The Rates ADO is a smart contract that can be used to hold rates configurations for other ADOs. Instead of setting up the rate on the ADO itself, the ADO can reference this ADO to extract the rates set up and apply them on the ADO. These rates can be used to add a fee that is payed on a messages whether a tax or royalty.
We have seen in the AndromedaMsg section that rates can be applied on ADOs that have the rates feature enabled. This ADO can be referenced by those ADOs to apply the rates specified here.
ado_type: rates
Version: 2.0.1-beta.1
By actions, we are referring to execute messages.
Name | Type | Description |
---|---|---|
Only available to the ADO owner
Sets a rate on the specified action.
An enum specifying the type of the rate.
Additive: The rate amount acts as a tax and is added to the price and payed by the buyer. For example a 10% additive rate (with one recipient) on a price of 1000 uandr means the buyer has to send 1100 uandr.
Deductive: The rate amount acts as a royalty and is deducted from the price. For example a 10% deductive rate on a price of 1000 uandr means the buyer needs to send 1000 uand and 100 will be taken to the recipient of the rate.
Percentage is specified as a decimal. This means a rate of 10% is specified as 0.1 and not 10.
Percent: The rate is specified as a percentage of the price using decimal.
Flat: The rate is specified as a fixed amount of Coin.
Only available to the ADO owner.
Removes the rate set on the specified action.
The rest of the execute messages can be found in the ADO Base section.
Queries the rates applied for the specified action.
Returns a LocalRate struct containing the configurations of the rate.
The rest of the query messages can be found in the ADO Base section.
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
action
String
The message to apply the rates on.
rate
The rate configurations.
kernel_address
String
Contract address of the kernel contract to be used for AMP messaging. Kernel contract address can be found in our deployed contracts.
owner
Option<String>
Optional address to specify as the owner of the ADO being created. Defaults to the sender if not specified.
action
String
The execute message to add rates on.
rate
The rate configurations.
rate_type
The type of rate.
recipients
Vec<Recipient>
The addresses to recieve the rates. Each address specified will receive the full amount of rate. For example, having a rate of 5% and 2 recipients means each address will receive a 5% rate.
value
The amount of funds taken.
description
Option<String>
Optional description for the purpose of the rate.
action
String
The execute message to remove the rates from.