Skip to content

feat: Add integration tests for token contract#86

Merged
Gbangbolaoluwagbemiga merged 3 commits intoHyperSafeD:mainfrom
ritik4ever:feat/token-integration-tests-32
Feb 25, 2026
Merged

feat: Add integration tests for token contract#86
Gbangbolaoluwagbemiga merged 3 commits intoHyperSafeD:mainfrom
ritik4ever:feat/token-integration-tests-32

Conversation

@ritik4ever
Copy link
Copy Markdown
Contributor

feat: Add Integration Tests for Token Contract

Closes #32

Description

This pull request introduces integration tests for the sanctifier-core analyzer to verify its ability to detect common vulnerabilities in Soroban token contracts.

To facilitate this, a new vulnerable contract, token-with-bugs, has been added. This contract includes the following intentional vulnerabilities:

  • Missing Authorization: The transfer function can be called without a require_auth check, allowing unauthorized transfers.
  • Integer Overflow: The mint and transfer functions perform arithmetic operations without using checked arithmetic, making them vulnerable to integer overflow/underflow attacks.

Changes

  • Created a new contract contracts/token-with-bugs with the vulnerabilities described above.
  • Added a new test case test_token_with_bugs to tooling/sanctifier-core/src/lib.rs.
  • The new test uses the Analyzer to scan the token-with-bugs contract.
  • Assertions have been added to confirm that scan_auth_gaps and scan_arithmetic_overflow correctly identify and report the vulnerabilities.

Testing

The changes were tested by running the sanctifier-core test suite. The new test test_token_with_bugs passes, confirming that the analyzer works as expected.

@ritik4ever
Copy link
Copy Markdown
Contributor Author

@Gbangbolaoluwagbemiga please review my PR

@Gbangbolaoluwagbemiga
Copy link
Copy Markdown
Contributor

@ritik4ever, please resolve conflicts

@Gbangbolaoluwagbemiga Gbangbolaoluwagbemiga merged commit fbc78a8 into HyperSafeD:main Feb 25, 2026
0 of 2 checks passed
xqcxx pushed a commit to xqcxx/Sanctifier that referenced this pull request Mar 10, 2026
…ract-template-Reentrancy-Guardian

Develop-smart-contract-template-Reentrancy-Guardian
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.

test: Add Integration Tests for Token Contract

2 participants