{"id":20737587,"url":"https://github.com/patronum-labs/contract-extensions","last_synced_at":"2026-02-05T13:32:20.400Z","repository":{"id":250384119,"uuid":"833847883","full_name":"Patronum-Labs/contract-extensions","owner":"Patronum-Labs","description":"Set of smart contract extensions that can be used by different smart contract accounts, like Gnosis Safe, UniversalProfiles, etc ..","archived":false,"fork":false,"pushed_at":"2024-12-29T12:48:18.000Z","size":69,"stargazers_count":2,"open_issues_count":7,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-04-14T10:51:40.255Z","etag":null,"topics":["contract-extensions","extensions-contracts","fallback","gnosis-safe","lsp17","safe","safe-fallback"],"latest_commit_sha":null,"homepage":"","language":"Solidity","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Patronum-Labs.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":"2024-07-25T22:13:43.000Z","updated_at":"2025-01-14T04:55:18.000Z","dependencies_parsed_at":"2024-11-17T06:15:01.817Z","dependency_job_id":"b6a9afe6-e23f-45bf-be07-bf7048e2d59c","html_url":"https://github.com/Patronum-Labs/contract-extensions","commit_stats":null,"previous_names":["patronum-labs/contract-extensions"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Patronum-Labs/contract-extensions","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Patronum-Labs%2Fcontract-extensions","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Patronum-Labs%2Fcontract-extensions/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Patronum-Labs%2Fcontract-extensions/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Patronum-Labs%2Fcontract-extensions/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Patronum-Labs","download_url":"https://codeload.github.com/Patronum-Labs/contract-extensions/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Patronum-Labs%2Fcontract-extensions/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29122612,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-05T10:47:47.471Z","status":"ssl_error","status_checked_at":"2026-02-05T10:45:08.119Z","response_time":65,"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":["contract-extensions","extensions-contracts","fallback","gnosis-safe","lsp17","safe","safe-fallback"],"created_at":"2024-11-17T06:14:56.559Z","updated_at":"2026-02-05T13:32:20.329Z","avatar_url":"https://github.com/Patronum-Labs.png","language":"Solidity","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Contract Extensions\n\nThis repository contains smart contract **extensions** to be used with different smart contracts accounts, similar to those used in advanced account systems like **Gnosis Safe** and **Universal Profiles**, etc ..\n\n## Overview\n\nSmart contract accounts often implement an extending mechanism where calls to non-existent functions are delegated to extensions using the fallback function. These extensions contain the actual logic and execute it on behalf of the main contract.\n\n```mermaid\nsequenceDiagram\n    participant EU as External User\n    participant SCA as Smart Contract Account\n    participant EXT as Extension\n\n    EU-\u003e\u003eSCA: Call function A\n    Note over SCA: Function A doesn't exist\n    SCA-\u003e\u003eEXT: Call to extension for function A\n    EXT-\u003e\u003eEXT: Execute func A\n    EXT-\u003e\u003eSCA: Return result\n    SCA-\u003e\u003eEU: Return result\n```\n\nThis approach is beneficial for contracts that:\n\n* Have logic that may change over time\n* Need to implement a large number of functions\n* Want to maintain upgradeability for specific functionalities\n\n## Use Cases\n\n### Flexible ERC721 Callbacks\n\nConsider an ERC721 token receiver. Initially, in your **GnosisSafe/UniversalProfile** you might want to accept all tokens. However, later you may decide to only accept specific tokens. If this logic was implemented natively in an immutable contract, changing it would be impossible. By using extensions, you can:\n\n* Start with an extension that accepts all tokens\n* Later, replace it with a new extension that only accepts specific tokens\n\nThis flexibility allows for evolving logic without needing to redeploy the main contract.\n\n## Available Extensions\n\nThe extensions available are:\n- `ExtERC165StorageOwnable`: Extension that allows the owner of the extension to add **ERC165** supported interfaces.\n- `ExtERC165StorageSingleton`: Extension that allows each smart contract account to add **ERC165** supported interfaces, can be used as a singleton.\n- `ExtERC1271Ownable`: Extension that validates the signature and the hash based on whether the recovered address matches the address of the owner of the smart contract account.\n  \nMore to come soon ...\n\n## Usage\n\n### Build\n\n```sh\n$ forge build\n```\n\n### Test\n\n```sh\n$ forge test\n```\n\n### Gas Snapshots\n\n```sh\n$ forge snapshot\n```\n\n## Contributing\n\nContributions are welcome! Please feel free to submit a Pull Request.\n\n## License\n\n[MIT License](LICENSE)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpatronum-labs%2Fcontract-extensions","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpatronum-labs%2Fcontract-extensions","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpatronum-labs%2Fcontract-extensions/lists"}