This project consists of 4 repos:
most-bridge-backend
- canister for minting and withdrawing ckSUI tokensmost-bridge-helper
- generating sui address from base64 public keymost-ck-sui-helper
- sui smart contract for depositing SUI tokens to mintermost-bridge-api
- check here https://github.com/4-point-0/most-bridge-api
- follow https://internetcomputer.org/docs/current/developer-docs/getting-started/install/ instructions to install necesarry tools
- for local testing deploy
most-ck-sui-helper
to local, devnet or testnet - update constants
SUI_PACKAGE_ID
andSUI_MODULE_ID
deploy canister frommost-bridge-backend
locally, get public key and convert it to SUI_ADDRESS usingmost-bridge-helper
- set minter address with
setMinterAddress
method onckSuiHelper.move
smart contract
Use SUI cli script:
sui client call --package <CONTRACT_ID> --module ckSuiHelper --function deposit --args <AMOUNT> <COIN_ID> <PRINCIPAL_ADDRESS_STRING> <MINTER_ID>
Export identity in cli:
dfx identity use default
export DEFAULT=$(dfx identity get-principal)
Approve amount for withdrawal:
dfx canister call --identity default ck_sui_ledger_canister icrc2_approve "(record {spender= record {owner = principal \"${CANISTER_MINTER_ID}\";};amount = ${AMOUNT}: nat;})" --network ic
Withdraw
dfx canister call minter withdraw "(record {
amount = \"${AMOUNT}\";
recipient = \"${RECIPIENT_SUI _ADDRESS}\"
})"