interfaces.adoc 45 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962
  1. :github-icon: pass:[<svg class="icon"><use href="#github-icon"/></svg>]
  2. :IERC20: pass:normal[xref:token/ERC20.adoc#IERC20[`IERC20`]]
  3. :IERC20Metadata: pass:normal[xref:token/ERC20.adoc#IERC20Metadata[`IERC20Metadata`]]
  4. :IERC165: pass:normal[xref:utils.adoc#IERC165[`IERC165`]]
  5. :IERC721: pass:normal[xref:token/ERC721.adoc#IERC721[`IERC721`]]
  6. :IERC721Receiver: pass:normal[xref:token/ERC721.adoc#IERC721Receiver[`IERC721Receiver`]]
  7. :IERC721Enumerable: pass:normal[xref:token/ERC721.adoc#IERC721Enumerable[`IERC721Enumerable`]]
  8. :IERC721Metadata: pass:normal[xref:token/ERC721.adoc#IERC721Metadata[`IERC721Metadata`]]
  9. :IERC777: pass:normal[xref:token/ERC777.adoc#IERC777[`IERC777`]]
  10. :IERC777Recipient: pass:normal[xref:token/ERC777.adoc#IERC777Recipient[`IERC777Recipient`]]
  11. :IERC777Sender: pass:normal[xref:token/ERC777.adoc#IERC777Sender[`IERC777Sender`]]
  12. :IERC1155: pass:normal[xref:token/ERC1155.adoc#IERC1155[`IERC1155`]]
  13. :IERC1155Receiver: pass:normal[xref:token/ERC1155.adoc#IERC1155Receiver[`IERC1155Receiver`]]
  14. :IERC1155MetadataURI: pass:normal[xref:token/ERC1155.adoc#IERC1155MetadataURI[`IERC1155MetadataURI`]]
  15. :IERC1271: pass:normal[xref:interfaces.adoc#IERC1271[`IERC1271`]]
  16. :IERC1363: pass:normal[xref:interfaces.adoc#IERC1363[`IERC1363`]]
  17. :IERC1363Receiver: pass:normal[xref:interfaces.adoc#IERC1363Receiver[`IERC1363Receiver`]]
  18. :IERC1363Spender: pass:normal[xref:interfaces.adoc#IERC1363Spender[`IERC1363Spender`]]
  19. :IERC1820Implementer: pass:normal[xref:utils.adoc#IERC1820Implementer[`IERC1820Implementer`]]
  20. :IERC1820Registry: pass:normal[xref:utils.adoc#IERC1820Registry[`IERC1820Registry`]]
  21. :IERC1822Proxiable: pass:normal[xref:interfaces.adoc#IERC1822Proxiable[`IERC1822Proxiable`]]
  22. :IERC2612: pass:normal[xref:interfaces.adoc#IERC2612[`IERC2612`]]
  23. :IERC2981: pass:normal[xref:interfaces.adoc#IERC2981[`IERC2981`]]
  24. :IERC3156FlashLender: pass:normal[xref:interfaces.adoc#IERC3156FlashLender[`IERC3156FlashLender`]]
  25. :IERC3156FlashBorrower: pass:normal[xref:interfaces.adoc#IERC3156FlashBorrower[`IERC3156FlashBorrower`]]
  26. :IERC4626: pass:normal[xref:interfaces.adoc#IERC4626[`IERC4626`]]
  27. :IERC4906: pass:normal[xref:interfaces.adoc#IERC4906[`IERC4906`]]
  28. :IERC5267: pass:normal[xref:interfaces.adoc#IERC5267[`IERC5267`]]
  29. :IERC5313: pass:normal[xref:interfaces.adoc#IERC5313[`IERC5313`]]
  30. :IERC5805: pass:normal[xref:interfaces.adoc#IERC5805[`IERC5805`]]
  31. :IERC6372: pass:normal[xref:interfaces.adoc#IERC6372[`IERC6372`]]
  32. :xref-IERC1271-isValidSignature-bytes32-bytes-: xref:interfaces.adoc#IERC1271-isValidSignature-bytes32-bytes-
  33. :xref-IERC1363-transferAndCall-address-uint256-: xref:interfaces.adoc#IERC1363-transferAndCall-address-uint256-
  34. :xref-IERC1363-transferAndCall-address-uint256-bytes-: xref:interfaces.adoc#IERC1363-transferAndCall-address-uint256-bytes-
  35. :xref-IERC1363-transferFromAndCall-address-address-uint256-: xref:interfaces.adoc#IERC1363-transferFromAndCall-address-address-uint256-
  36. :xref-IERC1363-transferFromAndCall-address-address-uint256-bytes-: xref:interfaces.adoc#IERC1363-transferFromAndCall-address-address-uint256-bytes-
  37. :xref-IERC1363-approveAndCall-address-uint256-: xref:interfaces.adoc#IERC1363-approveAndCall-address-uint256-
  38. :xref-IERC1363-approveAndCall-address-uint256-bytes-: xref:interfaces.adoc#IERC1363-approveAndCall-address-uint256-bytes-
  39. :xref-IERC20-totalSupply--: xref:token/ERC20.adoc#IERC20-totalSupply--
  40. :xref-IERC20-balanceOf-address-: xref:token/ERC20.adoc#IERC20-balanceOf-address-
  41. :xref-IERC20-transfer-address-uint256-: xref:token/ERC20.adoc#IERC20-transfer-address-uint256-
  42. :xref-IERC20-allowance-address-address-: xref:token/ERC20.adoc#IERC20-allowance-address-address-
  43. :xref-IERC20-approve-address-uint256-: xref:token/ERC20.adoc#IERC20-approve-address-uint256-
  44. :xref-IERC20-transferFrom-address-address-uint256-: xref:token/ERC20.adoc#IERC20-transferFrom-address-address-uint256-
  45. :xref-IERC165-supportsInterface-bytes4-: xref:utils.adoc#IERC165-supportsInterface-bytes4-
  46. :xref-IERC20-Transfer-address-address-uint256-: xref:token/ERC20.adoc#IERC20-Transfer-address-address-uint256-
  47. :xref-IERC20-Approval-address-address-uint256-: xref:token/ERC20.adoc#IERC20-Approval-address-address-uint256-
  48. :IERC1363-transferAndCall: pass:normal[xref:interfaces.adoc#IERC1363-transferAndCall-address-uint256-bytes-[`IERC1363.transferAndCall`]]
  49. :IERC1363-transferFromAndCall: pass:normal[xref:interfaces.adoc#IERC1363-transferFromAndCall-address-address-uint256-bytes-[`IERC1363.transferFromAndCall`]]
  50. :xref-IERC1363Receiver-onTransferReceived-address-address-uint256-bytes-: xref:interfaces.adoc#IERC1363Receiver-onTransferReceived-address-address-uint256-bytes-
  51. :IERC1363-approveAndCall: pass:normal[xref:interfaces.adoc#IERC1363-approveAndCall-address-uint256-bytes-[`IERC1363.approveAndCall`]]
  52. :xref-IERC1363Spender-onApprovalReceived-address-uint256-bytes-: xref:interfaces.adoc#IERC1363Spender-onApprovalReceived-address-uint256-bytes-
  53. :xref-IERC1822Proxiable-proxiableUUID--: xref:interfaces.adoc#IERC1822Proxiable-proxiableUUID--
  54. :xref-IERC20Permit-permit-address-address-uint256-uint256-uint8-bytes32-bytes32-: xref:token/ERC20.adoc#IERC20Permit-permit-address-address-uint256-uint256-uint8-bytes32-bytes32-
  55. :xref-IERC20Permit-nonces-address-: xref:token/ERC20.adoc#IERC20Permit-nonces-address-
  56. :xref-IERC20Permit-DOMAIN_SEPARATOR--: xref:token/ERC20.adoc#IERC20Permit-DOMAIN_SEPARATOR--
  57. :xref-IERC2981-royaltyInfo-uint256-uint256-: xref:interfaces.adoc#IERC2981-royaltyInfo-uint256-uint256-
  58. :xref-IERC165-supportsInterface-bytes4-: xref:utils.adoc#IERC165-supportsInterface-bytes4-
  59. :xref-IERC3156FlashLender-maxFlashLoan-address-: xref:interfaces.adoc#IERC3156FlashLender-maxFlashLoan-address-
  60. :xref-IERC3156FlashLender-flashFee-address-uint256-: xref:interfaces.adoc#IERC3156FlashLender-flashFee-address-uint256-
  61. :xref-IERC3156FlashLender-flashLoan-contract-IERC3156FlashBorrower-address-uint256-bytes-: xref:interfaces.adoc#IERC3156FlashLender-flashLoan-contract-IERC3156FlashBorrower-address-uint256-bytes-
  62. :xref-IERC3156FlashBorrower-onFlashLoan-address-address-uint256-uint256-bytes-: xref:interfaces.adoc#IERC3156FlashBorrower-onFlashLoan-address-address-uint256-uint256-bytes-
  63. :xref-IERC4626-asset--: xref:interfaces.adoc#IERC4626-asset--
  64. :xref-IERC4626-totalAssets--: xref:interfaces.adoc#IERC4626-totalAssets--
  65. :xref-IERC4626-convertToShares-uint256-: xref:interfaces.adoc#IERC4626-convertToShares-uint256-
  66. :xref-IERC4626-convertToAssets-uint256-: xref:interfaces.adoc#IERC4626-convertToAssets-uint256-
  67. :xref-IERC4626-maxDeposit-address-: xref:interfaces.adoc#IERC4626-maxDeposit-address-
  68. :xref-IERC4626-previewDeposit-uint256-: xref:interfaces.adoc#IERC4626-previewDeposit-uint256-
  69. :xref-IERC4626-deposit-uint256-address-: xref:interfaces.adoc#IERC4626-deposit-uint256-address-
  70. :xref-IERC4626-maxMint-address-: xref:interfaces.adoc#IERC4626-maxMint-address-
  71. :xref-IERC4626-previewMint-uint256-: xref:interfaces.adoc#IERC4626-previewMint-uint256-
  72. :xref-IERC4626-mint-uint256-address-: xref:interfaces.adoc#IERC4626-mint-uint256-address-
  73. :xref-IERC4626-maxWithdraw-address-: xref:interfaces.adoc#IERC4626-maxWithdraw-address-
  74. :xref-IERC4626-previewWithdraw-uint256-: xref:interfaces.adoc#IERC4626-previewWithdraw-uint256-
  75. :xref-IERC4626-withdraw-uint256-address-address-: xref:interfaces.adoc#IERC4626-withdraw-uint256-address-address-
  76. :xref-IERC4626-maxRedeem-address-: xref:interfaces.adoc#IERC4626-maxRedeem-address-
  77. :xref-IERC4626-previewRedeem-uint256-: xref:interfaces.adoc#IERC4626-previewRedeem-uint256-
  78. :xref-IERC4626-redeem-uint256-address-address-: xref:interfaces.adoc#IERC4626-redeem-uint256-address-address-
  79. :xref-IERC20Metadata-name--: xref:token/ERC20.adoc#IERC20Metadata-name--
  80. :xref-IERC20Metadata-symbol--: xref:token/ERC20.adoc#IERC20Metadata-symbol--
  81. :xref-IERC20Metadata-decimals--: xref:token/ERC20.adoc#IERC20Metadata-decimals--
  82. :xref-IERC20-totalSupply--: xref:token/ERC20.adoc#IERC20-totalSupply--
  83. :xref-IERC20-balanceOf-address-: xref:token/ERC20.adoc#IERC20-balanceOf-address-
  84. :xref-IERC20-transfer-address-uint256-: xref:token/ERC20.adoc#IERC20-transfer-address-uint256-
  85. :xref-IERC20-allowance-address-address-: xref:token/ERC20.adoc#IERC20-allowance-address-address-
  86. :xref-IERC20-approve-address-uint256-: xref:token/ERC20.adoc#IERC20-approve-address-uint256-
  87. :xref-IERC20-transferFrom-address-address-uint256-: xref:token/ERC20.adoc#IERC20-transferFrom-address-address-uint256-
  88. :xref-IERC4626-Deposit-address-address-uint256-uint256-: xref:interfaces.adoc#IERC4626-Deposit-address-address-uint256-uint256-
  89. :xref-IERC4626-Withdraw-address-address-address-uint256-uint256-: xref:interfaces.adoc#IERC4626-Withdraw-address-address-address-uint256-uint256-
  90. :xref-IERC20-Transfer-address-address-uint256-: xref:token/ERC20.adoc#IERC20-Transfer-address-address-uint256-
  91. :xref-IERC20-Approval-address-address-uint256-: xref:token/ERC20.adoc#IERC20-Approval-address-address-uint256-
  92. :xref-IERC5313-owner--: xref:interfaces.adoc#IERC5313-owner--
  93. :xref-IERC5267-eip712Domain--: xref:interfaces.adoc#IERC5267-eip712Domain--
  94. :xref-IERC5267-EIP712DomainChanged--: xref:interfaces.adoc#IERC5267-EIP712DomainChanged--
  95. :xref-IVotes-getVotes-address-: xref:governance.adoc#IVotes-getVotes-address-
  96. :xref-IVotes-getPastVotes-address-uint256-: xref:governance.adoc#IVotes-getPastVotes-address-uint256-
  97. :xref-IVotes-getPastTotalSupply-uint256-: xref:governance.adoc#IVotes-getPastTotalSupply-uint256-
  98. :xref-IVotes-delegates-address-: xref:governance.adoc#IVotes-delegates-address-
  99. :xref-IVotes-delegate-address-: xref:governance.adoc#IVotes-delegate-address-
  100. :xref-IVotes-delegateBySig-address-uint256-uint256-uint8-bytes32-bytes32-: xref:governance.adoc#IVotes-delegateBySig-address-uint256-uint256-uint8-bytes32-bytes32-
  101. :xref-IERC6372-clock--: xref:interfaces.adoc#IERC6372-clock--
  102. :xref-IERC6372-CLOCK_MODE--: xref:interfaces.adoc#IERC6372-CLOCK_MODE--
  103. :xref-IVotes-DelegateChanged-address-address-address-: xref:governance.adoc#IVotes-DelegateChanged-address-address-address-
  104. :xref-IVotes-DelegateVotesChanged-address-uint256-uint256-: xref:governance.adoc#IVotes-DelegateVotesChanged-address-uint256-uint256-
  105. :xref-IERC6372-clock--: xref:interfaces.adoc#IERC6372-clock--
  106. :xref-IERC6372-CLOCK_MODE--: xref:interfaces.adoc#IERC6372-CLOCK_MODE--
  107. = Interfaces
  108. [.readme-notice]
  109. NOTE: This document is better viewed at https://docs.openzeppelin.com/contracts/api/interfaces
  110. == List of standardized interfaces
  111. These interfaces are available as `.sol` files, and also as compiler `.json` ABI files (through the npm package). These
  112. are useful to interact with third party contracts that implement them.
  113. - {IERC20}
  114. - {IERC20Metadata}
  115. - {IERC165}
  116. - {IERC721}
  117. - {IERC721Receiver}
  118. - {IERC721Enumerable}
  119. - {IERC721Metadata}
  120. - {IERC777}
  121. - {IERC777Recipient}
  122. - {IERC777Sender}
  123. - {IERC1155}
  124. - {IERC1155Receiver}
  125. - {IERC1155MetadataURI}
  126. - {IERC1271}
  127. - {IERC1363}
  128. - {IERC1363Receiver}
  129. - {IERC1363Spender}
  130. - {IERC1820Implementer}
  131. - {IERC1820Registry}
  132. - {IERC1822Proxiable}
  133. - {IERC2612}
  134. - {IERC2981}
  135. - {IERC3156FlashLender}
  136. - {IERC3156FlashBorrower}
  137. - {IERC4626}
  138. - {IERC4906}
  139. - {IERC5267}
  140. - {IERC5313}
  141. - {IERC5805}
  142. - {IERC6372}
  143. == Detailed ABI
  144. :isValidSignature: pass:normal[xref:#IERC1271-isValidSignature-bytes32-bytes-[`++isValidSignature++`]]
  145. [.contract]
  146. [[IERC1271]]
  147. === `++IERC1271++` link:https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.9.3/contracts/interfaces/IERC1271.sol[{github-icon},role=heading-link]
  148. [.hljs-theme-light.nopadding]
  149. ```solidity
  150. import "@openzeppelin/contracts/interfaces/IERC1271.sol";
  151. ```
  152. Interface of the ERC1271 standard signature validation method for
  153. contracts as defined in https://eips.ethereum.org/EIPS/eip-1271[ERC-1271].
  154. _Available since v4.1._
  155. [.contract-index]
  156. .Functions
  157. --
  158. * {xref-IERC1271-isValidSignature-bytes32-bytes-}[`++isValidSignature(hash, signature)++`]
  159. --
  160. [.contract-item]
  161. [[IERC1271-isValidSignature-bytes32-bytes-]]
  162. ==== `[.contract-item-name]#++isValidSignature++#++(bytes32 hash, bytes signature) → bytes4 magicValue++` [.item-kind]#external#
  163. Should return whether the signature provided is valid for the provided data
  164. :transferAndCall: pass:normal[xref:#IERC1363-transferAndCall-address-uint256-[`++transferAndCall++`]]
  165. :transferAndCall: pass:normal[xref:#IERC1363-transferAndCall-address-uint256-bytes-[`++transferAndCall++`]]
  166. :transferFromAndCall: pass:normal[xref:#IERC1363-transferFromAndCall-address-address-uint256-[`++transferFromAndCall++`]]
  167. :transferFromAndCall: pass:normal[xref:#IERC1363-transferFromAndCall-address-address-uint256-bytes-[`++transferFromAndCall++`]]
  168. :approveAndCall: pass:normal[xref:#IERC1363-approveAndCall-address-uint256-[`++approveAndCall++`]]
  169. :approveAndCall: pass:normal[xref:#IERC1363-approveAndCall-address-uint256-bytes-[`++approveAndCall++`]]
  170. [.contract]
  171. [[IERC1363]]
  172. === `++IERC1363++` link:https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.9.3/contracts/interfaces/IERC1363.sol[{github-icon},role=heading-link]
  173. [.hljs-theme-light.nopadding]
  174. ```solidity
  175. import "@openzeppelin/contracts/interfaces/IERC1363.sol";
  176. ```
  177. Interface of an ERC1363 compliant contract, as defined in the
  178. https://eips.ethereum.org/EIPS/eip-1363[EIP].
  179. Defines a interface for ERC20 tokens that supports executing recipient
  180. code after `transfer` or `transferFrom`, or spender code after `approve`.
  181. [.contract-index]
  182. .Functions
  183. --
  184. * {xref-IERC1363-transferAndCall-address-uint256-}[`++transferAndCall(to, amount)++`]
  185. * {xref-IERC1363-transferAndCall-address-uint256-bytes-}[`++transferAndCall(to, amount, data)++`]
  186. * {xref-IERC1363-transferFromAndCall-address-address-uint256-}[`++transferFromAndCall(from, to, amount)++`]
  187. * {xref-IERC1363-transferFromAndCall-address-address-uint256-bytes-}[`++transferFromAndCall(from, to, amount, data)++`]
  188. * {xref-IERC1363-approveAndCall-address-uint256-}[`++approveAndCall(spender, amount)++`]
  189. * {xref-IERC1363-approveAndCall-address-uint256-bytes-}[`++approveAndCall(spender, amount, data)++`]
  190. [.contract-subindex-inherited]
  191. .IERC20
  192. * {xref-IERC20-totalSupply--}[`++totalSupply()++`]
  193. * {xref-IERC20-balanceOf-address-}[`++balanceOf(account)++`]
  194. * {xref-IERC20-transfer-address-uint256-}[`++transfer(to, amount)++`]
  195. * {xref-IERC20-allowance-address-address-}[`++allowance(owner, spender)++`]
  196. * {xref-IERC20-approve-address-uint256-}[`++approve(spender, amount)++`]
  197. * {xref-IERC20-transferFrom-address-address-uint256-}[`++transferFrom(from, to, amount)++`]
  198. [.contract-subindex-inherited]
  199. .IERC165
  200. * {xref-IERC165-supportsInterface-bytes4-}[`++supportsInterface(interfaceId)++`]
  201. --
  202. [.contract-index]
  203. .Events
  204. --
  205. [.contract-subindex-inherited]
  206. .IERC20
  207. * {xref-IERC20-Transfer-address-address-uint256-}[`++Transfer(from, to, value)++`]
  208. * {xref-IERC20-Approval-address-address-uint256-}[`++Approval(owner, spender, value)++`]
  209. [.contract-subindex-inherited]
  210. .IERC165
  211. --
  212. [.contract-item]
  213. [[IERC1363-transferAndCall-address-uint256-]]
  214. ==== `[.contract-item-name]#++transferAndCall++#++(address to, uint256 amount) → bool++` [.item-kind]#external#
  215. Transfer tokens from `msg.sender` to another address and then call `onTransferReceived` on receiver
  216. [.contract-item]
  217. [[IERC1363-transferAndCall-address-uint256-bytes-]]
  218. ==== `[.contract-item-name]#++transferAndCall++#++(address to, uint256 amount, bytes data) → bool++` [.item-kind]#external#
  219. Transfer tokens from `msg.sender` to another address and then call `onTransferReceived` on receiver
  220. [.contract-item]
  221. [[IERC1363-transferFromAndCall-address-address-uint256-]]
  222. ==== `[.contract-item-name]#++transferFromAndCall++#++(address from, address to, uint256 amount) → bool++` [.item-kind]#external#
  223. Transfer tokens from one address to another and then call `onTransferReceived` on receiver
  224. [.contract-item]
  225. [[IERC1363-transferFromAndCall-address-address-uint256-bytes-]]
  226. ==== `[.contract-item-name]#++transferFromAndCall++#++(address from, address to, uint256 amount, bytes data) → bool++` [.item-kind]#external#
  227. Transfer tokens from one address to another and then call `onTransferReceived` on receiver
  228. [.contract-item]
  229. [[IERC1363-approveAndCall-address-uint256-]]
  230. ==== `[.contract-item-name]#++approveAndCall++#++(address spender, uint256 amount) → bool++` [.item-kind]#external#
  231. Approve the passed address to spend the specified amount of tokens on behalf of msg.sender
  232. and then call `onApprovalReceived` on spender.
  233. [.contract-item]
  234. [[IERC1363-approveAndCall-address-uint256-bytes-]]
  235. ==== `[.contract-item-name]#++approveAndCall++#++(address spender, uint256 amount, bytes data) → bool++` [.item-kind]#external#
  236. Approve the passed address to spend the specified amount of tokens on behalf of msg.sender
  237. and then call `onApprovalReceived` on spender.
  238. :onTransferReceived: pass:normal[xref:#IERC1363Receiver-onTransferReceived-address-address-uint256-bytes-[`++onTransferReceived++`]]
  239. [.contract]
  240. [[IERC1363Receiver]]
  241. === `++IERC1363Receiver++` link:https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.9.3/contracts/interfaces/IERC1363Receiver.sol[{github-icon},role=heading-link]
  242. [.hljs-theme-light.nopadding]
  243. ```solidity
  244. import "@openzeppelin/contracts/interfaces/IERC1363Receiver.sol";
  245. ```
  246. Interface for any contract that wants to support {IERC1363-transferAndCall}
  247. or {IERC1363-transferFromAndCall} from {ERC1363} token contracts.
  248. [.contract-index]
  249. .Functions
  250. --
  251. * {xref-IERC1363Receiver-onTransferReceived-address-address-uint256-bytes-}[`++onTransferReceived(operator, from, amount, data)++`]
  252. --
  253. [.contract-item]
  254. [[IERC1363Receiver-onTransferReceived-address-address-uint256-bytes-]]
  255. ==== `[.contract-item-name]#++onTransferReceived++#++(address operator, address from, uint256 amount, bytes data) → bytes4++` [.item-kind]#external#
  256. Any ERC1363 smart contract calls this function on the recipient
  257. after a `transfer` or a `transferFrom`. This function MAY throw to revert and reject the
  258. transfer. Return of other than the magic value MUST result in the
  259. transaction being reverted.
  260. Note: the token contract address is always the message sender.
  261. :onApprovalReceived: pass:normal[xref:#IERC1363Spender-onApprovalReceived-address-uint256-bytes-[`++onApprovalReceived++`]]
  262. [.contract]
  263. [[IERC1363Spender]]
  264. === `++IERC1363Spender++` link:https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.9.3/contracts/interfaces/IERC1363Spender.sol[{github-icon},role=heading-link]
  265. [.hljs-theme-light.nopadding]
  266. ```solidity
  267. import "@openzeppelin/contracts/interfaces/IERC1363Spender.sol";
  268. ```
  269. Interface for any contract that wants to support {IERC1363-approveAndCall}
  270. from {ERC1363} token contracts.
  271. [.contract-index]
  272. .Functions
  273. --
  274. * {xref-IERC1363Spender-onApprovalReceived-address-uint256-bytes-}[`++onApprovalReceived(owner, amount, data)++`]
  275. --
  276. [.contract-item]
  277. [[IERC1363Spender-onApprovalReceived-address-uint256-bytes-]]
  278. ==== `[.contract-item-name]#++onApprovalReceived++#++(address owner, uint256 amount, bytes data) → bytes4++` [.item-kind]#external#
  279. Any ERC1363 smart contract calls this function on the recipient
  280. after an `approve`. This function MAY throw to revert and reject the
  281. approval. Return of other than the magic value MUST result in the
  282. transaction being reverted.
  283. Note: the token contract address is always the message sender.
  284. :proxiableUUID: pass:normal[xref:#IERC1822Proxiable-proxiableUUID--[`++proxiableUUID++`]]
  285. [.contract]
  286. [[IERC1822Proxiable]]
  287. === `++IERC1822Proxiable++` link:https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.9.3/contracts/interfaces/draft-IERC1822.sol[{github-icon},role=heading-link]
  288. [.hljs-theme-light.nopadding]
  289. ```solidity
  290. import "@openzeppelin/contracts/interfaces/draft-IERC1822.sol";
  291. ```
  292. ERC1822: Universal Upgradeable Proxy Standard (UUPS) documents a method for upgradeability through a simplified
  293. proxy whose upgrades are fully controlled by the current implementation.
  294. [.contract-index]
  295. .Functions
  296. --
  297. * {xref-IERC1822Proxiable-proxiableUUID--}[`++proxiableUUID()++`]
  298. --
  299. [.contract-item]
  300. [[IERC1822Proxiable-proxiableUUID--]]
  301. ==== `[.contract-item-name]#++proxiableUUID++#++() → bytes32++` [.item-kind]#external#
  302. Returns the storage slot that the proxiable contract assumes is being used to store the implementation
  303. address.
  304. IMPORTANT: A proxy pointing at a proxiable contract should not be considered proxiable itself, because this risks
  305. bricking a proxy that upgrades to it, by delegating to itself until out of gas. Thus it is critical that this
  306. function revert if invoked through a proxy.
  307. [.contract]
  308. [[IERC2612]]
  309. === `++IERC2612++` link:https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.9.3/contracts/interfaces/IERC2612.sol[{github-icon},role=heading-link]
  310. [.hljs-theme-light.nopadding]
  311. ```solidity
  312. import "@openzeppelin/contracts/interfaces/IERC2612.sol";
  313. ```
  314. [.contract-index]
  315. .Functions
  316. --
  317. [.contract-subindex-inherited]
  318. .IERC20Permit
  319. * {xref-IERC20Permit-permit-address-address-uint256-uint256-uint8-bytes32-bytes32-}[`++permit(owner, spender, value, deadline, v, r, s)++`]
  320. * {xref-IERC20Permit-nonces-address-}[`++nonces(owner)++`]
  321. * {xref-IERC20Permit-DOMAIN_SEPARATOR--}[`++DOMAIN_SEPARATOR()++`]
  322. --
  323. :royaltyInfo: pass:normal[xref:#IERC2981-royaltyInfo-uint256-uint256-[`++royaltyInfo++`]]
  324. [.contract]
  325. [[IERC2981]]
  326. === `++IERC2981++` link:https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.9.3/contracts/interfaces/IERC2981.sol[{github-icon},role=heading-link]
  327. [.hljs-theme-light.nopadding]
  328. ```solidity
  329. import "@openzeppelin/contracts/interfaces/IERC2981.sol";
  330. ```
  331. Interface for the NFT Royalty Standard.
  332. A standardized way to retrieve royalty payment information for non-fungible tokens (NFTs) to enable universal
  333. support for royalty payments across all NFT marketplaces and ecosystem participants.
  334. _Available since v4.5._
  335. [.contract-index]
  336. .Functions
  337. --
  338. * {xref-IERC2981-royaltyInfo-uint256-uint256-}[`++royaltyInfo(tokenId, salePrice)++`]
  339. [.contract-subindex-inherited]
  340. .IERC165
  341. * {xref-IERC165-supportsInterface-bytes4-}[`++supportsInterface(interfaceId)++`]
  342. --
  343. [.contract-item]
  344. [[IERC2981-royaltyInfo-uint256-uint256-]]
  345. ==== `[.contract-item-name]#++royaltyInfo++#++(uint256 tokenId, uint256 salePrice) → address receiver, uint256 royaltyAmount++` [.item-kind]#external#
  346. Returns how much royalty is owed and to whom, based on a sale price that may be denominated in any unit of
  347. exchange. The royalty amount is denominated and should be paid in that same unit of exchange.
  348. :maxFlashLoan: pass:normal[xref:#IERC3156FlashLender-maxFlashLoan-address-[`++maxFlashLoan++`]]
  349. :flashFee: pass:normal[xref:#IERC3156FlashLender-flashFee-address-uint256-[`++flashFee++`]]
  350. :flashLoan: pass:normal[xref:#IERC3156FlashLender-flashLoan-contract-IERC3156FlashBorrower-address-uint256-bytes-[`++flashLoan++`]]
  351. [.contract]
  352. [[IERC3156FlashLender]]
  353. === `++IERC3156FlashLender++` link:https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.9.3/contracts/interfaces/IERC3156FlashLender.sol[{github-icon},role=heading-link]
  354. [.hljs-theme-light.nopadding]
  355. ```solidity
  356. import "@openzeppelin/contracts/interfaces/IERC3156FlashLender.sol";
  357. ```
  358. Interface of the ERC3156 FlashLender, as defined in
  359. https://eips.ethereum.org/EIPS/eip-3156[ERC-3156].
  360. _Available since v4.1._
  361. [.contract-index]
  362. .Functions
  363. --
  364. * {xref-IERC3156FlashLender-maxFlashLoan-address-}[`++maxFlashLoan(token)++`]
  365. * {xref-IERC3156FlashLender-flashFee-address-uint256-}[`++flashFee(token, amount)++`]
  366. * {xref-IERC3156FlashLender-flashLoan-contract-IERC3156FlashBorrower-address-uint256-bytes-}[`++flashLoan(receiver, token, amount, data)++`]
  367. --
  368. [.contract-item]
  369. [[IERC3156FlashLender-maxFlashLoan-address-]]
  370. ==== `[.contract-item-name]#++maxFlashLoan++#++(address token) → uint256++` [.item-kind]#external#
  371. The amount of currency available to be lended.
  372. [.contract-item]
  373. [[IERC3156FlashLender-flashFee-address-uint256-]]
  374. ==== `[.contract-item-name]#++flashFee++#++(address token, uint256 amount) → uint256++` [.item-kind]#external#
  375. The fee to be charged for a given loan.
  376. [.contract-item]
  377. [[IERC3156FlashLender-flashLoan-contract-IERC3156FlashBorrower-address-uint256-bytes-]]
  378. ==== `[.contract-item-name]#++flashLoan++#++(contract IERC3156FlashBorrower receiver, address token, uint256 amount, bytes data) → bool++` [.item-kind]#external#
  379. Initiate a flash loan.
  380. :onFlashLoan: pass:normal[xref:#IERC3156FlashBorrower-onFlashLoan-address-address-uint256-uint256-bytes-[`++onFlashLoan++`]]
  381. [.contract]
  382. [[IERC3156FlashBorrower]]
  383. === `++IERC3156FlashBorrower++` link:https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.9.3/contracts/interfaces/IERC3156FlashBorrower.sol[{github-icon},role=heading-link]
  384. [.hljs-theme-light.nopadding]
  385. ```solidity
  386. import "@openzeppelin/contracts/interfaces/IERC3156FlashBorrower.sol";
  387. ```
  388. Interface of the ERC3156 FlashBorrower, as defined in
  389. https://eips.ethereum.org/EIPS/eip-3156[ERC-3156].
  390. _Available since v4.1._
  391. [.contract-index]
  392. .Functions
  393. --
  394. * {xref-IERC3156FlashBorrower-onFlashLoan-address-address-uint256-uint256-bytes-}[`++onFlashLoan(initiator, token, amount, fee, data)++`]
  395. --
  396. [.contract-item]
  397. [[IERC3156FlashBorrower-onFlashLoan-address-address-uint256-uint256-bytes-]]
  398. ==== `[.contract-item-name]#++onFlashLoan++#++(address initiator, address token, uint256 amount, uint256 fee, bytes data) → bytes32++` [.item-kind]#external#
  399. Receive a flash loan.
  400. :Deposit: pass:normal[xref:#IERC4626-Deposit-address-address-uint256-uint256-[`++Deposit++`]]
  401. :Withdraw: pass:normal[xref:#IERC4626-Withdraw-address-address-address-uint256-uint256-[`++Withdraw++`]]
  402. :asset: pass:normal[xref:#IERC4626-asset--[`++asset++`]]
  403. :totalAssets: pass:normal[xref:#IERC4626-totalAssets--[`++totalAssets++`]]
  404. :convertToShares: pass:normal[xref:#IERC4626-convertToShares-uint256-[`++convertToShares++`]]
  405. :convertToAssets: pass:normal[xref:#IERC4626-convertToAssets-uint256-[`++convertToAssets++`]]
  406. :maxDeposit: pass:normal[xref:#IERC4626-maxDeposit-address-[`++maxDeposit++`]]
  407. :previewDeposit: pass:normal[xref:#IERC4626-previewDeposit-uint256-[`++previewDeposit++`]]
  408. :deposit: pass:normal[xref:#IERC4626-deposit-uint256-address-[`++deposit++`]]
  409. :maxMint: pass:normal[xref:#IERC4626-maxMint-address-[`++maxMint++`]]
  410. :previewMint: pass:normal[xref:#IERC4626-previewMint-uint256-[`++previewMint++`]]
  411. :mint: pass:normal[xref:#IERC4626-mint-uint256-address-[`++mint++`]]
  412. :maxWithdraw: pass:normal[xref:#IERC4626-maxWithdraw-address-[`++maxWithdraw++`]]
  413. :previewWithdraw: pass:normal[xref:#IERC4626-previewWithdraw-uint256-[`++previewWithdraw++`]]
  414. :withdraw: pass:normal[xref:#IERC4626-withdraw-uint256-address-address-[`++withdraw++`]]
  415. :maxRedeem: pass:normal[xref:#IERC4626-maxRedeem-address-[`++maxRedeem++`]]
  416. :previewRedeem: pass:normal[xref:#IERC4626-previewRedeem-uint256-[`++previewRedeem++`]]
  417. :redeem: pass:normal[xref:#IERC4626-redeem-uint256-address-address-[`++redeem++`]]
  418. [.contract]
  419. [[IERC4626]]
  420. === `++IERC4626++` link:https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.9.3/contracts/interfaces/IERC4626.sol[{github-icon},role=heading-link]
  421. [.hljs-theme-light.nopadding]
  422. ```solidity
  423. import "@openzeppelin/contracts/interfaces/IERC4626.sol";
  424. ```
  425. Interface of the ERC4626 "Tokenized Vault Standard", as defined in
  426. https://eips.ethereum.org/EIPS/eip-4626[ERC-4626].
  427. _Available since v4.7._
  428. [.contract-index]
  429. .Functions
  430. --
  431. * {xref-IERC4626-asset--}[`++asset()++`]
  432. * {xref-IERC4626-totalAssets--}[`++totalAssets()++`]
  433. * {xref-IERC4626-convertToShares-uint256-}[`++convertToShares(assets)++`]
  434. * {xref-IERC4626-convertToAssets-uint256-}[`++convertToAssets(shares)++`]
  435. * {xref-IERC4626-maxDeposit-address-}[`++maxDeposit(receiver)++`]
  436. * {xref-IERC4626-previewDeposit-uint256-}[`++previewDeposit(assets)++`]
  437. * {xref-IERC4626-deposit-uint256-address-}[`++deposit(assets, receiver)++`]
  438. * {xref-IERC4626-maxMint-address-}[`++maxMint(receiver)++`]
  439. * {xref-IERC4626-previewMint-uint256-}[`++previewMint(shares)++`]
  440. * {xref-IERC4626-mint-uint256-address-}[`++mint(shares, receiver)++`]
  441. * {xref-IERC4626-maxWithdraw-address-}[`++maxWithdraw(owner)++`]
  442. * {xref-IERC4626-previewWithdraw-uint256-}[`++previewWithdraw(assets)++`]
  443. * {xref-IERC4626-withdraw-uint256-address-address-}[`++withdraw(assets, receiver, owner)++`]
  444. * {xref-IERC4626-maxRedeem-address-}[`++maxRedeem(owner)++`]
  445. * {xref-IERC4626-previewRedeem-uint256-}[`++previewRedeem(shares)++`]
  446. * {xref-IERC4626-redeem-uint256-address-address-}[`++redeem(shares, receiver, owner)++`]
  447. [.contract-subindex-inherited]
  448. .IERC20Metadata
  449. * {xref-IERC20Metadata-name--}[`++name()++`]
  450. * {xref-IERC20Metadata-symbol--}[`++symbol()++`]
  451. * {xref-IERC20Metadata-decimals--}[`++decimals()++`]
  452. [.contract-subindex-inherited]
  453. .IERC20
  454. * {xref-IERC20-totalSupply--}[`++totalSupply()++`]
  455. * {xref-IERC20-balanceOf-address-}[`++balanceOf(account)++`]
  456. * {xref-IERC20-transfer-address-uint256-}[`++transfer(to, amount)++`]
  457. * {xref-IERC20-allowance-address-address-}[`++allowance(owner, spender)++`]
  458. * {xref-IERC20-approve-address-uint256-}[`++approve(spender, amount)++`]
  459. * {xref-IERC20-transferFrom-address-address-uint256-}[`++transferFrom(from, to, amount)++`]
  460. --
  461. [.contract-index]
  462. .Events
  463. --
  464. * {xref-IERC4626-Deposit-address-address-uint256-uint256-}[`++Deposit(sender, owner, assets, shares)++`]
  465. * {xref-IERC4626-Withdraw-address-address-address-uint256-uint256-}[`++Withdraw(sender, receiver, owner, assets, shares)++`]
  466. [.contract-subindex-inherited]
  467. .IERC20Metadata
  468. [.contract-subindex-inherited]
  469. .IERC20
  470. * {xref-IERC20-Transfer-address-address-uint256-}[`++Transfer(from, to, value)++`]
  471. * {xref-IERC20-Approval-address-address-uint256-}[`++Approval(owner, spender, value)++`]
  472. --
  473. [.contract-item]
  474. [[IERC4626-asset--]]
  475. ==== `[.contract-item-name]#++asset++#++() → address assetTokenAddress++` [.item-kind]#external#
  476. Returns the address of the underlying token used for the Vault for accounting, depositing, and withdrawing.
  477. - MUST be an ERC-20 token contract.
  478. - MUST NOT revert.
  479. [.contract-item]
  480. [[IERC4626-totalAssets--]]
  481. ==== `[.contract-item-name]#++totalAssets++#++() → uint256 totalManagedAssets++` [.item-kind]#external#
  482. Returns the total amount of the underlying asset that is “managed” by Vault.
  483. - SHOULD include any compounding that occurs from yield.
  484. - MUST be inclusive of any fees that are charged against assets in the Vault.
  485. - MUST NOT revert.
  486. [.contract-item]
  487. [[IERC4626-convertToShares-uint256-]]
  488. ==== `[.contract-item-name]#++convertToShares++#++(uint256 assets) → uint256 shares++` [.item-kind]#external#
  489. Returns the amount of shares that the Vault would exchange for the amount of assets provided, in an ideal
  490. scenario where all the conditions are met.
  491. - MUST NOT be inclusive of any fees that are charged against assets in the Vault.
  492. - MUST NOT show any variations depending on the caller.
  493. - MUST NOT reflect slippage or other on-chain conditions, when performing the actual exchange.
  494. - MUST NOT revert.
  495. NOTE: This calculation MAY NOT reflect the “per-user” price-per-share, and instead should reflect the
  496. “average-user’s” price-per-share, meaning what the average user should expect to see when exchanging to and
  497. from.
  498. [.contract-item]
  499. [[IERC4626-convertToAssets-uint256-]]
  500. ==== `[.contract-item-name]#++convertToAssets++#++(uint256 shares) → uint256 assets++` [.item-kind]#external#
  501. Returns the amount of assets that the Vault would exchange for the amount of shares provided, in an ideal
  502. scenario where all the conditions are met.
  503. - MUST NOT be inclusive of any fees that are charged against assets in the Vault.
  504. - MUST NOT show any variations depending on the caller.
  505. - MUST NOT reflect slippage or other on-chain conditions, when performing the actual exchange.
  506. - MUST NOT revert.
  507. NOTE: This calculation MAY NOT reflect the “per-user” price-per-share, and instead should reflect the
  508. “average-user’s” price-per-share, meaning what the average user should expect to see when exchanging to and
  509. from.
  510. [.contract-item]
  511. [[IERC4626-maxDeposit-address-]]
  512. ==== `[.contract-item-name]#++maxDeposit++#++(address receiver) → uint256 maxAssets++` [.item-kind]#external#
  513. Returns the maximum amount of the underlying asset that can be deposited into the Vault for the receiver,
  514. through a deposit call.
  515. - MUST return a limited value if receiver is subject to some deposit limit.
  516. - MUST return 2 ** 256 - 1 if there is no limit on the maximum amount of assets that may be deposited.
  517. - MUST NOT revert.
  518. [.contract-item]
  519. [[IERC4626-previewDeposit-uint256-]]
  520. ==== `[.contract-item-name]#++previewDeposit++#++(uint256 assets) → uint256 shares++` [.item-kind]#external#
  521. Allows an on-chain or off-chain user to simulate the effects of their deposit at the current block, given
  522. current on-chain conditions.
  523. - MUST return as close to and no more than the exact amount of Vault shares that would be minted in a deposit
  524. call in the same transaction. I.e. deposit should return the same or more shares as previewDeposit if called
  525. in the same transaction.
  526. - MUST NOT account for deposit limits like those returned from maxDeposit and should always act as though the
  527. deposit would be accepted, regardless if the user has enough tokens approved, etc.
  528. - MUST be inclusive of deposit fees. Integrators should be aware of the existence of deposit fees.
  529. - MUST NOT revert.
  530. NOTE: any unfavorable discrepancy between convertToShares and previewDeposit SHOULD be considered slippage in
  531. share price or some other type of condition, meaning the depositor will lose assets by depositing.
  532. [.contract-item]
  533. [[IERC4626-deposit-uint256-address-]]
  534. ==== `[.contract-item-name]#++deposit++#++(uint256 assets, address receiver) → uint256 shares++` [.item-kind]#external#
  535. Mints shares Vault shares to receiver by depositing exactly amount of underlying tokens.
  536. - MUST emit the Deposit event.
  537. - MAY support an additional flow in which the underlying tokens are owned by the Vault contract before the
  538. deposit execution, and are accounted for during deposit.
  539. - MUST revert if all of assets cannot be deposited (due to deposit limit being reached, slippage, the user not
  540. approving enough underlying tokens to the Vault contract, etc).
  541. NOTE: most implementations will require pre-approval of the Vault with the Vault’s underlying asset token.
  542. [.contract-item]
  543. [[IERC4626-maxMint-address-]]
  544. ==== `[.contract-item-name]#++maxMint++#++(address receiver) → uint256 maxShares++` [.item-kind]#external#
  545. Returns the maximum amount of the Vault shares that can be minted for the receiver, through a mint call.
  546. - MUST return a limited value if receiver is subject to some mint limit.
  547. - MUST return 2 ** 256 - 1 if there is no limit on the maximum amount of shares that may be minted.
  548. - MUST NOT revert.
  549. [.contract-item]
  550. [[IERC4626-previewMint-uint256-]]
  551. ==== `[.contract-item-name]#++previewMint++#++(uint256 shares) → uint256 assets++` [.item-kind]#external#
  552. Allows an on-chain or off-chain user to simulate the effects of their mint at the current block, given
  553. current on-chain conditions.
  554. - MUST return as close to and no fewer than the exact amount of assets that would be deposited in a mint call
  555. in the same transaction. I.e. mint should return the same or fewer assets as previewMint if called in the
  556. same transaction.
  557. - MUST NOT account for mint limits like those returned from maxMint and should always act as though the mint
  558. would be accepted, regardless if the user has enough tokens approved, etc.
  559. - MUST be inclusive of deposit fees. Integrators should be aware of the existence of deposit fees.
  560. - MUST NOT revert.
  561. NOTE: any unfavorable discrepancy between convertToAssets and previewMint SHOULD be considered slippage in
  562. share price or some other type of condition, meaning the depositor will lose assets by minting.
  563. [.contract-item]
  564. [[IERC4626-mint-uint256-address-]]
  565. ==== `[.contract-item-name]#++mint++#++(uint256 shares, address receiver) → uint256 assets++` [.item-kind]#external#
  566. Mints exactly shares Vault shares to receiver by depositing amount of underlying tokens.
  567. - MUST emit the Deposit event.
  568. - MAY support an additional flow in which the underlying tokens are owned by the Vault contract before the mint
  569. execution, and are accounted for during mint.
  570. - MUST revert if all of shares cannot be minted (due to deposit limit being reached, slippage, the user not
  571. approving enough underlying tokens to the Vault contract, etc).
  572. NOTE: most implementations will require pre-approval of the Vault with the Vault’s underlying asset token.
  573. [.contract-item]
  574. [[IERC4626-maxWithdraw-address-]]
  575. ==== `[.contract-item-name]#++maxWithdraw++#++(address owner) → uint256 maxAssets++` [.item-kind]#external#
  576. Returns the maximum amount of the underlying asset that can be withdrawn from the owner balance in the
  577. Vault, through a withdraw call.
  578. - MUST return a limited value if owner is subject to some withdrawal limit or timelock.
  579. - MUST NOT revert.
  580. [.contract-item]
  581. [[IERC4626-previewWithdraw-uint256-]]
  582. ==== `[.contract-item-name]#++previewWithdraw++#++(uint256 assets) → uint256 shares++` [.item-kind]#external#
  583. Allows an on-chain or off-chain user to simulate the effects of their withdrawal at the current block,
  584. given current on-chain conditions.
  585. - MUST return as close to and no fewer than the exact amount of Vault shares that would be burned in a withdraw
  586. call in the same transaction. I.e. withdraw should return the same or fewer shares as previewWithdraw if
  587. called
  588. in the same transaction.
  589. - MUST NOT account for withdrawal limits like those returned from maxWithdraw and should always act as though
  590. the withdrawal would be accepted, regardless if the user has enough shares, etc.
  591. - MUST be inclusive of withdrawal fees. Integrators should be aware of the existence of withdrawal fees.
  592. - MUST NOT revert.
  593. NOTE: any unfavorable discrepancy between convertToShares and previewWithdraw SHOULD be considered slippage in
  594. share price or some other type of condition, meaning the depositor will lose assets by depositing.
  595. [.contract-item]
  596. [[IERC4626-withdraw-uint256-address-address-]]
  597. ==== `[.contract-item-name]#++withdraw++#++(uint256 assets, address receiver, address owner) → uint256 shares++` [.item-kind]#external#
  598. Burns shares from owner and sends exactly assets of underlying tokens to receiver.
  599. - MUST emit the Withdraw event.
  600. - MAY support an additional flow in which the underlying tokens are owned by the Vault contract before the
  601. withdraw execution, and are accounted for during withdraw.
  602. - MUST revert if all of assets cannot be withdrawn (due to withdrawal limit being reached, slippage, the owner
  603. not having enough shares, etc).
  604. Note that some implementations will require pre-requesting to the Vault before a withdrawal may be performed.
  605. Those methods should be performed separately.
  606. [.contract-item]
  607. [[IERC4626-maxRedeem-address-]]
  608. ==== `[.contract-item-name]#++maxRedeem++#++(address owner) → uint256 maxShares++` [.item-kind]#external#
  609. Returns the maximum amount of Vault shares that can be redeemed from the owner balance in the Vault,
  610. through a redeem call.
  611. - MUST return a limited value if owner is subject to some withdrawal limit or timelock.
  612. - MUST return balanceOf(owner) if owner is not subject to any withdrawal limit or timelock.
  613. - MUST NOT revert.
  614. [.contract-item]
  615. [[IERC4626-previewRedeem-uint256-]]
  616. ==== `[.contract-item-name]#++previewRedeem++#++(uint256 shares) → uint256 assets++` [.item-kind]#external#
  617. Allows an on-chain or off-chain user to simulate the effects of their redeemption at the current block,
  618. given current on-chain conditions.
  619. - MUST return as close to and no more than the exact amount of assets that would be withdrawn in a redeem call
  620. in the same transaction. I.e. redeem should return the same or more assets as previewRedeem if called in the
  621. same transaction.
  622. - MUST NOT account for redemption limits like those returned from maxRedeem and should always act as though the
  623. redemption would be accepted, regardless if the user has enough shares, etc.
  624. - MUST be inclusive of withdrawal fees. Integrators should be aware of the existence of withdrawal fees.
  625. - MUST NOT revert.
  626. NOTE: any unfavorable discrepancy between convertToAssets and previewRedeem SHOULD be considered slippage in
  627. share price or some other type of condition, meaning the depositor will lose assets by redeeming.
  628. [.contract-item]
  629. [[IERC4626-redeem-uint256-address-address-]]
  630. ==== `[.contract-item-name]#++redeem++#++(uint256 shares, address receiver, address owner) → uint256 assets++` [.item-kind]#external#
  631. Burns exactly shares from owner and sends assets of underlying tokens to receiver.
  632. - MUST emit the Withdraw event.
  633. - MAY support an additional flow in which the underlying tokens are owned by the Vault contract before the
  634. redeem execution, and are accounted for during redeem.
  635. - MUST revert if all of shares cannot be redeemed (due to withdrawal limit being reached, slippage, the owner
  636. not having enough shares, etc).
  637. NOTE: some implementations will require pre-requesting to the Vault before a withdrawal may be performed.
  638. Those methods should be performed separately.
  639. [.contract-item]
  640. [[IERC4626-Deposit-address-address-uint256-uint256-]]
  641. ==== `[.contract-item-name]#++Deposit++#++(address indexed sender, address indexed owner, uint256 assets, uint256 shares)++` [.item-kind]#event#
  642. [.contract-item]
  643. [[IERC4626-Withdraw-address-address-address-uint256-uint256-]]
  644. ==== `[.contract-item-name]#++Withdraw++#++(address indexed sender, address indexed receiver, address indexed owner, uint256 assets, uint256 shares)++` [.item-kind]#event#
  645. :owner: pass:normal[xref:#IERC5313-owner--[`++owner++`]]
  646. [.contract]
  647. [[IERC5313]]
  648. === `++IERC5313++` link:https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.9.3/contracts/interfaces/IERC5313.sol[{github-icon},role=heading-link]
  649. [.hljs-theme-light.nopadding]
  650. ```solidity
  651. import "@openzeppelin/contracts/interfaces/IERC5313.sol";
  652. ```
  653. Interface for the Light Contract Ownership Standard.
  654. A standardized minimal interface required to identify an account that controls a contract
  655. _Available since v4.9._
  656. [.contract-index]
  657. .Functions
  658. --
  659. * {xref-IERC5313-owner--}[`++owner()++`]
  660. --
  661. [.contract-item]
  662. [[IERC5313-owner--]]
  663. ==== `[.contract-item-name]#++owner++#++() → address++` [.item-kind]#external#
  664. Gets the address of the owner.
  665. :EIP712DomainChanged: pass:normal[xref:#IERC5267-EIP712DomainChanged--[`++EIP712DomainChanged++`]]
  666. :eip712Domain: pass:normal[xref:#IERC5267-eip712Domain--[`++eip712Domain++`]]
  667. [.contract]
  668. [[IERC5267]]
  669. === `++IERC5267++` link:https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.9.3/contracts/interfaces/IERC5267.sol[{github-icon},role=heading-link]
  670. [.hljs-theme-light.nopadding]
  671. ```solidity
  672. import "@openzeppelin/contracts/interfaces/IERC5267.sol";
  673. ```
  674. [.contract-index]
  675. .Functions
  676. --
  677. * {xref-IERC5267-eip712Domain--}[`++eip712Domain()++`]
  678. --
  679. [.contract-index]
  680. .Events
  681. --
  682. * {xref-IERC5267-EIP712DomainChanged--}[`++EIP712DomainChanged()++`]
  683. --
  684. [.contract-item]
  685. [[IERC5267-eip712Domain--]]
  686. ==== `[.contract-item-name]#++eip712Domain++#++() → bytes1 fields, string name, string version, uint256 chainId, address verifyingContract, bytes32 salt, uint256[] extensions++` [.item-kind]#external#
  687. returns the fields and values that describe the domain separator used by this contract for EIP-712
  688. signature.
  689. [.contract-item]
  690. [[IERC5267-EIP712DomainChanged--]]
  691. ==== `[.contract-item-name]#++EIP712DomainChanged++#++()++` [.item-kind]#event#
  692. MAY be emitted to signal that the domain could have changed.
  693. [.contract]
  694. [[IERC5805]]
  695. === `++IERC5805++` link:https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.9.3/contracts/interfaces/IERC5805.sol[{github-icon},role=heading-link]
  696. [.hljs-theme-light.nopadding]
  697. ```solidity
  698. import "@openzeppelin/contracts/interfaces/IERC5805.sol";
  699. ```
  700. [.contract-index]
  701. .Functions
  702. --
  703. [.contract-subindex-inherited]
  704. .IVotes
  705. * {xref-IVotes-getVotes-address-}[`++getVotes(account)++`]
  706. * {xref-IVotes-getPastVotes-address-uint256-}[`++getPastVotes(account, timepoint)++`]
  707. * {xref-IVotes-getPastTotalSupply-uint256-}[`++getPastTotalSupply(timepoint)++`]
  708. * {xref-IVotes-delegates-address-}[`++delegates(account)++`]
  709. * {xref-IVotes-delegate-address-}[`++delegate(delegatee)++`]
  710. * {xref-IVotes-delegateBySig-address-uint256-uint256-uint8-bytes32-bytes32-}[`++delegateBySig(delegatee, nonce, expiry, v, r, s)++`]
  711. [.contract-subindex-inherited]
  712. .IERC6372
  713. * {xref-IERC6372-clock--}[`++clock()++`]
  714. * {xref-IERC6372-CLOCK_MODE--}[`++CLOCK_MODE()++`]
  715. --
  716. [.contract-index]
  717. .Events
  718. --
  719. [.contract-subindex-inherited]
  720. .IVotes
  721. * {xref-IVotes-DelegateChanged-address-address-address-}[`++DelegateChanged(delegator, fromDelegate, toDelegate)++`]
  722. * {xref-IVotes-DelegateVotesChanged-address-uint256-uint256-}[`++DelegateVotesChanged(delegate, previousBalance, newBalance)++`]
  723. [.contract-subindex-inherited]
  724. .IERC6372
  725. --
  726. :clock: pass:normal[xref:#IERC6372-clock--[`++clock++`]]
  727. :CLOCK_MODE: pass:normal[xref:#IERC6372-CLOCK_MODE--[`++CLOCK_MODE++`]]
  728. [.contract]
  729. [[IERC6372]]
  730. === `++IERC6372++` link:https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.9.3/contracts/interfaces/IERC6372.sol[{github-icon},role=heading-link]
  731. [.hljs-theme-light.nopadding]
  732. ```solidity
  733. import "@openzeppelin/contracts/interfaces/IERC6372.sol";
  734. ```
  735. [.contract-index]
  736. .Functions
  737. --
  738. * {xref-IERC6372-clock--}[`++clock()++`]
  739. * {xref-IERC6372-CLOCK_MODE--}[`++CLOCK_MODE()++`]
  740. --
  741. [.contract-item]
  742. [[IERC6372-clock--]]
  743. ==== `[.contract-item-name]#++clock++#++() → uint48++` [.item-kind]#external#
  744. Clock used for flagging checkpoints. Can be overridden to implement timestamp based checkpoints (and voting).
  745. [.contract-item]
  746. [[IERC6372-CLOCK_MODE--]]
  747. ==== `[.contract-item-name]#++CLOCK_MODE++#++() → string++` [.item-kind]#external#
  748. Description of the clock