-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
chore: migrate deposits into sd59x60 #9
Conversation
feesDenominatedInPoolTokens[0] += restFee;//we give rest of the fee (if any) to the first recipient | ||
} | ||
|
||
function calculateRedemptionFee(address tco2, address pool, uint256 depositAmount) external override returns (address[] memory recipients, uint256[] memory feesDenominatedInPoolTokens) { | ||
require(depositAmount > 0, "depositAmount must be > 0"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Redemption amount must be > 0
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yea, but our interface has the param "depositAmount" so intentionally keep it like this
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yea, but our interface has the param "depositAmount" so intentionally keep it like this
should it though? maybe the interface should be changed then as well
feesDenominatedInPoolTokens[i] = (totalFee * _shares[i]) / 100; | ||
restFee -= feesDenominatedInPoolTokens[i]; | ||
} | ||
|
||
require(restFee >=0); | ||
require(restFee >= 0); | ||
recipients = _recipients; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is this ok that we assign a reference here to our field and expose it outside? or is it still copied over?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's copied but not via the manually copying each item, should be more efficient
@@ -44,27 +34,30 @@ contract FeeCalculator is IDepositFeeCalculator, IRedemptionFeeCalculator { | |||
} | |||
|
|||
function calculateDepositFees(address tco2, address pool, uint256 depositAmount) external override returns (address[] memory recipients, uint256[] memory feesDenominatedInPoolTokens) { | |||
require(depositAmount > 0, "depositAmount must be > 0"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Deposit amount must be greater than 0
could be a better phrasing?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
depositAmount refers to param name
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks good, just some comments to consider
This simplifies the code by using sd59x60 for deposits.