Skip to content
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

Fuse fixed accounting #10

Open
wants to merge 30 commits into
base: fuse-reactive-audit
Choose a base branch
from
Open
Changes from 1 commit
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
78c15b2
reentrancy fix
sriyantra Apr 30, 2022
a35a047
Fix Etherscan warning from checkpointInterest
davidlucid Apr 30, 2022
d524f98
Code comments
davidlucid Apr 30, 2022
8c79124
Revert "Fix Etherscan warning from checkpointInterest"
davidlucid Apr 30, 2022
e84e42e
Create CEtherDelegateTempExploitAccounting.sol
davidlucid Apr 30, 2022
1194e20
Update CEtherDelegateTempExploitAccounting.sol
davidlucid Apr 30, 2022
5428a94
CEtherDelegateTempExploitAccounting: support multiple secondary accounts
davidlucid Apr 30, 2022
bdaee36
Hardhat tests
davidlucid Apr 30, 2022
79ca176
Fix quantities in tests to consider min borrow
davidlucid Apr 30, 2022
e5c2c23
Test with real-life exploit code
davidlucid May 1, 2022
79f93e7
Add fix script for testing
davidlucid May 1, 2022
b8b3187
Update hardhat.config.js
davidlucid May 1, 2022
da2497a
Update CEtherDelegateTempExploitAccounting.sol
davidlucid May 1, 2022
dc52214
Create hardhat/test/fix-accounting.js
davidlucid May 1, 2022
7aa950a
More assertions!
davidlucid May 1, 2022
36b83a2
add accrueInterest()
sriyantra May 4, 2022
4567caf
Revert "add accrueInterest()"
sriyantra May 4, 2022
1878d56
add accrueInterest()
sriyantra May 4, 2022
a3c0d58
inherit CEther
sriyantra May 4, 2022
21e9d21
doTransferIn() CEI
sriyantra May 4, 2022
91386dc
Revert "doTransferIn() CEI"
sriyantra May 4, 2022
e5c344b
remove unused
sriyantra May 5, 2022
34c4dd3
Merge branch 'fuse-fixed-accounting' of https://github.com/Rari-Capit…
sriyantra May 5, 2022
db1a653
format
sriyantra May 5, 2022
f39cfad
Update CEtherDelegateTempExploitAccounting.sol
sriyantra May 5, 2022
be592b8
fix comment
sriyantra May 5, 2022
cc29449
add borrowIndex update
sriyantra May 5, 2022
02dbeef
simplify statement
sriyantra May 5, 2022
852dd96
Remove unnecessary code
davidlucid May 7, 2022
5fea929
Simplify CEtherDelegateTempExploitAccounting
davidlucid May 7, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions contracts/CEtherDelegateTempExploitAccounting.sol
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,8 @@ contract CEtherDelegateTempExploitAccounting is CDelegateInterface, CEther {
accountTokens[0x32075bAd9050d4767018084F0Cb87b3182D36C45] = 0;
sriyantra marked this conversation as resolved.
Show resolved Hide resolved

// Set account #1 borrow balance = secondary accounts' borrow balance - account #1 supply balance
require(secondaryAccountsBorrowBalance >= account1SupplyBalance, "Expected secondary accounts' combined borrow balance to be greater than or equal to account #1 supply balance.");
require(accountBorrows[0x32075bAd9050d4767018084F0Cb87b3182D36C45].principal == 0, "Expected account #1 borrow balance to start at 0.");
require(secondaryAccountsBorrowBalance >= account1SupplyBalance, "Expect secondary accounts' combined borrow balance >= account #1 supply balance.");
require(accountBorrows[0x32075bAd9050d4767018084F0Cb87b3182D36C45].principal == 0, "Expect account #1 borrow balance to start at 0.");
sriyantra marked this conversation as resolved.
Show resolved Hide resolved
accountBorrows[0x32075bAd9050d4767018084F0Cb87b3182D36C45].principal = sub_(secondaryAccountsBorrowBalance, account1SupplyBalance);
sriyantra marked this conversation as resolved.
Show resolved Hide resolved
accountBorrows[0x32075bAd9050d4767018084F0Cb87b3182D36C45].interestIndex = borrowIndex;
sriyantra marked this conversation as resolved.
Show resolved Hide resolved

Expand Down