{"id":25237215,"url":"https://github.com/Recon-Fuzz/erc7540-reusable-properties","last_synced_at":"2025-10-26T12:30:39.227Z","repository":{"id":237197554,"uuid":"794015231","full_name":"Recon-Fuzz/erc7540-reusable-properties","owner":"Recon-Fuzz","description":null,"archived":false,"fork":false,"pushed_at":"2024-08-16T11:44:58.000Z","size":1312,"stargazers_count":1,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2024-08-16T12:59:22.297Z","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":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Recon-Fuzz.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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":"2024-04-30T09:46:26.000Z","updated_at":"2024-08-16T12:07:51.000Z","dependencies_parsed_at":null,"dependency_job_id":"a24c6583-c174-4132-9420-c29d6d890001","html_url":"https://github.com/Recon-Fuzz/erc7540-reusable-properties","commit_stats":null,"previous_names":["recon-fuzz/erc7540-reusable-properties"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Recon-Fuzz%2Ferc7540-reusable-properties","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Recon-Fuzz%2Ferc7540-reusable-properties/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Recon-Fuzz%2Ferc7540-reusable-properties/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Recon-Fuzz%2Ferc7540-reusable-properties/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Recon-Fuzz","download_url":"https://codeload.github.com/Recon-Fuzz/erc7540-reusable-properties/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":238320494,"owners_count":19452564,"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":"2025-02-11T15:33:39.177Z","updated_at":"2025-10-26T12:30:38.844Z","avatar_url":"https://github.com/Recon-Fuzz.png","language":"Solidity","funding_links":[],"categories":["Reusable properties"],"sub_categories":["Utils"],"readme":"# ERC7540 Reusable Properties\n\nA collection of reusable properties for [ERC-7540](https://eips.ethereum.org/EIPS/eip-7540) Vaults \n\nWritten in collaboration with [Centrifuge](https://centrifuge.io/)\n\n## Quickstart\n\n```\nforge install Recon-Fuzz/erc7540-reusable-properties --no-commit\n```\n\n## Specification\n\n| Property | Description | Category |\n| --- | --- | --- |\n| 7540-1 | `convertToAssets(totalSupply) == totalAssets` unless price is 0.0 | High Level |\n| 7540-2 | `convertToShares(totalAssets) == totalSupply` unless price is 0.0 | High Level | \n| 7540-3 | max* never reverts | DOS Invariant | \n| 7540-4 | claiming more than max always reverts | Stateful Test | \n| 7540-5 | requestRedeem reverts if the share balance is less than amount | Stateful Test | \n| 7540-6 | preview* always reverts | Stateful Test |\n| 7540-7 | if max[method] \u003e 0, then [method] (max) should not revert | DOS Invariant | \n\n## Usage\n\n1. Install the repo as a dependency to a Foundry project\n\n```\nforge install Recon-Fuzz/erc7540-reusable-properties --no-commit\n```\n\n2. Inherit from the `ERC7540Properties` contract in the contract where you've defined your properties. For a test suite harnessed with Recon it will look something like this: \n\n```solidity\nabstract contract Properties is Setup, Asserts, ERC7540Properties {}\n```\n\n3. Add a way to change the `actor` state variable in the `ERC7540Properties` contract. The simplest way to do this is by exposing a target function with something like the following implementation: \n\n```solidity\n    function setup_switchActor(uint8 actorIndex) public {\n        actor = actorsArray[actorIndex % actorsArray.length];\n    }\n```\n\n4. The properties defined in the `ERC7540Properties` contract are meant to hold for a vault implementation conforming to the ERC specification. If your implementation doesn't require certain properties to hold you can simply exclude them from your contract in which you define your properties:\n\n```solidity\nabstract contract Properties is Setup, Asserts, ERC7540Properties {\n    function crytic_erc7540_1() public returns (bool test) {\n        test = erc7540_1(address(vault));\n    }\n\n    function crytic_erc7540_2() public returns (bool test) {\n        test = erc7540_2(address(vault));\n    }\n}\n```\n\nby not adding a wrapper for properties other than `erc7540_2` and `erc7540_2` the other properties defined in `ERC7540Properties` don't get evaluated by the fuzzer.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FRecon-Fuzz%2Ferc7540-reusable-properties","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FRecon-Fuzz%2Ferc7540-reusable-properties","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FRecon-Fuzz%2Ferc7540-reusable-properties/lists"}