In the initial implementation, the authorization library facilitates the creation of Algorand Standard Assets on the Algorand blockchain. We will allow the following operations:
[ ] Creating a DRT
[ ] Sketch a trait FungibleAsset for managing assets
In milestone 1 we treat DRT transfer, redemption, etc. as a matter of convention and these operations will not be implemented in the current scope. Other tooling, like goal, can be used in the mean time for development and testing purposes.
An AssetCreationTransaction trait is provided which has an async create_asset() method, using the async-trait crate, that returns a basic result type.
The initial implementation of the library sketches the outline of an FungibleAsset trait by presenting an interface similar to that in ERC-20, as follows:
name() which returns an Option<String>, representing the asset name;
symbol() which returns an Option<String>, an abbreviation for the asset name e.g. USDC;
decimals() which returns a uint32, the number of digits after the decimal point;
total_supply() which returns a uint256, the number of minted assets;
balance_of(address: &[u8]) which returns the balance of the address as a uint256;
transfer_from(sender: &[u8], receiver: &[u8], value: uint256) which transfers an amount of the asset and returns some Result<bool,Err>;
Overview
In the initial implementation, the authorization library facilitates the creation of Algorand Standard Assets on the Algorand blockchain. We will allow the following operations:
FungibleAsset
for managing assetsIn milestone 1 we treat DRT transfer, redemption, etc. as a matter of convention and these operations will not be implemented in the current scope. Other tooling, like
goal
, can be used in the mean time for development and testing purposes.Implementation
Blockchain integration using algonaut library.
An
AssetCreationTransaction
trait is provided which has an asynccreate_asset()
method, using theasync-trait
crate, that returns a basic result type.The initial implementation of the library sketches the outline of an
FungibleAsset
trait by presenting an interface similar to that in ERC-20, as follows:name()
which returns anOption<String>
, representing the asset name;symbol()
which returns anOption<String>
, an abbreviation for the asset name e.g. USDC;decimals()
which returns auint32
, the number of digits after the decimal point;total_supply()
which returns auint256
, the number of minted assets;balance_of(address: &[u8])
which returns the balance of the address as auint256
;transfer_from(sender: &[u8], receiver: &[u8], value: uint256)
which transfers an amount of the asset and returns someResult<bool,Err>
;