CoreDepositWallet contract on HyperEVM allows you to deposit USDC from
HyperEVM to HyperCore. This topic describes the contract interface and the
available deposit functions.
Deposit functions
TheCoreDepositWallet provides three entry points for depositing USDC from
HyperEVM into HyperCore. All deposits credit a user’s balance on HyperCore, on
either the perps or spot DEX.
deposit function
The deposit function transfers USDC from the caller’s address and credits the
same address on HyperCore, after the caller has approved the CoreDepositWallet
to spend their tokens.
Signature:
Token pull: Uses
transferFrom(msg.sender, address(this), amount) →
requires prior ERC-20 approve from the msg.sender to the core deposit wallet.
Who is credited: The msg.sender of the transaction on HyperEVM is credited
on HyperCore.
Examples:
ERC-20 Approval:
Note: If the destination DEX value is not supported (spot or perps), the
deposit is credited to the sender’s spot balance.
depositFor function
The depositFor function transfers USDC from the caller but credits a specified
recipient address on HyperCore. This allows deposits on behalf of another user.
Signature:
Token pull: Uses
transferFrom(msg.sender, address(this), amount) →
requires prior ERC-20 approve from the msg.sender to the core deposit wallet.
Who is credited: The recipient address passed to the function is credited on
HyperCore.
Examples:
ERC-20 Approval:
Note: If the destination DEX value is not supported (spot or perps), the
deposit is credited to the recipient’s spot balance.
depositWithAuth function
The depositWithAuth function allows depositing USDC using a pre-signed
ERC-3009 authorization. This enables a deposit where the token transfer is
authorized offchain and executed onchain without requiring a prior approve call.
Signature:
amount: The USDC amount being deposited from HyperEVM to HyperCoreauthValidAfter,authValidBefore,authNonce,v,r,s: EIP-3009-style authorization fields forreceiveWithAuthorizationdestinationDex: The HyperCore destinationdexindex. Accepted values are:0→ default perps DEXtype(uint32).max→ spot DEX
token.receiveWithAuthorization(...), no prior approve
needed.
Who is credited: The msg.sender which has to match the from address from
the receiveWithAuthorization is credited on HyperCore.
receiveWithAuthorization details:
- ERC: ERC-3009
- Function Signature:
ReceiveWithAuthorization - Parameters:
Example:
The example below illustrates how to generate an ERC-3009 authorization:
depositWithAuth function with
the authorization data:
Note: If the destination DEX value is not supported (spot or
perp), the
deposit is credited to the authorizer's spot balance.