{"id":24066316,"url":"https://github.com/rainlanguage/rain.extrospection","last_synced_at":"2026-05-17T14:31:56.545Z","repository":{"id":166766448,"uuid":"641915704","full_name":"rainlanguage/rain.extrospection","owner":"rainlanguage","description":null,"archived":false,"fork":false,"pushed_at":"2026-05-08T07:43:49.000Z","size":3244,"stargazers_count":0,"open_issues_count":5,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-05-08T08:37:45.673Z","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":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/rainlanguage.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":"audit/2026-02-19-01/pass0/process.md","citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2023-05-17T12:37:03.000Z","updated_at":"2026-04-29T19:31:20.000Z","dependencies_parsed_at":"2025-10-18T20:10:36.436Z","dependency_job_id":"b7185bd2-8595-4ab6-9a00-e1c2d88283d1","html_url":"https://github.com/rainlanguage/rain.extrospection","commit_stats":null,"previous_names":["rainprotocol/rain.extrospection","rainlanguage/rain.extrospection"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/rainlanguage/rain.extrospection","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rainlanguage%2Frain.extrospection","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rainlanguage%2Frain.extrospection/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rainlanguage%2Frain.extrospection/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rainlanguage%2Frain.extrospection/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rainlanguage","download_url":"https://codeload.github.com/rainlanguage/rain.extrospection/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rainlanguage%2Frain.extrospection/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33142101,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-17T09:28:26.183Z","status":"ssl_error","status_checked_at":"2026-05-17T09:27:52.702Z","response_time":107,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6: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":[],"created_at":"2025-01-09T11:40:10.849Z","updated_at":"2026-05-17T14:31:51.536Z","avatar_url":"https://github.com/rainlanguage.png","language":"Solidity","funding_links":[],"categories":[],"sub_categories":[],"readme":"# rain.extrospection\n\nDocs at https://rainprotocol.github.io/rain.extrospection\n\n## Extrospection\n\nExtrospection is a collection of interfaces, libraries and an implementation\ncontract that expose onchain logic to offchain tooling.\n\nFocus is on analysing the bytecode of contracts directly, such as deciding\nwhether we can prove that an address is immutable due to the absence of all state\nchanging opcodes.\n\nEfforts have been made to implement the logic efficiently but it is expected that\nthe primary execution environment will be offchain, so there are somewhat gas\nintensive algorithms in this repository.\n\n### `IExtrospectBytecodeV2`\n\nTools to read and get a basic understanding of what opcodes are used in the\nbytecode of some address.\n\nThe most basic functions `bytecode` and `bytecodeHash` simply expose the\nunderlying native evm logic for each.\n\nThe more sophisticated `scanEVMOpcodesPresentInAccount` and\n`scanEVMOpcodesReachableInAccount` build a bitmap of all the opcodes that are\npresent in the scanned contract. This bitmap is built as `1 \u003c\u003c opcode` where\nopcode is a single byte, and the scan is a `uint256` so the space of all opcodes\nas a `uint8` maps perfectly to all the bits in an EVM word.\n\nThe \"present in\" scan simply loops over the entire bytecode, but is `PUSH*` aware\nso knows that the inline argument to any `PUSH` opcode is not itself an opcode.\nThis is the most conservative scan but can easily trigger false positives, such\nas due to bytes in the CBOR metadata commonly appended to contracts by solidity.\n\nCBOR metadata MAY be disabled in newer versions of Solidity and is not present\nin other EVM language compilers.\n\nThe \"reachable in\" scan understands enough about the EVM execution environment to\nignore data that is not reachable by a `JUMPDEST`. This is achieved by pausing\nthe scanner after any opcode that halts execution, then resuming it once a jump\ndestination is found. This scan DOES NOT cause false positives due to metdata or\nsimilar \"data only\" regions of a contract, however it is susceptible to breakages\nif the EVM execution model ever changes. For example, if the set of halting ops\never changes, or a new `JUMPDEST` alternative is invented, the scanner will\nrequire an entirely new implementation and redeployment to support this.\n\n### `IExtrospectERC1167ProxyV1`\n\nCheck if a given account is an `ERC1167` minimal proxy contract.\n\nhttps://eips.ethereum.org/EIPS/eip-1167\n\nThe minimal proxy contract has exact bytecode so we can easily check if any\naccount is a proxy and extract the implementation address that is being proxied.\n\nHaving a canonical onchain check for this simplifies downstream tooling and\nminimises the surface area for implementation bugs.\n\n### `IExtrospectInterpreterV1`\n\nCheck if a candidate interpreter contract is fundamentally UNSAFE due to\nmutation.\n\nOne fundamental hard requirement of an interpreter is that it is NOT mutable.\nMost obviously this includes `SELFDESTRUCT` as that would allow for things like\nmetamorphic languages, which would completely undermine the integrity of any\nexpression that runs on the interpreter.\n\nLess obviously, every opcode that would fail a standard static call is also\ndisallowed within interpreters. This gives interpreters a guaranteed familiar\nset of security guarantees without needing to consider their internal\nimplementation.\n\nPragmatically this is a thin wrapper around the bytecode scanning tools that\ncheck for reachability of dangerous opcodes in the underlying.\n\nThis interface and/or concrete implementations are subject to change if/when new\nopcodes are supported by the EVM due to future hard forks.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frainlanguage%2Frain.extrospection","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frainlanguage%2Frain.extrospection","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frainlanguage%2Frain.extrospection/lists"}