AtomicSolverV2

Git Source

Inherits: IAtomicSolver, Auth

Author: crispymangoes

State Variables

eETH

ERC20 internal constant eETH = ERC20(0x35fA164735182de50811E8e2E824cFb9B6118ac2);

weETH

ERC20 internal constant weETH = ERC20(0xCd5fE23C85820F7B72D0926FC9b05b43E359b7ee);

Functions

constructor

constructor(address _owner, Authority _authority) Auth(_owner, _authority);

p2pSolve

Solver wants to exchange p2p share.asset() for withdraw queue shares.

Solver should approve this contract to spend share.asset().

redeemSolve

Solver wants to redeem withdraw offer shares, to help cover withdraw.

offer MUST be an ERC4626 vault.

redeemLiquidSolve

Solver wants to redeem withdraw offer shares, to help cover withdraw.

offer MUST be an ERC4626 vault.

finishSolve

Implement the finishSolve function WithdrawQueue expects to call.

nonReentrant is not needed on this function because it is impossible to reenter, because the above solve functions have the nonReentrant modifier. The only way to have the first 2 checks pass is if the msg.sender is the queue, and this contract is msg.sender of Queue.solve(), which is only called in the above functions.

_p2pSolve

Helper function containing the logic to handle p2p solves.

_redeemSolve

Helper function containing the logic to handle redeem solves.

_redeemLiquidSolve

Helper function containing the logic to handle redeem solves.

Errors

AtomicSolverV2___WrongInitiator

AtomicSolverV2___AlreadyInSolveContext

AtomicSolverV2___FailedToSolve

AtomicSolverV2___SolveMaxAssetsExceeded

AtomicSolverV2___P2PSolveMinSharesNotMet

AtomicSolverV2___RedeemSolveMinAssetDeltaNotMet

Enums

SolveType

The Solve Type, used in finishSolve to determine the logic used.

P2P Solver wants to swap share.asset() for user(s) shares

REDEEM Solver needs to redeem shares, then can cover user(s) required assets.

Was this helpful?