EscrowFacet
event Erc20Deposited(uint256 _tokenId, address _erc20Contract, address _from, address _to, uint256 _depositAmount)
event TransferEscrow(uint256 _tokenId, address _erc20Contract, address _from, address _to, uint256 _transferAmount)
function gotchiEscrow(uint256 _tokenId) public view returns (address)
function depositERC20(uint256 _tokenId, address _erc20Contract, uint256 _value) public
Allow the deposit of an ERC20 token to the escrow contract of a claimed aavegotchi
Will throw if token being deposited is same as collateral token for the aavegotchi
Name | Type | Description |
---|---|---|
_tokenId | uint256 | The identifier of the NFT receiving the ERC20 token |
_erc20Contract | address | The contract address of the ERC20 token to be deposited |
_value | uint256 | The amount of ERC20 tokens to deposit |
function batchDepositERC20(uint256[] _tokenIds, address[] _erc20Contracts, uint256[] _values) external
Allow the deposit of multiple ERC20 tokens to the escrow contract of a multiple claimed aavegotchis
Will throw if one of the tokens being deposited is same as collateral token for the corresponding aavegotchi
Name | Type | Description |
---|---|---|
_tokenIds | uint256[] | An array containing the identifiers of the NFTs receiving the ERC20 tokens |
_erc20Contracts | address[] | An array containing the contract addresses of the ERC20 tokens to be deposited |
_values | uint256[] | An array containing the amounts of ERC20 tokens to deposit |
function batchDepositGHST(uint256[] _tokenIds, uint256[] _values) external
Allow the deposit of GHST into the escrow of multiple aavegotchis
Name | Type | Description |
---|---|---|
_tokenIds | uint256[] | An array containing the identifiers of the NFTs receiving GHST |
_values | uint256[] | An array containing the amounts of ERC20 tokens to deposit into each aavegotchi |
function escrowBalance(uint256 _tokenId, address _erc20Contract) external view returns (uint256)
Query the balance of any ERC20 token being hekd in the escrow of an aavegotchi
Name | Type | Description |
---|---|---|
_tokenId | uint256 | Identifier of NFT to query |
_erc20Contract | address | Contract address of ERC20 token to query |
Name | Type | Description |
---|---|---|
[0] | uint256 | The balance of the escrow contract in _erc20Contract tokens |
function transferEscrow(uint256 _tokenId, address _erc20Contract, address _recipient, uint256 _transferAmount) external
Allow the owner of the aavegotchi to transfer out any ERC20 token in the escrow to an external address
Will throw if there is an attempt to transfer out the collateral ERC20 token
Name | Type | Description |
---|---|---|
_tokenId | uint256 | Identifier of NFT holding the ERC20 token |
_erc20Contract | address | Contract address of ERC20 token to transfer out |
_recipient | address | Address of the receiver |
_transferAmount | uint256 | Amount of ERC20 tokens to transfer out |