Closed scripnichenko closed 5 months ago
Hello @scripnichenko
Thanks for opening this issue.
We had this problem in our lesson as well, and we did not have enought time to fix it live.
For using solidity version 0.8.19
we can't use the recent versions of OpenZeppelin Contracts, that require solidity 0.8.20
or above. So in our case we would need to use older versions of OpenZeppelin Contracts to import the token contracts to use in our token.
The fixed code would look like this:
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.19;
import "https://github.com/OpenZeppelin/openzeppelin-contracts/blob/release-v4.9/contracts/token/ERC20/ERC20.sol";
import "https://github.com/OpenZeppelin/openzeppelin-contracts/blob/release-v4.9/contracts/token/ERC20/extensions/ERC20Permit.sol";
contract FrogToken is ERC20, ERC20Permit {
constructor() ERC20("FrogToken", "FROG") ERC20Permit("FrogToken") {
_mint(msg.sender, 1000 * 10 ** decimals());
}
}
Notice how we're specifying the branch release-v4.9
when importing, instead of picking the default that would be the latest
release.
Works now! Thanks, @MatheusDaros for info.
I get a gas error, so I put the version directly: pragma solidity 0.8.19;
Problem
Given a code snippet from Part1 Tutorial
1. Attempt to deploy to Local (Remix VM London)
Error:
Debug the transaction to get more information.
2. Attempt to deploy to Injected Provider - Metamask
Error:
After accepting next error appears: