11const semver = require ( "semver" ) ;
22const childProcess = require ( "child_process" ) ;
3- const ApprovedTransfer = require ( "../build/ApprovedTransfer" ) ;
43const RecoveryManager = require ( "../build/RecoveryManager" ) ;
54const MultiSig = require ( "../build/MultiSigWallet" ) ;
65const ModuleRegistry = require ( "../build/ModuleRegistry" ) ;
76const Upgrader = require ( "../build/SimpleUpgrader" ) ;
87const DeployManager = require ( "../utils/deploy-manager.js" ) ;
98const 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" ) ;
159
1610const utils = require ( "../utils/utilities.js" ) ;
1711
1812const 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 = [ ] ;
2115
22- const BACKWARD_COMPATIBILITY = 1 ;
16+ const BACKWARD_COMPATIBILITY = 2 ;
2317
2418const deploy = async ( network ) => {
2519 if ( ! [ "kovan" , "kovan-fork" , "staging" , "prod" ] . includes ( network ) ) {
@@ -50,33 +44,10 @@ const deploy = async (network) => {
5044 const MultiSigWrapper = await deployer . wrapDeployedContract ( MultiSig , config . contracts . MultiSigWallet ) ;
5145 const multisigExecutor = new MultisigExecutor ( MultiSigWrapper , deploymentWallet , config . multisig . autosign , { gasPrice } ) ;
5246
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-
6847 // //////////////////////////////////
6948 // Deploy new modules
7049 // //////////////////////////////////
7150
72- const ApprovedTransferWrapper = await deployer . deploy (
73- ApprovedTransfer ,
74- { } ,
75- config . contracts . ModuleRegistry ,
76- config . modules . GuardianStorage ,
77- ) ;
78- newModuleWrappers . push ( ApprovedTransferWrapper ) ;
79-
8051 const RecoveryManagerWrapper = await deployer . deploy (
8152 RecoveryManager ,
8253 { } ,
@@ -89,58 +60,20 @@ const deploy = async (network) => {
8960 ) ;
9061 newModuleWrappers . push ( RecoveryManagerWrapper ) ;
9162
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-
11963 // /////////////////////////////////////////////////
12064 // Update config and Upload ABIs
12165 // /////////////////////////////////////////////////
12266
12367 configurator . updateModuleAddresses ( {
124- ApprovedTransfer : ApprovedTransferWrapper . contractAddress ,
12568 RecoveryManager : RecoveryManagerWrapper . contractAddress ,
126- MakerV2Manager : MakerV2ManagerWrapper . contractAddress ,
127- TransferManager : TransferManagerWrapper . contractAddress ,
128- } ) ;
129-
130- configurator . updateInfrastructureAddresses ( {
131- MakerRegistry : MakerRegistryWrapper . contractAddress ,
13269 } ) ;
13370
13471 const gitHash = childProcess . execSync ( "git rev-parse HEAD" ) . toString ( "utf8" ) . replace ( / \n $ / , "" ) ;
13572 configurator . updateGitHash ( gitHash ) ;
13673 await configurator . save ( ) ;
13774
13875 await Promise . all ( [
139- abiUploader . upload ( ApprovedTransferWrapper , "modules" ) ,
14076 abiUploader . upload ( RecoveryManagerWrapper , "modules" ) ,
141- abiUploader . upload ( MakerV2ManagerWrapper , "modules" ) ,
142- abiUploader . upload ( TransferManagerWrapper , "modules" ) ,
143- abiUploader . upload ( MakerRegistryWrapper , "contracts" ) ,
14477 ] ) ;
14578
14679 // //////////////////////////////////
@@ -157,7 +90,6 @@ const deploy = async (network) => {
15790 // Deploy and Register upgraders
15891 // //////////////////////////////////
15992
160-
16193 let fingerprint ;
16294 const versions = await versionUploader . load ( BACKWARD_COMPATIBILITY ) ;
16395 for ( let idx = 0 ; idx < versions . length ; idx += 1 ) {
@@ -208,7 +140,6 @@ const deploy = async (network) => {
208140 await versionUploader . upload ( newVersion ) ;
209141} ;
210142
211-
212143module . exports = {
213144 deploy,
214145} ;
0 commit comments