Developer Quickstart
This quickstart uses the Testnet release and Foundry’s cast. You send a token transfer from Sepolia to SupraMVM Testnet by calling the Token Bridge directly, then post your first cross-chain message.
Before you begin
- Foundry installed, for
cast. - A Sepolia account with Sepolia ETH for gas, and its private key in
PRIVATE_KEY. - A supported token on Sepolia, such as WETH, which you can wrap from Sepolia ETH. See Supported Tokens.
- A SupraMVM Testnet account to receive the tokens, such as a StarKey Wallet account.
Set these environment variables. Take the Sepolia addresses from the Testnet tab of Contract Addresses and Supported Tokens:
export RPC_URL=<SEPOLIA_RPC_URL>
export TOKEN_BRIDGE=<SEPOLIA_TOKEN_BRIDGE_PROXY>
export HYPERNOVA=<SEPOLIA_HYPERNOVA_PROXY>
export TOKEN=<SEPOLIA_TOKEN_ADDRESS>
export SUPRA_CHAIN_ID=6 # SupraMVM Testnet
export RECEIVER=<YOUR_SUPRAMVM_ADDRESS> # 32-byte address: 0x followed by 64 hex digits
export AMOUNT=<AMOUNT_IN_TOKEN_BASE_UNITS> # within the token's transfer limitsIf TOKEN is WETH, wrap Sepolia ETH into WETH first:
cast send $TOKEN "deposit()" --value $AMOUNT --rpc-url $RPC_URL --private-key $PRIVATE_KEYSend a token transfer
Quote the fee
cast call $TOKEN_BRIDGE \
"inboundTokenFee(uint64,uint256,address)(uint64,uint64,uint64,uint256)" \
$SUPRA_CHAIN_ID $AMOUNT $TOKEN --rpc-url $RPC_URLThe first value is the amount the receiver gets, in SupraMVM’s token decimals.
Approve the Token Bridge
cast send $TOKEN "approve(address,uint256)" $TOKEN_BRIDGE $AMOUNT \
--rpc-url $RPC_URL --private-key $PRIVATE_KEYSend
cast send $TOKEN_BRIDGE \
"sendTokens(uint64,address,uint256,bytes32,bytes32)" \
$SUPRA_CHAIN_ID $TOKEN $AMOUNT $RECEIVER \
0x0000000000000000000000000000000000000000000000000000000000000000 \
--rpc-url $RPC_URL --private-key $PRIVATE_KEYWatch it arrive
The receipt contains a MessagePosted log from $HYPERNOVA. The log’s messageId identifies the transfer.
After the block meets the Token Bridge’s finality rule, a relayer delivers the transfer. The Token Bridge on SupraMVM mints the wrapped token to $RECEIVER. If you sent the SUPRA ERC-20 token, it releases SUPRA instead. See Track a Transfer.
Post a first message
Any address can post a message to a registered destination chain, and posting is free:
cast send $HYPERNOVA "postMessage(bytes,uint64)" 0x68656c6c6f $SUPRA_CHAIN_ID \
--rpc-url $RPC_URL --private-key $PRIVATE_KEYHypernova assigns the message a messageId, and the MessagePosted log records it with your address as caller. SupraNova’s relayers do not deliver this message. To act on it, relay it yourself to your own Move module on SupraMVM, which verifies it through hypernova_core. See Relay a Message and Receive a Message.
Next steps
- Smart Contract Integration — the rules for every transfer, and sending from SupraMVM
- Messaging Overview — build an application on HyperNova
- Contract Addresses