Hi, I only have question that I’m not clear enough.
So, currently I have a Token and a Crowdsale.
I give my Token (which inherit ERC20Detailed, ERC20Mintable) an initial supply.
Then transfer it to my Crowdsale to make public able to purchase the token from my contract.
Since I already implemented ERC20Mintable to my token.
I should be able to use mint function to add my total supply anytime.
I did able to do this using truffle, after getting the token instance (Token.deployed()).
For example, something like this => token.mint(target_addr, amount)
My questions are:
-
How to call the method after it is deployed (either in testnet or mainnet) without using truffle ?
In my case, I used web3.js. I can access mint function from the Token Contract instance:
For example: instance.methods.mint(target_addr, amount)
It is return TRUE value, but it is not adding any total supply value. (truffle does)
Is there any example, how to call mint function after the contract is deployed? -
Let’s say I manage to run the mint function.
I wonder, does not this mean mint can be called by anyone ?
They just need to get the ABI and contract address, then can use the mint function.
While those information can be fetched from Etherscan.
How mint know, if the caller is the onlyMinter, after it is deployed ?
Because mint function did not ask parameter for something like private key, or any credentials,
to show that the caller is the onlyMinter.
Please, help me to understand this.