Skip to main content

Action

Git Source - Generated with forge doc

enum Action {
NESTED_SELF_UNLOCK,
NESTED_EXECUTOR_UNLOCK,
SWAP_AND_SETTLE,
DONATE_AND_SETTLE,
ADD_LIQUIDITY_AND_SETTLE,
REMOVE_LIQUIDITY_AND_SETTLE,
INITIALIZE
}

PoolNestedActionsTest

Git Source

Inherits: Test, IUnlockCallback

State Variables

manager

IPoolManager manager;

executor

NestedActionExecutor public executor;

user

address user;

Functions

constructor

constructor(IPoolManager _manager);

unlock

function unlock(bytes calldata data) external;

unlockCallback

Called by the pool manager on msg.sender when the manager is unlocked

function unlockCallback(bytes calldata data) external override returns (bytes memory);

_nestedUnlock

function _nestedUnlock() internal;

NestedActionExecutor

Git Source

Inherits: Test, PoolTestBase

State Variables

key

PoolKey internal key;

user

address user;

ADD_LIQUIDITY_PARAMS

IPoolManager.ModifyLiquidityParams internal ADD_LIQUIDITY_PARAMS =
IPoolManager.ModifyLiquidityParams({tickLower: -120, tickUpper: 120, liquidityDelta: 1e18, salt: 0});

REMOVE_LIQUIDITY_PARAMS

IPoolManager.ModifyLiquidityParams internal REMOVE_LIQUIDITY_PARAMS =
IPoolManager.ModifyLiquidityParams({tickLower: -120, tickUpper: 120, liquidityDelta: -1e18, salt: 0});

SWAP_PARAMS

IPoolManager.SwapParams internal SWAP_PARAMS =
IPoolManager.SwapParams({zeroForOne: true, amountSpecified: -100, sqrtPriceLimitX96: Constants.SQRT_PRICE_1_2});
uint256 internal DONATE_AMOUNT0 = 12345e6;
uint256 internal DONATE_AMOUNT1 = 98765e4;

Functions

constructor

constructor(IPoolManager _manager, address _user) PoolTestBase(_manager);

setKey

function setKey(PoolKey memory _key) external;

execute

function execute(Action[] memory actions) public;

_nestedUnlock

function _nestedUnlock() internal;

_swap

function _swap(address caller) internal;

_addLiquidity

function _addLiquidity(address caller) internal;

_removeLiquidity

function _removeLiquidity(address caller) internal;

_donate

function _donate(address caller) internal;

_initialize

function _initialize() internal;

unlockCallback

function unlockCallback(bytes calldata) external pure override returns (bytes memory);

Errors

KeyNotSet

error KeyNotSet();