bracket-spacing.fmt.sol 1.3 KB

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