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.
validUntil
), allowing the non-withdrawn portion of the initial deposit to be received back by whoever opened the channel.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:
An Identity
, initialized with no privileges, to be used as a basis for IdentityProxy
:
An IdentityFactory
, set up with the AdEx relayer:
And the Registry
(now obsolete, no longer used):
All contracts here were compiled with solc v0.5.13.
The Identity
, initialized with no privileges, to be used as a basis for IdentityProxy
:
An IdentityFactory
, set up with the AdEx relayer:
And the Staking
:
The ADXSupplyController
contract:
The ADXToken
contract:
An instance of IdentityFactory
used for staking:
The Staking
contract:
The ADXFlashLoans
contract:
The ADXLoyaltyPoolToken
contract:
The ADXLoyaltyPoolIncentiveController
contract:
Not a base contract, but closely related to those systems. Reward distributor Identity:
The SupplyController
contract:
New V5 SupplyController
(increased cap to account for the to-be burned staking migration ADX):
New V5 SupplyController
(increased cap to account for the governance-induced burn):
New V5 SupplyController
(increase cap again to account for governance-induced burn):
New V5 SupplyController
(increase cap again to account for governance-induced burn and discount treasury tokens):
StakingPool:
StakingMigrator:
GaslessSweeper:
IdentityFactory
contract:
Identity
contract:
Same addresses on Ethereum, Polygon, BSC, Fantom, Arbitrum, Avalanche, Moonbeam, Moonriver, Cronos, Metis, Gnosis Chain (formerly xDAI), NEAR Aurora
truffle migrate --network mainnet
truffle migrate --network polygon
truffle migrate --network bsc
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
deploying an identity proxy through the IdentityFactory: 127549
addBond 73404
requestUnbond 34807
unbond 41770
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.
require
s should have an error messagedelegatecall
upgradability; upgradability is achieved via off-chain social consensusisValidSignature
doesn't work until deployedSince 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.
dApps can actually work around this by asking the user to deploy the proxy first.
merkletree.js