Skip to content

Add minimum mint value to use mintWithEth function#44

Merged
stubbsta merged 4 commits into
mainfrom
add-minimum-mint-amount
Oct 10, 2025
Merged

Add minimum mint value to use mintWithEth function#44
stubbsta merged 4 commits into
mainfrom
add-minimum-mint-amount

Conversation

@stubbsta
Copy link
Copy Markdown
Contributor

@stubbsta stubbsta commented Oct 9, 2025

Description

The TestStableToken previously had no lower limit to mint tokens. There is a possible risk for spamming because of this.
A minimum of 1 ETH has been added to the mintWithEth function, but there is no lower limit to mint if you are an approved minter.

Checklist

Ensure you completed all of the steps below before submitting your pull request:

  • Added constant for minimum mint amount which is checked in mintwithEth function
  • Added and verified tests for this new limit
  • Update README for TestStableToken

@stubbsta stubbsta requested a review from Copilot October 9, 2025 07:46
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

Adds a minimum mint value requirement to the TestStableToken's mintWithEth function to prevent potential spam attacks. Previously, any amount of ETH could be used to mint tokens, creating a risk for micro-transactions that could spam the network.

  • Added 1 ETH minimum requirement for the mintWithEth function
  • Updated all existing tests to use compliant amounts (≥1 ETH)
  • Added comprehensive test coverage for the new minimum requirement

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
test/TestStableToken.sol Introduces MIN_MINT_WEI constant and updates mintWithETH validation logic
test/TestStableToken.t.sol Adds new tests for minimum requirement and updates existing tests to use compliant amounts

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Comment thread test/TestStableToken.t.sol Outdated
@stubbsta stubbsta requested a review from Copilot October 9, 2025 11:09
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.


Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Comment thread test/TestStableToken.t.sol Outdated
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@stubbsta stubbsta requested review from 0x-r4bbit and jm-clius October 9, 2025 11:13
Copy link
Copy Markdown

@jm-clius jm-clius left a comment

Choose a reason for hiding this comment

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

Great, thanks!

@stubbsta stubbsta merged commit 851fa08 into main Oct 10, 2025
4 checks passed
@stubbsta stubbsta deleted the add-minimum-mint-amount branch October 10, 2025 06:13
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