diff --git a/.gas-snapshot b/.gas-snapshot index b20a5f7e6..e3a83024c 100644 --- a/.gas-snapshot +++ b/.gas-snapshot @@ -1,5 +1,6 @@ -GenericPoolOrderBookV3ArbOrderTakerTest:testGenericPoolMinimumOutput((address,bool,(address,address,address),(address,uint8,uint256)[],(address,uint8,uint256)[]),uint256,uint256,uint256,uint256) (runs: 5096, μ: 332052, ~: 330383) -GenericPoolOrderBookV3ArbOrderTakerTest:testGenericPoolTakeOrdersSender((address,bool,(address,address,address),(address,uint8,uint256)[],(address,uint8,uint256)[]),uint256,uint256) (runs: 5096, μ: 266210, ~: 265260) +GenericPoolOrderBookV3ArbOrderTakerInitTest:testGenericPoolOrderBookV3ArbOrderTakerInitInvalidInputs(bytes) (runs: 5096, μ: 112556, ~: 112571) +GenericPoolOrderBookV3ArbOrderTakerSenderTest:testGenericPoolMinimumOutput((address,bool,(address,address,address),(address,uint8,uint256)[],(address,uint8,uint256)[]),uint256,uint256,uint256,uint256) (runs: 5096, μ: 332057, ~: 330383) +GenericPoolOrderBookV3ArbOrderTakerSenderTest:testGenericPoolTakeOrdersSender((address,bool,(address,address,address),(address,uint8,uint256)[],(address,uint8,uint256)[]),uint256,uint256) (runs: 5096, μ: 266214, ~: 265260) GenericPoolOrderBookV3FlashBorrowerTest:testGenericPoolOrderBookV3FlashBorrowerMinimumOutput((address,bool,(address,address,address),(address,uint8,uint256)[],(address,uint8,uint256)[]),uint256,uint256,uint256,uint256) (runs: 5096, μ: 609059, ~: 605057) GenericPoolOrderBookV3FlashBorrowerTest:testGenericPoolOrderBookV3FlashBorrowerTakeOrdersSender((address,bool,(address,address,address),(address,uint8,uint256)[],(address,uint8,uint256)[]),uint256,uint256) (runs: 5096, μ: 522448, ~: 519675) LibOrderTest:testHashEqual((address,bool,(address,address,address),(address,uint8,uint256)[],(address,uint8,uint256)[])) (runs: 5096, μ: 196882, ~: 195948) @@ -86,5 +87,6 @@ OrderBookWithdrawTest:testWithdrawFullVault(address,uint256,uint256,uint256) (ru OrderBookWithdrawTest:testWithdrawMany((bool,address,address,uint256,uint248)[]) (runs: 5096, μ: 3169906, ~: 3156574) OrderBookWithdrawTest:testWithdrawPartialVault(address,uint256,uint256,uint256) (runs: 5096, μ: 49439, ~: 49439) OrderBookWithdrawTest:testWithdrawZero(address,address,uint256) (runs: 5096, μ: 12809, ~: 12809) -RouteProcessorOrderBookV3ArbOrderTakerTest:testRouteProcessorMinimumOutput((address,bool,(address,address,address),(address,uint8,uint256)[],(address,uint8,uint256)[]),uint256,uint256,uint256,uint256) (runs: 5096, μ: 332202, ~: 330538) -RouteProcessorOrderBookV3ArbOrderTakerTest:testRouteProcessorTakeOrdersSender((address,bool,(address,address,address),(address,uint8,uint256)[],(address,uint8,uint256)[]),uint256,uint256) (runs: 5096, μ: 266376, ~: 265424) \ No newline at end of file +RouteProcessorOrderBookV3ArbOrderTakerInitTest:testRouteProcessorOrderBookV3ArbOrderTakerInitInvalidInputs(bytes) (runs: 5096, μ: 135462, ~: 135478) +RouteProcessorOrderBookV3ArbOrderTakerSenderTest:testRouteProcessorMinimumOutput((address,bool,(address,address,address),(address,uint8,uint256)[],(address,uint8,uint256)[]),uint256,uint256,uint256,uint256) (runs: 5096, μ: 332199, ~: 330538) +RouteProcessorOrderBookV3ArbOrderTakerSenderTest:testRouteProcessorTakeOrdersSender((address,bool,(address,address,address),(address,uint8,uint256)[],(address,uint8,uint256)[]),uint256,uint256) (runs: 5096, μ: 266375, ~: 265424) \ No newline at end of file diff --git a/test/concrete/GenericPoolOrderBookV3ArbOrderTaker.init.t.sol b/test/concrete/GenericPoolOrderBookV3ArbOrderTaker.init.t.sol index d7c3286b6..75de5d4b1 100644 --- a/test/concrete/GenericPoolOrderBookV3ArbOrderTaker.init.t.sol +++ b/test/concrete/GenericPoolOrderBookV3ArbOrderTaker.init.t.sol @@ -10,14 +10,17 @@ import {IParserV1} from "rain.interpreter/src/interface/IParserV1.sol"; import {NonZeroBeforeArbInputs} from "src/abstract/OrderBookV3ArbOrderTaker.sol"; contract GenericPoolOrderBookV3ArbOrderTakerInitTest is GenericPoolOrderBookV3ArbOrderTakerTest { - function testGenericPoolOrderBookV3ArbOrderTakerInitInvalidInputs() public { + function testGenericPoolOrderBookV3ArbOrderTakerInitInvalidInputs(bytes memory io) public { + vm.assume(io.length >= 2); + vm.assume(io.length % 2 == 0); + vm.assume(io[0] != 0); address testArb = Clones.clone(iImplementation); vm.mockCall( iDeployer, abi.encodeWithSelector(IExpressionDeployerV3.deployExpression2.selector), - abi.encode(address(0), address(0), address(0), "0100") + abi.encode(address(0), address(0), address(0), io) ); - vm.expectRevert(abi.encodeWithSelector(NonZeroBeforeArbInputs.selector, 48)); + vm.expectRevert(abi.encodeWithSelector(NonZeroBeforeArbInputs.selector, uint256(uint8(io[0])))); ICloneableV2(testArb).initialize( abi.encode( OrderBookV3ArbOrderTakerConfigV1( diff --git a/test/concrete/RouteProcessorOrderBookV3ArbOrderTaker.init.t.sol b/test/concrete/RouteProcessorOrderBookV3ArbOrderTaker.init.t.sol index b38c06a50..125d8345e 100644 --- a/test/concrete/RouteProcessorOrderBookV3ArbOrderTaker.init.t.sol +++ b/test/concrete/RouteProcessorOrderBookV3ArbOrderTaker.init.t.sol @@ -10,14 +10,17 @@ import {EvaluableConfigV3, IExpressionDeployerV3} from "src/interface/unstable/I import {NonZeroBeforeArbInputs} from "src/abstract/OrderBookV3ArbOrderTaker.sol"; contract RouteProcessorOrderBookV3ArbOrderTakerInitTest is RouteProcessorOrderBookV3ArbOrderTakerTest { - function testRouteProcessorOrderBookV3ArbOrderTakerInitInvalidInputs() public { + function testRouteProcessorOrderBookV3ArbOrderTakerInitInvalidInputs(bytes memory io) public { + vm.assume(io.length >= 2); + vm.assume(io.length % 2 == 0); + vm.assume(io[0] != 0); address testArb = Clones.clone(iImplementation); vm.mockCall( iDeployer, abi.encodeWithSelector(IExpressionDeployerV3.deployExpression2.selector), - abi.encode(address(0), address(0), address(0), "0100") + abi.encode(address(0), address(0), address(0), io) ); - vm.expectRevert(abi.encodeWithSelector(NonZeroBeforeArbInputs.selector, 48)); + vm.expectRevert(abi.encodeWithSelector(NonZeroBeforeArbInputs.selector, uint256(uint8(io[0])))); ICloneableV2(testArb).initialize( abi.encode( OrderBookV3ArbOrderTakerConfigV1(