{"id":19096776,"url":"https://github.com/makerdao/token-tests","last_synced_at":"2025-04-30T14:15:19.655Z","repository":{"id":166901535,"uuid":"642456323","full_name":"makerdao/token-tests","owner":"makerdao","description":"Suite of unit and fuzz tests for MakerDAO-style ERC20 tokens","archived":false,"fork":false,"pushed_at":"2024-04-24T21:02:45.000Z","size":85,"stargazers_count":11,"open_issues_count":0,"forks_count":3,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-30T16:46:50.950Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Solidity","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"agpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/makerdao.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-05-18T15:53:06.000Z","updated_at":"2024-11-01T18:59:25.000Z","dependencies_parsed_at":"2024-04-09T15:44:32.568Z","dependency_job_id":"46bf1b5f-7d34-413b-8fff-fab0308c74aa","html_url":"https://github.com/makerdao/token-tests","commit_stats":null,"previous_names":["makerdao/token-tests"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/makerdao%2Ftoken-tests","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/makerdao%2Ftoken-tests/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/makerdao%2Ftoken-tests/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/makerdao%2Ftoken-tests/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/makerdao","download_url":"https://codeload.github.com/makerdao/token-tests/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249517935,"owners_count":21284861,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-09T03:37:46.920Z","updated_at":"2025-04-18T16:30:57.167Z","avatar_url":"https://github.com/makerdao.png","language":"Solidity","readme":"# token-tests\n\nTest suite for a standard \"Maker-style\" ERC20 token. An example of such a standard token can be found in `src/tests/SampleToken.sol`.\n\n## Getting Started\n\nRun `forge install makerdao/token-tests` in your newly setup repository.\n\nThere are two possible ways to use `token-tests`\n\n### 1) Letting `token-tests` handle testing for you\n\nThis is the recommended way. Inherit your test contract from `token-tests/TokenTests.sol` instead of `std-forge/Test.sol` (`contract YourTokenTest is TokenTests {`). You will then need to set the following inherited variables:\n\n```solidity\n    function setUp() public {\n        _token_ = address(new YourToken());\n        _contractName_ = \"YourToken\";\n        _tokenName_ = \"Your Token\";\n        _symbol_ = \"TKN\";\n        _version_ = \"1\"; // this can be omitted, in which case a default value of \"1\" is assumed\n        _decimals_ = 18; // this can be omitted, in which case a default value of 18 is assumed\n    }\n```\n\nThat's it. A suite of tests covering Mint/Burn, ERC20 functionalities and Permit will automatically be run for you. If you also want fuzz tests to be run, use `token-tests/TokenFuzzTests.sol` as your base class (which itself inherits from `TokenTests.sol`).\n\nYou can use `tests/TokenTests.t.sol` as an example of this first approach.\n\n### 2) Explicitely specifying your tests in your test class\n\nAlternatively, if you want more fine-grained control over your tests, you can inherit your test contract from `token-tests/TokenChecks.sol`. You will then be able to call individual token testing functions (all starting with the prefix `check`) or, alternatively, bulk testing functions such as `checkBulkERC20()`, `checkBulkMintBurn()` or `checkBulkPermit()`.\n\nIf you wish to use fuzz testing functions to fuzz test your token, inherit your test contract from `token-tests/FuzzTokenChecks.sol`. You will then be able to call any of the token fuzz testing functions (all in the form `checkXXXFuzz` or `checkBulkXXXFuzz`).\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmakerdao%2Ftoken-tests","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmakerdao%2Ftoken-tests","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmakerdao%2Ftoken-tests/lists"}