DESCRIPTION OF CONTRACT FUNCTIONS

This content is intended for experienced users and developers, please make sure you understand what each function does before using it.

Content:

Equivalence Protocol V2 / Equivalence Token V2 (ERC-20)


1)  State changing (write) functions:


-          approve(spender, amount)
Sets the allowance for the address of "spender" to spend the "amount" of EQT from the address which called the function.
input values: address "spender", uint256 "amount" (including 18 decimal places)


-          burn(amount)
Burns (destroys) the "amount" of EQT from the address which called the function.
input value: uint256 "amount" (including 18 decimal places)


-          burnFrom(account, amount)
Burns (destroys) the "amount" of EQT from the "account" address up to the allowance given by that address.
input values: address "account", uint256 "amount" (including 18 decimal places)


-          decreaseAllowance(spender, subtractedValue)
Decreases the allowance of "spender" towards the address which called the function by the "subtractedValue".
input values: address "spender", uint256 "subtractedValue" (including 18 decimal places)


-          increaseAllowance(spender, addedValue)
Increases the allowance of "spender" towards the address which called the function by the "addedValue".
input values: address "spender", uint256 "addedValue" (including 18 decimal places)


-          mint(payableAmount)   (payable function)
To the address which called the function is minted EQT of the same monetary value as the received amount of native cryptocurrency of the blockchain. This function is only available when the total supply of EQT is less than 100 000 000.
input value: amount of native cryptocurrency of the blockchain blockchain explorers usually accept input as decimal number, when using the function within the code of your own smart-contract or DAPP, value must be in form of uint256 with 18 decimal places

-          mintWithERC20(TokensToMint, PaymentToken)
To the address which called the function is minted the amount of EQT specified by the "TokensToMint" and the same monetary value of ERC-20 selected by "PaymentToken" is transferred from the same address. This function is only available when the total supply of EQT is less than 100 000 000.
input values: uint256 "TokensToMint" (including 18 decimal places), uint256 "PaymentToken" (supported values are 1-4)


-          pauseRewards()
If called by the address registered in the rewards program, stops the address which called the function from accumulating rewards and mints already accumulated rewards.
Reverts if called by the address which is not registered in the rewards program.


-          registerForRewards()
If called by the address which is not registered in the rewards program, registers the address into the rewards program and let's it accumulate reward for holding EQT. The reward is based on the amount of held EQT and time spend holding it. Reward per year is between 0-15% based on the total supply.
Reverts if called by the address which is already registered in the rewards program.


-          transfer(to, amount)
Transfers the "amount" of EQT from the address which called the function to the address specified by "to".
input values: address "to", uint256 "amount" (including 18 decimal places)


-          transferFrom(from, to, amount)
Transfers the "amount" of EQT from the address specified by "from" to the address specified by "to".
input values: address "from", address "to", uint256 "amount" (including 18 decimal places)


-          updateRewardsManually()
If called by the address registered in the rewards program, mints currently accumulated rewards and resets the "accumulation timer".
Reverts if called by the address which is not registered in the rewards program.

   

2) Read only functions:


-          BlockSpecialFunctionsOnPoolSetup()
Indicates whether functions "externalMint" and "burnFrom" are currently blocked due to initial setup of liquidity pool and related price data.
returns:
bool value, (true = blocked, false = unblocked)


-          EQTprice()
returns:
uint256 price (price of EQT in the native token of the blockchain, precision is 18 decimal places)
uint8 tokenDecimals (number of decimal places of the wrapped version of the native token of the blockchain)


-          EQTprice_Token1()
returns:
uint256 price (price of EQT denominated in the token 1, precision is 18 decimal places)
uint8 tokenDecimals (number of decimal places of the token 1)


-          EQTprice_Token2()
returns:
uint256 price (price of EQT denominated in the token 2, precision is 18 decimal places)
uint8 tokenDecimals (number of decimal places of the token 2)


-          EQTprice_Token3()
returns:
uint256 price (price of EQT denominated in the token 3, precision is 18 decimal places)
uint8 tokenDecimals (number of decimal places of the token 3)


-          EQTprice_Token4()
returns:
uint256 price (price of EQT denominated in the token 4, precision is 18 decimal places)
uint8 tokenDecimals (number of decimal places of the token 4)


-          LiquidityPoolWallet()
returns:
address of the wallet dedicated to the creation of liquidity pools


-          Metadata1()
returns:
address of the token 1


-          Metadata2()
returns:
address of the token 2


-          Metadata3()
returns:
address of the token 3


-          Metadata4()
returns:
address of the token 4


-          NativeMetadata()
returns:
address of the wrapped version of the native token of the blockchain


-          NativeTokenName()
returns:
string containing name of the wrapped version of the native token of the blockchain


-          PartnershipEnabled()
Indicates whether part of the funds gained by the minting of new EQT is forwarded to the payment splitter, where it can be withdrawn by our partners.
returns:
bool value, (true = funds are forwarded, false = funds are not forwarded)


-          PaymentSplitter()
returns:
address of the payment splitter


-          PriceOracle()
returns:
address of the Price Oracle (smart contract providing price data from the EQT liquidity pools)


-          Token1Name()
returns:
string containing name of the token 1


-          Token1isBTC()
Indicates whether token 1 is representation of Bitcoin.
returns:
bool value, true or false


-          Token1isETH()
Indicates whether token 1 is representation of Ether.
returns:
bool value, true or false


-          Token1isEUR()
Indicates whether token 1 is representation of Euro.
returns:
bool value, true or false


-          Token1isUSD()
Indicates whether token 1 is representation of US Dollar.
returns:
bool value, true or false


-          Token2Name()
returns:
string containing name of the token 2


-          Token2isBTC()
Indicates whether token 2 is representation of Bitcoin.
returns:
bool value, true or false


-          Token2isETH()
Indicates whether token 2 is representation of Ether.
returns:
bool value, true or false


-          Token2isEUR()
Indicates whether token 2 is representation of Euro.
returns:
bool value, true or false


-          Token2isUSD()
Indicates whether token 2 is representation of US Dollar.
returns:
bool value, true or false


-          Token3Name()
returns:
string containing name of the token 3


-          Token3isBTC()
Indicates whether token 3 is representation of Bitcoin.
returns:
bool value, true or false


-          Token3isETH()
Indicates whether token 3 is representation of Ether.
returns:
bool value, true or false


-          Token3isEUR()
Indicates whether token 3 is representation of Euro.
returns:
bool value, true or false


-          Token3isUSD()
Indicates whether token 3 is representation of US Dollar.
returns:
bool value, true or false


-          Token4Name()
returns:
string containing name of the token 4


-          Token4isBTC()
Indicates whether token 4 is representation of Bitcoin.
returns:
bool value, true or false


-          Token4isETH()
Indicates whether token 4 is representation of Ether.
returns:
bool value, true or false


-          Token4isEUR()
Indicates whether token 4 is representation of Euro.
returns:
bool value, true or false


-          Token4isUSD()
Indicates whether token 4 is representation of US Dollar.
returns:
bool value, true or false

-          allowance(owner, spender)
input values: address "owner", address "spender"
returns:
uint256 representing the amount of tokens that "spender" can transfer or burn from the wallet of the "owner", includes 18 decimal places


-          balanceOf(account)
input values: address "account"
returns:
uint256 representing the EQT balance of the "account", includes 18 decimal places


-          decimals()
returns:
uint8 representing number of decimal places of EQT (18)


-          mintMode()
returns:
uint256 representing mode of minting of EQT
(0 = "mint" and "mintWithERC20" enabled, 1 = "mint" enabled, 2 = "mintWithERC20" enabled, 3 = "mint" and "mintWithERC20" disabled)


-          name()
returns:
string representing the full name of the EQT (Equivalence Token V2)


-          owner()
returns:
address of the owner of the smart contract


-          symbol()
returns:
string representing the symbol of the token "EQT"

-          totalSupply()
returns:
uint256 representing the amount of all EQT currently existing on given blockchain, includes 18 decimal places


-          whitelist(address)
input value: address
returns:
bool value (true = address is whitelisted, false = address is not whitelisted)


-          whitelistUsageCounter()
returns:
uint256 representing how many times was address added to the whitelist

 

3)  Functions with limited access:


-          addToWhitelist(_address)
Access limited to the owner of the smart contract.
Usage of this function is monitored by the “whitelistUsageCounter.
Adds the "_address" to the whitelist and grants it access to the “externalMint” function.
input value: address "_address"

-          externalMint(_addr, amount)
Access limited to the whitelisted addresses.
Mints the "amount" of EQT to the address "_addr". In case of supply of EQT above the intended supply, fee is deduced from the "amount".
input values: address "_addr", uint256 "amount" (including 18 decimal places)


-          removeFromWhitelist(_address)
Access limited to the owner of the smart contract.
Removes the "_address" from the whitelist and revokes its access to the “externalMint” function.
input value: address "_address"

-          renounceOwnership(confirm)
Access limited to the owner of the smart contract.
Transfers ownership of the smart contract to the zero address.
input value: boolean "confirm"


-          setBlock(blockOnSetup)
Access limited to the owner of the smart contract.
Blocks usage of "externalMint" and "burnFrom" before the liquidity pools and price oracles are created and set. Initial value during contract deployment is "true".
input value: bool "blockOnSetup"


-          setMintMode(_mintMode)
Access limited to the owner of the smart contract.
Sets the way new tokens are minted as a number 0-3.
0 = "mint" and "mintWithERC20" enabled, 1 = "mint" enabled, 2 = "mintWithERC20" enabled, 3 = "mint" and "mintWithERC20" disabled
input value: uint256 "_mintMode"


-          setOracleAddress(_addr)
Access limited to the owner of the smart contract.
Sets the address of the source of EQT price.
input value: address "_addr"

-          setPartnership(enabled)
Access limited to the owner of the smart contract.
Sets whether the part of partnership program related to the minted EQT is active or not.
input value: bool "enabled"


-          setPaymentSplitter(_addr)
Access limited to the owner of the smart contract.
Sets the address of the "payment splitter", which is a smart contract used to distribute payments between our partners.
input value: address "_addr"


-          setTeamWallet(_addr)
Access limited to the owner of the smart contract.
Sets the address of the wallet of our team.
input value: address "_addr"


-          setToken1(_addr, USD, EUR, ETH, BTC)
Access limited to the owner of the smart contract.
Sets the address of the Token 1. Sets the indications whether the token represents some of the commonly used currency (USD, EUR, ETH, BTC). The set address is used when minting EQT using "mintWithERC20" (in case of parameter "paymentToken" set to 1).
input values: address "_addr", bool "USD", bool "EUR", bool "ETH", bool "BTC"


-          setToken2(_addr, USD, EUR, ETH, BTC)
Access limited to the owner of the smart contract.
Sets the address of the Token 2. Sets the indications whether the token represents some of the commonly used currency (USD, EUR, ETH, BTC). The set address is used when minting EQT using "mintWithERC20" (in case of parameter "paymentToken" set to 2).
input values: address "_addr", bool "USD", bool "EUR", bool "ETH", bool "BTC"


-          setToken3(_addr, USD, EUR, ETH, BTC)
Access limited to the owner of the smart contract.
Sets the address of the Token 3. Sets the indications whether the token represents some of the commonly used currency (USD, EUR, ETH, BTC). The set address is used when minting EQT using "mintWithERC20" (in case of parameter "paymentToken" set to 3).
input values: address "_addr", bool "USD", bool "EUR", bool "ETH", bool "BTC"


-          setToken4(_addr, USD, EUR, ETH, BTC)
Access limited to the owner of the smart contract.
Sets the address of the Token 4. Sets the indications whether the token represents some of the commonly used currency (USD, EUR, ETH, BTC). The set address is used when minting EQT using "mintWithERC20" (in case of parameter "paymentToken" set to 4).
input values: address "_addr", bool "USD", bool "EUR", bool "ETH", bool "BTC"


-          setWrappedNativeToken(_addr)
Access limited to the owner of the smart contract.
Sets the address of the wrapped version of the native token of the blockchain where Equivalence Protocol V2 is deployed.
input value: address "_addr"

-          transferOwnership(newOwner)
Access limited to the owner of the smart contract.
Transfers ownership of the smart contract to the specified address.
input value: address "newOwner"


-          withdraw()
Access limited to the owner of the smart contract.
Withdraws native token of the blockchain and/or EQT, if any are stuck in the smart contract.


-          withdrawERC20(address)
Access limited to the owner of the smart contract.
Withdraws any ERC-20 token, if such token is stuck in the smart contract.
input value: address "address"

EquivalenceTokenWrapper


1)  State changing (write) functions:


-          unwrapWEQT(amount)
Transfers the "amount" of WEQT from the address which called the function and mints the "amount" of EQT to the address which called the function.
input values: uint256 "amount" (including 18 decimal places)


-          wrapEQT(amount)
Burns the "amount" of EQT from the address which called the function and transfers the "amount" of WEQT to the address which called the function.
input values: uint256 "amount" (including 18 decimal places)


   

2) Read only functions:


-          EQT()
returns:
address of the Equivalence Protocol V2 / Equivalence Token V2


-          EQTaddressLocked()
returns:
bool value indicating whether address of the Equivalence Protocol V2 / Equivalence Token V2 is locked (true = locked, false = unlocked)


-          RequiredUnlockTime()
returns:
uint256 representing time in seconds needed to unlock the WEQT to allow its withdrawal


-          WEQT()
returns:
address of the WEQT


-          WEQTaddressLocked()
returns:
bool value indicating whether address of the WEQT is locked (true = locked, false = unlocked)


-          checkRemainingLockTime()
returns:
string "status", indicates whether tokens are locked, currently unlocking or already unlocked
uint256 "time", the remaining time to unlock the tokens in seconds (in case tokens are locked the value is 99999999999)


 

3)  Functions with limited access:


-          Withdraw_WEQT(amount)
Access limited to the owner of the smart contract. Function will revert if the tokens are locked.
Withdraws the "amount" of WEQT from the smart contract to the wallet of the owner of the smart contract.
input value: uint256 "amount" (includes 18 decimal places)


-          lock()
Access limited to the owner of the smart contract.
Locks the WEQT tokens in the smart contract, time required to unlock the tokens is 90 days.


-          lockEQTaddress(confirm)
Access limited to the owner of the smart contract.
Locks the address of the EQT, making change of the address impossible.
input value: bool "confirm"


-          lockWEQTaddress(confirm)
Access limited to the owner of the smart contract.
Locks the address of the WEQT, making change of the address impossible.
input value: bool "confirm"


-          setEQT(_addr)
Access limited to the owner of the smart contract. Function will revert if EQT address is locked.
Sets the address of the EQT.
input value: address "_addr"


-          setWEQT(_addr)
Access limited to the owner of the smart contract. Function will revert if WEQT address is locked.
Sets the address of the WEQT.
input value: address "_addr"


-          unlock()
Access limited to the owner of the smart contract.
Starts the procedure to unlock the WEQT tokens, time required to unlock the tokens is 90 days.

PaymentSplitter


1)  State changing (write) functions:


-          distribute_ERC20_Token(token)
Distributes the "token" among the set addresses.
input value: address "token"


-          distribute_Native_Token()
Distributes the native token of the blockchain among the set addresses.
 

   

2) Read only functions:


-          Partners(uint256)
returns:
address of the partner according to partner number, reverts if the address with such number doesn't exist


-          getPartnerNumber(_addr)
input value: address "addr"
returns:
uint256 representing the partner number, reverts if the address is not set as a wallet of our partner


 

3)  Functions with limited access:


-          addPartnerWallet(_addr)
Access limited to the owner of the smart contract.
Adds the address to the list of addresses which receive the tokens when the tokens are distributed.
input value: address "_addr"


-          removePartnerWallet(_addr)
Access limited to the owner of the smart contract.
Removes the address from the list of addresses which receive the tokens when the tokens are distributed.
input value: address "_addr"

UniswapNFTpositionLocker


1)  State changing (write) functions:


-          collectFees(Pool_Number)
Collects the fees from the pool set by "Pool_Number" to this smart contract.
input value: uint8 "Pool_Number"


-          withdrawFees(token)
Distributes the "token" among the project, team and our partners.
input value: address "token"
 

   

2) Read only functions:


-          EQT()
returns:
address of the Equivalence Protocol V2 / Equivalence Token V2


-          EQTaddressLocked()
returns:
bool value indicating whether address of the Equivalence Protocol V2 / Equivalence Token V2 is locked (true = locked, false = unlocked)


-          Partners(uint256)
returns:
address of the partner according to partner number, reverts if the address with such number doesn't exist


-          Pool(uint8)
returns:
address of the pool according to the pool number, reverts if the address with such number doesn't exist


-          PoolWallet()
returns:
address of the wallet dedicated to the creation of liquidity pools


-          Pool_LockDays(uint8)
returns:
uint8 representing the time in days necessary to unlock the pool according to the pool number, reverts if the pool with such number doesn't exist


-          Pool_NFT_ID(uint8)
returns:
uint256 representing NFT ID according to the pool number, reverts if the liquidity position with such number doesn't exist


-          Pool_priceRange(uint8)
returns:
string stating price range covered by the liquidity position according to the pool number, reverts if the liquidity position with such number doesn't exist


-          RequiredUnlockTime_1day()
returns:
uint256 representing time in seconds needed to unlock the pool which is locked for 1 day


-          RequiredUnlockTime_30days()
returns:
uint256 representing time in seconds needed to unlock the pool which is locked for 30 days


-          RequiredUnlockTime_90days()
returns:
uint256 representing time in seconds needed to unlock the pool which is locked for 90 days


-          checkAccumulatedFees(Pool_Number)
input value: uint8 "Pool_Number"
returns:
string "AccumulatedFees", contains estimation of how much of each token was accumulated as fees in the pool according to "Pool_Number"


-          checkAccumulatedFees_batch(batchStart, batchEnd)
input value: uint8 "batchStart", uint8 "batchEnd"
returns:
string "AccumulatedFees_Batch", contains estimation of how much of each token was accumulated as fees in each pool of the batch with pool number between "batchStart" and "batchEnd"


-          checkPoolData(Pool_Number)
input value: uint8 "Pool_Number"
returns:
string "Token0_Symbol", address "Token0_Address", string "Token1_Symbol", address "Token1_Address", string "EQT_Price_Range"


-          checkRemainingLockTime(Pool_Number)
returns:
uint256 "RemainingSeconds", the remaining time to unlock the pool in seconds (in case tokens are locked the value is 99999999999)
string "status", indicates whether tokens are locked, currently unlocking or already unlocked


-          getPartnerNumber(_addr)
input value: address "addr"
returns:
uint256 representing the partner number, reverts if the address is not set as a wallet of our partner


 

3)  Functions with limited access:


-          addPartnerWallet(_addr)
Access limited to the owner of the smart contract.
Adds the address to the list of addresses which receive the tokens when the accumulated liquidity pool fees are distributed.
input value: address "_addr"


-          lockEQTaddress(confirm)
Access limited to the owner of the smart contract.
Locks the address of the EQT, making change of the address impossible.
input value: bool "confirm"


-          lockPool(Pool_Number, LockDays)
Access limited to the owner of the smart contract.
Locks the pool according to the "Pool_Number" for the number of days set by "LockDays".
input value: uint8 "Pool_Number", uint8 "LockDays" (allowed values of LockDays are 1, 30 and 90)


-          removePartnerWallet(_addr)
Access limited to the owner of the smart contract.
Removes the address from the list of addresses which receive the tokens when the accumulated liquidity pool fees are distributed.
input value: address "_addr"


-          setEQT(_addr)
Access limited to the owner of the smart contract. Function will revert if EQT address is locked.
Sets the address of the EQT.
input value: address "_addr"


-          setPool(Pool_Number, Pool_Address, NFT_ID, LockDays, priceRange)
Access limited to the owner of the smart contract.
Sets the new liquidity position which will be stored in the smart-contract and locks it for the set duration.
input values: uint8 "Pool_Number", address "Pool_Address", uint256 "NFT_ID", uint8 "LockDays", string "priceRange"


-          setTeamWallet(_addr)
Access limited to the owner of the smart contract.
Sets the address of the wallet of our team.
input value: address "_addr"


-          unlockPool(Pool_Number)
Access limited to the owner of the smart contract.
Starts the procedure to unlock the liquidity position according to "Pool_Number".
input value: uint8 "Pool_Number"


-          withdrawUnlockedPool(Pool_Number)
Access limited to the owner of the smart contract.
Transfers the liquidity position according to "Pool_Number" from this smart contract to the wallet dedicated for the creation of the liquidity pools.
input value: uint8 "Pool_Number"

Other smart contracts


WrappedEquivalenceTokenV2:

This smart contract is deployed by us on the Ethereum, on other blockchains it is created automatically by the standard gateway of the bridge of given blockchain. Exact functions may differ between blockchains, however all functions of the ERC-20 standard should be supported across all blockchains.


PriceOracles:

This smart contract can be deprecated in the future, when new version is created. As the source of price data should always be used functions included directly in the Equivalence Protocol V2 smart contract.