fmt.sol 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. interface ITarget {
  2. function run() external payable;
  3. function veryAndVeryLongNameOfSomeRunFunction() external payable;
  4. }
  5. contract FunctionCallArgsStatement {
  6. ITarget public target;
  7. function estimate() public returns (uint256 gas) {
  8. gas = 1 gwei;
  9. }
  10. function veryAndVeryLongNameOfSomeGasEstimateFunction()
  11. public
  12. returns (uint256)
  13. {
  14. return gasleft();
  15. }
  16. function value(uint256 val) public returns (uint256) {
  17. return val;
  18. }
  19. function test() external {
  20. target.run{gas: gasleft(), value: 1 wei};
  21. target.run{gas: 1, value: 0x00}();
  22. target.run{gas: 1000, value: 1 ether}();
  23. target.run{gas: estimate(), value: value(1)}();
  24. target.run{
  25. value: value(1 ether),
  26. gas: veryAndVeryLongNameOfSomeGasEstimateFunction()
  27. }();
  28. target.run{ /* comment 1 */ value: /* comment2 */ 1};
  29. target.run{ /* comment3 */
  30. value: 1, // comment4
  31. gas: gasleft()
  32. };
  33. target.run{
  34. // comment5
  35. value: 1,
  36. // comment6
  37. gas: gasleft()
  38. };
  39. vm.expectEmit({checkTopic1: false, checkTopic2: false});
  40. }
  41. }