-
Notifications
You must be signed in to change notification settings - Fork 0
feat: add split method to Splitter #31
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
Merged
Merged
Changes from all commits
Commits
Show all changes
33 commits
Select commit
Hold shift + click to select a range
3032a7c
feat: add split method to Splitter
marcomariscal 312ea3f
refactor: simplify split to push-based pattern
marcomariscal 0b8ef9f
style: use modern vm.expectEmit and add BPS_DENOMINATOR constant
marcomariscal 26272b4
refactor: extract _addDistributors and _setBurnBps helpers to base co…
marcomariscal 8183615
refactor: move _mintToSplitter to base test contract
marcomariscal bfd1d0d
test: add concrete test cases with hardcoded expected values
marcomariscal aba48be
style: rename split tests for better scopelint spec readability
marcomariscal c4f6a27
test: drop redundant fuzz burn assertion
marcomariscal 9161df6
test: assert split invariants via deltas
marcomariscal 03128eb
test: assert burn via total supply delta
marcomariscal 90eed4c
test: document burn rounding bound
marcomariscal 6ce3bff
test: cover dust burn with nonzero burn bps
marcomariscal cd2e5d9
test: remove weight overflow assumes
marcomariscal 722e689
docs: clarify dust bound and burn accounting
marcomariscal fb25442
style: scopelint fmt
marcomariscal fd6d892
ci: pass token to foundry toolchain
marcomariscal 9ecf843
chore: drop foundry token inputs
marcomariscal a750d34
chore: use openzeppelin remappings
marcomariscal 2a3635e
test: assert exact distributions
marcomariscal 84015c3
test: use _setBurnBps helper
marcomariscal dc4a1f3
test: tighten dust bound to <= 1 wei
marcomariscal 963ceb4
test: remove redundant 100% burn split test
marcomariscal 2b90467
test: ensure dust rounding fuzz always produces dust
marcomariscal 6f0749c
test: rename split event test
marcomariscal 2d6e4a7
docs: document split() zero-balance no-op
marcomariscal 433b17f
test: clarify no-distributors split event test
marcomariscal c3a44d9
test: fold permissionless split into existing fuzz
marcomariscal 90c057e
test: replace hardcoded split cases with burn invariant fuzz
marcomariscal cf9628b
test: reuse two-distributor helpers
marcomariscal 1755681
test: drop redundant Split_ prefix in Split suite
marcomariscal 93b4daf
docs: clarify dust bound and burn includes dust
marcomariscal 4bd630c
chore: scopelint fmt
marcomariscal c0a5087
Minor changes
alexkeating File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
Oops, something went wrong.
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why wouldn't we call with
_burnAmounthereThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is documented in the
@devnote: "Any dust from rounding is burned along with the burn portion." The_totalBurnedcaptures both the intended burn amount and any dust from integer division in the distribution loop. Let me know if you'd like the inline comment or NatSpec to be clearer.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What numbers are we talking about when it comes to dust? Also, I see n divisions for distributing and 1 for burnings so I would guess there is more dust from distribution meaning we would be burning an excess amount? We can also try to improve the precision by adding a scale factor like we do in staker. It all really depends what the dust numbers look like
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Addressed in 93b4daf: added explicit docs that
burn()is called withburnAmount + dust(since dust is intentionally burned), and clarified the dust bound as<= distributors.length - 1.