Skip to main content

Deposit contracts

StellarDepositFactory gives each user a deposit address on an EVM funding network (an EIP-1167 clone of StellarDeposit, created with CREATE2 and salt keccak256(stellarWallet)). The address can only burn its own USDC through Circle CCTP V2 to that Stellar wallet. No owner, no admin, no upgrade. Implementation: 0x937a715805Bd525CBBF2817f5Eb184a322D7016c.

Base (testnet) · 0x05672D3bD02b1ebBFA6F4f5C104A7f2b7d0a2291 · View on explorer · View on GitHub

StellarDepositFactory​

addressFor​

READ
addressFor(string recipient) view returns (address)

The deposit address for a Stellar wallet, whether or not it exists yet.

flush​

WRITE
flush(string recipient, uint256 maxFee, uint32 minFinalityThreshold) returns (uint256)

Who can call: anyone

Creates the deposit address if needed, initialises it with the recipient, then burns its whole USDC balance through TokenMessengerV2.depositForBurnWithHook to Circle's Stellar CctpForwarder with the recipient in the hook. Only sends the user's own USDC to the user's own wallet.

Errors: below minimum, fee above cap, bad finality, recipient length, recipient type, recipient charset, create failed

hookFor​

READ
hookFor(string recipient) pure returns (bytes)

The forwarder hook: 24 zero bytes, version 0, length, then the strkey. Reverts unless the recipient is a 56-character G or C strkey.

configuration​

READ
usdc() · tokenMessenger() · forwarder() · destinationDomain() · minAmount() · maxFeeBps() · implementation()

Immutable configuration. On Base Sepolia: minimum 1 USDC, fee cap 10 bps, domain 27.

StellarDeposit (each deposit address)​

flush (on a deposit address)​

WRITE
flush(uint256 maxFee, uint32 minFinalityThreshold) returns (uint256 amount)

Who can call: anyone

The same forward, called on an existing deposit address directly.

Errors: below minimum, fee above cap, bad finality, not a deposit address

initialize​

WRITE
initialize(bytes hook)

Who can call: factory, once

Sets the factory and hook in the creating transaction. Reverts afterwards; the implementation itself is locked.

Errors: initialized

hookData​

READ
factory() · hookData()

Set at initialisation.

Events​

EventTopicsData
DepositCreateddepositrecipient
Flushedamount, maxFee, minFinalityThreshold