Skip to content

Commit a6d71da

Browse files
authored
fix: assume not precompiles for optimism sepolia (#750)
- baf6ba0 apply precompiles checks for optimism sepolia, fixes `testFuzz_AssumeNotPrecompile` test ``` [FAIL: assertion failed; counterexample: calldata=0x9d624fa10000000000000000000000004200000000000000000000000000000000000000 args=[0x4200000000000000000000000000000000000000]] testFuzz_AssumeNotPrecompile(address) (runs: 2, μ: 5868184, ~: 5868184) ``` Others - fix CI: - disable lint on build, we can follow up with resolving warnings - forge fmt with new formatter - switch mainnet rpc url - run all tests 9a12e56 supersedes #745
1 parent b8f065f commit a6d71da

File tree

12 files changed

+90
-119
lines changed

12 files changed

+90
-119
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -66,12 +66,7 @@ jobs:
6666
with:
6767
version: ${{ matrix.toolchain }}
6868
- run: forge --version
69-
- run: |
70-
if [ "${{ matrix.toolchain }}" = "stable" ]; then
71-
forge test -vvv --no-match-path "test/Config.t.sol"
72-
else
73-
forge test -vvv
74-
fi
69+
- run: forge test -vvv
7570

7671
fmt:
7772
runs-on: ubuntu-latest

foundry.toml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,14 @@ ignored_error_codes = [3860]
99

1010
[rpc_endpoints]
1111
# The RPC URLs are modified versions of the default for testing initialization.
12-
mainnet = "https://eth.merkle.io" # Different API key.
12+
mainnet = "https://reth-ethereum.ithaca.xyz/rpc"
1313
optimism_sepolia = "https://sepolia.optimism.io/" # Adds a trailing slash.
1414
arbitrum_one_sepolia = "https://sepolia-rollup.arbitrum.io/rpc/" # Adds a trailing slash.
1515
needs_undefined_env_var = "${UNDEFINED_RPC_URL_PLACEHOLDER}"
1616

17+
[lint]
18+
lint_on_build = false
19+
1720
[fmt]
1821
# These are all the `forge fmt` defaults.
1922
line_length = 120

src/StdAssertions.sol

Lines changed: 26 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -572,11 +572,7 @@ abstract contract StdAssertions {
572572
vm.assertApproxEqAbs(left, right, maxDelta);
573573
}
574574

575-
function assertApproxEqAbs(uint256 left, uint256 right, uint256 maxDelta, string memory err)
576-
internal
577-
pure
578-
virtual
579-
{
575+
function assertApproxEqAbs(uint256 left, uint256 right, uint256 maxDelta, string memory err) internal pure virtual {
580576
vm.assertApproxEqAbs(left, right, maxDelta, err);
581577
}
582578

@@ -626,7 +622,11 @@ abstract contract StdAssertions {
626622
uint256 left,
627623
uint256 right,
628624
uint256 maxPercentDelta // An 18 decimal fixed point number, where 1e18 == 100%
629-
) internal pure virtual {
625+
)
626+
internal
627+
pure
628+
virtual
629+
{
630630
vm.assertApproxEqRel(left, right, maxPercentDelta);
631631
}
632632

@@ -635,7 +635,11 @@ abstract contract StdAssertions {
635635
uint256 right,
636636
uint256 maxPercentDelta, // An 18 decimal fixed point number, where 1e18 == 100%
637637
string memory err
638-
) internal pure virtual {
638+
)
639+
internal
640+
pure
641+
virtual
642+
{
639643
vm.assertApproxEqRel(left, right, maxPercentDelta, err);
640644
}
641645

@@ -644,7 +648,11 @@ abstract contract StdAssertions {
644648
uint256 right,
645649
uint256 maxPercentDelta, // An 18 decimal fixed point number, where 1e18 == 100%
646650
uint256 decimals
647-
) internal pure virtual {
651+
)
652+
internal
653+
pure
654+
virtual
655+
{
648656
vm.assertApproxEqRelDecimal(left, right, maxPercentDelta, decimals);
649657
}
650658

@@ -667,7 +675,11 @@ abstract contract StdAssertions {
667675
int256 right,
668676
uint256 maxPercentDelta, // An 18 decimal fixed point number, where 1e18 == 100%
669677
string memory err
670-
) internal pure virtual {
678+
)
679+
internal
680+
pure
681+
virtual
682+
{
671683
vm.assertApproxEqRel(left, right, maxPercentDelta, err);
672684
}
673685

@@ -676,7 +688,11 @@ abstract contract StdAssertions {
676688
int256 right,
677689
uint256 maxPercentDelta, // An 18 decimal fixed point number, where 1e18 == 100%
678690
uint256 decimals
679-
) internal pure virtual {
691+
)
692+
internal
693+
pure
694+
virtual
695+
{
680696
vm.assertApproxEqRelDecimal(left, right, maxPercentDelta, decimals);
681697
}
682698

src/StdCheats.sol

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -326,7 +326,7 @@ abstract contract StdCheatsSafe {
326326
vm.assume(addr < address(0x1) || addr > address(0xff));
327327

328328
// forgefmt: disable-start
329-
if (chainId == 10 || chainId == 420) {
329+
if (chainId == 10 || chainId == 420 || chainId == 11155420) {
330330
// https://github.com/ethereum-optimism/optimism/blob/eaa371a0184b56b7ca6d9eb9cb0a2b78b2ccd864/op-bindings/predeploys/addresses.go#L6-L21
331331
vm.assume(addr < address(0x4200000000000000000000000000000000000000) || addr > address(0x4200000000000000000000000000000000000800));
332332
} else if (chainId == 42161 || chainId == 421613) {

src/StdConfig.sol

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -105,8 +105,9 @@ contract StdConfig {
105105

106106
// Cache the configure rpc endpoint for that chain.
107107
// Falls back to `[rpc_endpoints]`. Panics if no rpc endpoint is configured.
108-
try vm.parseTomlString(content, string.concat("$.", chain_key, ".endpoint_url")) returns (string memory url)
109-
{
108+
try vm.parseTomlString(content, string.concat("$.", chain_key, ".endpoint_url")) returns (
109+
string memory url
110+
) {
110111
_rpcOf[chainId] = vm.resolveEnv(url);
111112
} catch {
112113
_rpcOf[chainId] = vm.resolveEnv(vm.rpcUrl(chain_key));
@@ -126,7 +127,7 @@ contract StdConfig {
126127
revert AlreadyInitialized(key);
127128
}
128129
}
129-
} catch {} // Section does not exist, ignore.
130+
} catch {}
130131
}
131132
}
132133
}

src/StdJson.sol

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -197,10 +197,7 @@ library stdJson {
197197
return vm.serializeBool(jsonKey, key, value);
198198
}
199199

200-
function serialize(string memory jsonKey, string memory key, bool[] memory value)
201-
internal
202-
returns (string memory)
203-
{
200+
function serialize(string memory jsonKey, string memory key, bool[] memory value) internal returns (string memory) {
204201
return vm.serializeBool(jsonKey, key, value);
205202
}
206203

@@ -259,10 +256,7 @@ library stdJson {
259256
return vm.serializeBytes(jsonKey, key, value);
260257
}
261258

262-
function serialize(string memory jsonKey, string memory key, string memory value)
263-
internal
264-
returns (string memory)
265-
{
259+
function serialize(string memory jsonKey, string memory key, string memory value) internal returns (string memory) {
266260
return vm.serializeString(jsonKey, key, value);
267261
}
268262

src/StdToml.sol

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -197,10 +197,7 @@ library stdToml {
197197
return vm.serializeBool(jsonKey, key, value);
198198
}
199199

200-
function serialize(string memory jsonKey, string memory key, bool[] memory value)
201-
internal
202-
returns (string memory)
203-
{
200+
function serialize(string memory jsonKey, string memory key, bool[] memory value) internal returns (string memory) {
204201
return vm.serializeBool(jsonKey, key, value);
205202
}
206203

@@ -259,10 +256,7 @@ library stdToml {
259256
return vm.serializeBytes(jsonKey, key, value);
260257
}
261258

262-
function serialize(string memory jsonKey, string memory key, string memory value)
263-
internal
264-
returns (string memory)
265-
{
259+
function serialize(string memory jsonKey, string memory key, string memory value) internal returns (string memory) {
266260
return vm.serializeString(jsonKey, key, value);
267261
}
268262

src/Vm.sol

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

src/interfaces/IERC7540.sol

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -64,10 +64,7 @@ interface IERC7540Deposit is IERC7540Operator {
6464
* - MUST NOT show any variations depending on the caller.
6565
* - MUST NOT revert unless due to integer overflow caused by an unreasonably large input.
6666
*/
67-
function pendingDepositRequest(uint256 requestId, address controller)
68-
external
69-
view
70-
returns (uint256 pendingAssets);
67+
function pendingDepositRequest(uint256 requestId, address controller) external view returns (uint256 pendingAssets);
7168

7269
/**
7370
* @dev Returns the amount of requested assets in Claimable state for the controller to deposit or mint.
@@ -127,10 +124,7 @@ interface IERC7540Redeem is IERC7540Operator {
127124
* - MUST NOT show any variations depending on the caller.
128125
* - MUST NOT revert unless due to integer overflow caused by an unreasonably large input.
129126
*/
130-
function pendingRedeemRequest(uint256 requestId, address controller)
131-
external
132-
view
133-
returns (uint256 pendingShares);
127+
function pendingRedeemRequest(uint256 requestId, address controller) external view returns (uint256 pendingShares);
134128

135129
/**
136130
* @dev Returns the amount of requested shares in Claimable state for the controller to redeem or withdraw.

src/interfaces/IMulticall3.sol

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,7 @@ interface IMulticall3 {
2727
bytes returnData;
2828
}
2929

30-
function aggregate(Call[] calldata calls)
31-
external
32-
payable
33-
returns (uint256 blockNumber, bytes[] memory returnData);
30+
function aggregate(Call[] calldata calls) external payable returns (uint256 blockNumber, bytes[] memory returnData);
3431

3532
function aggregate3(Call3[] calldata calls) external payable returns (Result[] memory returnData);
3633

0 commit comments

Comments
 (0)