Migration of simple ERC20 token fails with constantinople
See original GitHub issueI have this very simple test contract:
pragma solidity 0.5.4;
import "openzeppelin-solidity/contracts/token/ERC20/ERC20.sol";
contract TutorialToken is ERC20 {
string public name = "TutorialToken";
string public symbol = "TT";
uint8 public decimals = 18;
uint public INITIAL_SUPPLY = 1000000000000;
constructor() public {
_mint(msg.sender, INITIAL_SUPPLY);
}
}
I added evmVersion: 'constantinople'
to my truffle-config.js
and tried to migrate, but got this error:
Deploying 'TutorialToken'
-------------------------
Error: *** Deployment Failed ***
"TutorialToken" hit an invalid opcode while deploying. Try:
* Verifying that your constructor params satisfy all assert conditions.
* Verifying your constructor code doesn't access an array out of bounds.
* Adding reason strings to your assert statements.
at /usr/src/app/node_modules/truffle/build/webpack:/packages/truffle-deployer/src/deployment.js:364:1
at process._tickCallback (internal/process/next_tick.js:68:7)
Truffle v5.0.5 (core: 5.0.5)
Node v10.15.1
It migrates fine on byzantium.
💻 Environment
openzeppelin-solidity@2.1.3
Issue Analytics
- State:
- Created 5 years ago
- Comments:10 (4 by maintainers)
Top Results From Across the Web
Migration of simple ERC20 token fails with constantinople #1657
I have this very simple test contract: pragma solidity 0.5.4; import "openzeppelin-solidity/contracts/token/ERC20/ERC20.sol"; ...
Read more >How contract migration works | Trail of Bits Blog
For ERC20 token contracts, you can find the list of all the holders by tracking the addresses of the Transfer events. This process...
Read more >Points to consider when creating a fungible token (ERC20 ...
Will burning a percentage of the amount transferred for an ERC20 token cause issues? Creating Capped ERC20 gives error in contract constructor.
Read more >Uncovering a Four Year Old Bug - Paradigm
The transaction in question was a simple ERC20 transfer, so I quickly simulated it on Anatol's node, which failed.
Read more >All about CRO Token Migration - Crypto.com Help Center
Token migration is the process of migrating your ERC20 CRO on the Ethereum network to CRO on Crypto.org Chain. There will be multiple...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Just cleared my build artifacts, ran
yarn upgrade
, changed my contracts to use solc 0.5.7, and removedevmVersion
from settings.yarn compile
works successfully and most of the contracts are able to migrate, but TutorialToken still fails:I can’t share my repo, but I’ll try to make a repo that can reproduce this sometime in the next week o two.
Sure! Reesolved though. I’d just like to leave a note that my difficulty was with
"truffle-hdwallet-provider": "1.0.5"
and I got around it by using"@truffle/hdwallet-provider": "1.0.34"
instead.