Skip to Content
iAssets (Proof of Efficient Liquidity)Smart Contract Integration

Smart Contract Integration

The system is composed of two main modules: iAsset and PoEL.


SUPRA

StatusContract AddressModules Link
Testnet0xc4a734e5b84deb218ab7ba5a46af45da54d5ff4aa8846e842c3ac2e32ce0eebdhttps://testnet.suprascan.io/address/0xc4a734e5b84deb218ab7ba5a46af45da54d5ff4aa8846e842c3ac2e32ce0eebd/f?tab=modules` 
Mainnet0xda20f7d0ec813c751926f06004a10bc6ee1eefc96798f6a1aa31447ee146f932https://suprascan.io/address/0xda20f7d0ec813c751926f06004a10bc6ee1eefc96798f6a1aa31447ee146f932/f?tab=modules 

Ethereum

Mainnet DeployedContract Address
Multisig admin (9/16)0xb09eE905aFfb96E4da95D50ed946cDa696C8FF1D
FeeOperatorImpl0xB69e964cA6cD9D9E02202A636e222469b97D8e32
FeeOperatorProxy0x6CA8244fF976DCa12d0260662cCE4483b4945BFF
TokenBridgeImplementation0xE7Bb5770D83f42a96e62B3034643d92139477009
TokenBridgeProxy0x573330c2F115FB1C1fBa3220f072f2eF9F411eC2
VaultImplementation0x9C9D5879eB96a7A037eA2b58196e342e93D80004
VaultProxy0x548957c5b25f6831382D848b9806459cdfBD048E
TESTNET DeployedContract Address
FeeOperatorImpl0x651b7a3a747CC75B33cEbF5c0740B69954EB5Bc0
FeeOperatorProxy0xcd06057e8642613C38b938EFbe4FB44734920e2a
TokenBridgeImplementation0x64ea2A2F3A9adADf42E21C7ed88fff5f87032990
TokenBridgeProxy0x7a5157c9A2F449f0EDDBa591327Ae1215c63ec75
VaultImplementation0x4efB9F7C6E1155E315c2dFEecEA0AEa7Bc88FD5F
VaultProxy0x70FeF9A2fF27Fd834E41D6b281A9e82Afc75305d

dApps that hold iAssets (e.g., liquidity pools) and need to withdraw rewards periodically can use the following methods from the PoEL and iAsset modules.

Methods Used During Integration

MethodIn / OutComment
View method

get_user_rewards

(user_address: address): UserRewardsInfo
in

user_address:
address of the iasset holder

out
UserRewardsInfo object containing:

Fields:
• Allocated rewards for a user allocated_rewards: u64,
  • • Withdrawable (claimed) rewards for a user withdrawable_rewards: u64,
  • • Epoch when rewards were claimed (moved to withdrawable) withdrawable_rewards_epoch: u64,
  • • Timestamp when rewards were claimed (moved to withdrawable) withdrawable_rewards_ts: u64,
  • • Withdrawn rewards for a user withdrawn_rewards: u64
Method returns total allocated rewards, withdrawable, withdrawn etc
View method

get_allocatable_rewards

(user_address: address, asset: Object<Metadata>): u64
in

user_address:
address of the iasset holder

asset:
iasset object

out
amount of SUPRA coins
Return number of rewards could be allocated by calling method update_rewards
View method

get_withdraw_timer_for_user

(user_address: address): u64
in

user_address:
address of the iasset holder
Method is useful for the claim/withdraw scenario. This method indicates the remaining time to wait until withdraw_rewards can be invoked

PoEL Module

MethodIn / OutComment
update_rewards (account: &signer, asset: Object)in
account: signer who updates rewards

asset: iAsset object for which rewards are updated
Call when get_allocatable_rewards returns a non-zero value
claim_rewards (account: &signer)in
account: signer who claims allocated rewards
Call only when allocated_rewards > 0
withdraw_rewards (account: &signer)in
account: signer who withdraws claimed rewards
Method can be called if withdrawable_rewards not 0 (something claimed) and Get_withdraw_timer_for_user is 0
Last updated on