ADVANCED TUTORIAL
ADVANCED TUTORIAL
Information on this page is not yet updated according to the changes in Equivalence Protocol V2
2) Interacting with the Equivalence Protocol
and Equivalence Protocol Wrapper smart contracts
and Equivalence Protocol Wrapper smart contracts
To get to the smart contract of Equivalence Protocol use this link.
To get to the smart contract of Equivalence Protocol Wrapper use this link.
Or alternatively you can:
Open https://etherscan.io/ and search for the address of the smart-contract.
(Equivalence Protocol address: 0xFdDCb0760F61f486fF0Ee65fc8C5014FCF586dB1)
(Equivalence Protocol Wrapper address: 0x3D5F126692BaBe95c2a9C2c412eC169a10fcecb8)
After that, select "Contract" and "Write Contract" as shown below.
To be able to use the functions of the contract, press button "Connect to Web3" and confirm the pop-up window.
a) Minting of tokens (only for Equivalence Protocol)
Minting is usually the most effective way of getting tokens - it cost less gas and there is no slippage.
Minting is only available when the total supply of tokens is below 100,000,000.
Minting of tokens means creating new tokens - this is done in exchange for ETH.
You can mint tokens by clicking on the function "mint", on the screenshot above it has the number 7.
After you click on the function, you need to enter the amount of ETH you want to use, then press "Write".
You will receive the amount of Equivalence Tokens into your wallet, according to the market price.
b) Transferring the tokens
To transfer tokens you can use the functions “transfer”, “transferFrom” and "transferExactAmount".
!!!IMPORTANT!!! - when you enter the amount, keep in mind it is in the smallest units of the token, that mean 10-18, decimal point is not supported. To send 1 token, you have to set the value 1018.
You can find tools for the conversion of Wei to Ether online (Wei is the smallest unit of Ether, also 10-18, so the calculation is the same), or use "+" sign next to the amount to select number of zeros.
-     The function “transfer” works the same way as transferring the tokens directly in Metamask, you need to input the address which will receive the tokens and amount. After filling those parameters in, press "Write" and your wallet should automatically pop-up to ask you for confirmation.
-     The function “transferFrom” can be used to transfer tokens between any two addresses, even when neither of them is yours. You need to enter the address of sender, the recipient and the amount of tokens (keep in mind that the amount is in Wei). After filling those parameters in, press "Write" and your wallet should automatically pop-up to ask you for confirmation.
You can use this function for example to ask for payment from someone else. The address from which the tokens are sent must approve your address to allow you to spend the amount of the tokens you want to send.
(functions “approve” or “increaseAllowance” are used to approve the address to spend the tokens, a description of these functions is in part C) of this tutorial)
-     The function “transferExactAmount” works the same way as the “transferFrom”, with one difference – the transfer fee is calculated on top of the amount, not subtracted from it.
This mean the amount received by the recipient is exactly the same as the amount you enter, but from your wallet will be charged a fee on top of the amount. Fee calculations had to be adapted to stay approximately the same in relation to the final amount which is being send.
(This behavior of fees could not be included in the standardized functions “transfer” and “transferFrom”, because it would make the token incompatible with Uniswap and other Dapps. Instead, the additional function “transferExactAmount” was created to give you the possibility to send the exact amount of tokens when necessary, regardless of any fees.)
You need to enter the address of sender, the recipient and the amount of tokens (keep in mind that the amount is in Wei). After filling those parameters in, press "Write" and your wallet should automatically pop-up to ask you for confirmation.
c) Approving another address to spend your tokens
Interaction with some smart-contracts may require those contracts to be able to burn or transfer your tokens in exchange for services provided by such a contract. Nobody can spend your tokens without your approval, regardless of whether it's a regular wallet or smart-contract.
To approve the address to spend your tokens, use the function "approve". Set the address which you are approving to spend your tokens and input the amount of tokens you will allow to be spent (including 18 zeros for decimal places, or you can adjust the amount you are approving later, when you confirm the transaction in Metamask). Confirm the values you set by pressing "Write".
If you would like to change the approved amount, you can use functions "increaseAllowance" to increase the amount you approved or "decreaseAllowance" do decrease it. Both of these functions work in the same manner as function "approve".
d) Participating in the Rewards program (only for Equivalence Protocol)
Any holder of the tokens can participate in the program and earn rewards over time. The reward percentage depends on the current supply and when the supply is above the intended supply, there is no reward at all. Participating in the Rewards program will slightly increase the gas needed to use the functions, which change your balance. For the details see the section "Fees and Rewards".
The function "registerForRewards" will register your address to the Rewards program.
The function "pauseRewards" will remove your address from the Rewards program (and also decrease gas consumption)
These functions do not require any parameters, just click on the function, press write and confirm the transaction in your wallet.
e) Wrapping and Unwrapping the tokens (only for the Equivalence Protocol Wrapper)
Any holder of the tokens can convert between the standard EQT and the wrapped version WEQT by using the following functions of the Equivalence Protocol Wrapper:
Function "wrapEQT" will wrap the amount of tokens you set, converting EQT to WEQT.
To use this function you must first use the function "approve"
of Equivalence Protocol (0xFdDCb0760F61f486fF0Ee65fc8C5014FCF586dB1),
to allow Equivalence Protocol Wrapper (0x3D5F126692BaBe95c2a9C2c412eC169a10fcecb8) to use your EQT.
How to do this is described in section 2 c) of this tutorial.Function "unwrapEQT" will unwrap the amount of tokens you set, converting WEQT to EQT.
Please make sure you are entering the correct value - the entered number doesn't contain a decimal point and requires 18 trailing zeros.
3) Transferring the tokens in Metamask
Transferring the tokens directly in Metamask is really simple:
Select the "Assets" screen
Click on the asset you want to transfer (in this case EQT)
In the new screen, press "SEND"
New screen will open - continue on the next screenshot
In the new screen, fill the address where you want to send the tokens
Items "Asset" and "Amount" will appear after you fill in the address
Asset should be pre-filled with EQT, if not select it
Set Amount and press "Next"
In the next screen you'll be asked to confirm the transaction and gas fee
4) Swapping (buying or selling) the tokens using Uniswap decentralized exchange
Open Uniswap by visiting https://app.uniswap.org/#/swap
Select the token you own (ETH/WETH or EQT) on the top line.
Select the token you want to obtain on the bottom line.
Set the amount of one of the tokens, the other one will be calculated automatically.
Press "Connect Wallet" and select the wallet you use.
When your wallet is connected, click on "Swap" and confirm the transaction in your wallet.
To select the Equivalence Token, you need to paste the token address:Â 0xFdDCb0760F61f486fF0Ee65fc8C5014FCF586dB1
On other exchanges, the procedure is analogical.
5) Using Utility Tokens
Utility Tokens are a smart contract using the Equivalence Protocol to allow investors to invest into tokens pegged to the value of a commodity (gold or silver), fiat currency - average value of USD and EUR, or Bitcoin. To see details, please check the white paper of the contract.
To view the smart contract use this link.
Or alternatively you can:
Open https://etherscan.io/ and search for the address of Utility Tokens smart-contract.
(Address: 0x8eEF9979f1D1f3f0708BB4a14d0805d016A907d2)
After that, select "Contract" and "Write Contract" as shown below.
Note: Graphical representation of the tokens can be viewed on OpenSea using this link.
To be able to use the functions of the contract, press button "Connect to Web3" and confirm the pop-up window.
a) How to gain the token in exchange for EQT
To get the token of this contract, you need to use the function with number 3, "mintTokensBurnEQT"
ID is the identification of the type of token you want to get:
Set "0" for Gold (each token is 0.001 ounce).
Set "1" for Silver (each token is 0.05 ounce).
Set "2" for Euro-Dollar (average value of USD and EUR).
Set "3" for Bitcoin (each token is 0.00001 BTC).amount_of_ERC1155 is the number of tokens you want to get, there are no decimal places.
After filling the parameters in, press "Write" and your wallet should pop-up to ask you to confirm the transaction.
b) How to burn the token to get back EQT
To exchange the token of this contract back to EQT, you need to use the function with number 2, "mintEQTburnTokens"
ID is the identification of the type of token you want to get:
Set "0" for Gold (each token is 0.001 ounce).
Set "1" for Silver (each token is 0.05 ounce).
Set "2" for Euro-Dollar (average value of USD and EUR).
Set "3" for Bitcoin (each token is 0.00001 BTC).amount_of_ERC1155 is the number of tokens you want to burn, there are no decimal places.
After filling the parameters in, press "Write" and your wallet should pop-up to ask you to confirm the transaction.
c) Checking the balance of Utility Tokens
The tokens of this contract are in the ERC-1155 format, Metamask can safely hold these tokens, but it is not able to show you the balance properly. You can only see your balance by using the function "balanceOf" in the section Read Contract on etherscan. Some other wallets might be capable of showing the balance directly.
To check your balance switch to the section "Read Contract" and click on function number 3 "balanceOf"
address is the address of wallet where you want to check balance of tokens
ID is the identification of the type of token you want to know the balance of:
Set "0" for Gold (each token is 0.001 ounce).
Set "1" for Silver (each token is 0.05 ounce).
Set "2" for Euro-Dollar (average value of USD and EUR).
Set "3" for Bitcoin (each token is 0.00001 BTC).
After filling the parameters in, press "Query" and amount of tokens will appear below the Query button.