implement burn function

This commit is contained in:
cryptoDev222 2021-08-10 10:18:33 -05:00
parent c7f446bc54
commit 3fb91b6136
3 changed files with 25 additions and 0 deletions

View File

@ -28,4 +28,6 @@ contract Events {
uint256 amtIn,
uint256 amtOut
);
event burn(uint256 tokenId);
}

View File

@ -127,6 +127,9 @@ abstract contract Helpers is DSMath, Basic {
(tokenId, liquidity, amount0, amount1) = nftManager.mint(params);
}
/**
* @dev Check if token address is etherAddr and convert it to weth
*/
function _checkETH(
uint256 _tokenId,
uint256 _amount0,
@ -233,4 +236,11 @@ abstract contract Helpers is DSMath, Basic {
);
amountOut = swapRouter.exactInputSingle(params);
}
/**
* @dev Burn Function
*/
function _burn(uint256 _tokenId) internal {
nftManager.burn(_tokenId);
}
}

View File

@ -183,6 +183,19 @@ abstract contract UniswapResolver is Helpers, Events {
_eventName = "collect(uint256,uint256,uint256)";
_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 {