Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 1 addition & 6 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,12 +66,7 @@ jobs:
with:
version: ${{ matrix.toolchain }}
- run: forge --version
- run: |
if [ "${{ matrix.toolchain }}" = "stable" ]; then
forge test -vvv --no-match-path "test/Config.t.sol"
else
forge test -vvv
fi
- run: forge test -vvv

fmt:
runs-on: ubuntu-latest
Expand Down
5 changes: 4 additions & 1 deletion foundry.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,14 @@ ignored_error_codes = [3860]

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

[lint]
lint_on_build = false

[fmt]
# These are all the `forge fmt` defaults.
line_length = 120
Expand Down
36 changes: 26 additions & 10 deletions src/StdAssertions.sol
Original file line number Diff line number Diff line change
Expand Up @@ -572,11 +572,7 @@ abstract contract StdAssertions {
vm.assertApproxEqAbs(left, right, maxDelta);
}

function assertApproxEqAbs(uint256 left, uint256 right, uint256 maxDelta, string memory err)
internal
pure
virtual
{
function assertApproxEqAbs(uint256 left, uint256 right, uint256 maxDelta, string memory err) internal pure virtual {
vm.assertApproxEqAbs(left, right, maxDelta, err);
}

Expand Down Expand Up @@ -626,7 +622,11 @@ abstract contract StdAssertions {
uint256 left,
uint256 right,
uint256 maxPercentDelta // An 18 decimal fixed point number, where 1e18 == 100%
) internal pure virtual {
)
internal
pure
virtual
{
vm.assertApproxEqRel(left, right, maxPercentDelta);
}

Expand All @@ -635,7 +635,11 @@ abstract contract StdAssertions {
uint256 right,
uint256 maxPercentDelta, // An 18 decimal fixed point number, where 1e18 == 100%
string memory err
) internal pure virtual {
)
internal
pure
virtual
{
vm.assertApproxEqRel(left, right, maxPercentDelta, err);
}

Expand All @@ -644,7 +648,11 @@ abstract contract StdAssertions {
uint256 right,
uint256 maxPercentDelta, // An 18 decimal fixed point number, where 1e18 == 100%
uint256 decimals
) internal pure virtual {
)
internal
pure
virtual
{
vm.assertApproxEqRelDecimal(left, right, maxPercentDelta, decimals);
}

Expand All @@ -667,7 +675,11 @@ abstract contract StdAssertions {
int256 right,
uint256 maxPercentDelta, // An 18 decimal fixed point number, where 1e18 == 100%
string memory err
) internal pure virtual {
)
internal
pure
virtual
{
vm.assertApproxEqRel(left, right, maxPercentDelta, err);
}

Expand All @@ -676,7 +688,11 @@ abstract contract StdAssertions {
int256 right,
uint256 maxPercentDelta, // An 18 decimal fixed point number, where 1e18 == 100%
uint256 decimals
) internal pure virtual {
)
internal
pure
virtual
{
vm.assertApproxEqRelDecimal(left, right, maxPercentDelta, decimals);
}

Expand Down
2 changes: 1 addition & 1 deletion src/StdCheats.sol
Original file line number Diff line number Diff line change
Expand Up @@ -326,7 +326,7 @@ abstract contract StdCheatsSafe {
vm.assume(addr < address(0x1) || addr > address(0xff));

// forgefmt: disable-start
if (chainId == 10 || chainId == 420) {
if (chainId == 10 || chainId == 420 || chainId == 11155420) {
// https://github.com/ethereum-optimism/optimism/blob/eaa371a0184b56b7ca6d9eb9cb0a2b78b2ccd864/op-bindings/predeploys/addresses.go#L6-L21
vm.assume(addr < address(0x4200000000000000000000000000000000000000) || addr > address(0x4200000000000000000000000000000000000800));
} else if (chainId == 42161 || chainId == 421613) {
Expand Down
7 changes: 4 additions & 3 deletions src/StdConfig.sol
Original file line number Diff line number Diff line change
Expand Up @@ -105,8 +105,9 @@ contract StdConfig {

// Cache the configure rpc endpoint for that chain.
// Falls back to `[rpc_endpoints]`. Panics if no rpc endpoint is configured.
try vm.parseTomlString(content, string.concat("$.", chain_key, ".endpoint_url")) returns (string memory url)
{
try vm.parseTomlString(content, string.concat("$.", chain_key, ".endpoint_url")) returns (
string memory url
) {
_rpcOf[chainId] = vm.resolveEnv(url);
} catch {
_rpcOf[chainId] = vm.resolveEnv(vm.rpcUrl(chain_key));
Expand All @@ -126,7 +127,7 @@ contract StdConfig {
revert AlreadyInitialized(key);
}
}
} catch {} // Section does not exist, ignore.
} catch {}
}
}
}
Expand Down
10 changes: 2 additions & 8 deletions src/StdJson.sol
Original file line number Diff line number Diff line change
Expand Up @@ -197,10 +197,7 @@ library stdJson {
return vm.serializeBool(jsonKey, key, value);
}

function serialize(string memory jsonKey, string memory key, bool[] memory value)
internal
returns (string memory)
{
function serialize(string memory jsonKey, string memory key, bool[] memory value) internal returns (string memory) {
return vm.serializeBool(jsonKey, key, value);
}

Expand Down Expand Up @@ -259,10 +256,7 @@ library stdJson {
return vm.serializeBytes(jsonKey, key, value);
}

function serialize(string memory jsonKey, string memory key, string memory value)
internal
returns (string memory)
{
function serialize(string memory jsonKey, string memory key, string memory value) internal returns (string memory) {
return vm.serializeString(jsonKey, key, value);
}

Expand Down
10 changes: 2 additions & 8 deletions src/StdToml.sol
Original file line number Diff line number Diff line change
Expand Up @@ -197,10 +197,7 @@ library stdToml {
return vm.serializeBool(jsonKey, key, value);
}

function serialize(string memory jsonKey, string memory key, bool[] memory value)
internal
returns (string memory)
{
function serialize(string memory jsonKey, string memory key, bool[] memory value) internal returns (string memory) {
return vm.serializeBool(jsonKey, key, value);
}

Expand Down Expand Up @@ -259,10 +256,7 @@ library stdToml {
return vm.serializeBytes(jsonKey, key, value);
}

function serialize(string memory jsonKey, string memory key, string memory value)
internal
returns (string memory)
{
function serialize(string memory jsonKey, string memory key, string memory value) internal returns (string memory) {
return vm.serializeString(jsonKey, key, value);
}

Expand Down
69 changes: 24 additions & 45 deletions src/Vm.sol

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 2 additions & 8 deletions src/interfaces/IERC7540.sol
Original file line number Diff line number Diff line change
Expand Up @@ -64,10 +64,7 @@ interface IERC7540Deposit is IERC7540Operator {
* - MUST NOT show any variations depending on the caller.
* - MUST NOT revert unless due to integer overflow caused by an unreasonably large input.
*/
function pendingDepositRequest(uint256 requestId, address controller)
external
view
returns (uint256 pendingAssets);
function pendingDepositRequest(uint256 requestId, address controller) external view returns (uint256 pendingAssets);

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

/**
* @dev Returns the amount of requested shares in Claimable state for the controller to redeem or withdraw.
Expand Down
5 changes: 1 addition & 4 deletions src/interfaces/IMulticall3.sol
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,7 @@ interface IMulticall3 {
bytes returnData;
}

function aggregate(Call[] calldata calls)
external
payable
returns (uint256 blockNumber, bytes[] memory returnData);
function aggregate(Call[] calldata calls) external payable returns (uint256 blockNumber, bytes[] memory returnData);

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

Expand Down
4 changes: 2 additions & 2 deletions test/StdChains.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ contract StdChainsMock is Test {
contract StdChainsTest is Test {
function test_ChainRpcInitialization() public {
// RPCs specified in `foundry.toml` should be updated.
assertEq(getChain(1).rpcUrl, "https://eth.merkle.io");
assertEq(getChain(1).rpcUrl, "https://reth-ethereum.ithaca.xyz/rpc");
assertEq(getChain("optimism_sepolia").rpcUrl, "https://sepolia.optimism.io/");
assertEq(getChain("arbitrum_one_sepolia").rpcUrl, "https://sepolia-rollup.arbitrum.io/rpc/");

Expand All @@ -36,7 +36,7 @@ contract StdChainsTest is Test {

// Cannot override RPCs defined in `foundry.toml`
vm.setEnv("MAINNET_RPC_URL", "myoverride2");
assertEq(getChain("mainnet").rpcUrl, "https://eth.merkle.io");
assertEq(getChain("mainnet").rpcUrl, "https://reth-ethereum.ithaca.xyz/rpc");

// Other RPCs should remain unchanged.
assertEq(getChain(31337).rpcUrl, "http://127.0.0.1:8545");
Expand Down
Loading