Smart Contract Integration
The system is composed of two main modules: iAsset and PoEL.
SUPRA
Testnet
0xc4a734e5b84deb218ab7ba5a46af45da54d5ff4aa8846e842c3ac2e32ce0eebd
https://testnet.suprascan.io/address/0xc4a734e5b84deb218ab7ba5a46af45da54d5ff4aa8846e842c3ac2e32ce0eebd/f?tab=modules
Mainnet
0xda20f7d0ec813c751926f06004a10bc6ee1eefc96798f6a1aa31447ee146f932
https://suprascan.io/address/0xda20f7d0ec813c751926f06004a10bc6ee1eefc96798f6a1aa31447ee146f932/f?tab=modules
Ethereum
Multisig admin (9/16)
0xb09eE905aFfb96E4da95D50ed946cDa696C8FF1D
FeeOperatorImpl
0xB69e964cA6cD9D9E02202A636e222469b97D8e32
FeeOperatorProxy
0x6CA8244fF976DCa12d0260662cCE4483b4945BFF
TokenBridgeImplementation
0xE7Bb5770D83f42a96e62B3034643d92139477009
TokenBridgeProxy
0x573330c2F115FB1C1fBa3220f072f2eF9F411eC2
VaultImplementation
0x9C9D5879eB96a7A037eA2b58196e342e93D80004
VaultProxy
0x548957c5b25f6831382D848b9806459cdfBD048E
FeeOperatorImpl
0x651b7a3a747CC75B33cEbF5c0740B69954EB5Bc0
FeeOperatorProxy
0xcd06057e8642613C38b938EFbe4FB44734920e2a
TokenBridgeImplementation
0x64ea2A2F3A9adADf42E21C7ed88fff5f87032990
TokenBridgeProxy
0x7a5157c9A2F449f0EDDBa591327Ae1215c63ec75
VaultImplementation
0x4efB9F7C6E1155E315c2dFEecEA0AEa7Bc88FD5F
VaultProxy
0x70FeF9A2fF27Fd834E41D6b281A9e82Afc75305d
Methods Used During Integration
View method
get_user_rewards
(user_address: address): UserRewardsInfo
in
user_address:
address of the iasset holder
out
UserRewardsInfo result object with various details.
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
update_rewards(account: &signer, asset: Object)
in
account: signer, who updates the rewards
asset : iasset object, for which rewards has to be updated
Call this method whenever get_allocatable_rewards returns a non-zero value
claim_rewards(account: &signer)
in
account: signer, who claims already allocated rewards
Call this method only when allocated_reward>0
withdraw_rewards(account: &signer)
in
account: signer, who withdraw already claimed rewards
Method can be called if withdrawable_rewards not 0 (something claimed) and Get_withdraw_timer_for_user is 0
Last updated
