-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathdeploy_token.js
More file actions
40 lines (34 loc) · 1.5 KB
/
deploy_token.js
File metadata and controls
40 lines (34 loc) · 1.5 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
/*
* Usage: npx hardhat deployToken --network <network>
* Verify: npx hardhat verify --network <network> <contract address>
*
* Notes:
* You need to have a .env file based on .env-template.
*/
const metadata = require("@superfluid-finance/metadata");
task("deployToken", "Deploy Pure Super Token")
.setAction(async (taskArgs, hre) => {
try {
const chainId = await hre.getChainId();
const superTokenFactoryAddr = metadata.networks.filter((item) => item.chainId == chainId)[0]
.contractsV1.superTokenFactory;
console.log(`network: ${hre.network.name}`);
console.log(`chainId: ${chainId}`);
console.log(`rpc: ${hre.network.config.url}`);
console.log(`deployer address`, (await hre.ethers.getSigners())[0].address);
console.log("superTokenFactory", superTokenFactoryAddr);
// deploy MintablePureSuperToken Logic Contract
const GoldLiteProxy = await hre.ethers.getContractFactory("GoldLiteProxy");
const goldLiteProxy = await GoldLiteProxy.deploy();
// initialize MintablePureSuperToken Contract
await goldLiteProxy.initialize(
superTokenFactoryAddr,
"Astro Gold Lite",
"ALITE",
(await hre.ethers.getSigners())[0].address
);
console.log("GoldLiteProxy deployed to:", goldLiteProxy.address);
} catch (error) {
console.log(error);
}
});