Update remappings and install instructions for Foundry on docs site (#4498)
Co-authored-by: ernestognw <ernestognw@gmail.com>
This commit is contained in:
@ -11,11 +11,25 @@
|
|||||||
[[install]]
|
[[install]]
|
||||||
=== Installation
|
=== Installation
|
||||||
|
|
||||||
|
==== Hardhat, Truffle (npm)
|
||||||
|
|
||||||
```console
|
```console
|
||||||
$ npm install @openzeppelin/contracts
|
$ npm install @openzeppelin/contracts
|
||||||
```
|
```
|
||||||
|
|
||||||
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.
|
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.
|
||||||
|
|
||||||
|
==== Foundry (git)
|
||||||
|
|
||||||
|
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.
|
||||||
|
|
||||||
|
WARNING: Foundry installs the latest version initially, but subsequent `forge update` commands will use the `master` branch.
|
||||||
|
|
||||||
|
```console
|
||||||
|
$ forge install OpenZeppelin/openzeppelin-contracts
|
||||||
|
```
|
||||||
|
|
||||||
|
Add `@openzeppelin/contracts/=lib/openzeppelin-contracts/contracts/` in `remappings.txt.`
|
||||||
|
|
||||||
[[usage]]
|
[[usage]]
|
||||||
=== Usage
|
=== Usage
|
||||||
|
|||||||
@ -1 +1 @@
|
|||||||
openzeppelin/=contracts/
|
@openzeppelin/contracts/=contracts/
|
||||||
|
|||||||
@ -3,8 +3,8 @@
|
|||||||
pragma solidity ^0.8.20;
|
pragma solidity ^0.8.20;
|
||||||
|
|
||||||
import {Test} from "forge-std/Test.sol";
|
import {Test} from "forge-std/Test.sol";
|
||||||
import {Strings} from "../../contracts/utils/Strings.sol";
|
import {Strings} from "@openzeppelin/contracts/utils/Strings.sol";
|
||||||
import {Governor} from "../../contracts/governance/Governor.sol";
|
import {Governor} from "@openzeppelin/contracts/governance/Governor.sol";
|
||||||
|
|
||||||
contract GovernorInternalTest is Test, Governor {
|
contract GovernorInternalTest is Test, Governor {
|
||||||
constructor() Governor("") {}
|
constructor() Governor("") {}
|
||||||
|
|||||||
@ -3,8 +3,8 @@
|
|||||||
pragma solidity ^0.8.20;
|
pragma solidity ^0.8.20;
|
||||||
|
|
||||||
import {Test} from "forge-std/Test.sol";
|
import {Test} from "forge-std/Test.sol";
|
||||||
import {ERC2771Forwarder} from "contracts/metatx/ERC2771Forwarder.sol";
|
import {ERC2771Forwarder} from "@openzeppelin/contracts/metatx/ERC2771Forwarder.sol";
|
||||||
import {CallReceiverMockTrustingForwarder, CallReceiverMock} from "contracts/mocks/CallReceiverMock.sol";
|
import {CallReceiverMockTrustingForwarder, CallReceiverMock} from "@openzeppelin/contracts/mocks/CallReceiverMock.sol";
|
||||||
|
|
||||||
struct ForwardRequest {
|
struct ForwardRequest {
|
||||||
address from;
|
address from;
|
||||||
|
|||||||
@ -3,12 +3,12 @@ pragma solidity ^0.8.20;
|
|||||||
|
|
||||||
import {ERC4626Test} from "erc4626-tests/ERC4626.test.sol";
|
import {ERC4626Test} from "erc4626-tests/ERC4626.test.sol";
|
||||||
|
|
||||||
import {ERC20} from "openzeppelin/token/ERC20/ERC20.sol";
|
import {ERC20} from "@openzeppelin/contracts/token/ERC20/ERC20.sol";
|
||||||
import {ERC4626} from "openzeppelin/token/ERC20/extensions/ERC4626.sol";
|
import {ERC4626} from "@openzeppelin/contracts/token/ERC20/extensions/ERC4626.sol";
|
||||||
|
|
||||||
import {ERC20Mock} from "openzeppelin/mocks/token/ERC20Mock.sol";
|
import {ERC20Mock} from "@openzeppelin/contracts/mocks/token/ERC20Mock.sol";
|
||||||
import {ERC4626Mock} from "openzeppelin/mocks/token/ERC4626Mock.sol";
|
import {ERC4626Mock} from "@openzeppelin/contracts/mocks/token/ERC4626Mock.sol";
|
||||||
import {ERC4626OffsetMock} from "openzeppelin/mocks/token/ERC4626OffsetMock.sol";
|
import {ERC4626OffsetMock} from "@openzeppelin/contracts/mocks/token/ERC4626OffsetMock.sol";
|
||||||
|
|
||||||
contract ERC4626VaultOffsetMock is ERC4626OffsetMock {
|
contract ERC4626VaultOffsetMock is ERC4626OffsetMock {
|
||||||
constructor(
|
constructor(
|
||||||
|
|||||||
@ -4,8 +4,8 @@ pragma solidity ^0.8.20;
|
|||||||
|
|
||||||
// solhint-disable func-name-mixedcase
|
// solhint-disable func-name-mixedcase
|
||||||
|
|
||||||
import {ERC721} from "../../../../contracts/token/ERC721/ERC721.sol";
|
import {ERC721} from "@openzeppelin/contracts/token/ERC721/ERC721.sol";
|
||||||
import {ERC721Consecutive} from "../../../../contracts/token/ERC721/extensions/ERC721Consecutive.sol";
|
import {ERC721Consecutive} from "@openzeppelin/contracts/token/ERC721/extensions/ERC721Consecutive.sol";
|
||||||
import {Test, StdUtils} from "forge-std/Test.sol";
|
import {Test, StdUtils} from "forge-std/Test.sol";
|
||||||
|
|
||||||
function toSingleton(address account) pure returns (address[] memory) {
|
function toSingleton(address account) pure returns (address[] memory) {
|
||||||
|
|||||||
@ -4,7 +4,7 @@ pragma solidity ^0.8.20;
|
|||||||
|
|
||||||
import {Test} from "forge-std/Test.sol";
|
import {Test} from "forge-std/Test.sol";
|
||||||
|
|
||||||
import {ShortStrings, ShortString} from "../../contracts/utils/ShortStrings.sol";
|
import {ShortStrings, ShortString} from "@openzeppelin/contracts/utils/ShortStrings.sol";
|
||||||
|
|
||||||
contract ShortStringsTest is Test {
|
contract ShortStringsTest is Test {
|
||||||
string _fallback;
|
string _fallback;
|
||||||
|
|||||||
@ -4,7 +4,7 @@ pragma solidity ^0.8.20;
|
|||||||
|
|
||||||
import {Test} from "forge-std/Test.sol";
|
import {Test} from "forge-std/Test.sol";
|
||||||
|
|
||||||
import {Math} from "../../../contracts/utils/math/Math.sol";
|
import {Math} from "@openzeppelin/contracts/utils/math/Math.sol";
|
||||||
|
|
||||||
contract MathTest is Test {
|
contract MathTest is Test {
|
||||||
// CEILDIV
|
// CEILDIV
|
||||||
|
|||||||
Reference in New Issue
Block a user