{"id":13632895,"url":"https://github.com/hyperledger-labs/perun-eth-contracts","last_synced_at":"2025-04-18T05:33:33.015Z","repository":{"id":37726967,"uuid":"282061660","full_name":"hyperledger-labs/perun-eth-contracts","owner":"hyperledger-labs","description":"🌔 Perun's Ethereum State Channel Contracts","archived":false,"fork":false,"pushed_at":"2023-02-03T11:38:00.000Z","size":1278,"stargazers_count":9,"open_issues_count":19,"forks_count":5,"subscribers_count":8,"default_branch":"main","last_synced_at":"2024-08-01T22:54:51.348Z","etag":null,"topics":["blockchain","go","state-channels"],"latest_commit_sha":null,"homepage":"https://perun.network/","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/hyperledger-labs.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}},"created_at":"2020-07-23T21:44:18.000Z","updated_at":"2023-08-19T15:15:09.000Z","dependencies_parsed_at":"2023-02-13T21:01:01.292Z","dependency_job_id":null,"html_url":"https://github.com/hyperledger-labs/perun-eth-contracts","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hyperledger-labs%2Fperun-eth-contracts","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hyperledger-labs%2Fperun-eth-contracts/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hyperledger-labs%2Fperun-eth-contracts/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hyperledger-labs%2Fperun-eth-contracts/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hyperledger-labs","download_url":"https://codeload.github.com/hyperledger-labs/perun-eth-contracts/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":223775296,"owners_count":17200488,"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","go","state-channels"],"created_at":"2024-08-01T22:03:23.010Z","updated_at":"2025-04-18T05:33:33.001Z","avatar_url":"https://github.com/hyperledger-labs.png","language":"TypeScript","funding_links":[],"categories":["TypeScript"],"sub_categories":[],"readme":"\u003ch1 align=\"center\"\u003e\u003cbr\u003e\n  \u003ca href=\"https://perun.network/\"\u003e\u003cimg src=\".assets/logo.png\" alt=\"Perun\" width=\"196\"\u003e\u003c/a\u003e\n\u003cbr\u003e\u003c/h1\u003e\n\n\u003ch4 align=\"center\"\u003ePerun State Channels Framework - Ethereum Backend Smart Contracts\u003c/h4\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"https://codecov.io/gh/hyperledger-labs/perun-eth-contracts\"\u003e\u003cimg src=\"https://codecov.io/gh/hyperledger-labs/perun-eth-contracts/branch/main/graph/badge.svg?token=QXZH8MKQG5\" alt=\"Codecov\"\u003e\u003c/a\u003e\n  \u003ca href=\"https://www.apache.org/licenses/LICENSE-2.0.txt\"\u003e\u003cimg src=\"https://img.shields.io/badge/license-Apache%202-blue\" alt=\"License: Apache 2.0\"\u003e\u003c/a\u003e\n  \u003ca href=\"https://github.com/hyperledger-labs/perun-eth-contracts/actions/workflows/ci.yml\"\u003e\u003cimg src=\"https://github.com/hyperledger-labs/perun-eth-contracts/actions/workflows/ci.yml/badge.svg\" alt=\"Pipeline status\"\u003e\u003c/a\u003e\n\u003c/p\u003e\n\nThis repository contains the Ethereum smart contracts for [go-perun](https://github.com/hyperledger-labs/go-perun)'s Ethereum backend.\nAdditionally, it allows cross-chain swaps with the Stellar blockchain. It supports our [Soroban Contract](https://github.com/perun-network/perun-soroban-contract), utilizing EVM-compatible cryptography and encoding. Channel participants can have multiple addresses in the channel.\n\n## Security Disclaimer\nThe smart contracts presented in this directory are under active development and are not ready for production use.\nThe authors take no responsibility for any loss of digital assets or other damage caused by their use.\n\n## Contracts\nPerun's Generalized State Channels Framework uses a set of interconnected smart contracts to define the on-chain logic for channel deposits, disputes, settlements and withdrawals.\nFor more detailed information, check out the [documentation](https://labs.hyperledger.org/perun-doc/index.html).\n\n### Asset Holder\nAsset holders are singleton contracts that hold the assets for ledger channels.\nThey are deployed once per asset (ETH, ERC-20, ...) and are shared between all channels that reference the same Adjudicator contract for channel disputing and closing.\n\nDeposits are directly transferred to the Asset Holders.\nThe outcome of closed channels are set by the Adjudicator on the channel's asset holders.\nAfter the outcome has been set, channel participants can withdraw their assets from the asset holders, sending a Withdrawal Authorization that has to be signed by the respective channel participant.\n\n### Adjudicator\nThe Adjudicator contract is called to dispute or close a channel.\nIt interprets channel states and sets finalized channel outcomes on the asset holders.\n\n**Collaborative Close**\u0026emsp;\nAll channel participants can agree on a final state off-chain.\nIn this case they can settle a channel without waiting for any timeouts by calling `concludeFinal` on the Adjudicator.\nThe Adjudicator will set the outcome on the individual asset holders, ready for withdrawal.\n\n**Dispute**\u0026emsp;\nIn case of a channel dispute, any party can `register` their final state on the Adjudicator contract.\nAfter state registration, the other channel participants have the chance to `refute` the submitted state with a higher-version state during the challenge period.\nAfter the challenge period is over, the channel outcome can either be finalized on the asset holders by calling `conclude` or the app's state can be progressed on-chain by calling `progress`.\n\n### App Contracts\nState Channel apps define a single method, `validTransition`, which defines the app-specific state transition rules.\nWhen a channel state is progressed on-chain on the Adjudicator by calling `progress`, the Adjudicator reads the address of the channel app from the channel parameters and, after performing generic state progression checks, calls the `validTransition` method on the app.\nIt is assumed to revert if any app-specific check fails.\n\n## Testing\nThe repository must be cloned recursively including [submodules](https://git-scm.com/book/en/v2/Git-Tools-Submodules).\n[Yarn](https://yarnpkg.com) and [Hardhat](https://hardhat.org/hardhat-runner/docs/getting-started) are expected to be installed globally.\nTo run the tests, run\n```sh\n$ yarn\n$ yarn build\n$ yarn test\n```\n\n## Copyright\nCopyright 2025 - See [NOTICE](NOTICE) file for copyright holders.\nUse of the source code is governed by the Apache 2.0 license that can be found in the [LICENSE file](LICENSE).\n\nContact us at [info@perun.network](mailto:info@perun.network).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhyperledger-labs%2Fperun-eth-contracts","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhyperledger-labs%2Fperun-eth-contracts","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhyperledger-labs%2Fperun-eth-contracts/lists"}