-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Write a flex voting Atoken using scaled balance caching (#21)
* Copy ATokenNaive into ATokenReserveCache * Write an initial test for checkpointing rebased balances * Write some failing tests * Make stored balance checkpointing test pass * Handle raw balance checkpointing during withdrawals * Compute vote weights based on scaled balances Why this works: #8 (comment) * Test that voting weight transfers * Checkpoint on transfer * Test that votes can be cast by recipients of aToken transfers * Rename ATokenReserveCache --> ATokenCheckpointed * Test getPastTotalDepsits * Add another getPastTotalDeposits test * Add more getPastTotalDeposits tests * scopelint fmt * Appease scopelint * Apply suggestions from code review Co-authored-by: Ed Mazurek <[email protected]> Co-authored-by: Matt Solomon <[email protected]> * Update based on PR review * Update based on PR review * Update based on PR review * Test that trasferFrom transfers voting weight * Remove unnecessary vm.roll in tests * Add more missing natspec * Override aToken._transfer not aToken.transfer * Clean up compiler warnings * Remove one more unnecessary vm.roll * Override MintableIncentivizedERC20._burn not AToken.burn * Delegate during initialization * Replace calls to super with explicit contracts * Override _mint not mint + mintToTreasury This is so much simpler/cleaner * Update self-delegation comment now that `initialize` has been overridden * Appease scopelint * Bump aave v3 to make AToken functions overrideable * Remove unnecessary return values from _checkpointRawBalanceOf * Add handleRepayment/2 to AToken mock for fork test compatibility * Remove naive implementation * Rename ATokenCheckpointed --> ATokenFlexVoting * Test checkpointing on mintToTreasury * Make tweaks for PR review * Remove unnecessary approximate assertions Co-authored-by: Ed Mazurek <[email protected]> Co-authored-by: Matt Solomon <[email protected]>
- Loading branch information
1 parent
1cd6967
commit 2965748
Showing
7 changed files
with
936 additions
and
324 deletions.
There are no files selected for viewing
Submodule aave-v3-core
updated
128 files
This file contains 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.