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
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
Most helpful comment
Hello @deepakkbc! You have probably installed version 2.0 of OpenZeppelin (the latest release). In it,
StandardTokenwas renamed toERC20: change your import statement and your contract should compile.