From 6e3e43d35bef6d9bff1fe62599d18f5d867d5eeb Mon Sep 17 00:00:00 2001 From: Hendrik Hofstadt Date: Thu, 26 Aug 2021 13:33:29 +0200 Subject: [PATCH] Deploy plain ERC20 as test token Previously we were using a Wormhole Wrapped asset which could cause confusions Change-Id: Id3d52c30dad839ab97caed6ea892555f7a9f12a3 --- ethereum/scripts/deploy_test_token.js | 30 +++++++-------------------- 1 file changed, 8 insertions(+), 22 deletions(-) diff --git a/ethereum/scripts/deploy_test_token.js b/ethereum/scripts/deploy_test_token.js index 17c8ff23..c58864b6 100644 --- a/ethereum/scripts/deploy_test_token.js +++ b/ethereum/scripts/deploy_test_token.js @@ -1,39 +1,25 @@ // run this script with truffle exec -const TokenImplementation = artifacts.require("TokenImplementation") +const ERC20 = artifacts.require("ERC20PresetMinterPauser") -module.exports = async function(callback) { +module.exports = async function (callback) { try { const accounts = await web3.eth.getAccounts(); // deploy token contract - const tokenAddress = (await TokenImplementation.new()).address; - const token = new web3.eth.Contract(TokenImplementation.abi, tokenAddress); + const tokenAddress = (await ERC20.new("Ethereum Test Token", "TKN")).address; + const token = new web3.eth.Contract(ERC20.abi, tokenAddress); - console.log("Token deployed at: "+tokenAddress); - - // initialize token contract - await token.methods.initialize( - "Test Token", - "TKN", - "18", // decimals - accounts[0], // owner - "0", - "0x00000000000000000000000000000000" - ).send({ - from:accounts[0], - gas:1000000 - }); + console.log("Token deployed at: " + tokenAddress); // mint 1000 units await token.methods.mint(accounts[0], "1000000000000000000000").send({ - from:accounts[0], - gas:1000000 + from: accounts[0], + gas: 1000000 }); callback(); - } - catch (e) { + } catch (e) { callback(e); } } \ No newline at end of file