I can't build my smart contract using Foundry because my dependency isn't recognized.
According to the documentation I have run the command
forge install openzeppelin/openzeppelin-contracts
Then I added the following line in the remapping.txt file:
openzeppelin-contracts/=lib/openzeppelin/contracts/
After updating the remapping file I ran the command and below are the results:
forge remappings
Now when I create my simple ERC20 contract that has the following code:
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.4;
import "@openzeppelin/contracts/token/ERC20/ERC20.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
contract Grape is ERC20, Ownable {
constructor() ERC20("Grape", "GRP") {
_mint(msg.sender, 1000000 * 10 ** decimals());
}
function mint(address to, uint256 amount) public onlyOwner {
_mint(to, amount);
}
}
And I try to build my project using:
forge build