ERC 777
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.
Methods
allowance
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.
Parameters
holder
address
undefined
spender
address
undefined
Returns
_0
uint256
undefined
approve
See {IERC20-approve}. Note that accounts cannot have allowance issued by their operators.
Parameters
spender
address
undefined
value
uint256
undefined
Returns
_0
bool
undefined
authorizeOperator
See {IERC777-authorizeOperator}.
Parameters
operator
address
undefined
balanceOf
Returns the amount of tokens owned by an account (tokenHolder
).
Parameters
tokenHolder
address
undefined
Returns
_0
uint256
undefined
burn
See {IERC777-burn}. Also emits a {IERC20-Transfer} event for ERC20 compatibility.
Parameters
amount
uint256
undefined
data
bytes
undefined
decimals
See {ERC20-decimals}. Always returns 18, as per the ERC777 EIP.
Returns
_0
uint8
undefined
defaultOperators
See {IERC777-defaultOperators}.
Returns
_0
address[]
undefined
granularity
See {IERC777-granularity}. This implementation always returns 1
.
Returns
_0
uint256
undefined
isOperatorFor
See {IERC777-isOperatorFor}.
Parameters
operator
address
undefined
tokenHolder
address
undefined
Returns
_0
bool
undefined
name
See {IERC777-name}.
Returns
_0
string
undefined
operatorBurn
See {IERC777-operatorBurn}. Emits {Burned} and {IERC20-Transfer} events.
Parameters
account
address
undefined
amount
uint256
undefined
data
bytes
undefined
operatorData
bytes
undefined
operatorSend
See {IERC777-operatorSend}. Emits {Sent} and {IERC20-Transfer} events.
Parameters
sender
address
undefined
recipient
address
undefined
amount
uint256
undefined
data
bytes
undefined
operatorData
bytes
undefined
revokeOperator
See {IERC777-revokeOperator}.
Parameters
operator
address
undefined
send
See {IERC777-send}. Also emits a {IERC20-Transfer} event for ERC20 compatibility.
Parameters
recipient
address
undefined
amount
uint256
undefined
data
bytes
undefined
symbol
See {IERC777-symbol}.
Returns
_0
string
undefined
totalSupply
See {IERC777-totalSupply}.
Returns
_0
uint256
undefined
transfer
See {IERC20-transfer}. Unlike send
, recipient
is not required to implement the {IERC777Recipient} interface if it is a contract. Also emits a {Sent} event.
Parameters
recipient
address
undefined
amount
uint256
undefined
Returns
_0
bool
undefined
transferFrom
See {IERC20-transferFrom}. 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.
Parameters
holder
address
undefined
recipient
address
undefined
amount
uint256
undefined
Returns
_0
bool
undefined
Events
Approval
Parameters
owner indexed
address
undefined
spender indexed
address
undefined
value
uint256
undefined
AuthorizedOperator
Parameters
operator indexed
address
undefined
tokenHolder indexed
address
undefined
Burned
Parameters
operator indexed
address
undefined
from indexed
address
undefined
amount
uint256
undefined
data
bytes
undefined
operatorData
bytes
undefined
Minted
Parameters
operator indexed
address
undefined
to indexed
address
undefined
amount
uint256
undefined
data
bytes
undefined
operatorData
bytes
undefined
RevokedOperator
Parameters
operator indexed
address
undefined
tokenHolder indexed
address
undefined
Sent
Parameters
operator indexed
address
undefined
from indexed
address
undefined
to indexed
address
undefined
amount
uint256
undefined
data
bytes
undefined
operatorData
bytes
undefined
Transfer
Parameters
from indexed
address
undefined
to indexed
address
undefined
value
uint256
undefined
Last updated