Hello,
I’m using the v3.01 preset ERC20PresetMinterPauser to create an erc20 mintable token using Remix. However when I try to mint, I get the following message
transact to Token.mint pending …
transact to Token.mint errored: Error: insufficient data for uint256 type (arg=“tokenId”, coderType=“uint256”, value=“0x”, version=4.0.45)
Strangely, the tokens are minted successfully. Any idea what is causing this?
I mint ERC20 tokens using the Remix UI, the recipient being the Test721 contract.
When I mint to Test721.sol, I get the error message
transact to Token.mint errored: Error: insufficient data for uint256 type (arg=“tokenId”, coderType=“uint256”, value=“0x”, version=4.0.45)
But the Test721 contract does receive the Tokens.
(Note, I get the same error minting to any other Externally Owned Account.)
Then when I do transferTokens from the Test721.sol contract to return the tokens to admin, I get the same message
transact to Test721.transferToken errored: Error: insufficient data for uint256 type (arg=“tokenId”, coderType=“uint256”, value=“0x”, version=4.0.45)
But the tokens are sent by the contract to the admin (deployer) account successfully.
I get the same issue when deploying to the JavaScript VM. It looks like an error with Remix, as the tokens are appropriately minted. I couldn’t see any open issues for this in Remix, so we may need to create an Issue.
Looking at your Test721.sol code, you are importing from a branch used to develop the v3 release and not using an official release tag of OpenZeppelin Contracts
Thanks so much for your help. I was playing the different branches to see if the error would go away. Shouldn’t I be using the master branch for the latest? , in which case the import is just
It would be great to narrow down the issue to a simple reproduceable example.
We shouldn’t import from the master branch as this may not be part of an official release.
Note: We should only use code published in an official release of OpenZeppelin Contracts, the latest release is 3.0.2. When importing via GitHub on Remix we can specify the release tag, (otherwise we will get the latest code in the master branch).
I don’t think I can make the example any simpler. It happens when the 721contract has an interface back to the ERC20 token contract.
Is there a link to the official releases of OpenZeppelin Contracts? On the github page the only reference I found to 3.02 is on the Branch: release-v3.0.0 page and a small note by nventuro, but the Latest release is still 3.01 on github
I know it's a while ago since this issue was discussed here. Right now I'm facing exactly the same situation. My current observation is I used Hardhat and there were no errors. I switched to Ganache and since then I get this error. Did you find out anything else or just the switch to truffle solved it.
Thanks for the reply! I switched to Truffle and the error still persists. So it's not about the tooling I guess. I also tried to compare the JSON Hardhat and Truffle is compiling. There are minor differences beside Truffle is adding a huge block at the end which looks to me like a "precompiled" something.