@@ -20,47 +20,47 @@ module.exports = async function (deployer, network, accounts) {
2020 console . log ( "Chaintype is:" , chaintype ) ;
2121 console . log ( "Deployer is:" , accounts [ 0 ] ) ;
2222
23- // const deploymentOptions = CONFIG.chains[chainid] || CONFIG.chains.default;
23+ const deploymentOptions = CONFIG . chains [ chainid ] || CONFIG . chains . default ;
2424
25- // //only for standard private chains
26- // if (chainid > 1000 && !process.env.KYC) {
27- // let IexecInterfaceInstance;
28- // const IexecProxyInstance = await ERC1538Proxy.deployed();
29- // const totalAmount = ACCOUNTS.reduce(
30- // (acc, { amount }) => acc.add(web3.utils.toBN(amount)),
31- // web3.utils.toBN(0)
32- // );
25+ //only for standard private chains
26+ if ( chainid > 1000 && ! process . env . KYC ) {
27+ let IexecInterfaceInstance ;
28+ const IexecProxyInstance = await ERC1538Proxy . deployed ( ) ;
29+ const totalAmount = ACCOUNTS . reduce (
30+ ( acc , { amount } ) => acc . add ( web3 . utils . toBN ( amount ) ) ,
31+ web3 . utils . toBN ( 0 )
32+ ) ;
3333
34- // // deposit
35- // console.log("Depositing " + totalAmount);
36- // switch (deploymentOptions.asset) {
37- // case "Token":
38- // IexecInterfaceInstance = await IexecInterfaceToken.at(
39- // IexecProxyInstance.address
40- // );
41- // const RLCInstance = await RLC.deployed();
42- // await RLCInstance.approveAndCall(
43- // IexecInterfaceInstance.address,
44- // totalAmount,
45- // "0x"
46- // );
47- // break;
48- // case "Native":
49- // IexecInterfaceInstance = await IexecInterfaceNative.at(
50- // IexecProxyInstance.address
51- // );
52- // await IexecInterfaceInstance.deposit({
53- // from: accounts[0],
54- // value: totalAmount.mul(web3.utils.toBN(10 ** 9)),
55- // });
56- // break;
57- // }
34+ // deposit
35+ console . log ( "Depositing " + totalAmount ) ;
36+ switch ( deploymentOptions . asset ) {
37+ case "Token" :
38+ IexecInterfaceInstance = await IexecInterfaceToken . at (
39+ IexecProxyInstance . address
40+ ) ;
41+ const RLCInstance = await RLC . deployed ( ) ;
42+ await RLCInstance . approveAndCall (
43+ IexecInterfaceInstance . address ,
44+ totalAmount ,
45+ "0x"
46+ ) ;
47+ break ;
48+ case "Native" :
49+ IexecInterfaceInstance = await IexecInterfaceNative . at (
50+ IexecProxyInstance . address
51+ ) ;
52+ await IexecInterfaceInstance . deposit ( {
53+ from : accounts [ 0 ] ,
54+ value : totalAmount . mul ( web3 . utils . toBN ( 10 ** 9 ) ) ,
55+ } ) ;
56+ break ;
57+ }
5858
59- // // all transfers
60- // for (account of ACCOUNTS) {
61- // const { address, amount } = account
62- // console.log("Transferring for address " + address + ": " + amount);
63- // await IexecInterfaceInstance.transfer(address, amount);
64- // }
65- // }
59+ // all transfers
60+ for ( account of ACCOUNTS ) {
61+ const { address, amount } = account
62+ console . log ( "Transferring for address " + address + ": " + amount ) ;
63+ await IexecInterfaceInstance . transfer ( address , amount ) ;
64+ }
65+ }
6666} ;
0 commit comments