original.sol 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  1. pragma solidity ^0.8.13;
  2. /// @title A Hello world example
  3. contract HelloWorld {
  4. /// Some example struct
  5. struct Person {
  6. uint age;
  7. address wallet;
  8. }
  9. /**
  10. Here's a more double asterix comment
  11. */
  12. Person public theDude;
  13. /// Constructs the dude
  14. /// @param age The dude's age
  15. constructor(uint256 age) {
  16. theDude = Person({
  17. age: age,
  18. wallet: msg.sender
  19. });
  20. }
  21. /** @dev does nothing */
  22. function example() public {
  23. /**
  24. * Does this add a whitespace error?
  25. *
  26. * Let's find out.
  27. */
  28. }
  29. /** @dev Calculates a rectangle's surface and perimeter.
  30. * @param w Width of the rectangle.
  31. * @param h Height of the rectangle.
  32. * @return s The calculated surface.
  33. * @return p The calculated perimeter.
  34. */
  35. function rectangle(uint256 w, uint256 h) public pure returns (uint256 s, uint256 p) {
  36. s = w * h;
  37. p = 2 * (w + h);
  38. }
  39. /// A long doc line comment that will be wrapped
  40. function docLineOverflow() external {}
  41. function docLinePostfixOverflow() external {} /// A long doc line comment that will be wrapped
  42. /**
  43. * @notice Here is my comment
  44. * - item 1
  45. * - item 2
  46. * Some equations:
  47. * y = mx + b
  48. */
  49. function anotherExample() external {}
  50. /**
  51. contract A {
  52. function foo() public {
  53. // does nothing.
  54. }
  55. }
  56. */
  57. function multilineIndent() external {}
  58. /**
  59. contract A {
  60. function foo() public {
  61. // does nothing.
  62. }
  63. }
  64. */
  65. function multilineMalformedIndent() external {}
  66. /**
  67. contract A {
  68. function withALongNameThatWillCauseCommentWrap() public {
  69. // does nothing.
  70. }
  71. }
  72. */
  73. function malformedIndentOverflow() external {}
  74. }
  75. /**
  76. contract A {
  77. function foo() public {
  78. // does nothing.
  79. }
  80. }
  81. */
  82. function freeFloatingMultilineIndent() {}