1
1
const semver = require ( "semver" ) ;
2
2
const childProcess = require ( "child_process" ) ;
3
- const ApprovedTransfer = require ( "../build/ApprovedTransfer" ) ;
4
3
const RecoveryManager = require ( "../build/RecoveryManager" ) ;
5
4
const MultiSig = require ( "../build/MultiSigWallet" ) ;
6
5
const ModuleRegistry = require ( "../build/ModuleRegistry" ) ;
7
6
const Upgrader = require ( "../build/SimpleUpgrader" ) ;
8
7
const DeployManager = require ( "../utils/deploy-manager.js" ) ;
9
8
const MultisigExecutor = require ( "../utils/multisigexecutor.js" ) ;
10
- const TokenPriceProvider = require ( "../build/TokenPriceProvider" ) ;
11
- const MakerRegistry = require ( "../build/MakerRegistry" ) ;
12
- const ScdMcdMigration = require ( "../build/ScdMcdMigration" ) ;
13
- const MakerV2Manager = require ( "../build/MakerV2Manager" ) ;
14
- const TransferManager = require ( "../build/TransferManager" ) ;
15
9
16
10
const utils = require ( "../utils/utilities.js" ) ;
17
11
18
12
const TARGET_VERSION = "1.6.0" ;
19
- const MODULES_TO_ENABLE = [ "ApprovedTransfer" , " RecoveryManager" , "MakerV2Manager" , "TransferManager "] ;
20
- const MODULES_TO_DISABLE = [ "UniswapManager" ] ;
13
+ const MODULES_TO_ENABLE = [ "RecoveryManager" ] ;
14
+ const MODULES_TO_DISABLE = [ ] ;
21
15
22
- const BACKWARD_COMPATIBILITY = 1 ;
16
+ const BACKWARD_COMPATIBILITY = 2 ;
23
17
24
18
const deploy = async ( network ) => {
25
19
if ( ! [ "kovan" , "kovan-fork" , "staging" , "prod" ] . includes ( network ) ) {
@@ -50,33 +44,10 @@ const deploy = async (network) => {
50
44
const MultiSigWrapper = await deployer . wrapDeployedContract ( MultiSig , config . contracts . MultiSigWallet ) ;
51
45
const multisigExecutor = new MultisigExecutor ( MultiSigWrapper , deploymentWallet , config . multisig . autosign , { gasPrice } ) ;
52
46
53
- // //////////////////////////////////
54
- // Deploy infrastructure contracts
55
- // //////////////////////////////////
56
-
57
- // Deploy and configure Maker Registry
58
- const ScdMcdMigrationWrapper = await deployer . wrapDeployedContract ( ScdMcdMigration , config . defi . maker . migration ) ;
59
- const vatAddress = await ScdMcdMigrationWrapper . vat ( ) ;
60
- const MakerRegistryWrapper = await deployer . deploy ( MakerRegistry , { } , vatAddress ) ;
61
- const wethJoinAddress = await ScdMcdMigrationWrapper . wethJoin ( ) ;
62
- const addCollateralTransaction = await MakerRegistryWrapper . contract . addCollateral ( wethJoinAddress , { gasPrice } ) ;
63
- await MakerRegistryWrapper . verboseWaitForTransaction ( addCollateralTransaction , `Adding join adapter ${ wethJoinAddress } to the MakerRegistry` ) ;
64
- const changeMakerRegistryOwnerTx = await MakerRegistryWrapper . contract . changeOwner ( config . contracts . MultiSigWallet , { gasPrice } ) ;
65
- await MakerRegistryWrapper . verboseWaitForTransaction ( changeMakerRegistryOwnerTx , "Set the MultiSig as the owner of the MakerRegistry" ) ;
66
- const TokenPriceProviderWrapper = await deployer . wrapDeployedContract ( TokenPriceProvider , config . contracts . TokenPriceProvider ) ;
67
-
68
47
// //////////////////////////////////
69
48
// Deploy new modules
70
49
// //////////////////////////////////
71
50
72
- const ApprovedTransferWrapper = await deployer . deploy (
73
- ApprovedTransfer ,
74
- { } ,
75
- config . contracts . ModuleRegistry ,
76
- config . modules . GuardianStorage ,
77
- ) ;
78
- newModuleWrappers . push ( ApprovedTransferWrapper ) ;
79
-
80
51
const RecoveryManagerWrapper = await deployer . deploy (
81
52
RecoveryManager ,
82
53
{ } ,
@@ -89,58 +60,20 @@ const deploy = async (network) => {
89
60
) ;
90
61
newModuleWrappers . push ( RecoveryManagerWrapper ) ;
91
62
92
- const MakerV2ManagerWrapper = await deployer . deploy (
93
- MakerV2Manager ,
94
- { } ,
95
- config . contracts . ModuleRegistry ,
96
- config . modules . GuardianStorage ,
97
- config . defi . maker . migration ,
98
- config . defi . maker . pot ,
99
- config . defi . maker . jug ,
100
- MakerRegistryWrapper . contractAddress ,
101
- config . defi . uniswap . factory ,
102
- ) ;
103
- newModuleWrappers . push ( MakerV2ManagerWrapper ) ;
104
-
105
- const TransferManagerWrapper = await deployer . deploy (
106
- TransferManager ,
107
- { } ,
108
- config . contracts . ModuleRegistry ,
109
- config . modules . TransferStorage ,
110
- config . modules . GuardianStorage ,
111
- TokenPriceProviderWrapper . contractAddress ,
112
- config . settings . securityPeriod || 0 ,
113
- config . settings . securityWindow || 0 ,
114
- config . settings . defaultLimit || "1000000000000000000" ,
115
- [ "test" , "staging" , "prod" ] . includes ( network ) ? config . modules . TransferManager : "0x0000000000000000000000000000000000000000" ,
116
- ) ;
117
- newModuleWrappers . push ( TransferManagerWrapper ) ;
118
-
119
63
// /////////////////////////////////////////////////
120
64
// Update config and Upload ABIs
121
65
// /////////////////////////////////////////////////
122
66
123
67
configurator . updateModuleAddresses ( {
124
- ApprovedTransfer : ApprovedTransferWrapper . contractAddress ,
125
68
RecoveryManager : RecoveryManagerWrapper . contractAddress ,
126
- MakerV2Manager : MakerV2ManagerWrapper . contractAddress ,
127
- TransferManager : TransferManagerWrapper . contractAddress ,
128
- } ) ;
129
-
130
- configurator . updateInfrastructureAddresses ( {
131
- MakerRegistry : MakerRegistryWrapper . contractAddress ,
132
69
} ) ;
133
70
134
71
const gitHash = childProcess . execSync ( "git rev-parse HEAD" ) . toString ( "utf8" ) . replace ( / \n $ / , "" ) ;
135
72
configurator . updateGitHash ( gitHash ) ;
136
73
await configurator . save ( ) ;
137
74
138
75
await Promise . all ( [
139
- abiUploader . upload ( ApprovedTransferWrapper , "modules" ) ,
140
76
abiUploader . upload ( RecoveryManagerWrapper , "modules" ) ,
141
- abiUploader . upload ( MakerV2ManagerWrapper , "modules" ) ,
142
- abiUploader . upload ( TransferManagerWrapper , "modules" ) ,
143
- abiUploader . upload ( MakerRegistryWrapper , "contracts" ) ,
144
77
] ) ;
145
78
146
79
// //////////////////////////////////
@@ -157,7 +90,6 @@ const deploy = async (network) => {
157
90
// Deploy and Register upgraders
158
91
// //////////////////////////////////
159
92
160
-
161
93
let fingerprint ;
162
94
const versions = await versionUploader . load ( BACKWARD_COMPATIBILITY ) ;
163
95
for ( let idx = 0 ; idx < versions . length ; idx += 1 ) {
@@ -208,7 +140,6 @@ const deploy = async (network) => {
208
140
await versionUploader . upload ( newVersion ) ;
209
141
} ;
210
142
211
-
212
143
module . exports = {
213
144
deploy,
214
145
} ;
0 commit comments