Update token decimals for test token

This commit is contained in:
Drew 2022-06-29 15:17:27 +00:00
parent ae69dd1bc8
commit da2fc8b4c6
3 changed files with 11 additions and 4 deletions

View File

@ -5,7 +5,8 @@ pragma solidity ^0.7.6;
import "@openzeppelin/contracts/token/ERC20/ERC20.sol";
contract WormUSD is ERC20 {
constructor(address mintToAddress) ERC20("wormUSD", "WUSD"){
_mint(mintToAddress, 1000000000*10**18);
constructor(address mintToAddress, uint8 decimals, uint256 supply) ERC20("wormUSD", "WUSD"){
_setupDecimals(decimals);
_mint(mintToAddress, supply*10**decimals);
}
}

4
contracts/deploy_token.sh Executable file
View File

@ -0,0 +1,4 @@
#!/bin/bash
set -euo pipefail
npx truffle migrate --config cfg/truffle-config.tokens.js --network goerli --reset

View File

@ -1,9 +1,11 @@
require("dotenv").config({ path: ".env" });
i;
const WormUSD = artifacts.require("WormUSD");
module.exports = async function (deployer, network) {
const mintAddress = process.env.mintToAddress;
const tokenDecimals = process.env.decimals;
const tokenSupply = process.env.supply;
await deployer.deploy(WormUSD, mintAddress);
await deployer.deploy(WormUSD, mintAddress, tokenDecimals, tokenSupply);
};