Skip to content

Commit 8643fd4

Browse files
frangioernestognw
andauthored
Update remappings and install instructions for Foundry on docs site (OpenZeppelin#4498)
Co-authored-by: ernestognw <[email protected]>
1 parent cb0ffef commit 8643fd4

File tree

8 files changed

+29
-15
lines changed

8 files changed

+29
-15
lines changed

docs/modules/ROOT/pages/index.adoc

+15-1
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,25 @@
1111
[[install]]
1212
=== Installation
1313

14+
==== Hardhat, Truffle (npm)
15+
1416
```console
1517
$ npm install @openzeppelin/contracts
1618
```
1719

18-
OpenZeppelin Contracts features a xref:releases-stability.adoc#api-stability[stable API], which means your contracts won't break unexpectedly when upgrading to a newer minor version.
20+
OpenZeppelin Contracts features a xref:releases-stability.adoc#api-stability[stable API], which means that your contracts won't break unexpectedly when upgrading to a newer minor version.
21+
22+
==== Foundry (git)
23+
24+
WARNING: When installing via git, it is a common error to use the `master` branch. This is a development branch that should be avoided in favor of tagged releases. The release process involves security measures that the `master` branch does not guarantee.
25+
26+
WARNING: Foundry installs the latest version initially, but subsequent `forge update` commands will use the `master` branch.
27+
28+
```console
29+
$ forge install OpenZeppelin/openzeppelin-contracts
30+
```
31+
32+
Add `@openzeppelin/contracts/=lib/openzeppelin-contracts/contracts/` in `remappings.txt.`
1933

2034
[[usage]]
2135
=== Usage

remappings.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
openzeppelin/=contracts/
1+
@openzeppelin/contracts/=contracts/

test/governance/Governor.t.sol

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
pragma solidity ^0.8.20;
44

55
import {Test} from "forge-std/Test.sol";
6-
import {Strings} from "../../contracts/utils/Strings.sol";
7-
import {Governor} from "../../contracts/governance/Governor.sol";
6+
import {Strings} from "@openzeppelin/contracts/utils/Strings.sol";
7+
import {Governor} from "@openzeppelin/contracts/governance/Governor.sol";
88

99
contract GovernorInternalTest is Test, Governor {
1010
constructor() Governor("") {}

test/metatx/ERC2771Forwarder.t.sol

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
pragma solidity ^0.8.20;
44

55
import {Test} from "forge-std/Test.sol";
6-
import {ERC2771Forwarder} from "contracts/metatx/ERC2771Forwarder.sol";
7-
import {CallReceiverMockTrustingForwarder, CallReceiverMock} from "contracts/mocks/CallReceiverMock.sol";
6+
import {ERC2771Forwarder} from "@openzeppelin/contracts/metatx/ERC2771Forwarder.sol";
7+
import {CallReceiverMockTrustingForwarder, CallReceiverMock} from "@openzeppelin/contracts/mocks/CallReceiverMock.sol";
88

99
struct ForwardRequest {
1010
address from;

test/token/ERC20/extensions/ERC4626.t.sol

+5-5
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,12 @@ pragma solidity ^0.8.20;
33

44
import {ERC4626Test} from "erc4626-tests/ERC4626.test.sol";
55

6-
import {ERC20} from "openzeppelin/token/ERC20/ERC20.sol";
7-
import {ERC4626} from "openzeppelin/token/ERC20/extensions/ERC4626.sol";
6+
import {ERC20} from "@openzeppelin/contracts/token/ERC20/ERC20.sol";
7+
import {ERC4626} from "@openzeppelin/contracts/token/ERC20/extensions/ERC4626.sol";
88

9-
import {ERC20Mock} from "openzeppelin/mocks/token/ERC20Mock.sol";
10-
import {ERC4626Mock} from "openzeppelin/mocks/token/ERC4626Mock.sol";
11-
import {ERC4626OffsetMock} from "openzeppelin/mocks/token/ERC4626OffsetMock.sol";
9+
import {ERC20Mock} from "@openzeppelin/contracts/mocks/token/ERC20Mock.sol";
10+
import {ERC4626Mock} from "@openzeppelin/contracts/mocks/token/ERC4626Mock.sol";
11+
import {ERC4626OffsetMock} from "@openzeppelin/contracts/mocks/token/ERC4626OffsetMock.sol";
1212

1313
contract ERC4626VaultOffsetMock is ERC4626OffsetMock {
1414
constructor(

test/token/ERC721/extensions/ERC721Consecutive.t.sol

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ pragma solidity ^0.8.20;
44

55
// solhint-disable func-name-mixedcase
66

7-
import {ERC721} from "../../../../contracts/token/ERC721/ERC721.sol";
8-
import {ERC721Consecutive} from "../../../../contracts/token/ERC721/extensions/ERC721Consecutive.sol";
7+
import {ERC721} from "@openzeppelin/contracts/token/ERC721/ERC721.sol";
8+
import {ERC721Consecutive} from "@openzeppelin/contracts/token/ERC721/extensions/ERC721Consecutive.sol";
99
import {Test, StdUtils} from "forge-std/Test.sol";
1010

1111
function toSingleton(address account) pure returns (address[] memory) {

test/utils/ShortStrings.t.sol

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ pragma solidity ^0.8.20;
44

55
import {Test} from "forge-std/Test.sol";
66

7-
import {ShortStrings, ShortString} from "../../contracts/utils/ShortStrings.sol";
7+
import {ShortStrings, ShortString} from "@openzeppelin/contracts/utils/ShortStrings.sol";
88

99
contract ShortStringsTest is Test {
1010
string _fallback;

test/utils/math/Math.t.sol

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ pragma solidity ^0.8.20;
44

55
import {Test} from "forge-std/Test.sol";
66

7-
import {Math} from "../../../contracts/utils/math/Math.sol";
7+
import {Math} from "@openzeppelin/contracts/utils/math/Math.sol";
88

99
contract MathTest is Test {
1010
// CEILDIV

0 commit comments

Comments
 (0)