Lesson 12: ERC20Mock.sol Help #766
-
|
Hi everyone, I am working on lesson 12 and creating the helper config when i am across this error:
The problem is my ERC20Mock.sol, it is missing code compared to Patrick's code at 1:57:41 on lesson 3, does anyone know why this is? ERC20Mock.sol- Here is my HelperConfig.s.sol: |
Beta Was this translation helpful? Give feedback.
Replies: 4 comments 4 replies
-
|
Actually in the latest versions of open zeppelin, they have removed all 4 arguments from constructor: // SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "../token/ERC20/ERC20.sol";
// mock class using ERC20
contract ERC20Mock is ERC20 {
constructor(
string memory name,
string memory symbol,
address initialAccount,
uint256 initialBalance
) payable ERC20(name, symbol) {
_mint(initialAccount, initialBalance);
}
function mint(address account, uint256 amount) public {
_mint(account, amount);
}
function burn(address account, uint256 amount) public {
_burn(account, amount);
}
function transferInternal(
address from,
address to,
uint256 value
) public {
_transfer(from, to, value);
}
function approveInternal(
address owner,
address spender,
uint256 value
) public {
_approve(owner, spender, value);
}
}So, you can just copy paste the above previous version into your ERC20Mock |
Beta Was this translation helpful? Give feedback.
-
|
Or you can just do this: First: Go to lib folder -> delete openzeppelin folder. Second: install forge install openzeppelin/[email protected] --no-commit |
Beta Was this translation helpful? Give feedback.
-
|
Thanks for posting this question. I was perplexed too. |
Beta Was this translation helpful? Give feedback.
-
|
Thank you for asking this question, I was wondering the same just now. |
Beta Was this translation helpful? Give feedback.
Actually in the latest versions of open zeppelin, they have removed all 4 arguments from constructor:
The latest version of ERC20Mock: https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/mocks/token/ERC20Mock.sol
The previous version: