The Ethereum implementation of the AdEx Protocol.
This replaces adex-core.
This repository implements OUTPACE (off-chain unidirectional trustless payment channel) and a gas abstraction layer called AdEx Identity.
- 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. - 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 ERC20's; needless to say, the user needs to be aware of what token they're using/earning
- For more details on how OUTPACE channels work, please read the specs: AdEx Protocol and OUTPACE.
First, run ganache-cli
in a separate terminal
truffle build # This is important cause js/IdentityProxyDeploy uses artifacts from there
npm test
The contract AdExCore
from version v3.1.0, compiled with solc v0.5.6 is deployed here:
- Mainnet: https://etherscan.io/address/0x333420fc6a897356e69b62417cd17ff012177d2b
- Goerli: https://goerli.etherscan.io/address/0x333420fc6a897356e69b62417cd17ff012177d2b
- Kovan: https://kovan.etherscan.io/address/0x333420fc6a897356e69b62417cd17ff012177d2b
An Identity
, initialized with no privileges, to be used as a basis for IdentityProxy
:
- Mainnet: https://etherscan.io/address/0xbdf97b0f5fa78beae684d9fb67dd45f11b996e46
- Goerli: https://goerli.etherscan.io/address/0xbdf97b0f5fa78beae684d9fb67dd45f11b996e46
An IdentityFactory
, set up with the AdEx relayer:
- Mainnet: https://etherscan.io/address/0x801dbbb2fcbf9f4c3865c6ba5c5012ee19ec283a
- Goerli: https://goerli.etherscan.io/address/0x801dbbb2fcbf9f4c3865c6ba5c5012ee19ec283a
And the Registry
(now obsolete, no longer used):
- Mainnet: https://etherscan.io/address/0x7671db0a70fa0196071d634f26971b9371627dc0
- Goerli: https://goerli.etherscan.io/address/0x7671db0a70fa0196071d634f26971b9371627dc0
All contracts here were compiled with solc v0.5.13.
The Identity
, initialized with no privileges, to be used as a basis for IdentityProxy
:
- Mainnet: https://etherscan.io/address/0x96e3cb4b4632ed45363ff2c9f0fbec9b583d9d3a
- Goerli: https://goerli.etherscan.io/address/0x96e3cb4b4632ed45363ff2c9f0fbec9b583d9d3a
An IdentityFactory
, set up with the AdEx relayer:
- Mainnet: https://etherscan.io/address/0xd5a1c8a5ea507ea459216ff34939cae3326dba6f
- Goerli: https://goerli.etherscan.io/address/0xd5a1c8a5ea507ea459216ff34939cae3326dba6f
And the Staking
:
- Mainnet (ADX token and the AdEx multisig as slasher): https://etherscan.io/address/0x46ad2d37ceaee1e82b70b867e674b903a4b4ca32
- Goerli (TST token and creator as a slasher): https://goerli.etherscan.io/address/0x46ad2d37ceaee1e82b70b867e674b903a4b4ca32
The full deploy processis as follows
- Deploy AdExCore
- Deploy an IdentityFactory
- Deploy a single Identity, with no owners and no registry
- Deploy a Staking
truffle compile
cat build/contracts/AdExCore.json | jq '.bytecode' # this is the bytecode you have to deploy
./scripts/bundle.sh contracts/AdExCore.sol # this will output a bundled .sol code
Measured with solc v0.5.6, commit d80fa80424ef7b8932399424f8d919d67b135a30
channelOpen: 69961
channelWithdrawExpired: 70470
channelWithdraw: 137117
execute: 89900
execRoutines: 114440
channelOpen, through execute: 115086
This 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.
- ENS Contract mainnet address: 0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e
- ENS PublicResolve mainnet address: 0x226159d592E2b063810a10Ebf6dcbADA94Ed68b8
- adex.eth node hash: 0x4e4e818e9467df5c5d1f8c399b11acc73ea24ad69e9c8e1ba6e5784a302c47d4
- adex.eth subdomain registrar (adex.eth controller), compiled with solc v0.5.6: 0x7bc082552b1a195813ddb500600ce2b544d579cb
- G0 Group: all issues discovered were of Low severity, and all were resolved
- Sigma Prime: 4 issues discovered with "Informational" severity, all resolved
- G0 Group, Staking contract: all issues discovered were resolved
- @BrendanChou for SafeERC20: https://gist.github.com/BrendanChou/88a2eeb80947ff00bcf58ffdafeaeb61
- @decanus for SignatureValidator
- @ConnextProject for
merkletree.js