swap-contracts-module/scripts/setup-swap.js

27 lines
859 B
JavaScript
Raw Normal View History

2021-01-29 05:26:28 +00:00
const hre = require("hardhat");
async function main() {
// Deploy ERC20 Token
// XXX Who is default signer here?
const ERC20 = await hre.ethers.getContractFactory("ERC20PresetMinterPauser");
var erc20 = await ERC20.deploy("TestToken", "TEST");
await erc20.deployed();
console.log("ERC20: ", erc20.address);
2021-01-29 05:27:31 +00:00
// Deploy SwapFactory
const SimpleSwapFactory = await hre.ethers.getContractFactory("SimpleSwapFactory");
var simpleSwapFactory = await SimpleSwapFactory.deploy(erc20.address);
await simpleSwapFactory.deployed();
console.log("SimpleSwapFactory: ", simpleSwapFactory.address);
2021-01-29 05:26:28 +00:00
}
// We recommend this pattern to be able to use async/await everywhere
// and properly handle errors.
main()
.then(() => process.exit(0))
.catch(error => {
console.error(error);
process.exit(1);
});