-
Notifications
You must be signed in to change notification settings - Fork 8
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
[PDE-251] [Fix] ottersec advisory check issues #128
Conversation
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 file severely out of date?
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.
Discussed offline - better to make the smart contract smaller and rely on offchain event indexing. |
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.
LGTM
What's new in this PR?
accrueYield
iterates through potentially all ofYieldDistributionTokenStorage::deposits
to calculate the amount of yield auser
is owed. there’s a hackygasleft
to break out of the loop, but it seems unstable and creates a dependency on gas costs. importantly, it also means that the yield might not be fully up to date afteraccrueYield
, creating a strange edgecase. can you use a more traditional yield per token model to calculate the amount of yield owed?Using yield per token model now.
do you expect
AssetTokenStorage::{whitelist, holders}
to ever contain a non-trivial amount of addresses?removed arrays and loops, added events so they can be indexed
some other general questions:
what’s the intention of using the
from.call(abi.encodeWithSelector(…))
pattern? why not just castfrom
toISmartWallet
and do the function call directly?The Solidity compiler adds a check that the target address has extcodesize > 0 and otherwise reverts for high-level calls, so we have to use a low-level call here
is there sample code using
_notifyRedeem
and_notifyDeposit
? the exampleUSDT.sol
doesn’t use these functions, and they seem unused throughout the rest of the codebaseit seems like
whitelist
isn’t used anywhere in the code. would it make sense to use.removed whitelist array