{"id":31534092,"url":"https://github.com/ambiretech/adex-protocol-eth","last_synced_at":"2025-10-04T05:17:21.319Z","repository":{"id":38298970,"uuid":"149938490","full_name":"AmbireTech/adex-protocol-eth","owner":"AmbireTech","description":"Ethereum implementation of the Ambire Protocol: Ambire Wallet contracts and AdEx payment channels","archived":false,"fork":false,"pushed_at":"2025-03-20T17:24:42.000Z","size":9808,"stargazers_count":54,"open_issues_count":24,"forks_count":30,"subscribers_count":7,"default_branch":"master","last_synced_at":"2025-08-09T01:03:53.336Z","etag":null,"topics":["adex","advertising","defi","ethereum","metatx","payment-channels","smart-wallet","solidity","state-channels","wallet","walletconnect"],"latest_commit_sha":null,"homepage":"https://www.ambire.com","language":"JavaScript","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/AmbireTech.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":"audits/Ambire Contest — Code 423n4.pdf","citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-09-23T01:29:13.000Z","updated_at":"2025-03-20T17:24:46.000Z","dependencies_parsed_at":"2024-04-29T15:47:55.510Z","dependency_job_id":"cebceb8d-8c73-4176-9eeb-77f96b0ed466","html_url":"https://github.com/AmbireTech/adex-protocol-eth","commit_stats":{"total_commits":1265,"total_committers":20,"mean_commits":63.25,"dds":"0.11067193675889331","last_synced_commit":"18c581cd4a205e1e5f917b9c9c597100ccbe698c"},"previous_names":["adexnetwork/adex-protocol-eth"],"tags_count":36,"template":false,"template_full_name":null,"purl":"pkg:github/AmbireTech/adex-protocol-eth","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AmbireTech%2Fadex-protocol-eth","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AmbireTech%2Fadex-protocol-eth/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AmbireTech%2Fadex-protocol-eth/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AmbireTech%2Fadex-protocol-eth/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/AmbireTech","download_url":"https://codeload.github.com/AmbireTech/adex-protocol-eth/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AmbireTech%2Fadex-protocol-eth/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":278266896,"owners_count":25958733,"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-10-04T02:00:05.491Z","response_time":63,"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":["adex","advertising","defi","ethereum","metatx","payment-channels","smart-wallet","solidity","state-channels","wallet","walletconnect"],"created_at":"2025-10-04T05:17:18.544Z","updated_at":"2025-10-04T05:17:21.310Z","avatar_url":"https://github.com/AmbireTech.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# adex-protocol-eth\n\nThe Ethereum implementation of the [AdEx Protocol](https://github.com/AdExNetwork/adex-protocol).\n\nThis replaces [adex-core](https://github.com/AdExNetwork/adex-core).\n\nThis repository implements [OUTPACE](https://github.com/AdExNetwork/adex-protocol/blob/master/OUTPACE.md) (off-chain unidirectional trustless payment channel) and a gas abstraction layer called [AdEx Identity](https://github.com/AdExNetwork/adex-protocol/issues/10).\n\n### Please note\n\n* Every channel will eventually expire (after `validUntil`), allowing the non-withdrawn portion of the initial deposit to be received back by whoever opened the channel.\n* Channels can be created with any ERC20 token; if the underlying token of a channel is insecure or malicious, that also compromises the channel as well; this is out of scope of this contract, since this is a fundamental issue with any system that uses ERC20s; needless to say, the user needs to be aware of what token they're using/earning\n* For more details on how OUTPACE channels work, please read the specs: [AdEx Protocol](https://github.com/AdExNetwork/adex-protocol) and [OUTPACE](https://github.com/AdExNetwork/adex-protocol/blob/master/OUTPACE.md).\n\n## Testing\n\nFirst, run `ganache-cli` in a separate terminal\n\n```\ntruffle build # This is important cause js/IdentityProxyDeploy uses artifacts from there\nnpm test\n```\n\n## Deployment\n\nThe contract `AdExCore` from version v3.1.0, compiled with solc v0.5.6 is deployed here:\n\n* Mainnet: https://etherscan.io/address/0x333420fc6a897356e69b62417cd17ff012177d2b\n* Goerli: https://goerli.etherscan.io/address/0x333420fc6a897356e69b62417cd17ff012177d2b\n* Kovan: https://kovan.etherscan.io/address/0x333420fc6a897356e69b62417cd17ff012177d2b\n\nAn `Identity`, initialized with no privileges, to be used as a basis for `IdentityProxy`:\n\n* Mainnet: https://etherscan.io/address/0xbdf97b0f5fa78beae684d9fb67dd45f11b996e46\n* Goerli: https://goerli.etherscan.io/address/0xbdf97b0f5fa78beae684d9fb67dd45f11b996e46\n\nAn `IdentityFactory`, set up with the AdEx relayer:\n\n* Mainnet: https://etherscan.io/address/0x801dbbb2fcbf9f4c3865c6ba5c5012ee19ec283a\n* Goerli: https://goerli.etherscan.io/address/0x801dbbb2fcbf9f4c3865c6ba5c5012ee19ec283a\n\nAnd the `Registry` (now obsolete, no longer used):\n\n* Mainnet: https://etherscan.io/address/0x7671db0a70fa0196071d634f26971b9371627dc0\n* Goerli: https://goerli.etherscan.io/address/0x7671db0a70fa0196071d634f26971b9371627dc0\n\n### v4.1\n\nAll contracts here were compiled with solc v0.5.13.\n\nThe `Identity`, initialized with no privileges, to be used as a basis for `IdentityProxy`:\n\n* Mainnet: https://etherscan.io/address/0x96e3cb4b4632ed45363ff2c9f0fbec9b583d9d3a\n* Goerli: https://goerli.etherscan.io/address/0x96e3cb4b4632ed45363ff2c9f0fbec9b583d9d3a\n\nAn `IdentityFactory`, set up with the AdEx relayer:\n\n* Mainnet: https://etherscan.io/address/0xd5a1c8a5ea507ea459216ff34939cae3326dba6f\n* Goerli: https://goerli.etherscan.io/address/0xd5a1c8a5ea507ea459216ff34939cae3326dba6f\n\nAnd the `Staking`:\n\n* Mainnet (ADX token and the AdEx multisig as slasher): https://etherscan.io/address/0x46ad2d37ceaee1e82b70b867e674b903a4b4ca32\n* Goerli (TST token and creator as a slasher): https://goerli.etherscan.io/address/0x46ad2d37ceaee1e82b70b867e674b903a4b4ca32\n\n### v4.2\n\nThe `ADXSupplyController` contract:\n\n* Mainnet: https://etherscan.io/address/0x360625ba7bce57f74eb5501fd2b75db8f85a85d8\n* Goerli: https://goerli.etherscan.io/address/0x360625ba7bce57f74eb5501fd2b75db8f85a85d8\n\nThe `ADXToken` contract:\n\n* Mainnet: https://etherscan.io/address/0xade00c28244d5ce17d72e40330b1c318cd12b7c3\n* Goerli: https://goerli.etherscan.io/address/0xade00c28244d5ce17d72e40330b1c318cd12b7c3\n\nAn instance of `IdentityFactory` used for staking:\n\n* Mainnet: https://etherscan.io/address/0x9fe0d438e3c29c7cff949ad8e8da9403a531cc1a\n* Goerli: https://goerli.etherscan.io/address/0x9fe0d438e3c29c7cff949ad8e8da9403a531cc1a\n\nThe `Staking` contract:\n* Mainnet (ADX token and the AdEx multisig as slasher): https://etherscan.io/address/0x4846c6837ec670bbd1f5b485471c8f64ecb9c534\n* Goerli (TST token and creator as a slasher): https://goerli.etherscan.io/address/0x4846c6837ec670bbd1f5b485471c8f64ecb9c534\n\nThe `ADXFlashLoans` contract:\n* Mainnet: https://etherscan.io/address/0xae4c306ce6641e1276c57473f2c2953841f0856a\n* Goerli: https://goerli.etherscan.io/address/0xae4c306ce6641e1276c57473f2c2953841f0856a\n\nThe `ADXLoyaltyPoolToken` contract:\n* Mainnet: https://etherscan.io/address/0xd9a4cb9dc9296e111c66dfacab8be034ee2e1c2c\n* Goerli: https://goerli.etherscan.io/address/0xd9a4cb9dc9296e111c66dfacab8be034ee2e1c2c\n\nThe `ADXLoyaltyPoolIncentiveController` contract:\n* Mainnet: https://etherscan.io/address/0xc1aeC6a718c16698D14e9f4d88d2268ae8B04e71\n* Goerli: https://goerli.etherscan.io/address/0xc1aeC6a718c16698D14e9f4d88d2268ae8B04e71\n\n**Not a base contract, but closely related to those systems.** Reward distributor Identity:\n* Mainnet: https://etherscan.io/address/0xe3C19038238De9bcc3E735ec4968eCd45e04c837\n\n\n### v5\n\nThe `SupplyController` contract:\n\n* Mainnet: https://mainnet.etherscan.io/address/0x617e6f354d288fcb33e148b1bb6d2cc9be1f7695\n* Goerli: https://goerli.etherscan.io/address/0x617e6f354d288fcb33e148b1bb6d2cc9be1f7695\n\nNew V5 `SupplyController` (increased cap to account for the to-be burned staking migration ADX):\n\n* Mainnet: https://etherscan.io/address/0x9d47f1c6ba4d66d8aa5e19226191a8968bc9094e\n* Goerli: https://goerli.etherscan.io/address/0x9d47f1c6ba4d66d8aa5e19226191a8968bc9094e\n\nNew V5 `SupplyController` (increased cap to account for the governance-induced burn):\n* Mainnet: https://etherscan.io/address/0x515629338229dd5f8cea3f4f3cc8185ba21fa30b\n\nNew V5 `SupplyController` (increase cap again to account for governance-induced burn):\n* Mainnet: https://etherscan.io/address/0xD4628FA47AAe2d0f4c8a204f36c2d93AA8dc31F5 \n\nNew V5 `SupplyController` (increase cap again to account for governance-induced burn by discounting treasury tokens):\n* Mainnet: https://etherscan.io/address/0x9B370599B2bf61806DDca1379257F26377472BEe\n* Was later updated by setting the incentive rate on 05 Feb 2024 following another halving governance vote\n\nStakingPool:\n\n* Mainnet: https://etherscan.io/address/0xb6456b57f03352be48bf101b46c1752a0813491a\n* Goerli: https://goerli.etherscan.io/address/0xb6456b57f03352be48bf101b46c1752a0813491a\n\nStakingMigrator:\n* Mainnet: https://etherscan.io/address/0x27851df171c419a8e05cac7d7b45a9fa72b0a07c\n* Goerli: https://goerli.etherscan.io/address/0x27851df171c419a8e05cac7d7b45a9fa72b0a07c\n\nGaslessSweeper:\n* Mainnet: https://etherscan.io/address/0x872e239332d13d6b29bf58283906d92fb2a7209b#code\n* Goerli: https://goerli.etherscan.io/address/0x872e239332d13d6b29bf58283906d92fb2a7209b#code\n\n### Wallet (first demo)\n\n`IdentityFactory` contract:\n* Mainnet: https://etherscan.io/address/0x50484176F62bc7B5c5F24Db12ce0508c514D0C07\n* Goerli: https://goerli.etherscan.io/address/0x50484176F62bc7B5c5F24Db12ce0508c514D0C07\n* Polygon: https://polygonscan.com/address/0x50484176F62bc7B5c5F24Db12ce0508c514D0C07\n* Binance Smart Chain: https://bscscan.com/address/0x50484176F62bc7B5c5F24Db12ce0508c514D0C07\n\n`Identity` contract:\n* Mainnet: https://etherscan.io/address/0x90012067C3254Af79E19D3c08e6c28Ae5Af8dAEC\n* Goerli: https://goerli.etherscan.io/address/0x90012067C3254Af79E19D3c08e6c28Ae5Af8dAEC\n* Polygon: https://polygonscan.com/address/0x90012067C3254Af79E19D3c08e6c28Ae5Af8dAEC\n* Binance Smart Chain: https://bscscan.com/address/0x90012067C3254Af79E19D3c08e6c28Ae5Af8dAEC\n\n\n### Ambire Wallet\n\n* Factory: 0xBf07a0Df119Ca234634588fbDb5625594E2a5BCA\n* Base identity: 0x2A2b85EB1054d6f0c6c2E37dA05eD3E5feA684EF\n* QuickAccManager: 0xfF3f6D14DF43c112aB98834Ee1F82083E07c26BF\n* Batcher: 0x460fad03099f67391d84c9cc0ea7aa2457969cea\n\nSame addresses on Ethereum, Polygon, BSC, Fantom, Arbitrum, Avalanche, Moonbeam, Moonriver, Cronos, Metis, Gnosis Chain (formerly xDAI), NEAR Aurora\n\n### Deployment\n\n```\ntruffle migrate --network mainnet\ntruffle migrate --network polygon\ntruffle migrate --network bsc\n```\n\n### Verifying on etherscan\n\n```\ntruffle compile\ncat build/contracts/AdExCore.json | jq '.bytecode' # this is the bytecode you have to deploy\n./scripts/bundle.sh contracts/AdExCore.sol # this will output a bundled .sol code\n```\n\n### Gas usage, from the tests\n\nMeasured with solc v0.5.6, commit d80fa80424ef7b8932399424f8d919d67b135a30\n\n```\nchannelOpen: 69961\nchannelWithdrawExpired: 70470\nchannelWithdraw: 137117\nexecute: 89900\nexecRoutines: 114440\nchannelOpen, through execute: 115086\ndeploying an identity proxy through the IdentityFactory: 127549\naddBond  73404\nrequestUnbond  34807\nunbond  41770\n```\n\n\n### ENS\n\nThis is not a part of the adex-protocol-eth source code, but it may be useful for anyone building on top of adex-protocol-eth who wishes to integrate with ENS.\n\n* ENS Contract mainnet address: 0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e\n* ENS PublicResolve mainnet address: 0x226159d592E2b063810a10Ebf6dcbADA94Ed68b8\n* adex.eth node hash: 0x4e4e818e9467df5c5d1f8c399b11acc73ea24ad69e9c8e1ba6e5784a302c47d4\n* adex.eth subdomain registrar (adex.eth controller), compiled with solc v0.5.6: [0x7bc082552b1a195813ddb500600ce2b544d579cb](https://etherscan.io/address/0x7bc082552b1a195813ddb500600ce2b544d579cb)\n\n## Code style and design principles\n\n* Minimalistic use of smart contracts in general\n   * Avoid putting logic in SCs if it's outcome is controlled by a single entity anyway\n   * Do not add complexity and centralization to address various \"what ifs\" that should be addressed off-chain, e.g. \"what if users send tokens to this contract by accident\"\n* Detailed tests for every contract\n* No Solidity warnings allowed\n* No modifiers allowed\n* No use of inheritance for core contracts; inheritance is permitted for deployless contracts\n* No reentrancy guards allowed, instead we use the Checks-Effects-Interactions pattern\n* All `require`s should have an error message\n* No `delegatecall` upgradability; upgradability is achieved via off-chain social consensus\n* No emergency stops or pausability: it dilutes the value of smart contracts\n\n## Audits\n\n* [G0 Group](https://github.com/g0-group/Audits/blob/master/AdExNetwork.md): all issues discovered were of Low severity, and all were resolved\n* [Sigma Prime](https://github.com/sigp/public-audits/blob/master/adex/review.pdf): 4 issues discovered with \"Informational\" severity, all resolved\n* [G0 Group, Staking contract](https://github.com/g0-group/Audits/blob/master/G0Group-AdExStaking.pdf): all issues discovered were resolved\n* [Forkway, ADXToken](https://github.com/AdExNetwork/adex-protocol-eth/blob/master/audits/Forkway_ADXToken_audit.pdf): all issues discovered were informational and resolved\n* [Forkway, ADXLoyaltyPoolToken](https://github.com/AdExNetwork/adex-protocol-eth/blob/master/audits/forkway-loyalty-pool.md): all issues discovered were resolved\n* [CodeArena](https://github.com/AmbireTech/adex-protocol-eth/blob/master/audits/Ambire%20Contest%20%E2%80%94%20Code%20423n4.pdf) (_view report [on CodeArena's website](https://code423n4.com/reports/2021-10-ambire/)_): all issues discovered were patched\n\n## Integration guide: Identity v5.2\n\n### EIP 1271 `isValidSignature` doesn't work until deployed\n\nSince `isValidSignature` relies on calling the Identity contract through `eth_call`, we need that said Identity contract (proxy) is deployed. With the relayer, this is not true until the first transaction, due to the counterfactual deployment.\n\ndApps can actually work around this by asking the user to deploy the proxy first.\n\n## Credits\n\n* @BrendanChou for SafeERC20: https://gist.github.com/BrendanChou/88a2eeb80947ff00bcf58ffdafeaeb61\n* @decanus for SignatureValidator\n* @ConnextProject for `merkletree.js`\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fambiretech%2Fadex-protocol-eth","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fambiretech%2Fadex-protocol-eth","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fambiretech%2Fadex-protocol-eth/lists"}