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

TOB-AJNA-2: global scalar (at index 8192) is never updated #753

Merged
merged 5 commits into from
Apr 20, 2023
Merged
Changes from 1 commit
Commits
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
6 changes: 2 additions & 4 deletions src/libraries/internal/Deposits.sol
Original file line number Diff line number Diff line change
Expand Up @@ -321,10 +321,8 @@ library Deposits {
function treeSum(
DepositsState storage deposits_
) internal view returns (uint256) {
// In a scaled Fenwick tree, sum is at the root node, but needs to be scaled
uint256 scaling = deposits_.scaling[SIZE];
// scaling == 0 means scale factor is actually 1
return (scaling != 0) ? Maths.wmul(scaling, deposits_.values[SIZE]) : deposits_.values[SIZE];
// In a scaled Fenwick tree, sum is at the root node and never scaled
return deposits_.values[SIZE];
}

/**
Expand Down