{"id":22619621,"url":"https://github.com/devalpha18/xfund-vor","last_synced_at":"2025-03-29T02:09:26.302Z","repository":{"id":246308245,"uuid":"584717188","full_name":"devalpha18/xfund-vor","owner":"devalpha18","description":"A suite of Ethereum smart contracts, and accompanying Provider Oracle software for running VOR, and integrating VOR into your own smart contracts.","archived":false,"fork":false,"pushed_at":"2023-01-03T10:35:11.000Z","size":1051,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-03T11:51:11.642Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://vor.unification.io","language":"Go","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/devalpha18.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-01-03T10:34:40.000Z","updated_at":"2024-06-27T01:57:46.000Z","dependencies_parsed_at":"2024-06-27T05:19:44.684Z","dependency_job_id":null,"html_url":"https://github.com/devalpha18/xfund-vor","commit_stats":null,"previous_names":["devalpha18/xfund-vor"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devalpha18%2Fxfund-vor","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devalpha18%2Fxfund-vor/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devalpha18%2Fxfund-vor/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devalpha18%2Fxfund-vor/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/devalpha18","download_url":"https://codeload.github.com/devalpha18/xfund-vor/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246126696,"owners_count":20727594,"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":[],"created_at":"2024-12-08T22:06:40.890Z","updated_at":"2025-03-29T02:09:26.280Z","avatar_url":"https://github.com/devalpha18.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![GitHub release (latest by date)](https://img.shields.io/github/v/release/unification-com/xfund-vor?label=oracle%20version)](https://github.com/unification-com/xfund-vor/releases/latest)\n[![npm](https://img.shields.io/npm/v/@unification-com/xfund-vor?label=smart%20contract%20version%20%28npm%29)](https://www.npmjs.com/package/@unification-com/xfund-vor)\n![sc unit tests](https://github.com/unification-com/xfund-vor/actions/workflows/test-contracts.yml/badge.svg)\n\n# Verified Open Randomness\n\nA suite of Ethereum smart contracts, and accompanying Provider Oracle software\nfor running VOR, and integrating VOR into your own smart contracts.\n\n## VOR Integration Quickstart\n\n1. Install the package\n\n```bash\nyarn add @unification-com/xfund-vor\n```\n\nor\n\n```bash\nnpm i @unification-com/xfund-vor\n```\n\n2. Import `VORConsumerBase.sol` into your contract and pass\n   parameters to your `constructor`\n\n```solidity\nimport \"@unification-com/xfund-vor/contracts/VORConsumerBase.sol\";\n\ncontract MyRandomNumberContract is VORConsumerBase {\n    constructor(address _vorCoordinator, address _xfund)\n    public VORConsumerBase(_vorCoordinator, _xfund) {\n        // other stuff...\n    }\n}\n```\n\n3. Implement a `requestRandomness` function\n\n```solidity\n    function requestRandomness(uint256 _userProvidedSeed, bytes32 _keyHash, unit256 _fee) \n    external\n    returns (bytes32 requestId) {\n        requestId = requestRandomness(_keyHash, _fee, _userProvidedSeed);\n        // other stuff...\n    }\n```\n\n4. Implement the `fulfillRandomness` function for data Providers to send data\n\n```solidity\n    function fulfillRandomness(bytes32 requestId, uint256 randomness) internal override {\n        // do something with the received number\n        uint256 randVal = randomness.mod(999).add(1);\n        // other stuff...\n    }\n```\n\n## Development and Testing\n\nClone of fork\n\n```bash\ngit clone https://github.com/unification-com/xfund-vor\nnpx truffle compile\n```\n\n### Dev Environment\n\nA complete Dockerised development environment is available, which is useful for both\ncontributing to the development of VOR and when developing your own VOR-enabled smart\ncontracts.\n\nThe development environment can be run using:\n\n```bash\nmake dev-env\n```\n\nAlternatively, run the docker commands as follows:\n\n```bash\ndocker build -t vor_dev_env -f docker/dev.Dockerfile .\ndocker run -it -p 8545:8545 -p 8445:8445 vor_dev_env\n```\n\nThe environment will:\n\n1. Spawn a deterministic `ganach-cli` development chain with 20 accounts funded with 100 ETH\n2. Compile and deploy the necessary VOR smart contracts\n3. Initialise the test accounts, send test tokens and register the Oracle's proving key\n4. Run the `oracle` application\n\nThe container exposes port `8545` allowing the Ganache chain to be accessible\nvia http://127.0.0.1:8545\n\nAdditionally, port `8445` is exposed, allowing the oracle to be accessed using the `oracle-cli`\ntool.\n\n#### Dev environment configuration\n\n- Ganache CLI wallet mnemonic: `myth like bonus scare over problem client lizard pioneer submit female collect`\n- Ganache CLI URL: `http://127.0.0.1:8545`\n- Ganache CLI Network/Chain ID: `696969`\n- VORCoordinator Contract address: `0xCfEB869F69431e42cdB54A4F4f105C19C080A601`\n- BlockHashStore contract address: `0x5b1869D9A4C187F2EAa108f3062412ecf0526b24`\n- VOR Oracle Wallet Address: `0xFFcf8FDEE72ac11b5c542428B35EEF5769C409f0`\n- VOR Oracle KeyHash: `0x1a7a24165e904cb38eb8344affcf8fdee72ac11b5c542428b35eef5769c409f0`\n- VOR Oracle API key: `0pear3uoznba36fwzoaspwrvc164bkjd`\n\n### `oraclecli` in the Dev environment\n\nYou will need to build the tool:\n\n```bash\nmake build-oracle-cli\n```\n\nThe `oracle-cli` commands should now be available when the dev environment is running, for example:\n\n```bash\n./oracle-cli/build/oraclecli about -c ./docker/assets/oracle-cli_settings.json\n```\n\n**Note**: you will need to pass the `-c ./docker/assets/oracle-cli_settings.json` flag\nwith each command in order to use the correct connection settings.\n\n### Unit Testing\n\nRun smart contract tests:\n\n```bash\nyarn test\n```\n\nRun `oracle` tests:\n\n```bash\nmake test-oracle\n```\n\nThis will run the `go` tests in a self-contained, dockerised environment. A Ganache\nnetwork will be run within the container for the tests to run against.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdevalpha18%2Fxfund-vor","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdevalpha18%2Fxfund-vor","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdevalpha18%2Fxfund-vor/lists"}