File tree 5 files changed +59
-3
lines changed
5 files changed +59
-3
lines changed Original file line number Diff line number Diff line change
1
+ import { HardhatRuntimeEnvironment } from 'hardhat/types' ;
2
+ import { DeployFunction } from 'hardhat-deploy/types' ;
3
+ import { ADDRESSES , CONSTANTS } from '../helpers/gov-constants' ;
4
+
5
+ const func : DeployFunction = async function ( hre : HardhatRuntimeEnvironment ) {
6
+ const { deployments, getNamedAccounts } = hre ;
7
+ const { deploy, log } = deployments ;
8
+ const { deployer } = await getNamedAccounts ( ) ;
9
+
10
+ log ( `Deployer: ${ deployer } \n` ) ;
11
+
12
+ const optimisticGov = await deployments . getOrNull ( 'SwellchainOptimisticGov' ) ;
13
+
14
+ if ( optimisticGov ) {
15
+ log ( `Reusing optimistic governance at: ${ optimisticGov . address } ` ) ;
16
+ } else {
17
+ await deploy ( 'SwellchainOptimisticGov' , {
18
+ args : [
19
+ ADDRESSES [ 'OVM_L2_MESSENGER' ] ,
20
+ ADDRESSES [ 'ETHEREUM_GOV_EXECUTOR_SEPOLIA' ] ,
21
+ CONSTANTS [ 'DELAY' ] ,
22
+ CONSTANTS [ 'GRACE_PERIOD' ] ,
23
+ CONSTANTS [ 'MIN_DELAY' ] ,
24
+ CONSTANTS [ 'MAX_DELAY' ] ,
25
+ ADDRESSES [ 'OVM_GUARDIAN' ] ,
26
+ ] ,
27
+ contract : 'OptimismBridgeExecutor' ,
28
+ from : deployer ,
29
+ log : true ,
30
+ } ) ;
31
+ }
32
+ } ;
33
+
34
+ export default func ;
35
+ func . dependencies = [ ] ;
36
+ func . tags = [ 'SwellchainOptimisticGov' ] ;
Original file line number Diff line number Diff line change @@ -22,6 +22,7 @@ import {
22
22
eEthereumNetwork ,
23
23
eNetwork ,
24
24
eOptimismNetwork ,
25
+ eSwellchainNetwork ,
25
26
ePolygonNetwork ,
26
27
eXDaiNetwork ,
27
28
} from './helpers/types' ;
@@ -174,6 +175,8 @@ const hardhatConfig: HardhatUserConfig = {
174
175
l1 : 'sepolia' ,
175
176
} ,
176
177
} ,
178
+ [ eSwellchainNetwork . main ] : getCommonNetworkConfig ( eSwellchainNetwork . main , 1923 ) ,
179
+ [ eSwellchainNetwork . testnet ] : getCommonNetworkConfig ( eSwellchainNetwork . testnet , 1924 ) ,
177
180
hardhat : {
178
181
accounts : accounts . map ( ( { secretKey, balance } : { secretKey : string ; balance : string } ) => ( {
179
182
privateKey : secretKey ,
Original file line number Diff line number Diff line change 3
3
eEthereumNetwork ,
4
4
eOptimismNetwork ,
5
5
ePolygonNetwork ,
6
+ eSwellchainNetwork ,
6
7
eXDaiNetwork ,
7
8
iParamsPerNetwork ,
8
9
} from './helpers/types' ;
@@ -31,4 +32,6 @@ export const NETWORKS_RPC_URL: iParamsPerNetwork<string> = {
31
32
[ eArbitrumNetwork . arbitrumTestnet ] : `https://sepolia-rollup.arbitrum.io/rpc` ,
32
33
[ eOptimismNetwork . main ] : `https://opt-mainnet.g.alchemy.com/v2/${ ALCHEMY_KEY } ` ,
33
34
[ eOptimismNetwork . testnet ] : "https://sepolia.optimism.io" ,
35
+ [ eSwellchainNetwork . main ] : "https://swell-mainnet.alt.technology" ,
36
+ [ eSwellchainNetwork . testnet ] : "https://swell-testnet.alt.technology" ,
34
37
} ;
Original file line number Diff line number Diff line change @@ -7,7 +7,8 @@ export type eNetwork =
7
7
| ePolygonNetwork
8
8
| eXDaiNetwork
9
9
| eArbitrumNetwork
10
- | eOptimismNetwork ;
10
+ | eOptimismNetwork
11
+ | eSwellchainNetwork ;
11
12
12
13
export enum eEthereumNetwork {
13
14
goerli = 'goerli' ,
@@ -23,6 +24,11 @@ export enum ePolygonNetwork {
23
24
mumbai = 'mumbai' ,
24
25
}
25
26
27
+ export enum eSwellchainNetwork {
28
+ main = 'swellchain' ,
29
+ testnet = 'swell_testnet' ,
30
+ }
31
+
26
32
export enum eXDaiNetwork {
27
33
xdai = 'xdai' ,
28
34
}
@@ -53,7 +59,8 @@ export type iParamsPerNetwork<T> =
53
59
| iPolygonParamsPerNetwork < T >
54
60
| iXDaiParamsPerNetwork < T >
55
61
| iArbitrumParamsPerNetwork < T >
56
- | iOptimismParamsPerNetwork < T > ;
62
+ | iOptimismParamsPerNetwork < T >
63
+ | iSwellchainParamsPerNetwork < T > ;
57
64
58
65
export interface iParamsPerNetworkAll < T >
59
66
extends iEthereumParamsPerNetwork < T > ,
@@ -88,6 +95,11 @@ export interface iOptimismParamsPerNetwork<T> {
88
95
[ eOptimismNetwork . testnet ] : T ;
89
96
}
90
97
98
+ export interface iSwellchainParamsPerNetwork < T > {
99
+ [ eSwellchainNetwork . main ] : T ;
100
+ [ eSwellchainNetwork . testnet ] : T ;
101
+ }
102
+
91
103
export interface ObjectString {
92
104
[ key : string ] : string ;
93
105
}
Original file line number Diff line number Diff line change 34
34
"deploy:optimism:testnet" : " hardhat --network optimisticSepolia deploy --tags 'OptimisticGov'" ,
35
35
"deploy:optimism:mainnet" : " hardhat --network optimism deploy --tags 'OptimisticGov'" ,
36
36
"deploy:arbitrum:testnet" : " hardhat --network arbitrum-testnet deploy --tags 'ArbitrumGov'" ,
37
- "deploy:arbitrum:mainnet" : " hardhat --network arbitrum deploy --tags 'ArbitrumGov'"
37
+ "deploy:arbitrum:mainnet" : " hardhat --network arbitrum deploy --tags 'ArbitrumGov'" ,
38
+ "deploy:swellchain:testnet" : " hardhat --network swell_testnet deploy --tags 'SwellchainOptimisticGov'" ,
39
+ "deploy:swellchain:mainnet" : " hardhat --network swellchain deploy --tags 'SwellchainOptimisticGov'"
38
40
},
39
41
"devDependencies" : {
40
42
"@aave/governance-v2" : " ^1.0.0" ,
You can’t perform that action at this time.
0 commit comments