Timelock
The Timelock ADO or Escrow ADO is a smart contract built to hold funds (Native coins) for a period of time until the set condition is satisfied.
There are two main conditions that can be used by the contract:
Expiration: A time expiration to when the funds can be released.
MinimumFunds: A minimum amount of funds to be deposited before they can be released.
Once a condition is satisfied, the funds can be released by anyone.
Ado_type: timelock
Version: 2.0.2-beta.1
InstantiateMsg
Name | Type | Description |
---|---|---|
| String | Contract address of the kernel contract to be used for AMP messaging. Kernel contract address can be found in our deployed contracts. |
| Option<String> | Optional address to specify as the owner of the ADO being created. Defaults to the sender if not specified. |
ExecuteMsg
HoldFunds
Holds sent funds in escrow.
Name | Type | Description |
---|---|---|
| Option<Recipient> | Optional recipient address. If not set, defaults to the sender. |
| Option<EscrowCondition> | An optional condition to unlock the Escrow. |
EscrowCondition
Enum used to specify the condition which must be met in order for the Escrow to unlock.
The Expiration timestamp is taken in nanosecond precision. Using another precision will give a "Time in the past" error.
EscrowCondition Type | Type | Description |
---|---|---|
| Requires a given time to be reached. The time is specified in milliseconds. | |
| Vec<Coin> | Requires a minimum amount of funds to be deposited. |
ReleaseFunds
Releases any held funds by the specified recipient.
Name | Type | Description |
---|---|---|
| Option<String> | Optional address to release the funds for. Will default to the sender if not specified. |
| Option<String> | An optional address for which to start after, used for pagination. |
| Option<u32> | Optional limit to the number of timelocks to attempt to unlock. Defaults to 10 and can be set to a maximum of 30. |
ReleaseSpecificFunds
Release funds held by the owner
to the recipient
. (The recipient has to be the same as the one defined when the owner executed HoldFunds
)
Name | Type | Description |
---|---|---|
| String | The address of the funds to be released. |
| Option<String> | Optional address to receive the released funds. Will default to the sender if not specified. |
Base Executes
The rest of the execute messages can be found in the ADO Base section.
QueryMsg
GetLockedFunds
Query any held funds for an address.
Name | Type | Description |
---|---|---|
| String | The address of the owner of the funds. |
| String | The address of the recipient of the funds. |
GetLockedFundsResponse
Name | Type | Description |
---|---|---|
| Option<Escrow> | Optional Escrow with the held funds and related information. |
GetLockedFundsForRecipient
Queries the locked funds for the specified recipient.
Name | Type | Description |
---|---|---|
| String | The address of the recipient.. |
| Option<String> | An optional address for which to start after, used for pagination. |
| Option<u32> | Optional limit to the number timelocks to attempt to query. Defaults to 10 and can be set to a maximum of 30. |
GetLockedFundsForRecipientResponse
Name | Type | Description |
---|---|---|
| Vec<Escrow> | Optional Escrow with the held funds and related information. |
Escrow
The time-lock contract uses a basic struct to store a record of funds being held.
Name | Type | Description |
---|---|---|
| Vec<Coin> | Funds being held within the Escrow. |
| Option<EscrowCondition> | Optional condition for the Escrow. |
| The recipient of the funds once |
Base Queries
The rest of the query messages can be found in the ADO Base section.