{"id":31106059,"url":"https://github.com/bright/bright-disputes","last_synced_at":"2026-08-04T01:31:42.107Z","repository":{"id":179167956,"uuid":"647166128","full_name":"bright/bright-disputes","owner":"bright","description":null,"archived":false,"fork":false,"pushed_at":"2024-03-22T12:40:59.000Z","size":3072,"stargazers_count":1,"open_issues_count":1,"forks_count":0,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-04-07T02:38:13.598Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Rust","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/bright.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}},"created_at":"2023-05-30T07:46:27.000Z","updated_at":"2023-07-09T01:47:54.000Z","dependencies_parsed_at":"2023-09-23T13:02:50.233Z","dependency_job_id":"9897fa25-8404-4020-986b-ff7eb9cc63fb","html_url":"https://github.com/bright/bright-disputes","commit_stats":null,"previous_names":["bright/bright-disputes"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/bright/bright-disputes","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bright%2Fbright-disputes","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bright%2Fbright-disputes/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bright%2Fbright-disputes/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bright%2Fbright-disputes/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bright","download_url":"https://codeload.github.com/bright/bright-disputes/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bright%2Fbright-disputes/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":275537152,"owners_count":25482345,"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","status":"online","status_checked_at":"2025-09-17T02:00:09.119Z","response_time":84,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":[],"created_at":"2025-09-17T04:52:47.110Z","updated_at":"2025-09-17T04:52:48.914Z","avatar_url":"https://github.com/bright.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Bright Disputes\nThis project is a dApp for raising and solving the disputes on the Substrate-based blockchains. Process of building and running smart contract can be found in the sections bellow. Showcase scenario can be found in the [documentation](https://github.com/bright/bright-disputes/blob/main/doc/README.md).\n\n## Prerequisites\n1. `cargo-contract 3.0.1`\n2. `ink-wrapper 0.5.0`\n3. `rustc-1.69`\n4. `jq`\n\nBefore running anything, please update submodules.\n```\ngit submodule update --init --recursive\n```\n## Build (manually)\nBright Disputes is actually a smart contract and a CLI, which allows to execute commands on the Substrate node. In this section we will present how to manually build them.\n\n### Building smart contract\nTo build a smart contract locally we can run:\n```\ncargo contract build --release --manifest-path contract/Cargo.toml\n```\nThis call will generate files:\n```\ncontract/target/ink/bright_disputes.json\ncontract/target/ink/bright_disputes.wasm\ncontract/target/ink/bright_disputes.contract\n```\nand they can be deployed on the node.\n\n### Building CLI\nFollow the instructions from the [README](https://github.com/bright/bright-disputes/blob/main/cli/README.md). file.\n\n## Build (docker)\nSmart contract can be build with the Docker:\n```\nDOCKER_BUILDKIT=1 docker build -f docker/Dockerfile --output artifacts . \n```\nThis will export *bright_disputes.json*, *bright_disputes.wasm*, *bright_disputes.contract*, to the *artifacts* directory.\n\n## Build (script)\nThe last way to build and run Bright Disputes is to use a script. We simplify the whole process, by providing a `scripts/deploy.sh` script. It will starts aleph node, building and deploying smart contract on it. Script will also pre-fund [accounts](https://github.com/bright/bright-disputes/blob/main/doc/accounts), which can be used to play/test with the smart contract. More details can be found in the [showcase](https://github.com/bright/bright-disputes/blob/main/doc/README.md). Script is using three docker images:\n* disputes-node - is an image of the aleph node, where our smart contract is going to be deployed\n* disputes-cliain - is a image of `cliain` tool, which is a wrapper over `substrate-api-client` library. It simplify calls over Substrate chain extrinsic.\n* disputes-ink-dev - this image contains environment for building a smart contract\n\nTo run a script just type:\n```\nbash scripts/deploy.sh\n```\n\nPlease note, that this script is based on the [deploy.sh](https://github.com/Cardinal-Cryptography/zk-apps/blob/main/shielder/deploy/deploy.sh) created by the Cardinal-Cryptography.\n\n## Running UI\nTo run a UI, please follow the instructions from the [README](./ui/README.md) file in ui folder.\n\n## Tests\nTo run a unit test:\n```\ncargo test --release --manifest-path contract/Cargo.toml\n```\nor with docker:\n```\ndocker build -f docker/Dockerfile.testing --progress=plain .\n```\n\n## E2E tests\nCurrently, we have four major tests for testing different endings of the dispute:\n* No majority of votes.\n* Verdict against the owner of the dispute.\n* Verdict against the defendant of the dispute.\n* Testing dispute rounds.\n\nTo run E2E tests on your local machine, first run a aleph-node, build and deploy smart contract. We can do it, by running `deploy.sh` script:\n```\nbash scripts/deploy.sh\n```\n\nNext we need to use [ink-wrapper](https://crates.io/crates/ink-wrapper) tool to generate a type-safe code for calling smart contract from our e2e tests:\n```\ncd tests\nink-wrapper -m ../contract/target/ink/bright_disputes.json --wasm-path ../contract/target/ink/bright_disputes.wasm | rustfmt +nightly --edition 2021 \u003e bright_disputes.rs\n```\n\nFinally we can run a e2e tests by calling:\n```\ncargo +nightly-2023-04-19 test --release\n```\n\nThe output of the e2e test is:\n```\ntest bright_disputes_test::test_dispute_verdict_none ... ok\ntest bright_disputes_test::test_dispute_verdict_positive ... ok\ntest bright_disputes_test::test_dispute_verdict_negative ... ok\ntest bright_disputes_test::test_dispute_rounds ... ok\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbright%2Fbright-disputes","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbright%2Fbright-disputes","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbright%2Fbright-disputes/lists"}