Skip to content

Commit e916ae6

Browse files
committed
also adjust semantic-money
1 parent 154300d commit e916ae6

File tree

4 files changed

+36
-5
lines changed

4 files changed

+36
-5
lines changed

packages/ethereum-contracts/CHANGELOG.md

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,37 @@ All notable changes to the ethereum-contracts will be documented in this file.
33

44
This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
55

6+
## [v1.13.0]
7+
8+
### Breaking
9+
10+
The npm dependency @openzeppelin/contracts is now mapped to the local path `@openzeppelin/contracts-v4`.
11+
This frees up the default path `@openzeppelin/contracts` for v5 which most new Solidity projects use.
12+
13+
In order to use this package in a **foundry project (new or existing) with dependencies installed as git submodules**, this steps are recommended:
14+
15+
1. Add openzeppelin-contracts v4 as a submodule:
16+
```
17+
git submodule add -b release-v4.9 https://github.com/OpenZeppelin/openzeppelin-contracts lib/openzeppelin-contracts-v4
18+
```
19+
Note the explicit local path with v4 postfix.
20+
21+
2. Add this mapping to `foundry.toml` or `remappings.txt` (depending on where they are located in your project):
22+
```
23+
"@openzeppelin/contracts-v4/=lib/openzeppelin-contracts-v4/contracts/"
24+
```
25+
26+
That way, projects can use the import path `@openzeppelin/contracts` for openzeppelin v5. This is the default when using npm for installing the openzeppelin dependency.
27+
28+
**Note:**
29+
foundry by default auto-detects mappings based on the contents of the lib directory and nested foundry configuration files.
30+
Because of this, it may automatically add a mapping `openzeppelin/=lib/openzeppelin-contracts-v4/contracts/` .
31+
In case you're using the import path `openzeppelin/...` in your project, that may not be what you want.
32+
In this case you can either change the import path to something else, or you can disable mapping auto-detection with `auto_detect_remappings = false` (see [docs](https://book.getfoundry.sh/reference/config/solidity-compiler#auto_detect_remappings)). If you disable it, you may need to explicitly add some mappings, e.g. for forge-std.
33+
34+
In order to use this package in a **project with dependencies managed by npm packages**, you don't need to do anything.
35+
Except: if you relied on the openzeppelin-contracts v4 dependency installed by this package, you now need to either also adjust the import path, or explicity add the dependency with the default path to your project.
36+
637
## [v1.12.1]
738

839
### Added

packages/solidity-semantic-money/src/ref-impl/ToySuperToken.sol

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ pragma solidity ^0.8.23;
33

44
// solhint-disable not-rely-on-time
55

6-
import { IERC20 } from "@openzeppelin/contracts/token/ERC20/IERC20.sol";
7-
import { SafeCast } from "@openzeppelin/contracts/utils/math/SafeCast.sol";
6+
import { IERC20 } from "@openzeppelin/contracts-v4/token/ERC20/IERC20.sol";
7+
import { SafeCast } from "@openzeppelin/contracts-v4/utils/math/SafeCast.sol";
88

99
import {
1010
Time, Value, FlowRate,

packages/solidity-semantic-money/src/ref-impl/ToySuperfluidPool.sol

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ pragma solidity ^0.8.23;
33

44
// solhint-disable not-rely-on-time
55

6-
import { Initializable } from "@openzeppelin/contracts/proxy/utils/Initializable.sol";
6+
import { Initializable } from "@openzeppelin/contracts-v4/proxy/utils/Initializable.sol";
77
import {
88
Time, Value, FlowRate, Unit,
99
BasicParticle,

packages/solidity-semantic-money/src/ref-impl/ToySuperfluidToken.sol

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ pragma solidity ^0.8.23;
33

44
// solhint-disable not-rely-on-time
55

6-
import { EnumerableSet } from "@openzeppelin/contracts/utils/structs/EnumerableSet.sol";
7-
import { Clones } from "@openzeppelin/contracts/proxy/Clones.sol";
6+
import { EnumerableSet } from "@openzeppelin/contracts-v4/utils/structs/EnumerableSet.sol";
7+
import { Clones } from "@openzeppelin/contracts-v4/proxy/Clones.sol";
88
import { FlowId, ISuperfluidToken } from "./ISuperfluidToken.sol";
99
import {
1010
Time, Value, FlowRate,

0 commit comments

Comments
 (0)