Smart Contract Integration
The system is composed of two main modules: iAsset and PoEL.
SUPRA
| Status | Contract Address | Modules Link |
|---|---|---|
| Testnet | 0xc4a734e5b84deb218ab7ba5a46af45da54d5ff4aa8846e842c3ac2e32ce0eebd | https://testnet.suprascan.io/address/0xc4a734e5b84deb218ab7ba5a46af45da54d5ff4aa8846e842c3ac2e32ce0eebd/f?tab=modules` |
| Mainnet | 0xda20f7d0ec813c751926f06004a10bc6ee1eefc96798f6a1aa31447ee146f932 | https://suprascan.io/address/0xda20f7d0ec813c751926f06004a10bc6ee1eefc96798f6a1aa31447ee146f932/f?tab=modules |
Ethereum
| Mainnet Deployed | Contract Address |
|---|---|
| Multisig admin (9/16) | 0xb09eE905aFfb96E4da95D50ed946cDa696C8FF1D |
| FeeOperatorImpl | 0xB69e964cA6cD9D9E02202A636e222469b97D8e32 |
| FeeOperatorProxy | 0x6CA8244fF976DCa12d0260662cCE4483b4945BFF |
| TokenBridgeImplementation | 0xE7Bb5770D83f42a96e62B3034643d92139477009 |
| TokenBridgeProxy | 0x573330c2F115FB1C1fBa3220f072f2eF9F411eC2 |
| VaultImplementation | 0x9C9D5879eB96a7A037eA2b58196e342e93D80004 |
| VaultProxy | 0x548957c5b25f6831382D848b9806459cdfBD048E |
| TESTNET Deployed | Contract Address |
|---|---|
| FeeOperatorImpl | 0x651b7a3a747CC75B33cEbF5c0740B69954EB5Bc0 |
| FeeOperatorProxy | 0xcd06057e8642613C38b938EFbe4FB44734920e2a |
| TokenBridgeImplementation | 0x64ea2A2F3A9adADf42E21C7ed88fff5f87032990 |
| TokenBridgeProxy | 0x7a5157c9A2F449f0EDDBa591327Ae1215c63ec75 |
| VaultImplementation | 0x4efB9F7C6E1155E315c2dFEecEA0AEa7Bc88FD5F |
| VaultProxy | 0x70FeF9A2fF27Fd834E41D6b281A9e82Afc75305d |
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
| Method | In / Out | Comment |
|---|---|---|
View method get_user_rewards(user_address: address): UserRewardsInfo | inuser_address:address of the iasset holder outUserRewardsInfo object containing:Fields:• Allocated rewards for a user allocated_rewards: u64,
| Method returns total allocated rewards, withdrawable, withdrawn etc |
View method get_allocatable_rewards(user_address: address, asset: Object<Metadata>): u64 | inuser_address:address of the iasset holder asset:iasset object outamount 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 | inuser_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
| Method | In / Out | Comment |
|---|---|---|
update_rewards (account: &signer, asset: Object) | inaccount: signer who updates rewardsasset: iAsset object for which rewards are updated | Call when get_allocatable_rewards returns a non-zero value |
claim_rewards (account: &signer) | inaccount: signer who claims allocated rewards | Call only when allocated_rewards > 0 |
withdraw_rewards (account: &signer) | inaccount: 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