Openzeppelin-contracts: token/ERC20/StandardToken.sol is missing

Created on 13 Dec 2018  路  6Comments  路  Source: OpenZeppelin/openzeppelin-contracts

Hello, I am getting error when I run compile command from truffle console:

Error: Could not find openzeppelin-solidity/contracts/token/ERC20/StandardToken.sol from any sources; imported from /Users/test/Sites/ethereum/tokenzendr-contract/contracts/BearToken.sol

When I check StandardToken.sol in the path, it's not there. Can somebody please suggest me why its missing or what's the alternative way?

Thank you

question

Most helpful comment

Hello @deepakkbc! You have probably installed version 2.0 of OpenZeppelin (the latest release). In it, StandardToken was renamed to ERC20: change your import statement and your contract should compile.

All 6 comments

Hello @deepakkbc! You have probably installed version 2.0 of OpenZeppelin (the latest release). In it, StandardToken was renamed to ERC20: change your import statement and your contract should compile.

waoo..thank you for quick reply. When I replace stanardToken with erc20.sol, I have started getting so many Undeclared identifier errors like
/Users/deepak/Sites/ethereum/tokenzendr-contract/contracts/TokenZendR.sol:6:24: DeclarationError: Identifier not found or not unique.
contract TokenZendR is Ownable, Pausable {
^-----^
,/Users/deepak/Sites/ethereum/tokenzendr-contract/contracts/TokenZendR.sol:61:68: DeclarationError: Undeclared identifier.
function addNewToken(bytes32 symbol_, address address_) public onlyOwner returns (bool) {

In fact I was following this tutorial https://medium.com/coinmonks/building-ethereum-dapps-with-reactjs-truffle-contract-web3-a-ui-for-tokenzendr-a-smart-bf345478b116

How did you install OpenZeppelin? Please make sure you're actually using version 2.0 (if installed via npm, it should be in your package.json file); ERC20.sol was an interface pre-2.0, not a contract.

For the record:

The docs for OZ-2.0 have StandardToken in them
https://openzeppelin.org/api/docs/token_ERC20_StandardToken.html

But it links to v1.12.0
https://github.com/OpenZeppelin/zeppelin-solidity/blob/v1.12.0/contracts/token/ERC20/StandardToken.sol

Are those docs version controlled somewhere where I can open a PR?

Hi @zachlysobey, our docs situation is a bit of a mess, right, but we're actively working on it.

Where did you find the first link you shared? It's not accessible through the sidebar.

@frangio I think I just came from a google search

Was this page helpful?
0 / 5 - 0 ratings

Related issues

shrugs picture shrugs  路  4Comments

bh2smith picture bh2smith  路  4Comments

golivax picture golivax  路  4Comments

mswezey23 picture mswezey23  路  3Comments

nventuro picture nventuro  路  4Comments