Feat/instant exit#9
Conversation
| /// @notice Transfers not claimed tokens to the sender. | ||
| /// @dev When contract doesn't have funds during exercise, this function allows to claim the tokens once contract is funded | ||
| /// @param to Destination address for token transfer | ||
| function claim(address to) external whenNotPaused { |
There was a problem hiding this comment.
eidolon is having second thoughts about claim system
There was a problem hiding this comment.
but keep this modifier here and on exercise
| _configSwapProps(_swapProps); | ||
| } | ||
|
|
||
| function configSwapProps(SwapProps memory _swapProps) external virtual; |
| _configSwapProps(_swapProps); | ||
| } | ||
|
|
||
| function configSwapProps(SwapProps memory _swapProps) external virtual; |
There was a problem hiding this comment.
leave a comment here that says i needs to be permissioned in implementation
| UniV3 | ||
| } | ||
|
|
||
| struct SwapProps { |
| _setInstantExitFee(_instantExitFee); | ||
| } | ||
|
|
||
| function _setInstantExitFee(uint256 _instantExitFee) internal { |
There was a problem hiding this comment.
probably is fine to have the limit be 100%, but might be good to ponder on for a little bit to b sure
| feeAmount = 0; | ||
| // transfer payment tokens from user to the set receivers | ||
| distributeFees(paymentToken.balanceOf(address(this)), paymentToken); | ||
| if (paymentToken.balanceOf(feeRecipients[0]) == 0 || paymentToken.balanceOf(feeRecipients[1]) == 0) { |
There was a problem hiding this comment.
maybe only check the amount we receive from the swap (return or balance check on this contract itself)
|
|
||
| paymentAmount = amount.mulWadUp(price); | ||
| if (paymentAmount > _params.maxPaymentAmount) revert Exercise__SlippageTooHigh(); | ||
| emit Exercised(from, recipient, underlyingAmount, paymentAmount); |
There was a problem hiding this comment.
this is prob fine but it would be nice to know what kind of exercise zap or redeem this was in the event. however... its not worth doing anything about...
enum exerciseType maybe
| { | ||
| if (block.timestamp > params.deadline) revert Exercise__PastDeadline(); | ||
| // apply multiplier to price | ||
| paymentAmount = _getPaymentAmount(amount); |
| return _getPaymentAmount(amount); | ||
| } | ||
|
|
||
| function _getPaymentAmount(uint256 amount) private view returns (uint256 paymentAmount) { |
There was a problem hiding this comment.
think about if internal or not once more (namespace vs possibility of wanting to call this function in child)
Zapping feature, swap module, commonized tests (UTs and ITs on mode), new velo interface