NonfungiblePositionManager
해당 컨트랙트는 ERC721 대체 불가능한 토큰 인터페이스의 KLAYswap V3 포지션을 wrapping합니다.
Code
Github Link: (Will be updated after official launch)
Address
Events, Read-Only Functions, and State-Changing Functions
Events
IncreaseLiquidity
event IncreaseLiquidity(
uint256 indexed tokenId,
uint128 liquidity,
uint256 amount0,
uint256 amount1
);포지션 NFT에 대한 유동성 증가 시 발생 또한 토큰이 발행될 때 방출됩니다.
Parameters:
tokenId
uint256
The ID of the token for which liquidity was increased
liquidity
uint128
The amount by which liquidity for the NFT position was increased
amount0
uint256
The amount of token0 that was paid for the increase in liquidity
amount1
uint256
The amount of token1 that was paid for the increase in liquidity
DecreaseLiquidity
event DecreaseLiquidity(
uint256 indexed tokenId,
uint128 liquidity,
uint256 amount0,
uint256 amount1
);포지션 NFT에 대한 유동성 감소 시 발생
Parameters:
tokenId
uint256
The ID of the token for which liquidity was decreased
liquidity
uint128
The amount by which liquidity for the NFT position was decreased
amount0
uint256
The amount of token0 that was accounted for the decrease in liquidity
amount1
uint256
The amount of token1 that was accounted for the decrease in liquidity
Collect
event Collect(
uint256 indexed tokenId,
address recipient,
uint256 amount0,
uint256 amount1,
uint256 reward
);포지션 NFT에 대한 토큰이 수집될 때 발생합니다. 보고된 금액은 반올림 동작으로 인해 이체된 금액과 정확히 일치하지 않을 수 있습니다.
Parameters:
tokenId
uint256
포지션 NFT ID
recipient
address
수집된 토큰을 받은 계정의 주소
amount0
uint256
수집된 포지션에 빚진 token0의 양
amount1
uint256
수집된 포지션에 빚진 token1의 양
Parameter Structs
MintParams
struct MintParams {
address token0;
address token1;
uint24 fee;
int24 tickLower;
int24 tickUpper;
uint256 amount0Desired;
uint256 amount1Desired;
uint256 amount0Min;
uint256 amount1Min;
address recipient;
uint256 deadline;
}IncreaseLiquidityParams
struct IncreaseLiquidityParams {
uint256 tokenId;
uint256 amount0Desired;
uint256 amount1Desired;
uint256 amount0Min;
uint256 amount1Min;
uint256 deadline;
}DecreaseLiquidityParams
struct DecreaseLiquidityParams {
uint256 tokenId;
uint128 liquidity;
uint256 amount0Min;
uint256 amount1Min;
uint256 deadline;
}CollectParams
struct CollectParams {
uint256 tokenId;
address recipient;
uint128 amount0Max;
uint128 amount1Max;
}Read-Only Functions
positions
function positions(
uint256 tokenId
) external view returns (
uint96 nonce,
address operator,
address token0,
address token1,
uint24 fee,
int24 tickLower,
int24 tickUpper,
uint128 liquidity,
uint256 feeGrowthInside0LastX128,
uint256 feeGrowthInside1LastX128,
uint128 tokensOwed0,
uint128 tokensOwed1
)주어진 토큰 ID와 관련된 위치 정보를 반환합니다.
토큰 ID가 유효하지 않은 경우 throw.
Parameters:
tokenId
uint256
포지션을 나타내는 토큰의 ID
Return Values:
nonce
uint96
permit에 대한 nonce 값
operator
address
지출이 승인된 주소
token0
address
특정 풀에 대한 token0의 주소
token1
address
특정 풀에 대한 token1의 주소
fee
uint24
풀과 관련된 수수료
tickLower
int24
위치에 대한 틱 범위의 하단
tickUpper
int24
위치에 대한 틱 범위의 상단
liquidity
uint128
포지션의 유동성
feeGrowthInside0LastX128
uint256
개별 포지션에 대한 마지막 조치를 기준으로 token0의 수수료 증가
feeGrowthInside1LastX128
uint256
개별 포지션에 대한 마지막 조치를 기준으로 token1의 수수료 증가
tokensOwed0
uint128
마지막 계산 시점의 위치에 대한 미수금된 token0의 양
tokensOwed1
uint128
마지막 계산 시점의 위치에 대한 미수금된 token1의 양
positionRewards
function positionRewards(uint256 tokenId)
external
view
returns (
uint256 rewardGrowthInsideLastX128,
uint128 reward,
uint128 fee0Sum,
uint128 fee1Sum,
uint128 rewardSum
);Parameters:
tokenId
uint256
포지션을 나타내는 토큰의 ID
Return Values:
rewardGrowthInsideLastX128
uint256
개별 포지션에 대한 마지막 행동에 따른 보상 증가
reward
uint128
미수령 보상 금액
fee0Sum
uint128
token0의 누적 수수료
fee1Sum
uint128
token1의 누적 수수료
rewardSum
uint128
적립된 리워드 금액
getApproved
function getApproved() public view returns (address)tokenId 토큰에 대해 승인된 계정을 반환합니다.
요구 사항: 토큰 ID가 있어야 합니다.
tokenURI
function tokenURI(uint256 tokenId) public view returns (string)특정 토큰 ID를 설명하는 URI를 반환합니다.
Parameters:
tokenId
uint256
발행된 포지션을 나타내는 토큰의 ID
Return Values:
URI 데이터가 포함된 base64 문자열입니다.
baseURI
function baseURI() public returns (string)State-Changing Functions
mint
function mint(
struct INonfungiblePositionManager.MintParams params
) external returns (
uint256 tokenId,
uint128 liquidity,
uint256 amount0,
uint256 amount1
)NFT로 래핑된 새 포지션을 생성합니다.
풀이 존재하고 초기화될 때 이것을 호출하십시오. 풀이 생성되었지만 초기화되지 않은 경우 메서드가 존재하지 않습니다. 즉, 풀이 초기화된 것으로 간주됩니다.
Parameters:
params
struct INonfungiblePositionManager.MintParams
calldata에서 MintParams로 인코딩된 위치를 생성하는 데 필요한 매개변수
Return Values:
tokenId
uint256
발행된 포지션을 나타내는 토큰의 ID
liquidity
uint128
이 포지션의 유동성 양
amount0
uint256
token0의 수량
amount1
uint256
token1의 수량
increaseLiquidity
function increaseLiquidity(
struct INonfungiblePositionManager.IncreaseLiquidityParams params
) external returns (
uint128 liquidity,
uint256 amount0,
uint256 amount1
)msg.sender가 지불한 토큰으로 포지션의 유동성을 높입니다.
Parameters:
params
struct INonfungiblePositionManager.IncreaseLiquidityParams
calldata에서 IncreaseLiquidityParams로 인코딩된 포지션의 유동성을 증가시키는 데 필요한 매개변수
Return Values:
liquidity
uint128
증가에 따른 새로운 유동성 양
amount0
uint256
유동성을 달성하기 위한 token0의 양
amount1
uint256
유동성을 달성하기 위한 token1의 양
decreaseLiquidity
function decreaseLiquidity(
struct INonfungiblePositionManager.DecreaseLiquidityParams params
) external returns (uint256 amount0, uint256 amount1)포지션의 유동성을 줄여 포지션에 반영
Parameters:
params
struct INonfungiblePositionManager.DecreaseLiquidityParams
calldata에서 IncreaseLiquidityParams로 인코딩된 포지션의 유동성을 줄이는 데 필요한 매개변수
Return Values:
amount0
uint256
포지션의 빚진 토큰에 해당하는 token0의 양
amount1
uint256
포지션의 빚진 토큰에 해당하는 token1의 양
collect
function collect(
struct INonfungiblePositionManager.CollectParams params
) external returns (uint256 amount0, uint256 amount1)수령인에게 지불해야 하는 최대 금액의 수수료를 징수합니다.
Parameters:
params
struct INonfungiblePositionManager.CollectParams
calldata에서 CollectParams로 인코딩된 수집에 필요한 매개변수
Return Values:
amount0
uint256
token0에서 징수된 수수료 금액
amount1
uint256
token1에서 징수된 수수료 금액
burn
function burn(uint256 tokenId) externalNFT 계약에서 토큰 ID를 삭제하는 토큰 ID를 소각합니다. 토큰은 유동성이 0이어야 하며 모든 토큰이 먼저 수집되어야 합니다.
Parameters:
tokenId
uint256
소각되는 토큰의 ID
Last updated