mirror of
https://github.com/Instadapp/dsa-connectors.git
synced 2024-07-29 22:37:00 +00:00
setUint removed
This commit is contained in:
parent
ad3bd0ad9a
commit
e5c318d4e2
|
@ -16,7 +16,7 @@ contract Helpers is Basic {
|
|||
int24 tickLower;
|
||||
int24 tickUpper;
|
||||
uint256 amount;
|
||||
bool token0to1;
|
||||
bool tokenDirectn;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -37,7 +37,7 @@ contract Helpers is Basic {
|
|||
params_.token1
|
||||
);
|
||||
|
||||
if(params_.token0to1){
|
||||
if(params_.tokenDirectn){
|
||||
amountSend_ = params_.amount == type(uint128).max ? getTokenBal(TokenInterface(params_.token0)) : params_.amount;
|
||||
convertMaticToWmatic(params_.token0 == maticAddr, token0_, amountSend_);
|
||||
approve(token0_, address(limitCon_), amountSend_);
|
||||
|
@ -55,10 +55,10 @@ contract Helpers is Basic {
|
|||
params_.tickLower,
|
||||
params_.tickUpper,
|
||||
amountSend_,
|
||||
params_.token0to1
|
||||
params_.tokenDirectn
|
||||
);
|
||||
|
||||
(tokenId_, liquidity_, mintAmount_) = limitCon_.createPosition(parameter);
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -4,8 +4,6 @@ pragma experimental ABIEncoderV2;
|
|||
|
||||
interface IUniLimitOrder {
|
||||
|
||||
function token0to1(uint256) external view returns (bool);
|
||||
|
||||
struct MintParams {
|
||||
address token0;
|
||||
address token1;
|
||||
|
@ -13,7 +11,7 @@ interface IUniLimitOrder {
|
|||
int24 tickLower;
|
||||
int24 tickUpper;
|
||||
uint256 amount;
|
||||
bool token0To1;
|
||||
bool tokenDirectn;
|
||||
}
|
||||
|
||||
function createPosition(
|
||||
|
@ -40,4 +38,4 @@ interface IUniLimitOrder {
|
|||
external
|
||||
returns (uint128 liquidity_);
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
@ -19,8 +19,7 @@ contract LimitOrderConnector is Helpers {
|
|||
int24 tickLower_,
|
||||
int24 tickUpper_,
|
||||
uint256 amount_,
|
||||
bool token0to1_,
|
||||
uint256 setId_
|
||||
bool tokenDirectn_
|
||||
)
|
||||
external
|
||||
payable
|
||||
|
@ -34,7 +33,7 @@ contract LimitOrderConnector is Helpers {
|
|||
tickLower_,
|
||||
tickUpper_,
|
||||
amount_,
|
||||
token0to1_
|
||||
tokenDirectn_
|
||||
);
|
||||
|
||||
(
|
||||
|
@ -43,8 +42,6 @@ contract LimitOrderConnector is Helpers {
|
|||
uint256 minAmount_
|
||||
) = _createPosition(params_);
|
||||
|
||||
setUint(setId_, liquidity_);
|
||||
|
||||
eventName_ = "LogCreate(uint256,uint256,uint256,int24,int24)";
|
||||
eventParam_ = abi.encode(
|
||||
tokenId_,
|
||||
|
@ -59,8 +56,7 @@ contract LimitOrderConnector is Helpers {
|
|||
function closeMid(
|
||||
uint256 tokenId_,
|
||||
uint256 amountAMin_,
|
||||
uint256 amountBMin_,
|
||||
uint256[] calldata setIds_
|
||||
uint256 amountBMin_
|
||||
)
|
||||
external
|
||||
payable
|
||||
|
@ -69,17 +65,13 @@ contract LimitOrderConnector is Helpers {
|
|||
|
||||
(uint128 liquidity_, uint256 amount0, uint256 amount1) = limitCon_.closeMidPosition(tokenId_, amountAMin_, amountBMin_);
|
||||
|
||||
setUint(setIds_[0], amount0);
|
||||
setUint(setIds_[1], amount1);
|
||||
|
||||
eventName_ = "LogWithdrawMid(uint256,uint256,uint256,uint256)";
|
||||
eventParam_ = abi.encode(tokenId_, liquidity_, amount0, amount1);
|
||||
}
|
||||
|
||||
|
||||
function closeFull(
|
||||
uint256 tokenId_,
|
||||
uint256 setId_
|
||||
uint256 tokenId_
|
||||
)
|
||||
external
|
||||
payable
|
||||
|
@ -88,8 +80,6 @@ contract LimitOrderConnector is Helpers {
|
|||
|
||||
(uint256 closeAmount_) = limitCon_.closeFullPosition(tokenId_);
|
||||
|
||||
setUint(setId_, closeAmount_);
|
||||
|
||||
eventName_ = "LogWithdrawFull(uint256,uint256)";
|
||||
eventParam_ = abi.encode(tokenId_, closeAmount_);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user