You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
100 lines
2.1 KiB
100 lines
2.1 KiB
2 years ago
|
# Kaly Chain wKLC Token & Vesting Contract Deploy and Verify
|
||
|
|
||
|
## How to configue `harhat.config.js`
|
||
|
|
||
|
```bash
|
||
|
module.exports = {
|
||
|
solidity: {
|
||
|
compilers: [
|
||
|
{
|
||
|
version: "0.8.11",
|
||
|
settings: {
|
||
|
optimizer: {
|
||
|
enabled: true,
|
||
|
runs: 200,
|
||
|
},
|
||
|
},
|
||
|
}
|
||
|
],
|
||
|
},
|
||
|
networks: {
|
||
|
kaly: {
|
||
|
url: "https://testnetrpc.kalychain.io/rpc",
|
||
|
accounts: ['put your private key here dont forget to remove before uploading to github'],
|
||
|
gas: 3000000,
|
||
|
gasPrice: 8000000000,
|
||
|
|
||
|
}
|
||
|
},
|
||
|
etherscan: {
|
||
|
apiKey: {
|
||
|
kaly: "abc"
|
||
|
},
|
||
|
customChains: [
|
||
|
{
|
||
|
network: "kaly",
|
||
|
chainId: 3889,
|
||
|
allowUnlimitedContractSize: true,
|
||
|
gas: 3000000,
|
||
|
gasPrice: 8000000000,
|
||
|
urls: {
|
||
|
apiURL: "https://testnet.kalyscan.io/api",
|
||
|
browserURL: "https://testnet.kalyscan.io"
|
||
|
}
|
||
|
}
|
||
|
]
|
||
|
}
|
||
|
};
|
||
|
```
|
||
|
|
||
|
## How to deploy wKLC token and Vesting contract
|
||
|
|
||
|
### Deploy token contract
|
||
|
|
||
|
```bash
|
||
|
npx hardhat run scripts/deploy_token.js --network kaly
|
||
|
```
|
||
|
|
||
|
### Deploy token vesting contract
|
||
|
|
||
|
Before deploy, you have to update `scripts/deploy_vesting.js` as you can see below with the wKLC address.
|
||
|
|
||
|
```bash
|
||
|
const TokenVesting = await ethers.getContractFactory("TokenVesting");
|
||
|
const tokenVesting = await TokenVesting.deploy(
|
||
|
Token = "0x069255299Bb729399f3CECaBdc73d15d3D10a2A3"
|
||
|
);
|
||
|
console.log("TokenVesting address:", tokenVesting.address);
|
||
|
}
|
||
|
```
|
||
|
|
||
|
```bash
|
||
|
npx hardhat run scripts/deploy_vesting.js --network kaly
|
||
|
```
|
||
|
|
||
|
|
||
|
Update `scripts/verify_vesting.js` with the Token Vesting address and wKLC address
|
||
|
|
||
|
`verify_vesting.js`
|
||
|
```bash
|
||
|
await hre.run("verify:verify", {
|
||
|
address: Deployed Token Vesting contract address,
|
||
|
constructorArguments: [
|
||
|
0x069255299Bb729399f3CECaBdc73d15d3D10a2A3
|
||
|
]
|
||
|
})
|
||
|
```
|
||
|
|
||
|
The final step is run below commands.
|
||
|
|
||
|
```bash
|
||
|
npx hardhat run scripts/verify_token.js --network kaly
|
||
|
```
|
||
|
|
||
|
```bash
|
||
|
npx hardhat run scripts/verify_vesting.js --network kaly
|
||
|
```
|
||
|
|
||
|
|
||
|
Finally, you will get fully verified wKLC Token and Vesting contracts.
|