123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950 |
- :github-icon: pass:[<svg class="icon"><use href="#github-icon"/></svg>]
- :IERC777: pass:normal[xref:token/ERC777.adoc#IERC777[`IERC777`]]
- :ERC777: pass:normal[xref:token/ERC777.adoc#ERC777[`ERC777`]]
- :IERC777Sender: pass:normal[xref:token/ERC777.adoc#IERC777Sender[`IERC777Sender`]]
- :IERC777Recipient: pass:normal[xref:token/ERC777.adoc#IERC777Recipient[`IERC777Recipient`]]
- :IERC1820Registry: pass:normal[xref:utils.adoc#IERC1820Registry[`IERC1820Registry`]]
- :ERC1820Implementer: pass:normal[xref:utils.adoc#ERC1820Implementer[`ERC1820Implementer`]]
- :xref-IERC777-name--: xref:token/ERC777.adoc#IERC777-name--
- :xref-IERC777-symbol--: xref:token/ERC777.adoc#IERC777-symbol--
- :xref-IERC777-granularity--: xref:token/ERC777.adoc#IERC777-granularity--
- :xref-IERC777-totalSupply--: xref:token/ERC777.adoc#IERC777-totalSupply--
- :xref-IERC777-balanceOf-address-: xref:token/ERC777.adoc#IERC777-balanceOf-address-
- :xref-IERC777-send-address-uint256-bytes-: xref:token/ERC777.adoc#IERC777-send-address-uint256-bytes-
- :xref-IERC777-burn-uint256-bytes-: xref:token/ERC777.adoc#IERC777-burn-uint256-bytes-
- :xref-IERC777-isOperatorFor-address-address-: xref:token/ERC777.adoc#IERC777-isOperatorFor-address-address-
- :xref-IERC777-authorizeOperator-address-: xref:token/ERC777.adoc#IERC777-authorizeOperator-address-
- :xref-IERC777-revokeOperator-address-: xref:token/ERC777.adoc#IERC777-revokeOperator-address-
- :xref-IERC777-defaultOperators--: xref:token/ERC777.adoc#IERC777-defaultOperators--
- :xref-IERC777-operatorSend-address-address-uint256-bytes-bytes-: xref:token/ERC777.adoc#IERC777-operatorSend-address-address-uint256-bytes-bytes-
- :xref-IERC777-operatorBurn-address-uint256-bytes-bytes-: xref:token/ERC777.adoc#IERC777-operatorBurn-address-uint256-bytes-bytes-
- :xref-IERC777-Minted-address-address-uint256-bytes-bytes-: xref:token/ERC777.adoc#IERC777-Minted-address-address-uint256-bytes-bytes-
- :xref-IERC777-Burned-address-address-uint256-bytes-bytes-: xref:token/ERC777.adoc#IERC777-Burned-address-address-uint256-bytes-bytes-
- :xref-IERC777-AuthorizedOperator-address-address-: xref:token/ERC777.adoc#IERC777-AuthorizedOperator-address-address-
- :xref-IERC777-RevokedOperator-address-address-: xref:token/ERC777.adoc#IERC777-RevokedOperator-address-address-
- :xref-IERC777-Sent-address-address-address-uint256-bytes-bytes-: xref:token/ERC777.adoc#IERC777-Sent-address-address-address-uint256-bytes-bytes-
- :IERC777Sender: pass:normal[xref:token/ERC777.adoc#IERC777Sender[`IERC777Sender`]]
- :IERC777Recipient: pass:normal[xref:token/ERC777.adoc#IERC777Recipient[`IERC777Recipient`]]
- :IERC777Recipient: pass:normal[xref:token/ERC777.adoc#IERC777Recipient[`IERC777Recipient`]]
- :IERC777Sender: pass:normal[xref:token/ERC777.adoc#IERC777Sender[`IERC777Sender`]]
- :IERC777Sender: pass:normal[xref:token/ERC777.adoc#IERC777Sender[`IERC777Sender`]]
- :IERC777Recipient: pass:normal[xref:token/ERC777.adoc#IERC777Recipient[`IERC777Recipient`]]
- :IERC777Recipient: pass:normal[xref:token/ERC777.adoc#IERC777Recipient[`IERC777Recipient`]]
- :IERC777Sender: pass:normal[xref:token/ERC777.adoc#IERC777Sender[`IERC777Sender`]]
- :IERC777: pass:normal[xref:token/ERC777.adoc#IERC777[`IERC777`]]
- :IERC777-Sent: pass:normal[xref:token/ERC777.adoc#IERC777-Sent-address-address-address-uint256-bytes-bytes-[`IERC777.Sent`]]
- :IERC20-Transfer: pass:normal[xref:token/ERC20.adoc#IERC20-Transfer-address-address-uint256-[`IERC20.Transfer`]]
- :IERC777-granularity: pass:normal[xref:token/ERC777.adoc#IERC777-granularity--[`IERC777.granularity`]]
- :xref-ERC777-constructor-string-string-address---: xref:token/ERC777.adoc#ERC777-constructor-string-string-address---
- :xref-ERC777-name--: xref:token/ERC777.adoc#ERC777-name--
- :xref-ERC777-symbol--: xref:token/ERC777.adoc#ERC777-symbol--
- :xref-ERC777-decimals--: xref:token/ERC777.adoc#ERC777-decimals--
- :xref-ERC777-granularity--: xref:token/ERC777.adoc#ERC777-granularity--
- :xref-ERC777-totalSupply--: xref:token/ERC777.adoc#ERC777-totalSupply--
- :xref-ERC777-balanceOf-address-: xref:token/ERC777.adoc#ERC777-balanceOf-address-
- :xref-ERC777-send-address-uint256-bytes-: xref:token/ERC777.adoc#ERC777-send-address-uint256-bytes-
- :xref-ERC777-transfer-address-uint256-: xref:token/ERC777.adoc#ERC777-transfer-address-uint256-
- :xref-ERC777-burn-uint256-bytes-: xref:token/ERC777.adoc#ERC777-burn-uint256-bytes-
- :xref-ERC777-isOperatorFor-address-address-: xref:token/ERC777.adoc#ERC777-isOperatorFor-address-address-
- :xref-ERC777-authorizeOperator-address-: xref:token/ERC777.adoc#ERC777-authorizeOperator-address-
- :xref-ERC777-revokeOperator-address-: xref:token/ERC777.adoc#ERC777-revokeOperator-address-
- :xref-ERC777-defaultOperators--: xref:token/ERC777.adoc#ERC777-defaultOperators--
- :xref-ERC777-operatorSend-address-address-uint256-bytes-bytes-: xref:token/ERC777.adoc#ERC777-operatorSend-address-address-uint256-bytes-bytes-
- :xref-ERC777-operatorBurn-address-uint256-bytes-bytes-: xref:token/ERC777.adoc#ERC777-operatorBurn-address-uint256-bytes-bytes-
- :xref-ERC777-allowance-address-address-: xref:token/ERC777.adoc#ERC777-allowance-address-address-
- :xref-ERC777-approve-address-uint256-: xref:token/ERC777.adoc#ERC777-approve-address-uint256-
- :xref-ERC777-transferFrom-address-address-uint256-: xref:token/ERC777.adoc#ERC777-transferFrom-address-address-uint256-
- :xref-ERC777-_mint-address-uint256-bytes-bytes-: xref:token/ERC777.adoc#ERC777-_mint-address-uint256-bytes-bytes-
- :xref-ERC777-_mint-address-uint256-bytes-bytes-bool-: xref:token/ERC777.adoc#ERC777-_mint-address-uint256-bytes-bytes-bool-
- :xref-ERC777-_send-address-address-uint256-bytes-bytes-bool-: xref:token/ERC777.adoc#ERC777-_send-address-address-uint256-bytes-bytes-bool-
- :xref-ERC777-_burn-address-uint256-bytes-bytes-: xref:token/ERC777.adoc#ERC777-_burn-address-uint256-bytes-bytes-
- :xref-ERC777-_approve-address-address-uint256-: xref:token/ERC777.adoc#ERC777-_approve-address-address-uint256-
- :xref-ERC777-_spendAllowance-address-address-uint256-: xref:token/ERC777.adoc#ERC777-_spendAllowance-address-address-uint256-
- :xref-ERC777-_beforeTokenTransfer-address-address-address-uint256-: xref:token/ERC777.adoc#ERC777-_beforeTokenTransfer-address-address-address-uint256-
- :xref-IERC20-Transfer-address-address-uint256-: xref:token/ERC20.adoc#IERC20-Transfer-address-address-uint256-
- :xref-IERC20-Approval-address-address-uint256-: xref:token/ERC20.adoc#IERC20-Approval-address-address-uint256-
- :xref-IERC777-Minted-address-address-uint256-bytes-bytes-: xref:token/ERC777.adoc#IERC777-Minted-address-address-uint256-bytes-bytes-
- :xref-IERC777-Burned-address-address-uint256-bytes-bytes-: xref:token/ERC777.adoc#IERC777-Burned-address-address-uint256-bytes-bytes-
- :xref-IERC777-AuthorizedOperator-address-address-: xref:token/ERC777.adoc#IERC777-AuthorizedOperator-address-address-
- :xref-IERC777-RevokedOperator-address-address-: xref:token/ERC777.adoc#IERC777-RevokedOperator-address-address-
- :xref-IERC777-Sent-address-address-address-uint256-bytes-bytes-: xref:token/ERC777.adoc#IERC777-Sent-address-address-address-uint256-bytes-bytes-
- :IERC777-name: pass:normal[xref:token/ERC777.adoc#IERC777-name--[`IERC777.name`]]
- :IERC777-symbol: pass:normal[xref:token/ERC777.adoc#IERC777-symbol--[`IERC777.symbol`]]
- :ERC20-decimals: pass:normal[xref:token/ERC20.adoc#ERC20-decimals--[`ERC20.decimals`]]
- :IERC777-granularity: pass:normal[xref:token/ERC777.adoc#IERC777-granularity--[`IERC777.granularity`]]
- :IERC777-totalSupply: pass:normal[xref:token/ERC777.adoc#IERC777-totalSupply--[`IERC777.totalSupply`]]
- :IERC777-send: pass:normal[xref:token/ERC777.adoc#IERC777-send-address-uint256-bytes-[`IERC777.send`]]
- :IERC20-Transfer: pass:normal[xref:token/ERC20.adoc#IERC20-Transfer-address-address-uint256-[`IERC20.Transfer`]]
- :IERC20-transfer: pass:normal[xref:token/ERC20.adoc#IERC20-transfer-address-uint256-[`IERC20.transfer`]]
- :IERC777Recipient: pass:normal[xref:token/ERC777.adoc#IERC777Recipient[`IERC777Recipient`]]
- :IERC777-burn: pass:normal[xref:token/ERC777.adoc#IERC777-burn-uint256-bytes-[`IERC777.burn`]]
- :IERC20-Transfer: pass:normal[xref:token/ERC20.adoc#IERC20-Transfer-address-address-uint256-[`IERC20.Transfer`]]
- :IERC777-isOperatorFor: pass:normal[xref:token/ERC777.adoc#IERC777-isOperatorFor-address-address-[`IERC777.isOperatorFor`]]
- :IERC777-authorizeOperator: pass:normal[xref:token/ERC777.adoc#IERC777-authorizeOperator-address-[`IERC777.authorizeOperator`]]
- :IERC777-revokeOperator: pass:normal[xref:token/ERC777.adoc#IERC777-revokeOperator-address-[`IERC777.revokeOperator`]]
- :IERC777-defaultOperators: pass:normal[xref:token/ERC777.adoc#IERC777-defaultOperators--[`IERC777.defaultOperators`]]
- :IERC777-operatorSend: pass:normal[xref:token/ERC777.adoc#IERC777-operatorSend-address-address-uint256-bytes-bytes-[`IERC777.operatorSend`]]
- :IERC20-Transfer: pass:normal[xref:token/ERC20.adoc#IERC20-Transfer-address-address-uint256-[`IERC20.Transfer`]]
- :IERC777-operatorBurn: pass:normal[xref:token/ERC777.adoc#IERC777-operatorBurn-address-uint256-bytes-bytes-[`IERC777.operatorBurn`]]
- :IERC20-Transfer: pass:normal[xref:token/ERC20.adoc#IERC20-Transfer-address-address-uint256-[`IERC20.Transfer`]]
- :IERC20-allowance: pass:normal[xref:token/ERC20.adoc#IERC20-allowance-address-address-[`IERC20.allowance`]]
- :IERC20-approve: pass:normal[xref:token/ERC20.adoc#IERC20-approve-address-uint256-[`IERC20.approve`]]
- :IERC20-transferFrom: pass:normal[xref:token/ERC20.adoc#IERC20-transferFrom-address-address-uint256-[`IERC20.transferFrom`]]
- :IERC20-Transfer: pass:normal[xref:token/ERC20.adoc#IERC20-Transfer-address-address-uint256-[`IERC20.Transfer`]]
- :IERC20-Approval: pass:normal[xref:token/ERC20.adoc#IERC20-Approval-address-address-uint256-[`IERC20.Approval`]]
- :IERC777Sender: pass:normal[xref:token/ERC777.adoc#IERC777Sender[`IERC777Sender`]]
- :IERC777Recipient: pass:normal[xref:token/ERC777.adoc#IERC777Recipient[`IERC777Recipient`]]
- :IERC20-Transfer: pass:normal[xref:token/ERC20.adoc#IERC20-Transfer-address-address-uint256-[`IERC20.Transfer`]]
- :IERC777Recipient: pass:normal[xref:token/ERC777.adoc#IERC777Recipient[`IERC777Recipient`]]
- :IERC777Sender: pass:normal[xref:token/ERC777.adoc#IERC777Sender[`IERC777Sender`]]
- :IERC777Recipient: pass:normal[xref:token/ERC777.adoc#IERC777Recipient[`IERC777Recipient`]]
- :IERC20-Transfer: pass:normal[xref:token/ERC20.adoc#IERC20-Transfer-address-address-uint256-[`IERC20.Transfer`]]
- :IERC777Recipient: pass:normal[xref:token/ERC777.adoc#IERC777Recipient[`IERC777Recipient`]]
- :ERC20-_approve: pass:normal[xref:token/ERC20.adoc#ERC20-_approve-address-address-uint256-[`ERC20._approve`]]
- :IERC20-Approval: pass:normal[xref:token/ERC20.adoc#IERC20-Approval-address-address-uint256-[`IERC20.Approval`]]
- :IERC777: pass:normal[xref:token/ERC777.adoc#IERC777[`IERC777`]]
- :IERC1820Registry: pass:normal[xref:utils.adoc#IERC1820Registry[`IERC1820Registry`]]
- :ERC1820Implementer: pass:normal[xref:utils.adoc#ERC1820Implementer[`ERC1820Implementer`]]
- :xref-IERC777Sender-tokensToSend-address-address-address-uint256-bytes-bytes-: xref:token/ERC777.adoc#IERC777Sender-tokensToSend-address-address-address-uint256-bytes-bytes-
- :IERC777: pass:normal[xref:token/ERC777.adoc#IERC777[`IERC777`]]
- :IERC777-balanceOf: pass:normal[xref:token/ERC777.adoc#IERC777-balanceOf-address-[`IERC777.balanceOf`]]
- :IERC777: pass:normal[xref:token/ERC777.adoc#IERC777[`IERC777`]]
- :IERC1820Registry: pass:normal[xref:utils.adoc#IERC1820Registry[`IERC1820Registry`]]
- :ERC1820Implementer: pass:normal[xref:utils.adoc#ERC1820Implementer[`ERC1820Implementer`]]
- :xref-IERC777Recipient-tokensReceived-address-address-address-uint256-bytes-bytes-: xref:token/ERC777.adoc#IERC777Recipient-tokensReceived-address-address-address-uint256-bytes-bytes-
- :IERC777: pass:normal[xref:token/ERC777.adoc#IERC777[`IERC777`]]
- :IERC777-balanceOf: pass:normal[xref:token/ERC777.adoc#IERC777-balanceOf-address-[`IERC777.balanceOf`]]
- :ERC777: pass:normal[xref:token/ERC777.adoc#ERC777[`ERC777`]]
- :xref-ERC777PresetFixedSupply-constructor-string-string-address---uint256-address-: xref:token/ERC777.adoc#ERC777PresetFixedSupply-constructor-string-string-address---uint256-address-
- :xref-ERC777-name--: xref:token/ERC777.adoc#ERC777-name--
- :xref-ERC777-symbol--: xref:token/ERC777.adoc#ERC777-symbol--
- :xref-ERC777-decimals--: xref:token/ERC777.adoc#ERC777-decimals--
- :xref-ERC777-granularity--: xref:token/ERC777.adoc#ERC777-granularity--
- :xref-ERC777-totalSupply--: xref:token/ERC777.adoc#ERC777-totalSupply--
- :xref-ERC777-balanceOf-address-: xref:token/ERC777.adoc#ERC777-balanceOf-address-
- :xref-ERC777-send-address-uint256-bytes-: xref:token/ERC777.adoc#ERC777-send-address-uint256-bytes-
- :xref-ERC777-transfer-address-uint256-: xref:token/ERC777.adoc#ERC777-transfer-address-uint256-
- :xref-ERC777-burn-uint256-bytes-: xref:token/ERC777.adoc#ERC777-burn-uint256-bytes-
- :xref-ERC777-isOperatorFor-address-address-: xref:token/ERC777.adoc#ERC777-isOperatorFor-address-address-
- :xref-ERC777-authorizeOperator-address-: xref:token/ERC777.adoc#ERC777-authorizeOperator-address-
- :xref-ERC777-revokeOperator-address-: xref:token/ERC777.adoc#ERC777-revokeOperator-address-
- :xref-ERC777-defaultOperators--: xref:token/ERC777.adoc#ERC777-defaultOperators--
- :xref-ERC777-operatorSend-address-address-uint256-bytes-bytes-: xref:token/ERC777.adoc#ERC777-operatorSend-address-address-uint256-bytes-bytes-
- :xref-ERC777-operatorBurn-address-uint256-bytes-bytes-: xref:token/ERC777.adoc#ERC777-operatorBurn-address-uint256-bytes-bytes-
- :xref-ERC777-allowance-address-address-: xref:token/ERC777.adoc#ERC777-allowance-address-address-
- :xref-ERC777-approve-address-uint256-: xref:token/ERC777.adoc#ERC777-approve-address-uint256-
- :xref-ERC777-transferFrom-address-address-uint256-: xref:token/ERC777.adoc#ERC777-transferFrom-address-address-uint256-
- :xref-ERC777-_mint-address-uint256-bytes-bytes-: xref:token/ERC777.adoc#ERC777-_mint-address-uint256-bytes-bytes-
- :xref-ERC777-_mint-address-uint256-bytes-bytes-bool-: xref:token/ERC777.adoc#ERC777-_mint-address-uint256-bytes-bytes-bool-
- :xref-ERC777-_send-address-address-uint256-bytes-bytes-bool-: xref:token/ERC777.adoc#ERC777-_send-address-address-uint256-bytes-bytes-bool-
- :xref-ERC777-_burn-address-uint256-bytes-bytes-: xref:token/ERC777.adoc#ERC777-_burn-address-uint256-bytes-bytes-
- :xref-ERC777-_approve-address-address-uint256-: xref:token/ERC777.adoc#ERC777-_approve-address-address-uint256-
- :xref-ERC777-_spendAllowance-address-address-uint256-: xref:token/ERC777.adoc#ERC777-_spendAllowance-address-address-uint256-
- :xref-ERC777-_beforeTokenTransfer-address-address-address-uint256-: xref:token/ERC777.adoc#ERC777-_beforeTokenTransfer-address-address-address-uint256-
- :xref-IERC20-Transfer-address-address-uint256-: xref:token/ERC20.adoc#IERC20-Transfer-address-address-uint256-
- :xref-IERC20-Approval-address-address-uint256-: xref:token/ERC20.adoc#IERC20-Approval-address-address-uint256-
- :xref-IERC777-Minted-address-address-uint256-bytes-bytes-: xref:token/ERC777.adoc#IERC777-Minted-address-address-uint256-bytes-bytes-
- :xref-IERC777-Burned-address-address-uint256-bytes-bytes-: xref:token/ERC777.adoc#IERC777-Burned-address-address-uint256-bytes-bytes-
- :xref-IERC777-AuthorizedOperator-address-address-: xref:token/ERC777.adoc#IERC777-AuthorizedOperator-address-address-
- :xref-IERC777-RevokedOperator-address-address-: xref:token/ERC777.adoc#IERC777-RevokedOperator-address-address-
- :xref-IERC777-Sent-address-address-address-uint256-bytes-bytes-: xref:token/ERC777.adoc#IERC777-Sent-address-address-address-uint256-bytes-bytes-
- :ERC777-constructor: pass:normal[xref:token/ERC777.adoc#ERC777-constructor-string-string-address---[`ERC777.constructor`]]
- = ERC 777
- [.readme-notice]
- NOTE: This document is better viewed at https://docs.openzeppelin.com/contracts/api/token/erc777
- CAUTION: As of v4.9, OpenZeppelin's implementation of ERC-777 is deprecated and will be removed in the next major release.
- This set of interfaces and contracts are all related to the https://eips.ethereum.org/EIPS/eip-777[ERC777 token standard].
- TIP: For an overview of ERC777 tokens and a walk through on how to create a token contract read our xref:ROOT:erc777.adoc[ERC777 guide].
- The token behavior itself is implemented in the core contracts: {IERC777}, {ERC777}.
- Additionally there are interfaces used to develop contracts that react to token movements: {IERC777Sender}, {IERC777Recipient}.
- == Core
- :Minted: pass:normal[xref:#IERC777-Minted-address-address-uint256-bytes-bytes-[`++Minted++`]]
- :Burned: pass:normal[xref:#IERC777-Burned-address-address-uint256-bytes-bytes-[`++Burned++`]]
- :AuthorizedOperator: pass:normal[xref:#IERC777-AuthorizedOperator-address-address-[`++AuthorizedOperator++`]]
- :RevokedOperator: pass:normal[xref:#IERC777-RevokedOperator-address-address-[`++RevokedOperator++`]]
- :name: pass:normal[xref:#IERC777-name--[`++name++`]]
- :symbol: pass:normal[xref:#IERC777-symbol--[`++symbol++`]]
- :granularity: pass:normal[xref:#IERC777-granularity--[`++granularity++`]]
- :totalSupply: pass:normal[xref:#IERC777-totalSupply--[`++totalSupply++`]]
- :balanceOf: pass:normal[xref:#IERC777-balanceOf-address-[`++balanceOf++`]]
- :send: pass:normal[xref:#IERC777-send-address-uint256-bytes-[`++send++`]]
- :burn: pass:normal[xref:#IERC777-burn-uint256-bytes-[`++burn++`]]
- :isOperatorFor: pass:normal[xref:#IERC777-isOperatorFor-address-address-[`++isOperatorFor++`]]
- :authorizeOperator: pass:normal[xref:#IERC777-authorizeOperator-address-[`++authorizeOperator++`]]
- :revokeOperator: pass:normal[xref:#IERC777-revokeOperator-address-[`++revokeOperator++`]]
- :defaultOperators: pass:normal[xref:#IERC777-defaultOperators--[`++defaultOperators++`]]
- :operatorSend: pass:normal[xref:#IERC777-operatorSend-address-address-uint256-bytes-bytes-[`++operatorSend++`]]
- :operatorBurn: pass:normal[xref:#IERC777-operatorBurn-address-uint256-bytes-bytes-[`++operatorBurn++`]]
- :Sent: pass:normal[xref:#IERC777-Sent-address-address-address-uint256-bytes-bytes-[`++Sent++`]]
- [.contract]
- [[IERC777]]
- === `++IERC777++` link:https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.9.5/contracts/token/ERC777/IERC777.sol[{github-icon},role=heading-link]
- [.hljs-theme-light.nopadding]
- ```solidity
- import "@openzeppelin/contracts/token/ERC777/IERC777.sol";
- ```
- Interface of the ERC777Token standard as defined in the EIP.
- This contract uses the
- https://eips.ethereum.org/EIPS/eip-1820[ERC1820 registry standard] to let
- token holders and recipients react to token movements by using setting implementers
- for the associated interfaces in said registry. See {IERC1820Registry} and
- {ERC1820Implementer}.
- [.contract-index]
- .Functions
- --
- * {xref-IERC777-name--}[`++name()++`]
- * {xref-IERC777-symbol--}[`++symbol()++`]
- * {xref-IERC777-granularity--}[`++granularity()++`]
- * {xref-IERC777-totalSupply--}[`++totalSupply()++`]
- * {xref-IERC777-balanceOf-address-}[`++balanceOf(owner)++`]
- * {xref-IERC777-send-address-uint256-bytes-}[`++send(recipient, amount, data)++`]
- * {xref-IERC777-burn-uint256-bytes-}[`++burn(amount, data)++`]
- * {xref-IERC777-isOperatorFor-address-address-}[`++isOperatorFor(operator, tokenHolder)++`]
- * {xref-IERC777-authorizeOperator-address-}[`++authorizeOperator(operator)++`]
- * {xref-IERC777-revokeOperator-address-}[`++revokeOperator(operator)++`]
- * {xref-IERC777-defaultOperators--}[`++defaultOperators()++`]
- * {xref-IERC777-operatorSend-address-address-uint256-bytes-bytes-}[`++operatorSend(sender, recipient, amount, data, operatorData)++`]
- * {xref-IERC777-operatorBurn-address-uint256-bytes-bytes-}[`++operatorBurn(account, amount, data, operatorData)++`]
- --
- [.contract-index]
- .Events
- --
- * {xref-IERC777-Minted-address-address-uint256-bytes-bytes-}[`++Minted(operator, to, amount, data, operatorData)++`]
- * {xref-IERC777-Burned-address-address-uint256-bytes-bytes-}[`++Burned(operator, from, amount, data, operatorData)++`]
- * {xref-IERC777-AuthorizedOperator-address-address-}[`++AuthorizedOperator(operator, tokenHolder)++`]
- * {xref-IERC777-RevokedOperator-address-address-}[`++RevokedOperator(operator, tokenHolder)++`]
- * {xref-IERC777-Sent-address-address-address-uint256-bytes-bytes-}[`++Sent(operator, from, to, amount, data, operatorData)++`]
- --
- [.contract-item]
- [[IERC777-name--]]
- ==== `[.contract-item-name]#++name++#++() → string++` [.item-kind]#external#
- Returns the name of the token.
- [.contract-item]
- [[IERC777-symbol--]]
- ==== `[.contract-item-name]#++symbol++#++() → string++` [.item-kind]#external#
- Returns the symbol of the token, usually a shorter version of the
- name.
- [.contract-item]
- [[IERC777-granularity--]]
- ==== `[.contract-item-name]#++granularity++#++() → uint256++` [.item-kind]#external#
- Returns the smallest part of the token that is not divisible. This
- means all token operations (creation, movement and destruction) must have
- amounts that are a multiple of this number.
- For most token contracts, this value will equal 1.
- [.contract-item]
- [[IERC777-totalSupply--]]
- ==== `[.contract-item-name]#++totalSupply++#++() → uint256++` [.item-kind]#external#
- Returns the amount of tokens in existence.
- [.contract-item]
- [[IERC777-balanceOf-address-]]
- ==== `[.contract-item-name]#++balanceOf++#++(address owner) → uint256++` [.item-kind]#external#
- Returns the amount of tokens owned by an account (`owner`).
- [.contract-item]
- [[IERC777-send-address-uint256-bytes-]]
- ==== `[.contract-item-name]#++send++#++(address recipient, uint256 amount, bytes data)++` [.item-kind]#external#
- Moves `amount` tokens from the caller's account to `recipient`.
- If send or receive hooks are registered for the caller and `recipient`,
- the corresponding functions will be called with `data` and empty
- `operatorData`. See {IERC777Sender} and {IERC777Recipient}.
- Emits a {Sent} event.
- Requirements
- - the caller must have at least `amount` tokens.
- - `recipient` cannot be the zero address.
- - if `recipient` is a contract, it must implement the {IERC777Recipient}
- interface.
- [.contract-item]
- [[IERC777-burn-uint256-bytes-]]
- ==== `[.contract-item-name]#++burn++#++(uint256 amount, bytes data)++` [.item-kind]#external#
- Destroys `amount` tokens from the caller's account, reducing the
- total supply.
- If a send hook is registered for the caller, the corresponding function
- will be called with `data` and empty `operatorData`. See {IERC777Sender}.
- Emits a {Burned} event.
- Requirements
- - the caller must have at least `amount` tokens.
- [.contract-item]
- [[IERC777-isOperatorFor-address-address-]]
- ==== `[.contract-item-name]#++isOperatorFor++#++(address operator, address tokenHolder) → bool++` [.item-kind]#external#
- Returns true if an account is an operator of `tokenHolder`.
- Operators can send and burn tokens on behalf of their owners. All
- accounts are their own operator.
- See {operatorSend} and {operatorBurn}.
- [.contract-item]
- [[IERC777-authorizeOperator-address-]]
- ==== `[.contract-item-name]#++authorizeOperator++#++(address operator)++` [.item-kind]#external#
- Make an account an operator of the caller.
- See {isOperatorFor}.
- Emits an {AuthorizedOperator} event.
- Requirements
- - `operator` cannot be calling address.
- [.contract-item]
- [[IERC777-revokeOperator-address-]]
- ==== `[.contract-item-name]#++revokeOperator++#++(address operator)++` [.item-kind]#external#
- Revoke an account's operator status for the caller.
- See {isOperatorFor} and {defaultOperators}.
- Emits a {RevokedOperator} event.
- Requirements
- - `operator` cannot be calling address.
- [.contract-item]
- [[IERC777-defaultOperators--]]
- ==== `[.contract-item-name]#++defaultOperators++#++() → address[]++` [.item-kind]#external#
- Returns the list of default operators. These accounts are operators
- for all token holders, even if {authorizeOperator} was never called on
- them.
- This list is immutable, but individual holders may revoke these via
- {revokeOperator}, in which case {isOperatorFor} will return false.
- [.contract-item]
- [[IERC777-operatorSend-address-address-uint256-bytes-bytes-]]
- ==== `[.contract-item-name]#++operatorSend++#++(address sender, address recipient, uint256 amount, bytes data, bytes operatorData)++` [.item-kind]#external#
- Moves `amount` tokens from `sender` to `recipient`. The caller must
- be an operator of `sender`.
- If send or receive hooks are registered for `sender` and `recipient`,
- the corresponding functions will be called with `data` and
- `operatorData`. See {IERC777Sender} and {IERC777Recipient}.
- Emits a {Sent} event.
- Requirements
- - `sender` cannot be the zero address.
- - `sender` must have at least `amount` tokens.
- - the caller must be an operator for `sender`.
- - `recipient` cannot be the zero address.
- - if `recipient` is a contract, it must implement the {IERC777Recipient}
- interface.
- [.contract-item]
- [[IERC777-operatorBurn-address-uint256-bytes-bytes-]]
- ==== `[.contract-item-name]#++operatorBurn++#++(address account, uint256 amount, bytes data, bytes operatorData)++` [.item-kind]#external#
- Destroys `amount` tokens from `account`, reducing the total supply.
- The caller must be an operator of `account`.
- If a send hook is registered for `account`, the corresponding function
- will be called with `data` and `operatorData`. See {IERC777Sender}.
- Emits a {Burned} event.
- Requirements
- - `account` cannot be the zero address.
- - `account` must have at least `amount` tokens.
- - the caller must be an operator for `account`.
- [.contract-item]
- [[IERC777-Minted-address-address-uint256-bytes-bytes-]]
- ==== `[.contract-item-name]#++Minted++#++(address indexed operator, address indexed to, uint256 amount, bytes data, bytes operatorData)++` [.item-kind]#event#
- Emitted when `amount` tokens are created by `operator` and assigned to `to`.
- Note that some additional user `data` and `operatorData` can be logged in the event.
- [.contract-item]
- [[IERC777-Burned-address-address-uint256-bytes-bytes-]]
- ==== `[.contract-item-name]#++Burned++#++(address indexed operator, address indexed from, uint256 amount, bytes data, bytes operatorData)++` [.item-kind]#event#
- Emitted when `operator` destroys `amount` tokens from `account`.
- Note that some additional user `data` and `operatorData` can be logged in the event.
- [.contract-item]
- [[IERC777-AuthorizedOperator-address-address-]]
- ==== `[.contract-item-name]#++AuthorizedOperator++#++(address indexed operator, address indexed tokenHolder)++` [.item-kind]#event#
- Emitted when `operator` is made operator for `tokenHolder`.
- [.contract-item]
- [[IERC777-RevokedOperator-address-address-]]
- ==== `[.contract-item-name]#++RevokedOperator++#++(address indexed operator, address indexed tokenHolder)++` [.item-kind]#event#
- Emitted when `operator` is revoked its operator status for `tokenHolder`.
- [.contract-item]
- [[IERC777-Sent-address-address-address-uint256-bytes-bytes-]]
- ==== `[.contract-item-name]#++Sent++#++(address indexed operator, address indexed from, address indexed to, uint256 amount, bytes data, bytes operatorData)++` [.item-kind]#event#
- :_ERC1820_REGISTRY: pass:normal[xref:#ERC777-_ERC1820_REGISTRY-contract-IERC1820Registry[`++_ERC1820_REGISTRY++`]]
- :constructor: pass:normal[xref:#ERC777-constructor-string-string-address---[`++constructor++`]]
- :name: pass:normal[xref:#ERC777-name--[`++name++`]]
- :symbol: pass:normal[xref:#ERC777-symbol--[`++symbol++`]]
- :decimals: pass:normal[xref:#ERC777-decimals--[`++decimals++`]]
- :granularity: pass:normal[xref:#ERC777-granularity--[`++granularity++`]]
- :totalSupply: pass:normal[xref:#ERC777-totalSupply--[`++totalSupply++`]]
- :balanceOf: pass:normal[xref:#ERC777-balanceOf-address-[`++balanceOf++`]]
- :send: pass:normal[xref:#ERC777-send-address-uint256-bytes-[`++send++`]]
- :transfer: pass:normal[xref:#ERC777-transfer-address-uint256-[`++transfer++`]]
- :burn: pass:normal[xref:#ERC777-burn-uint256-bytes-[`++burn++`]]
- :isOperatorFor: pass:normal[xref:#ERC777-isOperatorFor-address-address-[`++isOperatorFor++`]]
- :authorizeOperator: pass:normal[xref:#ERC777-authorizeOperator-address-[`++authorizeOperator++`]]
- :revokeOperator: pass:normal[xref:#ERC777-revokeOperator-address-[`++revokeOperator++`]]
- :defaultOperators: pass:normal[xref:#ERC777-defaultOperators--[`++defaultOperators++`]]
- :operatorSend: pass:normal[xref:#ERC777-operatorSend-address-address-uint256-bytes-bytes-[`++operatorSend++`]]
- :operatorBurn: pass:normal[xref:#ERC777-operatorBurn-address-uint256-bytes-bytes-[`++operatorBurn++`]]
- :allowance: pass:normal[xref:#ERC777-allowance-address-address-[`++allowance++`]]
- :approve: pass:normal[xref:#ERC777-approve-address-uint256-[`++approve++`]]
- :transferFrom: pass:normal[xref:#ERC777-transferFrom-address-address-uint256-[`++transferFrom++`]]
- :_mint: pass:normal[xref:#ERC777-_mint-address-uint256-bytes-bytes-[`++_mint++`]]
- :_mint: pass:normal[xref:#ERC777-_mint-address-uint256-bytes-bytes-bool-[`++_mint++`]]
- :_send: pass:normal[xref:#ERC777-_send-address-address-uint256-bytes-bytes-bool-[`++_send++`]]
- :_burn: pass:normal[xref:#ERC777-_burn-address-uint256-bytes-bytes-[`++_burn++`]]
- :_approve: pass:normal[xref:#ERC777-_approve-address-address-uint256-[`++_approve++`]]
- :_spendAllowance: pass:normal[xref:#ERC777-_spendAllowance-address-address-uint256-[`++_spendAllowance++`]]
- :_beforeTokenTransfer: pass:normal[xref:#ERC777-_beforeTokenTransfer-address-address-address-uint256-[`++_beforeTokenTransfer++`]]
- [.contract]
- [[ERC777]]
- === `++ERC777++` link:https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.9.5/contracts/token/ERC777/ERC777.sol[{github-icon},role=heading-link]
- [.hljs-theme-light.nopadding]
- ```solidity
- import "@openzeppelin/contracts/token/ERC777/ERC777.sol";
- ```
- Implementation of the {IERC777} interface.
- This implementation is agnostic to the way tokens are created. This means
- that a supply mechanism has to be added in a derived contract using {_mint}.
- Support for ERC20 is included in this contract, as specified by the EIP: both
- the ERC777 and ERC20 interfaces can be safely used when interacting with it.
- Both {IERC777-Sent} and {IERC20-Transfer} events are emitted on token
- movements.
- Additionally, the {IERC777-granularity} value is hard-coded to `1`, meaning that there
- are no special restrictions in the amount of tokens that created, moved, or
- destroyed. This makes integration with ERC20 applications seamless.
- CAUTION: This file is deprecated as of v4.9 and will be removed in the next major release.
- [.contract-index]
- .Functions
- --
- * {xref-ERC777-constructor-string-string-address---}[`++constructor(name_, symbol_, defaultOperators_)++`]
- * {xref-ERC777-name--}[`++name()++`]
- * {xref-ERC777-symbol--}[`++symbol()++`]
- * {xref-ERC777-decimals--}[`++decimals()++`]
- * {xref-ERC777-granularity--}[`++granularity()++`]
- * {xref-ERC777-totalSupply--}[`++totalSupply()++`]
- * {xref-ERC777-balanceOf-address-}[`++balanceOf(tokenHolder)++`]
- * {xref-ERC777-send-address-uint256-bytes-}[`++send(recipient, amount, data)++`]
- * {xref-ERC777-transfer-address-uint256-}[`++transfer(recipient, amount)++`]
- * {xref-ERC777-burn-uint256-bytes-}[`++burn(amount, data)++`]
- * {xref-ERC777-isOperatorFor-address-address-}[`++isOperatorFor(operator, tokenHolder)++`]
- * {xref-ERC777-authorizeOperator-address-}[`++authorizeOperator(operator)++`]
- * {xref-ERC777-revokeOperator-address-}[`++revokeOperator(operator)++`]
- * {xref-ERC777-defaultOperators--}[`++defaultOperators()++`]
- * {xref-ERC777-operatorSend-address-address-uint256-bytes-bytes-}[`++operatorSend(sender, recipient, amount, data, operatorData)++`]
- * {xref-ERC777-operatorBurn-address-uint256-bytes-bytes-}[`++operatorBurn(account, amount, data, operatorData)++`]
- * {xref-ERC777-allowance-address-address-}[`++allowance(holder, spender)++`]
- * {xref-ERC777-approve-address-uint256-}[`++approve(spender, value)++`]
- * {xref-ERC777-transferFrom-address-address-uint256-}[`++transferFrom(holder, recipient, amount)++`]
- * {xref-ERC777-_mint-address-uint256-bytes-bytes-}[`++_mint(account, amount, userData, operatorData)++`]
- * {xref-ERC777-_mint-address-uint256-bytes-bytes-bool-}[`++_mint(account, amount, userData, operatorData, requireReceptionAck)++`]
- * {xref-ERC777-_send-address-address-uint256-bytes-bytes-bool-}[`++_send(from, to, amount, userData, operatorData, requireReceptionAck)++`]
- * {xref-ERC777-_burn-address-uint256-bytes-bytes-}[`++_burn(from, amount, data, operatorData)++`]
- * {xref-ERC777-_approve-address-address-uint256-}[`++_approve(holder, spender, value)++`]
- * {xref-ERC777-_spendAllowance-address-address-uint256-}[`++_spendAllowance(owner, spender, amount)++`]
- * {xref-ERC777-_beforeTokenTransfer-address-address-address-uint256-}[`++_beforeTokenTransfer(operator, from, to, amount)++`]
- [.contract-subindex-inherited]
- .IERC20
- [.contract-subindex-inherited]
- .IERC777
- --
- [.contract-index]
- .Events
- --
- [.contract-subindex-inherited]
- .IERC20
- * {xref-IERC20-Transfer-address-address-uint256-}[`++Transfer(from, to, value)++`]
- * {xref-IERC20-Approval-address-address-uint256-}[`++Approval(owner, spender, value)++`]
- [.contract-subindex-inherited]
- .IERC777
- * {xref-IERC777-Minted-address-address-uint256-bytes-bytes-}[`++Minted(operator, to, amount, data, operatorData)++`]
- * {xref-IERC777-Burned-address-address-uint256-bytes-bytes-}[`++Burned(operator, from, amount, data, operatorData)++`]
- * {xref-IERC777-AuthorizedOperator-address-address-}[`++AuthorizedOperator(operator, tokenHolder)++`]
- * {xref-IERC777-RevokedOperator-address-address-}[`++RevokedOperator(operator, tokenHolder)++`]
- * {xref-IERC777-Sent-address-address-address-uint256-bytes-bytes-}[`++Sent(operator, from, to, amount, data, operatorData)++`]
- --
- [.contract-item]
- [[ERC777-constructor-string-string-address---]]
- ==== `[.contract-item-name]#++constructor++#++(string name_, string symbol_, address[] defaultOperators_)++` [.item-kind]#public#
- `defaultOperators` may be an empty array.
- [.contract-item]
- [[ERC777-name--]]
- ==== `[.contract-item-name]#++name++#++() → string++` [.item-kind]#public#
- See {IERC777-name}.
- [.contract-item]
- [[ERC777-symbol--]]
- ==== `[.contract-item-name]#++symbol++#++() → string++` [.item-kind]#public#
- See {IERC777-symbol}.
- [.contract-item]
- [[ERC777-decimals--]]
- ==== `[.contract-item-name]#++decimals++#++() → uint8++` [.item-kind]#public#
- See {ERC20-decimals}.
- Always returns 18, as per the
- [ERC777 EIP](https://eips.ethereum.org/EIPS/eip-777#backward-compatibility).
- [.contract-item]
- [[ERC777-granularity--]]
- ==== `[.contract-item-name]#++granularity++#++() → uint256++` [.item-kind]#public#
- See {IERC777-granularity}.
- This implementation always returns `1`.
- [.contract-item]
- [[ERC777-totalSupply--]]
- ==== `[.contract-item-name]#++totalSupply++#++() → uint256++` [.item-kind]#public#
- See {IERC777-totalSupply}.
- [.contract-item]
- [[ERC777-balanceOf-address-]]
- ==== `[.contract-item-name]#++balanceOf++#++(address tokenHolder) → uint256++` [.item-kind]#public#
- Returns the amount of tokens owned by an account (`tokenHolder`).
- [.contract-item]
- [[ERC777-send-address-uint256-bytes-]]
- ==== `[.contract-item-name]#++send++#++(address recipient, uint256 amount, bytes data)++` [.item-kind]#public#
- See {IERC777-send}.
- Also emits a {IERC20-Transfer} event for ERC20 compatibility.
- [.contract-item]
- [[ERC777-transfer-address-uint256-]]
- ==== `[.contract-item-name]#++transfer++#++(address recipient, uint256 amount) → bool++` [.item-kind]#public#
- See {IERC20-transfer}.
- Unlike `send`, `recipient` is _not_ required to implement the {IERC777Recipient}
- interface if it is a contract.
- Also emits a {Sent} event.
- [.contract-item]
- [[ERC777-burn-uint256-bytes-]]
- ==== `[.contract-item-name]#++burn++#++(uint256 amount, bytes data)++` [.item-kind]#public#
- See {IERC777-burn}.
- Also emits a {IERC20-Transfer} event for ERC20 compatibility.
- [.contract-item]
- [[ERC777-isOperatorFor-address-address-]]
- ==== `[.contract-item-name]#++isOperatorFor++#++(address operator, address tokenHolder) → bool++` [.item-kind]#public#
- See {IERC777-isOperatorFor}.
- [.contract-item]
- [[ERC777-authorizeOperator-address-]]
- ==== `[.contract-item-name]#++authorizeOperator++#++(address operator)++` [.item-kind]#public#
- See {IERC777-authorizeOperator}.
- [.contract-item]
- [[ERC777-revokeOperator-address-]]
- ==== `[.contract-item-name]#++revokeOperator++#++(address operator)++` [.item-kind]#public#
- See {IERC777-revokeOperator}.
- [.contract-item]
- [[ERC777-defaultOperators--]]
- ==== `[.contract-item-name]#++defaultOperators++#++() → address[]++` [.item-kind]#public#
- See {IERC777-defaultOperators}.
- [.contract-item]
- [[ERC777-operatorSend-address-address-uint256-bytes-bytes-]]
- ==== `[.contract-item-name]#++operatorSend++#++(address sender, address recipient, uint256 amount, bytes data, bytes operatorData)++` [.item-kind]#public#
- See {IERC777-operatorSend}.
- Emits {Sent} and {IERC20-Transfer} events.
- [.contract-item]
- [[ERC777-operatorBurn-address-uint256-bytes-bytes-]]
- ==== `[.contract-item-name]#++operatorBurn++#++(address account, uint256 amount, bytes data, bytes operatorData)++` [.item-kind]#public#
- See {IERC777-operatorBurn}.
- Emits {Burned} and {IERC20-Transfer} events.
- [.contract-item]
- [[ERC777-allowance-address-address-]]
- ==== `[.contract-item-name]#++allowance++#++(address holder, address spender) → uint256++` [.item-kind]#public#
- See {IERC20-allowance}.
- Note that operator and allowance concepts are orthogonal: operators may
- not have allowance, and accounts with allowance may not be operators
- themselves.
- [.contract-item]
- [[ERC777-approve-address-uint256-]]
- ==== `[.contract-item-name]#++approve++#++(address spender, uint256 value) → bool++` [.item-kind]#public#
- See {IERC20-approve}.
- NOTE: If `value` is the maximum `uint256`, the allowance is not updated on
- `transferFrom`. This is semantically equivalent to an infinite approval.
- Note that accounts cannot have allowance issued by their operators.
- [.contract-item]
- [[ERC777-transferFrom-address-address-uint256-]]
- ==== `[.contract-item-name]#++transferFrom++#++(address holder, address recipient, uint256 amount) → bool++` [.item-kind]#public#
- See {IERC20-transferFrom}.
- NOTE: Does not update the allowance if the current allowance
- is the maximum `uint256`.
- Note that operator and allowance concepts are orthogonal: operators cannot
- call `transferFrom` (unless they have allowance), and accounts with
- allowance cannot call `operatorSend` (unless they are operators).
- Emits {Sent}, {IERC20-Transfer} and {IERC20-Approval} events.
- [.contract-item]
- [[ERC777-_mint-address-uint256-bytes-bytes-]]
- ==== `[.contract-item-name]#++_mint++#++(address account, uint256 amount, bytes userData, bytes operatorData)++` [.item-kind]#internal#
- Creates `amount` tokens and assigns them to `account`, increasing
- the total supply.
- If a send hook is registered for `account`, the corresponding function
- will be called with the caller address as the `operator` and with
- `userData` and `operatorData`.
- See {IERC777Sender} and {IERC777Recipient}.
- Emits {Minted} and {IERC20-Transfer} events.
- Requirements
- - `account` cannot be the zero address.
- - if `account` is a contract, it must implement the {IERC777Recipient}
- interface.
- [.contract-item]
- [[ERC777-_mint-address-uint256-bytes-bytes-bool-]]
- ==== `[.contract-item-name]#++_mint++#++(address account, uint256 amount, bytes userData, bytes operatorData, bool requireReceptionAck)++` [.item-kind]#internal#
- Creates `amount` tokens and assigns them to `account`, increasing
- the total supply.
- If `requireReceptionAck` is set to true, and if a send hook is
- registered for `account`, the corresponding function will be called with
- `operator`, `data` and `operatorData`.
- See {IERC777Sender} and {IERC777Recipient}.
- Emits {Minted} and {IERC20-Transfer} events.
- Requirements
- - `account` cannot be the zero address.
- - if `account` is a contract, it must implement the {IERC777Recipient}
- interface.
- [.contract-item]
- [[ERC777-_send-address-address-uint256-bytes-bytes-bool-]]
- ==== `[.contract-item-name]#++_send++#++(address from, address to, uint256 amount, bytes userData, bytes operatorData, bool requireReceptionAck)++` [.item-kind]#internal#
- Send tokens
- [.contract-item]
- [[ERC777-_burn-address-uint256-bytes-bytes-]]
- ==== `[.contract-item-name]#++_burn++#++(address from, uint256 amount, bytes data, bytes operatorData)++` [.item-kind]#internal#
- Burn tokens
- [.contract-item]
- [[ERC777-_approve-address-address-uint256-]]
- ==== `[.contract-item-name]#++_approve++#++(address holder, address spender, uint256 value)++` [.item-kind]#internal#
- See {ERC20-_approve}.
- Note that accounts cannot have allowance issued by their operators.
- [.contract-item]
- [[ERC777-_spendAllowance-address-address-uint256-]]
- ==== `[.contract-item-name]#++_spendAllowance++#++(address owner, address spender, uint256 amount)++` [.item-kind]#internal#
- Updates `owner` s allowance for `spender` based on spent `amount`.
- Does not update the allowance amount in case of infinite allowance.
- Revert if not enough allowance is available.
- Might emit an {IERC20-Approval} event.
- [.contract-item]
- [[ERC777-_beforeTokenTransfer-address-address-address-uint256-]]
- ==== `[.contract-item-name]#++_beforeTokenTransfer++#++(address operator, address from, address to, uint256 amount)++` [.item-kind]#internal#
- Hook that is called before any token transfer. This includes
- calls to {send}, {transfer}, {operatorSend}, {transferFrom}, minting and burning.
- Calling conditions:
- - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens
- will be to transferred to `to`.
- - when `from` is zero, `amount` tokens will be minted for `to`.
- - when `to` is zero, `amount` of ``from``'s tokens will be burned.
- - `from` and `to` are never both zero.
- To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].
- == Hooks
- :tokensToSend: pass:normal[xref:#IERC777Sender-tokensToSend-address-address-address-uint256-bytes-bytes-[`++tokensToSend++`]]
- [.contract]
- [[IERC777Sender]]
- === `++IERC777Sender++` link:https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.9.5/contracts/token/ERC777/IERC777Sender.sol[{github-icon},role=heading-link]
- [.hljs-theme-light.nopadding]
- ```solidity
- import "@openzeppelin/contracts/token/ERC777/IERC777Sender.sol";
- ```
- Interface of the ERC777TokensSender standard as defined in the EIP.
- {IERC777} Token holders can be notified of operations performed on their
- tokens by having a contract implement this interface (contract holders can be
- their own implementer) and registering it on the
- https://eips.ethereum.org/EIPS/eip-1820[ERC1820 global registry].
- See {IERC1820Registry} and {ERC1820Implementer}.
- [.contract-index]
- .Functions
- --
- * {xref-IERC777Sender-tokensToSend-address-address-address-uint256-bytes-bytes-}[`++tokensToSend(operator, from, to, amount, userData, operatorData)++`]
- --
- [.contract-item]
- [[IERC777Sender-tokensToSend-address-address-address-uint256-bytes-bytes-]]
- ==== `[.contract-item-name]#++tokensToSend++#++(address operator, address from, address to, uint256 amount, bytes userData, bytes operatorData)++` [.item-kind]#external#
- Called by an {IERC777} token contract whenever a registered holder's
- (`from`) tokens are about to be moved or destroyed. The type of operation
- is conveyed by `to` being the zero address or not.
- This call occurs _before_ the token contract's state is updated, so
- {IERC777-balanceOf}, etc., can be used to query the pre-operation state.
- This function may revert to prevent the operation from being executed.
- :tokensReceived: pass:normal[xref:#IERC777Recipient-tokensReceived-address-address-address-uint256-bytes-bytes-[`++tokensReceived++`]]
- [.contract]
- [[IERC777Recipient]]
- === `++IERC777Recipient++` link:https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.9.5/contracts/token/ERC777/IERC777Recipient.sol[{github-icon},role=heading-link]
- [.hljs-theme-light.nopadding]
- ```solidity
- import "@openzeppelin/contracts/token/ERC777/IERC777Recipient.sol";
- ```
- Interface of the ERC777TokensRecipient standard as defined in the EIP.
- Accounts can be notified of {IERC777} tokens being sent to them by having a
- contract implement this interface (contract holders can be their own
- implementer) and registering it on the
- https://eips.ethereum.org/EIPS/eip-1820[ERC1820 global registry].
- See {IERC1820Registry} and {ERC1820Implementer}.
- [.contract-index]
- .Functions
- --
- * {xref-IERC777Recipient-tokensReceived-address-address-address-uint256-bytes-bytes-}[`++tokensReceived(operator, from, to, amount, userData, operatorData)++`]
- --
- [.contract-item]
- [[IERC777Recipient-tokensReceived-address-address-address-uint256-bytes-bytes-]]
- ==== `[.contract-item-name]#++tokensReceived++#++(address operator, address from, address to, uint256 amount, bytes userData, bytes operatorData)++` [.item-kind]#external#
- Called by an {IERC777} token contract whenever tokens are being
- moved or created into a registered account (`to`). The type of operation
- is conveyed by `from` being the zero address or not.
- This call occurs _after_ the token contract's state is updated, so
- {IERC777-balanceOf}, etc., can be used to query the post-operation state.
- This function may revert to prevent the operation from being executed.
- == Presets
- These contracts are preconfigured combinations of features. They can be used through inheritance or as models to copy and paste their source code.
- :constructor: pass:normal[xref:#ERC777PresetFixedSupply-constructor-string-string-address---uint256-address-[`++constructor++`]]
- [.contract]
- [[ERC777PresetFixedSupply]]
- === `++ERC777PresetFixedSupply++` link:https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.9.5/contracts/token/ERC777/presets/ERC777PresetFixedSupply.sol[{github-icon},role=heading-link]
- [.hljs-theme-light.nopadding]
- ```solidity
- import "@openzeppelin/contracts/token/ERC777/presets/ERC777PresetFixedSupply.sol";
- ```
- {ERC777} token, including:
- - Preminted initial supply
- - No access control mechanism (for minting/pausing) and hence no governance
- _Available since v3.4._
- [.contract-index]
- .Functions
- --
- * {xref-ERC777PresetFixedSupply-constructor-string-string-address---uint256-address-}[`++constructor(name, symbol, defaultOperators, initialSupply, owner)++`]
- [.contract-subindex-inherited]
- .ERC777
- * {xref-ERC777-name--}[`++name()++`]
- * {xref-ERC777-symbol--}[`++symbol()++`]
- * {xref-ERC777-decimals--}[`++decimals()++`]
- * {xref-ERC777-granularity--}[`++granularity()++`]
- * {xref-ERC777-totalSupply--}[`++totalSupply()++`]
- * {xref-ERC777-balanceOf-address-}[`++balanceOf(tokenHolder)++`]
- * {xref-ERC777-send-address-uint256-bytes-}[`++send(recipient, amount, data)++`]
- * {xref-ERC777-transfer-address-uint256-}[`++transfer(recipient, amount)++`]
- * {xref-ERC777-burn-uint256-bytes-}[`++burn(amount, data)++`]
- * {xref-ERC777-isOperatorFor-address-address-}[`++isOperatorFor(operator, tokenHolder)++`]
- * {xref-ERC777-authorizeOperator-address-}[`++authorizeOperator(operator)++`]
- * {xref-ERC777-revokeOperator-address-}[`++revokeOperator(operator)++`]
- * {xref-ERC777-defaultOperators--}[`++defaultOperators()++`]
- * {xref-ERC777-operatorSend-address-address-uint256-bytes-bytes-}[`++operatorSend(sender, recipient, amount, data, operatorData)++`]
- * {xref-ERC777-operatorBurn-address-uint256-bytes-bytes-}[`++operatorBurn(account, amount, data, operatorData)++`]
- * {xref-ERC777-allowance-address-address-}[`++allowance(holder, spender)++`]
- * {xref-ERC777-approve-address-uint256-}[`++approve(spender, value)++`]
- * {xref-ERC777-transferFrom-address-address-uint256-}[`++transferFrom(holder, recipient, amount)++`]
- * {xref-ERC777-_mint-address-uint256-bytes-bytes-}[`++_mint(account, amount, userData, operatorData)++`]
- * {xref-ERC777-_mint-address-uint256-bytes-bytes-bool-}[`++_mint(account, amount, userData, operatorData, requireReceptionAck)++`]
- * {xref-ERC777-_send-address-address-uint256-bytes-bytes-bool-}[`++_send(from, to, amount, userData, operatorData, requireReceptionAck)++`]
- * {xref-ERC777-_burn-address-uint256-bytes-bytes-}[`++_burn(from, amount, data, operatorData)++`]
- * {xref-ERC777-_approve-address-address-uint256-}[`++_approve(holder, spender, value)++`]
- * {xref-ERC777-_spendAllowance-address-address-uint256-}[`++_spendAllowance(owner, spender, amount)++`]
- * {xref-ERC777-_beforeTokenTransfer-address-address-address-uint256-}[`++_beforeTokenTransfer(operator, from, to, amount)++`]
- [.contract-subindex-inherited]
- .IERC20
- [.contract-subindex-inherited]
- .IERC777
- --
- [.contract-index]
- .Events
- --
- [.contract-subindex-inherited]
- .ERC777
- [.contract-subindex-inherited]
- .IERC20
- * {xref-IERC20-Transfer-address-address-uint256-}[`++Transfer(from, to, value)++`]
- * {xref-IERC20-Approval-address-address-uint256-}[`++Approval(owner, spender, value)++`]
- [.contract-subindex-inherited]
- .IERC777
- * {xref-IERC777-Minted-address-address-uint256-bytes-bytes-}[`++Minted(operator, to, amount, data, operatorData)++`]
- * {xref-IERC777-Burned-address-address-uint256-bytes-bytes-}[`++Burned(operator, from, amount, data, operatorData)++`]
- * {xref-IERC777-AuthorizedOperator-address-address-}[`++AuthorizedOperator(operator, tokenHolder)++`]
- * {xref-IERC777-RevokedOperator-address-address-}[`++RevokedOperator(operator, tokenHolder)++`]
- * {xref-IERC777-Sent-address-address-address-uint256-bytes-bytes-}[`++Sent(operator, from, to, amount, data, operatorData)++`]
- --
- [.contract-item]
- [[ERC777PresetFixedSupply-constructor-string-string-address---uint256-address-]]
- ==== `[.contract-item-name]#++constructor++#++(string name, string symbol, address[] defaultOperators, uint256 initialSupply, address owner)++` [.item-kind]#public#
- Mints `initialSupply` amount of token and transfers them to `owner`.
- See {ERC777-constructor}.
|