mirror of
https://github.com/Instadapp/dsa-connectors.git
synced 2024-07-29 22:37:00 +00:00
implement burn function
This commit is contained in:
parent
c7f446bc54
commit
3fb91b6136
|
@ -28,4 +28,6 @@ contract Events {
|
||||||
uint256 amtIn,
|
uint256 amtIn,
|
||||||
uint256 amtOut
|
uint256 amtOut
|
||||||
);
|
);
|
||||||
|
|
||||||
|
event burn(uint256 tokenId);
|
||||||
}
|
}
|
||||||
|
|
|
@ -127,6 +127,9 @@ abstract contract Helpers is DSMath, Basic {
|
||||||
(tokenId, liquidity, amount0, amount1) = nftManager.mint(params);
|
(tokenId, liquidity, amount0, amount1) = nftManager.mint(params);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @dev Check if token address is etherAddr and convert it to weth
|
||||||
|
*/
|
||||||
function _checkETH(
|
function _checkETH(
|
||||||
uint256 _tokenId,
|
uint256 _tokenId,
|
||||||
uint256 _amount0,
|
uint256 _amount0,
|
||||||
|
@ -233,4 +236,11 @@ abstract contract Helpers is DSMath, Basic {
|
||||||
);
|
);
|
||||||
amountOut = swapRouter.exactInputSingle(params);
|
amountOut = swapRouter.exactInputSingle(params);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @dev Burn Function
|
||||||
|
*/
|
||||||
|
function _burn(uint256 _tokenId) internal {
|
||||||
|
nftManager.burn(_tokenId);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -183,6 +183,19 @@ abstract contract UniswapResolver is Helpers, Events {
|
||||||
_eventName = "collect(uint256,uint256,uint256)";
|
_eventName = "collect(uint256,uint256,uint256)";
|
||||||
_eventParam = abi.encode(tokenId, amount0, amount1);
|
_eventParam = abi.encode(tokenId, amount0, amount1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @dev Burn Function
|
||||||
|
*/
|
||||||
|
function burnNFT(uint256 tokenId)
|
||||||
|
external
|
||||||
|
payable
|
||||||
|
returns (string memory _eventName, bytes memory _eventParam)
|
||||||
|
{
|
||||||
|
_burn(tokenId);
|
||||||
|
_eventName = "burnPosition(uint256)";
|
||||||
|
_eventParam = abi.encode(tokenId);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
contract ConnectV2UniswapV3 is UniswapResolver {
|
contract ConnectV2UniswapV3 is UniswapResolver {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user