LogoLogo
  • Imua
    • About
  • Manifesto
    • The Problems
    • The Principles
  • Architecture
    • Imua Design Principles
    • Imua Network
    • Imua Modules
    • Client Chain Bridges
      • Trustless Verification of Client Chain State
      • Handling Race Conditions between Imua and Client Chains
    • Client Chain Contracts
  • Concepts
    • Ecosystem
      • Re/stakers
      • Operators
      • Services (AVS)
        • Service Integration with Imua
        • Service Committee
        • Service Integration Details
    • restaked Proof-of-Stake (rPOS)
    • Multi-Token Restaking
    • Multi-Chain Restaking with Trustless Bridging
    • Voting Power
    • Price Oracle
    • Flexible Integration with AVS
    • Tribe Staking
  • Governance
  • Risk Management
    • Risk Analysis
      • Risk Modeling
      • Risk Parameters
      • Crypto-Economic Risk
      • Unintended Slashing
      • Black Swan Events
    • Risk Mitigation
      • Smart Contract Simplicity
      • Audits
      • Slashing Prevention
      • Slashing Vetos
      • Insurance Pools
      • Circuit Breakers
  • Components
    • Testnet
    • Oracle Module
      • Reaching Consensus on Asset Prices
      • Penalty
      • Implementation Detail
    • Smart Contracts
    • Explorer
    • Registry
  • Validator Setup
    • Prerequisites
    • Node Install
    • Compiling Binary from Source
    • Oracle Price Feeder
    • Running the Node
    • Snapshot
    • Register Option 1 (Bootstrap)
    • Register Option 2 (Post Network Launch)
    • Deposit Tokens
    • Delegating Tokens
    • Confirm Election Status
    • Faucets
    • Managing The Validator
    • Security Best Practices
    • Risks & Mitigation
    • Participation in Governance
    • FAQs & Resources
  • Testnet Upgrade to v1.1.1
  • AVS Setup
    • AVS Overview
    • Prerequisites
    • Building the AVS in Imua
    • Hello-World-AVS Example
    • Becoming AVS Operator
    • AVS Register and Deploy
    • AVS Task Example
    • Enhanced and Automated Edition of hello-avs integration guide&example
  • Whitepaper (2023)
    • .pdf
  • FAQ
    • What problems is Imua solving?
    • What are the main design trade-offs that had to be made with an omnichain design?
    • Does the omnichain design imply added trust assumptions (relative to a single-chain design)?
    • What concurrency-related challenges would you face with a different design?
    • How does Imua integrate with new chains?
    • Do specific chains prove unique challenges w.r.t. integration?
    • How is the cross-chain communication is achieved?
    • What are the known attack / censorship vectors here, if any?
    • Are the restaked tokens being pooled in a centralized account?
    • Who will run the validators in the Imua network?
    • Is Imua an AVS?
    • How does Imua address the risks of overloading L1 social consensus?
    • Does the Imua queuing system raise concerns around latency?
    • What are the main benefits of an omnichain design?
Powered by GitBook
On this page
  1. Validator Setup

Deposit Tokens

PreviousRegister Option 2 (Post Network Launch)NextDelegating Tokens

Last updated 1 month ago

Deposit Tokens

Acquire Tokens

At the time of writing, Imua's testnet (imuachaintestnet_233-8) supports and on Sepolia for staking. To participate in consensus, validators don't need both of these tokens; only one token type is sufficient.

  • ETH on Sepolia can be obtained from faucets provided by or .

    • Purpose: ETH is used to pay for gas on the Ethereum testnet.

  • exoETH on Sepolia can be obtained from the .

    • Purpose: exoETH is used for staking on Imua testnet.

  • on Sepolia can be obtained by sending Sepolia ETH to the wstETH address 0xB82381A3fBD3FaFA77B3a7bE693342618240067b.

    • Purpose: wstETH is Lido’s liquid staking token and is used for restaking.

  • imua, which is the native token on Imua, can be obtained from the testnet . Similar to ETH and wei, the smaller unit of imua is hua such that 1 imua = 1e18 hua.

    • Purpose: imua is used to pay for gas on Imua.

Among the tokens listed above, only imua is present on the Imua chain while others live on Sepolia.

Deposit Tokens

The contract which accepts deposits is currently deployed on Ethereum, which means the Ethereum private key ($ETH_PRIVATE_KEY) is needed.

## Script constants
EXO_ETH_ADDR=0x83E6850591425e3C1E263c054f4466838B9Bd9e4
WST_ETH_ADDR=0xB82381A3fBD3FaFA77B3a7bE693342618240067b
GATEWAY_ADDR=0x64B5B5A618072C1E4D137f91Af780e3B17A81f3f

## User choices
# Enter your Ethereum testnet private key
ETH_PRIVATE_KEY=0xabcde.....
# Enter the address corresponding to the key
ETH_ADDRESS=0x123....
# Obtain the token as described above, and choose the one you intend to deposit.
# For most validators, this default works. However, others can still bring in 
# their `wstETH` (or another supported token) to participate.
TOKEN=$EXO_ETH_ADDR
# Quantity of token to deposit (without the 1e18 multiplier)
# Decimal values are supported
QUANTITY=25
# Endpoint for Ethereum RPC
ETHEREUM_RPC_URL=https://rpc.ankr.com/eth_sepolia

# Approve the deposit by Vault
VAULT_ADDR=$(cast call --rpc-url $ETHEREUM_RPC_URL $GATEWAY_ADDR "tokenToVault(address) returns (address)" $TOKEN)
cast send --rpc-url $ETHEREUM_RPC_URL \
    $TOKEN \
    "approve(address,uint256)" \
    $VAULT_ADDR \
    "$(cast maxu)" \
    --private-key $ETH_PRIVATE_KEY

BOOTSTRAPPED=$(cast call --rpc-url $ETHEREUM_RPC_URL $GATEWAY_ADDR "bootstrapped() returns (bool)")
if [ "$BOOTSTRAPPED" = "true" ]; then
    # Generate the LZ messsage to calculate the fees
    DEPOSIT_PREFIX="0x02"
    TOKEN_B32=$(cast 2b $TOKEN)
    ETH_ADDRESS_B32=$(cast 2b $ETH_ADDRESS)
    QUANTITY_B32=$(printf "%064s" $(cast 2h $(cast 2w $QUANTITY) | cut -c3-) | tr ' ' '0') # left padding
    LZ_MESSAGE=$(cast ch $DEPOSIT_PREFIX $TOKEN_B32 $ETH_ADDRESS_B32 $QUANTITY_B32)
    VALUE=$(cast call --rpc-url $ETHEREUM_RPC_URL $GATEWAY_ADDR "quote(bytes)" $LZ_MESSAGE)
else
    # No fees
    VALUE=0
fi

# Execute the transaction
cast send --rpc-url $ETHEREUM_RPC_URL \
    $GATEWAY_ADDR \
    "deposit(address,uint256)" \
    $TOKEN \
    $(cast 2w $QUANTITY) \
    --private-key $ETH_PRIVATE_KEY \
    --value $(cast 2d $VALUE)

The expected output of the commands should look similar to below:

blockHash               0x496b22768c38687dedeaf1f6b3823b0973b25ae90ea961e702f6dd4ba82a980a
blockNumber             6679149

<! -- truncated -->

transactionHash         0x24426c2acf0e6a411961f478bca68a36c12ed0bff3d7206cd1cd7662908d40cf
transactionIndex        84
type                    2
blobGasPrice            
blobGasUsed             
authorizationList       
to                      0x8fc4E764C2C3B0646ba572AEa958fB5724706412
ETH_LZ_ID=40161 # Sepolia, where our $GATEWAY_ADDR lives
STAKER_ID=$(echo "${ETH_ADDRESS}" | tr '[:upper:]' '[:lower:]')_$(printf '0x%x\n' "${ETH_LZ_ID}")
# our public endpoint is available below, but you can use your own node too
IMUA_COS_GRPC_URL=https://api-cosmos-grpc.exocore-restaking.com:443
imuad query assets staker-assets \
    --node $IMUA_COS_GRPC_URL \
    $STAKER_ID --node $IMUA_COS_GRPC_URL \
    --output json | jq

The expected output of this will represent the quantity of tokens deposited, multiplied by 1e18.

{
  "asset_infos": [
    {
      // the `asset_id` will vary depending on $TOKEN chosen
      // the `_0x9ce1` represents that hex value of the ETH_LZ_ID, a unique ID
      // assigned by LayerZero to the Sepolia network
      "asset_id": "0xb82381a3fbd3fafa77b3a7be693342618240067b_0x9ce1",
      "info": {
        // Represents a quantity of 0.5 * 1e18
        "total_deposit_amount": "500000000000000000",
        // The below amount is "free" as in not deleted to an operator
        "withdrawable_amount": "500000000000000000",
        // The below amount is currently "unbonding"
        "pending_undelegation_amount": "0"
      }
    }
  ]
}

If the above transaction is executed post network launch, may be used to check whether the Deposit message, sent from Ethereum to Imua, was executed on the destination chain successfully. Once it is executed, the deposited amount can be queried from Imua.

exoETH
wstETH
Alchemy
Infura
faucet
wstETH
faucet
LayerZeroScan