{"id":20376936,"url":"https://github.com/xjonathanlei/eosyield","last_synced_at":"2025-06-24T19:46:32.475Z","repository":{"id":40568529,"uuid":"143675979","full_name":"xJonathanLEI/eosyield","owner":"xJonathanLEI","description":"A contract whose owner can temporaily yield control over it until a later time","archived":false,"fork":false,"pushed_at":"2022-01-18T21:14:05.000Z","size":11,"stargazers_count":21,"open_issues_count":0,"forks_count":10,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-06-20T17:08:48.071Z","etag":null,"topics":["blockchain","eos","immutability","smart-contracts"],"latest_commit_sha":null,"homepage":null,"language":"C++","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/xJonathanLEI.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}},"created_at":"2018-08-06T04:21:53.000Z","updated_at":"2025-02-27T16:41:17.000Z","dependencies_parsed_at":"2022-08-27T02:56:58.176Z","dependency_job_id":null,"html_url":"https://github.com/xJonathanLEI/eosyield","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/xJonathanLEI/eosyield","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xJonathanLEI%2Feosyield","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xJonathanLEI%2Feosyield/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xJonathanLEI%2Feosyield/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xJonathanLEI%2Feosyield/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/xJonathanLEI","download_url":"https://codeload.github.com/xJonathanLEI/eosyield/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xJonathanLEI%2Feosyield/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":261745439,"owners_count":23203392,"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":["blockchain","eos","immutability","smart-contracts"],"created_at":"2024-11-15T01:40:03.026Z","updated_at":"2025-06-24T19:46:32.439Z","avatar_url":"https://github.com/xJonathanLEI.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# EOS Yield Contract\n\nThis contract demostrates how an EOS contract can be made immutable in a given period of time, without losing mutability forever. Such a mechanism guarantees immutability when trustlessness is necessary, with code changes possible with prior notice to users.\n\nThe intent of this contract is explained in [this reddit post](https://www.reddit.com/r/eos/comments/94zoch/demo_contract_for_temporary_immutability/).\n\n## Powered by EOS Yield\n\nThe following dApps feature implementation of the Temporary Immutability pattern proposed by this contract:\n\n- [Final Noob](https://github.com/erikajung/finalnoobcryptogame): A decentralized EOS game.\n\n- [DeltaDex](https://deltadex.io): A fully on-chain decentralized exchange.\n\n## Clone and Compile\n\nTo clone the repository and compile the contract into binary:\n\n    $ git clone https://github.com/xJonathanLEI/eosyield.git\n    $ cd eosyield\n    $ eosiocpp -o eosyield.wast eosyield.cpp\n    $ eosiocpp -g eosyield.abi eosyield.cpp\n\nThree files: `eosyield.wast`, `eosyield.wasm` and `eosyield.abi` will be generated after compilation succeeds.\n\n## Contract Setup\n\nTo test the contract, first set up a contract account, say `yield`:\n\n    $ cleos system newaccount --buy-ram \"1000.0000 SYS\" --stake-net \"100.0000 SYS\" --stake-cpu \"100.0000 SYS\" eosio yield YOUR_PUBLIC_KEY;\n\nPublish the contract:\n\n    $ cleos set contract yield /path/to/contract/folder;\n\nGive account `owner` permission to `eosio.code` permission so that the contract itself can modify its own permission settings:\n\n    $ cleos set account permission yield owner '{\"threshold\": 1,\"keys\": [{\"key\": \"YOUR_PUBLIC_KEY\",\"weight\": 1}],\"accounts\": [{\"permission\":{\"actor\":\"yield\",\"permission\":\"eosio.code\"},\"weight\":1}]}' -p yield@owner;\n\nSet the owner to be your account (`jonathan` here):\n\n    $ cleos push action yield setowner '[\"jonathan\"]' -p yield@owner;\n\nTo yield control on the contract:\n\n    $ cleos push action yield yieldcontrol '[60]' -p jonathan;\n\nIf you check permission now, you would see the contract code would be the sole owner of itself:\n\n    $ cleos get account yield;\n\nCheck the yield info from database:\n\n    $ cleos get table yield yield yieldinfo;\n\nTo extend the yield period:\n\n    $ cleos push action yield extend '[120]' -p jonathan;\n\nTo regain control after the expiration is reached:\n\n    $ cleos push action yield regain '' -p jonathan;\n\n## License\n\nThis EOS contract is licensed under the MIT license.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxjonathanlei%2Feosyield","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fxjonathanlei%2Feosyield","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxjonathanlei%2Feosyield/lists"}