dERP SBT Contract

Controlled dPASS Minting

Lunarspace created a 'soulbound token' or SBT that is used for access control. This token is called the dPASS.

The dERP SBT Contract is used to manage the creation, minting and control of the dPASS tokens. The contract uses the mint message to mint a new dPASS token, which requires the input of the owner of the token, and an optional input of ‘token_uri’. The ‘add_minter’ message is used to add a minter to the contract, which is a user who is authorized to mint new dPASS tokens. This message requires the input of minter which is the address of the user who will be added as minter. The ‘remove_minter’ message is used to remove a minter from the contract, which is a user who is no longer authorized to mint new dERP SBT tokens. This message also requires the "address" of the user to be passed as a parameter in the object.

The ‘enable_admin’ message type is used to grant admin privileges to a user. This message also requires the "address" of the user to be passed as a parameter in the object.

Token Management

The dERP SBT Contract is focused on the management of the dERP tokens (SBT). The instantiate message type takes in three required parameters: admin, name, and symbol. The admin parameter is a string that represents the admin address of the SBT, the name parameter is a string that represents the name of the SBT, and the symbol parameter is a string that represents the symbol of the SBT.

The execute message type in the dERP SBT Contract contains three options: ‘mint’, ‘add_minter’ and ‘remove_minter’.

  • 'mint' message type: used to mint new tokens and requires an object with the owner parameter, which is a string representing the address of the token owner and an optional ‘token_uri’ parameter, which is a string representing the Universal Resource Identifier (URI) of the token.

  • ‘add_minter’ message type: used to add a minter address and requires an object with the minter parameter, which is a string representing the minter's address.

  • ‘remove_minter’ message type: used to remove a minter address and requires an object with the minter parameter, which is a string representing the minter's address.

Querying

The query message type in the dERP SBT Contract contains two options: ‘holds_sbt’ and ‘owner_of’. The ‘holds_sbt’ message type is used to check if an address holds a certain amount of SBT and requires an object with the ‘addr’ parameter, which is a string representing the address. The ‘owner_of’ message type is used to check the owner of a certain token ID and requires an object with the ‘token_id’ parameter, which is an integer representing the token ID.

The dERP SBT Contract includes the "total_supply" query which returns the total number of tokens that have been minted. The "balance_of" query takes an "addr" parameter, which is the address of a user, and returns the number of tokens that user holds. The "owner_of" query takes a "token_id" parameter, which is the unique identifier of a token, and returns the address of the owner of that token.

Last updated