Skip to main content

Module transfer

Module transfer 

Source
Expand description

Moving money: sends and moves between balances on the venue, USDC in and out through the Arbitrum bridge, spot tokens between HyperCore and HyperEVM, and the ERC-20 calls they need.

Re-exports§

pub use crate::utils::sign::L1Action;
pub use crate::utils::sign::UserAction;
pub use evm::HYPE_SYSTEM;
pub use evm::Linked;
pub use evm::is_system_address;
pub use evm::system_address;
pub use evm::system_token;
pub use send::AgentSendAsset;
pub use send::Amount;
pub use send::BadAmount;
pub use send::Balance;
pub use send::Change;
pub use send::Ctx;
pub use send::Effect;
pub use send::EvmContract;
pub use send::HYPE_EVM_DECIMALS;
pub use send::MAX_DECIMALS;
pub use send::PERP_DEX;
pub use send::Plan;
pub use send::PreTransferCheck;
pub use send::Refused;
pub use send::SPOT_DEX;
pub use send::SendAsset;
pub use send::SpotOut;
pub use send::SpotSend;
pub use send::SpotToken;
pub use send::UsdClassTransfer;
pub use send::UsdSend;
pub use send::Withdraw3;
pub use send::clean_amount;
pub use send::key;
pub use send::pre_transfer_check;
pub use send::pre_transfer_check_request;

Modules§

bridge
USDC in and out of Hyperliquid through the Arbitrum bridge. In: a USDC transfer to the bridge on Arbitrum, credited to the same address on Hyperliquid in about a minute; under MINIMUM_DEPOSIT it is lost. Out: withdraw3 on the venue (crate::transfer::Withdraw3). The reads before a deposit are crate::client::evm::rpc queries, sent by the caller.
erc20
The ERC-20 calls a bridge or a Core link needs: transfer (USDC into the Arbitrum bridge, a token back to Core through its system address), balanceOf, approve, decimals and symbol, and their answers.
evm
HyperCore and HyperEVM, linked. A linked spot token crosses between Core and EVM spot through its system address: 0x2222...2222 for HYPE, 0x20, zeros and the token index for any other. Core to EVM is a spotSend or sendAsset to Linked::system; EVM to Core is a HyperEVM transaction to the same address (Linked::to_core). A send to a system address leaves Core rather than reaching a person, so a transfer checks for them.
send
Money moved on the venue: the actions that send USDC and spot tokens and move them between an account’s own balances, the plan that turns a move into exactly what is signed, amounts in the form that is hashed, a spot token as a transfer names it, and the check on a recipient.