Interfaces
This section provides information on the public methods of the GatewayWallet and GatewayMinter smart contracts. The full ABIs are available on GitHub.GatewayWallet
deposit
Deposit tokens after approving this contract for the token. The resulting balance belongs to the function caller.Solidity
depositFor
Deposit tokens on behalf of another address after approving this contract for the token. The resulting balance belongs to the address specified by thedepositor parameter, not the function caller.
Solidity
depositWithPermit
Deposit tokens with an EIP-2612 permit. The resulting balance belongs to theowner specified in the permit. The permit’s spender must be the address of
the GatewayWallet contract. The full permitted value is always deposited.
Solidity
depositWithPermit
Deposit tokens with an EIP-2612 permit (using the EIP-7597 extension), passing the signature as bytes to allow for SCA deposits. The resulting balance belongs to theowner specified in the permit. The permit’s spender must be the
address of the GatewayWallet contract. The full permitted value is always
deposited. EOA wallet signatures should be packed in the order of r, s, v.
Solidity
depositWithAuthorization
Deposit tokens with an ERC-3009 authorization. The resulting balance in this contract belongs to thefrom specified in the authorization. The
authorization’s to must be the address of the GatewayWallet contract.
Solidity
depositWithAuthorization
Deposit tokens with an ERC-3009 authorization (using the ERC-7598 extension), passing the signature as bytes to allow for SCA deposits. The resulting balance in this contract belongs to thefrom specified in the authorization. The
authorization’s to must be the address of this contract. The transfer will be
done via receiveWithAuthorization. EOA wallet signatures should be packed in
the order of r, s, v.
Solidity
totalBalance
Returns the total balance of a depositor for a given token. This will always be equal to the sum ofavailableBalance and withdrawingBalance.
Solidity
Returns
availableBalance
Returns the balance that is available to the depositor, subject to deposits being observed by Circle in a finalized block and excepting in-flight transfers.Solidity
Returns
withdrawingBalance
Returns the balance that is in the process of being withdrawn from the GatewayWallet contract.Solidity
Returns
withdrawableBalance
Returns the balance that is withdrawable as of the current block. This will either be 0 orwithdrawingBalance.
Solidity
Returns
balanceOf
Returns the balance of a depositor for a given token and balance type, compatible with ERC-1155. The “token”id is encoded as
uint256(bytes32(abi.encodePacked(uint96(BALANCE_TYPE), address(token)))),
where BALANCE_TYPE is 0 for Total, 1 for Available, 2 for Withdrawing,
and 3 for Withdrawable.
Solidity
Returns
balanceOfBatch
The batch version ofbalanceOf, compatible with ERC-1155. depositors and
ids must be the same length. See the documentation for balanceOf for the
format of ids.
Solidity
Returns
addDelegate
Allow a delegate to transfer the caller’s balance of the specified token. This acts as a full allowance fordelegate on the token balance of the function
caller.
Solidity
removeDelegate
Stop allowing a delegate to transfer the caller’s balance of the specified token. This revocation is not respected for burn intents that have already been signed, so that burns cannot be prevented by removing the delegate.Solidity
isAuthorizedForBalance
Returns whether an address is authorized to transfer tokens on behalf of a depositor.Solidity
Returns
withdrawalDelay
Returns the number of blocks that must pass after callinginitiateWithdrawal
before a withdrawal can be completed.
Solidity
withdrawalBlock
Returns the block height at which an in-progress withdrawal is withdrawable, or 0 if there is no in-progress withdrawal.Solidity
Returns
initiateWithdrawal
Starts the withdrawal process. AfterwithdrawalDelay blocks, withdraw may be
called to complete the withdrawal. Once a withdrawal has been initiated, that
amount can no longer be used. Repeated calls will add to the amount and reset
the timer.
Solidity
withdraw
Completes a withdrawal that was initiated at leastwithdrawalDelay blocks ago.
The funds are sent to the depositor (who must be the caller of this function).
The full amount that is in the process of being withdrawn is always withdrawn.
Solidity
GatewayMinter
gatewayMint
Mint funds via a signed attestation from the Gateway API. Emits an event containing thekeccak256 hash of the encoded TransferSpec (which is the same
for the corresponding burn that will happen on the source domain), to be used as
a cross-chain identifier and for replay protection.
Solidity
Common
These methods are supported by both theGatewayWallet and GatewayMinter
contracts.
domain
The domain assigned to the chain this contract is deployed on.Solidity
isTokenSupported
Whether or not a token is supported.Solidity
Returns
isTransferSpecHashUsed
Whether or not a transfer spec hash has been used.Solidity
Returns
isDenylisted
Whether or not a given address is denied from interacting with the contract.Solidity
Returns
Events
GatewayWallet
Deposited
Emitted when a deposit is made. Thesender will always be the same as
depositor, except when a deposit is made using depositFor.
Solidity
DelegateAdded
Emitted when a delegate is authorized for a depositor’s balance.Solidity
DelegateRemoved
Emitted when a delegate’s authorization is revoked.Solidity
WithdrawalInitiated
Emitted when a withdrawal is initiated.Solidity
WithdrawalCompleted
Emitted when a withdrawal is completed and funds have been transferred to the depositor.Solidity
GatewayBurned
Emitted when Circle burns tokens that have been minted on another domainSolidity
GatewayMinter
AttestationUsed
Emitted when an attestation is used.Solidity
Common
These events are emitted by both theGatewayWallet and GatewayMinter
contracts.
Denylisted
Emitted when an address is added to the denylist.Solidity
UnDenylisted
Emitted when an address is removed from the denylist.Solidity
TokenSupported
Emitted when a token is added to the set of supported tokens.Solidity