Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
WOETH: Donation attack prevention #2106
base: master
Are you sure you want to change the base?
WOETH: Donation attack prevention #2106
Changes from 20 commits
2839dc1
2e6be62
5495d4b
d0eb16f
fc5d874
cfec4e5
8405bfc
e03223c
319467f
1142a74
f911ba6
3dc8523
bad282b
07b51cf
c0333fb
2c965c3
df57ef7
13fd4da
7923ddb
c69583f
6822937
ac855d9
1c9fc64
56d0b7d
057469c
1a6a16f
2223600
b34d811
39e8d4b
3615ef7
466f957
52eb244
f0580bc
0a988d5
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
Large diffs are not rendered by default.
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.
Missing an explicit visibility.
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.
thanks nice catch, corrected
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.
nit: perhaps we could just treat any donation as "yield"?
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.
nit: Points to older code (pre-yield-delegation). Would be nice to update it to point to latest commit hash on master
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.
If we used in
credits
here as well from the call fromcreditsBalanceOfHighres
, we would have ever piece of data already loaded inside this function to check that our actual assets was equal or greater than our expected assets.May or may not be such a great idea though to revert in a view function.
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.
Hmm, that would be a good check that would detect possible mathematical irregularities (perhaps due to rounding). Though as you point out it would be weird to revert in a view function.
Monitoring sounds like a good place for it though. Have Grafana regularly query both credits values and check that the ones in OETH.sol are greater or equal to the ones in WOETH.sol.
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.
Notion task added here: https://www.notion.so/originprotocol/WOETH-monitoring-sanity-check-695c73c0d0d04ef999a5242407d8a212
Check warning on line 200 in contracts/contracts/token/WOETH.sol
Codecov / codecov/patch
contracts/contracts/token/WOETH.sol#L200
Check warning on line 227 in contracts/contracts/token/WOETH.sol
Codecov / codecov/patch
contracts/contracts/token/WOETH.sol#L227