@@ -5,38 +5,27 @@ import { ethers } from 'ethers'
55import GraphPeripheryModule from '../periphery'
66import GraphProxyAdminModule from '../periphery/GraphProxyAdmin'
77
8- import DummyArtifact from '../../../build/contracts/contracts/mocks/Dummy.sol/Dummy.json'
98import GraphProxyArtifact from '@graphprotocol/contracts/build/contracts/contracts/upgrades/GraphProxy.sol/GraphProxy.json'
109
1110const ZERO_ADDRESS = '0x0000000000000000000000000000000000000000'
1211
1312// HorizonStaking, GraphPayments and PaymentsEscrow use GraphDirectory but they also in the directory.
1413// So we need to deploy their proxies, register them in the controller before being able to deploy the implementations
1514export default buildModule ( 'HorizonProxies' , ( m ) => {
16- const { Controller, PeripheryRegistered } = m . useModule ( GraphPeripheryModule )
15+ const { Controller } = m . useModule ( GraphPeripheryModule )
1716 const { GraphProxyAdmin } = m . useModule ( GraphProxyAdminModule )
1817
1918 // Deploy HorizonStaking proxy without an implementation
20- const HorizonStakingProxy = m . contract ( 'GraphProxy' , GraphProxyArtifact , [ ZERO_ADDRESS , GraphProxyAdmin ] , { after : [ PeripheryRegistered ] , id : 'GraphProxy_HorizonStaking' } )
19+ const HorizonStakingProxy = m . contract ( 'GraphProxy' , GraphProxyArtifact , [ ZERO_ADDRESS , GraphProxyAdmin ] , { after : [ ] , id : 'GraphProxy_HorizonStaking' } )
2120
2221 // Deploy proxies for payments contracts using OZ TransparentUpgradeableProxy
2322 const { Proxy : GraphPaymentsProxy , ProxyAdmin : GraphPaymentsProxyAdmin } = deployWithOZProxy ( m , 'GraphPayments' )
2423 const { Proxy : PaymentsEscrowProxy , ProxyAdmin : PaymentsEscrowProxyAdmin } = deployWithOZProxy ( m , 'PaymentsEscrow' )
2524
2625 // Register the proxies in the controller
27- const setProxyHorizonStaking = m . call ( Controller , 'setContractProxy' , [ ethers . keccak256 ( ethers . toUtf8Bytes ( 'Staking' ) ) , HorizonStakingProxy ] , { id : 'setContractProxy_HorizonStaking' } )
28- const setProxyGraphPayments = m . call ( Controller , 'setContractProxy' , [ ethers . keccak256 ( ethers . toUtf8Bytes ( 'GraphPayments' ) ) , GraphPaymentsProxy ] , { id : 'setContractProxy_GraphPayments' } )
29- const setProxyPaymentsEscrow = m . call ( Controller , 'setContractProxy' , [ ethers . keccak256 ( ethers . toUtf8Bytes ( 'PaymentsEscrow' ) ) , PaymentsEscrowProxy ] , { id : 'setContractProxy_PaymentsEscrow' } )
30-
31- // Deploy dummy contract to signal that all periphery contracts are registered
32- const HorizonRegistered = m . contract ( 'Dummy' , DummyArtifact , [ ] , {
33- id : 'RegisteredDummy' ,
34- after : [
35- setProxyHorizonStaking ,
36- setProxyGraphPayments ,
37- setProxyPaymentsEscrow ,
38- ] ,
39- } )
40-
41- return { HorizonStakingProxy, GraphPaymentsProxy, PaymentsEscrowProxy, HorizonRegistered, GraphPaymentsProxyAdmin, PaymentsEscrowProxyAdmin }
26+ m . call ( Controller , 'setContractProxy' , [ ethers . keccak256 ( ethers . toUtf8Bytes ( 'Staking' ) ) , HorizonStakingProxy ] , { id : 'setContractProxy_HorizonStaking' } )
27+ m . call ( Controller , 'setContractProxy' , [ ethers . keccak256 ( ethers . toUtf8Bytes ( 'GraphPayments' ) ) , GraphPaymentsProxy ] , { id : 'setContractProxy_GraphPayments' } )
28+ m . call ( Controller , 'setContractProxy' , [ ethers . keccak256 ( ethers . toUtf8Bytes ( 'PaymentsEscrow' ) ) , PaymentsEscrowProxy ] , { id : 'setContractProxy_PaymentsEscrow' } )
29+
30+ return { HorizonStakingProxy, GraphPaymentsProxy, PaymentsEscrowProxy, GraphPaymentsProxyAdmin, PaymentsEscrowProxyAdmin }
4231} )
0 commit comments