@@ -8,10 +8,12 @@ const Locker = artifacts.require("./Locker.sol");
8
8
const LoanManager_1_0_12 = artifacts . require ( "./legacy/1.0.12/LoanManager_1_0_12.sol" ) ;
9
9
const Exchange = artifacts . require ( "./Exchange.sol" ) ;
10
10
11
- module . exports = async function ( deployer , network , accounts ) {
11
+ module . exports = async function ( deployer , network , accounts ) {
12
12
deployer . then ( async ( ) => {
13
- const monetarySupervisor = MonetarySupervisor . at ( MonetarySupervisor . address ) ;
14
- const feeAccount = FeeAccount . at ( FeeAccount . address ) ;
13
+ const [ monetarySupervisor , feeAccount ] = await Promise . all ( [
14
+ MonetarySupervisor . at ( MonetarySupervisor . address ) ,
15
+ FeeAccount . at ( FeeAccount . address ) ,
16
+ ] ) ;
15
17
16
18
const oldToken = await TokenAEur . new ( accounts [ 0 ] , FeeAccount . address ) ;
17
19
@@ -25,32 +27,32 @@ module.exports = async function(deployer, network, accounts) {
25
27
const oldExchange = await Exchange . new ( accounts [ 0 ] , oldToken . address , Rates . address ) ;
26
28
27
29
await Promise . all ( [
28
- oldLoanManager . grantPermission ( accounts [ 0 ] , "StabilityBoard" ) ,
29
- oldLocker . grantPermission ( accounts [ 0 ] , "StabilityBoard" ) ,
30
- oldExchange . grantPermission ( accounts [ 0 ] , "StabilityBoard" )
30
+ oldLoanManager . grantPermission ( accounts [ 0 ] , web3 . utils . asciiToHex ( "StabilityBoard" ) ) ,
31
+ oldLocker . grantPermission ( accounts [ 0 ] , web3 . utils . asciiToHex ( "StabilityBoard" ) ) ,
32
+ oldExchange . grantPermission ( accounts [ 0 ] , web3 . utils . asciiToHex ( "StabilityBoard" ) ) ,
31
33
] ) ;
32
34
33
35
await Promise . all ( [
34
- oldToken . grantPermission ( MonetarySupervisor . address , "MonetarySupervisor" ) ,
36
+ oldToken . grantPermission ( MonetarySupervisor . address , web3 . utils . asciiToHex ( "MonetarySupervisor" ) ) ,
35
37
36
38
monetarySupervisor . setAcceptedLegacyAugmintToken ( oldToken . address , true ) ,
37
39
38
- oldToken . grantPermission ( accounts [ 0 ] , "MonetarySupervisor" ) , // "hack" for test to issue
40
+ oldToken . grantPermission ( accounts [ 0 ] , web3 . utils . asciiToHex ( "MonetarySupervisor" ) ) , // "hack" for test to issue
39
41
40
42
/* Locker permissions & products */
41
- monetarySupervisor . grantPermission ( oldLocker . address , "Locker" ) ,
42
- feeAccount . grantPermission ( oldLocker . address , "NoTransferFee" ) ,
43
+ monetarySupervisor . grantPermission ( oldLocker . address , web3 . utils . asciiToHex ( "Locker" ) ) ,
44
+ feeAccount . grantPermission ( oldLocker . address , web3 . utils . asciiToHex ( "NoTransferFee" ) ) ,
43
45
oldLocker . addLockProduct ( 80001 , 31536000 , 1000 , true ) , // 365 days, 8% p.a.
44
46
oldLocker . addLockProduct ( 1 , 60 , 1000 , true ) , // 1 minute for testing, ~69.15% p.a.
45
47
46
48
/* LoanManager permissions & products */
47
- monetarySupervisor . grantPermission ( oldLoanManager . address , "LoanManager" ) ,
48
- feeAccount . grantPermission ( oldLoanManager . address , "NoTransferFee" ) ,
49
+ monetarySupervisor . grantPermission ( oldLoanManager . address , web3 . utils . asciiToHex ( "LoanManager" ) ) ,
50
+ feeAccount . grantPermission ( oldLoanManager . address , web3 . utils . asciiToHex ( "NoTransferFee" ) ) ,
49
51
oldLoanManager . addLoanProduct ( 1 , 999999 , 990000 , 1000 , 50000 , true ) , // defaults in 1 secs for testing ? p.a.
50
52
oldLoanManager . addLoanProduct ( 3600 , 999989 , 980000 , 1000 , 50000 , true ) , // due in 1hr for testing repayments ? p.a.
51
53
oldLoanManager . addLoanProduct ( 31536000 , 860000 , 550000 , 1000 , 50000 , true ) , // 365d, 14% p.a.
52
54
/* Exchange permissions */
53
- feeAccount . grantPermission ( oldExchange . address , "NoTransferFee" )
55
+ feeAccount . grantPermission ( oldExchange . address , web3 . utils . asciiToHex ( "NoTransferFee" ) ) ,
54
56
] ) ;
55
57
56
58
await oldToken . issueTo ( accounts [ 0 ] , 20000 ) ; // issue some to account 0
@@ -59,12 +61,12 @@ module.exports = async function(deployer, network, accounts) {
59
61
oldToken . transferAndNotify ( oldLocker . address , 1500 , 0 ) ,
60
62
oldToken . transferAndNotify ( oldLocker . address , 1600 , 1 ) ,
61
63
62
- oldLoanManager . newEthBackedLoan ( 0 , { value : web3 . toWei ( 0.1 ) } ) ,
63
- oldLoanManager . newEthBackedLoan ( 2 , { value : web3 . toWei ( 0.2 ) } ) ,
64
+ oldLoanManager . newEthBackedLoan ( 0 , { value : web3 . utils . toWei ( " 0.1" ) } ) ,
65
+ oldLoanManager . newEthBackedLoan ( 2 , { value : web3 . utils . toWei ( " 0.2" ) } ) ,
64
66
oldToken . transferAndNotify ( oldExchange . address , 2000 , 1010000 ) ,
65
67
oldToken . transferAndNotify ( oldExchange . address , 1100 , 980000 ) ,
66
- oldExchange . placeBuyTokenOrder ( 990000 , { value : web3 . toWei ( 0.01 ) } ) ,
67
- oldExchange . placeBuyTokenOrder ( 1020000 , { value : web3 . toWei ( 0.011 ) } )
68
+ oldExchange . placeBuyTokenOrder ( 990000 , { value : web3 . utils . toWei ( " 0.01" ) } ) ,
69
+ oldExchange . placeBuyTokenOrder ( 1020000 , { value : web3 . utils . toWei ( " 0.011" ) } ) ,
68
70
] ) ;
69
71
70
72
console . log (
0 commit comments