Skip to content

feat: add minimal Token contract with unit and fuzz tests#2

Merged
oliv3rdrt merged 1 commit into
mainfrom
feat/token-contract
May 17, 2026
Merged

feat: add minimal Token contract with unit and fuzz tests#2
oliv3rdrt merged 1 commit into
mainfrom
feat/token-contract

Conversation

@oliv3rdrt

Copy link
Copy Markdown
Owner

Summary

  • Adds src/Token.sol: a small ERC20-style token (transfer, approve, transferFrom) with no extras - just enough surface for unit + fuzz tests.
  • Adds test/Token.t.sol: 7 unit tests + 2 fuzz tests covering happy paths, reverts on insufficient balance/allowance, zero-address transfers, and the "infinite allowance is not decremented" rule.
  • Updates Deploy.s.sol to deploy the new contract alongside Counter and Vault.

Test plan

  • forge test --match-contract TokenTest -vv - 9 passed
  • forge test (full suite) - 22 passed, no regressions

Closes #1

Tiny ERC20-style sample (transfer/approve/transferFrom, no extras) so the
suite has another surface for practicing tests. Infinite allowance is
preserved across transfers, zero-address transfers revert.

Closes #1
@oliv3rdrt

Copy link
Copy Markdown
Owner Author

Reviewed locally - tests pass (forge test 22/22), no regressions, ready to merge.

@oliv3rdrt oliv3rdrt merged commit c5fbdff into main May 17, 2026
1 check failed
@oliv3rdrt oliv3rdrt deleted the feat/token-contract branch May 17, 2026 10:53
oliv3rdrt added a commit that referenced this pull request Jun 27, 2026
Tiny ERC20-style sample (transfer/approve/transferFrom, no extras) so the
suite has another surface for practicing tests. Infinite allowance is
preserved across transfers, zero-address transfers revert.

Closes #1

Co-authored-by: Oliver Anyanwu <oliver.anyanwu@aol.com>
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.

Add a minimal Token contract sample

1 participant