|
| 1 | +/* global artifacts */ |
| 2 | + |
| 3 | +const fs = require('fs') |
| 4 | +// |
| 5 | +// lib/utils |
| 6 | +// |
| 7 | +module.exports = async function(deployer, network) { |
| 8 | + let contracts = { |
| 9 | + SafeMath: artifacts.require( |
| 10 | + 'openzeppelin-solidity/contracts/math/SafeMath.sol' |
| 11 | + ), |
| 12 | + Math: artifacts.require('openzeppelin-solidity/contracts/math/Math.sol'), |
| 13 | + ECVerify: artifacts.require('./lib/ECVerify.sol'), |
| 14 | + BytesLib: artifacts.require('./lib/BytesLib.sol'), |
| 15 | + RLP: artifacts.require('./lib/RLP.sol'), |
| 16 | + MerklePatriciaProof: artifacts.require('./lib/MerklePatriciaProof.sol'), |
| 17 | + Merkle: artifacts.require('./lib/Merkle.sol'), |
| 18 | + RLPEncode: artifacts.require('./lib/RLPEncode.sol'), |
| 19 | + Common: artifacts.require('./lib/Common.sol'), |
| 20 | + RootChain: artifacts.require('./RootChain.sol'), |
| 21 | + DepositManager: artifacts.require('./DepositManager.sol'), |
| 22 | + WithdrawManager: artifacts.require('./WithdrawManager.sol'), |
| 23 | + TestToken: artifacts.require('./token/TestToken.sol'), |
| 24 | + RootERC721: artifacts.require('./token/RootERC721.sol'), |
| 25 | + MaticWETH: artifacts.require('./token/MaticWETH.sol'), |
| 26 | + StakeManager: artifacts.require('./root/StakeManager.sol'), |
| 27 | + ExitNFT: artifacts.require('./token/ExitNFT.sol'), |
| 28 | + TxValidator: artifacts.require('./proofs/TxValidator.sol'), |
| 29 | + ERC20Validator: artifacts.require('./proofs/ERC20Validator.sol'), |
| 30 | + ExitValidator: artifacts.require('./proofs/ExitValidator.sol'), |
| 31 | + NonceValidator: artifacts.require('./proofs/NonceValidator.sol'), |
| 32 | + ERC721Validator: artifacts.require('./proofs/ERC721Validator.sol'), |
| 33 | + DepositValidator: artifacts.require('./proofs/DepositValidator.sol') |
| 34 | + } |
| 35 | + let addressData = {} |
| 36 | + const keys = Object.keys(contracts) |
| 37 | + for (let i = 0; i < keys.length; i++) { |
| 38 | + let c = await contracts[keys[i]].deployed() |
| 39 | + addressData[keys[i]] = c.address |
| 40 | + console.log(addressData[keys[i]], keys[i], c.address) |
| 41 | + } |
| 42 | + |
| 43 | + let data = JSON.stringify(addressData) |
| 44 | + console.log(data) |
| 45 | + fs.writeFileSync('contracts2.json', data) |
| 46 | +} |
0 commit comments