ApproveAndCall

Allows callers to approve the DragonswapV2 position manager from this contract, for any token, and then make calls into the position manager

Functions

tryApprove

function tryApprove(address token, uint256 amount) private returns (bool);

getApprovalType

Lens to be called off-chain to determine which (if any) of the relevant approval functions should be called

function getApprovalType(address token, uint256 amount) external override returns (ApprovalType);

Parameters

NameTypeDescription

token

address

The token to approve

amount

uint256

The amount to approve

Returns

NameTypeDescription

<none>

ApprovalType

The required approval type

approveMax

Approves a token for the maximum possible amount

function approveMax(address token) external payable override;

Parameters

NameTypeDescription

token

address

The token to approve

approveMaxMinusOne

Approves a token for the maximum possible amount minus one

function approveMaxMinusOne(address token) external payable override;

Parameters

NameTypeDescription

token

address

The token to approve

approveZeroThenMax

Approves a token for zero, then the maximum possible amount

function approveZeroThenMax(address token) external payable override;

Parameters

NameTypeDescription

token

address

The token to approve

approveZeroThenMaxMinusOne

Approves a token for zero, then the maximum possible amount minus one

function approveZeroThenMaxMinusOne(address token) external payable override;

Parameters

NameTypeDescription

token

address

The token to approve

callPositionManager

Calls the position manager with arbitrary calldata

function callPositionManager(bytes memory data) public payable override returns (bytes memory result);

Parameters

NameTypeDescription

data

bytes

Calldata to pass along to the position manager

Returns

NameTypeDescription

result

bytes

The result from the call

balanceOf

function balanceOf(address token) private view returns (uint256);

mint

Calls the position manager's mint function

function mint(MintParams calldata params) external payable override returns (bytes memory result);

Parameters

NameTypeDescription

params

MintParams

Calldata to pass along to the position manager

Returns

NameTypeDescription

result

bytes

The result from the call

increaseLiquidity

Calls the position manager's increaseLiquidity function

function increaseLiquidity(IncreaseLiquidityParams calldata params)
    external
    payable
    override
    returns (bytes memory result);

Parameters

NameTypeDescription

params

IncreaseLiquidityParams

Calldata to pass along to the position manager

Returns

NameTypeDescription

result

bytes

The result from the call

Last updated