-
Notifications
You must be signed in to change notification settings - Fork 14
Utilities and features
A standard interface allows any tokens to be re-used by other applications: from wallets to decentralized exchanges.
- The following specification AEX-9 is following the well-known ERC20 standard introduced in Ethereum for creating, handling and interacting with fungible tokens.
- This standard is proven to be working and we think we can leverage of using it. It will also help us with interoperability and easier developers on-boarding as the main differences will be Sophia syntax related.
The following standard allows for the implementation of a standard API for tokens within smart contracts. This standard provides basic functionality to transfer tokens, as well as allow tokens to be approved so they can be spent by another on-chain third party.
There are several implementations available at the moment, which are still in develop progress but the preferred one and used is this one.
After deploying the token contract in order to do calls, and in generally to interact with Sophia Smart Contracts we use @aeternity/aepp-sdk/es/ae/universal
Main functions in Waellet that are used are:
-
create_allowance
for creating allowance forfor_account
-
transfer_allowance
for transferring tokens fromfrom_account
forfor_account
-
allowance
for getting the allowed spendable amount fromfrom_account
forfor_account
-
allowances
for getting all allowances for the current smart contract. Тo select the fungible token, that user wants to interact with in Create and Transfer is also required field.
This feature allows the user to add custom tokens and deploy their own Fungible tokens
To add Fungible Token you need to specify - address of deployed Fungible token contract, token symbol and token precision. When address is entered method meta_info
from the contract is called. If response is return the entered address is valid Fungible token contract and the user can add this token. This feature use @aeternity/aepp-sdk/es/ae/universal to interact with Sophia Smart Contracts
this.sdk.contractCallStatic(FUNGIBLE_TOKEN_CONTRACT,address,'meta_info')
This feature allows the user to deploy a fungible token smart contract. Name
, symbol
and decimals
(precision) parameters are required to deploy a new token. After entering the required values contract create transaction is being made which deploys the contract to the selected Aeternity network. After deployment, the token is added in the list of user's available tokens.
We use @aeternity/aepp-sdk/es/ae/universal for contract deployments on aeternity.
This feature allows the user to send a given amount of tokens to the website owner. When the tip page is opened the URL of the visited page is passed to the claim
method of the Waellet Tipping Contract. Sending the selected tip is also a call to the Waellet Tipping Contract