I have deployed a regular ERC20-compliant token contract through the Remix compiler and MetaMask. After doing so, the deployed token shows up on Etherscan as a token. However, when I try to deploy a token contract that is owned, it requires me to deploy the token contract and the owner contract separately, resulting in two isolated contracts that are from the same source code.
I use the very simple contract code from the official Ethereum website:
https://ethereum.org/token#full-coin-code
Any help you be appreciated
Best Answer
You don't need to deploy the inherited contract (owned) separately, you just need to inherit it in your token contract by adding in
"is owned"
(example below).Some more information about inheritance here. http://solidity.readthedocs.io/en/develop/contracts.html#inheritance
Then in Remix, you can choose to deploy MyToken only. Since the contract source code refers to owned (
"is owned"
), theowned
code will be included in the compiled MyToken code.Deploy MyToken only: