fip | title | status | type | author | created | updated |
---|---|---|---|---|---|---|
49 |
FIO Domain Auto-renew On-chain |
Draft |
Functionality |
Pawel Mastalerz <[email protected]> |
2024-09-18 |
2024-09-19 |
This FIP will let anyone set an auto-renew option on a domain and if they do, the domain will automatically be renewed before expiration date using funds of the account which set the auto-renew.
Contract | Action | Endpoint | Description |
---|---|---|---|
fio.address | setdomrenew | /set_fio_domian_autorenew | Sets FIO Domain to auto-renew. |
FIO Domains need to be renewed or they will be burned. Although the FIO Domain can be registered or renewed for multiple years, most users renew domains every year. The blockchain does not allow renewal notifications that many users are used to in Web2 world. As a result domains are sometimes forgotten to be renewed and are burned along with all associated FIO Handles. Auto-renew action will let users, who have FIO Tokens in account, set auto-renewal flag and have the domain renew automatically. In fact it may encourage some users to keep FIO in their accounts.
- User sets a domain to be renewed using adddomrenew
- Any user can set auto-renew on any domain.
- More than one account can have auto-renew set on the same domain.
- User calls renewdomains
- Any user can make this call and it will renew domains from all users. It carries no fee if renewal is executed and returns exception if there are no renewals to be executed. It works similarily to burnexpired.
- Domains which are set to expire in less than 7 days and have auto-renew set are identified.
- If more than one account is set to renew the same domain, the first account which set the renewal flag is identified.
- If account has no funds, auto-renewal flag is removed.
- Domain is renewed or exception is returned.
- When domain is renewed TPID passed in the setdomrenew is paid the TPID reward.
- User removes renewal flag using remdomrenew
- Only user who set a renewal flag on specific domain can remove it.
- Flag is removed and auto-renewal will not be conducted by this account.
Adds auto-renewal to a FIO Domain.
New fee: add_fio_domian_autorenew, not bundle-eligible, fee amount will be determined during development and updated here
Parameter | Required | Format | Definition |
---|---|---|---|
fio_domain | Yes | Valid FIO Domain | FIO Domain to auto-renew. |
max_fee | Yes | Positive Int | Maximum amount of SUFs the user is willing to pay for fee. Should be preceded by /get_fee for correct value. |
tpid | Yes | FIO Address | FIO Address of the entity which generates this transaction. TPID rewards will be paid to this address. Set to empty if not known. Auto-renew transactions will carry this TPID. |
actor | Yes | 12 character string | Valid actor of signer |
{
"fio_domain": "safu",
"max_fee": 30000000000,
"tpid": "rewards@wallet",
"actor": "aftyershcu22"
}
- Request is validated per Exception handling.
- RAM of actor calling action is increased.
- add_fio_domian_autorenew is charged to actor calling action.
- Check for maximum FIO transaction size is applied.
- FIO Domain set to be renewed by calling account with calling TPID.
Error condition | Trigger | Type | fields:name | fields:value | Error message |
---|---|---|---|---|---|
Invalid FIO Domain | Format of FIO Domain not valid or FIO Domain does not exist. | 400 | "fio_domain" | Value sent in, i.e. "-purse&purse" | "FIO Domain does not exist." |
Renewal alreday set | Renewal flag is already set for this domain by calling account. | 400 | "fio_domain" | Value sent in, i.e. "safu" | "Renewal alreday set for this FIO Domain." |
Invalid fee value | max_fee format is not valid | 400 | "max_fee" | Value sent in, e.g. "-100" | "Invalid fee value" |
Fee exceeds maximum | Actual fee is greater than supplied max_fee | 400 | "max_fee" | Value sent in, e.g. "1000000000" | "Fee exceeds supplied maximum" |
Insufficient balance | Available balance in account is less than fee | 400 | "max_fee" | Value sent in, e.g. "100000000000" | "Insufficient balance" |
Invalid TPID | tpid format is not valid | 400 | "tpid" | Value sent in, e.g. "notvalidfioaddress" | "TPID must be empty or valid FIO address" |
Signer not actor | Signer not actor | 403 | Type: invalid_signature |
Parameter | Format | Definition |
---|---|---|
status | String | OK if successful |
expiration | date-time | Timestamp of domain expiration |
fee_collected | Int | Amount of SUFs collected as fee |
{
"status": "OK",
"expiration": "2020-09-11T18:30:56",
"fee_collected": 1000000000
}
Removes auto-renewal from FIO Domain.
New fee: remove_fio_domian_autorenew, not bundle-eligible, fee amount will be determined during development and updated here
Parameter | Required | Format | Definition |
---|---|---|---|
fio_domain | Yes | Valid FIO Domain | FIO Domain from which auto-renew should be removed. |
max_fee | Yes | Positive Int | Maximum amount of SUFs the user is willing to pay for fee. Should be preceded by /get_fee for correct value. |
tpid | Yes | FIO Address | FIO Address of the entity which generates this transaction. TPID rewards will be paid to this address. Set to empty if not known. Auto-renew transactions will carry this TPID. |
actor | Yes | 12 character string | Valid actor of signer |
{
"fio_domain": "safu",
"max_fee": 30000000000,
"tpid": "rewards@wallet",
"actor": "aftyershcu22"
}
- Request is validated per Exception handling.
- RAM of actor calling action is increased.
- remove_fio_domian_autorenew is charged to actor calling action.
- Check for maximum FIO transaction size is applied.
- FIO Domain auto-renew flag for calling account is removed.
Error condition | Trigger | Type | fields:name | fields:value | Error message |
---|---|---|---|---|---|
Invalid FIO Domain | Format of FIO Domain not valid or FIO Domain does not exist. | 400 | "fio_domain" | Value sent in, i.e. "-purse&purse" | "FIO Domain does not exist." |
FIO Domain not set to auto-renew by calling account | FIO Domain is not set to bne renewed. | 400 | "fio_domain" | Value sent in, i.e. "safu" | "FIO Domain not set to auto-renew by calling account." |
Invalid fee value | max_fee format is not valid | 400 | "max_fee" | Value sent in, e.g. "-100" | "Invalid fee value" |
Fee exceeds maximum | Actual fee is greater than supplied max_fee | 400 | "max_fee" | Value sent in, e.g. "1000000000" | "Fee exceeds supplied maximum" |
Insufficient balance | Available balance in account is less than fee | 400 | "max_fee" | Value sent in, e.g. "100000000000" | "Insufficient balance" |
Invalid TPID | tpid format is not valid | 400 | "tpid" | Value sent in, e.g. "notvalidfioaddress" | "TPID must be empty or valid FIO address" |
Signer not actor | Signer not actor | 403 | Type: invalid_signature |
Parameter | Format | Definition |
---|---|---|
status | String | OK if successful |
expiration | date-time | Timestamp of domain expiration |
fee_collected | Int | Amount of SUFs collected as fee |
{
"status": "OK",
"expiration": "2020-09-11T18:30:56",
"fee_collected": 1000000000
}
Renew FIO Domains which have auto-renew flag set.
None
- Request is validated per Exception handling.
- RAM of actor calling action is increased.
- FIO Domains which are past expiration date - 7 days are renewed, see Process above.
Error condition | Trigger | Type | fields:name | fields:value | Error message |
---|---|---|---|---|---|
No FIO Domains to Renew | There are no domains to renew. | 404 | "No FIO Domains to Renew" | ||
Signer not actor | Signer not actor | 403 | Type: invalid_signature |
Parameter | Format | Definition |
---|---|---|
status | String | OK if successful |
renewed_domains | Int | Number of FIO Domains which were renewed. |
{
"status": "OK",
"renewed_domains": 1
}
Auto-renewal accounts are added to response.
Unchanged
Group | Parameter | Format | Definition |
---|---|---|---|
fio_domains | fio_domain | String | FIO Domain. |
fio_domains | expiration | String | Date when domain expires. |
fio_domains | is_public | Int | 0 - domain is not public; 1 - domain is public. |
fio_domains | auto_renew_accounts | Array | Array of accounts which have set the domain to auto-renew or empty array if none. |
{
"fio_domains": [
{
"fio_domain": "alice",
"expiration": "2020-09-11T18:30:56",
"is_public": 0,
"auto_renew" {"aftyershcu22"}
}
]
}
TBD
TBD
No changes to existing actions.
None