Actions Library 是一个支持 Uniswap v4 周边合约操作的智能合约代码库,定义了流动性管理、交换、捐赠、结算以及包装操作等多种功能,允许用户进行代币的增加、减少、铸造、销毁和交易等操作。
Actions Library 定义了 Uniswap v4 periphery 合约支持的所有操作。
// pool actions
// liquidity actions
uint256 internal constant INCREASE_LIQUIDITY = 0x00; // 增加流动性
uint256 internal constant DECREASE_LIQUIDITY = 0x01; // 减少流动性
uint256 internal constant MINT_POSITION = 0x02; // 铸造头寸
uint256 internal constant BURN_POSITION = 0x03; // 销毁头寸
uint256 internal constant INCREASE_LIQUIDITY_FROM_DELTAS = 0x04; // 根据余额增加流动性
uint256 internal constant MINT_POSITION_FROM_DELTAS = 0x05; // 根据余额铸造头寸
// swapping
uint256 internal constant SWAP_EXACT_IN_SINGLE = 0x06; // 精确输入代币数量,计算输出代币数量,完成单跳交易
uint256 internal constant SWAP_EXACT_IN = 0x07; // 精确输入代币数量,根据交易路径,计算输出代币数量,完成多跳交易
uint256 internal constant SWAP_EXACT_OUT_SINGLE = 0x08; // 精确输出代币数量,计算输入代币数量,完成单跳交易
uint256 internal constant SWAP_EXACT_OUT = 0x09; // 精确输出代币数量,根据交易路径,计算输入代币数量,完成多跳交易
// donate
// note this is not supported in the position manager or router
uint256 internal constant DONATE = 0x0a; // 捐赠代币
// closing deltas on the pool manager
// settling
uint256 internal constant SETTLE = 0x0b; // 结算单个代币欠款
uint256 internal constant SETTLE_ALL = 0x0c; // 结算单个代币的全部欠款
uint256 internal constant SETTLE_PAIR = 0x0d; // 结算交易对代币欠款
// taking
uint256 internal constant TAKE = 0x0e; // 提取单个代币余额
uint256 internal constant TAKE_ALL = 0x0f; // 提取单个代币的全部余额
uint256 internal constant TAKE_PORTION = 0x10; // 按比例提取单个代币余额
uint256 internal constant TAKE_PAIR = 0x11; // 提取交易对代币余额
uint256 internal constant CLOSE_CURRENCY = 0x12; // 结算或提取单个代币
uint256 internal constant CLEAR_OR_TAKE = 0x13; // 放弃或提取单个代币
uint256 internal constant SWEEP = 0x14; // 转出代币
uint256 internal constant WRAP = 0x15; // 包装 ETH
uint256 internal constant UNWRAP = 0x16; // 解包 WETH
// minting/burning 6909s to close deltas
// note this is not supported in the position manager or router
uint256 internal constant MINT_6909 = 0x17; // 铸造 ERC6909
uint256 internal constant BURN_6909 = 0x18; // 销毁 ERC6909
流动性相关操作:
交换相关操作:
捐赠操作:
结算操作:
包装操作:
铸造/销毁 ERC6909 token 操作:
- 原文链接: github.com/adshao/public...
- 登链社区 AI 助手,为大家转译优秀英文文章,如有翻译不通的地方,还请包涵~
如果觉得我的文章对您有用,请随意打赏。你的支持将鼓励我继续创作!