Skip to content

KyoungWan/rust-contract-call

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Minato Vault Scripts

Rust scripts for interacting with the vault contract deployed on the Soneium Minato testnet.

Setup

  1. Clone the repository

  2. Copy .env.example to .env and 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...
    

Available Scripts

The following scripts are available for interacting with the vault contract:

  1. Read Vault State - Read the USDT and notary addresses from the vault

    cargo run --bin read_vault_state
    
  2. Check USDT Balance - Check the USDT balance of the vault and sender

    cargo run --bin check_usdt_balance
    
  3. Transfer USDT to Vault - Mint USDT to the sender and transfer it to the vault

    cargo run --bin transfer_usdt_to_vault
    
  4. Enroll - Call the enroll function on the vault

    cargo run --bin enroll
    
  5. Claim - Call the claim function on the vault

    cargo run --bin claim
    

Contract Functions

The vault contract has the following functions:

  • enroll(uint256 orderId, string nickname, uint256 amount) - Enroll a new order in the vault
  • claim(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 address
  • notary() - Get the notary address

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages