rize-sui-core
v1.0.0
Published
## Description
Downloads
4
Readme
Rize V1 SUI smart contract
Description
Overview
RizeV1 is a smart contract deployed on the SUI platform. It is responsible for managing and interacting with coin objects received through the Wormhole bridge. The key functions of RizeV1 include:
- Receiving and Storing Coins: Receives coin objects from the Wormhole bridge and deposits them into the vault.
- Staking Operations: The operator allocates the coin objects, including user funds received from the Wormhole bridge, to various staking protocols on the SUI platform. Currently, RizeV1 supports staking with Scallop and Navi protocols.
- Claiming Rewards: The operator claims rewards from the staking protocols and deposits them into the vault.
Withdrawal Process
- Admin Permission: The admin can enable the withdrawal process by setting the withdraw status to true, allowing withdrawals from the admin account.
- Admin Withdrawal: The admin account can withdraw balances and objects stored in the vault.
- Conditions for Withdrawal: Withdrawals can be enabled under two circumstances:
- Migration to a future version of the Rize protocol.
- Emergency withdrawal.
Roles
- Upgrader: Holds 0x2::package::UpgradeCap and has the authority to upgrade the smart contract.
- Admin: Holds rize::role::AdminCap. The admin can assign operators, set the withdrawal status, and withdraw balances and objects when the withdrawal status is true.
- Operator: Assigned by the admin, the operator can allocate funds to staking pools, specifically Scallop and Navi, and claim rewards but cannot withdraw funds or objects.
For developers
Installation
Install sui binary from mysten/sui, and config the environment according to sui cli guide
yarn install
Build
yarn build
Deploy
yarn deploy
The deployed contract will be written to published/${NETWORK}.json
along with created object IDs that is useful for interacting with smart contract.
test
SUI_WALLET_PRIV_KEY=${admin_private_key} SUI_WALLET_PRIV_KEY2=${other_wallet} yarn test
TODOs
- [ ] Test smart contract upgrade process