Closed Mubasher-dv closed 9 months ago
Follow the instructions here.
Thanks bro
how did you go about i am stuck rn and i followed the instruction but it doesnt seem to work
Thanks bro
Hi what instructions are you guys talking about and how did you go about solving the issue
how did you go about i am stuck rn and i followed the instruction but it doesnt seem to work
Did you solve the proble if you did please help me.
Hi what instructions are you guys talking about and how did you go about solving the issue
In the latest version of openzeppelin/openzeppelin-contracts ERC20Mock.sol file has been updated with 0 constructor parameters. You should use forge install openzeppelin/openzeppelin-contracts@v4.8.3 --no-commit command to download the appropriate version synced with the video.
Hi what instructions are you guys talking about and how did you go about solving the issue
In the latest version of openzeppelin/openzeppelin-contracts ERC20Mock.sol file has been updated with 0 constructor parameters. You should use forge install openzeppelin/openzeppelin-contracts@v4.8.3 --no-commit command to download the appropriate version synced with the video.
thank you
You can also personalise the ERC20Mock
contract inside the openzeppelin library, making your own WETH20Mock
contract, where you mint and set the desired test balance inside the constructor.
E.g.:
import {ERC20} from "../token/ERC20/ERC20.sol";
contract ERC20MockWETH is ERC20 {
constructor(address _owner) ERC20("ERC20MockWETH", "WETH") {
_mint(_owner, 100e10);
}
function mint(address account, uint256 amount) external {
_mint(account, amount);
}
function burn(address account, uint256 amount) external {
_burn(account, amount);
}
}
I have been following Patick's StableCoin project.
The issue I am facing right now is that when he is using ERC20Mock, This contract needs four parameters to make a wethMock and wbtchMock, but now this contract doesn't need any parameters. So, how can I solve this issue to carry on this project?
ERC20Mock wethMock = new ERC20Mock("WETH","WETH", msg.sender, 1000e8);
ERC20Mock.sol
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0;
import {ERC20} from "../token/ERC20/ERC20.sol";
contract ERC20Mock is ERC20 { constructor() ERC20("ERC20Mock", "E20M") {}
}