-
Notifications
You must be signed in to change notification settings - Fork 53
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
Pool to support rebasing mint call #1490
Conversation
@@ -35,4 +33,8 @@ contract BurnWithFromMintTokenPool is BurnMintTokenPoolAbstract, ITypeAndVersion | |||
function _burn(uint256 amount) internal virtual override { | |||
IBurnMintERC20(address(i_token)).burn(address(this), amount); | |||
} | |||
|
|||
function typeAndVersion() external pure virtual override returns (string memory) { |
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.
The other way of writing it cannot be overridden
2bf3b54
to
9783c12
Compare
LCOV of commit
|
contracts/src/v0.8/ccip/test/pools/BurnWithFromMintRebasingTokenPool.t.sol
Outdated
Show resolved
Hide resolved
|
||
function test_releaseOrMint_rebasing_success(uint16 multiplierPercentage) public { | ||
uint256 amount = 1000; | ||
uint256 expectedAmount = amount * multiplierPercentage / 100; |
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.
q: if percentage is 0, this should still succeed right because balancePost == balancePre
and balancePost < balancePre
does not fail?
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.
Is balancePost == balancePre
desirable in the pool? It's basically a no balance increase
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.
Correct, I would call that case valid. The check is mostly there so 1) don't allow theft and 2) to not revert with an underflow when calculating the returned value
Quality Gate passedIssues Measures |
This basic pool supports rebasing minting