Skip to main content
The wallet and minter smart contracts have a set of interfaces and events that you can use to build with Circle Gateway. This page describes the user-facing methods of these contracts.

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
Parameters

depositFor

Deposit tokens on behalf of another address after approving this contract for the token. The resulting balance belongs to the address specified by the depositor parameter, not the function caller.
Solidity
Parameters

depositWithPermit

Deposit tokens with an EIP-2612 permit. The resulting balance belongs to the owner specified in the permit. The permit’s spender must be the address of the GatewayWallet contract. The full permitted value is always deposited.
Solidity
Parameters

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 the owner 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
Parameters

depositWithAuthorization

Deposit tokens with an ERC-3009 authorization. The resulting balance in this contract belongs to the from specified in the authorization. The authorization’s to must be the address of the GatewayWallet contract.
Solidity
Parameters

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 the from 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
Parameters

totalBalance

Returns the total balance of a depositor for a given token. This will always be equal to the sum of availableBalance and withdrawingBalance.
Solidity
Parameters 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
Parameters Returns

withdrawingBalance

Returns the balance that is in the process of being withdrawn from the GatewayWallet contract.
Solidity
Parameters Returns

withdrawableBalance

Returns the balance that is withdrawable as of the current block. This will either be 0 or withdrawingBalance.
Solidity
Parameters 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
Parameters Returns

balanceOfBatch

The batch version of balanceOf, compatible with ERC-1155. depositors and ids must be the same length. See the documentation for balanceOf for the format of ids.
Solidity
Parameters Returns

addDelegate

Allow a delegate to transfer the caller’s balance of the specified token. This acts as a full allowance for delegate on the token balance of the function caller.
Solidity
Parameters

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
Parameters

isAuthorizedForBalance

Returns whether an address is authorized to transfer tokens on behalf of a depositor.
Solidity
Parameters Returns

withdrawalDelay

Returns the number of blocks that must pass after calling initiateWithdrawal before a withdrawal can be completed.
Solidity
Returns

withdrawalBlock

Returns the block height at which an in-progress withdrawal is withdrawable, or 0 if there is no in-progress withdrawal.
Solidity
Parameters Returns

initiateWithdrawal

Starts the withdrawal process. After withdrawalDelay 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
Parameters

withdraw

Completes a withdrawal that was initiated at least withdrawalDelay 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
Parameters

GatewayMinter

gatewayMint

Mint funds via a signed attestation from the Gateway API. Emits an event containing the keccak256 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
Parameters

Common

These methods are supported by both the GatewayWallet and GatewayMinter contracts.

domain

The domain assigned to the chain this contract is deployed on.
Solidity
Returns

isTokenSupported

Whether or not a token is supported.
Solidity
Parameters Returns

isTransferSpecHashUsed

Whether or not a transfer spec hash has been used.
Solidity
Parameters Returns

isDenylisted

Whether or not a given address is denied from interacting with the contract.
Solidity
Parameters Returns

Events

GatewayWallet

Deposited

Emitted when a deposit is made. The sender will always be the same as depositor, except when a deposit is made using depositFor.
Solidity
Parameters

DelegateAdded

Emitted when a delegate is authorized for a depositor’s balance.
Solidity
Parameters

DelegateRemoved

Emitted when a delegate’s authorization is revoked.
Solidity
Parameters

WithdrawalInitiated

Emitted when a withdrawal is initiated.
Solidity
Parameters

WithdrawalCompleted

Emitted when a withdrawal is completed and funds have been transferred to the depositor.
Solidity
Parameters

GatewayBurned

Emitted when Circle burns tokens that have been minted on another domain
Solidity
Parameters

GatewayMinter

AttestationUsed

Emitted when an attestation is used.
Solidity
Parameters

Common

These events are emitted by both the GatewayWallet and GatewayMinter contracts.

Denylisted

Emitted when an address is added to the denylist.
Solidity
Parameters

UnDenylisted

Emitted when an address is removed from the denylist.
Solidity
Parameters

TokenSupported

Emitted when a token is added to the set of supported tokens.
Solidity
Parameters