UniV4StandardModulePublic

Git Source

Inherits: UniV4StandardModule, IArrakisLPModulePublic

this module can only set uni v4 pool that have generic hook, that don't require specific action to become liquidity provider.

State Variables

id

id = keccak256(abi.encode("UniV4StandardModulePublic"))

bytes32 public constant id =
    0x22f7eb8a1e047f6c492e05813f6e9c6cb1563d057a61278b8e0ae7977af1ac3f;

notFirstDeposit

bool public notFirstDeposit;

Functions

constructor

constructor(
    address poolManager_,
    address guardian_
) UniV4StandardModule(poolManager_, guardian_);

deposit

function used by metaVault to deposit tokens into the strategy.

function deposit(
    address depositor_,
    uint256 proportion_
)
    external
    payable
    onlyMetaVault
    nonReentrant
    whenNotPaused
    returns (uint256 amount0, uint256 amount1);

Parameters

NameTypeDescription
depositor_addressaddress that will provide the tokens.
proportion_uint256proportion of position needed to be add.

Returns

NameTypeDescription
amount0uint256amount of token0 deposited.
amount1uint256amount of token1 deposited.

initializePosition

function initializePosition(
    bytes calldata
) external override onlyMetaVault;

withdraw

function used by metaVault to withdraw tokens from the strategy.

function withdraw(
    address receiver_,
    uint256 proportion_
) public override returns (uint256 amount0, uint256 amount1);

Parameters

NameTypeDescription
receiver_addressaddress that will receive tokens.
proportion_uint256proportion of position needed to be withdrawn.

Returns

NameTypeDescription
amount0uint256amount of token0 withdrawn.
amount1uint256amount of token1 withdrawn.

unlockCallback

Called by the pool manager on msg.sender when a lock is acquired

function unlockCallback(
    bytes calldata data_
) public virtual returns (bytes memory);

Parameters

NameTypeDescription
data_bytesThe data that was passed to the call to lock

Returns

NameTypeDescription
<none>bytesresult data that you want to be returned from the lock call