Skip to content

Commit 57c5acc

Browse files
committed
fix: ignition modules to output correct name of contracts
Signed-off-by: Tomás Migone <[email protected]>
1 parent 010277e commit 57c5acc

File tree

10 files changed

+144
-1534
lines changed

10 files changed

+144
-1534
lines changed

packages/hardhat-graph-protocol/src/sdk/address-book.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import fs from 'fs'
22

3-
import { AssertionError } from 'assert'
43
import { assertObject } from './utils/assertion'
54

65
import { ContractList, loadContract } from './lib/contract'

packages/hardhat-graph-protocol/src/sdk/hardhat.base.config.ts

Lines changed: 11 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -46,48 +46,29 @@ export const etherscanUserConfig: Partial<EtherscanConfig> = {
4646
...(vars.has('ARBISCAN_API_KEY') && {
4747
arbitrumSepolia: vars.get('ARBISCAN_API_KEY'),
4848
}),
49-
...(vars.has('TENDERLY_API_KEY') && {
50-
virtualArbitrumSepolia: vars.get('TENDERLY_API_KEY'),
51-
virtualArbitrumOne: vars.get('TENDERLY_API_KEY'),
52-
}),
5349
},
54-
customChains: [
55-
...(vars.has('VIRTUAL_ARBITRUM_SEPOLIA_RPC')
56-
? [{
57-
network: 'virtualArbitrumSepolia',
58-
chainId: 421615,
59-
urls: {
60-
apiURL: `${vars.get('VIRTUAL_ARBITRUM_SEPOLIA_RPC')}/verify/etherscan`,
61-
browserURL: vars.get('VIRTUAL_ARBITRUM_SEPOLIA_RPC') || 'https://sepolia.arbiscan.io/',
62-
},
63-
}]
64-
: []),
65-
...(vars.has('VIRTUAL_ARBITRUM_ONE_RPC')
66-
? [{
67-
network: 'virtualArbitrumOne',
68-
chainId: 42162,
69-
urls: {
70-
apiURL: `${vars.get('VIRTUAL_ARBITRUM_ONE_RPC')}/verify/etherscan`,
71-
browserURL: vars.get('VIRTUAL_ARBITRUM_ONE_RPC') || 'https://arbiscan.io/',
72-
},
73-
}]
74-
: []),
75-
],
7650
}
7751

7852
// In general:
7953
// - hardhat is used for unit tests
8054
// - localhost is used for local development on a hardhat network or fork
81-
// - virtualArbitrumSepolia is for Tenderly Virtual Testnet
82-
export const networksUserConfig: NetworksUserConfig & Record<string, { secureAccounts?: SecureAccountsOptions }> = {
55+
type BaseNetworksUserConfig = NetworksUserConfig &
56+
Record<string, { secureAccounts?: SecureAccountsOptions }>
57+
export const networksUserConfig: BaseNetworksUserConfig = {
8358
hardhat: {
8459
chainId: 31337,
8560
accounts: getHardhatAccounts(),
61+
deployments: {
62+
horizon: require.resolve('@graphprotocol/horizon/addresses-local.json'),
63+
},
8664
},
8765
localhost: {
8866
chainId: 31337,
8967
url: 'http://localhost:8545',
9068
accounts: getTestnetAccounts(),
69+
deployments: {
70+
horizon: require.resolve('@graphprotocol/horizon/addresses-local.json'),
71+
},
9172
},
9273
arbitrumOne: {
9374
chainId: 42161,
@@ -103,27 +84,13 @@ export const networksUserConfig: NetworksUserConfig & Record<string, { secureAcc
10384
enabled: true,
10485
},
10586
},
106-
...(vars.has('VIRTUAL_ARBITRUM_SEPOLIA_RPC') && {
107-
virtualArbitrumSepolia: {
108-
chainId: 421615,
109-
url: vars.get('VIRTUAL_ARBITRUM_SEPOLIA_RPC'),
110-
accounts: getTestnetAccounts(),
111-
},
112-
}),
113-
...(vars.has('VIRTUAL_ARBITRUM_ONE_RPC') && {
114-
virtualArbitrumOne: {
115-
chainId: 42162,
116-
url: vars.get('VIRTUAL_ARBITRUM_ONE_RPC'),
117-
accounts: getTestnetAccounts(),
118-
},
119-
}),
12087
}
12188

122-
type HardhatBaseConfig = HardhatUserConfig &
89+
type BaseHardhatConfig = HardhatUserConfig &
12390
{ etherscan: Partial<EtherscanConfig> } &
12491
{ graph: GraphRuntimeEnvironmentOptions } &
12592
{ secureAccounts: SecureAccountsOptions }
126-
export const hardhatBaseConfig: HardhatBaseConfig = {
93+
export const hardhatBaseConfig: BaseHardhatConfig = {
12794
solidity: solidityUserConfig,
12895
paths: projectPathsUserConfig,
12996
secureAccounts: {

packages/horizon/hardhat.config.ts

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,9 @@
11
import { hardhatBaseConfig } from 'hardhat-graph-protocol/sdk'
2-
import { HardhatUserConfig } from 'hardhat/config'
32

43
// Hardhat plugins
54
import '@nomicfoundation/hardhat-foundry'
65
import '@nomicfoundation/hardhat-toolbox'
76
import '@nomicfoundation/hardhat-ignition-ethers'
8-
import '@tenderly/hardhat-tenderly'
97
import 'hardhat-storage-layout'
108
import 'hardhat-contract-sizer'
119
import 'hardhat-secure-accounts'
@@ -15,12 +13,4 @@ if (process.env.BUILD_RUN !== 'true') {
1513
require('hardhat-graph-protocol')
1614
}
1715

18-
const config: HardhatUserConfig = {
19-
...hardhatBaseConfig,
20-
tenderly: {
21-
project: 'graph-network',
22-
username: 'graphprotocol',
23-
},
24-
}
25-
26-
export default config
16+
export default hardhatBaseConfig

packages/horizon/ignition/modules/deploy.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ export default buildModule('GraphHorizon_Deploy', (m) => {
88
Controller,
99
EpochManager,
1010
GraphProxyAdmin,
11-
GraphTokenGateway,
12-
GraphToken,
11+
L2GraphTokenGateway,
12+
L2GraphToken,
1313
RewardsManager,
1414
L2Curation,
1515
} = m.useModule(GraphPeripheryModule)
@@ -35,8 +35,8 @@ export default buildModule('GraphHorizon_Deploy', (m) => {
3535
L2Curation,
3636
EpochManager,
3737
GraphProxyAdmin,
38-
GraphTokenGateway,
39-
GraphToken,
38+
L2GraphTokenGateway,
39+
L2GraphToken,
4040
RewardsManager,
4141
HorizonStaking,
4242
GraphPayments,

packages/horizon/ignition/modules/migrate/migrate-3.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ export default buildModule('GraphHorizon_Migrate_3', (m) => {
1212
Controller,
1313
GraphProxyAdmin,
1414
EpochManager,
15-
GraphToken,
16-
GraphTokenGateway,
15+
L2GraphToken,
16+
L2GraphTokenGateway,
1717
} = m.useModule(MigratePeripheryModule)
1818

1919
const {
@@ -37,7 +37,7 @@ export default buildModule('GraphHorizon_Migrate_3', (m) => {
3737
Controller,
3838
GraphProxyAdmin,
3939
EpochManager,
40-
GraphToken,
41-
GraphTokenGateway,
40+
L2GraphToken,
41+
L2GraphTokenGateway,
4242
}
4343
})

packages/horizon/ignition/modules/periphery/GraphToken.ts

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -10,34 +10,34 @@ import GraphTokenArtifact from '@graphprotocol/contracts/build/contracts/contrac
1010
export default buildModule('L2GraphToken', (m) => {
1111
const { GraphProxyAdmin } = m.useModule(GraphProxyAdminModule)
1212
const { RewardsManager } = m.useModule(RewardsManagerModule)
13-
const { GraphTokenGateway } = m.useModule(GraphTokenGatewayModule)
13+
const { L2GraphTokenGateway } = m.useModule(GraphTokenGatewayModule)
1414

1515
const deployer = m.getAccount(0)
1616
const governor = m.getAccount(1)
1717
const initialSupply = m.getParameter('initialSupply')
1818

19-
const GraphToken = deployWithGraphProxy(m, GraphProxyAdmin, {
19+
const L2GraphToken = deployWithGraphProxy(m, GraphProxyAdmin, {
2020
name: 'L2GraphToken',
2121
artifact: GraphTokenArtifact,
2222
initArgs: [deployer],
2323
})
2424

25-
const mintCall = m.call(GraphToken, 'mint', [deployer, initialSupply])
26-
const renounceMinterCall = m.call(GraphToken, 'renounceMinter', [])
27-
const addMinterRewardsManagerCall = m.call(GraphToken, 'addMinter', [RewardsManager], { id: 'addMinterRewardsManager' })
28-
const addMinterGatewayCall = m.call(GraphToken, 'addMinter', [GraphTokenGateway], { id: 'addMinterGateway' })
25+
const mintCall = m.call(L2GraphToken, 'mint', [deployer, initialSupply])
26+
const renounceMinterCall = m.call(L2GraphToken, 'renounceMinter', [])
27+
const addMinterRewardsManagerCall = m.call(L2GraphToken, 'addMinter', [RewardsManager], { id: 'addMinterRewardsManager' })
28+
const addMinterGatewayCall = m.call(L2GraphToken, 'addMinter', [L2GraphTokenGateway], { id: 'addMinterGateway' })
2929

3030
// No further calls are needed so we can transfer ownership now
31-
const transferOwnershipCall = m.call(GraphToken, 'transferOwnership', [governor], { after: [mintCall, renounceMinterCall, addMinterRewardsManagerCall, addMinterGatewayCall] })
32-
m.call(GraphToken, 'acceptOwnership', [], { from: governor, after: [transferOwnershipCall] })
31+
const transferOwnershipCall = m.call(L2GraphToken, 'transferOwnership', [governor], { after: [mintCall, renounceMinterCall, addMinterRewardsManagerCall, addMinterGatewayCall] })
32+
m.call(L2GraphToken, 'acceptOwnership', [], { from: governor, after: [transferOwnershipCall] })
3333

34-
return { GraphToken }
34+
return { L2GraphToken }
3535
})
3636

3737
export const MigrateGraphTokenModule = buildModule('L2GraphToken', (m) => {
3838
const graphTokenAddress = m.getParameter('graphTokenAddress')
3939

40-
const GraphToken = m.contractAt('L2GraphToken', GraphTokenArtifact, graphTokenAddress)
40+
const L2GraphToken = m.contractAt('L2GraphToken', GraphTokenArtifact, graphTokenAddress)
4141

42-
return { GraphToken }
42+
return { L2GraphToken }
4343
})

packages/horizon/ignition/modules/periphery/GraphTokenGateway.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,20 +13,20 @@ export default buildModule('L2GraphTokenGateway', (m) => {
1313

1414
const pauseGuardian = m.getParameter('pauseGuardian')
1515

16-
const GraphTokenGateway = deployWithGraphProxy(m, GraphProxyAdmin, {
16+
const L2GraphTokenGateway = deployWithGraphProxy(m, GraphProxyAdmin, {
1717
name: 'L2GraphTokenGateway',
1818
artifact: GraphTokenGatewayArtifact,
1919
initArgs: [Controller],
2020
})
21-
m.call(GraphTokenGateway, 'setPauseGuardian', [pauseGuardian])
21+
m.call(L2GraphTokenGateway, 'setPauseGuardian', [pauseGuardian])
2222

23-
return { GraphTokenGateway }
23+
return { L2GraphTokenGateway }
2424
})
2525

2626
export const MigrateGraphTokenGatewayModule = buildModule('L2GraphTokenGateway', (m) => {
2727
const graphTokenGatewayAddress = m.getParameter('graphTokenGatewayAddress')
2828

29-
const GraphTokenGateway = m.contractAt('L2GraphTokenGateway', GraphTokenGatewayArtifact, graphTokenGatewayAddress)
29+
const L2GraphTokenGateway = m.contractAt('L2GraphTokenGateway', GraphTokenGatewayArtifact, graphTokenGatewayAddress)
3030

31-
return { GraphTokenGateway }
31+
return { L2GraphTokenGateway }
3232
})

packages/horizon/ignition/modules/periphery/periphery.ts

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,13 @@ export default buildModule('GraphHorizon_Periphery', (m) => {
1717
const { EpochManager } = m.useModule(EpochManagerModule)
1818
const { L2Curation } = m.useModule(CurationModule)
1919
const { RewardsManager } = m.useModule(RewardsManagerModule)
20-
const { GraphTokenGateway } = m.useModule(GraphTokenGatewayModule)
21-
const { GraphToken } = m.useModule(GraphTokenModule)
20+
const { L2GraphTokenGateway } = m.useModule(GraphTokenGatewayModule)
21+
const { L2GraphToken } = m.useModule(GraphTokenModule)
2222

2323
m.call(Controller, 'setContractProxy', [ethers.keccak256(ethers.toUtf8Bytes('EpochManager')), EpochManager], { id: 'setContractProxy_EpochManager' })
2424
m.call(Controller, 'setContractProxy', [ethers.keccak256(ethers.toUtf8Bytes('RewardsManager')), RewardsManager], { id: 'setContractProxy_RewardsManager' })
25-
m.call(Controller, 'setContractProxy', [ethers.keccak256(ethers.toUtf8Bytes('GraphToken')), GraphToken], { id: 'setContractProxy_GraphToken' })
26-
m.call(Controller, 'setContractProxy', [ethers.keccak256(ethers.toUtf8Bytes('GraphTokenGateway')), GraphTokenGateway], { id: 'setContractProxy_GraphTokenGateway' })
25+
m.call(Controller, 'setContractProxy', [ethers.keccak256(ethers.toUtf8Bytes('GraphToken')), L2GraphToken], { id: 'setContractProxy_GraphToken' })
26+
m.call(Controller, 'setContractProxy', [ethers.keccak256(ethers.toUtf8Bytes('GraphTokenGateway')), L2GraphTokenGateway], { id: 'setContractProxy_GraphTokenGateway' })
2727
m.call(Controller, 'setContractProxy', [ethers.keccak256(ethers.toUtf8Bytes('GraphProxyAdmin')), GraphProxyAdmin], { id: 'setContractProxy_GraphProxyAdmin' })
2828
m.call(Controller, 'setContractProxy', [ethers.keccak256(ethers.toUtf8Bytes('Curation')), L2Curation], { id: 'setContractProxy_L2Curation' })
2929

@@ -32,8 +32,8 @@ export default buildModule('GraphHorizon_Periphery', (m) => {
3232
EpochManager,
3333
L2Curation,
3434
GraphProxyAdmin,
35-
GraphToken,
36-
GraphTokenGateway,
35+
L2GraphToken,
36+
L2GraphTokenGateway,
3737
RewardsManager,
3838
}
3939
})
@@ -44,8 +44,8 @@ export const MigratePeripheryModule = buildModule('GraphHorizon_Periphery', (m)
4444
const { Controller } = m.useModule(MigrateControllerDeployerModule)
4545
const { GraphProxyAdmin } = m.useModule(MigrateGraphProxyAdminModule)
4646
const { EpochManager } = m.useModule(MigrateEpochManagerModule)
47-
const { GraphToken } = m.useModule(MigrateGraphTokenModule)
48-
const { GraphTokenGateway } = m.useModule(MigrateGraphTokenGatewayModule)
47+
const { L2GraphToken } = m.useModule(MigrateGraphTokenModule)
48+
const { L2GraphTokenGateway } = m.useModule(MigrateGraphTokenGatewayModule)
4949

5050
// Load these contracts so they are available in the address book
5151

@@ -55,8 +55,8 @@ export const MigratePeripheryModule = buildModule('GraphHorizon_Periphery', (m)
5555
L2Curation,
5656
L2CurationImplementation,
5757
GraphProxyAdmin,
58-
GraphToken,
59-
GraphTokenGateway,
58+
L2GraphToken,
59+
L2GraphTokenGateway,
6060
RewardsManager,
6161
RewardsManagerImplementation,
6262
}

packages/horizon/package.json

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,6 @@
3131
"@nomicfoundation/ignition-core": "^0.15.9",
3232
"@openzeppelin/contracts": "^5.0.2",
3333
"@openzeppelin/contracts-upgradeable": "^5.0.2",
34-
"@tenderly/api-client": "^1.1.0",
35-
"@tenderly/hardhat-tenderly": "^2.5.2",
3634
"@typechain/ethers-v6": "^0.5.0",
3735
"@typechain/hardhat": "^9.0.0",
3836
"@types/chai": "^4.2.0",

0 commit comments

Comments
 (0)