0

How do I determine what functions aren't implementing? I will paste the code from both the token and crowdsale contract if needed (which I suspect it will be).

1

Go through the Solidity documentation to understand the syntax and how to import other files and libraries in your contract.

0

A token does not necessarily require a name or a symbol. Those are only for visualization purposes - to be displayed for example in Etherscan when displaying token details.

However, if you wish to add those details to your token you can inherit from OpenZeppelin's DetailedERC20 which adds those details.

The total supply of a token is saved in the BasicToken contract. You should inherit from that contract and add the required total supply in a constructor. Something like this:

contract OwnToken is DetailedERC20, BasicToken 
{
    constructor(uint256 initialAmount, string _name, uint8 _decimals, string _symbol) 
    DetailedERC20(_name, _symbol, _decimals)
    public
    {
        totalSupply_ = initialAmount;
    }
}
5
  • Hi Lauri, thank you for the info. I now need to know which contracts to use in remix to get a final result of a token contract and a crowdsale contract that work together. I also need to know where I add the name, symbol and total supply. Also, I read somewhere that I should add a 'using' statement but again, which contrtact to put that in. And finally, do I change the basictoken.sol to the name of my token or does that matter? Many thanks again! – user42515 Sep 11 '18 at 11:39
  • Hi Lauri, I have been working on this and I have one question...where do I add the above constructor? ie. which file and where in the file or do I substitute the above for an existing constructor and if so, in which file? Thanks again. – user42515 Sep 12 '18 at 9:28
  • Create a new file for your own token - in my example it's called OwnToken. That way you can easily add functionality to it without modifying the original OpenZeppelin "templates". – Lauri Peltonen Sep 12 '18 at 9:33
  • In MEW and get the following msg: "throw" is deprecated in favour of "revert()", "require()" and "assert()". if(!_spender.call(bytes4(bytes32(sha3("receiveApproval(address,uint256,address,bytes)"))), msg.sender, _value, this, _extraData)) { throw; } ^---^, for this line: if(!_spender.call(bytes4(bytes32(sha3("receiveApproval(address,uint256,address,bytes)"))), msg.sender, _value, this, _extraData)) { throw; } I don't know how to fix it. – user42515 Sep 12 '18 at 13:35
  • I couldn't figure out how to use zeppelinOS or remix, although I know how to use remix, I couldn't get it to work because I got an error saying contract can't implement all functions. Also, I ran the contracts through Securify but every contract I ran it gave me lots of errors. – user42515 Sep 12 '18 at 13:42

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.