Skip to content

Commit b30b7be

Browse files
d10rhellwolf
andauthored
switch to foundry v1 (stable) (#2052)
* switch to foundry v1 (stable) * migration fixes * CHANGELOG and readme updates * keep hotfuzz evm_version at shanghai * explicit evm_version for automation-contracts --------- Co-authored-by: Miao ZhiCheng <miao@superfluid.finance>
1 parent 4eda89b commit b30b7be

File tree

11 files changed

+30
-11
lines changed

11 files changed

+30
-11
lines changed

flake.lock

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

flake.nix

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
flake-utils.url = "github:numtide/flake-utils";
66
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
77
foundry = {
8-
url = "github:shazow/foundry.nix/monthly";
8+
url = "github:shazow/foundry.nix/stable";
99
inputs.flake-utils.follows = "flake-utils";
1010
inputs.nixpkgs.follows = "nixpkgs";
1111
};

packages/automation-contracts/autowrap/foundry.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@ root = '../../../'
33
libs = ['lib']
44
src = 'packages/automation-contracts/autowrap'
55
solc_version = "0.8.23"
6+
evm_version = 'paris'
7+
optimizer = true
8+
optimizer_runs = 200
69
remappings = [
710
'@superfluid-finance/solidity-semantic-money/src/=packages/solidity-semantic-money/src/',
811
'@superfluid-finance/ethereum-contracts/=packages/ethereum-contracts/',

packages/automation-contracts/autowrap/test/Manager.t.sol

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,11 +77,15 @@ contract ManagerTests is FoundrySuperfluidTester {
7777

7878
/// TESTS
7979

80-
function testFailDeploymentWithoutCFA() public {
80+
function test_RevertWhen_DeploymentWithoutCFA() public {
81+
vm.expectRevert(IManager.ZeroAddress.selector);
8182
new Manager(address(0), 1, 2);
8283
}
8384

84-
function testFailDeploymentWrongLimits() public {
85+
function test_RevertWhen_DeploymentWrongLimits() public {
86+
vm.expectRevert(
87+
abi.encodeWithSelector(IManager.WrongLimits.selector, 2, 1)
88+
);
8589
new Manager(address(sf.cfa), 2, 1);
8690
}
8791

packages/automation-contracts/autowrap/test/WrapStrategy.t.sol

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,8 @@ contract WrapStrategyTests is FoundrySuperfluidTester {
6060

6161
/// TESTS
6262

63-
function testFailDeploymentWithoutManager() public {
63+
function test_RevertWhen_DeploymentWithoutManager() public {
64+
vm.expectRevert(IStrategy.ZeroAddress.selector);
6465
new WrapStrategy(address(0));
6566
}
6667

packages/automation-contracts/scheduler/foundry.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@ root = '../../../'
33
libs = ['lib']
44
src = 'packages/automation-contracts/scheduler'
55
solc_version = "0.8.23"
6+
evm_version = 'paris'
7+
optimizer = true
8+
optimizer_runs = 200
69
remappings = [
710
'@superfluid-finance/solidity-semantic-money/src/=packages/solidity-semantic-money/src/',
811
'@superfluid-finance/ethereum-contracts/=packages/ethereum-contracts/',

packages/ethereum-contracts/CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm
1616
- Fixed deployment of SimpleForwarder (solved an issue which caused batch operation `OPERATION_TYPE_SIMPLE_FORWARD_CALL` to always revert)
1717
- `SuperTokenV1Library.getFlowRate` and `SuperTokenV1Library.getFlowInfo` now also allow querying the flowrate between pools and pool members
1818
- Superfluid Pools now emit a Transfer event when changing units with `updateMemberUnits`.
19+
- Dependency foundry updated to 1.0
1920

2021
### Breaking
2122
- `SuperTokenV1Library.distributeFlow`: return `actualFlowRate` instead of a bool

packages/ethereum-contracts/README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ function testRevertIfDecreaseFlowRateAllowanceAndACLCreateFlow() {
138138

139139
#### Internal Helper Functions
140140

141-
See [`FoundrySuperfluidTester.sol`](test/foundry/FoundrySuperfluidTester.sol) for examples of commonly used internal helper functions.
141+
See [`FoundrySuperfluidTester.t.sol`](test/foundry/FoundrySuperfluidTester.t.sol) for examples of commonly used internal helper functions.
142142
If you are writing a test that requires a helper function, the helper function is prefixed with `_` and uses camelCase to indicate that it is an internal helper function. For example:
143143

144144
```solidity
@@ -199,7 +199,7 @@ In foundry, you can use the `SuperfluidFrameworkDeployer` to deploy the Superflu
199199
import "forge-std/Test.sol";
200200
201201
import { ERC1820RegistryCompiled } from "@superfluid-finance/ethereum-contracts/contracts/libs/ERC1820RegistryCompiled.sol";
202-
import { SuperfluidFrameworkDeployer } from "@superfluid-finance/ethereum-contracts/contracts/utils/SuperfluidFrameworkDeployer.sol";
202+
import { SuperfluidFrameworkDeployer } from "@superfluid-finance/ethereum-contracts/contracts/utils/SuperfluidFrameworkDeployer.t.sol";
203203
import { TestToken } from "@superfluid-finance/ethereum-contracts/contracts/utils/TestToken.sol";
204204
import { SuperToken } from "@superfluid-finance/ethereum-contracts/contracts/superfluid/SuperToken.sol";
205205
@@ -218,7 +218,7 @@ contract SomeTest is Test {
218218
}
219219
}
220220
```
221-
See [SuperfluidFrameworkDeployer.sol](contracts/utils/SuperfluidFrameworkDeployer.sol) for more details.
221+
See [SuperfluidFrameworkDeployer.t.sol](contracts/utils/SuperfluidFrameworkDeployer.t.sol) for more details.
222222

223223
You can also deploy to a local blockchain (`hardhat` or `anvil`) via a forge script. For example, an example `Deploy.s.sol` file:
224224

packages/ethereum-contracts/foundry.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ ignored_error_codes = [
99
]
1010
# keep in sync with truffle-config.js
1111
evm_version = 'paris'
12+
optimizer = true
13+
optimizer_runs = 200
1214
remappings = [
1315
'@superfluid-finance/ethereum-contracts/contracts/=packages/ethereum-contracts/contracts/',
1416
'@superfluid-finance/solidity-semantic-money/src/=packages/solidity-semantic-money/src/',

packages/hot-fuzz/foundry.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@
22
root = '../..'
33
src = 'packages/hot-fuzz/contracts'
44
solc_version = "0.8.23"
5+
evm_version = 'shanghai'
6+
optimizer = true
7+
optimizer_runs = 200
58
remappings = [
69
'@superfluid-finance/ethereum-contracts/contracts/=packages/ethereum-contracts/contracts/',
710
'@superfluid-finance/solidity-semantic-money/src/=packages/solidity-semantic-money/src/',

0 commit comments

Comments
 (0)