Mint ERC20 balance with a button
This commit is contained in:
parent
813ff83878
commit
4f29bce3c2
|
@ -27,6 +27,10 @@
|
|||
<p id="aliceERC20Balance"></p>
|
||||
<!-- TODO: Add a button here, show erc20 token balance, etc -->
|
||||
|
||||
<form onSubmit="App.mint(); return false;">
|
||||
<button type="submit" class="btn btn-primary">Mint</button>
|
||||
</form>
|
||||
|
||||
</div>
|
||||
<div id="aliceSwap">
|
||||
<h2>Alice Swap</h2>
|
||||
|
|
|
@ -131,6 +131,12 @@ App = {
|
|||
}).catch(function(error) {
|
||||
console.warn(error);
|
||||
});
|
||||
},
|
||||
|
||||
mint: async function () {
|
||||
web3.eth.defaultAccount = web3.eth.accounts[0]
|
||||
var erc20 = await App.contracts.ERC20PresetMinterPauser.deployed()
|
||||
var foo = await erc20.mint(App.aliceAddress, 10000)
|
||||
}
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in New Issue