-
Notifications
You must be signed in to change notification settings - Fork 85
Simplified donation attack prevention #2453
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
Merged
sparrowDom
merged 82 commits into
master
from
sparrowDom/woeth_donation_prevention_simplified
Apr 15, 2025
Merged
Changes from all commits
Commits
Show all changes
82 commits
Select commit
Hold shift + click to select a range
2839dc1
intermittent work committed
sparrowDom 2e6be62
add draft solution for preparing WOETH for the landing markets
sparrowDom 5495d4b
add tests that confirm lending market protection works as exepcted
sparrowDom d0eb16f
add test to protect agains calling initialize twice
sparrowDom fc5d874
add comments
sparrowDom cfec4e5
remove unneeded files
sparrowDom 8405bfc
minor bug fix
sparrowDom e03223c
add fork script tests and fix bug
sparrowDom 319467f
add comments
sparrowDom 1142a74
add another test
sparrowDom f911ba6
divide after multiply
sparrowDom 3dc8523
change credits per token to highres
sparrowDom bad282b
add comment
sparrowDom 07b51cf
comments
sparrowDom c0333fb
lint
sparrowDom 2c965c3
minor changes
sparrowDom df57ef7
Merge remote-tracking branch 'origin/master' into sparrowDom/woeth_ha…
sparrowDom 13fd4da
correct fixture
sparrowDom 7923ddb
make code slighlty better regarding re-entry
sparrowDom c69583f
prettier
sparrowDom 6822937
add explicit visibility
sparrowDom ac855d9
minor test enhancement
sparrowDom 1c9fc64
better function name
sparrowDom 56d0b7d
remove comment
sparrowDom 057469c
simplify
sparrowDom 1a6a16f
simplify code
sparrowDom 2223600
simplify code
sparrowDom b34d811
Merge remote-tracking branch 'origin/master' into sparrowDom/woeth_ha…
sparrowDom 39e8d4b
refactor
sparrowDom 3615ef7
add redeem all test
sparrowDom 466f957
prettier
sparrowDom 52eb244
Add wOETH donation fork tests (#2122)
shahthepro f0580bc
rename deploy script
sparrowDom 0a988d5
add another test and simplify constructor
sparrowDom e2eb8cf
fix: specify override for name and symbol.
clement-ux c6ded55
fix: import IERC20Metadata.
clement-ux be6d473
add gap
sparrowDom c38a3c6
update reference to code
sparrowDom 66269c8
fix compile errors
sparrowDom 5a7192d
move initialize2() into primary initializer
sparrowDom 5ff5c5d
remove virtual where not needed
sparrowDom a05eaa5
Merge remote-tracking branch 'origin/master' into sparrowDom/woeth_ha…
sparrowDom 3ef2219
pick a more appropriate method for fetching highres CPT
sparrowDom 637cd3c
round in the favour of the protocol
sparrowDom 390e4a2
Revert "round in the favour of the protocol"
sparrowDom aad7b57
rounding error fixes
sparrowDom c005824
Option 1 for WOETH rounding error (#2419)
sparrowDom 36c2ce3
prettier
sparrowDom 6791cf1
add require 0 checks
sparrowDom abd7fbe
allow 0 value mints and redeems
sparrowDom 79af39f
Merge remote-tracking branch 'origin/master' into sparrowDom/woeth_ha…
sparrowDom 503d22b
to establish exchange rate for WOETH trust OETH completely
sparrowDom 7d15686
remove unneeded overrides
sparrowDom 11fa68c
add comment and prettier
sparrowDom f7b4953
fix a denomination bug
sparrowDom 1b2a44b
add fork test for the expected rate increase
sparrowDom 8635ee9
add comment
sparrowDom 1297d24
add tests for WOETH upgrade not changing the existing WOETH balances
sparrowDom 418eae5
denominate all rates to 1e27 for better precision
sparrowDom 3cd9322
undo the change
sparrowDom c93e12e
add comment
sparrowDom 80bea89
further simplify the WOETH rate calculation code
sparrowDom 6fc7f8e
add comments
sparrowDom f2b2a59
prettier
sparrowDom 8b237c0
update test to confirm that redemption amounts of WOETH before and af…
sparrowDom ebd7d3e
Fix bug with rounding direction on deposits
DanielVF 0eb41aa
nit: unify comment
sparrowDom 1765e26
sligth code simplification
sparrowDom 14cc62b
fix typo
sparrowDom c97a327
remove unused imports
sparrowDom ca1a998
remove todo
sparrowDom 3c25cee
switch to BUSL
sparrowDom 599c415
improve comment
sparrowDom 2f3f003
no need to call governable anymore
sparrowDom 65f8eb0
fix comment
sparrowDom 191f522
make WOSonic extend WOETH. Add deploy file and basic fork test
sparrowDom a2a69c9
use the more appropriate natspec compliant inheritdoc
sparrowDom 3d2d0fd
more appropriate naming
sparrowDom bdc0209
add aditiona test
sparrowDom 19854fa
Merge remote-tracking branch 'origin/master' into sparrowDom/woeth_do…
sparrowDom 6504385
make WOUSD inherit from WOETH
sparrowDom 87f0828
add deploy and fork test file for WOUSD
sparrowDom File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
from world import * | ||
|
||
def expect_approximate(woeth_holder, expected_balance): | ||
balance = woeth.balanceOf(woeth_holder) | ||
diff = abs(expected_balance - balance) | ||
if (diff != 0): | ||
raise Exception("Unexpected balance for account: %s".format(woeth_holder)) | ||
|
||
def confirm_balances_after_upgrade(): | ||
expect_approximate("0xBBBBBbbBBb9cC5e90e3b3Af64bdAF62C37EEFFCb", 1013453939109688661944) | ||
expect_approximate("0xC460B0b6c9b578A4Cb93F99A691e16dB96Ee5833", 575896531839923556165) | ||
expect_approximate("0xdca0a2341ed5438e06b9982243808a76b9add6d0", 319671606657733042618) | ||
expect_approximate("0x8a9d46d28003673cd4fe7a56ecfcfa2be6372e64", 182355401624955452064) | ||
expect_approximate("0xf65ecb5610000100befba41b9f9cf5ca32838078", 97352556026536192865) | ||
expect_approximate("0x0a26e7ab5c554232314a8d459eff0ede72333f08", 91628532171545105831) | ||
|
||
|
||
def manipulate_price(): | ||
OETH_WHALE="0xa4C637e0F704745D182e4D38cAb7E7485321d059" | ||
whl = {'from': OETH_WHALE } | ||
|
||
woeth.convertToAssets(1e18) / 1e18 | ||
oeth.transfer(woeth.address, 10_000 * 1e18, whl) | ||
woeth.convertToAssets(1e18) / 1e18 | ||
|
||
oeth.approve(woeth.address, 1e50, whl) | ||
woeth.deposit(5_000 * 1e18, OETH_WHALE, whl) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.