{"id":17794226,"url":"https://github.com/pyk/singleton","last_synced_at":"2025-08-13T05:31:24.430Z","repository":{"id":185991581,"uuid":"674424260","full_name":"pyk/singleton","owner":"pyk","description":"Simple and reusable singleton smart contract that supports ERC3156","archived":false,"fork":false,"pushed_at":"2023-08-17T04:41:52.000Z","size":11,"stargazers_count":3,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2024-10-27T11:26:04.558Z","etag":null,"topics":["erc20","erc3156","ethereum","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/pyk.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-08-03T23:24:23.000Z","updated_at":"2023-08-04T11:32:25.000Z","dependencies_parsed_at":null,"dependency_job_id":"4f7e3da0-3e67-4996-9686-5ead64b97050","html_url":"https://github.com/pyk/singleton","commit_stats":null,"previous_names":["pyk/singleton"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pyk%2Fsingleton","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pyk%2Fsingleton/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pyk%2Fsingleton/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pyk%2Fsingleton/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pyk","download_url":"https://codeload.github.com/pyk/singleton/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":229737479,"owners_count":18116456,"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":["erc20","erc3156","ethereum","solidity"],"created_at":"2024-10-27T11:15:35.522Z","updated_at":"2024-12-14T18:15:18.876Z","avatar_url":"https://github.com/pyk.png","language":"Solidity","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Singleton\n\nSingleton ERC20 vault contract with flash loan support.\n\n## Features\n\n- ✅ Compatible with any ERC20\n- ✅ Reduce gas fees on ERC20 transfer via internal transfer\n- ✅ Support ERC3156 (Flash Loan) with custom fees \u0026 recipient\n\n## Get started\n\nInstall and use directly on your project:\n\n```sh\nforge install pyk/singleton\n```\n\nExample usage:\n\n```sol\nimport {Singleton} from \"singleton/Singleton.sol\";\n\ncontract MyVault is Singleton {\n  constructor(adddress owner, uint256 fees) Singleton(owner, fees) {\n    //\n  }\n}\n```\n\nOr deploy directly using the factory:\n\n- Ethereum (_To be deployed_)\n- Arbitrum (_To be deployed_)\n- Optimism (_To be deployed_)\n- Base (_To be deployed_)\n\n## Tests\n\nRun test using the following command:\n\n```sh\nforge test --fork-url ETH_RPC_URL\n```\n\n```\n[⠢] Compiling...\nNo files changed, compilation skipped\n\nRunning 12 tests for test/Singleton.t.sol:SingletonTest\n[PASS] testDeposit() (gas: 219034)\n[PASS] testDepositWithCustomAccount() (gas: 220687)\n[PASS] testDepositWithZeroAmount() (gas: 162848)\n[PASS] testFlashLoanFee() (gas: 220030)\n[PASS] testFlashLoanMax() (gas: 217064)\n[PASS] testFlashLoanWithBorrowerNotRepaid() (gas: 689035)\n[PASS] testFlashLoanWithInvalidBorrower() (gas: 383503)\n[PASS] testFlashLoanWithValidBorrower() (gas: 714253)\n[PASS] testTransfer() (gas: 239685)\n[PASS] testWithdraw() (gas: 241137)\n[PASS] testWithdrawWithAmountGreaterThanBalance() (gas: 220333)\n[PASS] testWithdrawWithCustomRecipient() (gas: 245264)\nTest result: ok. 12 passed; 0 failed; 0 skipped; finished in 3.38s\nRan 1 test suites: 12 tests passed, 0 failed, 0 skipped (12 total tests)\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpyk%2Fsingleton","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpyk%2Fsingleton","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpyk%2Fsingleton/lists"}