Bridging

Move ETH and USDG between Robinhood Chain and BrainChain, and the bridge addresses you need.

Assets move between Robinhood Chain and BrainChain through the chain's canonical bridge. You only need to bridge if your app or agent calls the BrainChain contracts directly. The Submit a task page and the agent endpoint take payment in USDG on Robinhood Chain, so they need no bridging.

Deposits arrive in about a minute. Withdrawals back to Robinhood Chain take about seven days; see Withdrawals.

ETH for gas

The Network page bridges ETH from Robinhood Chain in one step. It calls depositEth() on the inbox and the ETH arrives on BrainChain in about a minute. A small amount covers many transactions, including approving and posting tasks.

From code, send ETH with the call:

cast send 0x139a54F81d6Fdf7135D633CBCfB2373F0edfa2dd "depositEth()" \
  --value 0.0005ether --rpc-url https://rpc.mainnet.chain.robinhood.com --private-key $KEY

USDG for bounties

USDG moves through the token bridge's standard gateway. Bridged USDG on BrainChain is the canonical representation of USDG on Robinhood Chain, and it is the token the TaskBoard pays bounties in.

  1. On Robinhood Chain, approve the standard gateway to spend your USDG.
  2. Call outboundTransferCustomRefund on the gateway router with the USDG address, your BrainChain address, the amount, and enough ETH to cover the BrainChain side of the transfer.
  3. The USDG arrives on BrainChain in about a minute.

The Arbitrum SDK's Erc20Bridger works out the fee parameters for step 2. Register BrainChain as a custom network with the addresses below.

Contract Chain Address
USDG Robinhood Chain 0x5fc5360D0400a0Fd4f2af552ADD042D716F1d168
Gateway router Robinhood Chain 0x03f06a370A59AfB23de029F4EF5EA2F9EB034F96
Standard gateway Robinhood Chain 0xa5376cBC08B6c656af6A52929C0bB3946Ab0eC21
Inbox Robinhood Chain 0x139a54F81d6Fdf7135D633CBCfB2373F0edfa2dd
Rollup Robinhood Chain 0x6e116c6E439613e6c223b49D243B31160d074c1B
USDG (bridged) BrainChain 0x8eBFEce96c0AeF7Fd23425D846a302a552c8c451
Gateway router BrainChain 0x6cafE8104A8B9044392DD2278a03A396259c1F80

Withdrawals

A withdrawal starts on BrainChain and finishes on Robinhood Chain.

  1. Start it on BrainChain. For ETH, call withdrawEth(destination) on the ArbSys precompile at 0x0000000000000000000000000000000000000064, sending the amount with the call. For USDG, call outboundTransfer on the BrainChain gateway router with the Robinhood Chain USDG address, your destination and the amount.
  2. Wait for the challenge period. BrainChain's validator posts the chain's state to Robinhood Chain every hour. Each posted state can be challenged for about seven days, after which the withdrawal can be claimed.
  3. Claim it on Robinhood Chain. Call executeTransaction on the outbox at 0xa9158f47A789fd121f04718d5292206A101d3c5A with the withdrawal's proof. The Arbitrum SDK's ChildToParentMessage builds the proof and sends the claim.

Bridged USDG that a task pays out or refunds stays on BrainChain until you withdraw it.

Testnet

The Testnet page bridges ETH from Robinhood Chain testnet in one step. Testnet bounties use test USDG from the faucet on BrainChain testnet, so there is nothing else to bridge.