Skip to content
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

Merged
merged 4 commits into from
Oct 8, 2024
Merged

Pool to support rebasing mint call #1490

merged 4 commits into from
Oct 8, 2024

Conversation

RensR
Copy link
Collaborator

@RensR RensR commented Oct 7, 2024

This basic pool supports rebasing minting

@@ -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) {
Copy link
Collaborator Author

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

Copy link
Contributor

github-actions bot commented Oct 7, 2024

LCOV of commit 44a2c6c during Solidity Foundry #8537

Summary coverage rate:
  lines......: 97.9% (2278 of 2328 lines)
  functions..: 95.1% (428 of 450 functions)
  branches...: 93.6% (538 of 575 branches)

Files changed coverage rate: n/a

@RensR RensR marked this pull request as ready for review October 7, 2024 13:12
@RensR RensR requested review from makramkd, elatoskinas, RayXpub and a team as code owners October 7, 2024 13:12

function test_releaseOrMint_rebasing_success(uint16 multiplierPercentage) public {
uint256 amount = 1000;
uint256 expectedAmount = amount * multiplierPercentage / 100;
Copy link
Collaborator

@elatoskinas elatoskinas Oct 8, 2024

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?

Copy link
Collaborator

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

Copy link
Collaborator Author

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

@cl-sonarqube-production
Copy link

@RensR RensR merged commit c4907f3 into ccip-develop Oct 8, 2024
127 checks passed
@RensR RensR deleted the add-rebasing-pool branch October 8, 2024 13:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants