Stablecoin Project: ERC20Mock problem (Probably cannot find the correct Mock contract) #42
-
When creating the mocks for WETH and WBTC we are using the following code: // Contract import statement
import {ERC20Mock} from "@openzeppelin/contracts/mocks/ERC20Mock.sol";
...
// Code 1:1 as the code that Patrick wrote to create mocks
ERC20Mock wethMock = new ERC20Mock("WETH", "WETH", msg.sender, 1000e8);
ERC20Mock wbtcMock = new ERC20Mock("WBTC", "WBTC", msg.sender, 1000e8); In this code, we are providing name, symbol, initialAccount and initialBalance (function arguments). // The Mock contract that I found
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import {ERC20} from "../token/ERC20/ERC20.sol";
contract ERC20Mock is ERC20 {
constructor() ERC20("ERC20Mock", "E20M") {}
function mint(address account, uint256 amount) external {
_mint(account, amount);
}
function burn(address account, uint256 amount) external {
_burn(account, amount);
}
} |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
The issue might be from using the latest dependency that has updated the mock contract. To solve this, remove the openzeppelin dependency and install the specific version that is being used. forge remove lib/openzeppelin-contracts There's probably a easier way to do this. |
Beta Was this translation helpful? Give feedback.
The issue might be from using the latest dependency that has updated the mock contract. To solve this, remove the openzeppelin dependency and install the specific version that is being used.
forge remove lib/openzeppelin-contracts
forge install openzeppelin/[email protected] --no-commit
There's probably a easier way to do this.