Repository navigation
fix: ensure balance in underlying token standard contract is updated when pruning - #39
Merged
Merged
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Description
Fixes #38
This PR adds a
_burnPrunedTokenshook to the abstractTokenEphemeralcontract, which must be implemented by concrete inheriting contracts, to burn expired tokens whenpruneBalanceRecordsis called.The hook is called from within
pruneBalanceRecordsand a newExpiredTokensPrunedevent is emitted, if the account has any expired tokens that need to be burned.The
_burnPrunedTokensmethod is implemented inEVMAuth1155:...and
EVMAuth6909:Type of change
How Has This Been Tested?
Checklist:
Additional context:
The fix for this issue caused the size of the
EVMAuth1155contract to exceed the runtime limit. In order to make it work, we needed to remove theisAcceptedERC20PaymentTokenfunction, which was deemed non-essential. ThetokenERC20Pricesfunction can be used instead; applications will just have to loop through the price structs to determine if a specific payment token is accepted.This PR also makes some changes to the scripts in
ExampleDeploy.s.sol, to illustrate that all roles should not necessarily be granted to the same user.