{"id":22399925,"url":"https://github.com/laugharne/solc_runs_dispatcher","last_synced_at":"2026-05-15T20:31:12.304Z","repository":{"id":201058829,"uuid":"706862210","full_name":"Laugharne/solc_runs_dispatcher","owner":"Laugharne","description":"The goal here is to see the effects of the number of public functions in a solidity smart contract and the level of optimization of solc solidity compiler on the bytecodes of the \"function dispatcher\".","archived":false,"fork":false,"pushed_at":"2023-10-29T08:05:36.000Z","size":63,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-07-19T08:46:53.655Z","etag":null,"topics":["gas","opcodes","optimization","php","solidity"],"latest_commit_sha":null,"homepage":"","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/Laugharne.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":"2023-10-18T19:01:12.000Z","updated_at":"2023-10-21T12:14:55.000Z","dependencies_parsed_at":"2024-12-05T08:10:38.889Z","dependency_job_id":"02e8c196-db42-46ae-8d36-c8f024da536b","html_url":"https://github.com/Laugharne/solc_runs_dispatcher","commit_stats":null,"previous_names":["laugharne/solc_runs_dispatcher"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Laugharne/solc_runs_dispatcher","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Laugharne%2Fsolc_runs_dispatcher","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Laugharne%2Fsolc_runs_dispatcher/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Laugharne%2Fsolc_runs_dispatcher/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Laugharne%2Fsolc_runs_dispatcher/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Laugharne","download_url":"https://codeload.github.com/Laugharne/solc_runs_dispatcher/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Laugharne%2Fsolc_runs_dispatcher/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33078898,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-15T20:25:35.270Z","status":"ssl_error","status_checked_at":"2026-05-15T20:25:34.732Z","response_time":103,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["gas","opcodes","optimization","php","solidity"],"created_at":"2024-12-05T08:10:35.166Z","updated_at":"2026-05-15T20:31:12.279Z","avatar_url":"https://github.com/Laugharne.png","language":"Solidity","funding_links":[],"categories":[],"sub_categories":[],"readme":"# solc_runs_tests\n\n## 📖 Table of Contents\n\n\n\u003c!-- TOC --\u003e\n\n- [solc_runs_tests](#solc_runs_tests)\n\t- [📖 Table of Contents](#-table-of-contents)\n\t- [🔭 Overview](#-overview)\n\t- [✏️ compiler parameters](#-compiler-parameters)\n\t- [📝 Results](#-results)\n\t- [🌲 Repository Tree](#-repository-tree)\n\n\u003c!-- /TOC --\u003e\n\n\n\n## 🔭 Overview\n\n\nThis repository is a testbed to experiment with optimizing Solidity compiler (*`solc`*) by launching compilation on it. The goal here is to see the effects of the **number of public functions** in a solidity smart contract and the **level of optimization** of `solc` solidity compiler on the bytecodes of the \"*function dispatcher*\".\n\n**Three PHP scripts** are used !\n\n1. `solc_runs_tests_files.php` : to **generate solidity source code** with a variable number of public functions. See files `FunctionDispatcher_XX.sol` with `XX` in range `4 to 15` corresponding to the number of functions.\n\n2. `solc_runs_tests_evm.php` : proceed to an **automatic solidity compilation** of scripts previously created, with a level of optimization from `200 to 1000`. The compilation output (*opcodes*) are write in dedicated folders (*see [repository tree](#-repository-tree)*) with names corresponding to runs level and number of functions.\n\n```php\n$cmd = \"solc --asm --overwrite --optimize-runs {$run} -o {$output} {$sol_file}\";\nsystem($cmd);\n```\n3. `solc_runs_tests_analyze.php` : proceed to a **static analyzis** of opcodes (from the differents file output) and count `tags` label on \"*function dispatcher*\" sections, corresponding to the number of sequential linear selector tests. And output results as **CSV** and **Markdown** data array.\n\n**Note !**\nThe solidity compiler `solc` version was set on **0.8.20**.\n\n\n## ✏️ compiler parameters\n\n**Runs level**\n```\nOptimizer Options:\n  --optimize-runs n (=200)\n      The number of runs specifies roughly how often each \n      opcode of the deployed code will be executed across the \n      lifetime of the contract. Lower values will optimize \n      more for initial deployment cost, higher values will \n      optimize more for high-frequency usage.\n```\n\n\n**Opcodes output**\n```\nOutput Components:\n    --asm    EVM assembly of the contracts.\n```\n\n\n## 📝 Results\n\n![](array.png)\n\n\n----\n\n\n## 🌲 Repository Tree\n```bash\n.\n├── array.csv\n├── array.md\n├── array.png\n├── FunctionDispatcher_10.sol\n├── FunctionDispatcher_11.sol\n├── FunctionDispatcher_12.sol\n├── FunctionDispatcher_13.sol\n├── FunctionDispatcher_14.sol\n├── FunctionDispatcher_15.sol\n├── FunctionDispatcher_4.sol\n├── FunctionDispatcher_5.sol\n├── FunctionDispatcher_6.sol\n├── FunctionDispatcher_7.sol\n├── FunctionDispatcher_8.sol\n├── FunctionDispatcher_9.sol\n└── output\n    ├── 1000_10\n    ├── 1000_11\n    ├── 1000_12\n    ├── 1000_13\n    ├── 1000_14\n    ├── 1000_15\n    ├── 1000_4\n    ├── 1000_5\n    ├── 1000_6\n    ├── 1000_7\n    ├── 1000_8\n    ├── 1000_9\n    ├── 200_10\n    ├── 200_11\n    ├── 200_12\n    ├── 200_13\n    ├── 200_14\n    ├── 200_15\n    ├── 200_4\n    ├── 200_5\n    ├── 200_6\n    ├── 200_7\n    ├── 200_8\n    ├── 200_9\n    ├── 300_10\n    ├── 300_11\n    ├── 300_12\n    ├── 300_13\n    ├── 300_14\n    ├── 300_15\n    ├── 300_4\n    ├── 300_5\n    ├── 300_6\n    ├── 300_7\n    ├── 300_8\n    ├── 300_9\n    ├── 400_10\n    ├── 400_11\n    ├── 400_12\n    ├── 400_13\n    ├── 400_14\n    ├── 400_15\n    ├── 400_4\n    ├── 400_5\n    ├── 400_6\n    ├── 400_7\n    ├── 400_8\n    ├── 400_9\n    ├── 500_10\n    ├── 500_11\n    ├── 500_12\n    ├── 500_13\n    ├── 500_14\n    ├── 500_15\n    ├── 500_4\n    ├── 500_5\n    ├── 500_6\n    ├── 500_7\n    ├── 500_8\n    ├── 500_9\n    ├── 600_10\n    ├── 600_11\n    ├── 600_12\n    ├── 600_13\n    ├── 600_14\n    ├── 600_15\n    ├── 600_4\n    ├── 600_5\n    ├── 600_6\n    ├── 600_7\n    ├── 600_8\n    ├── 600_9\n    ├── 700_10\n    ├── 700_11\n    ├── 700_12\n    ├── 700_13\n    ├── 700_14\n    ├── 700_15\n    ├── 700_4\n    ├── 700_5\n    ├── 700_6\n    ├── 700_7\n    ├── 700_8\n    ├── 700_9\n    ├── 800_10\n    ├── 800_11\n    ├── 800_12\n    ├── 800_13\n    ├── 800_14\n    ├── 800_15\n    ├── 800_4\n    ├── 800_5\n    ├── 800_6\n    ├── 800_7\n    ├── 800_8\n    ├── 800_9\n    ├── 900_10\n    ├── 900_11\n    ├── 900_12\n    ├── 900_13\n    ├── 900_14\n    ├── 900_15\n    ├── 900_4\n    ├── 900_5\n    ├── 900_6\n    ├── 900_7\n    ├── 900_8\n    └── 900_9\n\n109 directories\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flaugharne%2Fsolc_runs_dispatcher","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flaugharne%2Fsolc_runs_dispatcher","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flaugharne%2Fsolc_runs_dispatcher/lists"}