We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Inherits: IArrakisPrivateVaultRouter, ReentrancyGuard, Ownable, Pausable
address public immutable nativeToken;
IPermit2 public immutable permit2;
IRouterSwapExecutor public immutable swapper;
IArrakisMetaVaultFactory public immutable factory;
IWETH9 public immutable weth;
modifier onlyPrivateVault(address vault_);
constructor(address nativeToken_, address permit2_, address swapper_, address owner_, address factory_, address weth_);
function used to pause the router.
only callable by owner
function pause() external whenNotPaused onlyOwner;
function used to unpause the router.
function unpause() external whenPaused onlyOwner;
struct AddLiquidityData { uint256 amount0; uint256 amount1; address vault; }
addLiquidity adds liquidity to meta vault of interest (mints L tokens)
function addLiquidity(AddLiquidityData memory params_) external payable nonReentrant whenNotPaused onlyPrivateVault(params_.vault) returns (uint256 amount0, uint256 amount1);
Parameters
params_
AddLiquidityData
Returns
amount0
uint256
amount1
Check
addLiquidityData.amount0
addLiquidityData.amount1
Effects
token0
token1
module
Interactions
ArrakisMetaVaultPrivate.fund
Assertions
[Git Source]
struct SwapAndAddData { SwapData swapData; AddLiquidityData addData; }
Git Source
struct SwapData { bytes swapPayload; uint256 amountInSwap; uint256 amountOutSwap; address swapRouter; bool zeroForOne; }
swapAndAddLiquidity transfer tokens to and calls RouterSwapExecutor
function swapAndAddLiquidity(SwapAndAddData memory params_) external payable nonReentrant whenNotPaused onlyPrivateVault(params_.addData.vault) returns (uint256 amount0, uint256 amount1, uint256 amount0Diff, uint256 amount1Diff);
SwapAndAddData
mintAmount
amount0Diff
amount1Diff
Checks
struct RemoveLiquidityData { uint256 amount0; uint256 amount1; address vault; address payable receiver; }
addLiquidityPermit2 adds liquidity to private vault of interest (mints LP tokens)
function addLiquidityPermit2(AddLiquidityPermit2Data memory params_) external payable nonReentrant whenNotPaused onlyPrivateVault(params_.addData.vault) returns (uint256 amount0, uint256 amount1, uint256 sharesReceived);
AddLiquidityPermit2Data
swapAndAddLiquidityPermit2 transfer tokens to and calls RouterSwapExecutor
function swapAndAddLiquidityPermit2(SwapAndAddPermit2Data memory params_) external payable nonReentrant whenNotPaused onlyPrivateVault(params_.swapAndAddData.addData.vault) returns (uint256 amount0, uint256 amount1, uint256 sharesReceived, uint256 amount0Diff, uint256 amount1Diff);
SwapAndAddPermit2Data
removeLiquidityPermit2 removes liquidity from vault and burns LP tokens
function removeLiquidityPermit2(RemoveLiquidityPermit2Data memory params_) external nonReentrant whenNotPaused onlyPrivateVault(params_.removeData.vault) returns (uint256 amount0, uint256 amount1);
RemoveLiquidityPermit2Data
burnAmount
wrapAndAddLiquidity wrap eth and adds liquidity to meta vault of iPnterest (mints L tokens)
function wrapAndAddLiquidity(AddLiquidityData memory params_) external payable nonReentrant whenNotPaused onlyPrivateVault(params_.vault) returns (uint256 amount0, uint256 amount1, uint256 sharesReceived);
wrapAndSwapAndAddLiquidity wrap eth and transfer tokens to and calls RouterSwapExecutor
function wrapAndSwapAndAddLiquidity(SwapAndAddData memory params_) external payable nonReentrant whenNotPaused onlyPrivateVault(params_.addData.vault) returns (uint256 amount0, uint256 amount1, uint256 sharesReceived, uint256 amount0Diff, uint256 amount1Diff);
wrapAndAddLiquidityPermit2 wrap eth and adds liquidity to private vault of interest (mints LP tokens)
hack to get rid of stack too depth
function wrapAndAddLiquidityPermit2(AddLiquidityPermit2Data memory params_) external payable nonReentrant whenNotPaused onlyPrivateVault(params_.addData.vault) returns (uint256 amount0, uint256 amount1, uint256 sharesReceived);
wrapAndSwapAndAddLiquidityPermit2 wrap eth and transfer tokens to and calls RouterSwapExecutor
function wrapAndSwapAndAddLiquidityPermit2(SwapAndAddPermit2Data memory params_) external payable nonReentrant whenNotPaused onlyPrivateVault(params_.swapAndAddData.addData.vault) returns (uint256 amount0, uint256 amount1, uint256 sharesReceived, uint256 amount0Diff, uint256 amount1Diff);
receive() external payable;
getMintAmounts used to get the shares we can mint from some max amounts.
function getMintAmounts(address vault_, uint256 maxAmount0_, uint256 maxAmount1_) external view returns (uint256 shareToMint, uint256 amount0ToDeposit, uint256 amount1ToDeposit);
vault_
address
maxAmount0_
maxAmount1_
shareToMint
amount0ToDeposit
amount1ToDeposit
function _addLiquidity( address vault_, uint256 amount0_, uint256 amount1_, uint256 shares_, address receiver_, address token0_, address token1_ ) internal;
function _swapAndAddLiquidity(SwapAndAddData memory params_, address token0_, address token1_) internal returns ( uint256 amount0Use, uint256 amount1Use, uint256 amount0, uint256 amount1, uint256 sharesReceived, uint256 amount0Diff, uint256 amount1Diff );
function _swapAndAddLiquiditySendBackLeftOver(SwapAndAddData memory params_, address token0_, address token1_) internal returns (uint256 amount0, uint256 amount1, uint256 sharesReceived, uint256 amount0Diff, uint256 amount1Diff);
function _removeLiquidity(RemoveLiquidityData memory params_) internal returns (uint256 amount0, uint256 amount1);
function _permit2AddLengthOne( AddLiquidityPermit2Data memory params_, address token0_, address token1_, uint256 amount0_, uint256 amount1_ ) internal;
function _permit2AddLengthOneOrTwo( AddLiquidityPermit2Data memory params_, address token0_, address token1_, uint256 amount0_, uint256 amount1_ ) internal;
function _permit2Add( uint256 permittedLength_, AddLiquidityPermit2Data memory params_, address token0_, address token1_, uint256 amount0_, uint256 amount1_ ) internal;
function _permit2SwapAndAddLengthOne(SwapAndAddPermit2Data memory params_, address token0_, address token1_) internal;
function _permit2SwapAndAddLengthOneOrTwo(SwapAndAddPermit2Data memory params_, address token0_, address token1_) internal;
function _permit2SwapAndAdd( uint256 permittedLength_, SwapAndAddPermit2Data memory params_, address token0_, address token1_ ) internal;
function _getMintAmounts(address vault_, uint256 maxAmount0_, uint256 maxAmount1_) internal view returns (uint256 shareToMint, uint256 amount0ToDeposit, uint256 amount1ToDeposit);
The text was updated successfully, but these errors were encountered:
No branches or pull requests
ArrakisPrivateVaultRouter
Inherits:
IArrakisPrivateVaultRouter, ReentrancyGuard, Ownable, Pausable
State Variables
nativeToken
permit2
swapper
factory
weth
Functions
onlyPrivateVault
constructor
pause
function used to pause the router.
only callable by owner
unpause
function used to unpause the router.
only callable by owner
AddLiquidityData
addLiquidity
addLiquidity adds liquidity to meta vault of interest (mints L tokens)
Parameters
params_
AddLiquidityData
Returns
amount0
uint256
amount1
uint256
Check
addLiquidityData.amount0
oraddLiquidityData.amount1
should be greater than 0.Effects
token0
andtoken1
from vault.module
of the vault.Interactions
addLiquidityData.amount0
andaddLiquidityData.amount1
tomodule
.ArrakisMetaVaultPrivate.fund
withaddLiquidityData.amount0
andaddLiquidityData.amount1
.Assertions
SwapAndAddData
[Git Source]
struct SwapAndAddData { SwapData swapData; AddLiquidityData addData; }
SwapData
Git Source
swapAndAddLiquidity
swapAndAddLiquidity transfer tokens to and calls RouterSwapExecutor
Parameters
params_
SwapAndAddData
Returns
amount0
uint256
mintAmount
amount1
uint256
mintAmount
amount0Diff
uint256
amount1Diff
uint256
Checks
Effects
Interactions
Assertions
RemoveLiquidityData
addLiquidityPermit2
addLiquidityPermit2 adds liquidity to private vault of interest (mints LP tokens)
Parameters
params_
AddLiquidityPermit2Data
Returns
amount0
uint256
amount1
uint256
swapAndAddLiquidityPermit2
swapAndAddLiquidityPermit2 transfer tokens to and calls RouterSwapExecutor
Parameters
params_
SwapAndAddPermit2Data
Returns
amount0
uint256
amount1
uint256
amount0Diff
uint256
amount1Diff
uint256
removeLiquidityPermit2
removeLiquidityPermit2 removes liquidity from vault and burns LP tokens
Parameters
params_
RemoveLiquidityPermit2Data
Returns
amount0
uint256
burnAmount
amount1
uint256
burnAmount
wrapAndAddLiquidity
wrapAndAddLiquidity wrap eth and adds liquidity to meta vault of iPnterest (mints L tokens)
Parameters
params_
AddLiquidityData
Returns
amount0
uint256
amount1
uint256
wrapAndSwapAndAddLiquidity
wrapAndSwapAndAddLiquidity wrap eth and transfer tokens to and calls RouterSwapExecutor
Parameters
params_
SwapAndAddData
Returns
amount0
uint256
amount1
uint256
amount0Diff
uint256
amount1Diff
uint256
wrapAndAddLiquidityPermit2
wrapAndAddLiquidityPermit2 wrap eth and adds liquidity to private vault of interest (mints LP tokens)
hack to get rid of stack too depth
Parameters
params_
AddLiquidityPermit2Data
Returns
amount0
uint256
amount1
uint256
wrapAndSwapAndAddLiquidityPermit2
wrapAndSwapAndAddLiquidityPermit2 wrap eth and transfer tokens to and calls RouterSwapExecutor
Parameters
params_
SwapAndAddPermit2Data
Returns
amount0
uint256
amount1
uint256
amount0Diff
uint256
amount1Diff
uint256
receive
hack to get rid of stack too depth
getMintAmounts
getMintAmounts used to get the shares we can mint from some max amounts.
Parameters
vault_
address
maxAmount0_
uint256
maxAmount1_
uint256
Returns
shareToMint
uint256
amount0ToDeposit
uint256
amount1ToDeposit
uint256
_addLiquidity
_swapAndAddLiquidity
_swapAndAddLiquiditySendBackLeftOver
_removeLiquidity
_permit2AddLengthOne
_permit2AddLengthOneOrTwo
_permit2Add
_permit2SwapAndAddLengthOne
_permit2SwapAndAddLengthOneOrTwo
_permit2SwapAndAdd
_getMintAmounts
The text was updated successfully, but these errors were encountered: