add cp event && smartroute helper fix

This commit is contained in:
owen05
2021-01-18 22:32:12 +08:00
parent 211b5e0172
commit 059778b27b
13 changed files with 201 additions and 88 deletions

View File

@@ -27,6 +27,12 @@ contract CPVesting is CPFunding {
using SafeMath for uint256;
using SafeERC20 for IERC20;
// ============ Events ============
event Claim(address user, uint256 baseAmount, uint256 quoteAmount);
event ClaimLP(uint256 amount);
// ================ Modifiers ================
modifier afterSettlement() {
@@ -55,12 +61,15 @@ contract CPVesting is CPFunding {
IDODOCallee(to).CPClaimBidCall(msg.sender,baseAmount,quoteAmount,data);
}
emit Claim(msg.sender, baseAmount, quoteAmount);
}
// ============ Owner Functions ============
function claimLPToken() external onlyOwner afterFreeze {
IERC20(_POOL_).safeTransfer(_OWNER_, getClaimableLPToken());
uint256 lpAmount = getClaimableLPToken();
IERC20(_POOL_).safeTransfer(_OWNER_, lpAmount);
emit ClaimLP(lpAmount);
}
function getClaimableLPToken() public view afterFreeze returns (uint256) {