This repository was archived by the owner on Dec 10, 2025. It is now read-only.
updated aaveTokenV2 with transfer cost reduction#4
Open
dhadrien wants to merge 27 commits into
Open
Conversation
5ce91df to
2c5b35d
Compare
2c5b35d to
21d5532
Compare
388be9e to
9e7b33e
Compare
9e7b33e to
9392f15
Compare
Author
|
| expect(await aaveInstance.isSnapshotted(users[2].address, '0')).to.be.equal(true); | ||
| }); | ||
|
|
||
| it('User 1 tries to delegate proposition power to user 3', async () => { |
Member
There was a problem hiding this comment.
I would remove "tries to", since it actually does it (same in next case)
same for these cases in delegationWithSnapshot
…-v2 into tmp/delegation-gas-fixes
Tmp/delegation gas fixes
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
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Improvement goal:
Currently every token transfer triggers 4 snapshots which can be costly in gas
We propose to decrease gas cost for most transfers.
Intended new behaviour
We propose to disable by default power snapshots for:
=> The overall condition is that their current balance Of Token == their power.
Note: They will not be able to participate in governance.
Users that want to participate in governance can opt in to keep the same behaviour as before the change.
Technical description
An account can delegate to:
Every token transfers or delegation event can toggle snapshot for a user:
Example:
Event 1: User 1 received 3 AAVE from User 3
Event 2: User 2 delegates to User 4
Event 3: User 4 delegates voting power to User1. Balance of User 4 = 0 AAVE
Event 4: User 4 receives 7 AAVE Tokens
Event 5 : User 1 delegates to itself for both power
=> Snapshot On for both powers
Note: to avoid some edge cases where users would be snapshot off while still receiving power the system follow this property:
e.g