You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
interfaceIERC6551Registry {
/// @dev The registry SHALL emit the AccountCreated event upon successful account creationevent AccountCreated(
addressaccount,
addressimplementation,
uint256chainId,
addresstokenContract,
uint256tokenId,
uint256salt
);
/// @dev Creates a token bound account for an ERC-721 token.////// If account has already been created, returns the account address without calling create2.////// If initData is not empty and account has not yet been created, calls account with/// provided initData after creation.////// Emits AccountCreated event.////// @return the address of the accountfunction createAccount(
addressimplementation,
uint256chainId,
addresstokenContract,
uint256tokenId,
uint256salt,
bytescalldatainitData
) externalreturns (address);
/// @dev Returns the computed address of a token bound account////// @return The computed address of the accountfunction account(
addressimplementation,
uint256chainId,
addresstokenContract,
uint256tokenId,
uint256salt
) externalviewreturns (address);
}
Account Interface
/// @dev the ERC-165 identifier for this interface is `0x400a0398`interfaceIERC6551Account {
/// @dev Token bound accounts MUST implement a `receive` function.////// Token bound accounts MAY perform arbitrary logic to restrict conditions/// under which Ether can be received.receive() externalpayable;
/// @dev Executes `call` on address `to`, with value `value` and calldata/// `data`.////// MUST revert and bubble up errors if call fails.////// By default, token bound accounts MUST allow the owner of the ERC-721 token/// which owns the account to execute arbitrary calls using `executeCall`.////// Token bound accounts MAY implement additional authorization mechanisms/// which limit the ability of the ERC-721 token holder to execute calls.////// Token bound accounts MAY implement additional execution functions which/// grant execution permissions to other non-owner accounts.////// @return The result of the callfunction executeCall(
addressto,
uint256value,
bytescalldatadata
) externalpayablereturns (bytesmemory);
/// @dev Returns identifier of the ERC-721 token which owns the/// account////// The return value of this function MUST be constant - it MUST NOT change/// over time.////// @return chainId The EIP-155 ID of the chain the ERC-721 token exists on/// @return tokenContract The contract address of the ERC-721 token/// @return tokenId The ID of the ERC-721 tokenfunction token()
externalviewreturns (
uint256chainId,
addresstokenContract,
uint256tokenId
);
/// @dev Returns the owner of the ERC-721 token which controls the account/// if the token exists.////// This is value is obtained by calling `ownerOf` on the ERC-721 contract.////// @return Address of the owner of the ERC-721 token which owns the accountfunction owner() externalviewreturns (address);
/// @dev Returns a nonce value that is updated on every successful transaction////// @return The current account noncefunction nonce() externalviewreturns (uint256);
}