Skip to main content

Solidity API

AtlETH

Do not manually set balances without updating totalSupply, as the sum of all user balances must not exceed it.

constructor

constructor(uint256 escrowDuration, uint256 atlasSurchargeRate, uint256 bundlerSurchargeRate, address verification, address simulator, address initialSurchargeRecipient, address l2GasCalculator) internal

balanceOf

function balanceOf(address account) external view returns (uint256)

Returns the unbonded AtlETH balance of the specified account.

Parameters

NameTypeDescription
accountaddressThe address for which to query the unbonded AtlETH balance.

Return Values

NameTypeDescription
[0]uint256The unbonded AtlETH balance of the specified account.

balanceOfBonded

function balanceOfBonded(address account) external view returns (uint256)

Returns the bonded AtlETH balance of the specified account.

Parameters

NameTypeDescription
accountaddressThe address for which to query the bonded AtlETH balance.

Return Values

NameTypeDescription
[0]uint256The bonded AtlETH balance of the specified account.

balanceOfUnbonding

function balanceOfUnbonding(address account) external view returns (uint256)

Returns the unbonding AtlETH balance of the specified account.

Parameters

NameTypeDescription
accountaddressThe address for which to query the unbonding AtlETH balance.

Return Values

NameTypeDescription
[0]uint256The unbonding AtlETH balance of the specified account.

accountLastActiveBlock

function accountLastActiveBlock(address account) external view returns (uint256)

Returns the last active block of the specified account in the escrow contract.

Parameters

NameTypeDescription
accountaddressThe address for which to query the last active block.

Return Values

NameTypeDescription
[0]uint256The last active block of the specified account in the escrow contract.

unbondingCompleteBlock

function unbondingCompleteBlock(address account) external view returns (uint256)

Returns the block number at which the unbonding process of the specified account will be completed.

Parameters

NameTypeDescription
accountaddressThe address for which to query the completion block of unbonding.

Return Values

NameTypeDescription
[0]uint256The block number at which the unbonding process of the specified account will be completed.

deposit

function deposit() external payable

Deposits ETH to receive atlETH tokens in return.

Mints atlETH tokens to the caller in exchange for the deposited ETH.

withdraw

function withdraw(uint256 amount) external

Redeems atlETH tokens for ETH.

Burns the specified amount of atlETH tokens from the caller's balance and transfers the equivalent amount of ETH to the caller.

Parameters

NameTypeDescription
amountuint256The amount of atlETH tokens to redeem for ETH.

_mint

function _mint(address to, uint256 amount) internal

Mints new atlETH tokens and assigns them to the specified account.

Parameters

NameTypeDescription
toaddressThe address to which the newly minted atlETH tokens will be assigned.
amountuint256The amount of atlETH tokens to mint and assign to the specified account.

_burn

function _burn(address from, uint256 amount) internal

Burns atlETH tokens from the specified account.

Parameters

NameTypeDescription
fromaddressThe address from which the atlETH tokens will be burned.
amountuint256The amount of atlETH tokens to burn from the specified account.

_deduct

function _deduct(address account, uint256 amount) internal

Deducts atlETH tokens from the specified account.

This function deducts the specified amount of atlETH tokens from the balance of the specified account. If the deduction results in a negative balance, it handles the shortfall differently depending on whether the account has passed the unbonding lock period. If the account has passed the lock period, the shortfall is considered as unbonding, and the total supply is adjusted accordingly. Otherwise, if the account is still within the lock period, the function reverts due to insufficient balance for deduction.

Parameters

NameTypeDescription
accountaddressThe address from which to deduct atlETH tokens.
amountuint256The amount of atlETH tokens to deduct from the specified account.

bond

function bond(uint256 amount) external

Puts a "hold" on a solver's AtlETH, enabling it to be used in Atlas transactions.

This function locks the specified amount of AtlETH tokens for the sender, making them bonded. Bonded AtlETH tokens must first be unbonded before they can be transferred or withdrawn.

Parameters

NameTypeDescription
amountuint256The amount of AtlETH tokens to bond.

depositAndBond

function depositAndBond(uint256 amountToBond) external payable

Deposits the caller's ETH and mints AtlETH, then bonds a specified amount of that AtlETH.

Parameters

NameTypeDescription
amountToBonduint256The amount of AtlETH tokens to bond after the deposit.

unbond

function unbond(uint256 amount) external

Starts the unbonding wait time for the specified amount of AtlETH tokens.

This function initiates the unbonding process for the specified amount of AtlETH tokens held by the sender. Unbonding AtlETH tokens can still be used by solvers while the unbonding process is ongoing, but adjustments may be made at withdrawal to ensure solvency.

Parameters

NameTypeDescription
amountuint256The amount of AtlETH tokens to unbond.

redeem

function redeem(uint256 amount) external

Redeems the specified amount of AtlETH tokens for withdrawal.

Parameters

NameTypeDescription
amountuint256The amount of AtlETH tokens to redeem for withdrawal.

_bond

function _bond(address owner, uint256 amount) internal

Puts a hold on a solver's AtlETH tokens, enabling them to be used in Atlas transactions.

This internal function puts a hold on a solver's AtlETH tokens, enabling them to be used in Atlas transactions. The specified amount of AtlETH tokens is deducted from the owner's balance and added to the bonded balance. The total supply and bonded total supply are updated accordingly.

Parameters

NameTypeDescription
owneraddressThe address of the account to put a hold on AtlETH tokens for.
amountuint256The amount of AtlETH tokens to put a hold on.

_unbond

function _unbond(address owner, uint256 amount) internal

Starts the unbonding wait time for a specified amount of AtlETH tokens.

This internal function starts the unbonding wait time for a specified amount of AtlETH tokens. The specified amount of AtlETH tokens is deducted from the owner's bonded balance and added to the unbonding balance. The last accessed block for the owner is updated to the current block number.

Parameters

NameTypeDescription
owneraddressThe address of the account to start the unbonding wait time for.
amountuint256The amount of AtlETH tokens to start the unbonding wait time for.

_redeem

function _redeem(address owner, uint256 amount) internal

Redeems the specified amount of AtlETH tokens for withdrawal.

This function allows the owner to redeem a specified amount of AtlETH tokens for withdrawal. If the unbonding process is active for the specified account, the function will revert. Otherwise, the specified amount of AtlETH tokens will be added back to the account's balance, and the total supply will be updated accordingly.

Parameters

NameTypeDescription
owneraddressThe address of the account redeeming AtlETH tokens for withdrawal.
amountuint256The amount of AtlETH tokens to redeem for withdrawal.

withdrawSurcharge

function withdrawSurcharge() external

Allows the current surcharge recipient to withdraw the accumulated surcharge. NOTE: If the only ETH in Atlas is the surcharge, be mindful that withdrawing this ETH may limit solvers' liquidity to flashloan ETH from Atlas in their solverOps.

This function can only be called by the current surcharge recipient. It transfers the accumulated surcharge amount to the surcharge recipient's address.

transferSurchargeRecipient

function transferSurchargeRecipient(address newRecipient) external

Starts the transfer of the surcharge recipient designation to a new address.

This function can only be called by the current surcharge recipient. It sets the pendingSurchargeRecipient to the specified newRecipient address, allowing the new recipient to claim the surcharge recipient designation by calling becomeSurchargeRecipient. If the caller is not the current surcharge recipient, it reverts with an InvalidAccess error.

Parameters

NameTypeDescription
newRecipientaddressThe address of the new surcharge recipient.

becomeSurchargeRecipient

function becomeSurchargeRecipient() external

Finalizes the transfer of the surcharge recipient designation to a new address.

This function can only be called by the pending surcharge recipient, and it completes the transfer of the surcharge recipient designation to the address stored in pendingSurchargeRecipient. If the caller is not the pending surcharge recipient, it reverts with an InvalidAccess error.

_checkIfUnlocked

function _checkIfUnlocked() internal view