- Location:
xlink-dao/contracts/liabtc/liabtc-mint-registry.clar
The liabtc-mint-registry
is the data and treasury counterpart to the liabtc-mint-endpoint
contract. It manages the storage of burn requests data and serves as the aBTC
treasury during burn operations.
Although it is primarly designed to be called by the liabtc-mint-endpoint
, this registry can function as a general vault accesible to governance roles (LISA DAO or enabled extensions).
What actions can this contract do?
- Create new burn requests, each tracked using a unique nonce.
- Update any field of a burn request, including its status.
- Transfer a specified token1 from its balance to a designated recipient. The caller specifies the token, recipient and transfer amount.
The following functions are guarded by the is-dao-or-extension
function. These features are resticted to the LISA DAO or enabled extensions.
Creates or modifies burn requests in the burn-requests
map as specified in the details
parameter. It is called by the functions request-burn
, revoke-burn
and finalize-burn
in the liabtc-mint-endpoint
contract.
New requests are created by passing u0
as the request-id
parameter. On each request creation, the burn-request-nonce
variable is incremented by one, resulting in the id of the new request.
Name | Type |
---|---|
request-id |
uint |
details |
{ requested-by: principal, amount: uint, requested-at: uint, status: (buff 1) } |
Calls the transfer
function of the token-trait
passed with as-contract
privilege. The caller has the ability to send tokens from the registry's balance to a designated recipient
.
Name | Type |
---|---|
amount |
uint |
recipient |
principal |
token-trait |
<sip-010-trait> |
Standard protocol function to check whether the contract-caller
is an enabled extension within the DAO or the tx-sender
is the DAO itself (proposal execution scenario). The enabled extension check is delegated to the LISA's executor-dao
contract.
Returns the burn-request-nonce
variable.
Returns the burn request on the burn-requests
map at a given key. If there is no entry for the provided request-id
, throws.
Name | Type |
---|---|
request-id |
uint |
Data | Type |
---|---|
Variable | uint |
Indicates the request-id
of the last burn request created. This variable can only monotonically increase. It initialized as u0
, the key that will always have an empty value.
Data | Type |
---|---|
Map | uint { requested-by: principal, amount: uint, requested-at: uint, status: (buff 1) } |
Map that stores the burn requests, typically used by the liabtc-mint-endpoint
.
Type | Value |
---|---|
buff 1 |
0x00 |
Burn request pending status. When created, burn requests start with this status.
Type | Value |
---|---|
buff 1 |
0x01 |
Burn request finalize status.
Type | Value |
---|---|
buff 1 |
0x02 |
Burn request revoked status.
<sip-010-trait>
: Interaction with potentially any contract implementing the official SIP-010 occurs when thetransfer
function is called.
'SP2XD7417HGPRTREMKF748VNEQPDRR0RMANB7X1NK.executor-dao
: This contract is exclusively called by theis-dao-or-extension
function for authorizing governance operations.
Error Name | Value |
---|---|
err-unauthorised |
(err u1000) |
err-unknown-request-id |
(err u1008) |
Footnotes
-
The token just needs to comply with the official SIP-010. ↩