Skip to content

Scratch testnet 3 (for testing only) #800

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 118 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
118 commits
Select commit Hold shift + click to select a range
1142934
feat: linear indexer rewards
pcarranzav Aug 31, 2022
5d20c86
feat: minting in L1 gateway with allowance
pcarranzav Sep 1, 2022
cc4a2dd
test: avoid issues with epoch boundary in allocation tests
pcarranzav Sep 2, 2022
51cc8cd
chore: add comment on setIssuancePerBlock to remind of L1 allowance c…
pcarranzav Sep 5, 2022
06b9774
fix(RewardsManager): skip calculations if issuance is zero
pcarranzav Sep 7, 2022
bbe2cff
fix(RewardsManagerStorage): make deprecated variables private
pcarranzav Sep 7, 2022
b77f501
fix(cli): replace issuanceRate getter/setter with one for issuancePer…
pcarranzav Sep 7, 2022
5124371
fix(e2e): issuanceRate replaced by issuancePerBlock
pcarranzav Sep 7, 2022
4f2262d
chore(L1GraphTokenGateway): rename _block parameter to _blockNum for …
pcarranzav Sep 7, 2022
6351786
test(L1GraphTokenGateway): remove redundant awaits and combine two ev…
pcarranzav Sep 7, 2022
263355d
fix: add RewardsManager as minter in L2
pcarranzav Sep 27, 2022
dbdda2f
fix: use strict < for block in L2 mint allowance (OZ N-02)
pcarranzav Oct 21, 2022
1845259
fix: remove the deprecated pow from RewardsManager (OZ N-03)
pcarranzav Oct 21, 2022
f170357
feat: migrating GNS signal to L2 (early WIP)
pcarranzav Jun 23, 2022
266fdef
feat: working on L1 side of GNS L2 migration
pcarranzav Jun 24, 2022
498cd38
feat: still more WIP on GNS migration
pcarranzav Jun 27, 2022
a0e90b2
test: fix subgraph IDs now we add chainID
pcarranzav Jun 27, 2022
9efb72c
feat: functions to claim curator balance
pcarranzav Jun 29, 2022
55fe96a
test: add tests for mintTaxFree
pcarranzav Jun 29, 2022
88443f9
test: add some tests for legacy GNS migration
pcarranzav Jun 29, 2022
02b7c7d
fix: use L1GNS as key in the address book
pcarranzav Jun 30, 2022
f76daec
feat: tests outline, and realized we need to handle legacy subgraphs
pcarranzav Jun 30, 2022
844bdc7
feat: claiming balance on legacy subgraphs is a bit different
pcarranzav Jul 1, 2022
c0e7485
test: more WIP on tests for GNS migration
pcarranzav Jul 1, 2022
303199c
test: fix destination address
pcarranzav Jul 1, 2022
8e8cb8e
test: fix gateway configuration
pcarranzav Jul 15, 2022
1721ba3
test: fix check for reserveRatio in migrated subgraph
pcarranzav Jul 15, 2022
7b2e715
test: more tests for sending to L2, plus optimize advanceBlocks
pcarranzav Jul 19, 2022
0bed94d
chore: use AddressAliasHelper in L2GNS
pcarranzav Aug 26, 2022
9a636f2
chore: use separate functions to compute slots
pcarranzav Aug 30, 2022
f1037c9
fix(L1GNS): better revert messages, and add more tests
pcarranzav Sep 16, 2022
cd427cc
fix: use a single storage contract to prevent upgrade issues
pcarranzav Sep 20, 2022
825ad70
test(e2e): fix L1GNS in config and use new subgraph id format
pcarranzav Sep 20, 2022
9510d27
fix: bool for deprecated, and more tests
pcarranzav Sep 20, 2022
ea375bc
test: wip on initial tests for L2GNS
pcarranzav Sep 20, 2022
29445ce
fix: allow larger msg.value when claiming curation
pcarranzav Oct 10, 2022
5fa1e1c
fix: use the new onTokenTransfer interface
pcarranzav Oct 11, 2022
79185ce
test: more WIP on tests for L2GNS
pcarranzav Oct 21, 2022
421396c
test: fix GNS tests, add some more L2GNS tests
pcarranzav Oct 27, 2022
61575ac
test: more fixes in curation and gns tests
pcarranzav Oct 31, 2022
50624ae
test: align to epoch to prevent issues in allocation tests
pcarranzav Oct 31, 2022
9b2b54d
fix: make slot functions public and part of base GNS
pcarranzav Nov 2, 2022
a3fb8ca
test: progress on setting up the test for the MPT proofs
pcarranzav Nov 2, 2022
63ba5c0
fix: revert messages, tests for MPT proofs
pcarranzav Nov 3, 2022
2b0a27e
test: more tests for claiming L2 balances
pcarranzav Nov 4, 2022
699a247
test: add tests for claiming from legacy subgraphs
pcarranzav Nov 4, 2022
034049c
fix: config changes for L2GNS instead of GNS
pcarranzav Nov 4, 2022
00c16ee
fix: reverse order of arguments and add tests for legacy view functions
pcarranzav Nov 4, 2022
7ed0078
test: initial structure to test the MPT verifier
pcarranzav Nov 4, 2022
1412ca2
test: use newer MPT library
pcarranzav Nov 8, 2022
39493c8
fix: can't upgrade subgraphNFT, so metadata must be added manually
pcarranzav Nov 8, 2022
26be8ac
fix: cleaner storage, and allow disabling MPT proofs
pcarranzav Nov 8, 2022
602a9ff
test: a few more tests for MPT
pcarranzav Nov 8, 2022
06534f0
test: improve coverage for MPT verifier
pcarranzav Nov 8, 2022
5f2fdea
test: add tests for MPT using hashed keys like Ethereum
pcarranzav Nov 9, 2022
18bc53b
feat: hardcode reserve ratio to 1 in L2, and allow pre-curated deploy…
pcarranzav Nov 10, 2022
dd38b01
test(e2e): separate L1/L2 curation tests
pcarranzav Nov 10, 2022
90e41e7
fix: remove bonding curve from GNS
pcarranzav Nov 10, 2022
eeee6e4
fix: remove bancor formula from L2 curation
pcarranzav Nov 10, 2022
676f7e8
fix: no need for onlyGNS in L1 Curation now
pcarranzav Nov 10, 2022
d128873
fix: remove reserve ratio from retryable tx, and other QA improvements
pcarranzav Nov 10, 2022
556010d
test: fix chain path in e2e
pcarranzav Nov 10, 2022
57b84cc
fix: various QA improvements
pcarranzav Nov 10, 2022
9df2a02
fix: gas optimization: > 0 is != 0
pcarranzav Nov 10, 2022
92c9e01
fix: owner
pcarranzav Nov 17, 2022
115a575
fix: remove MPT claiming and the need to lock subgraphs before sendin…
pcarranzav Nov 18, 2022
8755a22
fix: no need for the trie npm package anymore
pcarranzav Nov 18, 2022
e8fb9d5
fix: gas check in L1GNS, and some QA/NatSpec details
pcarranzav Nov 21, 2022
703fca7
fix: missed a rename
pcarranzav Nov 21, 2022
bb9cdeb
fix: comment details
pcarranzav Nov 21, 2022
25297df
test: remove outdated l2 gas test
pcarranzav Nov 22, 2022
f340c3a
Merge branch 'dev' into pcv/l2-linear-rewards
pcarranzav Nov 24, 2022
6321e60
fix: restore e2e task from dev
pcarranzav Nov 24, 2022
6639f8d
fix(L1GNS): use a public function for outbound calldata
pcarranzav Nov 25, 2022
75522bf
fix: allow anyone to deprecate a subgraph if migration is not finishe…
pcarranzav Dec 7, 2022
0a53332
fix: update comments in deprecateSubgraphMigratedFromL1
pcarranzav Dec 17, 2022
5d924c4
test: check that curators can't double spend on L1 after migration (O…
pcarranzav Dec 15, 2022
f8c2f06
test: add tests for L2GNS.publishNewVersion (OZ M-03)
pcarranzav Dec 15, 2022
2393e20
test: add basic tests for subgraphSignal and subgraphTokens (OZ M-03)
pcarranzav Dec 16, 2022
119fd79
test: access control tests for subgraphNFT mint/burn (OZ M-03)
pcarranzav Dec 16, 2022
64dfcd0
fix: set curator signal to zero after claiming from L1 to L2 (OZ L-01)
pcarranzav Dec 19, 2022
7e81698
fix: getClaimCuratorBalanceOutboundCalldata is pure now
pcarranzav Dec 20, 2022
de4c3ab
fix: make CurationPool.reserveRatio properly deprecated in L2 (OZ L-02)
pcarranzav Dec 19, 2022
f61eae8
fix: improve NatSpec coverage and complete IManaged (OZ L-03)
pcarranzav Dec 19, 2022
2a7cd68
fix: rename SubgraphData.reserveRatio to reserveRatioDeprecated (OZ N…
pcarranzav Dec 19, 2022
8e7e9a0
fix: split the migration data struct between L1 and L2GNS (OZ N-03)
pcarranzav Dec 20, 2022
d433a1b
fix(Managed): use hash directly in syncAllContracts and gns (OZ N-04)
pcarranzav Dec 20, 2022
f9fa05c
fix: remove unused imports (OZ N-06)
pcarranzav Dec 20, 2022
e606b68
fix: mark GNS as abstract (OZ N-07)
pcarranzav Dec 20, 2022
b0832f2
fix: document the encoding in L2GNS.onTokenTransfer (OZ N-08)
pcarranzav Dec 20, 2022
ce13a01
fix: correct unit for curationTaxPercentage in comment (OZ N-09)
pcarranzav Dec 20, 2022
87cd0fe
fix: add indexed params to some events (OZ N-10)
pcarranzav Dec 20, 2022
b59c798
fix: use named arguments in long function calls (OZ N-11)
pcarranzav Dec 20, 2022
ce1de68
Merge branch 'dev' into pcv/l2-linear-rewards-merge-dev-2
pcarranzav Dec 23, 2022
69e542d
fix: set issuancePerBlock on goerli config
pcarranzav Dec 23, 2022
c0383e1
Merge pull request #780 from graphprotocol/pcv/l2-linear-rewards-merg…
pcarranzav Dec 23, 2022
18eb0a2
feat: subgraph migration to L2 sending only the owner's tokens (OZ M-01)
pcarranzav Dec 8, 2022
e9fb416
fix: also return tokens if subgraph is disabled
pcarranzav Jan 31, 2023
7836497
test: check edge cases in L2GNS
pcarranzav Jan 31, 2023
3b78aac
fix: apply suggestions from code review
pcarranzav Feb 15, 2023
ce9a8f9
fix: events emitted in L2 GNS migration
pcarranzav Feb 15, 2023
a994b63
fix: review comments from #585 in L2GNS
pcarranzav Feb 15, 2023
287167e
fix: remove unused imports (OZ N-01 for #764)
pcarranzav Feb 28, 2023
e30eb01
test: add some missing cases for GNS migration (OZ N-02 for #764)
pcarranzav Feb 28, 2023
192aecf
fix: use variable for withdrawableGRT to save gas (OZ N-03 for #764)
pcarranzav Feb 28, 2023
83fffa3
feat: stake and delegation migration helpers for L2
pcarranzav Jan 20, 2023
00f5c94
fix: correct proxy check in Staking fallback
pcarranzav Mar 15, 2023
dc40106
fix(config): set L1 gateway as minter on localhost and goerli
pcarranzav Mar 15, 2023
ae7aede
Merge branch 'pcv/l2-linear-rewards' into pcv/scratch-testnet-3
pcarranzav Mar 15, 2023
1517458
Merge branch 'pcv/786-fix-fallback-check' into pcv/scratch-testnet-3
pcarranzav Mar 15, 2023
f98e16c
test: epoch boundary fix on allocations test
pcarranzav Mar 15, 2023
79e3f30
chore: initial scratch-3 deployment to goerli
pcarranzav Mar 15, 2023
c9333c0
fix(gre): if a config path is set, use it
pcarranzav Mar 15, 2023
0e3ed90
chore: deploy L2 side of scratch 3
pcarranzav Mar 15, 2023
5fc7a96
feat(cli): configure migration helpers when configuring bridge
pcarranzav Mar 16, 2023
cda35fc
fix(cli): address book for L2GNS and L2Staking
pcarranzav Mar 16, 2023
4d98675
fix: use scratch 3 addresses in addresses.json
pcarranzav Mar 16, 2023
7bfe211
chore: version release v3.0.0-scratch3r1
abarmat Mar 16, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .solcover.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,5 @@ module.exports = {
},
skipFiles,
istanbulFolder: './reports/coverage',
configureYulOptimizer: true,
}
1 change: 0 additions & 1 deletion .solhintignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,5 @@ node_modules
./contracts/discovery/erc1056
./contracts/rewards/RewardsManager.sol
./contracts/staking/libs/LibFixedMath.sol
./contracts/tests/RewardsManagerMock.sol
./contracts/tests/ens
./contracts/tests/testnet/GSRManager.sol
1,183 changes: 216 additions & 967 deletions addresses.json

Large diffs are not rendered by default.

13 changes: 7 additions & 6 deletions cli/commands/migrate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,9 @@ let allContracts = [
'Curation',
'SubgraphNFTDescriptor',
'SubgraphNFT',
'GNS',
'Staking',
'L1GNS',
'StakingExtension',
'L1Staking',
'RewardsManager',
'DisputeManager',
'AllocationExchange',
Expand All @@ -40,17 +41,17 @@ let allContracts = [

const l2Contracts = [
'GraphProxyAdmin',
'BancorFormula',
'Controller',
'EpochManager',
'L2GraphToken',
'GraphCurationToken',
'ServiceRegistry',
'Curation',
'L2Curation',
'SubgraphNFTDescriptor',
'SubgraphNFT',
'GNS',
'Staking',
'L2GNS',
'StakingExtension',
'L2Staking',
'RewardsManager',
'DisputeManager',
'AllocationExchange',
Expand Down
26 changes: 26 additions & 0 deletions cli/commands/protocol/configure-bridge.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,20 @@ export const configureL1Bridge = async (cli: CLIEnvironment, cliArgs: CLIArgs):
l1Inbox.address,
l1Router.address,
])

const l1GNS = cli.contracts.L1GNS
logger.info('L1 GNS address: ' + l1GNS.address)
const l2GNS = l2AddressBook.getEntry('L2GNS')
logger.info('L2 GNS address: ' + l2GNS.address)
await sendTransaction(cli.wallet, l1GNS, 'setCounterpartGNSAddress', [l2GNS.address])
await sendTransaction(cli.wallet, gateway, 'addToCallhookAllowlist', [l1GNS.address])

const l1Staking = cli.contracts.L1Staking
logger.info('L1 Staking address: ' + l1Staking.address)
const l2Staking = l2AddressBook.getEntry('L2Staking')
logger.info('L2 Staking address: ' + l2Staking.address)
await sendTransaction(cli.wallet, l1Staking, 'setCounterpartStakingAddress', [l2Staking.address])
await sendTransaction(cli.wallet, gateway, 'addToCallhookAllowlist', [l1Staking.address])
}

export const configureL2Bridge = async (cli: CLIEnvironment, cliArgs: CLIArgs): Promise<void> => {
Expand Down Expand Up @@ -68,6 +82,18 @@ export const configureL2Bridge = async (cli: CLIEnvironment, cliArgs: CLIArgs):
logger.info('L2 Router address: ' + l2Router.address)
await sendTransaction(cli.wallet, gateway, 'setL2Router', [l2Router.address])

const l1GNS = l1AddressBook.getEntry('L1GNS')
const l2GNS = cli.contracts['L2GNS']
logger.info('L1 GNS address: ' + l1GNS.address)
logger.info('L2 GNS address: ' + l2GNS.address)
await sendTransaction(cli.wallet, l2GNS, 'setCounterpartGNSAddress', [l1GNS.address])

const l1Staking = l1AddressBook.getEntry('L1Staking')
const l2Staking = cli.contracts['L2Staking']
logger.info('L1 Staking address: ' + l1Staking.address)
logger.info('L2 Staking address: ' + l2Staking.address)
await sendTransaction(cli.wallet, l2Staking, 'setCounterpartStakingAddress', [l1Staking.address])

logger.info('L2 Gateway address: ' + gateway.address)
await sendTransaction(cli.wallet, token, 'setGateway', [gateway.address])
}
Expand Down
2 changes: 1 addition & 1 deletion cli/commands/protocol/get.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ export const gettersList = {
'epochs-length': { contract: 'EpochManager', name: 'epochLength' },
'epochs-current': { contract: 'EpochManager', name: 'currentEpoch' },
// Rewards
'rewards-issuance-rate': { contract: 'RewardsManager', name: 'issuanceRate' },
'rewards-issuance-per-block': { contract: 'RewardsManager', name: 'issuancePerBlock' },
'subgraph-availability-oracle': {
contract: 'RewardsManager',
name: 'subgraphAvailabilityOracle',
Expand Down
2 changes: 1 addition & 1 deletion cli/commands/protocol/set.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ export const settersList = {
// Epochs
'epochs-length': { contract: 'EpochManager', name: 'setEpochLength' },
// Rewards
'rewards-issuance-rate': { contract: 'RewardsManager', name: 'setIssuanceRate' },
'rewards-issuance-per-block': { contract: 'RewardsManager', name: 'setIssuancePerBlock' },
'subgraph-availability-oracle': {
contract: 'RewardsManager',
name: 'setSubgraphAvailabilityOracle',
Expand Down
45 changes: 41 additions & 4 deletions cli/contracts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,14 @@ import { getContractAt } from './network'

import { EpochManager } from '../build/types/EpochManager'
import { DisputeManager } from '../build/types/DisputeManager'
import { Staking } from '../build/types/Staking'
import { L1Staking } from '../build/types/L1Staking'
import { L2Staking } from '../build/types/L2Staking'
import { ServiceRegistry } from '../build/types/ServiceRegistry'
import { Curation } from '../build/types/Curation'
import { RewardsManager } from '../build/types/RewardsManager'
import { GNS } from '../build/types/GNS'
import { L1GNS } from '../build/types/L1GNS'
import { L2GNS } from '../build/types/L2GNS'
import { GraphProxyAdmin } from '../build/types/GraphProxyAdmin'
import { GraphToken } from '../build/types/GraphToken'
import { Controller } from '../build/types/Controller'
Expand All @@ -37,15 +40,21 @@ import { L1GraphTokenGateway } from '../build/types/L1GraphTokenGateway'
import { L2GraphToken } from '../build/types/L2GraphToken'
import { L2GraphTokenGateway } from '../build/types/L2GraphTokenGateway'
import { BridgeEscrow } from '../build/types/BridgeEscrow'
import { L2Curation } from '../build/types/L2Curation'
import { IL1Staking } from '../build/types/IL1Staking'
import { IL2Staking } from '../build/types/IL2Staking'
import { Interface } from 'ethers/lib/utils'
import { loadArtifact } from './artifacts'

export interface NetworkContracts {
EpochManager: EpochManager
DisputeManager: DisputeManager
Staking: Staking
Staking: IL1Staking | IL2Staking
ServiceRegistry: ServiceRegistry
Curation: Curation
Curation: Curation | L2Curation
L2Curation: L2Curation
RewardsManager: RewardsManager
GNS: GNS
GNS: GNS | L1GNS | L2GNS
GraphProxyAdmin: GraphProxyAdmin
GraphToken: GraphToken
Controller: Controller
Expand All @@ -60,6 +69,10 @@ export interface NetworkContracts {
BridgeEscrow: BridgeEscrow
L2GraphToken: L2GraphToken
L2GraphTokenGateway: L2GraphTokenGateway
L1GNS: L1GNS
L2GNS: L2GNS
L1Staking: IL1Staking
L2Staking: IL2Staking
}

export const loadAddressBookContract = (
Expand Down Expand Up @@ -91,6 +104,15 @@ export const loadContracts = (
contract.connect = getWrappedConnect(contract, contractName)
contract = wrapCalls(contract, contractName)
}
if (contractName == 'L1Staking') {
// Hack the contract into behaving like an IL1Staking
const iface = new Interface(loadArtifact('IL1Staking').abi)
contract = new Contract(contract.address, iface) as unknown as IL1Staking
} else if (contractName == 'L2Staking') {
// Hack the contract into behaving like an IL2Staking
const iface = new Interface(loadArtifact('IL2Staking').abi)
contract = new Contract(contract.address, iface) as unknown as IL2Staking
}
contracts[contractName] = contract

if (signerOrProvider) {
Expand All @@ -101,6 +123,21 @@ export const loadContracts = (
if (chainIdIsL2(chainId) && contractName == 'L2GraphToken') {
contracts['GraphToken'] = contracts[contractName]
}
if (signerOrProvider && chainIdIsL2(chainId) && contractName == 'L2GNS') {
contracts['GNS'] = contracts[contractName]
}
if (signerOrProvider && chainIdIsL2(chainId) && contractName == 'L2Staking') {
contracts['Staking'] = contracts[contractName]
}
if (signerOrProvider && chainIdIsL2(chainId) && contractName == 'L2Curation') {
contracts['Curation'] = contracts[contractName]
}
if (signerOrProvider && !chainIdIsL2(chainId) && contractName == 'L1GNS') {
contracts['GNS'] = contracts[contractName]
}
if (signerOrProvider && !chainIdIsL2(chainId) && contractName == 'L1Staking') {
contracts['Staking'] = contracts[contractName]
}
} catch (err) {
logger.warn(`Could not load contract ${contractName} - ${err.message}`)
}
Expand Down
14 changes: 13 additions & 1 deletion cli/network.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@ import { AddressBook } from './address-book'
import { loadArtifact } from './artifacts'
import { defaultOverrides } from './defaults'
import { GraphToken } from '../build/types/GraphToken'
import { Interface } from 'ethers/lib/utils'
import { IL1Staking } from '../build/types/IL1Staking'
import { IL2Staking } from '../build/types/IL2Staking'

const { keccak256, randomBytes, parseUnits, hexlify } = utils

Expand Down Expand Up @@ -197,7 +200,7 @@ export const deployContract = async (

// Deploy
const factory = getContractFactory(name, libraries)
const contract = await factory.connect(sender).deploy(...args)
let contract = await factory.connect(sender).deploy(...args)
const txHash = contract.deployTransaction.hash
logger.info(`> Deploy ${name}, txHash: ${txHash}`)
await sender.provider.waitForTransaction(txHash)
Expand All @@ -209,6 +212,15 @@ export const deployContract = async (
logger.info(`= RuntimeCodeHash: ${runtimeCodeHash}`)
logger.info(`${name} has been deployed to address: ${contract.address}`)

if (name == 'L1Staking') {
// Hack the contract into behaving like an IL1Staking
const iface = new Interface(loadArtifact('IL1Staking').abi)
contract = new Contract(contract.address, iface, sender) as unknown as IL1Staking
} else if (name == 'L2Staking') {
// Hack the contract into behaving like an IL2Staking
const iface = new Interface(loadArtifact('IL2Staking').abi)
contract = new Contract(contract.address, iface, sender) as unknown as IL2Staking
}
return { contract, creationCodeHash, runtimeCodeHash, txHash, libraries }
}

Expand Down
151 changes: 151 additions & 0 deletions config/graph.arbitrum-goerli-scratch-3.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,151 @@
general:
arbitrator: &arbitrator "0xed42A803C9f0bAE74bF0E63f36FF0Ae7FF38beF7" # Arbitration Council (TODO: update)
governor: &governor "0xf6De21Ce446B47d7599BC6554Eaa9EDF05Dfe731" # Graph Council (TODO: update)
authority: &authority "0xDfaf2F953899c3Fae4aa4979727fd9F441E006b2" # Authority that signs payment vouchers
availabilityOracle: &availabilityOracle "0xC241E5A6e35432bf340B9853F025D90031a9E8ef" # Subgraph Availability Oracle (TODO: update)
pauseGuardian: &pauseGuardian "0x5753d3c0c08C2Cee7be69eBbd058299faB0ea966" # Protocol pause guardian (TODO: update)
allocationExchangeOwner: &allocationExchangeOwner "0x91cEc32a6975265cF96A43f4209F39274cBEc088" # Allocation Exchange owner (TODO: update)

contracts:
Controller:
calls:
- fn: "setContractProxy"
id: "0xe6876326c1291dfcbbd3864a6816d698cd591defc7aa2153d7f9c4c04016c89f" # keccak256('Curation')
contractAddress: "${{L2Curation.address}}"
- fn: "setContractProxy"
id: "0x39605a6c26a173774ca666c67ef70cf491880e5d3d6d0ca66ec0a31034f15ea3" # keccak256('GNS')
contractAddress: "${{L2GNS.address}}"
- fn: "setContractProxy"
id: "0xf942813d07d17b56de9a9afc8de0ced6e8c053bbfdcc87b7badea4ddcf27c307" # keccak256('DisputeManager')
contractAddress: "${{DisputeManager.address}}"
- fn: "setContractProxy"
id: "0xc713c3df6d14cdf946460395d09af88993ee2b948b1a808161494e32c5f67063" # keccak256('EpochManager')
contractAddress: "${{EpochManager.address}}"
- fn: "setContractProxy"
id: "0x966f1e8d8d8014e05f6ec4a57138da9be1f7c5a7f802928a18072f7c53180761" # keccak256('RewardsManager')
contractAddress: "${{RewardsManager.address}}"
- fn: "setContractProxy"
id: "0x1df41cd916959d1163dc8f0671a666ea8a3e434c13e40faef527133b5d167034" # keccak256('Staking')
contractAddress: "${{L2Staking.address}}"
- fn: "setContractProxy"
id: "0x45fc200c7e4544e457d3c5709bfe0d520442c30bbcbdaede89e8d4a4bbc19247" # keccak256('GraphToken')
contractAddress: "${{L2GraphToken.address}}"
- fn: "setContractProxy"
id: "0xd362cac9cb75c10d67bcc0b7eeb0b1ef48bb5420b556c092d4fd7f758816fcf0" # keccak256('GraphTokenGateway')
contractAddress: "${{L2GraphTokenGateway.address}}"
- fn: "setPauseGuardian"
pauseGuardian: *pauseGuardian
- fn: "transferOwnership"
owner: *governor
GraphProxyAdmin:
calls:
- fn: "transferOwnership"
owner: *governor
ServiceRegistry:
proxy: true
init:
controller: "${{Controller.address}}"
calls:
- fn: "syncAllContracts"
EpochManager:
proxy: true
init:
controller: "${{Controller.address}}"
lengthInBlocks: 554 # length in hours = lengthInBlocks*13/60/60 (~13 second blocks)
L2GraphToken:
proxy: true
init:
owner: "${{Env.deployer}}"
calls:
- fn: "addMinter"
minter: "${{RewardsManager.address}}"
- fn: "renounceMinter"
- fn: "transferOwnership"
owner: *governor
L2Curation:
proxy: true
init:
controller: "${{Controller.address}}"
curationTokenMaster: "${{GraphCurationToken.address}}"
curationTaxPercentage: 10000 # in parts per million
minimumCurationDeposit: "1000000000000000000" # in wei
calls:
- fn: "syncAllContracts"
DisputeManager:
proxy: true
init:
controller: "${{Controller.address}}"
arbitrator: *arbitrator
minimumDeposit: "10000000000000000000000" # in wei
fishermanRewardPercentage: 500000 # in parts per million
idxSlashingPercentage: 25000 # in parts per million
qrySlashingPercentage: 25000 # in parts per million
calls:
- fn: "syncAllContracts"
L2GNS:
proxy: true
init:
controller: "${{Controller.address}}"
subgraphNFT: "${{SubgraphNFT.address}}"
calls:
- fn: "approveAll"
- fn: "syncAllContracts"
SubgraphNFT:
init:
governor: "${{Env.deployer}}"
calls:
- fn: "setTokenDescriptor"
tokenDescriptor: "${{SubgraphNFTDescriptor.address}}"
- fn: "setMinter"
minter: "${{L2GNS.address}}"
- fn: "transferOwnership"
owner: *governor
L2Staking:
proxy: true
init:
controller: "${{Controller.address}}"
minimumIndexerStake: "100000000000000000000000" # in wei
thawingPeriod: 6646 # in blocks
protocolPercentage: 10000 # in parts per million
curationPercentage: 100000 # in parts per million
channelDisputeEpochs: 2 # in epochs
maxAllocationEpochs: 4 # in epochs
delegationUnbondingPeriod: 12 # in epochs
delegationRatio: 16 # delegated stake to indexer stake multiplier
rebateAlphaNumerator: 77 # rebateAlphaNumerator / rebateAlphaDenominator
rebateAlphaDenominator: 100 # rebateAlphaNumerator / rebateAlphaDenominator
extensionImpl: "${{StakingExtension.address}}"
calls:
- fn: "setDelegationTaxPercentage"
delegationTaxPercentage: 5000 # parts per million
- fn: "setSlasher"
slasher: "${{DisputeManager.address}}"
allowed: true
- fn: "setAssetHolder"
assetHolder: "${{AllocationExchange.address}}"
allowed: true
- fn: "syncAllContracts"
RewardsManager:
proxy: true
init:
controller: "${{Controller.address}}"
calls:
- fn: "setSubgraphAvailabilityOracle"
subgraphAvailabilityOracle: *availabilityOracle
- fn: "syncAllContracts"
AllocationExchange:
init:
graphToken: "${{L2GraphToken.address}}"
staking: "${{L2Staking.address}}"
governor: *allocationExchangeOwner
authority: *authority
calls:
- fn: "approveAll"
L2GraphTokenGateway:
proxy: true
init:
controller: "${{Controller.address}}"
calls:
- fn: "syncAllContracts"
- fn: "setPauseGuardian"
pauseGuardian: *pauseGuardian
Loading