contract.hbs 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. {{~#*inline "typed-variable-array"~}}
  2. {{#each .}}{{typeName}}{{#if name}} {{name}}{{/if}}{{#unless @last}}, {{/unless}}{{/each}}
  3. {{~/inline~}}
  4. {{#each linkable}}
  5. :{{name}}: pass:normal[xref:#{{anchor}}[`++{{name}}++`]]
  6. {{/each}}
  7. [.contract]
  8. [[{{anchor}}]]
  9. === `++{{name}}++` link:{{github-link file.path}}[{github-icon},role=heading-link]
  10. [.hljs-theme-light.nopadding]
  11. ```solidity
  12. import "@openzeppelin/contracts/{{file.path}}";
  13. ```
  14. {{natspec.devdoc}}
  15. {{#if ownModifiers}}
  16. [.contract-index]
  17. .Modifiers
  18. --
  19. {{#each ownModifiers}}
  20. * {xref-{{slug anchor~}} }[`++{{name}}({{args.names}})++`]
  21. {{/each}}
  22. --
  23. {{/if}}
  24. {{#if functions}}
  25. [.contract-index]
  26. .Functions
  27. --
  28. {{#each inheritedItems}}
  29. {{#if (or @first (ne contract.name "Context"))}}
  30. {{#unless @first}}
  31. [.contract-subindex-inherited]
  32. .{{contract.name}}
  33. {{/unless}}
  34. {{#each functions}}
  35. * {xref-{{slug anchor~}} }[`++{{name}}({{args.names}})++`]
  36. {{/each}}
  37. {{/if}}
  38. {{/each}}
  39. --
  40. {{/if}}
  41. {{#if events}}
  42. [.contract-index]
  43. .Events
  44. --
  45. {{#each inheritedItems}}
  46. {{#unless @first}}
  47. [.contract-subindex-inherited]
  48. .{{contract.name}}
  49. {{/unless}}
  50. {{#each events}}
  51. * {xref-{{slug anchor~}} }[`++{{name}}({{args.names}})++`]
  52. {{/each}}
  53. {{/each}}
  54. --
  55. {{/if}}
  56. {{#each ownModifiers}}
  57. [.contract-item]
  58. [[{{anchor}}]]
  59. ==== `[.contract-item-name]#++{{name}}++#++({{> typed-variable-array args}})++` [.item-kind]#modifier#
  60. {{natspec.devdoc}}
  61. {{/each}}
  62. {{#each ownFunctions}}
  63. [.contract-item]
  64. [[{{anchor}}]]
  65. ==== `[.contract-item-name]#++{{name}}++#++({{> typed-variable-array args}}){{#if outputs}} → {{> typed-variable-array outputs}}{{/if}}++` [.item-kind]#{{visibility}}#
  66. {{natspec.devdoc}}
  67. {{/each}}
  68. {{#each ownEvents}}
  69. [.contract-item]
  70. [[{{anchor}}]]
  71. ==== `[.contract-item-name]#++{{name}}++#++({{> typed-variable-array args}})++` [.item-kind]#event#
  72. {{natspec.devdoc}}
  73. {{/each}}