{"id":15065186,"url":"https://github.com/shailscript/patron","last_synced_at":"2026-02-02T08:04:04.766Z","repository":{"id":103974931,"uuid":"188632625","full_name":"shailscript/patron","owner":"shailscript","description":"A solidity contract factory to deploy fully-manageable independent Ethereum donation contracts for the owner.","archived":false,"fork":false,"pushed_at":"2022-12-14T03:08:55.000Z","size":14,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-06-30T00:02:05.836Z","etag":null,"topics":["ethereum-blockchain","ethereum-contract","solidity-contracts","solidity-language"],"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/shailscript.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":"2019-05-26T02:40:52.000Z","updated_at":"2022-12-14T03:08:55.000Z","dependencies_parsed_at":"2023-03-13T15:00:25.235Z","dependency_job_id":null,"html_url":"https://github.com/shailscript/patron","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/shailscript/patron","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shailscript%2Fpatron","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shailscript%2Fpatron/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shailscript%2Fpatron/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shailscript%2Fpatron/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/shailscript","download_url":"https://codeload.github.com/shailscript/patron/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shailscript%2Fpatron/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29007387,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-02T06:37:10.400Z","status":"ssl_error","status_checked_at":"2026-02-02T06:37:09.383Z","response_time":58,"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":["ethereum-blockchain","ethereum-contract","solidity-contracts","solidity-language"],"created_at":"2024-09-25T00:34:57.616Z","updated_at":"2026-02-02T08:04:04.735Z","avatar_url":"https://github.com/shailscript.png","language":"Solidity","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Patron\n\u003e Submitted By: \u003cbr\u003e Shailendra Shukla \u003cbr\u003e 101224373\n\nInspired by the famous Patreon website where creators accept donations from their supporters, this contract tries to implement somewhat a similar use case serving the content creators/artists on blockchain.\n\nSo, there are six contracts implementing inheritance, abstract contract, events, and other concepts of solidity.\n- First is the `Ownable` contract that has 1 modifier and 3 methods.\n- Second contract is the `Destructible` contract with 2 methods.\n- Third contract is the `Donatable` abstract contract having 1 event, 2 function signatures and 1 modifier.\n- Fourth contract is the `Patron` contract which inherits all of the above contracts to implement 3 methods and emits 1 event declared in the Donatable class.\n- Fifth contract is the `PatronFactory` contract which acts as a contract factory to deploy multiple instances of Patron contract.\n- Lastly we have the sixth contract named `PatronDashboard` which is the Dashboard implementation to support PatronFactory and facilitate its use. This contract is still under development to implement all features of the Patron contract via proxy methods.\n\nFor the PatronFactory contract, signatures for the methods are given below.\n```JS\nfunction deployPatron(address payable _artistAddress) public {}\nfunction getPatronDeploymentById( uint _id) public view returns (Patron) {}\n```\n\nPlease go through the documentation in the Patron.sol file for other contracts, method signatures and implementation details. Though it is well documented but in case of lack of clarity please feel free to open an issue or make suggestions to the existing codebase creating a pull request or fork.\n\n## Deployment\nPatronDashboard Contract has been deployed to the testnet and can be found at etherscan.io, visit the following link: https://ropsten.etherscan.io/address/0x401b6dc3d1fd9ac02096237ee3c0f5e144e8f294\n\nPatronFactory Contract has been deployed to the testnet and can be found at etherscan.io, visit the following link: https://ropsten.etherscan.io/address/0xcf239de9f8b3f3eb9caaeacb7bbb05f4616f7c5b\n\n## Interacting with the Contracts\nTo interact with the PatronDashboard you can follow the steps below:\n1. Call `newPatronDeployment()` to deploy make your patron account to accept donations\n2. Call `donateToArtist(uint _id)` with an arbitrary account and send some ETH along with the artist ID (use 0 to test) as parameters, and you should see an output like this. (sent 3ETH)\n```JSON \n\n{\n  \"from\": \"0x9e43...57df879031\",\n  \"topic\": \"0xd77...465374401d38ae5...15ff9df3158f9b72a7\",\n  \"event\": \"DonationSuccessful\",\n  \"args\": {\n    \"0\": \"0x76A846CD2a...a468423D\",\n    \"1\": \"3000000000000000000\",\n    \"from\": \"0x76A846CD2a...a468423D\",\n    \"value\": \"3000000000000000000\",\n    \"length\": 2\n  }\n}\n```\n\u003e **NOTE** : *An event has been fired named `DonationSuccessful` which shows the method has been executed successfully.*\n\nTo verify, you can connect to the first address using Patron contract and check its balance. Well, that's going to be implemented in near future with all other cool features. \n\u003cbr\u003eThis was implemeted just to demonstrate successful use of Dashboard and Factory implementation. A fully functional dApp is coming soon, fingers crossed!\n\n## Extra information\nSome higher level concepts of Solidity programming has been used in the contracts above, to name some \n- **Multiple contract interactions** There are six contracts in total and all of these are woven together to make this application a fully functional project. In order to do that successfully contracts *inherit* from other contracts. You can spot the use of *abstract contracts* which are implemented using *is* keyword in Solidity. Example code snippet is below for reference:\n```JS\nconstructor(address _database) public {\n  database = PatronFactory(_database);\n}\n```\n- **Factory and Dashboard** implementation can be seen which makes the code quite functional in nature and gives the whole application a single entry point, avoiding hassle and making a single control point as the *Dashboard*. *Factory* here is used to enable deployment of multiple contract instances.\n- **Passing values to parent functions** Life isn't that easy when you're writing some Solidity code so passing value from one method to other is a crucial concept. The method below is payable but it is a proxy method so it has to send all ETH it has recieved to the real implementation of the donate method. Look how it is implemented:\n```JS\nfunction donateToArtist(uint _id) public payable {\n  Patron thisPatronInstance = database.getPatronDeploymentById(_id);\n  thisPatronInstance.donate.value(msg.value)();\n}\n```\n- **Clean dev documentation** - This may sound unimportant but as a developer I find it really crucial to document your code especially when it is for others to see or understand. Ideally, it should be slef explanatory but `@...` annotation and such documentation helps generate API docs encouraging clean code practices. \n\n## Do it yourself\nYou can deploy the Patron contract individually to use all of its functions. Given below is the function signature for all of its methods\n```JS\nfunction donate() public payable isDonationOpen {}\nfunction setStatus(bool _status) public onlyOwner {}\nfunction acceptedDonations() public view returns (uint256) {}\nfunction withdrawAll() public onlyOwner {}\nfunction withdrawSome(uint256 _value) public onlyOwner {}\nfunction withdrawToOtherAcc(address payable _recipient, uint256 _value) public onlyOwner {}\nfunction destroyAndSendTo(address payable _recipient) public onlyOwner {}\nfunction destroy() public onlyOwner {}\n```\n\n## See Also\nDocumentation ref: https://ethereumdev.io/inheritance-in-solidity/\n\n## Author\nShailendra Shukla, shailendra.shukla@georgebrown.ca\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshailscript%2Fpatron","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fshailscript%2Fpatron","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshailscript%2Fpatron/lists"}