This repository contains the following modules organized into core functionality and utility libraries:
Administrative capability module that provides secure access control for protocol management functions.
Global configuration management module that handles package versioning, role-based access control integration.
Role definition module that establishes role constants for the access control system, including minter, redeemer, collateral manager, gatekeeper, rewarder, and blacklist manager roles, ...
Access Control List for efficiently member roles management.
Implement deUSD token.
Implement wdeUSD vault to facilitate bridging deUSD from Ethereum to Sui.
Main minting and redemption module that processes collateral deposits and deUSD issuance.
Allow users to lock their collateral/deUSD tokens for minting/burning deUSD.
Allow liquidity providers to staking their LP tokens to receive rewards.
Staked deUSD implementation following ERC4626 vault standard.
Allow operator to transfer rewards into th `sd
Note: If you run into with any issues, try to run make clean to clean up the build cache and retry.
sui move build -dsui move test- Update the
initial_rewarderin theMove.tomlfile with appreciate value.
sui client publish- Run the following command to get the upgrade object, get
UPGRADE_CAPABILITYfrom the publishing transaction:
sui client upgrade -c <UPGRADE_CAPABILITY>Follow the guide in the previous section to publish the package.
After publishing, check the publishing transaction to get the corresponding configurations (object IDs). Then, create a new .env file in the root folder from .env.example and update the values accordingly.
Follow the guide in the previous section to upgrade the package.
Remember to update the new value of PACKAGE_VERSION in the config.move module and commit this changes before upgrading.
After upgrading, check the upgrading transaction to get the new package ID and update the PACKAGE_ID in the .env file.
Then, run the following command to get upgrade package version:
make upgrade-package-versionRun the following command to initialize the deUSD treasury cap config:
make initialize-deusd-treasury-cap-configNote: This step is required to allow external contracts to mint/burn deUSD via DeUSDTreasuryCap and should be done only once.
Run the following command to initialize the minting contract:
make initialize-mintingRequirements:
- The
wdeUSDcoin must be created by Sui bridge with 6 decimals before initializing the vault. Then updateWDEUSD_COIN_METADATA_IDandWDEUSD_TYPEin the.envfile.
Run the following command to initialize the vault contract:
make initialize-wdeusd-vaultThis is required if you want to transfer the deUSD's treasury cap to another account to allow the new account
to mint/burn deUSD directly, not used in normal operations because the contract will not be able to mint/burn deUSD
util the new deUSD config is initialized.
Actor: admin of the contract.
Run the following command to delete the deUSD config:
make delete-deusd-config caps_owner=${owners_of_treasury_cap_account_address}Note: this command will transfer both TreasuryCap and DenyCapV2 to the caps_owner address.
You can find the object IDs of TreasuryCap and DenyCapV2 by checking the content of the DeUSDConfig before deleting it.
Actor: anyone who owns the TreasuryCap and DenyCapV2.
Run the following command to re-initialize the deUSD config.
make initialize-deusd-config treasury_cap=${treasury_cap_id} deny_cap=${deny_cap_id}After re-initializing the deUSD config, please update the DEUSD_CONFIG_ID in the .env file.
The DeUSDTreasuryCap should be used for cross-chain bridges to mint/burn deUSD.
make create-deusd-treasury-cap to=${owner_account_address}This function should be used if a DeUSDTreasuryCap is compromised.
make set-deusd-treasury-cap-status treasury_cap_id=${deusd_treasury_cap_id} is_active=false