βœ…Remappings

Solmate (forge remappings)

Install solmate:

Create an ERC20 contract:

Build:

See what libraries have been installed:

Here solmate is remapped to lib/solmate/src/.

OpenZeppelin Contracts (remappings.txt)

Some libraries, such as OpenZeppelin contracts, should be installed via npm:

We run mkdir first because node modules can be install locally or globally. Reference:

In contract, import OpenZeppelin Ownable:

We have to create a remappings.txt file for this import statement to make sense:

Update our contract:

Build it:

Build succeeded

Last updated

Was this helpful?