PancakeSwapV4StandardModulePublic

Git Source

Inherits: PancakeSwapV4StandardModule, IArrakisLPModulePublic

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

State Variables

id

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

bytes32 public constant id =
    0xf8a84b2e3e22d069766d4756d362bc5c6eb85d74765bf4feeb8c017f9e8c7937;

notFirstDeposit

bool public notFirstDeposit;

Functions

constructor

constructor(
    address poolManager_,
    address guardian_,
    address vault_,
    address distributor_,
    address collector_
)
    PancakeSwapV4StandardModule(
        poolManager_,
        guardian_,
        vault_,
        distributor_,
        collector_
    );

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.

lockAcquired

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

function lockAcquired(
    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