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

feat: add ERC20FlashMint extension #407

Merged
merged 181 commits into from
Jan 7, 2025

Conversation

Ifechukwudaniel
Copy link
Contributor

@Ifechukwudaniel Ifechukwudaniel commented Nov 14, 2024

NOTE: It is impossible to write any unit tests until it is possible to mock contract::address() in tests (see OpenZeppelin/stylus-test-helpers#5).

Resolves #355

PR Checklist

  • Tests
  • Documentation
  • Changelog

Copy link

netlify bot commented Nov 14, 2024

Deploy Preview for contracts-stylus canceled.

Name Link
🔨 Latest commit a7c0160
🔍 Latest deploy log https://app.netlify.com/sites/contracts-stylus/deploys/67357c1f782e3e00081ecd3f

Copy link

netlify bot commented Nov 14, 2024

Deploy Preview for contracts-stylus canceled.

Name Link
🔨 Latest commit c2495db
🔍 Latest deploy log https://app.netlify.com/sites/contracts-stylus/deploys/677d6b16ccfb650008aea50d

@Ifechukwudaniel
Copy link
Contributor Author

This is my initial draft

Copy link
Collaborator

@0xNeshi 0xNeshi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @Ifechukwudaniel!
Thanks for the contribution!

The PR overall looks good, let's polish it a bit

contracts/src/flashloan/borrower.rs Outdated Show resolved Hide resolved
contracts/src/flashloan/borrower.rs Outdated Show resolved Hide resolved
contracts/src/token/erc20/extensions/flashmint.rs Outdated Show resolved Hide resolved
contracts/src/token/erc20/extensions/flashmint.rs Outdated Show resolved Hide resolved
contracts/src/token/erc20/extensions/flashmint.rs Outdated Show resolved Hide resolved
contracts/src/token/erc20/extensions/flashmint.rs Outdated Show resolved Hide resolved
contracts/src/token/erc20/extensions/flashmint.rs Outdated Show resolved Hide resolved
contracts/src/token/erc20/extensions/flashmint.rs Outdated Show resolved Hide resolved
contracts/src/token/erc20/extensions/flashmint.rs Outdated Show resolved Hide resolved
contracts/src/token/erc20/extensions/flashmint.rs Outdated Show resolved Hide resolved
@Ifechukwudaniel
Copy link
Contributor Author

@0xNeshi what do you think about the new implementation for the extension

@0xNeshi 0xNeshi requested review from bidzyyys and 0xNeshi December 30, 2024 10:33
Copy link
Collaborator

@bidzyyys bidzyyys left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Almost ready to merge.

contracts/src/token/erc20/utils/safe_erc20.rs Outdated Show resolved Hide resolved
docs/modules/ROOT/pages/erc20-flash-mint.adoc Outdated Show resolved Hide resolved
contracts/src/token/erc20/extensions/flash_mint.rs Outdated Show resolved Hide resolved
contracts/src/token/erc20/extensions/flash_mint.rs Outdated Show resolved Hide resolved
contracts/src/token/erc20/extensions/flash_mint.rs Outdated Show resolved Hide resolved
examples/erc20-flash-mint/tests/mock/borrower.rs Outdated Show resolved Hide resolved
Copy link
Collaborator

@bidzyyys bidzyyys left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would not include benchmarks as they do not cover everything. I suggest removing this part at all, wdyt @qalisander?

@bidzyyys bidzyyys self-requested a review January 3, 2025 12:16
Copy link
Collaborator

@bidzyyys bidzyyys left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Left some comments.

Copy link
Member

@qalisander qalisander left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good job guys!
There few comments left to be resolved, overall LGTM

Copy link
Collaborator

@bidzyyys bidzyyys left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@bidzyyys bidzyyys merged commit 9d0a466 into OpenZeppelin:main Jan 7, 2025
23 checks passed
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.

[Feature]: ERC20FlashMint extension
4 participants