liabtc-mint-registry
Last updated
Last updated
Location: xlink-dao/contracts/liabtc/liabtc-mint-registry.clar
The liabtc-mint-registry
is the data and treasury counterpart to the 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 from its balance to a designated recipient. The caller specifies the token, recipient and transfer amount.
The following functions are guarded by the function. These features are resticted to the LISA DAO or enabled extensions.
set-burn-request
Creates or modifies burn requests in the map as specified in the details
parameter. It is called by the functions , and in the contract.
New requests are created by passing u0
as the request-id
parameter. On each request creation, the variable is incremented by one, resulting in the id of the new request.
Parameters
request-id
uint
details
{ requested-by: principal, amount: uint, requested-at: uint, status: (buff 1) }
transfer
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
.
Parameters
amount
uint
recipient
principal
token-trait
<sip-010-trait>
is-dao-or-extension
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.
get-burn-request-nonce
get-burn-request-or-fail
request-id
uint
burn-request-nonce
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.
burn-requests
Map
uint { requested-by: principal, amount: uint, requested-at: uint, status: (buff 1) }
PENDING
buff 1
0x00
Burn request pending status. When created, burn requests start with this status.
FINALIZED
buff 1
0x01
Burn request finalize status.
REVOKED
buff 1
0x02
Burn request revoked status.
err-unauthorised
(err u1000)
err-unknown-request-id
(err u1008)
Returns the variable.
Returns the burn request on the map at a given key. If there is no entry for the provided request-id
, throws.
Map that stores the burn requests, typically used by the .
<sip-010-trait>
: Interaction with potentially any contract implementing the occurs when the function is called.
'SM26NBC8SFHNW4P1Y4DFH27974P56WN86C92HPEHH.lisa-dao
: This contract is exclusively called by the function for authorizing governance operations.