Skip to content

ERC721AssetVault

ERC721AssetVault

_inventory

mapping(address => mapping(uint256 => address)) _inventory

Vault inventory Mapping token address -> token ID -> owner.

constructor

constructor(address operator, address acl) public

Constructor.

Name Type Description
operator address First operator account.
acl address ACL contract address

onERC721Received

function onERC721Received(address operator, address from, uint256 tokenId, bytes) external returns (bytes4)

_Whenever an {IERC721} `tokenId` token is transferred to this contract via {IERC721-safeTransferFrom} by `operator` from `from`, this function is called.

It must return its Solidity selector to confirm the token transfer. If any other value is returned or the interface is not implemented by the recipient, the transfer will be reverted.

The selector can be obtained in Solidity with `IERC721Receiver.onERC721Received.selector`._

returnToOwner

function returnToOwner(address token, uint256 tokenId) external

Transfers the asset to the original owner, registered upon deposit. NOTE: The asset is always returns to the owner. There is no way to send the `asset` to an arbitrary address.

Name Type Description
token address Token address.
tokenId uint256 Token ID.

assetClass

function assetClass() external pure returns (bytes4)

Returns vault asset class.

Name Type Description
[0] bytes4 Asset class ID.

supportsInterface

function supportsInterface(bytes4 interfaceId) public view virtual returns (bool)

_Returns true if this contract implements the interface defined by `interfaceId`. See the corresponding https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section] to learn more about how these ids are created.

This function call must use less than 30 000 gas._