📌Escrow
Overview
The Escrow
contract is designed to securely manage the escrow process for various types of assets including ERC-20 tokens, Ether, and ERC-721 (NFT) tokens.
It acts as an intermediary to hold assets until predefined conditions are met, providing a trustless mechanism for transactions between parties.
Methods
acceptToken
acceptToken
Accepts ERC-20 tokens into escrow.
Parameters
Parameter | Type | Description |
|
| Address of the ERC-20 token. |
|
| Amount of tokens to be escrowed. |
|
| Timestamp when the escrow will be unlocked. |
Returns
Return | Type | Description |
|
| Remaining balance of the sender post-transaction. |
acceptEth
acceptEth
Accepts Ether into escrow.
Parameters
Parameter | Type | Description |
|
| Timestamp when the escrow will be unlocked. |
Returns
Return | Type | Description |
|
| Amount of Ether sent to the contract. |
tokenTransaction
tokenTransaction
Retrieves the current state of an ERC-20 token transaction in escrow.
Parameters
Parameter | Type | Description |
|
| Address of the ERC-20 token. |
Returns
Return | Type | Description |
Tuple |
| Amount, lock status, spent status, and mature time. |
ethTransacton
ethTransacton
Retrieves the current state of an Ether transaction in escrow.
Returns
Return | Type | Description |
Tuple |
| Amount, lock status, spent status, and mature time. |
ethRelease
ethRelease
Admin function to unlock Ether in escrow.
Parameters
Return | Type | Description |
|
| Returns true if successful. |
ethWithdraw
ethWithdraw
Allows the seller to withdraw unlocked Ether.
Returns
Return | Type | Description |
|
| Returns true if successful. |
tokenRelease
tokenRelease
Admin function to unlock ERC-20 tokens in escrow.
Parameters
Parameter | Type | Description |
|
| Address of the ERC-20 token. |
Returns
Return | Type | Description |
|
| Returns true if successful. |
tokenWithdraw
tokenWithdraw
Allows the seller to withdraw unlocked ERC-20 tokens.
Parameters
Parameter | Type | Description |
|
| Address of the ERC-20 token. |
Returns
Return | Type | Description |
|
| Returns true if successful. |
acceptNFT
acceptNFT
Accepts an ERC-721 token into escrow.
Parameters
Parameter | Type | Description |
|
| Address of the ERC-721 token contract. |
|
| ID of the token. |
|
| Timestamp when the escrow will be unlocked. |
Returns
Return | Type | Description |
|
| ID of the accepted token. |
nftTransactions
nftTransactions
Retrieves current state of transactions in escrow for a specific ERC-721 token contract.
Parameters
Parameter | Type | Description |
|
| Address of the ERC-721 token contract. |
Returns
Return | Type | Description |
|
| An array of NFTTransaction structures. |
nftRelease
nftRelease
Admin function to unlock an ERC-721 token in escrow.
Parameters
Parameter | Type | Description |
|
| Address of the ERC-721 token contract. |
|
| Index of the token in the escrow. |
Returns
Return | Type | Description |
|
| Returns true if successful. |
nftWithdraw
nftWithdraw
Allows the seller to withdraw an unlocked ERC-721 token.
Parameters
Parameter | Type | Description |
|
| Address of the ERC-721 token contract. |
|
| Index of the token in the escrow. |
Returns
Return | Type | Description |
|
| Returns true if successful. |
Last updated