Update remappings and install instructions for Foundry on docs site (#4498)

Co-authored-by: ernestognw <ernestognw@gmail.com>
This commit is contained in:
Francisco
2023-08-08 23:22:57 -03:00
committed by GitHub
parent cb0ffefe2f
commit 8643fd45fd
8 changed files with 29 additions and 15 deletions

View File

@ -11,11 +11,25 @@
[[install]]
=== Installation
==== Hardhat, Truffle (npm)
```console
$ 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

View File

@ -1 +1 @@
openzeppelin/=contracts/
@openzeppelin/contracts/=contracts/

View File

@ -3,8 +3,8 @@
pragma solidity ^0.8.20;
import {Test} from "forge-std/Test.sol";
import {Strings} from "../../contracts/utils/Strings.sol";
import {Governor} from "../../contracts/governance/Governor.sol";
import {Strings} from "@openzeppelin/contracts/utils/Strings.sol";
import {Governor} from "@openzeppelin/contracts/governance/Governor.sol";
contract GovernorInternalTest is Test, Governor {
constructor() Governor("") {}

View File

@ -3,8 +3,8 @@
pragma solidity ^0.8.20;
import {Test} from "forge-std/Test.sol";
import {ERC2771Forwarder} from "contracts/metatx/ERC2771Forwarder.sol";
import {CallReceiverMockTrustingForwarder, CallReceiverMock} from "contracts/mocks/CallReceiverMock.sol";
import {ERC2771Forwarder} from "@openzeppelin/contracts/metatx/ERC2771Forwarder.sol";
import {CallReceiverMockTrustingForwarder, CallReceiverMock} from "@openzeppelin/contracts/mocks/CallReceiverMock.sol";
struct ForwardRequest {
address from;

View File

@ -3,12 +3,12 @@ pragma solidity ^0.8.20;
import {ERC4626Test} from "erc4626-tests/ERC4626.test.sol";
import {ERC20} from "openzeppelin/token/ERC20/ERC20.sol";
import {ERC4626} from "openzeppelin/token/ERC20/extensions/ERC4626.sol";
import {ERC20} from "@openzeppelin/contracts/token/ERC20/ERC20.sol";
import {ERC4626} from "@openzeppelin/contracts/token/ERC20/extensions/ERC4626.sol";
import {ERC20Mock} from "openzeppelin/mocks/token/ERC20Mock.sol";
import {ERC4626Mock} from "openzeppelin/mocks/token/ERC4626Mock.sol";
import {ERC4626OffsetMock} from "openzeppelin/mocks/token/ERC4626OffsetMock.sol";
import {ERC20Mock} from "@openzeppelin/contracts/mocks/token/ERC20Mock.sol";
import {ERC4626Mock} from "@openzeppelin/contracts/mocks/token/ERC4626Mock.sol";
import {ERC4626OffsetMock} from "@openzeppelin/contracts/mocks/token/ERC4626OffsetMock.sol";
contract ERC4626VaultOffsetMock is ERC4626OffsetMock {
constructor(

View File

@ -4,8 +4,8 @@ pragma solidity ^0.8.20;
// solhint-disable func-name-mixedcase
import {ERC721} from "../../../../contracts/token/ERC721/ERC721.sol";
import {ERC721Consecutive} from "../../../../contracts/token/ERC721/extensions/ERC721Consecutive.sol";
import {ERC721} from "@openzeppelin/contracts/token/ERC721/ERC721.sol";
import {ERC721Consecutive} from "@openzeppelin/contracts/token/ERC721/extensions/ERC721Consecutive.sol";
import {Test, StdUtils} from "forge-std/Test.sol";
function toSingleton(address account) pure returns (address[] memory) {

View File

@ -4,7 +4,7 @@ pragma solidity ^0.8.20;
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 {
string _fallback;

View File

@ -4,7 +4,7 @@ pragma solidity ^0.8.20;
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 {
// CEILDIV