Rust scripts for interacting with the vault contract deployed on the Soneium Minato testnet.
-
Clone the repository
-
Copy
.env.exampleto.envand fill in the required values:# RPC URL for soneium minato testnet MINATO_RPC_URL=https://minato-rpc.soneium.com # Contract addresses MINATO_VAULT_ADDRESS=0x... MINATO_USDT_ADDRESS=0x... # Private keys (DO NOT USE PRODUCTION KEYS HERE) PRIVATE_KEY=0x... NOTARY_PRIVATE_KEY=0x...
The following scripts are available for interacting with the vault contract:
-
Read Vault State - Read the USDT and notary addresses from the vault
cargo run --bin read_vault_state -
Check USDT Balance - Check the USDT balance of the vault and sender
cargo run --bin check_usdt_balance -
Transfer USDT to Vault - Mint USDT to the sender and transfer it to the vault
cargo run --bin transfer_usdt_to_vault -
Enroll - Call the enroll function on the vault
cargo run --bin enroll -
Claim - Call the claim function on the vault
cargo run --bin claim
The vault contract has the following functions:
enroll(uint256 orderId, string nickname, uint256 amount)- Enroll a new order in the vaultclaim(uint256 orderId, address recipient, uint256 amount, uint8 v, bytes32 r, bytes32 s)- Claim funds from the vault
And the following read functions:
usdt()- Get the USDT contract addressnotary()- Get the notary address