{"id":19070803,"url":"https://github.com/mento-protocol/mento-std","last_synced_at":"2026-05-17T14:30:19.292Z","repository":{"id":253554479,"uuid":"843851711","full_name":"mento-protocol/mento-std","owner":"mento-protocol","description":"Extension of forge-std with additional Mento utilities","archived":false,"fork":false,"pushed_at":"2024-08-26T08:28:42.000Z","size":71,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-02T15:50:45.496Z","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/mento-protocol.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-08-17T16:02:58.000Z","updated_at":"2024-08-26T08:28:46.000Z","dependencies_parsed_at":"2024-08-17T17:24:54.872Z","dependency_job_id":"bd0ad03a-e485-4322-ba27-005444d83a7e","html_url":"https://github.com/mento-protocol/mento-std","commit_stats":null,"previous_names":["mento-protocol/mento-std"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mento-protocol%2Fmento-std","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mento-protocol%2Fmento-std/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mento-protocol%2Fmento-std/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mento-protocol%2Fmento-std/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mento-protocol","download_url":"https://codeload.github.com/mento-protocol/mento-std/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240122574,"owners_count":19751142,"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-09T01:20:40.602Z","updated_at":"2026-05-17T14:30:17.208Z","avatar_url":"https://github.com/mento-protocol.png","language":"Solidity","funding_links":[],"categories":[],"sub_categories":[],"readme":"## Mento Standard Solidity Library (mento-std)\n\nExtensions for [forge-std](https://github.com/foundry-rs/forge-std) and added utilities that are shared between `mento-core` and `mento-deployments`, and potentially other Mento Solidity repositories.\n\n### Array\n\nProvides helpers to build dynamic arrays of finite length by the use of overloaded functions.\nThe [Array.sol](./src/Array.sol) file is generated by [this script](./bin/gen-array-helpers.ts), which can be called by running:\n\n```\npnpm gen:array-helpers\n```\n\nThe configuration is stored in the script file:\n```typescript\nconst TARGETS = {\n  uints: {\n    type: \"uint256\"\n  },\n  addresses: {\n    type: 'address'\n  },\n  bytes4s: {\n    type: 'bytes4'\n  },\n  bytes32s: {\n    type: 'bytes32'\n  }\n} as const;\nconst MAX_SIZE = 8;\n```\n\n### CeloChains\n\nCeloChains is an extension of the `StdChains` contract in `forge-std`. \nIt adds the celo specific chains to the registered chains in `StdChains`, and adds \na couple of convenience methods.\n\n### ContractsLookup\n\nThe contract implements the logic to lookup contract addresses that can be derived from:\n1. A dependencies.json file.\n2. Contract creations recorded in broadcast scripts, that are explicitly loaded by calling `load`.\n3. The Celo registry.\n4. The GovernanceFactory contract, if it can be found in (1) or (2). \n\nUsage: \n\n```solidity\nimport {Script} from \"mento-std/Script.sol\"\n\ncontract SomeScript is Script {\n  function setUp() {\n    load(\"DeploySomething\", \"latest\");\n  }\n  \n  function doSufff() {\n    address something = lookup(\"Something\");\n  }\n}\n```\n\n### CeloPrecompiles\n\nMinimum precompiles helper which only treats the TRANSFER precompile, it seams like after the L2 move this will be the only one left, and it's the only one we have ever cared about at mento.\n\n### Script\n\nBase `Script` contract that composes from base `forge-std` modules and extends them with the local modules.\n\n### Test\n\nBase `Test` contract that composes from base `forge-std` modules and extends them with the local modules.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmento-protocol%2Fmento-std","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmento-protocol%2Fmento-std","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmento-protocol%2Fmento-std/lists"}