From 6c661fc80375402b265a3c8ab5981107849240bc Mon Sep 17 00:00:00 2001 From: Keating Date: Wed, 19 Apr 2023 12:40:57 -0400 Subject: [PATCH 01/48] Initial work --- src/V5Router.sol | 53 +++++++++++++++++++ src/interfaces/AggregationExecutionRouter.sol | 46 ++++++++++++++++ 2 files changed, 99 insertions(+) create mode 100644 src/V5Router.sol create mode 100644 src/interfaces/AggregationExecutionRouter.sol diff --git a/src/V5Router.sol b/src/V5Router.sol new file mode 100644 index 0000000..34cf1f8 --- /dev/null +++ b/src/V5Router.sol @@ -0,0 +1,53 @@ +// executor can be removed +// srcToken: each contract is a src token +// dstToken: Can be represented by an integer?? +// amount: strat +// minReturnAmount: strat +// flags? +// permit? +// data - don't think we can do anything, comes from their api. +// SPDX-License-Identifier: MIT +pragma solidity >=0.8.0; + +import {IAggregationExecutor} from "src/interfaces/AggregationExecutionRouter.sol"; + + +// Struct for the aggregation router +struct SwapDescription { + IERC20 srcToken; + IERC20 dstToken; + address payable srcReceiver; + address payable dstReceiver; + uint256 amount; + uint256 minReturnAmount; + uint256 flags; +} + +abstract contract AggregationBaseRouter { + IAggregationExecutor public immutable AGGREGATION_EXECUTOR; + + address public immutable TOKEN; + address public immutable SOURCE_RECEIVER; + + constructor( + IAggregationExecutor aggreationExecutor, + address token, + address sourceReceiver + ) { + AGGREGATION_EXECUTOR = aggreationExecutor; + TOKEN = token; + SOURCE_RECEIVER = sourceReceiver; + } + + + +} + +contract V5Router { + + // + function fallback() external payable { + // This is the fallback function + + } +} diff --git a/src/interfaces/AggregationExecutionRouter.sol b/src/interfaces/AggregationExecutionRouter.sol new file mode 100644 index 0000000..98cfbf9 --- /dev/null +++ b/src/interfaces/AggregationExecutionRouter.sol @@ -0,0 +1,46 @@ +// SPDX-License-Identifier: MIT +pragma solidity >=0.8.0; + +// Struct for the aggregation router +struct SwapDescription { + IERC20 srcToken; + IERC20 dstToken; + address payable srcReceiver; + address payable dstReceiver; + uint256 amount; + uint256 minReturnAmount; + uint256 flags; +} + +abstract contract AggregationBaseRouter { + IAccountBalance public immutable ACCOUNT_BALANCE; + + address public immutable TOKEN; + address public immutable SOURCE_RECEIVER; + + constructor( + IClearingHouse clearingHouse, + address asset, + bool isBaseToQuote, + bool isExactInput, + IAccountBalance accountBalance + ) { + PERPETUAL_CLEARING_HOUSE = clearingHouse; + IS_BASE_TO_QUOTE = isBaseToQuote; + IS_EXACT_INPUT = isExactInput; + TOKEN = asset; + ACCOUNT_BALANCE = accountBalance; + } + + + +} + +contract V5Router { + + // + function fallback() external payable { + // This is the fallback function + + } +} From 13c05ff2057aa25abfb295045dd1764f3accfd35 Mon Sep 17 00:00:00 2001 From: Keating Date: Wed, 19 Apr 2023 12:41:17 -0400 Subject: [PATCH 02/48] forge install: solmate --- .gitmodules | 3 +++ lib/solmate | 1 + 2 files changed, 4 insertions(+) create mode 160000 lib/solmate diff --git a/.gitmodules b/.gitmodules index 888d42d..c59f396 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,3 +1,6 @@ [submodule "lib/forge-std"] path = lib/forge-std url = https://github.com/foundry-rs/forge-std +[submodule "lib/solmate"] + path = lib/solmate + url = https://github.com/transmissions11/solmate diff --git a/lib/solmate b/lib/solmate new file mode 160000 index 0000000..2001af4 --- /dev/null +++ b/lib/solmate @@ -0,0 +1 @@ +Subproject commit 2001af43aedb46fdc2335d2a7714fb2dae7cfcd1 From 4ad7fda471686034e689b1873680a33fee35a7ba Mon Sep 17 00:00:00 2001 From: Keating Date: Thu, 20 Apr 2023 04:45:07 -0400 Subject: [PATCH 03/48] forge install: openzeppelin-contracts v4.8.3 --- .gitmodules | 3 +++ lib/openzeppelin-contracts | 1 + 2 files changed, 4 insertions(+) create mode 160000 lib/openzeppelin-contracts diff --git a/.gitmodules b/.gitmodules index c59f396..69f7db1 100644 --- a/.gitmodules +++ b/.gitmodules @@ -4,3 +4,6 @@ [submodule "lib/solmate"] path = lib/solmate url = https://github.com/transmissions11/solmate +[submodule "lib/openzeppelin-contracts"] + path = lib/openzeppelin-contracts + url = https://github.com//OpenZeppelin/openzeppelin-contracts diff --git a/lib/openzeppelin-contracts b/lib/openzeppelin-contracts new file mode 160000 index 0000000..0a25c19 --- /dev/null +++ b/lib/openzeppelin-contracts @@ -0,0 +1 @@ +Subproject commit 0a25c1940ca220686588c4af3ec526f725fe2582 From ec6677a4beb88c2054028f167be40655345a8b93 Mon Sep 17 00:00:00 2001 From: Keating Date: Tue, 25 Apr 2023 18:33:19 -0400 Subject: [PATCH 04/48] Building V5 router --- script/Deploy.s.sol | 9 +- src/Counter.sol | 14 --- src/RouterFactory.sol | 57 ++++++++++++ src/V5Router.sol | 88 ++++++++++++------- src/interfaces/AggregationExecutionRouter.sol | 46 ---------- .../IAggregationExecutionRouter.sol | 7 ++ src/interfaces/IAggregationRouter.sol | 24 +++++ src/lib/Create2.sol | 29 ++++++ test/1InchContracts.sol | 13 +++ test/Counter.t.sol | 26 ------ test/V5Router.t.sol | 18 ++++ 11 files changed, 204 insertions(+), 127 deletions(-) delete mode 100644 src/Counter.sol create mode 100644 src/RouterFactory.sol delete mode 100644 src/interfaces/AggregationExecutionRouter.sol create mode 100644 src/interfaces/IAggregationExecutionRouter.sol create mode 100644 src/interfaces/IAggregationRouter.sol create mode 100644 src/lib/Create2.sol create mode 100644 test/1InchContracts.sol delete mode 100644 test/Counter.t.sol create mode 100644 test/V5Router.t.sol diff --git a/script/Deploy.s.sol b/script/Deploy.s.sol index 293fec5..98eacb0 100644 --- a/script/Deploy.s.sol +++ b/script/Deploy.s.sol @@ -3,14 +3,7 @@ pragma solidity ^0.8.16; import "forge-std/Script.sol"; -import {Counter} from "src/Counter.sol"; contract Deploy is Script { - Counter counter; - - function run() public { - // Commented out for now until https://github.com/crytic/slither/pull/1461 is released. - // vm.startBroadcast(); - counter = new Counter(); - } + function run() public {} } diff --git a/src/Counter.sol b/src/Counter.sol deleted file mode 100644 index 530c811..0000000 --- a/src/Counter.sol +++ /dev/null @@ -1,14 +0,0 @@ -// SPDX-License-Identifier: UNLICENSED -pragma solidity ^0.8.16; - -contract Counter { - uint256 public number; - - function setNumber(uint256 newNumber) public { - number = newNumber; - } - - function increment() public { - number++; - } -} diff --git a/src/RouterFactory.sol b/src/RouterFactory.sol new file mode 100644 index 0000000..f6ad175 --- /dev/null +++ b/src/RouterFactory.sol @@ -0,0 +1,57 @@ +// SPDX-License-Identifier: MIT +pragma solidity >=0.8.0; + +import {IAggregationExecutor} from "src/interfaces/IAggregationExecutionRouter.sol"; +import {IAggregationRouter} from "src/interfaces/IAggregationRouter.sol"; +import {Create2} from "src/lib/Create2.sol"; +import {V5Router} from "src/V5Router.sol"; + +contract OneInchRouterFactory { + IAggregationExecutor public immutable AGGREGATION_EXECUTOR; + IAggregationRouter public immutable V5_AGGREGATION_ROUTER; + address public immutable SOURCE_RECEIVER; + + event RouterDeployed(address indexed asset); + + constructor( + IAggregationExecutor aggregationExecutor, + IAggregationRouter v5AggregationRouter + ) { + AGGREGATION_EXECUTOR = aggregationExecutor; + V5_AGGREGATION_ROUTER = v5AggregationRouter; + SOURCE_RECEIVER = address(aggregationExecutor); + } + + function deploy(address asset) external returns (address) { + bytes32 salt = _salt(asset); + address router = address( + new V5Router{salt: salt}( + V5_AGGREGATION_ROUTER, + AGGREGATION_EXECUTOR, + asset, + SOURCE_RECEIVER + ) + ); + emit RouterDeployed(router); + return router; + } + + function computeAddress(address asset) external view returns (address) { + return + Create2.computeCreate2Address( + _salt(asset), + address(this), + type(V5Router).creationCode, + abi.encode( + V5_AGGREGATION_ROUTER, + AGGREGATION_EXECUTOR, + asset, + SOURCE_RECEIVER + ) + ); + } + + function _salt(address asset) internal pure returns (bytes32) { + return bytes32(uint256(uint160(asset))); + } +} diff --git a/src/V5Router.sol b/src/V5Router.sol index 34cf1f8..d454575 100644 --- a/src/V5Router.sol +++ b/src/V5Router.sol @@ -9,45 +9,67 @@ // SPDX-License-Identifier: MIT pragma solidity >=0.8.0; -import {IAggregationExecutor} from "src/interfaces/AggregationExecutionRouter.sol"; - - -// Struct for the aggregation router -struct SwapDescription { - IERC20 srcToken; - IERC20 dstToken; - address payable srcReceiver; - address payable dstReceiver; - uint256 amount; - uint256 minReturnAmount; - uint256 flags; -} +import {IAggregationExecutor} from "src/interfaces/IAggregationExecutionRouter.sol"; +import {IAggregationRouter} from "src/interfaces/IAggregationRouter.sol"; +import {IERC20} from "openzeppelin-contracts/contracts/token/ERC20/IERC20.sol"; abstract contract AggregationBaseRouter { - IAggregationExecutor public immutable AGGREGATION_EXECUTOR; - - address public immutable TOKEN; - address public immutable SOURCE_RECEIVER; - - constructor( - IAggregationExecutor aggreationExecutor, - address token, - address sourceReceiver - ) { - AGGREGATION_EXECUTOR = aggreationExecutor; - TOKEN = token; - SOURCE_RECEIVER = sourceReceiver; - } - + IAggregationExecutor public immutable AGGREGATION_EXECUTOR; + address public immutable TOKEN; + address public immutable SOURCE_RECEIVER; + constructor( + IAggregationExecutor aggreationExecutor, + address token, + address sourceReceiver + ) { + AGGREGATION_EXECUTOR = aggreationExecutor; + TOKEN = token; + SOURCE_RECEIVER = sourceReceiver; + } } -contract V5Router { +contract V5Router is AggregationBaseRouter { + IAggregationRouter public immutable AGGREGATION_ROUTER; - // - function fallback() external payable { - // This is the fallback function + constructor( + IAggregationRouter aggregationRouter, + IAggregationExecutor aggregationExecutor, + address token, + address sourceReceiver + ) AggregationBaseRouter(aggregationExecutor, token, sourceReceiver) { + AGGREGATION_ROUTER = aggregationRouter; + } - } + // + // TODO: minReturnAmount is the minimum allowed output amount + // + // Can we have exact out? And maybe a percentage slipppage. + // + // the flags match specific constant masks. there is no documentation on these though + fallback() external payable { + // This is the fallback function + ( + address dstToken, + uint256 amount, + uint256 minReturnAmount, + bytes memory data, + bool flags + ) = abi.decode(msg.data, (address, uint256, uint256, bytes, bool)); + AGGREGATION_ROUTER.swap( + AGGREGATION_EXECUTOR, + IAggregationRouter.SwapDescription({ + srcToken: IERC20(TOKEN), + dstToken: IERC20(dstToken), + srcReceiver: payable(SOURCE_RECEIVER), + dstReceiver: payable(msg.sender), + amount: amount, + minReturnAmount: minReturnAmount, + flags: flags ? 1 : 0 + }), + "", + data + ); + } } diff --git a/src/interfaces/AggregationExecutionRouter.sol b/src/interfaces/AggregationExecutionRouter.sol deleted file mode 100644 index 98cfbf9..0000000 --- a/src/interfaces/AggregationExecutionRouter.sol +++ /dev/null @@ -1,46 +0,0 @@ -// SPDX-License-Identifier: MIT -pragma solidity >=0.8.0; - -// Struct for the aggregation router -struct SwapDescription { - IERC20 srcToken; - IERC20 dstToken; - address payable srcReceiver; - address payable dstReceiver; - uint256 amount; - uint256 minReturnAmount; - uint256 flags; -} - -abstract contract AggregationBaseRouter { - IAccountBalance public immutable ACCOUNT_BALANCE; - - address public immutable TOKEN; - address public immutable SOURCE_RECEIVER; - - constructor( - IClearingHouse clearingHouse, - address asset, - bool isBaseToQuote, - bool isExactInput, - IAccountBalance accountBalance - ) { - PERPETUAL_CLEARING_HOUSE = clearingHouse; - IS_BASE_TO_QUOTE = isBaseToQuote; - IS_EXACT_INPUT = isExactInput; - TOKEN = asset; - ACCOUNT_BALANCE = accountBalance; - } - - - -} - -contract V5Router { - - // - function fallback() external payable { - // This is the fallback function - - } -} diff --git a/src/interfaces/IAggregationExecutionRouter.sol b/src/interfaces/IAggregationExecutionRouter.sol new file mode 100644 index 0000000..2baea5c --- /dev/null +++ b/src/interfaces/IAggregationExecutionRouter.sol @@ -0,0 +1,7 @@ +pragma solidity >=0.8.0; + +/// @title Interface for making arbitrary calls during swap +interface IAggregationExecutor { + /// @notice propagates information about original msg.sender and executes arbitrary data + function execute(address msgSender) external payable; // 0x4b64e492 +} diff --git a/src/interfaces/IAggregationRouter.sol b/src/interfaces/IAggregationRouter.sol new file mode 100644 index 0000000..9bc58e5 --- /dev/null +++ b/src/interfaces/IAggregationRouter.sol @@ -0,0 +1,24 @@ +pragma solidity >=0.8.0; + +import {IAggregationExecutor} from "src/interfaces/IAggregationExecutionRouter.sol"; +import {IERC20} from "openzeppelin-contracts/contracts/token/ERC20/IERC20.sol"; + +interface IAggregationRouter { + struct SwapDescription { + IERC20 srcToken; + IERC20 dstToken; + address payable srcReceiver; + address payable dstReceiver; + uint256 amount; + uint256 minReturnAmount; + uint256 flags; + } + + /// @notice propagates information about original msg.sender and executes arbitrary data + function swap( + IAggregationExecutor executor, + SwapDescription calldata desc, + bytes calldata permit, + bytes calldata data + ) external payable returns (uint256 returnAmount, uint256 spentAmount); // 0x4b64e492 +} diff --git a/src/lib/Create2.sol b/src/lib/Create2.sol new file mode 100644 index 0000000..a6a0431 --- /dev/null +++ b/src/lib/Create2.sol @@ -0,0 +1,29 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity ^0.8.16; + +library Create2 { + function computeCreate2Address( + bytes32 salt, + address deployer, + bytes memory initcode, + bytes memory constructorArgs + ) internal pure returns (address) { + return + address( + uint160( + uint256( + keccak256( + abi.encodePacked( + bytes1(0xff), + deployer, + salt, + keccak256( + abi.encodePacked(initcode, constructorArgs) + ) + ) + ) + ) + ) + ); + } +} diff --git a/test/1InchContracts.sol b/test/1InchContracts.sol new file mode 100644 index 0000000..d50f1d5 --- /dev/null +++ b/test/1InchContracts.sol @@ -0,0 +1,13 @@ +// SPDX-License-Identifier: MIT +pragma solidity >=0.8.0; + +import {IAggregationExecutor} from "src/interfaces/IAggregationExecutionRouter.sol"; +import {IAggregationRouter} from "src/interfaces/IAggregationRouter.sol"; + +contract OneInchContracts { + IAggregationRouter aggregationRouter = + IAggregationRouter(0x1111111254EEB25477B68fb85Ed929f73A960582); + IAggregationExecutor aggreationExecutor = + IAggregationExecutor(0xf0694ACc9E941B176E17B9Ef923e71E7B8b2477A); + address public immutable USDC = 0x7F5c764cBc14f9669B88837ca1490cCa17c31607; +} diff --git a/test/Counter.t.sol b/test/Counter.t.sol deleted file mode 100644 index 706f5ef..0000000 --- a/test/Counter.t.sol +++ /dev/null @@ -1,26 +0,0 @@ -// SPDX-License-Identifier: UNLICENSED -pragma solidity ^0.8.16; - -import "forge-std/Test.sol"; -import {Deploy} from "script/Deploy.s.sol"; -import {Counter} from "src/Counter.sol"; - -contract CounterTest is Test, Deploy { - function setUp() public { - Deploy.run(); - } -} - -contract Increment is CounterTest { - function test_NumberIsIncremented() public { - counter.increment(); - assertEq(counter.number(), 1); - } -} - -contract SetNumber is CounterTest { - function testFuzz_NumberIsSet(uint256 x) public { - counter.setNumber(x); - assertEq(counter.number(), x); - } -} diff --git a/test/V5Router.t.sol b/test/V5Router.t.sol new file mode 100644 index 0000000..484ae04 --- /dev/null +++ b/test/V5Router.t.sol @@ -0,0 +1,18 @@ +// SPDX-License-Identifier: MIT +pragma solidity >=0.8.0; + +import "forge-std/Test.sol"; +import {OneInchRouterFactory} from "src/RouterFactory.sol"; +import {OneInchContracts} from "test/1InchContracts.sol"; + +contract V5RouterTestBase is Test, OneInchContracts { + function setUp() public { + vm.createSelectFork(vm.rpcUrl("optimism"), 87_407_144); + OneInchRouterFactory factory = new OneInchRouterFactory( + aggreationExecutor, + aggregationRouter + ); + factory.deploy(USDC); + deal(USDC, address(this), 100_000_000); + } +} From 9c71bc4083d242cbca2f26af64b3043f80e45b85 Mon Sep 17 00:00:00 2001 From: Keating Date: Wed, 26 Apr 2023 17:18:39 -0400 Subject: [PATCH 05/48] Working test --- foundry.toml | 6 ++++ script/Deploy.s.sol | 8 ++++- src/RouterFactory.sol | 65 +++++++++++++++++----------------------- src/V5Router.sol | 2 ++ src/lib/Create2.sol | 42 +++++++++++--------------- test/1InchContracts.sol | 11 +++---- test/RouterFactory.t.sol | 23 ++++++++++++++ test/V5Router.t.sol | 63 ++++++++++++++++++++++++++++++++++++-- 8 files changed, 150 insertions(+), 70 deletions(-) create mode 100644 test/RouterFactory.t.sol diff --git a/foundry.toml b/foundry.toml index be39c57..9b4befa 100644 --- a/foundry.toml +++ b/foundry.toml @@ -24,3 +24,9 @@ single_line_statement_blocks = "single" tab_width = 2 wrap_comments = true + +# =============================== +# ======== RPC Endpoints ======== +# =============================== +[rpc_endpoints] + optimism = "${OPTIMISM_RPC_URL}" diff --git a/script/Deploy.s.sol b/script/Deploy.s.sol index 98eacb0..acd7886 100644 --- a/script/Deploy.s.sol +++ b/script/Deploy.s.sol @@ -3,7 +3,13 @@ pragma solidity ^0.8.16; import "forge-std/Script.sol"; +import {IERC20} from "openzeppelin-contracts/contracts/token/ERC20/IERC20.sol"; +// approve for amount to router contract Deploy is Script { - function run() public {} + function run() public { + address USDC = 0x7F5c764cBc14f9669B88837ca1490cCa17c31607; + vm.broadcast(); + IERC20(USDC).approve(0x1111111254EEB25477B68fb85Ed929f73A960582, 100_000); + } } diff --git a/src/RouterFactory.sol b/src/RouterFactory.sol index f6ad175..b7e07d0 100644 --- a/src/RouterFactory.sol +++ b/src/RouterFactory.sol @@ -7,51 +7,42 @@ import {Create2} from "src/lib/Create2.sol"; import {V5Router} from "src/V5Router.sol"; contract OneInchRouterFactory { - IAggregationExecutor public immutable AGGREGATION_EXECUTOR; - IAggregationRouter public immutable V5_AGGREGATION_ROUTER; - address public immutable SOURCE_RECEIVER; + IAggregationExecutor public immutable AGGREGATION_EXECUTOR; + IAggregationRouter public immutable V5_AGGREGATION_ROUTER; + address public immutable SOURCE_RECEIVER; - event RouterDeployed(address indexed asset); + event RouterDeployed(address indexed asset); - constructor( - IAggregationExecutor aggregationExecutor, - IAggregationRouter v5AggregationRouter - ) { - AGGREGATION_EXECUTOR = aggregationExecutor; - V5_AGGREGATION_ROUTER = v5AggregationRouter; - SOURCE_RECEIVER = address(aggregationExecutor); - } + constructor(IAggregationExecutor aggregationExecutor, IAggregationRouter v5AggregationRouter) { + AGGREGATION_EXECUTOR = aggregationExecutor; + V5_AGGREGATION_ROUTER = v5AggregationRouter; + SOURCE_RECEIVER = address(aggregationExecutor); + } - function deploy(address asset) external returns (address) { - bytes32 salt = _salt(asset); - address router = address( - new V5Router{salt: salt}( + function deploy(address asset) external returns (address) { + bytes32 salt = _salt(asset); + address router = address( + new V5Router{salt: salt}( V5_AGGREGATION_ROUTER, AGGREGATION_EXECUTOR, asset, SOURCE_RECEIVER ) - ); - emit RouterDeployed(router); - return router; - } + ); + emit RouterDeployed(router); + return router; + } - function computeAddress(address asset) external view returns (address) { - return - Create2.computeCreate2Address( - _salt(asset), - address(this), - type(V5Router).creationCode, - abi.encode( - V5_AGGREGATION_ROUTER, - AGGREGATION_EXECUTOR, - asset, - SOURCE_RECEIVER - ) - ); - } + function computeAddress(address asset) external view returns (address) { + return Create2.computeCreate2Address( + _salt(asset), + address(this), + type(V5Router).creationCode, + abi.encode(V5_AGGREGATION_ROUTER, AGGREGATION_EXECUTOR, asset, SOURCE_RECEIVER) + ); + } - function _salt(address asset) internal pure returns (bytes32) { - return bytes32(uint256(uint160(asset))); - } + function _salt(address asset) internal pure returns (bytes32) { + return bytes32(uint256(uint160(asset))); + } } diff --git a/src/V5Router.sol b/src/V5Router.sol index d454575..94baf1b 100644 --- a/src/V5Router.sol +++ b/src/V5Router.sol @@ -57,6 +57,8 @@ contract V5Router is AggregationBaseRouter { bytes memory data, bool flags ) = abi.decode(msg.data, (address, uint256, uint256, bytes, bool)); + IERC20(TOKEN).transferFrom(msg.sender, address(this), amount); + IERC20(TOKEN).approve(address(AGGREGATION_ROUTER), amount); AGGREGATION_ROUTER.swap( AGGREGATION_EXECUTOR, IAggregationRouter.SwapDescription({ diff --git a/src/lib/Create2.sol b/src/lib/Create2.sol index a6a0431..533a8ea 100644 --- a/src/lib/Create2.sol +++ b/src/lib/Create2.sol @@ -2,28 +2,22 @@ pragma solidity ^0.8.16; library Create2 { - function computeCreate2Address( - bytes32 salt, - address deployer, - bytes memory initcode, - bytes memory constructorArgs - ) internal pure returns (address) { - return - address( - uint160( - uint256( - keccak256( - abi.encodePacked( - bytes1(0xff), - deployer, - salt, - keccak256( - abi.encodePacked(initcode, constructorArgs) - ) - ) - ) - ) - ) - ); - } + function computeCreate2Address( + bytes32 salt, + address deployer, + bytes memory initcode, + bytes memory constructorArgs + ) internal pure returns (address) { + return address( + uint160( + uint256( + keccak256( + abi.encodePacked( + bytes1(0xff), deployer, salt, keccak256(abi.encodePacked(initcode, constructorArgs)) + ) + ) + ) + ) + ); + } } diff --git a/test/1InchContracts.sol b/test/1InchContracts.sol index d50f1d5..daeccf6 100644 --- a/test/1InchContracts.sol +++ b/test/1InchContracts.sol @@ -5,9 +5,10 @@ import {IAggregationExecutor} from "src/interfaces/IAggregationExecutionRouter.s import {IAggregationRouter} from "src/interfaces/IAggregationRouter.sol"; contract OneInchContracts { - IAggregationRouter aggregationRouter = - IAggregationRouter(0x1111111254EEB25477B68fb85Ed929f73A960582); - IAggregationExecutor aggreationExecutor = - IAggregationExecutor(0xf0694ACc9E941B176E17B9Ef923e71E7B8b2477A); - address public immutable USDC = 0x7F5c764cBc14f9669B88837ca1490cCa17c31607; + IAggregationRouter aggregationRouter = + IAggregationRouter(0x1111111254EEB25477B68fb85Ed929f73A960582); + IAggregationExecutor aggreationExecutor = + IAggregationExecutor(0xf0694ACc9E941B176E17B9Ef923e71E7B8b2477A); + address public immutable USDC = 0x7F5c764cBc14f9669B88837ca1490cCa17c31607; + address public immutable UNI = 0x6fd9d7AD17242c41f7131d257212c54A0e816691; } diff --git a/test/RouterFactory.t.sol b/test/RouterFactory.t.sol new file mode 100644 index 0000000..ccc7018 --- /dev/null +++ b/test/RouterFactory.t.sol @@ -0,0 +1,23 @@ +// SPDX-License-Identifier: MIT +pragma solidity >=0.8.0; + +import {Test} from "forge-std/Test.sol"; +import {OneInchRouterFactory} from "src/RouterFactory.sol"; +import {OneInchContracts} from "test/1InchContracts.sol"; + +contract RouterFactoryTest is Test, OneInchContracts { + OneInchRouterFactory factory; + + function test_deployV5Router() public { + OneInchRouterFactory factory = new OneInchRouterFactory( + aggreationExecutor, + aggregationRouter + ); + address V5Router = factory.deploy(USDC); + assertEq( + V5Router, + factory.computeAddress(USDC), + "V5Router address should be correct" + ); + } +} diff --git a/test/V5Router.t.sol b/test/V5Router.t.sol index 484ae04..c499853 100644 --- a/test/V5Router.t.sol +++ b/test/V5Router.t.sol @@ -4,15 +4,72 @@ pragma solidity >=0.8.0; import "forge-std/Test.sol"; import {OneInchRouterFactory} from "src/RouterFactory.sol"; import {OneInchContracts} from "test/1InchContracts.sol"; +import {IAggregationRouter} from "src/interfaces/IAggregationRouter.sol"; +import {IERC20} from "openzeppelin-contracts/contracts/token/ERC20/IERC20.sol"; + +contract V5RouterForkTestBase is Test, OneInchContracts { + OneInchRouterFactory factory; -contract V5RouterTestBase is Test, OneInchContracts { function setUp() public { - vm.createSelectFork(vm.rpcUrl("optimism"), 87_407_144); - OneInchRouterFactory factory = new OneInchRouterFactory( + vm.createSelectFork(vm.rpcUrl("optimism"), 94_524_034); + factory = new OneInchRouterFactory( aggreationExecutor, aggregationRouter ); factory.deploy(USDC); deal(USDC, address(this), 100_000_000); + // approve to send usdc + } +} + +// Is there a cheatcode to change the calling +// address. If so then I can get the calling data +// and run a test +contract V5RouterForkTest is V5RouterForkTestBase { + function returnSlice(bytes calldata d) public returns (bytes memory) { + return d[4:]; + } + + function test_swapUSDC() public { + address addr = 0xEAC5F0d4A9a45E1f9FdD0e7e2882e9f60E301156; + // Generated with the api + bytes + memory dataParams = hex"12aa3caf000000000000000000000000f0694acc9e941b176e17b9ef923e71e7b8b2477a0000000000000000000000007f5c764cbc14f9669b88837ca1490cca17c316070000000000000000000000006fd9d7ad17242c41f7131d257212c54a0e816691000000000000000000000000f0694acc9e941b176e17b9ef923e71e7b8b2477a000000000000000000000000eac5f0d4a9a45e1f9fdd0e7e2882e9f60e30115600000000000000000000000000000000000000000000000000000000000186a0000000000000000000000000000000000000000000000000003e530a0ee30f45000000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000001400000000000000000000000000000000000000000000000000000000000000160000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001f50000000000000000000000000000000000000000000000000000000001d700a007e5c0d20000000000000000000000000000000000000000000000000001b30001505126a132dab612db5cb9fc9ac426a0cc215a3423f9c97f5c764cbc14f9669b88837ca1490cca17c316070004f41766d8000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002e2669c6242f00000000000000000000000000000000000000000000000000000000000000a0000000000000000000000000f0694acc9e941b176e17b9ef923e71e7b8b2477a00000000000000000000000000000000000000000000000000000000644fdfe900000000000000000000000000000000000000000000000000000000000000010000000000000000000000007f5c764cbc14f9669b88837ca1490cca17c316070000000000000000000000004200000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000102a0000000000000000000000000000000000000000000000000003e530a0ee30f45ee63c1e581ad4c666fc170b468b19988959eb931a3676f0e9f42000000000000000000000000000000000000061111111254eeb25477b68fb85ed929f73a9605820000000000000000000000cfee7c08"; + ( + address executor, + IAggregationRouter.SwapDescription memory desc, + bytes memory permit, + bytes memory data + ) = abi.decode( + this.returnSlice(dataParams), + (address, IAggregationRouter.SwapDescription, bytes, bytes) + ); + console.logBytes(data); + console.logBytes(permit); + console.logAddress(address(desc.srcToken)); + console.logAddress(address(desc.dstToken)); + console.logAddress(desc.srcReceiver); + console.logAddress(desc.dstReceiver); + console.logUint(desc.amount); + console.logUint(desc.minReturnAmount); + console.logUint(desc.flags); + vm.startPrank(0xEAC5F0d4A9a45E1f9FdD0e7e2882e9f60E301156); + address routerAddr = factory.computeAddress(USDC); + IERC20(USDC).approve(routerAddr, 100_000); + uint256 startingBalance = IERC20(UNI).balanceOf(addr); + // Check balance on UNI + console.logAddress(addr); + console.logUint(startingBalance); + console.logBool(startingBalance == 0); + assertTrue(startingBalance == 0); + console.logAddress(address(factory)); + (bool ok, ) = payable(routerAddr).call( + abi.encode(UNI, 100_000, desc.minReturnAmount, data, false) + ); + assertTrue(ok); + console.logAddress(addr); + uint256 endingBalance = IERC20(UNI).balanceOf(addr); + console.log(endingBalance); + assertTrue(endingBalance == 17899388150783076); } } From ff3a2bb1d9a62ec30c41fd50a6e30f78878b5f64 Mon Sep 17 00:00:00 2001 From: Keating Date: Fri, 28 Apr 2023 10:36:54 -0400 Subject: [PATCH 06/48] A little cleaner V5 router --- src/AggregationBaseRouter.sol | 14 +++++ src/V5Router.sol | 97 ++++++++++++------------------ test/1InchContracts.sol | 2 +- test/RouterFactory.t.sol | 18 +++--- test/V5Router.t.sol | 110 ++++++++++++++++------------------ 5 files changed, 114 insertions(+), 127 deletions(-) create mode 100644 src/AggregationBaseRouter.sol diff --git a/src/AggregationBaseRouter.sol b/src/AggregationBaseRouter.sol new file mode 100644 index 0000000..d72efbc --- /dev/null +++ b/src/AggregationBaseRouter.sol @@ -0,0 +1,14 @@ +import {IAggregationExecutor} from "src/interfaces/IAggregationExecutionRouter.sol"; + +abstract contract AggregationBaseRouter { + IAggregationExecutor public immutable AGGREGATION_EXECUTOR; + + address public immutable TOKEN; + address public immutable SOURCE_RECEIVER; + + constructor(IAggregationExecutor aggreationExecutor, address token, address sourceReceiver) { + AGGREGATION_EXECUTOR = aggreationExecutor; + TOKEN = token; + SOURCE_RECEIVER = sourceReceiver; + } +} diff --git a/src/V5Router.sol b/src/V5Router.sol index 94baf1b..180e866 100644 --- a/src/V5Router.sol +++ b/src/V5Router.sol @@ -12,66 +12,47 @@ pragma solidity >=0.8.0; import {IAggregationExecutor} from "src/interfaces/IAggregationExecutionRouter.sol"; import {IAggregationRouter} from "src/interfaces/IAggregationRouter.sol"; import {IERC20} from "openzeppelin-contracts/contracts/token/ERC20/IERC20.sol"; - -abstract contract AggregationBaseRouter { - IAggregationExecutor public immutable AGGREGATION_EXECUTOR; - - address public immutable TOKEN; - address public immutable SOURCE_RECEIVER; - - constructor( - IAggregationExecutor aggreationExecutor, - address token, - address sourceReceiver - ) { - AGGREGATION_EXECUTOR = aggreationExecutor; - TOKEN = token; - SOURCE_RECEIVER = sourceReceiver; - } -} +import {AggregationBaseRouter} from "src/AggregationBaseRouter.sol"; contract V5Router is AggregationBaseRouter { - IAggregationRouter public immutable AGGREGATION_ROUTER; + IAggregationRouter public immutable AGGREGATION_ROUTER; + + constructor( + IAggregationRouter aggregationRouter, + IAggregationExecutor aggregationExecutor, + address token, + address sourceReceiver + ) AggregationBaseRouter(aggregationExecutor, token, sourceReceiver) { + AGGREGATION_ROUTER = aggregationRouter; + } - constructor( - IAggregationRouter aggregationRouter, - IAggregationExecutor aggregationExecutor, - address token, - address sourceReceiver - ) AggregationBaseRouter(aggregationExecutor, token, sourceReceiver) { - AGGREGATION_ROUTER = aggregationRouter; - } + receive() external payable {} - // - // TODO: minReturnAmount is the minimum allowed output amount - // - // Can we have exact out? And maybe a percentage slipppage. - // - // the flags match specific constant masks. there is no documentation on these though - fallback() external payable { - // This is the fallback function - ( - address dstToken, - uint256 amount, - uint256 minReturnAmount, - bytes memory data, - bool flags - ) = abi.decode(msg.data, (address, uint256, uint256, bytes, bool)); - IERC20(TOKEN).transferFrom(msg.sender, address(this), amount); - IERC20(TOKEN).approve(address(AGGREGATION_ROUTER), amount); - AGGREGATION_ROUTER.swap( - AGGREGATION_EXECUTOR, - IAggregationRouter.SwapDescription({ - srcToken: IERC20(TOKEN), - dstToken: IERC20(dstToken), - srcReceiver: payable(SOURCE_RECEIVER), - dstReceiver: payable(msg.sender), - amount: amount, - minReturnAmount: minReturnAmount, - flags: flags ? 1 : 0 - }), - "", - data - ); - } + // + // TODO: minReturnAmount is the minimum allowed output amount + // + // Can we have exact out? And maybe a percentage slipppage. + // + // the flags match specific constant masks. there is no documentation on these though + fallback() external payable { + // This is the fallback function + (address dstToken, uint256 amount, uint256 minReturnAmount, bytes memory data, bool flags) = + abi.decode(msg.data, (address, uint256, uint256, bytes, bool)); + IERC20(TOKEN).transferFrom(msg.sender, address(this), amount); + IERC20(TOKEN).approve(address(AGGREGATION_ROUTER), amount); + AGGREGATION_ROUTER.swap( + AGGREGATION_EXECUTOR, + IAggregationRouter.SwapDescription({ + srcToken: IERC20(TOKEN), + dstToken: IERC20(dstToken), + srcReceiver: payable(SOURCE_RECEIVER), + dstReceiver: payable(msg.sender), + amount: amount, + minReturnAmount: minReturnAmount, + flags: flags ? 1 : 0 + }), + "", + data + ); + } } diff --git a/test/1InchContracts.sol b/test/1InchContracts.sol index daeccf6..dd166fd 100644 --- a/test/1InchContracts.sol +++ b/test/1InchContracts.sol @@ -7,7 +7,7 @@ import {IAggregationRouter} from "src/interfaces/IAggregationRouter.sol"; contract OneInchContracts { IAggregationRouter aggregationRouter = IAggregationRouter(0x1111111254EEB25477B68fb85Ed929f73A960582); - IAggregationExecutor aggreationExecutor = + IAggregationExecutor aggregationExecutor = IAggregationExecutor(0xf0694ACc9E941B176E17B9Ef923e71E7B8b2477A); address public immutable USDC = 0x7F5c764cBc14f9669B88837ca1490cCa17c31607; address public immutable UNI = 0x6fd9d7AD17242c41f7131d257212c54A0e816691; diff --git a/test/RouterFactory.t.sol b/test/RouterFactory.t.sol index ccc7018..eaf8297 100644 --- a/test/RouterFactory.t.sol +++ b/test/RouterFactory.t.sol @@ -6,18 +6,14 @@ import {OneInchRouterFactory} from "src/RouterFactory.sol"; import {OneInchContracts} from "test/1InchContracts.sol"; contract RouterFactoryTest is Test, OneInchContracts { - OneInchRouterFactory factory; + OneInchRouterFactory factory; - function test_deployV5Router() public { - OneInchRouterFactory factory = new OneInchRouterFactory( - aggreationExecutor, + function test_deployV5Router() public { + factory = new OneInchRouterFactory( + aggregationExecutor, aggregationRouter ); - address V5Router = factory.deploy(USDC); - assertEq( - V5Router, - factory.computeAddress(USDC), - "V5Router address should be correct" - ); - } + address V5Router = factory.deploy(USDC); + assertEq(V5Router, factory.computeAddress(USDC), "V5Router address should be correct"); + } } diff --git a/test/V5Router.t.sol b/test/V5Router.t.sol index c499853..88e125c 100644 --- a/test/V5Router.t.sol +++ b/test/V5Router.t.sol @@ -8,68 +8,64 @@ import {IAggregationRouter} from "src/interfaces/IAggregationRouter.sol"; import {IERC20} from "openzeppelin-contracts/contracts/token/ERC20/IERC20.sol"; contract V5RouterForkTestBase is Test, OneInchContracts { - OneInchRouterFactory factory; + OneInchRouterFactory factory; + address addr; - function setUp() public { - vm.createSelectFork(vm.rpcUrl("optimism"), 94_524_034); - factory = new OneInchRouterFactory( - aggreationExecutor, + function setUp() public { + vm.createSelectFork(vm.rpcUrl("optimism"), 94_524_034); + factory = new OneInchRouterFactory( + aggregationExecutor, aggregationRouter ); - factory.deploy(USDC); - deal(USDC, address(this), 100_000_000); - // approve to send usdc - } + factory.deploy(USDC); + deal(USDC, address(this), 100_000_000); + addr = 0xEAC5F0d4A9a45E1f9FdD0e7e2882e9f60E301156; + } } -// Is there a cheatcode to change the calling -// address. If so then I can get the calling data -// and run a test contract V5RouterForkTest is V5RouterForkTestBase { - function returnSlice(bytes calldata d) public returns (bytes memory) { - return d[4:]; - } + function returnSlice(bytes calldata d) public pure returns (bytes memory) { + return d[4:]; + } - function test_swapUSDC() public { - address addr = 0xEAC5F0d4A9a45E1f9FdD0e7e2882e9f60E301156; - // Generated with the api - bytes - memory dataParams = hex"12aa3caf000000000000000000000000f0694acc9e941b176e17b9ef923e71e7b8b2477a0000000000000000000000007f5c764cbc14f9669b88837ca1490cca17c316070000000000000000000000006fd9d7ad17242c41f7131d257212c54a0e816691000000000000000000000000f0694acc9e941b176e17b9ef923e71e7b8b2477a000000000000000000000000eac5f0d4a9a45e1f9fdd0e7e2882e9f60e30115600000000000000000000000000000000000000000000000000000000000186a0000000000000000000000000000000000000000000000000003e530a0ee30f45000000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000001400000000000000000000000000000000000000000000000000000000000000160000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001f50000000000000000000000000000000000000000000000000000000001d700a007e5c0d20000000000000000000000000000000000000000000000000001b30001505126a132dab612db5cb9fc9ac426a0cc215a3423f9c97f5c764cbc14f9669b88837ca1490cca17c316070004f41766d8000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002e2669c6242f00000000000000000000000000000000000000000000000000000000000000a0000000000000000000000000f0694acc9e941b176e17b9ef923e71e7b8b2477a00000000000000000000000000000000000000000000000000000000644fdfe900000000000000000000000000000000000000000000000000000000000000010000000000000000000000007f5c764cbc14f9669b88837ca1490cca17c316070000000000000000000000004200000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000102a0000000000000000000000000000000000000000000000000003e530a0ee30f45ee63c1e581ad4c666fc170b468b19988959eb931a3676f0e9f42000000000000000000000000000000000000061111111254eeb25477b68fb85ed929f73a9605820000000000000000000000cfee7c08"; - ( - address executor, - IAggregationRouter.SwapDescription memory desc, - bytes memory permit, - bytes memory data - ) = abi.decode( - this.returnSlice(dataParams), - (address, IAggregationRouter.SwapDescription, bytes, bytes) - ); - console.logBytes(data); - console.logBytes(permit); - console.logAddress(address(desc.srcToken)); - console.logAddress(address(desc.dstToken)); - console.logAddress(desc.srcReceiver); - console.logAddress(desc.dstReceiver); - console.logUint(desc.amount); - console.logUint(desc.minReturnAmount); - console.logUint(desc.flags); - vm.startPrank(0xEAC5F0d4A9a45E1f9FdD0e7e2882e9f60E301156); - address routerAddr = factory.computeAddress(USDC); - IERC20(USDC).approve(routerAddr, 100_000); - uint256 startingBalance = IERC20(UNI).balanceOf(addr); - // Check balance on UNI - console.logAddress(addr); - console.logUint(startingBalance); - console.logBool(startingBalance == 0); - assertTrue(startingBalance == 0); - console.logAddress(address(factory)); - (bool ok, ) = payable(routerAddr).call( - abi.encode(UNI, 100_000, desc.minReturnAmount, data, false) - ); - assertTrue(ok); - console.logAddress(addr); - uint256 endingBalance = IERC20(UNI).balanceOf(addr); - console.log(endingBalance); - assertTrue(endingBalance == 17899388150783076); - } + function nativeSwap( + IAggregationRouter.SwapDescription memory desc, + bytes memory permit, + bytes memory data, + uint256 snapshotId + ) public returns (uint256) { + vm.revertTo(snapshotId); + aggregationRouter.swap(aggregationExecutor, desc, permit, data); + return IERC20(UNI).balanceOf(addr); + } + + function test_swapUSDC() public { + uint256 snapshotId = vm.snapshot(); + // Calldata generated from calling 1inch's api + bytes memory dataParams = + hex"12aa3caf000000000000000000000000f0694acc9e941b176e17b9ef923e71e7b8b2477a0000000000000000000000007f5c764cbc14f9669b88837ca1490cca17c316070000000000000000000000006fd9d7ad17242c41f7131d257212c54a0e816691000000000000000000000000f0694acc9e941b176e17b9ef923e71e7b8b2477a000000000000000000000000eac5f0d4a9a45e1f9fdd0e7e2882e9f60e30115600000000000000000000000000000000000000000000000000000000000186a0000000000000000000000000000000000000000000000000003e530a0ee30f45000000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000001400000000000000000000000000000000000000000000000000000000000000160000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001f50000000000000000000000000000000000000000000000000000000001d700a007e5c0d20000000000000000000000000000000000000000000000000001b30001505126a132dab612db5cb9fc9ac426a0cc215a3423f9c97f5c764cbc14f9669b88837ca1490cca17c316070004f41766d8000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002e2669c6242f00000000000000000000000000000000000000000000000000000000000000a0000000000000000000000000f0694acc9e941b176e17b9ef923e71e7b8b2477a00000000000000000000000000000000000000000000000000000000644fdfe900000000000000000000000000000000000000000000000000000000000000010000000000000000000000007f5c764cbc14f9669b88837ca1490cca17c316070000000000000000000000004200000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000102a0000000000000000000000000000000000000000000000000003e530a0ee30f45ee63c1e581ad4c666fc170b468b19988959eb931a3676f0e9f42000000000000000000000000000000000000061111111254eeb25477b68fb85ed929f73a9605820000000000000000000000cfee7c08"; + // Decode api calldata to get the data parameter needed for both calls + (, IAggregationRouter.SwapDescription memory desc, bytes memory permit, bytes memory data) = abi + .decode( + this.returnSlice(dataParams), (address, IAggregationRouter.SwapDescription, bytes, bytes) + ); + + // Setup optimized router call + vm.startPrank(0xEAC5F0d4A9a45E1f9FdD0e7e2882e9f60E301156); + address routerAddr = factory.computeAddress(USDC); + IERC20(USDC).approve(routerAddr, 100_000); + uint256 startingBalance = IERC20(UNI).balanceOf(addr); + assertTrue(startingBalance == 0); + + // Opitmized router call + (bool ok,) = + payable(routerAddr).call(abi.encode(UNI, 100_000, desc.minReturnAmount, data, false)); + + assertTrue(ok); + + // Compare balance to native aggregation router call + uint256 endingBalance = IERC20(UNI).balanceOf(addr); + uint256 nativeEndingBalance = nativeSwap(desc, permit, data, snapshotId); + assertTrue(endingBalance == nativeEndingBalance); + } } From e64fe760c71f07c08dbee660b8876150536b3aa9 Mon Sep 17 00:00:00 2001 From: Keating Date: Fri, 28 Apr 2023 14:46:08 -0400 Subject: [PATCH 07/48] Add V4 refactor --- src/AggregationBaseRouter.sol | 50 ++++++-- src/RouterFactory.sol | 69 ++++++----- src/V4Router.sol | 54 +++++++++ src/V5Router.sol | 96 ++++++++-------- .../IAggregationExecutionRouter.sol | 7 -- src/interfaces/IAggregationRouter.sol | 24 ---- src/interfaces/IV4AggregationExecutor.sol | 9 ++ src/interfaces/IV4AggregationRouter.sol | 30 +++++ src/interfaces/IV5AggregationExecutor.sol | 7 ++ src/interfaces/IV5AggregationRouter.sol | 24 ++++ test/1InchContracts.sol | 16 +-- test/V5Router.t.sol | 107 ++++++++++-------- 12 files changed, 316 insertions(+), 177 deletions(-) create mode 100644 src/V4Router.sol delete mode 100644 src/interfaces/IAggregationExecutionRouter.sol delete mode 100644 src/interfaces/IAggregationRouter.sol create mode 100644 src/interfaces/IV4AggregationExecutor.sol create mode 100644 src/interfaces/IV4AggregationRouter.sol create mode 100644 src/interfaces/IV5AggregationExecutor.sol create mode 100644 src/interfaces/IV5AggregationRouter.sol diff --git a/src/AggregationBaseRouter.sol b/src/AggregationBaseRouter.sol index d72efbc..029915d 100644 --- a/src/AggregationBaseRouter.sol +++ b/src/AggregationBaseRouter.sol @@ -1,14 +1,44 @@ -import {IAggregationExecutor} from "src/interfaces/IAggregationExecutionRouter.sol"; +import {IV5AggregationExecutor} from "src/interfaces/IV5AggregationExecutor.sol"; +import {IV5AggregationRouter} from "src/interfaces/IV5AggregationRouter.sol"; +import {IV4AggregationExecutor} from "src/interfaces/IV4AggregationExecutor.sol"; +import {IV4AggregationRouter} from "src/interfaces/IV4AggregationRouter.sol"; -abstract contract AggregationBaseRouter { - IAggregationExecutor public immutable AGGREGATION_EXECUTOR; +abstract contract AggregationV5BaseRouter { + IV5AggregationExecutor public immutable AGGREGATION_EXECUTOR; + IV5AggregationRouter public immutable AGGREGATION_ROUTER; - address public immutable TOKEN; - address public immutable SOURCE_RECEIVER; + address public immutable TOKEN; + address public immutable SOURCE_RECEIVER; - constructor(IAggregationExecutor aggreationExecutor, address token, address sourceReceiver) { - AGGREGATION_EXECUTOR = aggreationExecutor; - TOKEN = token; - SOURCE_RECEIVER = sourceReceiver; - } + constructor( + IV5AggregationExecutor aggregationExecutor, + IV5AggregationRouter aggregationRouter, + address token, + address sourceReceiver + ) { + AGGREGATION_EXECUTOR = aggregationExecutor; + AGGREGATION_ROUTER = aggregationRouter; + TOKEN = token; + SOURCE_RECEIVER = sourceReceiver; + } +} + +abstract contract AggregationV4BaseRouter { + IV4AggregationExecutor public immutable AGGREGATION_EXECUTOR; + IV4AggregationRouter public immutable AGGREGATION_ROUTER; + + address public immutable TOKEN; + address public immutable SOURCE_RECEIVER; + + constructor( + IV4AggregationExecutor aggregationExecutor, + IV4AggregationRouter aggregationRouter, + address token, + address sourceReceiver + ) { + AGGREGATION_EXECUTOR = aggregationExecutor; + AGGREGATION_ROUTER = aggregationRouter; + TOKEN = token; + SOURCE_RECEIVER = sourceReceiver; + } } diff --git a/src/RouterFactory.sol b/src/RouterFactory.sol index b7e07d0..eb534d3 100644 --- a/src/RouterFactory.sol +++ b/src/RouterFactory.sol @@ -1,48 +1,57 @@ // SPDX-License-Identifier: MIT pragma solidity >=0.8.0; -import {IAggregationExecutor} from "src/interfaces/IAggregationExecutionRouter.sol"; -import {IAggregationRouter} from "src/interfaces/IAggregationRouter.sol"; +import {IV5AggregationExecutor} from "src/interfaces/IV5AggregationExecutor.sol"; +import {IV5AggregationRouter} from "src/interfaces/IV5AggregationRouter.sol"; import {Create2} from "src/lib/Create2.sol"; import {V5Router} from "src/V5Router.sol"; contract OneInchRouterFactory { - IAggregationExecutor public immutable AGGREGATION_EXECUTOR; - IAggregationRouter public immutable V5_AGGREGATION_ROUTER; - address public immutable SOURCE_RECEIVER; + IV5AggregationExecutor public immutable AGGREGATION_EXECUTOR; + IV5AggregationRouter public immutable V5_AGGREGATION_ROUTER; + address public immutable SOURCE_RECEIVER; - event RouterDeployed(address indexed asset); + event RouterDeployed(address indexed asset); - constructor(IAggregationExecutor aggregationExecutor, IAggregationRouter v5AggregationRouter) { - AGGREGATION_EXECUTOR = aggregationExecutor; - V5_AGGREGATION_ROUTER = v5AggregationRouter; - SOURCE_RECEIVER = address(aggregationExecutor); - } + constructor( + IV5AggregationExecutor aggregationExecutor, + IV5AggregationRouter v5AggregationRouter + ) { + AGGREGATION_EXECUTOR = aggregationExecutor; + V5_AGGREGATION_ROUTER = v5AggregationRouter; + SOURCE_RECEIVER = address(aggregationExecutor); + } - function deploy(address asset) external returns (address) { - bytes32 salt = _salt(asset); - address router = address( - new V5Router{salt: salt}( + function deploy(address asset) external returns (address) { + bytes32 salt = _salt(asset); + address router = address( + new V5Router{salt: salt}( V5_AGGREGATION_ROUTER, AGGREGATION_EXECUTOR, asset, SOURCE_RECEIVER ) - ); - emit RouterDeployed(router); - return router; - } + ); + emit RouterDeployed(router); + return router; + } - function computeAddress(address asset) external view returns (address) { - return Create2.computeCreate2Address( - _salt(asset), - address(this), - type(V5Router).creationCode, - abi.encode(V5_AGGREGATION_ROUTER, AGGREGATION_EXECUTOR, asset, SOURCE_RECEIVER) - ); - } + function computeAddress(address asset) external view returns (address) { + return + Create2.computeCreate2Address( + _salt(asset), + address(this), + type(V5Router).creationCode, + abi.encode( + V5_AGGREGATION_ROUTER, + AGGREGATION_EXECUTOR, + asset, + SOURCE_RECEIVER + ) + ); + } - function _salt(address asset) internal pure returns (bytes32) { - return bytes32(uint256(uint160(asset))); - } + function _salt(address asset) internal pure returns (bytes32) { + return bytes32(uint256(uint160(asset))); + } } diff --git a/src/V4Router.sol b/src/V4Router.sol new file mode 100644 index 0000000..a1fd15c --- /dev/null +++ b/src/V4Router.sol @@ -0,0 +1,54 @@ +// SPDX-License-Identifier: MIT +pragma solidity >=0.8.0; + +import {IERC20} from "openzeppelin-contracts/contracts/token/ERC20/IERC20.sol"; +import {IV4AggregationExecutor} from "src/interfaces/IV4AggregationExecutor.sol"; +import {IV4AggregationRouter} from "src/interfaces/IV4AggregationRouter.sol"; +import {AggregationV4BaseRouter} from "src/AggregationBaseRouter.sol"; + +contract V4Router is AggregationV4BaseRouter { + constructor( + IV4AggregationRouter aggregationRouter, + IV4AggregationExecutor aggregationExecutor, + address token, + address sourceReceiver + ) + AggregationV4BaseRouter( + aggregationExecutor, + aggregationRouter, + token, + sourceReceiver + ) + {} + + receive() external payable {} + + // TODO: minReturnAmount is the minimum allowed output amount, and can probably reduced to a max int of 500. + // + // the flags match specific constant masks. there is no documentation on these, and there seems to be no specific logic on them + fallback() external payable { + ( + address dstToken, + uint256 amount, + uint256 minReturnAmount, + bytes memory data, + bool flags + ) = abi.decode(msg.data, (address, uint256, uint256, bytes, bool)); + IERC20(TOKEN).transferFrom(msg.sender, address(this), amount); + IERC20(TOKEN).approve(address(AGGREGATION_ROUTER), amount); + AGGREGATION_ROUTER.swap( + AGGREGATION_EXECUTOR, + IV4AggregationRouter.SwapDescription({ + srcToken: IERC20(TOKEN), + dstToken: IERC20(dstToken), + srcReceiver: payable(SOURCE_RECEIVER), + dstReceiver: payable(msg.sender), + amount: amount, + minReturnAmount: minReturnAmount, + flags: flags ? 1 : 0, + permit: "" + }), + data + ); + } +} diff --git a/src/V5Router.sol b/src/V5Router.sol index 180e866..3321fbd 100644 --- a/src/V5Router.sol +++ b/src/V5Router.sol @@ -1,58 +1,54 @@ -// executor can be removed -// srcToken: each contract is a src token -// dstToken: Can be represented by an integer?? -// amount: strat -// minReturnAmount: strat -// flags? -// permit? -// data - don't think we can do anything, comes from their api. // SPDX-License-Identifier: MIT pragma solidity >=0.8.0; -import {IAggregationExecutor} from "src/interfaces/IAggregationExecutionRouter.sol"; -import {IAggregationRouter} from "src/interfaces/IAggregationRouter.sol"; +import {IV5AggregationExecutor} from "src/interfaces/IV5AggregationExecutor.sol"; +import {IV5AggregationRouter} from "src/interfaces/IV5AggregationRouter.sol"; import {IERC20} from "openzeppelin-contracts/contracts/token/ERC20/IERC20.sol"; -import {AggregationBaseRouter} from "src/AggregationBaseRouter.sol"; +import {AggregationV5BaseRouter} from "src/AggregationBaseRouter.sol"; -contract V5Router is AggregationBaseRouter { - IAggregationRouter public immutable AGGREGATION_ROUTER; +contract V5Router is AggregationV5BaseRouter { + constructor( + IV5AggregationRouter aggregationRouter, + IV5AggregationExecutor aggregationExecutor, + address token, + address sourceReceiver + ) + AggregationV5BaseRouter( + aggregationExecutor, + aggregationRouter, + token, + sourceReceiver + ) + {} - constructor( - IAggregationRouter aggregationRouter, - IAggregationExecutor aggregationExecutor, - address token, - address sourceReceiver - ) AggregationBaseRouter(aggregationExecutor, token, sourceReceiver) { - AGGREGATION_ROUTER = aggregationRouter; - } + receive() external payable {} - receive() external payable {} - - // - // TODO: minReturnAmount is the minimum allowed output amount - // - // Can we have exact out? And maybe a percentage slipppage. - // - // the flags match specific constant masks. there is no documentation on these though - fallback() external payable { - // This is the fallback function - (address dstToken, uint256 amount, uint256 minReturnAmount, bytes memory data, bool flags) = - abi.decode(msg.data, (address, uint256, uint256, bytes, bool)); - IERC20(TOKEN).transferFrom(msg.sender, address(this), amount); - IERC20(TOKEN).approve(address(AGGREGATION_ROUTER), amount); - AGGREGATION_ROUTER.swap( - AGGREGATION_EXECUTOR, - IAggregationRouter.SwapDescription({ - srcToken: IERC20(TOKEN), - dstToken: IERC20(dstToken), - srcReceiver: payable(SOURCE_RECEIVER), - dstReceiver: payable(msg.sender), - amount: amount, - minReturnAmount: minReturnAmount, - flags: flags ? 1 : 0 - }), - "", - data - ); - } + // TODO: minReturnAmount is the minimum allowed output amount, and can probably reduced to a max int of 500. + // + // the flags match specific constant masks. there is no documentation on these, and there seems to be no specific logic on them + fallback() external payable { + ( + address dstToken, + uint256 amount, + uint256 minReturnAmount, + bytes memory data, + bool flags + ) = abi.decode(msg.data, (address, uint256, uint256, bytes, bool)); + IERC20(TOKEN).transferFrom(msg.sender, address(this), amount); + IERC20(TOKEN).approve(address(AGGREGATION_ROUTER), amount); + AGGREGATION_ROUTER.swap( + AGGREGATION_EXECUTOR, + IV5AggregationRouter.SwapDescription({ + srcToken: IERC20(TOKEN), + dstToken: IERC20(dstToken), + srcReceiver: payable(SOURCE_RECEIVER), + dstReceiver: payable(msg.sender), + amount: amount, + minReturnAmount: minReturnAmount, + flags: flags ? 1 : 0 + }), + "", + data + ); + } } diff --git a/src/interfaces/IAggregationExecutionRouter.sol b/src/interfaces/IAggregationExecutionRouter.sol deleted file mode 100644 index 2baea5c..0000000 --- a/src/interfaces/IAggregationExecutionRouter.sol +++ /dev/null @@ -1,7 +0,0 @@ -pragma solidity >=0.8.0; - -/// @title Interface for making arbitrary calls during swap -interface IAggregationExecutor { - /// @notice propagates information about original msg.sender and executes arbitrary data - function execute(address msgSender) external payable; // 0x4b64e492 -} diff --git a/src/interfaces/IAggregationRouter.sol b/src/interfaces/IAggregationRouter.sol deleted file mode 100644 index 9bc58e5..0000000 --- a/src/interfaces/IAggregationRouter.sol +++ /dev/null @@ -1,24 +0,0 @@ -pragma solidity >=0.8.0; - -import {IAggregationExecutor} from "src/interfaces/IAggregationExecutionRouter.sol"; -import {IERC20} from "openzeppelin-contracts/contracts/token/ERC20/IERC20.sol"; - -interface IAggregationRouter { - struct SwapDescription { - IERC20 srcToken; - IERC20 dstToken; - address payable srcReceiver; - address payable dstReceiver; - uint256 amount; - uint256 minReturnAmount; - uint256 flags; - } - - /// @notice propagates information about original msg.sender and executes arbitrary data - function swap( - IAggregationExecutor executor, - SwapDescription calldata desc, - bytes calldata permit, - bytes calldata data - ) external payable returns (uint256 returnAmount, uint256 spentAmount); // 0x4b64e492 -} diff --git a/src/interfaces/IV4AggregationExecutor.sol b/src/interfaces/IV4AggregationExecutor.sol new file mode 100644 index 0000000..96fe2b2 --- /dev/null +++ b/src/interfaces/IV4AggregationExecutor.sol @@ -0,0 +1,9 @@ +// SPDX-License-Identifier: MIT +// permalink: https://optimistic.etherscan.io/address/0x1111111254760f7ab3f16433eea9304126dcd199#code#L990 +pragma solidity >=0.8.0; + +/// @title Interface for making arbitrary calls during swap +interface IV4AggregationExecutor { + /// @notice Make calls on `msgSender` with specified data + function callBytes(address msgSender, bytes calldata data) external payable; // 0x2636f7f8 +} diff --git a/src/interfaces/IV4AggregationRouter.sol b/src/interfaces/IV4AggregationRouter.sol new file mode 100644 index 0000000..ddb8c2b --- /dev/null +++ b/src/interfaces/IV4AggregationRouter.sol @@ -0,0 +1,30 @@ +pragma solidity >=0.8.0; + +import {IV4AggregationExecutor} from "src/interfaces/IV4AggregationExecutor.sol"; +import {IERC20} from "openzeppelin-contracts/contracts/token/ERC20/IERC20.sol"; + +interface IV4AggregationRouter { + struct SwapDescription { + IERC20 srcToken; + IERC20 dstToken; + address payable srcReceiver; + address payable dstReceiver; + uint256 amount; + uint256 minReturnAmount; + uint256 flags; + bytes permit; + } + + function swap( + IV4AggregationExecutor executor, + SwapDescription calldata desc, + bytes calldata data + ) + external + payable + returns ( + uint256 returnAmount, + uint256 spentAmount, + uint256 gasLeft + ); +} diff --git a/src/interfaces/IV5AggregationExecutor.sol b/src/interfaces/IV5AggregationExecutor.sol new file mode 100644 index 0000000..f13c3e6 --- /dev/null +++ b/src/interfaces/IV5AggregationExecutor.sol @@ -0,0 +1,7 @@ +pragma solidity >=0.8.0; + +/// @title Interface for making arbitrary calls during swap +interface IV5AggregationExecutor { + /// @notice propagates information about original msg.sender and executes arbitrary data + function execute(address msgSender) external payable; // 0x4b64e492 +} diff --git a/src/interfaces/IV5AggregationRouter.sol b/src/interfaces/IV5AggregationRouter.sol new file mode 100644 index 0000000..c9d197c --- /dev/null +++ b/src/interfaces/IV5AggregationRouter.sol @@ -0,0 +1,24 @@ +pragma solidity >=0.8.0; + +import {IV5AggregationExecutor} from "src/interfaces/IV5AggregationExecutor.sol"; +import {IERC20} from "openzeppelin-contracts/contracts/token/ERC20/IERC20.sol"; + +// V5 router interface +interface IV5AggregationRouter { + struct SwapDescription { + IERC20 srcToken; + IERC20 dstToken; + address payable srcReceiver; + address payable dstReceiver; + uint256 amount; + uint256 minReturnAmount; + uint256 flags; + } + + function swap( + IV5AggregationExecutor executor, + SwapDescription calldata desc, + bytes calldata permit, + bytes calldata data + ) external payable returns (uint256 returnAmount, uint256 spentAmount); +} diff --git a/test/1InchContracts.sol b/test/1InchContracts.sol index dd166fd..f3f7b81 100644 --- a/test/1InchContracts.sol +++ b/test/1InchContracts.sol @@ -1,14 +1,14 @@ // SPDX-License-Identifier: MIT pragma solidity >=0.8.0; -import {IAggregationExecutor} from "src/interfaces/IAggregationExecutionRouter.sol"; -import {IAggregationRouter} from "src/interfaces/IAggregationRouter.sol"; +import {IV5AggregationExecutor} from "src/interfaces/IV5AggregationExecutor.sol"; +import {IV5AggregationRouter} from "src/interfaces/IV5AggregationRouter.sol"; contract OneInchContracts { - IAggregationRouter aggregationRouter = - IAggregationRouter(0x1111111254EEB25477B68fb85Ed929f73A960582); - IAggregationExecutor aggregationExecutor = - IAggregationExecutor(0xf0694ACc9E941B176E17B9Ef923e71E7B8b2477A); - address public immutable USDC = 0x7F5c764cBc14f9669B88837ca1490cCa17c31607; - address public immutable UNI = 0x6fd9d7AD17242c41f7131d257212c54A0e816691; + IV5AggregationRouter aggregationRouter = + IV5AggregationRouter(0x1111111254EEB25477B68fb85Ed929f73A960582); + IV5AggregationExecutor aggregationExecutor = + IV5AggregationExecutor(0xf0694ACc9E941B176E17B9Ef923e71E7B8b2477A); + address public immutable USDC = 0x7F5c764cBc14f9669B88837ca1490cCa17c31607; + address public immutable UNI = 0x6fd9d7AD17242c41f7131d257212c54A0e816691; } diff --git a/test/V5Router.t.sol b/test/V5Router.t.sol index 88e125c..2b7dcd8 100644 --- a/test/V5Router.t.sol +++ b/test/V5Router.t.sol @@ -4,68 +4,79 @@ pragma solidity >=0.8.0; import "forge-std/Test.sol"; import {OneInchRouterFactory} from "src/RouterFactory.sol"; import {OneInchContracts} from "test/1InchContracts.sol"; -import {IAggregationRouter} from "src/interfaces/IAggregationRouter.sol"; +import {IV5AggregationRouter} from "src/interfaces/IV5AggregationRouter.sol"; import {IERC20} from "openzeppelin-contracts/contracts/token/ERC20/IERC20.sol"; contract V5RouterForkTestBase is Test, OneInchContracts { - OneInchRouterFactory factory; - address addr; + OneInchRouterFactory factory; + address addr; - function setUp() public { - vm.createSelectFork(vm.rpcUrl("optimism"), 94_524_034); - factory = new OneInchRouterFactory( + function setUp() public { + vm.createSelectFork(vm.rpcUrl("optimism"), 94_524_034); + factory = new OneInchRouterFactory( aggregationExecutor, aggregationRouter ); - factory.deploy(USDC); - deal(USDC, address(this), 100_000_000); - addr = 0xEAC5F0d4A9a45E1f9FdD0e7e2882e9f60E301156; - } + factory.deploy(USDC); + deal(USDC, address(this), 100_000_000); + addr = 0xEAC5F0d4A9a45E1f9FdD0e7e2882e9f60E301156; + } } contract V5RouterForkTest is V5RouterForkTestBase { - function returnSlice(bytes calldata d) public pure returns (bytes memory) { - return d[4:]; - } + function returnSlice(bytes calldata d) public pure returns (bytes memory) { + return d[4:]; + } - function nativeSwap( - IAggregationRouter.SwapDescription memory desc, - bytes memory permit, - bytes memory data, - uint256 snapshotId - ) public returns (uint256) { - vm.revertTo(snapshotId); - aggregationRouter.swap(aggregationExecutor, desc, permit, data); - return IERC20(UNI).balanceOf(addr); - } + function nativeSwap( + IV5AggregationRouter.SwapDescription memory desc, + bytes memory permit, + bytes memory data, + uint256 snapshotId + ) public returns (uint256) { + vm.revertTo(snapshotId); + aggregationRouter.swap(aggregationExecutor, desc, permit, data); + return IERC20(UNI).balanceOf(addr); + } - function test_swapUSDC() public { - uint256 snapshotId = vm.snapshot(); - // Calldata generated from calling 1inch's api - bytes memory dataParams = - hex"12aa3caf000000000000000000000000f0694acc9e941b176e17b9ef923e71e7b8b2477a0000000000000000000000007f5c764cbc14f9669b88837ca1490cca17c316070000000000000000000000006fd9d7ad17242c41f7131d257212c54a0e816691000000000000000000000000f0694acc9e941b176e17b9ef923e71e7b8b2477a000000000000000000000000eac5f0d4a9a45e1f9fdd0e7e2882e9f60e30115600000000000000000000000000000000000000000000000000000000000186a0000000000000000000000000000000000000000000000000003e530a0ee30f45000000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000001400000000000000000000000000000000000000000000000000000000000000160000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001f50000000000000000000000000000000000000000000000000000000001d700a007e5c0d20000000000000000000000000000000000000000000000000001b30001505126a132dab612db5cb9fc9ac426a0cc215a3423f9c97f5c764cbc14f9669b88837ca1490cca17c316070004f41766d8000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002e2669c6242f00000000000000000000000000000000000000000000000000000000000000a0000000000000000000000000f0694acc9e941b176e17b9ef923e71e7b8b2477a00000000000000000000000000000000000000000000000000000000644fdfe900000000000000000000000000000000000000000000000000000000000000010000000000000000000000007f5c764cbc14f9669b88837ca1490cca17c316070000000000000000000000004200000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000102a0000000000000000000000000000000000000000000000000003e530a0ee30f45ee63c1e581ad4c666fc170b468b19988959eb931a3676f0e9f42000000000000000000000000000000000000061111111254eeb25477b68fb85ed929f73a9605820000000000000000000000cfee7c08"; - // Decode api calldata to get the data parameter needed for both calls - (, IAggregationRouter.SwapDescription memory desc, bytes memory permit, bytes memory data) = abi - .decode( - this.returnSlice(dataParams), (address, IAggregationRouter.SwapDescription, bytes, bytes) - ); + function test_swapUSDC() public { + uint256 snapshotId = vm.snapshot(); + // Calldata generated from calling 1inch's api + bytes + memory dataParams = hex"12aa3caf000000000000000000000000f0694acc9e941b176e17b9ef923e71e7b8b2477a0000000000000000000000007f5c764cbc14f9669b88837ca1490cca17c316070000000000000000000000006fd9d7ad17242c41f7131d257212c54a0e816691000000000000000000000000f0694acc9e941b176e17b9ef923e71e7b8b2477a000000000000000000000000eac5f0d4a9a45e1f9fdd0e7e2882e9f60e30115600000000000000000000000000000000000000000000000000000000000186a0000000000000000000000000000000000000000000000000003e530a0ee30f45000000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000001400000000000000000000000000000000000000000000000000000000000000160000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001f50000000000000000000000000000000000000000000000000000000001d700a007e5c0d20000000000000000000000000000000000000000000000000001b30001505126a132dab612db5cb9fc9ac426a0cc215a3423f9c97f5c764cbc14f9669b88837ca1490cca17c316070004f41766d8000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002e2669c6242f00000000000000000000000000000000000000000000000000000000000000a0000000000000000000000000f0694acc9e941b176e17b9ef923e71e7b8b2477a00000000000000000000000000000000000000000000000000000000644fdfe900000000000000000000000000000000000000000000000000000000000000010000000000000000000000007f5c764cbc14f9669b88837ca1490cca17c316070000000000000000000000004200000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000102a0000000000000000000000000000000000000000000000000003e530a0ee30f45ee63c1e581ad4c666fc170b468b19988959eb931a3676f0e9f42000000000000000000000000000000000000061111111254eeb25477b68fb85ed929f73a9605820000000000000000000000cfee7c08"; + // Decode api calldata to get the data parameter needed for both calls + ( + , + IV5AggregationRouter.SwapDescription memory desc, + bytes memory permit, + bytes memory data + ) = abi.decode( + this.returnSlice(dataParams), + (address, IV5AggregationRouter.SwapDescription, bytes, bytes) + ); - // Setup optimized router call - vm.startPrank(0xEAC5F0d4A9a45E1f9FdD0e7e2882e9f60E301156); - address routerAddr = factory.computeAddress(USDC); - IERC20(USDC).approve(routerAddr, 100_000); - uint256 startingBalance = IERC20(UNI).balanceOf(addr); - assertTrue(startingBalance == 0); + // Setup optimized router call + vm.startPrank(0xEAC5F0d4A9a45E1f9FdD0e7e2882e9f60E301156); + address routerAddr = factory.computeAddress(USDC); + IERC20(USDC).approve(routerAddr, 100_000); + uint256 startingBalance = IERC20(UNI).balanceOf(addr); + assertTrue(startingBalance == 0); - // Opitmized router call - (bool ok,) = - payable(routerAddr).call(abi.encode(UNI, 100_000, desc.minReturnAmount, data, false)); + // Opitmized router call + (bool ok, ) = payable(routerAddr).call( + abi.encode(UNI, 100_000, desc.minReturnAmount, data, false) + ); - assertTrue(ok); + assertTrue(ok); - // Compare balance to native aggregation router call - uint256 endingBalance = IERC20(UNI).balanceOf(addr); - uint256 nativeEndingBalance = nativeSwap(desc, permit, data, snapshotId); - assertTrue(endingBalance == nativeEndingBalance); - } + // Compare balance to native aggregation router call + uint256 endingBalance = IERC20(UNI).balanceOf(addr); + uint256 nativeEndingBalance = nativeSwap( + desc, + permit, + data, + snapshotId + ); + assertTrue(endingBalance == nativeEndingBalance); + } } From 950f1ffac6f1ea22f12a61eee60d18d8e4ab32f4 Mon Sep 17 00:00:00 2001 From: Keating Date: Sun, 30 Apr 2023 13:04:14 -0400 Subject: [PATCH 08/48] V4 with tests --- script/Deploy.s.sol | 14 +++-- src/RouterFactory.sol | 111 ++++++++++++++++++++++++++++++++------- test/1InchContracts.sol | 11 +++- test/RouterFactory.t.sol | 28 +++++++--- test/V4Router.t.sol | 83 +++++++++++++++++++++++++++++ test/V5Router.t.sol | 18 +++++-- 6 files changed, 225 insertions(+), 40 deletions(-) create mode 100644 test/V4Router.t.sol diff --git a/script/Deploy.s.sol b/script/Deploy.s.sol index acd7886..7602b94 100644 --- a/script/Deploy.s.sol +++ b/script/Deploy.s.sol @@ -7,9 +7,13 @@ import {IERC20} from "openzeppelin-contracts/contracts/token/ERC20/IERC20.sol"; // approve for amount to router contract Deploy is Script { - function run() public { - address USDC = 0x7F5c764cBc14f9669B88837ca1490cCa17c31607; - vm.broadcast(); - IERC20(USDC).approve(0x1111111254EEB25477B68fb85Ed929f73A960582, 100_000); - } + function run() public { + address USDC = 0x7F5c764cBc14f9669B88837ca1490cCa17c31607; + vm.broadcast(); + // IERC20(USDC).approve(0x1111111254EEB25477B68fb85Ed929f73A960582, 100_000); + IERC20(USDC).approve( + 0x1111111254760F7ab3F16433eea9304126DCd199, + 100_000 + ); + } } diff --git a/src/RouterFactory.sol b/src/RouterFactory.sol index eb534d3..bfae9ce 100644 --- a/src/RouterFactory.sol +++ b/src/RouterFactory.sol @@ -3,40 +3,111 @@ pragma solidity >=0.8.0; import {IV5AggregationExecutor} from "src/interfaces/IV5AggregationExecutor.sol"; import {IV5AggregationRouter} from "src/interfaces/IV5AggregationRouter.sol"; +import {IV4AggregationExecutor} from "src/interfaces/IV4AggregationExecutor.sol"; +import {IV4AggregationRouter} from "src/interfaces/IV4AggregationRouter.sol"; import {Create2} from "src/lib/Create2.sol"; import {V5Router} from "src/V5Router.sol"; +import {V4Router} from "src/V4Router.sol"; contract OneInchRouterFactory { - IV5AggregationExecutor public immutable AGGREGATION_EXECUTOR; + error RouterTypeDoesNotExist(); + + enum RouterTypes { + V4AggregationRouter, + V5AggregationRouter + } + + IV5AggregationExecutor public immutable V5_AGGREGATION_EXECUTOR; IV5AggregationRouter public immutable V5_AGGREGATION_ROUTER; - address public immutable SOURCE_RECEIVER; + IV4AggregationExecutor public immutable V4_AGGREGATION_EXECUTOR; + IV4AggregationRouter public immutable V4_AGGREGATION_ROUTER; + address public immutable V5_SOURCE_RECEIVER; + address public immutable V4_SOURCE_RECEIVER; - event RouterDeployed(address indexed asset); + event RouterDeployed(RouterTypes type_, address indexed asset); + // Add V4 params constructor( - IV5AggregationExecutor aggregationExecutor, - IV5AggregationRouter v5AggregationRouter + IV5AggregationExecutor v5AggregationExecutor, + IV5AggregationRouter v5AggregationRouter, + IV4AggregationExecutor v4AggregationExecutor, + IV4AggregationRouter v4AggregationRouter ) { - AGGREGATION_EXECUTOR = aggregationExecutor; + V5_AGGREGATION_EXECUTOR = v5AggregationExecutor; V5_AGGREGATION_ROUTER = v5AggregationRouter; - SOURCE_RECEIVER = address(aggregationExecutor); + V5_SOURCE_RECEIVER = address(v5AggregationExecutor); + V4_AGGREGATION_EXECUTOR = v4AggregationExecutor; + V4_AGGREGATION_ROUTER = v4AggregationRouter; + V4_SOURCE_RECEIVER = address(v4AggregationExecutor); } - function deploy(address asset) external returns (address) { + function deploy(RouterTypes type_, address asset) + external + returns (address) + { bytes32 salt = _salt(asset); - address router = address( - new V5Router{salt: salt}( - V5_AGGREGATION_ROUTER, - AGGREGATION_EXECUTOR, - asset, - SOURCE_RECEIVER - ) - ); - emit RouterDeployed(router); + address router; + if (type_ == RouterTypes.V5AggregationRouter) { + router = address( + new V5Router{salt: salt}( + V5_AGGREGATION_ROUTER, + V5_AGGREGATION_EXECUTOR, + asset, + V5_SOURCE_RECEIVER + ) + ); + } else if (type_ == RouterTypes.V4AggregationRouter) { + router = address( + new V4Router{salt: salt}( + V4_AGGREGATION_ROUTER, + V4_AGGREGATION_EXECUTOR, + asset, + V4_SOURCE_RECEIVER + ) + ); + } else { + revert RouterTypeDoesNotExist(); + } + emit RouterDeployed(type_, asset); return router; } - function computeAddress(address asset) external view returns (address) { + function computeAddress(RouterTypes type_, address asset) + external + view + returns (address) + { + if (type_ == RouterTypes.V4AggregationRouter) + return _computeV4AggregationRouterAddress(asset); + else if (type_ == RouterTypes.V5AggregationRouter) + return _computeV5AggregationRouterAddress(asset); + else revert RouterTypeDoesNotExist(); + } + + function _computeV4AggregationRouterAddress(address asset) + internal + view + returns (address) + { + return + Create2.computeCreate2Address( + _salt(asset), + address(this), + type(V4Router).creationCode, + abi.encode( + V4_AGGREGATION_ROUTER, + V4_AGGREGATION_EXECUTOR, + asset, + V4_SOURCE_RECEIVER + ) + ); + } + + function _computeV5AggregationRouterAddress(address asset) + internal + view + returns (address) + { return Create2.computeCreate2Address( _salt(asset), @@ -44,9 +115,9 @@ contract OneInchRouterFactory { type(V5Router).creationCode, abi.encode( V5_AGGREGATION_ROUTER, - AGGREGATION_EXECUTOR, + V5_AGGREGATION_EXECUTOR, asset, - SOURCE_RECEIVER + V5_SOURCE_RECEIVER ) ); } diff --git a/test/1InchContracts.sol b/test/1InchContracts.sol index f3f7b81..5e4b27b 100644 --- a/test/1InchContracts.sol +++ b/test/1InchContracts.sol @@ -3,12 +3,19 @@ pragma solidity >=0.8.0; import {IV5AggregationExecutor} from "src/interfaces/IV5AggregationExecutor.sol"; import {IV5AggregationRouter} from "src/interfaces/IV5AggregationRouter.sol"; +import {IV4AggregationExecutor} from "src/interfaces/IV4AggregationExecutor.sol"; +import {IV4AggregationRouter} from "src/interfaces/IV4AggregationRouter.sol"; contract OneInchContracts { - IV5AggregationRouter aggregationRouter = + IV5AggregationRouter v5AggregationRouter = IV5AggregationRouter(0x1111111254EEB25477B68fb85Ed929f73A960582); - IV5AggregationExecutor aggregationExecutor = + IV5AggregationExecutor v5AggregationExecutor = IV5AggregationExecutor(0xf0694ACc9E941B176E17B9Ef923e71E7B8b2477A); + IV4AggregationRouter v4AggregationRouter = + IV4AggregationRouter(0x1111111254760F7ab3F16433eea9304126DCd199); + IV4AggregationExecutor v4AggregationExecutor = + IV4AggregationExecutor(0xf0694ACc9E941B176E17B9Ef923e71E7B8b2477A); + address public immutable USDC = 0x7F5c764cBc14f9669B88837ca1490cCa17c31607; address public immutable UNI = 0x6fd9d7AD17242c41f7131d257212c54A0e816691; } diff --git a/test/RouterFactory.t.sol b/test/RouterFactory.t.sol index eaf8297..68446d0 100644 --- a/test/RouterFactory.t.sol +++ b/test/RouterFactory.t.sol @@ -6,14 +6,26 @@ import {OneInchRouterFactory} from "src/RouterFactory.sol"; import {OneInchContracts} from "test/1InchContracts.sol"; contract RouterFactoryTest is Test, OneInchContracts { - OneInchRouterFactory factory; + OneInchRouterFactory factory; - function test_deployV5Router() public { - factory = new OneInchRouterFactory( - aggregationExecutor, - aggregationRouter + function test_deployV5Router() public { + factory = new OneInchRouterFactory( + v5AggregationExecutor, + v5AggregationRouter, + v4AggregationExecutor, + v4AggregationRouter ); - address V5Router = factory.deploy(USDC); - assertEq(V5Router, factory.computeAddress(USDC), "V5Router address should be correct"); - } + address V5Router = factory.deploy( + OneInchRouterFactory.RouterTypes.V5AggregationRouter, + USDC + ); + assertEq( + V5Router, + factory.computeAddress( + OneInchRouterFactory.RouterTypes.V5AggregationRouter, + USDC + ), + "V5Router address should be correct" + ); + } } diff --git a/test/V4Router.t.sol b/test/V4Router.t.sol new file mode 100644 index 0000000..abcdfab --- /dev/null +++ b/test/V4Router.t.sol @@ -0,0 +1,83 @@ +// SPDX-License-Identifier: MIT +pragma solidity >=0.8.0; + +import "forge-std/Test.sol"; +import {OneInchRouterFactory} from "src/RouterFactory.sol"; +import {OneInchContracts} from "test/1InchContracts.sol"; +import {IV4AggregationRouter} from "src/interfaces/IV4AggregationRouter.sol"; +import {IERC20} from "openzeppelin-contracts/contracts/token/ERC20/IERC20.sol"; + +contract V4RouterForkTestBase is Test, OneInchContracts { + OneInchRouterFactory factory; + address addr; + + function setUp() public { + vm.createSelectFork(vm.rpcUrl("optimism"), 95_544_472); + factory = new OneInchRouterFactory( + v5AggregationExecutor, + v5AggregationRouter, + v4AggregationExecutor, + v4AggregationRouter + ); + factory.deploy( + OneInchRouterFactory.RouterTypes.V4AggregationRouter, + USDC + ); + deal(USDC, address(this), 100_000_000); + addr = 0xEAC5F0d4A9a45E1f9FdD0e7e2882e9f60E301156; + } +} + +contract V4RouterForkTest is V4RouterForkTestBase { + function returnSlice(bytes calldata d) public pure returns (bytes memory) { + return d[4:]; + } + + function nativeSwap( + IV4AggregationRouter.SwapDescription memory desc, + bytes memory data, + uint256 snapshotId + ) public returns (uint256) { + vm.revertTo(snapshotId); + v4AggregationRouter.swap(v4AggregationExecutor, desc, data); + return IERC20(UNI).balanceOf(addr); + } + + function test_swapUSDC() public { + uint256 snapshotId = vm.snapshot(); + // Calldata generated from calling 1inch's api + bytes + memory dataParams = hex"7c025200000000000000000000000000f0694acc9e941b176e17b9ef923e71e7b8b2477a000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000001800000000000000000000000007f5c764cbc14f9669b88837ca1490cca17c316070000000000000000000000006fd9d7ad17242c41f7131d257212c54a0e816691000000000000000000000000f0694acc9e941b176e17b9ef923e71e7b8b2477a000000000000000000000000eac5f0d4a9a45e1f9fdd0e7e2882e9f60e30115600000000000000000000000000000000000000000000000000000000000186a0000000000000000000000000000000000000000000000000003e1aba8fed6bc100000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001e10000000000000000000000000000000000000000000000000000000001a300a007e5c0d200000000000000000000000000000000000000000000000000017f00011c4330f9d5940c2313636546ab9852354860dce275dbad00000000000000000000000000000000000000000000000000002ecaf7212e2f002424b31a0c000000000000000000000000f0694acc9e941b176e17b9ef923e71e7b8b2477a00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000fffd8963efd1fc6a506488495d951d5263988d2500000000000000000000000000000000000000000000000000000000000000a000000000000000000000000000000000000000000000000000000000000000200000000000000000000000007f5c764cbc14f9669b88837ca1490cca17c3160702a0000000000000000000000000000000000000000000000000003e1aba8fed6bc1ee63c1e581ad4c666fc170b468b19988959eb931a3676f0e9f42000000000000000000000000000000000000061111111254760f7ab3f16433eea9304126dcd19900000000000000000000000000000000000000000000000000000000000186a000000000000000000000000000000000000000000000000000000000000000cfee7c08"; + // Decode api calldata to get the data parameter needed for both calls + ( + , + IV4AggregationRouter.SwapDescription memory desc, + bytes memory data + ) = abi.decode( + this.returnSlice(dataParams), + (address, IV4AggregationRouter.SwapDescription, bytes) + ); + + // Setup optimized router call + vm.startPrank(0xEAC5F0d4A9a45E1f9FdD0e7e2882e9f60E301156); + address routerAddr = factory.computeAddress( + OneInchRouterFactory.RouterTypes.V4AggregationRouter, + USDC + ); + IERC20(USDC).approve(routerAddr, 100_000); + uint256 startingBalance = IERC20(UNI).balanceOf(addr); + assertTrue(startingBalance == 0); + + // Opitmized router call + (bool ok, ) = payable(routerAddr).call( + abi.encode(UNI, 100_000, desc.minReturnAmount, data, false) + ); + + assertTrue(ok); + + // Compare balance to native aggregation router call + uint256 endingBalance = IERC20(UNI).balanceOf(addr); + uint256 nativeEndingBalance = nativeSwap(desc, data, snapshotId); + assertTrue(endingBalance == nativeEndingBalance); + } +} diff --git a/test/V5Router.t.sol b/test/V5Router.t.sol index 2b7dcd8..9a7f3a7 100644 --- a/test/V5Router.t.sol +++ b/test/V5Router.t.sol @@ -14,10 +14,15 @@ contract V5RouterForkTestBase is Test, OneInchContracts { function setUp() public { vm.createSelectFork(vm.rpcUrl("optimism"), 94_524_034); factory = new OneInchRouterFactory( - aggregationExecutor, - aggregationRouter + v5AggregationExecutor, + v5AggregationRouter, + v4AggregationExecutor, + v4AggregationRouter + ); + factory.deploy( + OneInchRouterFactory.RouterTypes.V5AggregationRouter, + USDC ); - factory.deploy(USDC); deal(USDC, address(this), 100_000_000); addr = 0xEAC5F0d4A9a45E1f9FdD0e7e2882e9f60E301156; } @@ -35,7 +40,7 @@ contract V5RouterForkTest is V5RouterForkTestBase { uint256 snapshotId ) public returns (uint256) { vm.revertTo(snapshotId); - aggregationRouter.swap(aggregationExecutor, desc, permit, data); + v5AggregationRouter.swap(v5AggregationExecutor, desc, permit, data); return IERC20(UNI).balanceOf(addr); } @@ -57,7 +62,10 @@ contract V5RouterForkTest is V5RouterForkTestBase { // Setup optimized router call vm.startPrank(0xEAC5F0d4A9a45E1f9FdD0e7e2882e9f60E301156); - address routerAddr = factory.computeAddress(USDC); + address routerAddr = factory.computeAddress( + OneInchRouterFactory.RouterTypes.V5AggregationRouter, + USDC + ); IERC20(USDC).approve(routerAddr, 100_000); uint256 startingBalance = IERC20(UNI).balanceOf(addr); assertTrue(startingBalance == 0); From 580f0ba21d1f74bd76c5a30d1a259617efaad4ed Mon Sep 17 00:00:00 2001 From: Keating Date: Sun, 30 Apr 2023 13:26:59 -0400 Subject: [PATCH 09/48] Deploy script written --- script/Deploy.s.sol | 37 +++++++++++++++++++++++++++++-------- 1 file changed, 29 insertions(+), 8 deletions(-) diff --git a/script/Deploy.s.sol b/script/Deploy.s.sol index 7602b94..d4e2e7d 100644 --- a/script/Deploy.s.sol +++ b/script/Deploy.s.sol @@ -2,18 +2,39 @@ pragma solidity ^0.8.16; -import "forge-std/Script.sol"; +import {Script} from "forge-std/Script.sol"; import {IERC20} from "openzeppelin-contracts/contracts/token/ERC20/IERC20.sol"; +import {OneInchContracts} from "test/1InchContracts.sol"; +import {OneInchRouterFactory} from "src/RouterFactory.sol"; -// approve for amount to router -contract Deploy is Script { +// IERC20(USDC).approve(0x1111111254EEB25477B68fb85Ed929f73A960582, 100_000); +//IERC20(USDC).approve( +// 0x1111111254760F7ab3F16433eea9304126DCd199, +// 100_000 +//); +contract Deploy is Script, OneInchContracts { function run() public { - address USDC = 0x7F5c764cBc14f9669B88837ca1490cCa17c31607; + // Deploy the optimized router factory vm.broadcast(); - // IERC20(USDC).approve(0x1111111254EEB25477B68fb85Ed929f73A960582, 100_000); - IERC20(USDC).approve( - 0x1111111254760F7ab3F16433eea9304126DCd199, - 100_000 + OneInchRouterFactory factory = new OneInchRouterFactory( + v5AggregationExecutor, + v5AggregationRouter, + v4AggregationExecutor, + v4AggregationRouter + ); + + // Deploy the optimized router for V5Aggregation + vm.broadcast(); + factory.deploy( + OneInchRouterFactory.RouterTypes.V5AggregationRouter, + USDC + ); + + // Deploy the optimized router for V4Aggregation + vm.broadcast(); + factory.deploy( + OneInchRouterFactory.RouterTypes.V4AggregationRouter, + USDC ); } } From 8c5f8dc4a01e9e9d784700a4435032730272f5eb Mon Sep 17 00:00:00 2001 From: Keating Date: Sun, 30 Apr 2023 18:06:25 -0400 Subject: [PATCH 10/48] Add Benchmarks --- foundry.toml | 1 + script/Benchmark.s.sol | 100 ++++++++++++++++++++++++++++++++++++++++ test/1InchContracts.sol | 8 ++++ test/V4Router.t.sol | 6 +-- test/V5Router.t.sol | 6 +-- 5 files changed, 111 insertions(+), 10 deletions(-) create mode 100644 script/Benchmark.s.sol diff --git a/foundry.toml b/foundry.toml index 9b4befa..9a15856 100644 --- a/foundry.toml +++ b/foundry.toml @@ -3,6 +3,7 @@ optimizer_runs = 10_000_000 solc_version = "0.8.16" verbosity = 3 + fs_permissions = [{ access = "read", path = "./broadcast" }] [profile.ci] fuzz = { runs = 5000 } diff --git a/script/Benchmark.s.sol b/script/Benchmark.s.sol new file mode 100644 index 0000000..5f8b1eb --- /dev/null +++ b/script/Benchmark.s.sol @@ -0,0 +1,100 @@ +// SPDX-License-Identifier: MIT +pragma solidity >=0.8.0; + +import {IERC20} from "openzeppelin-contracts/contracts/token/ERC20/IERC20.sol"; +import {Script, stdJson} from "forge-std/Script.sol"; + +import {IV5AggregationRouter} from "src/interfaces/IV5AggregationRouter.sol"; +import {IV4AggregationRouter} from "src/interfaces/IV4AggregationRouter.sol"; +import {OneInchContracts} from "test/1InchContracts.sol"; +import "forge-std/console.sol"; + +// Script to get benchmarks the test will need +// to be swapped out for new data as it is meant +// to be used by a specific test wallet +contract Benchmark is Script, OneInchContracts { + using stdJson for string; + error OptimizedV4RouterFailed(); + error OptimizedV5RouterFailed(); + + bytes public v5DataParams = + hex"12aa3caf000000000000000000000000f0694acc9e941b176e17b9ef923e71e7b8b2477a0000000000000000000000007f5c764cbc14f9669b88837ca1490cca17c316070000000000000000000000006fd9d7ad17242c41f7131d257212c54a0e816691000000000000000000000000f0694acc9e941b176e17b9ef923e71e7b8b2477a000000000000000000000000eac5f0d4a9a45e1f9fdd0e7e2882e9f60e30115600000000000000000000000000000000000000000000000000000000000186a0000000000000000000000000000000000000000000000000003e530a0ee30f45000000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000001400000000000000000000000000000000000000000000000000000000000000160000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001f50000000000000000000000000000000000000000000000000000000001d700a007e5c0d20000000000000000000000000000000000000000000000000001b30001505126a132dab612db5cb9fc9ac426a0cc215a3423f9c97f5c764cbc14f9669b88837ca1490cca17c316070004f41766d8000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002e2669c6242f00000000000000000000000000000000000000000000000000000000000000a0000000000000000000000000f0694acc9e941b176e17b9ef923e71e7b8b2477a00000000000000000000000000000000000000000000000000000000644fdfe900000000000000000000000000000000000000000000000000000000000000010000000000000000000000007f5c764cbc14f9669b88837ca1490cca17c316070000000000000000000000004200000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000102a0000000000000000000000000000000000000000000000000003e530a0ee30f45ee63c1e581ad4c666fc170b468b19988959eb931a3676f0e9f42000000000000000000000000000000000000061111111254eeb25477b68fb85ed929f73a9605820000000000000000000000cfee7c08"; + bytes public v4DataParams = + hex"7c025200000000000000000000000000f0694acc9e941b176e17b9ef923e71e7b8b2477a000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000001800000000000000000000000007f5c764cbc14f9669b88837ca1490cca17c316070000000000000000000000006fd9d7ad17242c41f7131d257212c54a0e816691000000000000000000000000f0694acc9e941b176e17b9ef923e71e7b8b2477a000000000000000000000000eac5f0d4a9a45e1f9fdd0e7e2882e9f60e30115600000000000000000000000000000000000000000000000000000000000186a0000000000000000000000000000000000000000000000000003e1aba8fed6bc100000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001e10000000000000000000000000000000000000000000000000000000001a300a007e5c0d200000000000000000000000000000000000000000000000000017f00011c4330f9d5940c2313636546ab9852354860dce275dbad00000000000000000000000000000000000000000000000000002ecaf7212e2f002424b31a0c000000000000000000000000f0694acc9e941b176e17b9ef923e71e7b8b2477a00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000fffd8963efd1fc6a506488495d951d5263988d2500000000000000000000000000000000000000000000000000000000000000a000000000000000000000000000000000000000000000000000000000000000200000000000000000000000007f5c764cbc14f9669b88837ca1490cca17c3160702a0000000000000000000000000000000000000000000000000003e1aba8fed6bc1ee63c1e581ad4c666fc170b468b19988959eb931a3676f0e9f42000000000000000000000000000000000000061111111254760f7ab3f16433eea9304126dcd19900000000000000000000000000000000000000000000000000000000000186a000000000000000000000000000000000000000000000000000000000000000cfee7c08"; + + function run() public { + require(block.chainid == 10, "script can only be run on optimism"); + string memory file = "broadcast/Deploy.s.sol/10/run-latest.json"; + string memory json = vm.readFile(file); + address v5Rtr = json.readAddress( + ".transactions[1].additionalContracts[0].address" + ); + + address v4Rtr = json.readAddress( + ".transactions[2].additionalContracts[0].address" + ); + + // =========================== + // ======== Execution ======== + // =========================== + + vm.startBroadcast(); + // Optimized v5 router approval + IERC20(USDC).approve(v5Rtr, 100_000); + // Regular v5 router approval + IERC20(USDC).approve(address(v5AggregationRouter), 100_000); + + // Parse calldata returned by the api to get params + ( + , + IV5AggregationRouter.SwapDescription memory v5Desc, + bytes memory v5Permit, + bytes memory v5Data + ) = abi.decode( + this.returnSliceBytes(v5DataParams), + (address, IV5AggregationRouter.SwapDescription, bytes, bytes) + ); + // Regular v5 swap call + v5AggregationRouter.swap( + v5AggregationExecutor, + v5Desc, + v5Permit, + v5Data + ); + + // Opitmized router v5 swap call + (bool v5Ok, ) = payable(v5Rtr).call( + abi.encode(UNI, 100_000, v5Desc.minReturnAmount, v5Data, false) + ); + + if (!v5Ok) { + revert OptimizedV5RouterFailed(); + } + + // Parse v4 calldata returned by the 1inch api + ( + , + IV4AggregationRouter.SwapDescription memory v4Desc, + bytes memory v4Data + ) = abi.decode( + this.returnSliceBytes(v4DataParams), + (address, IV4AggregationRouter.SwapDescription, bytes) + ); + + // Optimized v4 router approval + IERC20(USDC).approve(v4Rtr, 100_000); + // Regular v4 router approval + IERC20(USDC).approve(address(v4AggregationRouter), 100_000); + + // Regular v4 swap call + v4AggregationRouter.swap(v4AggregationExecutor, v4Desc, v4Data); + + // Optimized v4 swap call + (bool v4Ok, ) = payable(v4Rtr).call( + abi.encode(UNI, 100_000, v4Desc.minReturnAmount, v4Data, false) + ); + if (!v4Ok) { + revert OptimizedV4RouterFailed(); + } + } +} diff --git a/test/1InchContracts.sol b/test/1InchContracts.sol index 5e4b27b..a7a4640 100644 --- a/test/1InchContracts.sol +++ b/test/1InchContracts.sol @@ -18,4 +18,12 @@ contract OneInchContracts { address public immutable USDC = 0x7F5c764cBc14f9669B88837ca1490cCa17c31607; address public immutable UNI = 0x6fd9d7AD17242c41f7131d257212c54A0e816691; + + function returnSliceBytes(bytes calldata d) + public + pure + returns (bytes memory) + { + return d[4:]; + } } diff --git a/test/V4Router.t.sol b/test/V4Router.t.sol index abcdfab..050c1a3 100644 --- a/test/V4Router.t.sol +++ b/test/V4Router.t.sol @@ -29,10 +29,6 @@ contract V4RouterForkTestBase is Test, OneInchContracts { } contract V4RouterForkTest is V4RouterForkTestBase { - function returnSlice(bytes calldata d) public pure returns (bytes memory) { - return d[4:]; - } - function nativeSwap( IV4AggregationRouter.SwapDescription memory desc, bytes memory data, @@ -54,7 +50,7 @@ contract V4RouterForkTest is V4RouterForkTestBase { IV4AggregationRouter.SwapDescription memory desc, bytes memory data ) = abi.decode( - this.returnSlice(dataParams), + this.returnSliceBytes(dataParams), (address, IV4AggregationRouter.SwapDescription, bytes) ); diff --git a/test/V5Router.t.sol b/test/V5Router.t.sol index 9a7f3a7..06e60ff 100644 --- a/test/V5Router.t.sol +++ b/test/V5Router.t.sol @@ -29,10 +29,6 @@ contract V5RouterForkTestBase is Test, OneInchContracts { } contract V5RouterForkTest is V5RouterForkTestBase { - function returnSlice(bytes calldata d) public pure returns (bytes memory) { - return d[4:]; - } - function nativeSwap( IV5AggregationRouter.SwapDescription memory desc, bytes memory permit, @@ -56,7 +52,7 @@ contract V5RouterForkTest is V5RouterForkTestBase { bytes memory permit, bytes memory data ) = abi.decode( - this.returnSlice(dataParams), + this.returnSliceBytes(dataParams), (address, IV5AggregationRouter.SwapDescription, bytes, bytes) ); From 4c02859a25e4b29b5a2b39c34f3bea7966590020 Mon Sep 17 00:00:00 2001 From: Keating Date: Sun, 30 Apr 2023 18:08:37 -0400 Subject: [PATCH 11/48] Add broadcast files --- .../Benchmark.s.sol/10/run-1682891249.json | 1128 +++++++++++++++++ broadcast/Benchmark.s.sol/10/run-latest.json | 1128 +++++++++++++++++ broadcast/Deploy.s.sol/10/run-1682875572.json | 162 +++ broadcast/Deploy.s.sol/10/run-latest.json | 162 +++ 4 files changed, 2580 insertions(+) create mode 100644 broadcast/Benchmark.s.sol/10/run-1682891249.json create mode 100644 broadcast/Benchmark.s.sol/10/run-latest.json create mode 100644 broadcast/Deploy.s.sol/10/run-1682875572.json create mode 100644 broadcast/Deploy.s.sol/10/run-latest.json diff --git a/broadcast/Benchmark.s.sol/10/run-1682891249.json b/broadcast/Benchmark.s.sol/10/run-1682891249.json new file mode 100644 index 0000000..5934876 --- /dev/null +++ b/broadcast/Benchmark.s.sol/10/run-1682891249.json @@ -0,0 +1,1128 @@ +{ + "transactions": [ + { + "hash": "0x348866c854cc363d7aa16f63f8dbc467180c9b42f49d0601760e883e9f34c75b", + "transactionType": "CALL", + "contractName": null, + "contractAddress": "0x7F5c764cBc14f9669B88837ca1490cCa17c31607", + "function": null, + "arguments": null, + "rpc": "", + "transaction": { + "type": "0x00", + "from": "0xeac5f0d4a9a45e1f9fdd0e7e2882e9f60e301156", + "to": "0x7f5c764cbc14f9669b88837ca1490cca17c31607", + "gas": "0x11e41", + "value": "0x0", + "data": "0x095ea7b3000000000000000000000000b17ccee669ab2cc40a6564da84db66dd8d144cb400000000000000000000000000000000000000000000000000000000000186a0", + "nonce": "0x1f" + }, + "additionalContracts": [], + "isFixedGasLimit": false + }, + { + "hash": "0x922fbc3c0c94e49f79c5bd2483f9d2be8644150654bc6b6b677f4debe097c6f7", + "transactionType": "CALL", + "contractName": null, + "contractAddress": "0x7F5c764cBc14f9669B88837ca1490cCa17c31607", + "function": null, + "arguments": null, + "rpc": "", + "transaction": { + "type": "0x00", + "from": "0xeac5f0d4a9a45e1f9fdd0e7e2882e9f60e301156", + "to": "0x7f5c764cbc14f9669b88837ca1490cca17c31607", + "gas": "0xbd68", + "value": "0x0", + "data": "0x095ea7b30000000000000000000000001111111254eeb25477b68fb85ed929f73a96058200000000000000000000000000000000000000000000000000000000000186a0", + "nonce": "0x20" + }, + "additionalContracts": [], + "isFixedGasLimit": false + }, + { + "hash": "0x0d1fbde82bd92ed22f1cd21788c5b734f7caa8b3523b0dba63cb65c1fd2cca4f", + "transactionType": "CALL", + "contractName": null, + "contractAddress": "0x1111111254EEB25477B68fb85Ed929f73A960582", + "function": null, + "arguments": null, + "rpc": "", + "transaction": { + "type": "0x00", + "from": "0xeac5f0d4a9a45e1f9fdd0e7e2882e9f60e301156", + "to": "0x1111111254eeb25477b68fb85ed929f73a960582", + "gas": "0x67bb8", + "value": "0x0", + "data": "0x12aa3caf000000000000000000000000f0694acc9e941b176e17b9ef923e71e7b8b2477a0000000000000000000000007f5c764cbc14f9669b88837ca1490cca17c316070000000000000000000000006fd9d7ad17242c41f7131d257212c54a0e816691000000000000000000000000f0694acc9e941b176e17b9ef923e71e7b8b2477a000000000000000000000000eac5f0d4a9a45e1f9fdd0e7e2882e9f60e30115600000000000000000000000000000000000000000000000000000000000186a0000000000000000000000000000000000000000000000000003e530a0ee30f45000000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000001400000000000000000000000000000000000000000000000000000000000000160000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001f50000000000000000000000000000000000000000000000000000000001d700a007e5c0d20000000000000000000000000000000000000000000000000001b30001505126a132dab612db5cb9fc9ac426a0cc215a3423f9c97f5c764cbc14f9669b88837ca1490cca17c316070004f41766d8000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002e2669c6242f00000000000000000000000000000000000000000000000000000000000000a0000000000000000000000000f0694acc9e941b176e17b9ef923e71e7b8b2477a00000000000000000000000000000000000000000000000000000000644fdfe900000000000000000000000000000000000000000000000000000000000000010000000000000000000000007f5c764cbc14f9669b88837ca1490cca17c316070000000000000000000000004200000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000102a0000000000000000000000000000000000000000000000000003e530a0ee30f45ee63c1e581ad4c666fc170b468b19988959eb931a3676f0e9f42000000000000000000000000000000000000061111111254eeb25477b68fb85ed929f73a9605820000000000000000000000", + "nonce": "0x21" + }, + "additionalContracts": [], + "isFixedGasLimit": false + }, + { + "hash": "0xe7bfb6d05f570a42721bb6168e20a3d23bd38bcdd9d14b19740af210f2382b13", + "transactionType": "CALL", + "contractName": null, + "contractAddress": "0xB17cCEE669aB2cc40A6564DA84Db66dD8D144CB4", + "function": null, + "arguments": null, + "rpc": "", + "transaction": { + "type": "0x00", + "from": "0xeac5f0d4a9a45e1f9fdd0e7e2882e9f60e301156", + "to": "0xb17ccee669ab2cc40a6564da84db66dd8d144cb4", + "gas": "0x68a35", + "value": "0x0", + "data": "0x0000000000000000000000006fd9d7ad17242c41f7131d257212c54a0e81669100000000000000000000000000000000000000000000000000000000000186a0000000000000000000000000000000000000000000000000003e530a0ee30f4500000000000000000000000000000000000000000000000000000000000000a0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001f50000000000000000000000000000000000000000000000000000000001d700a007e5c0d20000000000000000000000000000000000000000000000000001b30001505126a132dab612db5cb9fc9ac426a0cc215a3423f9c97f5c764cbc14f9669b88837ca1490cca17c316070004f41766d8000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002e2669c6242f00000000000000000000000000000000000000000000000000000000000000a0000000000000000000000000f0694acc9e941b176e17b9ef923e71e7b8b2477a00000000000000000000000000000000000000000000000000000000644fdfe900000000000000000000000000000000000000000000000000000000000000010000000000000000000000007f5c764cbc14f9669b88837ca1490cca17c316070000000000000000000000004200000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000102a0000000000000000000000000000000000000000000000000003e530a0ee30f45ee63c1e581ad4c666fc170b468b19988959eb931a3676f0e9f42000000000000000000000000000000000000061111111254eeb25477b68fb85ed929f73a9605820000000000000000000000", + "nonce": "0x22" + }, + "additionalContracts": [], + "isFixedGasLimit": false + }, + { + "hash": "0x71f79f21650241187d3e637351677f73d2fee7591f2600ecc768226d7d9a3178", + "transactionType": "CALL", + "contractName": null, + "contractAddress": "0x7F5c764cBc14f9669B88837ca1490cCa17c31607", + "function": null, + "arguments": null, + "rpc": "", + "transaction": { + "type": "0x00", + "from": "0xeac5f0d4a9a45e1f9fdd0e7e2882e9f60e301156", + "to": "0x7f5c764cbc14f9669b88837ca1490cca17c31607", + "gas": "0x11e41", + "value": "0x0", + "data": "0x095ea7b3000000000000000000000000444a406c15e6f87aee894999cb13b4ff1d61a85b00000000000000000000000000000000000000000000000000000000000186a0", + "nonce": "0x23" + }, + "additionalContracts": [], + "isFixedGasLimit": false + }, + { + "hash": "0x179019d502a67838533b07634ad619d39514b55a10599b250f80c5cb219ab04e", + "transactionType": "CALL", + "contractName": null, + "contractAddress": "0x7F5c764cBc14f9669B88837ca1490cCa17c31607", + "function": null, + "arguments": null, + "rpc": "", + "transaction": { + "type": "0x00", + "from": "0xeac5f0d4a9a45e1f9fdd0e7e2882e9f60e301156", + "to": "0x7f5c764cbc14f9669b88837ca1490cca17c31607", + "gas": "0xbd68", + "value": "0x0", + "data": "0x095ea7b30000000000000000000000001111111254760f7ab3f16433eea9304126dcd19900000000000000000000000000000000000000000000000000000000000186a0", + "nonce": "0x24" + }, + "additionalContracts": [], + "isFixedGasLimit": false + }, + { + "hash": "0x5445be7f53975a21d639f41e3e607903bc47ab5f1c87c2005c657dbf0efafe48", + "transactionType": "CALL", + "contractName": null, + "contractAddress": "0x1111111254760F7ab3F16433eea9304126DCd199", + "function": null, + "arguments": null, + "rpc": "", + "transaction": { + "type": "0x00", + "from": "0xeac5f0d4a9a45e1f9fdd0e7e2882e9f60e301156", + "to": "0x1111111254760f7ab3f16433eea9304126dcd199", + "gas": "0x41e7f", + "value": "0x0", + "data": "0x7c025200000000000000000000000000f0694acc9e941b176e17b9ef923e71e7b8b2477a000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000001800000000000000000000000007f5c764cbc14f9669b88837ca1490cca17c316070000000000000000000000006fd9d7ad17242c41f7131d257212c54a0e816691000000000000000000000000f0694acc9e941b176e17b9ef923e71e7b8b2477a000000000000000000000000eac5f0d4a9a45e1f9fdd0e7e2882e9f60e30115600000000000000000000000000000000000000000000000000000000000186a0000000000000000000000000000000000000000000000000003e1aba8fed6bc100000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001e10000000000000000000000000000000000000000000000000000000001a300a007e5c0d200000000000000000000000000000000000000000000000000017f00011c4330f9d5940c2313636546ab9852354860dce275dbad00000000000000000000000000000000000000000000000000002ecaf7212e2f002424b31a0c000000000000000000000000f0694acc9e941b176e17b9ef923e71e7b8b2477a00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000fffd8963efd1fc6a506488495d951d5263988d2500000000000000000000000000000000000000000000000000000000000000a000000000000000000000000000000000000000000000000000000000000000200000000000000000000000007f5c764cbc14f9669b88837ca1490cca17c3160702a0000000000000000000000000000000000000000000000000003e1aba8fed6bc1ee63c1e581ad4c666fc170b468b19988959eb931a3676f0e9f42000000000000000000000000000000000000061111111254760f7ab3f16433eea9304126dcd19900000000000000000000000000000000000000000000000000000000000186a000000000000000000000000000000000000000000000000000000000000000", + "nonce": "0x25" + }, + "additionalContracts": [], + "isFixedGasLimit": false + }, + { + "hash": "0x0d8dc46ad33862e3379182916a1539b58385d98e309f72b63179c594ca783ad0", + "transactionType": "CALL", + "contractName": null, + "contractAddress": "0x444A406C15e6F87Aee894999cb13B4ff1D61a85B", + "function": null, + "arguments": null, + "rpc": "", + "transaction": { + "type": "0x00", + "from": "0xeac5f0d4a9a45e1f9fdd0e7e2882e9f60e301156", + "to": "0x444a406c15e6f87aee894999cb13b4ff1d61a85b", + "gas": "0x4d893", + "value": "0x0", + "data": "0x0000000000000000000000006fd9d7ad17242c41f7131d257212c54a0e81669100000000000000000000000000000000000000000000000000000000000186a0000000000000000000000000000000000000000000000000003e1aba8fed6bc100000000000000000000000000000000000000000000000000000000000000a0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001e10000000000000000000000000000000000000000000000000000000001a300a007e5c0d200000000000000000000000000000000000000000000000000017f00011c4330f9d5940c2313636546ab9852354860dce275dbad00000000000000000000000000000000000000000000000000002ecaf7212e2f002424b31a0c000000000000000000000000f0694acc9e941b176e17b9ef923e71e7b8b2477a00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000fffd8963efd1fc6a506488495d951d5263988d2500000000000000000000000000000000000000000000000000000000000000a000000000000000000000000000000000000000000000000000000000000000200000000000000000000000007f5c764cbc14f9669b88837ca1490cca17c3160702a0000000000000000000000000000000000000000000000000003e1aba8fed6bc1ee63c1e581ad4c666fc170b468b19988959eb931a3676f0e9f42000000000000000000000000000000000000061111111254760f7ab3f16433eea9304126dcd19900000000000000000000000000000000000000000000000000000000000186a000000000000000000000000000000000000000000000000000000000000000", + "nonce": "0x26" + }, + "additionalContracts": [], + "isFixedGasLimit": false + } + ], + "receipts": [ + { + "transactionHash": "0x348866c854cc363d7aa16f63f8dbc467180c9b42f49d0601760e883e9f34c75b", + "transactionIndex": "0x0", + "blockHash": "0x9a259c5bfb1e00100a957619cbe9e496e05a3f84ea5a705ed9743237c49058e7", + "blockNumber": "0x5b287f3", + "from": "0xEAC5F0d4A9a45E1f9FdD0e7e2882e9f60E301156", + "to": "0x7F5c764cBc14f9669B88837ca1490cCa17c31607", + "cumulativeGasUsed": "0xcf3f", + "gasUsed": "0xcf3f", + "contractAddress": null, + "logs": [ + { + "address": "0x7F5c764cBc14f9669B88837ca1490cCa17c31607", + "topics": [ + "0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925", + "0x000000000000000000000000eac5f0d4a9a45e1f9fdd0e7e2882e9f60e301156", + "0x000000000000000000000000b17ccee669ab2cc40a6564da84db66dd8d144cb4" + ], + "data": "0x00000000000000000000000000000000000000000000000000000000000186a0", + "blockHash": "0x9a259c5bfb1e00100a957619cbe9e496e05a3f84ea5a705ed9743237c49058e7", + "blockNumber": "0x5b287f3", + "transactionHash": "0x348866c854cc363d7aa16f63f8dbc467180c9b42f49d0601760e883e9f34c75b", + "transactionIndex": "0x0", + "logIndex": "0x0", + "removed": false + } + ], + "status": "0x1", + "logsBloom": "0x00000000000000000000008000000000000000000000000000000000000000000000000000000000000040000000000000000040000000000000000000200000000000000000000000800000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000200000000000000000000000040000000020000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000800000000000000000000000010000" + }, + { + "transactionHash": "0x922fbc3c0c94e49f79c5bd2483f9d2be8644150654bc6b6b677f4debe097c6f7", + "transactionIndex": "0x0", + "blockHash": "0xe1ecbe29525ebdfe584d37b4d8930c701264f1ff8b15669d75ee919f6c76fad7", + "blockNumber": "0x5b287ff", + "from": "0xEAC5F0d4A9a45E1f9FdD0e7e2882e9f60E301156", + "to": "0x7F5c764cBc14f9669B88837ca1490cCa17c31607", + "cumulativeGasUsed": "0x8183", + "gasUsed": "0x8183", + "contractAddress": null, + "logs": [ + { + "address": "0x7F5c764cBc14f9669B88837ca1490cCa17c31607", + "topics": [ + "0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925", + "0x000000000000000000000000eac5f0d4a9a45e1f9fdd0e7e2882e9f60e301156", + "0x0000000000000000000000001111111254eeb25477b68fb85ed929f73a960582" + ], + "data": "0x00000000000000000000000000000000000000000000000000000000000186a0", + "blockHash": "0xe1ecbe29525ebdfe584d37b4d8930c701264f1ff8b15669d75ee919f6c76fad7", + "blockNumber": "0x5b287ff", + "transactionHash": "0x922fbc3c0c94e49f79c5bd2483f9d2be8644150654bc6b6b677f4debe097c6f7", + "transactionIndex": "0x0", + "logIndex": "0x0", + "removed": false + } + ], + "status": "0x1", + "logsBloom": "0x00000000000000000000008000000000000000000000000000000000000000000000000000000000000000000000000000000040000000000000000000200000000000000000080000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000040000000020000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010000000000000000400000000000000800000000000000000000000010000" + }, + { + "transactionHash": "0x0d1fbde82bd92ed22f1cd21788c5b734f7caa8b3523b0dba63cb65c1fd2cca4f", + "transactionIndex": "0x0", + "blockHash": "0x75dc10b02430f6ab2e7a19748dea56351e6b1a705d8f75142477f491b250ebae", + "blockNumber": "0x5b2880f", + "from": "0xEAC5F0d4A9a45E1f9FdD0e7e2882e9f60E301156", + "to": "0x1111111254EEB25477B68fb85Ed929f73A960582", + "cumulativeGasUsed": "0x46eda", + "gasUsed": "0x46eda", + "contractAddress": null, + "logs": [ + { + "address": "0x7F5c764cBc14f9669B88837ca1490cCa17c31607", + "topics": [ + "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef", + "0x000000000000000000000000eac5f0d4a9a45e1f9fdd0e7e2882e9f60e301156", + "0x000000000000000000000000f0694acc9e941b176e17b9ef923e71e7b8b2477a" + ], + "data": "0x00000000000000000000000000000000000000000000000000000000000186a0", + "blockHash": "0x75dc10b02430f6ab2e7a19748dea56351e6b1a705d8f75142477f491b250ebae", + "blockNumber": "0x5b2880f", + "transactionHash": "0x0d1fbde82bd92ed22f1cd21788c5b734f7caa8b3523b0dba63cb65c1fd2cca4f", + "transactionIndex": "0x0", + "logIndex": "0x0", + "removed": false + }, + { + "address": "0x7F5c764cBc14f9669B88837ca1490cCa17c31607", + "topics": [ + "0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925", + "0x000000000000000000000000eac5f0d4a9a45e1f9fdd0e7e2882e9f60e301156", + "0x0000000000000000000000001111111254eeb25477b68fb85ed929f73a960582" + ], + "data": "0x0000000000000000000000000000000000000000000000000000000000000000", + "blockHash": "0x75dc10b02430f6ab2e7a19748dea56351e6b1a705d8f75142477f491b250ebae", + "blockNumber": "0x5b2880f", + "transactionHash": "0x0d1fbde82bd92ed22f1cd21788c5b734f7caa8b3523b0dba63cb65c1fd2cca4f", + "transactionIndex": "0x0", + "logIndex": "0x1", + "removed": false + }, + { + "address": "0x7F5c764cBc14f9669B88837ca1490cCa17c31607", + "topics": [ + "0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925", + "0x000000000000000000000000f0694acc9e941b176e17b9ef923e71e7b8b2477a", + "0x000000000000000000000000a132dab612db5cb9fc9ac426a0cc215a3423f9c9" + ], + "data": "0x00000000000000000000000000000000000000000000000000000000000186a0", + "blockHash": "0x75dc10b02430f6ab2e7a19748dea56351e6b1a705d8f75142477f491b250ebae", + "blockNumber": "0x5b2880f", + "transactionHash": "0x0d1fbde82bd92ed22f1cd21788c5b734f7caa8b3523b0dba63cb65c1fd2cca4f", + "transactionIndex": "0x0", + "logIndex": "0x2", + "removed": false + }, + { + "address": "0x7F5c764cBc14f9669B88837ca1490cCa17c31607", + "topics": [ + "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef", + "0x000000000000000000000000f0694acc9e941b176e17b9ef923e71e7b8b2477a", + "0x00000000000000000000000048e18e3d1efa7f0e15f1b2bf01b232534c30a3ef" + ], + "data": "0x00000000000000000000000000000000000000000000000000000000000186a0", + "blockHash": "0x75dc10b02430f6ab2e7a19748dea56351e6b1a705d8f75142477f491b250ebae", + "blockNumber": "0x5b2880f", + "transactionHash": "0x0d1fbde82bd92ed22f1cd21788c5b734f7caa8b3523b0dba63cb65c1fd2cca4f", + "transactionIndex": "0x0", + "logIndex": "0x3", + "removed": false + }, + { + "address": "0x7F5c764cBc14f9669B88837ca1490cCa17c31607", + "topics": [ + "0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925", + "0x000000000000000000000000f0694acc9e941b176e17b9ef923e71e7b8b2477a", + "0x000000000000000000000000a132dab612db5cb9fc9ac426a0cc215a3423f9c9" + ], + "data": "0x0000000000000000000000000000000000000000000000000000000000000000", + "blockHash": "0x75dc10b02430f6ab2e7a19748dea56351e6b1a705d8f75142477f491b250ebae", + "blockNumber": "0x5b2880f", + "transactionHash": "0x0d1fbde82bd92ed22f1cd21788c5b734f7caa8b3523b0dba63cb65c1fd2cca4f", + "transactionIndex": "0x0", + "logIndex": "0x4", + "removed": false + }, + { + "address": "0x4200000000000000000000000000000000000006", + "topics": [ + "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef", + "0x00000000000000000000000048e18e3d1efa7f0e15f1b2bf01b232534c30a3ef", + "0x000000000000000000000000f0694acc9e941b176e17b9ef923e71e7b8b2477a" + ], + "data": "0x00000000000000000000000000000000000000000000000000002ff6128b1096", + "blockHash": "0x75dc10b02430f6ab2e7a19748dea56351e6b1a705d8f75142477f491b250ebae", + "blockNumber": "0x5b2880f", + "transactionHash": "0x0d1fbde82bd92ed22f1cd21788c5b734f7caa8b3523b0dba63cb65c1fd2cca4f", + "transactionIndex": "0x0", + "logIndex": "0x5", + "removed": false + }, + { + "address": "0x7F5c764cBc14f9669B88837ca1490cCa17c31607", + "topics": [ + "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef", + "0x00000000000000000000000048e18e3d1efa7f0e15f1b2bf01b232534c30a3ef", + "0x000000000000000000000000d5b6cfc309fd839fb33b826d8501ec90e6d9f45c" + ], + "data": "0x0000000000000000000000000000000000000000000000000000000000000032", + "blockHash": "0x75dc10b02430f6ab2e7a19748dea56351e6b1a705d8f75142477f491b250ebae", + "blockNumber": "0x5b2880f", + "transactionHash": "0x0d1fbde82bd92ed22f1cd21788c5b734f7caa8b3523b0dba63cb65c1fd2cca4f", + "transactionIndex": "0x0", + "logIndex": "0x6", + "removed": false + }, + { + "address": "0x48e18E3d1eFA7F0E15F1b2Bf01b232534c30a3EF", + "topics": [ + "0x112c256902bf554b6ed882d2936687aaeb4225e8cd5b51303c90ca6cf43a8602", + "0x000000000000000000000000a132dab612db5cb9fc9ac426a0cc215a3423f9c9" + ], + "data": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000032", + "blockHash": "0x75dc10b02430f6ab2e7a19748dea56351e6b1a705d8f75142477f491b250ebae", + "blockNumber": "0x5b2880f", + "transactionHash": "0x0d1fbde82bd92ed22f1cd21788c5b734f7caa8b3523b0dba63cb65c1fd2cca4f", + "transactionIndex": "0x0", + "logIndex": "0x7", + "removed": false + }, + { + "address": "0x48e18E3d1eFA7F0E15F1b2Bf01b232534c30a3EF", + "topics": [ + "0xcf2aa50876cdfbb541206f89af0ee78d44a2abf8d328e37fa4917f982149848a" + ], + "data": "0x00000000000000000000000000000000000000000000000007e321af0bc01ed400000000000000000000000000000000000000000000000000000000c0a170f8", + "blockHash": "0x75dc10b02430f6ab2e7a19748dea56351e6b1a705d8f75142477f491b250ebae", + "blockNumber": "0x5b2880f", + "transactionHash": "0x0d1fbde82bd92ed22f1cd21788c5b734f7caa8b3523b0dba63cb65c1fd2cca4f", + "transactionIndex": "0x0", + "logIndex": "0x8", + "removed": false + }, + { + "address": "0x48e18E3d1eFA7F0E15F1b2Bf01b232534c30a3EF", + "topics": [ + "0xd78ad95fa46c994b6551d0da85fc275fe613ce37657fb8d5e3d130840159d822", + "0x000000000000000000000000a132dab612db5cb9fc9ac426a0cc215a3423f9c9", + "0x000000000000000000000000f0694acc9e941b176e17b9ef923e71e7b8b2477a" + ], + "data": "0x000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000186a000000000000000000000000000000000000000000000000000002ff6128b10960000000000000000000000000000000000000000000000000000000000000000", + "blockHash": "0x75dc10b02430f6ab2e7a19748dea56351e6b1a705d8f75142477f491b250ebae", + "blockNumber": "0x5b2880f", + "transactionHash": "0x0d1fbde82bd92ed22f1cd21788c5b734f7caa8b3523b0dba63cb65c1fd2cca4f", + "transactionIndex": "0x0", + "logIndex": "0x9", + "removed": false + }, + { + "address": "0x6fd9d7AD17242c41f7131d257212c54A0e816691", + "topics": [ + "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef", + "0x000000000000000000000000ad4c666fc170b468b19988959eb931a3676f0e9f", + "0x0000000000000000000000001111111254eeb25477b68fb85ed929f73a960582" + ], + "data": "0x000000000000000000000000000000000000000000000000004038818da9a205", + "blockHash": "0x75dc10b02430f6ab2e7a19748dea56351e6b1a705d8f75142477f491b250ebae", + "blockNumber": "0x5b2880f", + "transactionHash": "0x0d1fbde82bd92ed22f1cd21788c5b734f7caa8b3523b0dba63cb65c1fd2cca4f", + "transactionIndex": "0x0", + "logIndex": "0xa", + "removed": false + }, + { + "address": "0x4200000000000000000000000000000000000006", + "topics": [ + "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef", + "0x000000000000000000000000f0694acc9e941b176e17b9ef923e71e7b8b2477a", + "0x000000000000000000000000ad4c666fc170b468b19988959eb931a3676f0e9f" + ], + "data": "0x00000000000000000000000000000000000000000000000000002ff6128b1096", + "blockHash": "0x75dc10b02430f6ab2e7a19748dea56351e6b1a705d8f75142477f491b250ebae", + "blockNumber": "0x5b2880f", + "transactionHash": "0x0d1fbde82bd92ed22f1cd21788c5b734f7caa8b3523b0dba63cb65c1fd2cca4f", + "transactionIndex": "0x0", + "logIndex": "0xb", + "removed": false + }, + { + "address": "0xAD4c666fC170B468B19988959eb931a3676f0e9F", + "topics": [ + "0xc42079f94a6350d7e6235f29174924f928cc2ac818eb64fed8004e115fbcca67", + "0x000000000000000000000000f0694acc9e941b176e17b9ef923e71e7b8b2477a", + "0x0000000000000000000000001111111254eeb25477b68fb85ed929f73a960582" + ], + "data": "0x00000000000000000000000000000000000000000000000000002ff6128b1096ffffffffffffffffffffffffffffffffffffffffffffffffffbfc77e72565dfb00000000000000000000000000000000000000128ad641fa7eee7279f2ce0f01000000000000000000000000000000000000000000000014da5c0b160a447bb8000000000000000000000000000000000000000000000000000000000000e424", + "blockHash": "0x75dc10b02430f6ab2e7a19748dea56351e6b1a705d8f75142477f491b250ebae", + "blockNumber": "0x5b2880f", + "transactionHash": "0x0d1fbde82bd92ed22f1cd21788c5b734f7caa8b3523b0dba63cb65c1fd2cca4f", + "transactionIndex": "0x0", + "logIndex": "0xc", + "removed": false + }, + { + "address": "0x6fd9d7AD17242c41f7131d257212c54A0e816691", + "topics": [ + "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef", + "0x0000000000000000000000001111111254eeb25477b68fb85ed929f73a960582", + "0x000000000000000000000000eac5f0d4a9a45e1f9fdd0e7e2882e9f60e301156" + ], + "data": "0x000000000000000000000000000000000000000000000000004038818da9a205", + "blockHash": "0x75dc10b02430f6ab2e7a19748dea56351e6b1a705d8f75142477f491b250ebae", + "blockNumber": "0x5b2880f", + "transactionHash": "0x0d1fbde82bd92ed22f1cd21788c5b734f7caa8b3523b0dba63cb65c1fd2cca4f", + "transactionIndex": "0x0", + "logIndex": "0xd", + "removed": false + } + ], + "status": "0x1", + "logsBloom": "0x00200000000000000000008000080000000000000000000000440000000000000004000000000000000000500000000000000040008020000010000000200000000200000000080800000008000000200020000000000000000000101000000000000000000400000008000000000000010000000000000000000010000800000000000000000000000002000000000000001000002000000000004040000000020000000000000000000000080204010000000000000000000000000000000000000002000000000000000400000000000000800000020020080000000400000010004000000000000400000020011000810000000010000000100000010000" + }, + { + "transactionHash": "0xe7bfb6d05f570a42721bb6168e20a3d23bd38bcdd9d14b19740af210f2382b13", + "transactionIndex": "0x0", + "blockHash": "0x8285656676e8f3a63a32f65fb6f729bd19bfc37a6da2ae05bed156d7088994fc", + "blockNumber": "0x5b28822", + "from": "0xEAC5F0d4A9a45E1f9FdD0e7e2882e9f60E301156", + "to": "0xB17cCEE669aB2cc40A6564DA84Db66dD8D144CB4", + "cumulativeGasUsed": "0x4a2c7", + "gasUsed": "0x4a2c7", + "contractAddress": null, + "logs": [ + { + "address": "0x7F5c764cBc14f9669B88837ca1490cCa17c31607", + "topics": [ + "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef", + "0x000000000000000000000000eac5f0d4a9a45e1f9fdd0e7e2882e9f60e301156", + "0x000000000000000000000000b17ccee669ab2cc40a6564da84db66dd8d144cb4" + ], + "data": "0x00000000000000000000000000000000000000000000000000000000000186a0", + "blockHash": "0x8285656676e8f3a63a32f65fb6f729bd19bfc37a6da2ae05bed156d7088994fc", + "blockNumber": "0x5b28822", + "transactionHash": "0xe7bfb6d05f570a42721bb6168e20a3d23bd38bcdd9d14b19740af210f2382b13", + "transactionIndex": "0x0", + "logIndex": "0x0", + "removed": false + }, + { + "address": "0x7F5c764cBc14f9669B88837ca1490cCa17c31607", + "topics": [ + "0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925", + "0x000000000000000000000000eac5f0d4a9a45e1f9fdd0e7e2882e9f60e301156", + "0x000000000000000000000000b17ccee669ab2cc40a6564da84db66dd8d144cb4" + ], + "data": "0x0000000000000000000000000000000000000000000000000000000000000000", + "blockHash": "0x8285656676e8f3a63a32f65fb6f729bd19bfc37a6da2ae05bed156d7088994fc", + "blockNumber": "0x5b28822", + "transactionHash": "0xe7bfb6d05f570a42721bb6168e20a3d23bd38bcdd9d14b19740af210f2382b13", + "transactionIndex": "0x0", + "logIndex": "0x1", + "removed": false + }, + { + "address": "0x7F5c764cBc14f9669B88837ca1490cCa17c31607", + "topics": [ + "0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925", + "0x000000000000000000000000b17ccee669ab2cc40a6564da84db66dd8d144cb4", + "0x0000000000000000000000001111111254eeb25477b68fb85ed929f73a960582" + ], + "data": "0x00000000000000000000000000000000000000000000000000000000000186a0", + "blockHash": "0x8285656676e8f3a63a32f65fb6f729bd19bfc37a6da2ae05bed156d7088994fc", + "blockNumber": "0x5b28822", + "transactionHash": "0xe7bfb6d05f570a42721bb6168e20a3d23bd38bcdd9d14b19740af210f2382b13", + "transactionIndex": "0x0", + "logIndex": "0x2", + "removed": false + }, + { + "address": "0x7F5c764cBc14f9669B88837ca1490cCa17c31607", + "topics": [ + "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef", + "0x000000000000000000000000b17ccee669ab2cc40a6564da84db66dd8d144cb4", + "0x000000000000000000000000f0694acc9e941b176e17b9ef923e71e7b8b2477a" + ], + "data": "0x00000000000000000000000000000000000000000000000000000000000186a0", + "blockHash": "0x8285656676e8f3a63a32f65fb6f729bd19bfc37a6da2ae05bed156d7088994fc", + "blockNumber": "0x5b28822", + "transactionHash": "0xe7bfb6d05f570a42721bb6168e20a3d23bd38bcdd9d14b19740af210f2382b13", + "transactionIndex": "0x0", + "logIndex": "0x3", + "removed": false + }, + { + "address": "0x7F5c764cBc14f9669B88837ca1490cCa17c31607", + "topics": [ + "0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925", + "0x000000000000000000000000b17ccee669ab2cc40a6564da84db66dd8d144cb4", + "0x0000000000000000000000001111111254eeb25477b68fb85ed929f73a960582" + ], + "data": "0x0000000000000000000000000000000000000000000000000000000000000000", + "blockHash": "0x8285656676e8f3a63a32f65fb6f729bd19bfc37a6da2ae05bed156d7088994fc", + "blockNumber": "0x5b28822", + "transactionHash": "0xe7bfb6d05f570a42721bb6168e20a3d23bd38bcdd9d14b19740af210f2382b13", + "transactionIndex": "0x0", + "logIndex": "0x4", + "removed": false + }, + { + "address": "0x7F5c764cBc14f9669B88837ca1490cCa17c31607", + "topics": [ + "0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925", + "0x000000000000000000000000f0694acc9e941b176e17b9ef923e71e7b8b2477a", + "0x000000000000000000000000a132dab612db5cb9fc9ac426a0cc215a3423f9c9" + ], + "data": "0x00000000000000000000000000000000000000000000000000000000000186a0", + "blockHash": "0x8285656676e8f3a63a32f65fb6f729bd19bfc37a6da2ae05bed156d7088994fc", + "blockNumber": "0x5b28822", + "transactionHash": "0xe7bfb6d05f570a42721bb6168e20a3d23bd38bcdd9d14b19740af210f2382b13", + "transactionIndex": "0x0", + "logIndex": "0x5", + "removed": false + }, + { + "address": "0x7F5c764cBc14f9669B88837ca1490cCa17c31607", + "topics": [ + "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef", + "0x000000000000000000000000f0694acc9e941b176e17b9ef923e71e7b8b2477a", + "0x00000000000000000000000048e18e3d1efa7f0e15f1b2bf01b232534c30a3ef" + ], + "data": "0x00000000000000000000000000000000000000000000000000000000000186a0", + "blockHash": "0x8285656676e8f3a63a32f65fb6f729bd19bfc37a6da2ae05bed156d7088994fc", + "blockNumber": "0x5b28822", + "transactionHash": "0xe7bfb6d05f570a42721bb6168e20a3d23bd38bcdd9d14b19740af210f2382b13", + "transactionIndex": "0x0", + "logIndex": "0x6", + "removed": false + }, + { + "address": "0x7F5c764cBc14f9669B88837ca1490cCa17c31607", + "topics": [ + "0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925", + "0x000000000000000000000000f0694acc9e941b176e17b9ef923e71e7b8b2477a", + "0x000000000000000000000000a132dab612db5cb9fc9ac426a0cc215a3423f9c9" + ], + "data": "0x0000000000000000000000000000000000000000000000000000000000000000", + "blockHash": "0x8285656676e8f3a63a32f65fb6f729bd19bfc37a6da2ae05bed156d7088994fc", + "blockNumber": "0x5b28822", + "transactionHash": "0xe7bfb6d05f570a42721bb6168e20a3d23bd38bcdd9d14b19740af210f2382b13", + "transactionIndex": "0x0", + "logIndex": "0x7", + "removed": false + }, + { + "address": "0x4200000000000000000000000000000000000006", + "topics": [ + "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef", + "0x00000000000000000000000048e18e3d1efa7f0e15f1b2bf01b232534c30a3ef", + "0x000000000000000000000000f0694acc9e941b176e17b9ef923e71e7b8b2477a" + ], + "data": "0x00000000000000000000000000000000000000000000000000002ff48dbaf1bd", + "blockHash": "0x8285656676e8f3a63a32f65fb6f729bd19bfc37a6da2ae05bed156d7088994fc", + "blockNumber": "0x5b28822", + "transactionHash": "0xe7bfb6d05f570a42721bb6168e20a3d23bd38bcdd9d14b19740af210f2382b13", + "transactionIndex": "0x0", + "logIndex": "0x8", + "removed": false + }, + { + "address": "0x7F5c764cBc14f9669B88837ca1490cCa17c31607", + "topics": [ + "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef", + "0x00000000000000000000000048e18e3d1efa7f0e15f1b2bf01b232534c30a3ef", + "0x000000000000000000000000d5b6cfc309fd839fb33b826d8501ec90e6d9f45c" + ], + "data": "0x0000000000000000000000000000000000000000000000000000000000000032", + "blockHash": "0x8285656676e8f3a63a32f65fb6f729bd19bfc37a6da2ae05bed156d7088994fc", + "blockNumber": "0x5b28822", + "transactionHash": "0xe7bfb6d05f570a42721bb6168e20a3d23bd38bcdd9d14b19740af210f2382b13", + "transactionIndex": "0x0", + "logIndex": "0x9", + "removed": false + }, + { + "address": "0x48e18E3d1eFA7F0E15F1b2Bf01b232534c30a3EF", + "topics": [ + "0x112c256902bf554b6ed882d2936687aaeb4225e8cd5b51303c90ca6cf43a8602", + "0x000000000000000000000000a132dab612db5cb9fc9ac426a0cc215a3423f9c9" + ], + "data": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000032", + "blockHash": "0x8285656676e8f3a63a32f65fb6f729bd19bfc37a6da2ae05bed156d7088994fc", + "blockNumber": "0x5b28822", + "transactionHash": "0xe7bfb6d05f570a42721bb6168e20a3d23bd38bcdd9d14b19740af210f2382b13", + "transactionIndex": "0x0", + "logIndex": "0xa", + "removed": false + }, + { + "address": "0x48e18E3d1eFA7F0E15F1b2Bf01b232534c30a3EF", + "topics": [ + "0xcf2aa50876cdfbb541206f89af0ee78d44a2abf8d328e37fa4917f982149848a" + ], + "data": "0x00000000000000000000000000000000000000000000000007e2f1ba7e052d1700000000000000000000000000000000000000000000000000000000c0a2f766", + "blockHash": "0x8285656676e8f3a63a32f65fb6f729bd19bfc37a6da2ae05bed156d7088994fc", + "blockNumber": "0x5b28822", + "transactionHash": "0xe7bfb6d05f570a42721bb6168e20a3d23bd38bcdd9d14b19740af210f2382b13", + "transactionIndex": "0x0", + "logIndex": "0xb", + "removed": false + }, + { + "address": "0x48e18E3d1eFA7F0E15F1b2Bf01b232534c30a3EF", + "topics": [ + "0xd78ad95fa46c994b6551d0da85fc275fe613ce37657fb8d5e3d130840159d822", + "0x000000000000000000000000a132dab612db5cb9fc9ac426a0cc215a3423f9c9", + "0x000000000000000000000000f0694acc9e941b176e17b9ef923e71e7b8b2477a" + ], + "data": "0x000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000186a000000000000000000000000000000000000000000000000000002ff48dbaf1bd0000000000000000000000000000000000000000000000000000000000000000", + "blockHash": "0x8285656676e8f3a63a32f65fb6f729bd19bfc37a6da2ae05bed156d7088994fc", + "blockNumber": "0x5b28822", + "transactionHash": "0xe7bfb6d05f570a42721bb6168e20a3d23bd38bcdd9d14b19740af210f2382b13", + "transactionIndex": "0x0", + "logIndex": "0xc", + "removed": false + }, + { + "address": "0x6fd9d7AD17242c41f7131d257212c54A0e816691", + "topics": [ + "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef", + "0x000000000000000000000000ad4c666fc170b468b19988959eb931a3676f0e9f", + "0x0000000000000000000000001111111254eeb25477b68fb85ed929f73a960582" + ], + "data": "0x0000000000000000000000000000000000000000000000000040366399484adb", + "blockHash": "0x8285656676e8f3a63a32f65fb6f729bd19bfc37a6da2ae05bed156d7088994fc", + "blockNumber": "0x5b28822", + "transactionHash": "0xe7bfb6d05f570a42721bb6168e20a3d23bd38bcdd9d14b19740af210f2382b13", + "transactionIndex": "0x0", + "logIndex": "0xd", + "removed": false + }, + { + "address": "0x4200000000000000000000000000000000000006", + "topics": [ + "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef", + "0x000000000000000000000000f0694acc9e941b176e17b9ef923e71e7b8b2477a", + "0x000000000000000000000000ad4c666fc170b468b19988959eb931a3676f0e9f" + ], + "data": "0x00000000000000000000000000000000000000000000000000002ff48dbaf1bd", + "blockHash": "0x8285656676e8f3a63a32f65fb6f729bd19bfc37a6da2ae05bed156d7088994fc", + "blockNumber": "0x5b28822", + "transactionHash": "0xe7bfb6d05f570a42721bb6168e20a3d23bd38bcdd9d14b19740af210f2382b13", + "transactionIndex": "0x0", + "logIndex": "0xe", + "removed": false + }, + { + "address": "0xAD4c666fC170B468B19988959eb931a3676f0e9F", + "topics": [ + "0xc42079f94a6350d7e6235f29174924f928cc2ac818eb64fed8004e115fbcca67", + "0x000000000000000000000000f0694acc9e941b176e17b9ef923e71e7b8b2477a", + "0x0000000000000000000000001111111254eeb25477b68fb85ed929f73a960582" + ], + "data": "0x00000000000000000000000000000000000000000000000000002ff48dbaf1bdffffffffffffffffffffffffffffffffffffffffffffffffffbfc99c66b7b52500000000000000000000000000000000000000128ad32dadc13af14735933691000000000000000000000000000000000000000000000014da5c0b160a447bb8000000000000000000000000000000000000000000000000000000000000e423", + "blockHash": "0x8285656676e8f3a63a32f65fb6f729bd19bfc37a6da2ae05bed156d7088994fc", + "blockNumber": "0x5b28822", + "transactionHash": "0xe7bfb6d05f570a42721bb6168e20a3d23bd38bcdd9d14b19740af210f2382b13", + "transactionIndex": "0x0", + "logIndex": "0xf", + "removed": false + }, + { + "address": "0x6fd9d7AD17242c41f7131d257212c54A0e816691", + "topics": [ + "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef", + "0x0000000000000000000000001111111254eeb25477b68fb85ed929f73a960582", + "0x000000000000000000000000eac5f0d4a9a45e1f9fdd0e7e2882e9f60e301156" + ], + "data": "0x0000000000000000000000000000000000000000000000000040366399484adb", + "blockHash": "0x8285656676e8f3a63a32f65fb6f729bd19bfc37a6da2ae05bed156d7088994fc", + "blockNumber": "0x5b28822", + "transactionHash": "0xe7bfb6d05f570a42721bb6168e20a3d23bd38bcdd9d14b19740af210f2382b13", + "transactionIndex": "0x0", + "logIndex": "0x10", + "removed": false + } + ], + "status": "0x1", + "logsBloom": "0x00200000000000000000008000080000000000000000000000440000000000000004000000000000000040500000000000000040008020000010000000200000000200000000080800800008000000200020000000000000000000101000000000000000000400000008000000000000010000000000000000000010000800000000000000000000000002000000000200001000002000000000004040000000020000000000000000000000080204010000000000000000000000000000000000000002000000000000000400000000000000800000020020080000000400000010004000000000000400000020011000810000000010000000100000010000" + }, + { + "transactionHash": "0x71f79f21650241187d3e637351677f73d2fee7591f2600ecc768226d7d9a3178", + "transactionIndex": "0x0", + "blockHash": "0x6c97deaa4f5ba68fb7a4f9bb0b3cdc9a09c3a49b65c76915e63f0becbd6f1cfb", + "blockNumber": "0x5b2882e", + "from": "0xEAC5F0d4A9a45E1f9FdD0e7e2882e9f60E301156", + "to": "0x7F5c764cBc14f9669B88837ca1490cCa17c31607", + "cumulativeGasUsed": "0xcf3f", + "gasUsed": "0xcf3f", + "contractAddress": null, + "logs": [ + { + "address": "0x7F5c764cBc14f9669B88837ca1490cCa17c31607", + "topics": [ + "0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925", + "0x000000000000000000000000eac5f0d4a9a45e1f9fdd0e7e2882e9f60e301156", + "0x000000000000000000000000444a406c15e6f87aee894999cb13b4ff1d61a85b" + ], + "data": "0x00000000000000000000000000000000000000000000000000000000000186a0", + "blockHash": "0x6c97deaa4f5ba68fb7a4f9bb0b3cdc9a09c3a49b65c76915e63f0becbd6f1cfb", + "blockNumber": "0x5b2882e", + "transactionHash": "0x71f79f21650241187d3e637351677f73d2fee7591f2600ecc768226d7d9a3178", + "transactionIndex": "0x0", + "logIndex": "0x0", + "removed": false + } + ], + "status": "0x1", + "logsBloom": "0x00000000000000000000008000000000000000000000000000000000000000000000000000000000000000000000000000000040000000000000000000200000000000000000000000000000000000000000000001000008000000100000000000000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000040000000020000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000800000000000000000000000010000" + }, + { + "transactionHash": "0x179019d502a67838533b07634ad619d39514b55a10599b250f80c5cb219ab04e", + "transactionIndex": "0x0", + "blockHash": "0x57eb61011139e2d87ffb3b6d29e7bac69e17919330e0d928403ddcc9b6b59261", + "blockNumber": "0x5b28839", + "from": "0xEAC5F0d4A9a45E1f9FdD0e7e2882e9f60E301156", + "to": "0x7F5c764cBc14f9669B88837ca1490cCa17c31607", + "cumulativeGasUsed": "0x8183", + "gasUsed": "0x8183", + "contractAddress": null, + "logs": [ + { + "address": "0x7F5c764cBc14f9669B88837ca1490cCa17c31607", + "topics": [ + "0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925", + "0x000000000000000000000000eac5f0d4a9a45e1f9fdd0e7e2882e9f60e301156", + "0x0000000000000000000000001111111254760f7ab3f16433eea9304126dcd199" + ], + "data": "0x00000000000000000000000000000000000000000000000000000000000186a0", + "blockHash": "0x57eb61011139e2d87ffb3b6d29e7bac69e17919330e0d928403ddcc9b6b59261", + "blockNumber": "0x5b28839", + "transactionHash": "0x179019d502a67838533b07634ad619d39514b55a10599b250f80c5cb219ab04e", + "transactionIndex": "0x0", + "logIndex": "0x0", + "removed": false + } + ], + "status": "0x1", + "logsBloom": "0x00000000000000000000008000000000000000000000000000000000000000000000000000000000000000000000000000000040000000000000400000200000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000040000000020000000000000200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000800000080000000000000000010000" + }, + { + "transactionHash": "0x5445be7f53975a21d639f41e3e607903bc47ab5f1c87c2005c657dbf0efafe48", + "transactionIndex": "0x0", + "blockHash": "0xde962d5313c54e9a1490d0f1cf82130a7fedcb011b11b3c8dac57ed0405b544f", + "blockNumber": "0x5b28846", + "from": "0xEAC5F0d4A9a45E1f9FdD0e7e2882e9f60E301156", + "to": "0x1111111254760F7ab3F16433eea9304126DCd199", + "cumulativeGasUsed": "0x2fb70", + "gasUsed": "0x2fb70", + "contractAddress": null, + "logs": [ + { + "address": "0x7F5c764cBc14f9669B88837ca1490cCa17c31607", + "topics": [ + "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef", + "0x000000000000000000000000eac5f0d4a9a45e1f9fdd0e7e2882e9f60e301156", + "0x000000000000000000000000f0694acc9e941b176e17b9ef923e71e7b8b2477a" + ], + "data": "0x00000000000000000000000000000000000000000000000000000000000186a0", + "blockHash": "0xde962d5313c54e9a1490d0f1cf82130a7fedcb011b11b3c8dac57ed0405b544f", + "blockNumber": "0x5b28846", + "transactionHash": "0x5445be7f53975a21d639f41e3e607903bc47ab5f1c87c2005c657dbf0efafe48", + "transactionIndex": "0x0", + "logIndex": "0x0", + "removed": false + }, + { + "address": "0x7F5c764cBc14f9669B88837ca1490cCa17c31607", + "topics": [ + "0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925", + "0x000000000000000000000000eac5f0d4a9a45e1f9fdd0e7e2882e9f60e301156", + "0x0000000000000000000000001111111254760f7ab3f16433eea9304126dcd199" + ], + "data": "0x0000000000000000000000000000000000000000000000000000000000000000", + "blockHash": "0xde962d5313c54e9a1490d0f1cf82130a7fedcb011b11b3c8dac57ed0405b544f", + "blockNumber": "0x5b28846", + "transactionHash": "0x5445be7f53975a21d639f41e3e607903bc47ab5f1c87c2005c657dbf0efafe48", + "transactionIndex": "0x0", + "logIndex": "0x1", + "removed": false + }, + { + "address": "0x4200000000000000000000000000000000000006", + "topics": [ + "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef", + "0x000000000000000000000000f9d5940c2313636546ab9852354860dce275dbad", + "0x000000000000000000000000f0694acc9e941b176e17b9ef923e71e7b8b2477a" + ], + "data": "0x00000000000000000000000000000000000000000000000000002ff8d9b2edfd", + "blockHash": "0xde962d5313c54e9a1490d0f1cf82130a7fedcb011b11b3c8dac57ed0405b544f", + "blockNumber": "0x5b28846", + "transactionHash": "0x5445be7f53975a21d639f41e3e607903bc47ab5f1c87c2005c657dbf0efafe48", + "transactionIndex": "0x0", + "logIndex": "0x2", + "removed": false + }, + { + "address": "0x7F5c764cBc14f9669B88837ca1490cCa17c31607", + "topics": [ + "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef", + "0x000000000000000000000000f0694acc9e941b176e17b9ef923e71e7b8b2477a", + "0x000000000000000000000000f9d5940c2313636546ab9852354860dce275dbad" + ], + "data": "0x00000000000000000000000000000000000000000000000000000000000186a0", + "blockHash": "0xde962d5313c54e9a1490d0f1cf82130a7fedcb011b11b3c8dac57ed0405b544f", + "blockNumber": "0x5b28846", + "transactionHash": "0x5445be7f53975a21d639f41e3e607903bc47ab5f1c87c2005c657dbf0efafe48", + "transactionIndex": "0x0", + "logIndex": "0x3", + "removed": false + }, + { + "address": "0xf9D5940c2313636546Ab9852354860dCE275DBaD", + "topics": [ + "0xc42079f94a6350d7e6235f29174924f928cc2ac818eb64fed8004e115fbcca67", + "0x000000000000000000000000f0694acc9e941b176e17b9ef923e71e7b8b2477a", + "0x000000000000000000000000f0694acc9e941b176e17b9ef923e71e7b8b2477a" + ], + "data": "0xffffffffffffffffffffffffffffffffffffffffffffffffffffd007264d120300000000000000000000000000000000000000000000000000000000000186a000000000000000000000000000000000000000000002da5e92e5b4199d8c66740000000000000000000000000000000000000000000000000000775b02e74881fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffcef6e", + "blockHash": "0xde962d5313c54e9a1490d0f1cf82130a7fedcb011b11b3c8dac57ed0405b544f", + "blockNumber": "0x5b28846", + "transactionHash": "0x5445be7f53975a21d639f41e3e607903bc47ab5f1c87c2005c657dbf0efafe48", + "transactionIndex": "0x0", + "logIndex": "0x4", + "removed": false + }, + { + "address": "0x6fd9d7AD17242c41f7131d257212c54A0e816691", + "topics": [ + "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef", + "0x000000000000000000000000ad4c666fc170b468b19988959eb931a3676f0e9f", + "0x0000000000000000000000001111111254760f7ab3f16433eea9304126dcd199" + ], + "data": "0x00000000000000000000000000000000000000000000000000403c0f203947a1", + "blockHash": "0xde962d5313c54e9a1490d0f1cf82130a7fedcb011b11b3c8dac57ed0405b544f", + "blockNumber": "0x5b28846", + "transactionHash": "0x5445be7f53975a21d639f41e3e607903bc47ab5f1c87c2005c657dbf0efafe48", + "transactionIndex": "0x0", + "logIndex": "0x5", + "removed": false + }, + { + "address": "0x4200000000000000000000000000000000000006", + "topics": [ + "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef", + "0x000000000000000000000000f0694acc9e941b176e17b9ef923e71e7b8b2477a", + "0x000000000000000000000000ad4c666fc170b468b19988959eb931a3676f0e9f" + ], + "data": "0x00000000000000000000000000000000000000000000000000002ff8d9b2edfd", + "blockHash": "0xde962d5313c54e9a1490d0f1cf82130a7fedcb011b11b3c8dac57ed0405b544f", + "blockNumber": "0x5b28846", + "transactionHash": "0x5445be7f53975a21d639f41e3e607903bc47ab5f1c87c2005c657dbf0efafe48", + "transactionIndex": "0x0", + "logIndex": "0x6", + "removed": false + }, + { + "address": "0xAD4c666fC170B468B19988959eb931a3676f0e9F", + "topics": [ + "0xc42079f94a6350d7e6235f29174924f928cc2ac818eb64fed8004e115fbcca67", + "0x000000000000000000000000f0694acc9e941b176e17b9ef923e71e7b8b2477a", + "0x0000000000000000000000001111111254760f7ab3f16433eea9304126dcd199" + ], + "data": "0x00000000000000000000000000000000000000000000000000002ff8d9b2edfdffffffffffffffffffffffffffffffffffffffffffffffffffbfc3f0dfc6b85f00000000000000000000000000000000000000128ad0191b67f5111972c2a4fd000000000000000000000000000000000000000000000014da5c0b160a447bb8000000000000000000000000000000000000000000000000000000000000e423", + "blockHash": "0xde962d5313c54e9a1490d0f1cf82130a7fedcb011b11b3c8dac57ed0405b544f", + "blockNumber": "0x5b28846", + "transactionHash": "0x5445be7f53975a21d639f41e3e607903bc47ab5f1c87c2005c657dbf0efafe48", + "transactionIndex": "0x0", + "logIndex": "0x7", + "removed": false + }, + { + "address": "0x6fd9d7AD17242c41f7131d257212c54A0e816691", + "topics": [ + "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef", + "0x0000000000000000000000001111111254760f7ab3f16433eea9304126dcd199", + "0x000000000000000000000000eac5f0d4a9a45e1f9fdd0e7e2882e9f60e301156" + ], + "data": "0x00000000000000000000000000000000000000000000000000403c0f203947a1", + "blockHash": "0xde962d5313c54e9a1490d0f1cf82130a7fedcb011b11b3c8dac57ed0405b544f", + "blockNumber": "0x5b28846", + "transactionHash": "0x5445be7f53975a21d639f41e3e607903bc47ab5f1c87c2005c657dbf0efafe48", + "transactionIndex": "0x0", + "logIndex": "0x8", + "removed": false + } + ], + "status": "0x1", + "logsBloom": "0x00000000000000000000008000080000000000008000000000440000000000000000000000000000000000100000000000000040008020000000400000200000000200000000000800000008000000000000000000000000000000101000000000000000000000000008000000000000000000000000000000000010000810000000000000000000000000000000000000000020002000000000000040000000020100000000000200000000000200000000000000000000000000000000000000000002000000000000000000000000000000800000000000000000000400000090004000000000000008000000001000800000080010000000000000010000" + }, + { + "transactionHash": "0x0d8dc46ad33862e3379182916a1539b58385d98e309f72b63179c594ca783ad0", + "transactionIndex": "0x0", + "blockHash": "0x6d3d3e03ea03bda1127f71bd4c31444568c19e1a65ce6c0f7a9024308a4814d6", + "blockNumber": "0x5b28853", + "from": "0xEAC5F0d4A9a45E1f9FdD0e7e2882e9f60E301156", + "to": "0x444A406C15e6F87Aee894999cb13B4ff1D61a85B", + "cumulativeGasUsed": "0x350dd", + "gasUsed": "0x350dd", + "contractAddress": null, + "logs": [ + { + "address": "0x7F5c764cBc14f9669B88837ca1490cCa17c31607", + "topics": [ + "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef", + "0x000000000000000000000000eac5f0d4a9a45e1f9fdd0e7e2882e9f60e301156", + "0x000000000000000000000000444a406c15e6f87aee894999cb13b4ff1d61a85b" + ], + "data": "0x00000000000000000000000000000000000000000000000000000000000186a0", + "blockHash": "0x6d3d3e03ea03bda1127f71bd4c31444568c19e1a65ce6c0f7a9024308a4814d6", + "blockNumber": "0x5b28853", + "transactionHash": "0x0d8dc46ad33862e3379182916a1539b58385d98e309f72b63179c594ca783ad0", + "transactionIndex": "0x0", + "logIndex": "0x0", + "removed": false + }, + { + "address": "0x7F5c764cBc14f9669B88837ca1490cCa17c31607", + "topics": [ + "0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925", + "0x000000000000000000000000eac5f0d4a9a45e1f9fdd0e7e2882e9f60e301156", + "0x000000000000000000000000444a406c15e6f87aee894999cb13b4ff1d61a85b" + ], + "data": "0x0000000000000000000000000000000000000000000000000000000000000000", + "blockHash": "0x6d3d3e03ea03bda1127f71bd4c31444568c19e1a65ce6c0f7a9024308a4814d6", + "blockNumber": "0x5b28853", + "transactionHash": "0x0d8dc46ad33862e3379182916a1539b58385d98e309f72b63179c594ca783ad0", + "transactionIndex": "0x0", + "logIndex": "0x1", + "removed": false + }, + { + "address": "0x7F5c764cBc14f9669B88837ca1490cCa17c31607", + "topics": [ + "0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925", + "0x000000000000000000000000444a406c15e6f87aee894999cb13b4ff1d61a85b", + "0x0000000000000000000000001111111254760f7ab3f16433eea9304126dcd199" + ], + "data": "0x00000000000000000000000000000000000000000000000000000000000186a0", + "blockHash": "0x6d3d3e03ea03bda1127f71bd4c31444568c19e1a65ce6c0f7a9024308a4814d6", + "blockNumber": "0x5b28853", + "transactionHash": "0x0d8dc46ad33862e3379182916a1539b58385d98e309f72b63179c594ca783ad0", + "transactionIndex": "0x0", + "logIndex": "0x2", + "removed": false + }, + { + "address": "0x7F5c764cBc14f9669B88837ca1490cCa17c31607", + "topics": [ + "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef", + "0x000000000000000000000000444a406c15e6f87aee894999cb13b4ff1d61a85b", + "0x000000000000000000000000f0694acc9e941b176e17b9ef923e71e7b8b2477a" + ], + "data": "0x00000000000000000000000000000000000000000000000000000000000186a0", + "blockHash": "0x6d3d3e03ea03bda1127f71bd4c31444568c19e1a65ce6c0f7a9024308a4814d6", + "blockNumber": "0x5b28853", + "transactionHash": "0x0d8dc46ad33862e3379182916a1539b58385d98e309f72b63179c594ca783ad0", + "transactionIndex": "0x0", + "logIndex": "0x3", + "removed": false + }, + { + "address": "0x7F5c764cBc14f9669B88837ca1490cCa17c31607", + "topics": [ + "0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925", + "0x000000000000000000000000444a406c15e6f87aee894999cb13b4ff1d61a85b", + "0x0000000000000000000000001111111254760f7ab3f16433eea9304126dcd199" + ], + "data": "0x0000000000000000000000000000000000000000000000000000000000000000", + "blockHash": "0x6d3d3e03ea03bda1127f71bd4c31444568c19e1a65ce6c0f7a9024308a4814d6", + "blockNumber": "0x5b28853", + "transactionHash": "0x0d8dc46ad33862e3379182916a1539b58385d98e309f72b63179c594ca783ad0", + "transactionIndex": "0x0", + "logIndex": "0x4", + "removed": false + }, + { + "address": "0x4200000000000000000000000000000000000006", + "topics": [ + "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef", + "0x000000000000000000000000f9d5940c2313636546ab9852354860dce275dbad", + "0x000000000000000000000000f0694acc9e941b176e17b9ef923e71e7b8b2477a" + ], + "data": "0x00000000000000000000000000000000000000000000000000002ff86e060a93", + "blockHash": "0x6d3d3e03ea03bda1127f71bd4c31444568c19e1a65ce6c0f7a9024308a4814d6", + "blockNumber": "0x5b28853", + "transactionHash": "0x0d8dc46ad33862e3379182916a1539b58385d98e309f72b63179c594ca783ad0", + "transactionIndex": "0x0", + "logIndex": "0x5", + "removed": false + }, + { + "address": "0x7F5c764cBc14f9669B88837ca1490cCa17c31607", + "topics": [ + "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef", + "0x000000000000000000000000f0694acc9e941b176e17b9ef923e71e7b8b2477a", + "0x000000000000000000000000f9d5940c2313636546ab9852354860dce275dbad" + ], + "data": "0x00000000000000000000000000000000000000000000000000000000000186a0", + "blockHash": "0x6d3d3e03ea03bda1127f71bd4c31444568c19e1a65ce6c0f7a9024308a4814d6", + "blockNumber": "0x5b28853", + "transactionHash": "0x0d8dc46ad33862e3379182916a1539b58385d98e309f72b63179c594ca783ad0", + "transactionIndex": "0x0", + "logIndex": "0x6", + "removed": false + }, + { + "address": "0xf9D5940c2313636546Ab9852354860dCE275DBaD", + "topics": [ + "0xc42079f94a6350d7e6235f29174924f928cc2ac818eb64fed8004e115fbcca67", + "0x000000000000000000000000f0694acc9e941b176e17b9ef923e71e7b8b2477a", + "0x000000000000000000000000f0694acc9e941b176e17b9ef923e71e7b8b2477a" + ], + "data": "0xffffffffffffffffffffffffffffffffffffffffffffffffffffd00791f9f56d00000000000000000000000000000000000000000000000000000000000186a000000000000000000000000000000000000000000002da61c695cf08e951b8590000000000000000000000000000000000000000000000000000775b02e74881fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffcef6e", + "blockHash": "0x6d3d3e03ea03bda1127f71bd4c31444568c19e1a65ce6c0f7a9024308a4814d6", + "blockNumber": "0x5b28853", + "transactionHash": "0x0d8dc46ad33862e3379182916a1539b58385d98e309f72b63179c594ca783ad0", + "transactionIndex": "0x0", + "logIndex": "0x7", + "removed": false + }, + { + "address": "0x6fd9d7AD17242c41f7131d257212c54A0e816691", + "topics": [ + "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef", + "0x000000000000000000000000ad4c666fc170b468b19988959eb931a3676f0e9f", + "0x0000000000000000000000001111111254760f7ab3f16433eea9304126dcd199" + ], + "data": "0x00000000000000000000000000000000000000000000000000403b699b8e50db", + "blockHash": "0x6d3d3e03ea03bda1127f71bd4c31444568c19e1a65ce6c0f7a9024308a4814d6", + "blockNumber": "0x5b28853", + "transactionHash": "0x0d8dc46ad33862e3379182916a1539b58385d98e309f72b63179c594ca783ad0", + "transactionIndex": "0x0", + "logIndex": "0x8", + "removed": false + }, + { + "address": "0x4200000000000000000000000000000000000006", + "topics": [ + "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef", + "0x000000000000000000000000f0694acc9e941b176e17b9ef923e71e7b8b2477a", + "0x000000000000000000000000ad4c666fc170b468b19988959eb931a3676f0e9f" + ], + "data": "0x00000000000000000000000000000000000000000000000000002ff86e060a93", + "blockHash": "0x6d3d3e03ea03bda1127f71bd4c31444568c19e1a65ce6c0f7a9024308a4814d6", + "blockNumber": "0x5b28853", + "transactionHash": "0x0d8dc46ad33862e3379182916a1539b58385d98e309f72b63179c594ca783ad0", + "transactionIndex": "0x0", + "logIndex": "0x9", + "removed": false + }, + { + "address": "0xAD4c666fC170B468B19988959eb931a3676f0e9F", + "topics": [ + "0xc42079f94a6350d7e6235f29174924f928cc2ac818eb64fed8004e115fbcca67", + "0x000000000000000000000000f0694acc9e941b176e17b9ef923e71e7b8b2477a", + "0x0000000000000000000000001111111254760f7ab3f16433eea9304126dcd199" + ], + "data": "0x00000000000000000000000000000000000000000000000000002ff86e060a93ffffffffffffffffffffffffffffffffffffffffffffffffffbfc4966471af2500000000000000000000000000000000000000128acd0490fea84da8de9e7ce5000000000000000000000000000000000000000000000014da5c0b160a447bb8000000000000000000000000000000000000000000000000000000000000e423", + "blockHash": "0x6d3d3e03ea03bda1127f71bd4c31444568c19e1a65ce6c0f7a9024308a4814d6", + "blockNumber": "0x5b28853", + "transactionHash": "0x0d8dc46ad33862e3379182916a1539b58385d98e309f72b63179c594ca783ad0", + "transactionIndex": "0x0", + "logIndex": "0xa", + "removed": false + }, + { + "address": "0x6fd9d7AD17242c41f7131d257212c54A0e816691", + "topics": [ + "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef", + "0x0000000000000000000000001111111254760f7ab3f16433eea9304126dcd199", + "0x000000000000000000000000eac5f0d4a9a45e1f9fdd0e7e2882e9f60e301156" + ], + "data": "0x00000000000000000000000000000000000000000000000000403b699b8e50db", + "blockHash": "0x6d3d3e03ea03bda1127f71bd4c31444568c19e1a65ce6c0f7a9024308a4814d6", + "blockNumber": "0x5b28853", + "transactionHash": "0x0d8dc46ad33862e3379182916a1539b58385d98e309f72b63179c594ca783ad0", + "transactionIndex": "0x0", + "logIndex": "0xb", + "removed": false + } + ], + "status": "0x1", + "logsBloom": "0x00000000000000000000008000080000000000008000000000440000000000000000000000000000000000100000000000000040008020000000400000200000000200000000000800000008000000000000000001000008000000101000000000000000000000000008000000000000000000000000000000000010000810040000000000000000000000000000000000000020002000000000000040000000020100000000000200000000000200000000000000000000000000000000000000000002000000000000000000000000000000800000000000000000000400000090004000000000000008000000001000800000080010000000000000010000" + } + ], + "libraries": [], + "pending": [], + "path": "", + "returns": {}, + "timestamp": 1682891249, + "chain": 10, + "multi": false, + "commit": "580f0ba" +} diff --git a/broadcast/Benchmark.s.sol/10/run-latest.json b/broadcast/Benchmark.s.sol/10/run-latest.json new file mode 100644 index 0000000..5934876 --- /dev/null +++ b/broadcast/Benchmark.s.sol/10/run-latest.json @@ -0,0 +1,1128 @@ +{ + "transactions": [ + { + "hash": "0x348866c854cc363d7aa16f63f8dbc467180c9b42f49d0601760e883e9f34c75b", + "transactionType": "CALL", + "contractName": null, + "contractAddress": "0x7F5c764cBc14f9669B88837ca1490cCa17c31607", + "function": null, + "arguments": null, + "rpc": "", + "transaction": { + "type": "0x00", + "from": "0xeac5f0d4a9a45e1f9fdd0e7e2882e9f60e301156", + "to": "0x7f5c764cbc14f9669b88837ca1490cca17c31607", + "gas": "0x11e41", + "value": "0x0", + "data": "0x095ea7b3000000000000000000000000b17ccee669ab2cc40a6564da84db66dd8d144cb400000000000000000000000000000000000000000000000000000000000186a0", + "nonce": "0x1f" + }, + "additionalContracts": [], + "isFixedGasLimit": false + }, + { + "hash": "0x922fbc3c0c94e49f79c5bd2483f9d2be8644150654bc6b6b677f4debe097c6f7", + "transactionType": "CALL", + "contractName": null, + "contractAddress": "0x7F5c764cBc14f9669B88837ca1490cCa17c31607", + "function": null, + "arguments": null, + "rpc": "", + "transaction": { + "type": "0x00", + "from": "0xeac5f0d4a9a45e1f9fdd0e7e2882e9f60e301156", + "to": "0x7f5c764cbc14f9669b88837ca1490cca17c31607", + "gas": "0xbd68", + "value": "0x0", + "data": "0x095ea7b30000000000000000000000001111111254eeb25477b68fb85ed929f73a96058200000000000000000000000000000000000000000000000000000000000186a0", + "nonce": "0x20" + }, + "additionalContracts": [], + "isFixedGasLimit": false + }, + { + "hash": "0x0d1fbde82bd92ed22f1cd21788c5b734f7caa8b3523b0dba63cb65c1fd2cca4f", + "transactionType": "CALL", + "contractName": null, + "contractAddress": "0x1111111254EEB25477B68fb85Ed929f73A960582", + "function": null, + "arguments": null, + "rpc": "", + "transaction": { + "type": "0x00", + "from": "0xeac5f0d4a9a45e1f9fdd0e7e2882e9f60e301156", + "to": "0x1111111254eeb25477b68fb85ed929f73a960582", + "gas": "0x67bb8", + "value": "0x0", + "data": "0x12aa3caf000000000000000000000000f0694acc9e941b176e17b9ef923e71e7b8b2477a0000000000000000000000007f5c764cbc14f9669b88837ca1490cca17c316070000000000000000000000006fd9d7ad17242c41f7131d257212c54a0e816691000000000000000000000000f0694acc9e941b176e17b9ef923e71e7b8b2477a000000000000000000000000eac5f0d4a9a45e1f9fdd0e7e2882e9f60e30115600000000000000000000000000000000000000000000000000000000000186a0000000000000000000000000000000000000000000000000003e530a0ee30f45000000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000001400000000000000000000000000000000000000000000000000000000000000160000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001f50000000000000000000000000000000000000000000000000000000001d700a007e5c0d20000000000000000000000000000000000000000000000000001b30001505126a132dab612db5cb9fc9ac426a0cc215a3423f9c97f5c764cbc14f9669b88837ca1490cca17c316070004f41766d8000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002e2669c6242f00000000000000000000000000000000000000000000000000000000000000a0000000000000000000000000f0694acc9e941b176e17b9ef923e71e7b8b2477a00000000000000000000000000000000000000000000000000000000644fdfe900000000000000000000000000000000000000000000000000000000000000010000000000000000000000007f5c764cbc14f9669b88837ca1490cca17c316070000000000000000000000004200000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000102a0000000000000000000000000000000000000000000000000003e530a0ee30f45ee63c1e581ad4c666fc170b468b19988959eb931a3676f0e9f42000000000000000000000000000000000000061111111254eeb25477b68fb85ed929f73a9605820000000000000000000000", + "nonce": "0x21" + }, + "additionalContracts": [], + "isFixedGasLimit": false + }, + { + "hash": "0xe7bfb6d05f570a42721bb6168e20a3d23bd38bcdd9d14b19740af210f2382b13", + "transactionType": "CALL", + "contractName": null, + "contractAddress": "0xB17cCEE669aB2cc40A6564DA84Db66dD8D144CB4", + "function": null, + "arguments": null, + "rpc": "", + "transaction": { + "type": "0x00", + "from": "0xeac5f0d4a9a45e1f9fdd0e7e2882e9f60e301156", + "to": "0xb17ccee669ab2cc40a6564da84db66dd8d144cb4", + "gas": "0x68a35", + "value": "0x0", + "data": "0x0000000000000000000000006fd9d7ad17242c41f7131d257212c54a0e81669100000000000000000000000000000000000000000000000000000000000186a0000000000000000000000000000000000000000000000000003e530a0ee30f4500000000000000000000000000000000000000000000000000000000000000a0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001f50000000000000000000000000000000000000000000000000000000001d700a007e5c0d20000000000000000000000000000000000000000000000000001b30001505126a132dab612db5cb9fc9ac426a0cc215a3423f9c97f5c764cbc14f9669b88837ca1490cca17c316070004f41766d8000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002e2669c6242f00000000000000000000000000000000000000000000000000000000000000a0000000000000000000000000f0694acc9e941b176e17b9ef923e71e7b8b2477a00000000000000000000000000000000000000000000000000000000644fdfe900000000000000000000000000000000000000000000000000000000000000010000000000000000000000007f5c764cbc14f9669b88837ca1490cca17c316070000000000000000000000004200000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000102a0000000000000000000000000000000000000000000000000003e530a0ee30f45ee63c1e581ad4c666fc170b468b19988959eb931a3676f0e9f42000000000000000000000000000000000000061111111254eeb25477b68fb85ed929f73a9605820000000000000000000000", + "nonce": "0x22" + }, + "additionalContracts": [], + "isFixedGasLimit": false + }, + { + "hash": "0x71f79f21650241187d3e637351677f73d2fee7591f2600ecc768226d7d9a3178", + "transactionType": "CALL", + "contractName": null, + "contractAddress": "0x7F5c764cBc14f9669B88837ca1490cCa17c31607", + "function": null, + "arguments": null, + "rpc": "", + "transaction": { + "type": "0x00", + "from": "0xeac5f0d4a9a45e1f9fdd0e7e2882e9f60e301156", + "to": "0x7f5c764cbc14f9669b88837ca1490cca17c31607", + "gas": "0x11e41", + "value": "0x0", + "data": "0x095ea7b3000000000000000000000000444a406c15e6f87aee894999cb13b4ff1d61a85b00000000000000000000000000000000000000000000000000000000000186a0", + "nonce": "0x23" + }, + "additionalContracts": [], + "isFixedGasLimit": false + }, + { + "hash": "0x179019d502a67838533b07634ad619d39514b55a10599b250f80c5cb219ab04e", + "transactionType": "CALL", + "contractName": null, + "contractAddress": "0x7F5c764cBc14f9669B88837ca1490cCa17c31607", + "function": null, + "arguments": null, + "rpc": "", + "transaction": { + "type": "0x00", + "from": "0xeac5f0d4a9a45e1f9fdd0e7e2882e9f60e301156", + "to": "0x7f5c764cbc14f9669b88837ca1490cca17c31607", + "gas": "0xbd68", + "value": "0x0", + "data": "0x095ea7b30000000000000000000000001111111254760f7ab3f16433eea9304126dcd19900000000000000000000000000000000000000000000000000000000000186a0", + "nonce": "0x24" + }, + "additionalContracts": [], + "isFixedGasLimit": false + }, + { + "hash": "0x5445be7f53975a21d639f41e3e607903bc47ab5f1c87c2005c657dbf0efafe48", + "transactionType": "CALL", + "contractName": null, + "contractAddress": "0x1111111254760F7ab3F16433eea9304126DCd199", + "function": null, + "arguments": null, + "rpc": "", + "transaction": { + "type": "0x00", + "from": "0xeac5f0d4a9a45e1f9fdd0e7e2882e9f60e301156", + "to": "0x1111111254760f7ab3f16433eea9304126dcd199", + "gas": "0x41e7f", + "value": "0x0", + "data": "0x7c025200000000000000000000000000f0694acc9e941b176e17b9ef923e71e7b8b2477a000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000001800000000000000000000000007f5c764cbc14f9669b88837ca1490cca17c316070000000000000000000000006fd9d7ad17242c41f7131d257212c54a0e816691000000000000000000000000f0694acc9e941b176e17b9ef923e71e7b8b2477a000000000000000000000000eac5f0d4a9a45e1f9fdd0e7e2882e9f60e30115600000000000000000000000000000000000000000000000000000000000186a0000000000000000000000000000000000000000000000000003e1aba8fed6bc100000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001e10000000000000000000000000000000000000000000000000000000001a300a007e5c0d200000000000000000000000000000000000000000000000000017f00011c4330f9d5940c2313636546ab9852354860dce275dbad00000000000000000000000000000000000000000000000000002ecaf7212e2f002424b31a0c000000000000000000000000f0694acc9e941b176e17b9ef923e71e7b8b2477a00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000fffd8963efd1fc6a506488495d951d5263988d2500000000000000000000000000000000000000000000000000000000000000a000000000000000000000000000000000000000000000000000000000000000200000000000000000000000007f5c764cbc14f9669b88837ca1490cca17c3160702a0000000000000000000000000000000000000000000000000003e1aba8fed6bc1ee63c1e581ad4c666fc170b468b19988959eb931a3676f0e9f42000000000000000000000000000000000000061111111254760f7ab3f16433eea9304126dcd19900000000000000000000000000000000000000000000000000000000000186a000000000000000000000000000000000000000000000000000000000000000", + "nonce": "0x25" + }, + "additionalContracts": [], + "isFixedGasLimit": false + }, + { + "hash": "0x0d8dc46ad33862e3379182916a1539b58385d98e309f72b63179c594ca783ad0", + "transactionType": "CALL", + "contractName": null, + "contractAddress": "0x444A406C15e6F87Aee894999cb13B4ff1D61a85B", + "function": null, + "arguments": null, + "rpc": "", + "transaction": { + "type": "0x00", + "from": "0xeac5f0d4a9a45e1f9fdd0e7e2882e9f60e301156", + "to": "0x444a406c15e6f87aee894999cb13b4ff1d61a85b", + "gas": "0x4d893", + "value": "0x0", + "data": "0x0000000000000000000000006fd9d7ad17242c41f7131d257212c54a0e81669100000000000000000000000000000000000000000000000000000000000186a0000000000000000000000000000000000000000000000000003e1aba8fed6bc100000000000000000000000000000000000000000000000000000000000000a0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001e10000000000000000000000000000000000000000000000000000000001a300a007e5c0d200000000000000000000000000000000000000000000000000017f00011c4330f9d5940c2313636546ab9852354860dce275dbad00000000000000000000000000000000000000000000000000002ecaf7212e2f002424b31a0c000000000000000000000000f0694acc9e941b176e17b9ef923e71e7b8b2477a00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000fffd8963efd1fc6a506488495d951d5263988d2500000000000000000000000000000000000000000000000000000000000000a000000000000000000000000000000000000000000000000000000000000000200000000000000000000000007f5c764cbc14f9669b88837ca1490cca17c3160702a0000000000000000000000000000000000000000000000000003e1aba8fed6bc1ee63c1e581ad4c666fc170b468b19988959eb931a3676f0e9f42000000000000000000000000000000000000061111111254760f7ab3f16433eea9304126dcd19900000000000000000000000000000000000000000000000000000000000186a000000000000000000000000000000000000000000000000000000000000000", + "nonce": "0x26" + }, + "additionalContracts": [], + "isFixedGasLimit": false + } + ], + "receipts": [ + { + "transactionHash": "0x348866c854cc363d7aa16f63f8dbc467180c9b42f49d0601760e883e9f34c75b", + "transactionIndex": "0x0", + "blockHash": "0x9a259c5bfb1e00100a957619cbe9e496e05a3f84ea5a705ed9743237c49058e7", + "blockNumber": "0x5b287f3", + "from": "0xEAC5F0d4A9a45E1f9FdD0e7e2882e9f60E301156", + "to": "0x7F5c764cBc14f9669B88837ca1490cCa17c31607", + "cumulativeGasUsed": "0xcf3f", + "gasUsed": "0xcf3f", + "contractAddress": null, + "logs": [ + { + "address": "0x7F5c764cBc14f9669B88837ca1490cCa17c31607", + "topics": [ + "0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925", + "0x000000000000000000000000eac5f0d4a9a45e1f9fdd0e7e2882e9f60e301156", + "0x000000000000000000000000b17ccee669ab2cc40a6564da84db66dd8d144cb4" + ], + "data": "0x00000000000000000000000000000000000000000000000000000000000186a0", + "blockHash": "0x9a259c5bfb1e00100a957619cbe9e496e05a3f84ea5a705ed9743237c49058e7", + "blockNumber": "0x5b287f3", + "transactionHash": "0x348866c854cc363d7aa16f63f8dbc467180c9b42f49d0601760e883e9f34c75b", + "transactionIndex": "0x0", + "logIndex": "0x0", + "removed": false + } + ], + "status": "0x1", + "logsBloom": "0x00000000000000000000008000000000000000000000000000000000000000000000000000000000000040000000000000000040000000000000000000200000000000000000000000800000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000200000000000000000000000040000000020000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000800000000000000000000000010000" + }, + { + "transactionHash": "0x922fbc3c0c94e49f79c5bd2483f9d2be8644150654bc6b6b677f4debe097c6f7", + "transactionIndex": "0x0", + "blockHash": "0xe1ecbe29525ebdfe584d37b4d8930c701264f1ff8b15669d75ee919f6c76fad7", + "blockNumber": "0x5b287ff", + "from": "0xEAC5F0d4A9a45E1f9FdD0e7e2882e9f60E301156", + "to": "0x7F5c764cBc14f9669B88837ca1490cCa17c31607", + "cumulativeGasUsed": "0x8183", + "gasUsed": "0x8183", + "contractAddress": null, + "logs": [ + { + "address": "0x7F5c764cBc14f9669B88837ca1490cCa17c31607", + "topics": [ + "0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925", + "0x000000000000000000000000eac5f0d4a9a45e1f9fdd0e7e2882e9f60e301156", + "0x0000000000000000000000001111111254eeb25477b68fb85ed929f73a960582" + ], + "data": "0x00000000000000000000000000000000000000000000000000000000000186a0", + "blockHash": "0xe1ecbe29525ebdfe584d37b4d8930c701264f1ff8b15669d75ee919f6c76fad7", + "blockNumber": "0x5b287ff", + "transactionHash": "0x922fbc3c0c94e49f79c5bd2483f9d2be8644150654bc6b6b677f4debe097c6f7", + "transactionIndex": "0x0", + "logIndex": "0x0", + "removed": false + } + ], + "status": "0x1", + "logsBloom": "0x00000000000000000000008000000000000000000000000000000000000000000000000000000000000000000000000000000040000000000000000000200000000000000000080000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000040000000020000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010000000000000000400000000000000800000000000000000000000010000" + }, + { + "transactionHash": "0x0d1fbde82bd92ed22f1cd21788c5b734f7caa8b3523b0dba63cb65c1fd2cca4f", + "transactionIndex": "0x0", + "blockHash": "0x75dc10b02430f6ab2e7a19748dea56351e6b1a705d8f75142477f491b250ebae", + "blockNumber": "0x5b2880f", + "from": "0xEAC5F0d4A9a45E1f9FdD0e7e2882e9f60E301156", + "to": "0x1111111254EEB25477B68fb85Ed929f73A960582", + "cumulativeGasUsed": "0x46eda", + "gasUsed": "0x46eda", + "contractAddress": null, + "logs": [ + { + "address": "0x7F5c764cBc14f9669B88837ca1490cCa17c31607", + "topics": [ + "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef", + "0x000000000000000000000000eac5f0d4a9a45e1f9fdd0e7e2882e9f60e301156", + "0x000000000000000000000000f0694acc9e941b176e17b9ef923e71e7b8b2477a" + ], + "data": "0x00000000000000000000000000000000000000000000000000000000000186a0", + "blockHash": "0x75dc10b02430f6ab2e7a19748dea56351e6b1a705d8f75142477f491b250ebae", + "blockNumber": "0x5b2880f", + "transactionHash": "0x0d1fbde82bd92ed22f1cd21788c5b734f7caa8b3523b0dba63cb65c1fd2cca4f", + "transactionIndex": "0x0", + "logIndex": "0x0", + "removed": false + }, + { + "address": "0x7F5c764cBc14f9669B88837ca1490cCa17c31607", + "topics": [ + "0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925", + "0x000000000000000000000000eac5f0d4a9a45e1f9fdd0e7e2882e9f60e301156", + "0x0000000000000000000000001111111254eeb25477b68fb85ed929f73a960582" + ], + "data": "0x0000000000000000000000000000000000000000000000000000000000000000", + "blockHash": "0x75dc10b02430f6ab2e7a19748dea56351e6b1a705d8f75142477f491b250ebae", + "blockNumber": "0x5b2880f", + "transactionHash": "0x0d1fbde82bd92ed22f1cd21788c5b734f7caa8b3523b0dba63cb65c1fd2cca4f", + "transactionIndex": "0x0", + "logIndex": "0x1", + "removed": false + }, + { + "address": "0x7F5c764cBc14f9669B88837ca1490cCa17c31607", + "topics": [ + "0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925", + "0x000000000000000000000000f0694acc9e941b176e17b9ef923e71e7b8b2477a", + "0x000000000000000000000000a132dab612db5cb9fc9ac426a0cc215a3423f9c9" + ], + "data": "0x00000000000000000000000000000000000000000000000000000000000186a0", + "blockHash": "0x75dc10b02430f6ab2e7a19748dea56351e6b1a705d8f75142477f491b250ebae", + "blockNumber": "0x5b2880f", + "transactionHash": "0x0d1fbde82bd92ed22f1cd21788c5b734f7caa8b3523b0dba63cb65c1fd2cca4f", + "transactionIndex": "0x0", + "logIndex": "0x2", + "removed": false + }, + { + "address": "0x7F5c764cBc14f9669B88837ca1490cCa17c31607", + "topics": [ + "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef", + "0x000000000000000000000000f0694acc9e941b176e17b9ef923e71e7b8b2477a", + "0x00000000000000000000000048e18e3d1efa7f0e15f1b2bf01b232534c30a3ef" + ], + "data": "0x00000000000000000000000000000000000000000000000000000000000186a0", + "blockHash": "0x75dc10b02430f6ab2e7a19748dea56351e6b1a705d8f75142477f491b250ebae", + "blockNumber": "0x5b2880f", + "transactionHash": "0x0d1fbde82bd92ed22f1cd21788c5b734f7caa8b3523b0dba63cb65c1fd2cca4f", + "transactionIndex": "0x0", + "logIndex": "0x3", + "removed": false + }, + { + "address": "0x7F5c764cBc14f9669B88837ca1490cCa17c31607", + "topics": [ + "0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925", + "0x000000000000000000000000f0694acc9e941b176e17b9ef923e71e7b8b2477a", + "0x000000000000000000000000a132dab612db5cb9fc9ac426a0cc215a3423f9c9" + ], + "data": "0x0000000000000000000000000000000000000000000000000000000000000000", + "blockHash": "0x75dc10b02430f6ab2e7a19748dea56351e6b1a705d8f75142477f491b250ebae", + "blockNumber": "0x5b2880f", + "transactionHash": "0x0d1fbde82bd92ed22f1cd21788c5b734f7caa8b3523b0dba63cb65c1fd2cca4f", + "transactionIndex": "0x0", + "logIndex": "0x4", + "removed": false + }, + { + "address": "0x4200000000000000000000000000000000000006", + "topics": [ + "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef", + "0x00000000000000000000000048e18e3d1efa7f0e15f1b2bf01b232534c30a3ef", + "0x000000000000000000000000f0694acc9e941b176e17b9ef923e71e7b8b2477a" + ], + "data": "0x00000000000000000000000000000000000000000000000000002ff6128b1096", + "blockHash": "0x75dc10b02430f6ab2e7a19748dea56351e6b1a705d8f75142477f491b250ebae", + "blockNumber": "0x5b2880f", + "transactionHash": "0x0d1fbde82bd92ed22f1cd21788c5b734f7caa8b3523b0dba63cb65c1fd2cca4f", + "transactionIndex": "0x0", + "logIndex": "0x5", + "removed": false + }, + { + "address": "0x7F5c764cBc14f9669B88837ca1490cCa17c31607", + "topics": [ + "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef", + "0x00000000000000000000000048e18e3d1efa7f0e15f1b2bf01b232534c30a3ef", + "0x000000000000000000000000d5b6cfc309fd839fb33b826d8501ec90e6d9f45c" + ], + "data": "0x0000000000000000000000000000000000000000000000000000000000000032", + "blockHash": "0x75dc10b02430f6ab2e7a19748dea56351e6b1a705d8f75142477f491b250ebae", + "blockNumber": "0x5b2880f", + "transactionHash": "0x0d1fbde82bd92ed22f1cd21788c5b734f7caa8b3523b0dba63cb65c1fd2cca4f", + "transactionIndex": "0x0", + "logIndex": "0x6", + "removed": false + }, + { + "address": "0x48e18E3d1eFA7F0E15F1b2Bf01b232534c30a3EF", + "topics": [ + "0x112c256902bf554b6ed882d2936687aaeb4225e8cd5b51303c90ca6cf43a8602", + "0x000000000000000000000000a132dab612db5cb9fc9ac426a0cc215a3423f9c9" + ], + "data": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000032", + "blockHash": "0x75dc10b02430f6ab2e7a19748dea56351e6b1a705d8f75142477f491b250ebae", + "blockNumber": "0x5b2880f", + "transactionHash": "0x0d1fbde82bd92ed22f1cd21788c5b734f7caa8b3523b0dba63cb65c1fd2cca4f", + "transactionIndex": "0x0", + "logIndex": "0x7", + "removed": false + }, + { + "address": "0x48e18E3d1eFA7F0E15F1b2Bf01b232534c30a3EF", + "topics": [ + "0xcf2aa50876cdfbb541206f89af0ee78d44a2abf8d328e37fa4917f982149848a" + ], + "data": "0x00000000000000000000000000000000000000000000000007e321af0bc01ed400000000000000000000000000000000000000000000000000000000c0a170f8", + "blockHash": "0x75dc10b02430f6ab2e7a19748dea56351e6b1a705d8f75142477f491b250ebae", + "blockNumber": "0x5b2880f", + "transactionHash": "0x0d1fbde82bd92ed22f1cd21788c5b734f7caa8b3523b0dba63cb65c1fd2cca4f", + "transactionIndex": "0x0", + "logIndex": "0x8", + "removed": false + }, + { + "address": "0x48e18E3d1eFA7F0E15F1b2Bf01b232534c30a3EF", + "topics": [ + "0xd78ad95fa46c994b6551d0da85fc275fe613ce37657fb8d5e3d130840159d822", + "0x000000000000000000000000a132dab612db5cb9fc9ac426a0cc215a3423f9c9", + "0x000000000000000000000000f0694acc9e941b176e17b9ef923e71e7b8b2477a" + ], + "data": "0x000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000186a000000000000000000000000000000000000000000000000000002ff6128b10960000000000000000000000000000000000000000000000000000000000000000", + "blockHash": "0x75dc10b02430f6ab2e7a19748dea56351e6b1a705d8f75142477f491b250ebae", + "blockNumber": "0x5b2880f", + "transactionHash": "0x0d1fbde82bd92ed22f1cd21788c5b734f7caa8b3523b0dba63cb65c1fd2cca4f", + "transactionIndex": "0x0", + "logIndex": "0x9", + "removed": false + }, + { + "address": "0x6fd9d7AD17242c41f7131d257212c54A0e816691", + "topics": [ + "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef", + "0x000000000000000000000000ad4c666fc170b468b19988959eb931a3676f0e9f", + "0x0000000000000000000000001111111254eeb25477b68fb85ed929f73a960582" + ], + "data": "0x000000000000000000000000000000000000000000000000004038818da9a205", + "blockHash": "0x75dc10b02430f6ab2e7a19748dea56351e6b1a705d8f75142477f491b250ebae", + "blockNumber": "0x5b2880f", + "transactionHash": "0x0d1fbde82bd92ed22f1cd21788c5b734f7caa8b3523b0dba63cb65c1fd2cca4f", + "transactionIndex": "0x0", + "logIndex": "0xa", + "removed": false + }, + { + "address": "0x4200000000000000000000000000000000000006", + "topics": [ + "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef", + "0x000000000000000000000000f0694acc9e941b176e17b9ef923e71e7b8b2477a", + "0x000000000000000000000000ad4c666fc170b468b19988959eb931a3676f0e9f" + ], + "data": "0x00000000000000000000000000000000000000000000000000002ff6128b1096", + "blockHash": "0x75dc10b02430f6ab2e7a19748dea56351e6b1a705d8f75142477f491b250ebae", + "blockNumber": "0x5b2880f", + "transactionHash": "0x0d1fbde82bd92ed22f1cd21788c5b734f7caa8b3523b0dba63cb65c1fd2cca4f", + "transactionIndex": "0x0", + "logIndex": "0xb", + "removed": false + }, + { + "address": "0xAD4c666fC170B468B19988959eb931a3676f0e9F", + "topics": [ + "0xc42079f94a6350d7e6235f29174924f928cc2ac818eb64fed8004e115fbcca67", + "0x000000000000000000000000f0694acc9e941b176e17b9ef923e71e7b8b2477a", + "0x0000000000000000000000001111111254eeb25477b68fb85ed929f73a960582" + ], + "data": "0x00000000000000000000000000000000000000000000000000002ff6128b1096ffffffffffffffffffffffffffffffffffffffffffffffffffbfc77e72565dfb00000000000000000000000000000000000000128ad641fa7eee7279f2ce0f01000000000000000000000000000000000000000000000014da5c0b160a447bb8000000000000000000000000000000000000000000000000000000000000e424", + "blockHash": "0x75dc10b02430f6ab2e7a19748dea56351e6b1a705d8f75142477f491b250ebae", + "blockNumber": "0x5b2880f", + "transactionHash": "0x0d1fbde82bd92ed22f1cd21788c5b734f7caa8b3523b0dba63cb65c1fd2cca4f", + "transactionIndex": "0x0", + "logIndex": "0xc", + "removed": false + }, + { + "address": "0x6fd9d7AD17242c41f7131d257212c54A0e816691", + "topics": [ + "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef", + "0x0000000000000000000000001111111254eeb25477b68fb85ed929f73a960582", + "0x000000000000000000000000eac5f0d4a9a45e1f9fdd0e7e2882e9f60e301156" + ], + "data": "0x000000000000000000000000000000000000000000000000004038818da9a205", + "blockHash": "0x75dc10b02430f6ab2e7a19748dea56351e6b1a705d8f75142477f491b250ebae", + "blockNumber": "0x5b2880f", + "transactionHash": "0x0d1fbde82bd92ed22f1cd21788c5b734f7caa8b3523b0dba63cb65c1fd2cca4f", + "transactionIndex": "0x0", + "logIndex": "0xd", + "removed": false + } + ], + "status": "0x1", + "logsBloom": "0x00200000000000000000008000080000000000000000000000440000000000000004000000000000000000500000000000000040008020000010000000200000000200000000080800000008000000200020000000000000000000101000000000000000000400000008000000000000010000000000000000000010000800000000000000000000000002000000000000001000002000000000004040000000020000000000000000000000080204010000000000000000000000000000000000000002000000000000000400000000000000800000020020080000000400000010004000000000000400000020011000810000000010000000100000010000" + }, + { + "transactionHash": "0xe7bfb6d05f570a42721bb6168e20a3d23bd38bcdd9d14b19740af210f2382b13", + "transactionIndex": "0x0", + "blockHash": "0x8285656676e8f3a63a32f65fb6f729bd19bfc37a6da2ae05bed156d7088994fc", + "blockNumber": "0x5b28822", + "from": "0xEAC5F0d4A9a45E1f9FdD0e7e2882e9f60E301156", + "to": "0xB17cCEE669aB2cc40A6564DA84Db66dD8D144CB4", + "cumulativeGasUsed": "0x4a2c7", + "gasUsed": "0x4a2c7", + "contractAddress": null, + "logs": [ + { + "address": "0x7F5c764cBc14f9669B88837ca1490cCa17c31607", + "topics": [ + "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef", + "0x000000000000000000000000eac5f0d4a9a45e1f9fdd0e7e2882e9f60e301156", + "0x000000000000000000000000b17ccee669ab2cc40a6564da84db66dd8d144cb4" + ], + "data": "0x00000000000000000000000000000000000000000000000000000000000186a0", + "blockHash": "0x8285656676e8f3a63a32f65fb6f729bd19bfc37a6da2ae05bed156d7088994fc", + "blockNumber": "0x5b28822", + "transactionHash": "0xe7bfb6d05f570a42721bb6168e20a3d23bd38bcdd9d14b19740af210f2382b13", + "transactionIndex": "0x0", + "logIndex": "0x0", + "removed": false + }, + { + "address": "0x7F5c764cBc14f9669B88837ca1490cCa17c31607", + "topics": [ + "0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925", + "0x000000000000000000000000eac5f0d4a9a45e1f9fdd0e7e2882e9f60e301156", + "0x000000000000000000000000b17ccee669ab2cc40a6564da84db66dd8d144cb4" + ], + "data": "0x0000000000000000000000000000000000000000000000000000000000000000", + "blockHash": "0x8285656676e8f3a63a32f65fb6f729bd19bfc37a6da2ae05bed156d7088994fc", + "blockNumber": "0x5b28822", + "transactionHash": "0xe7bfb6d05f570a42721bb6168e20a3d23bd38bcdd9d14b19740af210f2382b13", + "transactionIndex": "0x0", + "logIndex": "0x1", + "removed": false + }, + { + "address": "0x7F5c764cBc14f9669B88837ca1490cCa17c31607", + "topics": [ + "0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925", + "0x000000000000000000000000b17ccee669ab2cc40a6564da84db66dd8d144cb4", + "0x0000000000000000000000001111111254eeb25477b68fb85ed929f73a960582" + ], + "data": "0x00000000000000000000000000000000000000000000000000000000000186a0", + "blockHash": "0x8285656676e8f3a63a32f65fb6f729bd19bfc37a6da2ae05bed156d7088994fc", + "blockNumber": "0x5b28822", + "transactionHash": "0xe7bfb6d05f570a42721bb6168e20a3d23bd38bcdd9d14b19740af210f2382b13", + "transactionIndex": "0x0", + "logIndex": "0x2", + "removed": false + }, + { + "address": "0x7F5c764cBc14f9669B88837ca1490cCa17c31607", + "topics": [ + "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef", + "0x000000000000000000000000b17ccee669ab2cc40a6564da84db66dd8d144cb4", + "0x000000000000000000000000f0694acc9e941b176e17b9ef923e71e7b8b2477a" + ], + "data": "0x00000000000000000000000000000000000000000000000000000000000186a0", + "blockHash": "0x8285656676e8f3a63a32f65fb6f729bd19bfc37a6da2ae05bed156d7088994fc", + "blockNumber": "0x5b28822", + "transactionHash": "0xe7bfb6d05f570a42721bb6168e20a3d23bd38bcdd9d14b19740af210f2382b13", + "transactionIndex": "0x0", + "logIndex": "0x3", + "removed": false + }, + { + "address": "0x7F5c764cBc14f9669B88837ca1490cCa17c31607", + "topics": [ + "0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925", + "0x000000000000000000000000b17ccee669ab2cc40a6564da84db66dd8d144cb4", + "0x0000000000000000000000001111111254eeb25477b68fb85ed929f73a960582" + ], + "data": "0x0000000000000000000000000000000000000000000000000000000000000000", + "blockHash": "0x8285656676e8f3a63a32f65fb6f729bd19bfc37a6da2ae05bed156d7088994fc", + "blockNumber": "0x5b28822", + "transactionHash": "0xe7bfb6d05f570a42721bb6168e20a3d23bd38bcdd9d14b19740af210f2382b13", + "transactionIndex": "0x0", + "logIndex": "0x4", + "removed": false + }, + { + "address": "0x7F5c764cBc14f9669B88837ca1490cCa17c31607", + "topics": [ + "0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925", + "0x000000000000000000000000f0694acc9e941b176e17b9ef923e71e7b8b2477a", + "0x000000000000000000000000a132dab612db5cb9fc9ac426a0cc215a3423f9c9" + ], + "data": "0x00000000000000000000000000000000000000000000000000000000000186a0", + "blockHash": "0x8285656676e8f3a63a32f65fb6f729bd19bfc37a6da2ae05bed156d7088994fc", + "blockNumber": "0x5b28822", + "transactionHash": "0xe7bfb6d05f570a42721bb6168e20a3d23bd38bcdd9d14b19740af210f2382b13", + "transactionIndex": "0x0", + "logIndex": "0x5", + "removed": false + }, + { + "address": "0x7F5c764cBc14f9669B88837ca1490cCa17c31607", + "topics": [ + "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef", + "0x000000000000000000000000f0694acc9e941b176e17b9ef923e71e7b8b2477a", + "0x00000000000000000000000048e18e3d1efa7f0e15f1b2bf01b232534c30a3ef" + ], + "data": "0x00000000000000000000000000000000000000000000000000000000000186a0", + "blockHash": "0x8285656676e8f3a63a32f65fb6f729bd19bfc37a6da2ae05bed156d7088994fc", + "blockNumber": "0x5b28822", + "transactionHash": "0xe7bfb6d05f570a42721bb6168e20a3d23bd38bcdd9d14b19740af210f2382b13", + "transactionIndex": "0x0", + "logIndex": "0x6", + "removed": false + }, + { + "address": "0x7F5c764cBc14f9669B88837ca1490cCa17c31607", + "topics": [ + "0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925", + "0x000000000000000000000000f0694acc9e941b176e17b9ef923e71e7b8b2477a", + "0x000000000000000000000000a132dab612db5cb9fc9ac426a0cc215a3423f9c9" + ], + "data": "0x0000000000000000000000000000000000000000000000000000000000000000", + "blockHash": "0x8285656676e8f3a63a32f65fb6f729bd19bfc37a6da2ae05bed156d7088994fc", + "blockNumber": "0x5b28822", + "transactionHash": "0xe7bfb6d05f570a42721bb6168e20a3d23bd38bcdd9d14b19740af210f2382b13", + "transactionIndex": "0x0", + "logIndex": "0x7", + "removed": false + }, + { + "address": "0x4200000000000000000000000000000000000006", + "topics": [ + "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef", + "0x00000000000000000000000048e18e3d1efa7f0e15f1b2bf01b232534c30a3ef", + "0x000000000000000000000000f0694acc9e941b176e17b9ef923e71e7b8b2477a" + ], + "data": "0x00000000000000000000000000000000000000000000000000002ff48dbaf1bd", + "blockHash": "0x8285656676e8f3a63a32f65fb6f729bd19bfc37a6da2ae05bed156d7088994fc", + "blockNumber": "0x5b28822", + "transactionHash": "0xe7bfb6d05f570a42721bb6168e20a3d23bd38bcdd9d14b19740af210f2382b13", + "transactionIndex": "0x0", + "logIndex": "0x8", + "removed": false + }, + { + "address": "0x7F5c764cBc14f9669B88837ca1490cCa17c31607", + "topics": [ + "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef", + "0x00000000000000000000000048e18e3d1efa7f0e15f1b2bf01b232534c30a3ef", + "0x000000000000000000000000d5b6cfc309fd839fb33b826d8501ec90e6d9f45c" + ], + "data": "0x0000000000000000000000000000000000000000000000000000000000000032", + "blockHash": "0x8285656676e8f3a63a32f65fb6f729bd19bfc37a6da2ae05bed156d7088994fc", + "blockNumber": "0x5b28822", + "transactionHash": "0xe7bfb6d05f570a42721bb6168e20a3d23bd38bcdd9d14b19740af210f2382b13", + "transactionIndex": "0x0", + "logIndex": "0x9", + "removed": false + }, + { + "address": "0x48e18E3d1eFA7F0E15F1b2Bf01b232534c30a3EF", + "topics": [ + "0x112c256902bf554b6ed882d2936687aaeb4225e8cd5b51303c90ca6cf43a8602", + "0x000000000000000000000000a132dab612db5cb9fc9ac426a0cc215a3423f9c9" + ], + "data": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000032", + "blockHash": "0x8285656676e8f3a63a32f65fb6f729bd19bfc37a6da2ae05bed156d7088994fc", + "blockNumber": "0x5b28822", + "transactionHash": "0xe7bfb6d05f570a42721bb6168e20a3d23bd38bcdd9d14b19740af210f2382b13", + "transactionIndex": "0x0", + "logIndex": "0xa", + "removed": false + }, + { + "address": "0x48e18E3d1eFA7F0E15F1b2Bf01b232534c30a3EF", + "topics": [ + "0xcf2aa50876cdfbb541206f89af0ee78d44a2abf8d328e37fa4917f982149848a" + ], + "data": "0x00000000000000000000000000000000000000000000000007e2f1ba7e052d1700000000000000000000000000000000000000000000000000000000c0a2f766", + "blockHash": "0x8285656676e8f3a63a32f65fb6f729bd19bfc37a6da2ae05bed156d7088994fc", + "blockNumber": "0x5b28822", + "transactionHash": "0xe7bfb6d05f570a42721bb6168e20a3d23bd38bcdd9d14b19740af210f2382b13", + "transactionIndex": "0x0", + "logIndex": "0xb", + "removed": false + }, + { + "address": "0x48e18E3d1eFA7F0E15F1b2Bf01b232534c30a3EF", + "topics": [ + "0xd78ad95fa46c994b6551d0da85fc275fe613ce37657fb8d5e3d130840159d822", + "0x000000000000000000000000a132dab612db5cb9fc9ac426a0cc215a3423f9c9", + "0x000000000000000000000000f0694acc9e941b176e17b9ef923e71e7b8b2477a" + ], + "data": "0x000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000186a000000000000000000000000000000000000000000000000000002ff48dbaf1bd0000000000000000000000000000000000000000000000000000000000000000", + "blockHash": "0x8285656676e8f3a63a32f65fb6f729bd19bfc37a6da2ae05bed156d7088994fc", + "blockNumber": "0x5b28822", + "transactionHash": "0xe7bfb6d05f570a42721bb6168e20a3d23bd38bcdd9d14b19740af210f2382b13", + "transactionIndex": "0x0", + "logIndex": "0xc", + "removed": false + }, + { + "address": "0x6fd9d7AD17242c41f7131d257212c54A0e816691", + "topics": [ + "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef", + "0x000000000000000000000000ad4c666fc170b468b19988959eb931a3676f0e9f", + "0x0000000000000000000000001111111254eeb25477b68fb85ed929f73a960582" + ], + "data": "0x0000000000000000000000000000000000000000000000000040366399484adb", + "blockHash": "0x8285656676e8f3a63a32f65fb6f729bd19bfc37a6da2ae05bed156d7088994fc", + "blockNumber": "0x5b28822", + "transactionHash": "0xe7bfb6d05f570a42721bb6168e20a3d23bd38bcdd9d14b19740af210f2382b13", + "transactionIndex": "0x0", + "logIndex": "0xd", + "removed": false + }, + { + "address": "0x4200000000000000000000000000000000000006", + "topics": [ + "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef", + "0x000000000000000000000000f0694acc9e941b176e17b9ef923e71e7b8b2477a", + "0x000000000000000000000000ad4c666fc170b468b19988959eb931a3676f0e9f" + ], + "data": "0x00000000000000000000000000000000000000000000000000002ff48dbaf1bd", + "blockHash": "0x8285656676e8f3a63a32f65fb6f729bd19bfc37a6da2ae05bed156d7088994fc", + "blockNumber": "0x5b28822", + "transactionHash": "0xe7bfb6d05f570a42721bb6168e20a3d23bd38bcdd9d14b19740af210f2382b13", + "transactionIndex": "0x0", + "logIndex": "0xe", + "removed": false + }, + { + "address": "0xAD4c666fC170B468B19988959eb931a3676f0e9F", + "topics": [ + "0xc42079f94a6350d7e6235f29174924f928cc2ac818eb64fed8004e115fbcca67", + "0x000000000000000000000000f0694acc9e941b176e17b9ef923e71e7b8b2477a", + "0x0000000000000000000000001111111254eeb25477b68fb85ed929f73a960582" + ], + "data": "0x00000000000000000000000000000000000000000000000000002ff48dbaf1bdffffffffffffffffffffffffffffffffffffffffffffffffffbfc99c66b7b52500000000000000000000000000000000000000128ad32dadc13af14735933691000000000000000000000000000000000000000000000014da5c0b160a447bb8000000000000000000000000000000000000000000000000000000000000e423", + "blockHash": "0x8285656676e8f3a63a32f65fb6f729bd19bfc37a6da2ae05bed156d7088994fc", + "blockNumber": "0x5b28822", + "transactionHash": "0xe7bfb6d05f570a42721bb6168e20a3d23bd38bcdd9d14b19740af210f2382b13", + "transactionIndex": "0x0", + "logIndex": "0xf", + "removed": false + }, + { + "address": "0x6fd9d7AD17242c41f7131d257212c54A0e816691", + "topics": [ + "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef", + "0x0000000000000000000000001111111254eeb25477b68fb85ed929f73a960582", + "0x000000000000000000000000eac5f0d4a9a45e1f9fdd0e7e2882e9f60e301156" + ], + "data": "0x0000000000000000000000000000000000000000000000000040366399484adb", + "blockHash": "0x8285656676e8f3a63a32f65fb6f729bd19bfc37a6da2ae05bed156d7088994fc", + "blockNumber": "0x5b28822", + "transactionHash": "0xe7bfb6d05f570a42721bb6168e20a3d23bd38bcdd9d14b19740af210f2382b13", + "transactionIndex": "0x0", + "logIndex": "0x10", + "removed": false + } + ], + "status": "0x1", + "logsBloom": "0x00200000000000000000008000080000000000000000000000440000000000000004000000000000000040500000000000000040008020000010000000200000000200000000080800800008000000200020000000000000000000101000000000000000000400000008000000000000010000000000000000000010000800000000000000000000000002000000000200001000002000000000004040000000020000000000000000000000080204010000000000000000000000000000000000000002000000000000000400000000000000800000020020080000000400000010004000000000000400000020011000810000000010000000100000010000" + }, + { + "transactionHash": "0x71f79f21650241187d3e637351677f73d2fee7591f2600ecc768226d7d9a3178", + "transactionIndex": "0x0", + "blockHash": "0x6c97deaa4f5ba68fb7a4f9bb0b3cdc9a09c3a49b65c76915e63f0becbd6f1cfb", + "blockNumber": "0x5b2882e", + "from": "0xEAC5F0d4A9a45E1f9FdD0e7e2882e9f60E301156", + "to": "0x7F5c764cBc14f9669B88837ca1490cCa17c31607", + "cumulativeGasUsed": "0xcf3f", + "gasUsed": "0xcf3f", + "contractAddress": null, + "logs": [ + { + "address": "0x7F5c764cBc14f9669B88837ca1490cCa17c31607", + "topics": [ + "0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925", + "0x000000000000000000000000eac5f0d4a9a45e1f9fdd0e7e2882e9f60e301156", + "0x000000000000000000000000444a406c15e6f87aee894999cb13b4ff1d61a85b" + ], + "data": "0x00000000000000000000000000000000000000000000000000000000000186a0", + "blockHash": "0x6c97deaa4f5ba68fb7a4f9bb0b3cdc9a09c3a49b65c76915e63f0becbd6f1cfb", + "blockNumber": "0x5b2882e", + "transactionHash": "0x71f79f21650241187d3e637351677f73d2fee7591f2600ecc768226d7d9a3178", + "transactionIndex": "0x0", + "logIndex": "0x0", + "removed": false + } + ], + "status": "0x1", + "logsBloom": "0x00000000000000000000008000000000000000000000000000000000000000000000000000000000000000000000000000000040000000000000000000200000000000000000000000000000000000000000000001000008000000100000000000000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000040000000020000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000800000000000000000000000010000" + }, + { + "transactionHash": "0x179019d502a67838533b07634ad619d39514b55a10599b250f80c5cb219ab04e", + "transactionIndex": "0x0", + "blockHash": "0x57eb61011139e2d87ffb3b6d29e7bac69e17919330e0d928403ddcc9b6b59261", + "blockNumber": "0x5b28839", + "from": "0xEAC5F0d4A9a45E1f9FdD0e7e2882e9f60E301156", + "to": "0x7F5c764cBc14f9669B88837ca1490cCa17c31607", + "cumulativeGasUsed": "0x8183", + "gasUsed": "0x8183", + "contractAddress": null, + "logs": [ + { + "address": "0x7F5c764cBc14f9669B88837ca1490cCa17c31607", + "topics": [ + "0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925", + "0x000000000000000000000000eac5f0d4a9a45e1f9fdd0e7e2882e9f60e301156", + "0x0000000000000000000000001111111254760f7ab3f16433eea9304126dcd199" + ], + "data": "0x00000000000000000000000000000000000000000000000000000000000186a0", + "blockHash": "0x57eb61011139e2d87ffb3b6d29e7bac69e17919330e0d928403ddcc9b6b59261", + "blockNumber": "0x5b28839", + "transactionHash": "0x179019d502a67838533b07634ad619d39514b55a10599b250f80c5cb219ab04e", + "transactionIndex": "0x0", + "logIndex": "0x0", + "removed": false + } + ], + "status": "0x1", + "logsBloom": "0x00000000000000000000008000000000000000000000000000000000000000000000000000000000000000000000000000000040000000000000400000200000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000040000000020000000000000200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000800000080000000000000000010000" + }, + { + "transactionHash": "0x5445be7f53975a21d639f41e3e607903bc47ab5f1c87c2005c657dbf0efafe48", + "transactionIndex": "0x0", + "blockHash": "0xde962d5313c54e9a1490d0f1cf82130a7fedcb011b11b3c8dac57ed0405b544f", + "blockNumber": "0x5b28846", + "from": "0xEAC5F0d4A9a45E1f9FdD0e7e2882e9f60E301156", + "to": "0x1111111254760F7ab3F16433eea9304126DCd199", + "cumulativeGasUsed": "0x2fb70", + "gasUsed": "0x2fb70", + "contractAddress": null, + "logs": [ + { + "address": "0x7F5c764cBc14f9669B88837ca1490cCa17c31607", + "topics": [ + "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef", + "0x000000000000000000000000eac5f0d4a9a45e1f9fdd0e7e2882e9f60e301156", + "0x000000000000000000000000f0694acc9e941b176e17b9ef923e71e7b8b2477a" + ], + "data": "0x00000000000000000000000000000000000000000000000000000000000186a0", + "blockHash": "0xde962d5313c54e9a1490d0f1cf82130a7fedcb011b11b3c8dac57ed0405b544f", + "blockNumber": "0x5b28846", + "transactionHash": "0x5445be7f53975a21d639f41e3e607903bc47ab5f1c87c2005c657dbf0efafe48", + "transactionIndex": "0x0", + "logIndex": "0x0", + "removed": false + }, + { + "address": "0x7F5c764cBc14f9669B88837ca1490cCa17c31607", + "topics": [ + "0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925", + "0x000000000000000000000000eac5f0d4a9a45e1f9fdd0e7e2882e9f60e301156", + "0x0000000000000000000000001111111254760f7ab3f16433eea9304126dcd199" + ], + "data": "0x0000000000000000000000000000000000000000000000000000000000000000", + "blockHash": "0xde962d5313c54e9a1490d0f1cf82130a7fedcb011b11b3c8dac57ed0405b544f", + "blockNumber": "0x5b28846", + "transactionHash": "0x5445be7f53975a21d639f41e3e607903bc47ab5f1c87c2005c657dbf0efafe48", + "transactionIndex": "0x0", + "logIndex": "0x1", + "removed": false + }, + { + "address": "0x4200000000000000000000000000000000000006", + "topics": [ + "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef", + "0x000000000000000000000000f9d5940c2313636546ab9852354860dce275dbad", + "0x000000000000000000000000f0694acc9e941b176e17b9ef923e71e7b8b2477a" + ], + "data": "0x00000000000000000000000000000000000000000000000000002ff8d9b2edfd", + "blockHash": "0xde962d5313c54e9a1490d0f1cf82130a7fedcb011b11b3c8dac57ed0405b544f", + "blockNumber": "0x5b28846", + "transactionHash": "0x5445be7f53975a21d639f41e3e607903bc47ab5f1c87c2005c657dbf0efafe48", + "transactionIndex": "0x0", + "logIndex": "0x2", + "removed": false + }, + { + "address": "0x7F5c764cBc14f9669B88837ca1490cCa17c31607", + "topics": [ + "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef", + "0x000000000000000000000000f0694acc9e941b176e17b9ef923e71e7b8b2477a", + "0x000000000000000000000000f9d5940c2313636546ab9852354860dce275dbad" + ], + "data": "0x00000000000000000000000000000000000000000000000000000000000186a0", + "blockHash": "0xde962d5313c54e9a1490d0f1cf82130a7fedcb011b11b3c8dac57ed0405b544f", + "blockNumber": "0x5b28846", + "transactionHash": "0x5445be7f53975a21d639f41e3e607903bc47ab5f1c87c2005c657dbf0efafe48", + "transactionIndex": "0x0", + "logIndex": "0x3", + "removed": false + }, + { + "address": "0xf9D5940c2313636546Ab9852354860dCE275DBaD", + "topics": [ + "0xc42079f94a6350d7e6235f29174924f928cc2ac818eb64fed8004e115fbcca67", + "0x000000000000000000000000f0694acc9e941b176e17b9ef923e71e7b8b2477a", + "0x000000000000000000000000f0694acc9e941b176e17b9ef923e71e7b8b2477a" + ], + "data": "0xffffffffffffffffffffffffffffffffffffffffffffffffffffd007264d120300000000000000000000000000000000000000000000000000000000000186a000000000000000000000000000000000000000000002da5e92e5b4199d8c66740000000000000000000000000000000000000000000000000000775b02e74881fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffcef6e", + "blockHash": "0xde962d5313c54e9a1490d0f1cf82130a7fedcb011b11b3c8dac57ed0405b544f", + "blockNumber": "0x5b28846", + "transactionHash": "0x5445be7f53975a21d639f41e3e607903bc47ab5f1c87c2005c657dbf0efafe48", + "transactionIndex": "0x0", + "logIndex": "0x4", + "removed": false + }, + { + "address": "0x6fd9d7AD17242c41f7131d257212c54A0e816691", + "topics": [ + "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef", + "0x000000000000000000000000ad4c666fc170b468b19988959eb931a3676f0e9f", + "0x0000000000000000000000001111111254760f7ab3f16433eea9304126dcd199" + ], + "data": "0x00000000000000000000000000000000000000000000000000403c0f203947a1", + "blockHash": "0xde962d5313c54e9a1490d0f1cf82130a7fedcb011b11b3c8dac57ed0405b544f", + "blockNumber": "0x5b28846", + "transactionHash": "0x5445be7f53975a21d639f41e3e607903bc47ab5f1c87c2005c657dbf0efafe48", + "transactionIndex": "0x0", + "logIndex": "0x5", + "removed": false + }, + { + "address": "0x4200000000000000000000000000000000000006", + "topics": [ + "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef", + "0x000000000000000000000000f0694acc9e941b176e17b9ef923e71e7b8b2477a", + "0x000000000000000000000000ad4c666fc170b468b19988959eb931a3676f0e9f" + ], + "data": "0x00000000000000000000000000000000000000000000000000002ff8d9b2edfd", + "blockHash": "0xde962d5313c54e9a1490d0f1cf82130a7fedcb011b11b3c8dac57ed0405b544f", + "blockNumber": "0x5b28846", + "transactionHash": "0x5445be7f53975a21d639f41e3e607903bc47ab5f1c87c2005c657dbf0efafe48", + "transactionIndex": "0x0", + "logIndex": "0x6", + "removed": false + }, + { + "address": "0xAD4c666fC170B468B19988959eb931a3676f0e9F", + "topics": [ + "0xc42079f94a6350d7e6235f29174924f928cc2ac818eb64fed8004e115fbcca67", + "0x000000000000000000000000f0694acc9e941b176e17b9ef923e71e7b8b2477a", + "0x0000000000000000000000001111111254760f7ab3f16433eea9304126dcd199" + ], + "data": "0x00000000000000000000000000000000000000000000000000002ff8d9b2edfdffffffffffffffffffffffffffffffffffffffffffffffffffbfc3f0dfc6b85f00000000000000000000000000000000000000128ad0191b67f5111972c2a4fd000000000000000000000000000000000000000000000014da5c0b160a447bb8000000000000000000000000000000000000000000000000000000000000e423", + "blockHash": "0xde962d5313c54e9a1490d0f1cf82130a7fedcb011b11b3c8dac57ed0405b544f", + "blockNumber": "0x5b28846", + "transactionHash": "0x5445be7f53975a21d639f41e3e607903bc47ab5f1c87c2005c657dbf0efafe48", + "transactionIndex": "0x0", + "logIndex": "0x7", + "removed": false + }, + { + "address": "0x6fd9d7AD17242c41f7131d257212c54A0e816691", + "topics": [ + "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef", + "0x0000000000000000000000001111111254760f7ab3f16433eea9304126dcd199", + "0x000000000000000000000000eac5f0d4a9a45e1f9fdd0e7e2882e9f60e301156" + ], + "data": "0x00000000000000000000000000000000000000000000000000403c0f203947a1", + "blockHash": "0xde962d5313c54e9a1490d0f1cf82130a7fedcb011b11b3c8dac57ed0405b544f", + "blockNumber": "0x5b28846", + "transactionHash": "0x5445be7f53975a21d639f41e3e607903bc47ab5f1c87c2005c657dbf0efafe48", + "transactionIndex": "0x0", + "logIndex": "0x8", + "removed": false + } + ], + "status": "0x1", + "logsBloom": "0x00000000000000000000008000080000000000008000000000440000000000000000000000000000000000100000000000000040008020000000400000200000000200000000000800000008000000000000000000000000000000101000000000000000000000000008000000000000000000000000000000000010000810000000000000000000000000000000000000000020002000000000000040000000020100000000000200000000000200000000000000000000000000000000000000000002000000000000000000000000000000800000000000000000000400000090004000000000000008000000001000800000080010000000000000010000" + }, + { + "transactionHash": "0x0d8dc46ad33862e3379182916a1539b58385d98e309f72b63179c594ca783ad0", + "transactionIndex": "0x0", + "blockHash": "0x6d3d3e03ea03bda1127f71bd4c31444568c19e1a65ce6c0f7a9024308a4814d6", + "blockNumber": "0x5b28853", + "from": "0xEAC5F0d4A9a45E1f9FdD0e7e2882e9f60E301156", + "to": "0x444A406C15e6F87Aee894999cb13B4ff1D61a85B", + "cumulativeGasUsed": "0x350dd", + "gasUsed": "0x350dd", + "contractAddress": null, + "logs": [ + { + "address": "0x7F5c764cBc14f9669B88837ca1490cCa17c31607", + "topics": [ + "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef", + "0x000000000000000000000000eac5f0d4a9a45e1f9fdd0e7e2882e9f60e301156", + "0x000000000000000000000000444a406c15e6f87aee894999cb13b4ff1d61a85b" + ], + "data": "0x00000000000000000000000000000000000000000000000000000000000186a0", + "blockHash": "0x6d3d3e03ea03bda1127f71bd4c31444568c19e1a65ce6c0f7a9024308a4814d6", + "blockNumber": "0x5b28853", + "transactionHash": "0x0d8dc46ad33862e3379182916a1539b58385d98e309f72b63179c594ca783ad0", + "transactionIndex": "0x0", + "logIndex": "0x0", + "removed": false + }, + { + "address": "0x7F5c764cBc14f9669B88837ca1490cCa17c31607", + "topics": [ + "0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925", + "0x000000000000000000000000eac5f0d4a9a45e1f9fdd0e7e2882e9f60e301156", + "0x000000000000000000000000444a406c15e6f87aee894999cb13b4ff1d61a85b" + ], + "data": "0x0000000000000000000000000000000000000000000000000000000000000000", + "blockHash": "0x6d3d3e03ea03bda1127f71bd4c31444568c19e1a65ce6c0f7a9024308a4814d6", + "blockNumber": "0x5b28853", + "transactionHash": "0x0d8dc46ad33862e3379182916a1539b58385d98e309f72b63179c594ca783ad0", + "transactionIndex": "0x0", + "logIndex": "0x1", + "removed": false + }, + { + "address": "0x7F5c764cBc14f9669B88837ca1490cCa17c31607", + "topics": [ + "0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925", + "0x000000000000000000000000444a406c15e6f87aee894999cb13b4ff1d61a85b", + "0x0000000000000000000000001111111254760f7ab3f16433eea9304126dcd199" + ], + "data": "0x00000000000000000000000000000000000000000000000000000000000186a0", + "blockHash": "0x6d3d3e03ea03bda1127f71bd4c31444568c19e1a65ce6c0f7a9024308a4814d6", + "blockNumber": "0x5b28853", + "transactionHash": "0x0d8dc46ad33862e3379182916a1539b58385d98e309f72b63179c594ca783ad0", + "transactionIndex": "0x0", + "logIndex": "0x2", + "removed": false + }, + { + "address": "0x7F5c764cBc14f9669B88837ca1490cCa17c31607", + "topics": [ + "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef", + "0x000000000000000000000000444a406c15e6f87aee894999cb13b4ff1d61a85b", + "0x000000000000000000000000f0694acc9e941b176e17b9ef923e71e7b8b2477a" + ], + "data": "0x00000000000000000000000000000000000000000000000000000000000186a0", + "blockHash": "0x6d3d3e03ea03bda1127f71bd4c31444568c19e1a65ce6c0f7a9024308a4814d6", + "blockNumber": "0x5b28853", + "transactionHash": "0x0d8dc46ad33862e3379182916a1539b58385d98e309f72b63179c594ca783ad0", + "transactionIndex": "0x0", + "logIndex": "0x3", + "removed": false + }, + { + "address": "0x7F5c764cBc14f9669B88837ca1490cCa17c31607", + "topics": [ + "0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925", + "0x000000000000000000000000444a406c15e6f87aee894999cb13b4ff1d61a85b", + "0x0000000000000000000000001111111254760f7ab3f16433eea9304126dcd199" + ], + "data": "0x0000000000000000000000000000000000000000000000000000000000000000", + "blockHash": "0x6d3d3e03ea03bda1127f71bd4c31444568c19e1a65ce6c0f7a9024308a4814d6", + "blockNumber": "0x5b28853", + "transactionHash": "0x0d8dc46ad33862e3379182916a1539b58385d98e309f72b63179c594ca783ad0", + "transactionIndex": "0x0", + "logIndex": "0x4", + "removed": false + }, + { + "address": "0x4200000000000000000000000000000000000006", + "topics": [ + "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef", + "0x000000000000000000000000f9d5940c2313636546ab9852354860dce275dbad", + "0x000000000000000000000000f0694acc9e941b176e17b9ef923e71e7b8b2477a" + ], + "data": "0x00000000000000000000000000000000000000000000000000002ff86e060a93", + "blockHash": "0x6d3d3e03ea03bda1127f71bd4c31444568c19e1a65ce6c0f7a9024308a4814d6", + "blockNumber": "0x5b28853", + "transactionHash": "0x0d8dc46ad33862e3379182916a1539b58385d98e309f72b63179c594ca783ad0", + "transactionIndex": "0x0", + "logIndex": "0x5", + "removed": false + }, + { + "address": "0x7F5c764cBc14f9669B88837ca1490cCa17c31607", + "topics": [ + "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef", + "0x000000000000000000000000f0694acc9e941b176e17b9ef923e71e7b8b2477a", + "0x000000000000000000000000f9d5940c2313636546ab9852354860dce275dbad" + ], + "data": "0x00000000000000000000000000000000000000000000000000000000000186a0", + "blockHash": "0x6d3d3e03ea03bda1127f71bd4c31444568c19e1a65ce6c0f7a9024308a4814d6", + "blockNumber": "0x5b28853", + "transactionHash": "0x0d8dc46ad33862e3379182916a1539b58385d98e309f72b63179c594ca783ad0", + "transactionIndex": "0x0", + "logIndex": "0x6", + "removed": false + }, + { + "address": "0xf9D5940c2313636546Ab9852354860dCE275DBaD", + "topics": [ + "0xc42079f94a6350d7e6235f29174924f928cc2ac818eb64fed8004e115fbcca67", + "0x000000000000000000000000f0694acc9e941b176e17b9ef923e71e7b8b2477a", + "0x000000000000000000000000f0694acc9e941b176e17b9ef923e71e7b8b2477a" + ], + "data": "0xffffffffffffffffffffffffffffffffffffffffffffffffffffd00791f9f56d00000000000000000000000000000000000000000000000000000000000186a000000000000000000000000000000000000000000002da61c695cf08e951b8590000000000000000000000000000000000000000000000000000775b02e74881fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffcef6e", + "blockHash": "0x6d3d3e03ea03bda1127f71bd4c31444568c19e1a65ce6c0f7a9024308a4814d6", + "blockNumber": "0x5b28853", + "transactionHash": "0x0d8dc46ad33862e3379182916a1539b58385d98e309f72b63179c594ca783ad0", + "transactionIndex": "0x0", + "logIndex": "0x7", + "removed": false + }, + { + "address": "0x6fd9d7AD17242c41f7131d257212c54A0e816691", + "topics": [ + "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef", + "0x000000000000000000000000ad4c666fc170b468b19988959eb931a3676f0e9f", + "0x0000000000000000000000001111111254760f7ab3f16433eea9304126dcd199" + ], + "data": "0x00000000000000000000000000000000000000000000000000403b699b8e50db", + "blockHash": "0x6d3d3e03ea03bda1127f71bd4c31444568c19e1a65ce6c0f7a9024308a4814d6", + "blockNumber": "0x5b28853", + "transactionHash": "0x0d8dc46ad33862e3379182916a1539b58385d98e309f72b63179c594ca783ad0", + "transactionIndex": "0x0", + "logIndex": "0x8", + "removed": false + }, + { + "address": "0x4200000000000000000000000000000000000006", + "topics": [ + "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef", + "0x000000000000000000000000f0694acc9e941b176e17b9ef923e71e7b8b2477a", + "0x000000000000000000000000ad4c666fc170b468b19988959eb931a3676f0e9f" + ], + "data": "0x00000000000000000000000000000000000000000000000000002ff86e060a93", + "blockHash": "0x6d3d3e03ea03bda1127f71bd4c31444568c19e1a65ce6c0f7a9024308a4814d6", + "blockNumber": "0x5b28853", + "transactionHash": "0x0d8dc46ad33862e3379182916a1539b58385d98e309f72b63179c594ca783ad0", + "transactionIndex": "0x0", + "logIndex": "0x9", + "removed": false + }, + { + "address": "0xAD4c666fC170B468B19988959eb931a3676f0e9F", + "topics": [ + "0xc42079f94a6350d7e6235f29174924f928cc2ac818eb64fed8004e115fbcca67", + "0x000000000000000000000000f0694acc9e941b176e17b9ef923e71e7b8b2477a", + "0x0000000000000000000000001111111254760f7ab3f16433eea9304126dcd199" + ], + "data": "0x00000000000000000000000000000000000000000000000000002ff86e060a93ffffffffffffffffffffffffffffffffffffffffffffffffffbfc4966471af2500000000000000000000000000000000000000128acd0490fea84da8de9e7ce5000000000000000000000000000000000000000000000014da5c0b160a447bb8000000000000000000000000000000000000000000000000000000000000e423", + "blockHash": "0x6d3d3e03ea03bda1127f71bd4c31444568c19e1a65ce6c0f7a9024308a4814d6", + "blockNumber": "0x5b28853", + "transactionHash": "0x0d8dc46ad33862e3379182916a1539b58385d98e309f72b63179c594ca783ad0", + "transactionIndex": "0x0", + "logIndex": "0xa", + "removed": false + }, + { + "address": "0x6fd9d7AD17242c41f7131d257212c54A0e816691", + "topics": [ + "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef", + "0x0000000000000000000000001111111254760f7ab3f16433eea9304126dcd199", + "0x000000000000000000000000eac5f0d4a9a45e1f9fdd0e7e2882e9f60e301156" + ], + "data": "0x00000000000000000000000000000000000000000000000000403b699b8e50db", + "blockHash": "0x6d3d3e03ea03bda1127f71bd4c31444568c19e1a65ce6c0f7a9024308a4814d6", + "blockNumber": "0x5b28853", + "transactionHash": "0x0d8dc46ad33862e3379182916a1539b58385d98e309f72b63179c594ca783ad0", + "transactionIndex": "0x0", + "logIndex": "0xb", + "removed": false + } + ], + "status": "0x1", + "logsBloom": "0x00000000000000000000008000080000000000008000000000440000000000000000000000000000000000100000000000000040008020000000400000200000000200000000000800000008000000000000000001000008000000101000000000000000000000000008000000000000000000000000000000000010000810040000000000000000000000000000000000000020002000000000000040000000020100000000000200000000000200000000000000000000000000000000000000000002000000000000000000000000000000800000000000000000000400000090004000000000000008000000001000800000080010000000000000010000" + } + ], + "libraries": [], + "pending": [], + "path": "", + "returns": {}, + "timestamp": 1682891249, + "chain": 10, + "multi": false, + "commit": "580f0ba" +} diff --git a/broadcast/Deploy.s.sol/10/run-1682875572.json b/broadcast/Deploy.s.sol/10/run-1682875572.json new file mode 100644 index 0000000..bea4375 --- /dev/null +++ b/broadcast/Deploy.s.sol/10/run-1682875572.json @@ -0,0 +1,162 @@ +{ + "transactions": [ + { + "hash": "0x007eeabf910018da20ef36241f5474d69fa6a608e7991d41d65a90767bcf9349", + "transactionType": "CREATE", + "contractName": "OneInchRouterFactory", + "contractAddress": "0x8ea1Cec74fA7CDdfE8056198ef1A3718aDae2895", + "function": null, + "arguments": [ + "0xf0694ACc9E941B176E17B9Ef923e71E7B8b2477A", + "0x1111111254EEB25477B68fb85Ed929f73A960582", + "0xf0694ACc9E941B176E17B9Ef923e71E7B8b2477A", + "0x1111111254760F7ab3F16433eea9304126DCd199" + ], + "rpc": "", + "transaction": { + "type": "0x00", + "from": "0xeac5f0d4a9a45e1f9fdd0e7e2882e9f60e301156", + "gas": "0x1dc418", + "value": "0x0", + "data": "0x61014060405234801561001157600080fd5b50604051611bde380380611bde8339810160408190526100309161007a565b6001600160a01b03938416608081905292841660a05261010092909252821660c0819052911660e052610120526100d9565b6001600160a01b038116811461007757600080fd5b50565b6000806000806080858703121561009057600080fd5b845161009b81610062565b60208601519094506100ac81610062565b60408601519093506100bd81610062565b60608601519092506100ce81610062565b939692955090935050565b60805160a05160c05160e0516101005161012051611a6461017a6000396000818161011c015281816103a901526104fc01526000818161017d015281816102c2015261060b0152600081816101a40152818161036601526104a201526000818160ce0152818161038701526104ca01526000818160f50152818161027f01526105b1015260008181610156015281816102a001526105d90152611a646000f3fe608060405234801561001057600080fd5b50600436106100885760003560e01c806344b6b3331161005b57806344b6b3331461013e578063ced156d914610151578063d0a32a3b14610178578063eafc4d611461019f57600080fd5b80630e6e0fb21461008d57806312d69f9a146100c957806333e81795146100f05780633cffdecc14610117575b600080fd5b6100a061009b366004610735565b6101c6565b60405173ffffffffffffffffffffffffffffffffffffffff909116815260200160405180910390f35b6100a07f000000000000000000000000000000000000000000000000000000000000000081565b6100a07f000000000000000000000000000000000000000000000000000000000000000081565b6100a07f000000000000000000000000000000000000000000000000000000000000000081565b6100a061014c366004610735565b61024a565b6100a07f000000000000000000000000000000000000000000000000000000000000000081565b6100a07f000000000000000000000000000000000000000000000000000000000000000081565b6100a07f000000000000000000000000000000000000000000000000000000000000000081565b6000808360018111156101db576101db61078b565b036101f0576101e98261042a565b9050610244565b60018360018111156102045761020461078b565b03610212576101e982610539565b6040517fe34f15ca00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b92915050565b600073ffffffffffffffffffffffffffffffffffffffff821681600185818111156102775761027761078b565b0361034a57817f00000000000000000000000000000000000000000000000000000000000000007f0000000000000000000000000000000000000000000000000000000000000000867f00000000000000000000000000000000000000000000000000000000000000006040516102ed9061071b565b73ffffffffffffffffffffffffffffffffffffffff94851681529284166020840152908316604083015290911660608201526080018190604051809103906000f5905080158015610342573d6000803e3d6000fd5b5090506103d4565b600085600181111561035e5761035e61078b565b0361021257817f00000000000000000000000000000000000000000000000000000000000000007f0000000000000000000000000000000000000000000000000000000000000000867f00000000000000000000000000000000000000000000000000000000000000006040516102ed90610728565b8373ffffffffffffffffffffffffffffffffffffffff167f8b7908ccc516745a211cceb7b00399a7bc2db042629feefb1daf11d8fa7eda998660405161041a91906107ba565b60405180910390a2949350505050565b600061024473ffffffffffffffffffffffffffffffffffffffff8316306040518060200161045790610728565b8181037fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe09081018352601f90910116604081815273ffffffffffffffffffffffffffffffffffffffff7f0000000000000000000000000000000000000000000000000000000000000000811660208401527f000000000000000000000000000000000000000000000000000000000000000081169183019190915280881660608301527f000000000000000000000000000000000000000000000000000000000000000016608082015260a0015b604051602081830303815290604052610638565b600061024473ffffffffffffffffffffffffffffffffffffffff831630604051806020016105669061071b565b8181037fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe09081018352601f90910116604081815273ffffffffffffffffffffffffffffffffffffffff7f0000000000000000000000000000000000000000000000000000000000000000811660208401527f000000000000000000000000000000000000000000000000000000000000000081169183019190915280881660608301527f000000000000000000000000000000000000000000000000000000000000000016608082015260a001610525565b600060ff60f81b8486858560405160200161065492919061082b565b604051602081830303815290604052805190602001206040516020016106dc94939291907fff0000000000000000000000000000000000000000000000000000000000000094909416845260609290921b7fffffffffffffffffffffffffffffffffffffffff0000000000000000000000001660018401526015830152603582015260550190565b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0818403018152919052805160209091012095945050505050565b6108b88061084983390190565b61092e8061110183390190565b6000806040838503121561074857600080fd5b82356002811061075757600080fd5b9150602083013573ffffffffffffffffffffffffffffffffffffffff8116811461078057600080fd5b809150509250929050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fd5b60208101600283106107f5577f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fd5b91905290565b6000815160005b8181101561081c5760208185018101518683015201610802565b50600093019283525090919050565b600061084061083a83866107fb565b846107fb565b94935050505056fe61010060405234801561001157600080fd5b506040516108b83803806108b88339810160408190526100309161006a565b6001600160a01b0392831660805292821660a052811660c0521660e0526100c9565b6001600160a01b038116811461006757600080fd5b50565b6000806000806080858703121561008057600080fd5b845161008b81610052565b602086015190945061009c81610052565b60408601519093506100ad81610052565b60608601519092506100be81610052565b939692955090935050565b60805160a05160c05160e051610786610132600039600081816102c1015261047201526000818160b70152818161019101528181610269015261043e0152600081816101620152818161020101526103ad01526000818161023d015261040a01526107866000f3fe6080604052600436106100435760003560e01c80630621153b1461039b5780634803f27a146103f857806382bfefc81461042c578063ff8ce5d0146104605761004a565b3661004a57005b60008080808061005a36826104e4565b6040517f23b872dd000000000000000000000000000000000000000000000000000000008152336004820152306024820152604481018590529499509297509095509350915073ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000000000000000000000000000000000000000000016906323b872dd906064016020604051808303816000875af1158015610100573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906101249190610603565b506040517f095ea7b300000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000000000000000000000000000000000000000000081166004830152602482018690527f0000000000000000000000000000000000000000000000000000000000000000169063095ea7b3906044016020604051808303816000875af11580156101da573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906101fe9190610603565b507f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff166312aa3caf7f00000000000000000000000000000000000000000000000000000000000000006040518060e001604052807f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff1681526020018973ffffffffffffffffffffffffffffffffffffffff1681526020017f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff1681526020013373ffffffffffffffffffffffffffffffffffffffff1681526020018881526020018781526020018561032f576000610332565b60015b60ff16815250856040518463ffffffff1660e01b81526004016103579392919061068b565b60408051808303816000875af1158015610375573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610399919061072c565b005b3480156103a757600080fd5b506103cf7f000000000000000000000000000000000000000000000000000000000000000081565b60405173ffffffffffffffffffffffffffffffffffffffff909116815260200160405180910390f35b34801561040457600080fd5b506103cf7f000000000000000000000000000000000000000000000000000000000000000081565b34801561043857600080fd5b506103cf7f000000000000000000000000000000000000000000000000000000000000000081565b34801561046c57600080fd5b506103cf7f000000000000000000000000000000000000000000000000000000000000000081565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b80151581146104d157600080fd5b50565b80356104df816104c3565b919050565b600080600080600060a086880312156104fc57600080fd5b853573ffffffffffffffffffffffffffffffffffffffff8116811461052057600080fd5b94506020860135935060408601359250606086013567ffffffffffffffff8082111561054b57600080fd5b818801915088601f83011261055f57600080fd5b81358181111561057157610571610494565b604051601f82017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0908116603f011681019083821181831017156105b7576105b7610494565b816040528281528b60208487010111156105d057600080fd5b8260208601602083013760006020848301015280965050505050506105f7608087016104d4565b90509295509295909350565b60006020828403121561061557600080fd5b8151610620816104c3565b9392505050565b6000815180845260005b8181101561064d57602081850181015186830182015201610631565b5060006020828601015260207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f83011685010191505092915050565b600061014073ffffffffffffffffffffffffffffffffffffffff808716845280865116602085015280602087015116604085015280604087015116606085015280606087015116608085015250608085015160a084015260a085015160c084015260c085015160e08401528061010084015261070d8184016000815260200190565b90508281036101208401526107228185610627565b9695505050505050565b6000806040838503121561073f57600080fd5b50508051602090910151909290915056fea26469706673582212201cb8a535426b4a44845edc534db759da911a7856b5044dd9b2aab90ecab41fa964736f6c6343000810003361010060405234801561001157600080fd5b5060405161092e38038061092e8339810160408190526100309161006a565b6001600160a01b0392831660805292821660a052811660c0521660e0526100c9565b6001600160a01b038116811461006757600080fd5b50565b6000806000806080858703121561008057600080fd5b845161008b81610052565b602086015190945061009c81610052565b60408601519093506100ad81610052565b60608601519092506100be81610052565b939692955090935050565b60805160a05160c05160e0516107fc610132600039600081816102c2015261048901526000818160b7015281816101910152818161026a01526104550152600081816101620152818161020101526103c401526000818161023d015261042101526107fc6000f3fe6080604052600436106100435760003560e01c80630621153b146103b25780634803f27a1461040f57806382bfefc814610443578063ff8ce5d0146104775761004a565b3661004a57005b60008080808061005a36826104fb565b6040517f23b872dd000000000000000000000000000000000000000000000000000000008152336004820152306024820152604481018590529499509297509095509350915073ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000000000000000000000000000000000000000000016906323b872dd906064016020604051808303816000875af1158015610100573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610124919061061a565b506040517f095ea7b300000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000000000000000000000000000000000000000000081166004830152602482018690527f0000000000000000000000000000000000000000000000000000000000000000169063095ea7b3906044016020604051808303816000875af11580156101da573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906101fe919061061a565b507f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff16637c0252007f00000000000000000000000000000000000000000000000000000000000000006040518061010001604052807f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff1681526020018973ffffffffffffffffffffffffffffffffffffffff1681526020017f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff1681526020013373ffffffffffffffffffffffffffffffffffffffff16815260200188815260200187815260200185610330576000610333565b60015b60ff16815260200160405180602001604052806000815250815250856040518463ffffffff1660e01b815260040161036d939291906106a2565b6060604051808303816000875af115801561038c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906103b09190610798565b005b3480156103be57600080fd5b506103e67f000000000000000000000000000000000000000000000000000000000000000081565b60405173ffffffffffffffffffffffffffffffffffffffff909116815260200160405180910390f35b34801561041b57600080fd5b506103e67f000000000000000000000000000000000000000000000000000000000000000081565b34801561044f57600080fd5b506103e67f000000000000000000000000000000000000000000000000000000000000000081565b34801561048357600080fd5b506103e67f000000000000000000000000000000000000000000000000000000000000000081565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b80151581146104e857600080fd5b50565b80356104f6816104da565b919050565b600080600080600060a0868803121561051357600080fd5b853573ffffffffffffffffffffffffffffffffffffffff8116811461053757600080fd5b94506020860135935060408601359250606086013567ffffffffffffffff8082111561056257600080fd5b818801915088601f83011261057657600080fd5b813581811115610588576105886104ab565b604051601f82017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0908116603f011681019083821181831017156105ce576105ce6104ab565b816040528281528b60208487010111156105e757600080fd5b82602086016020830137600060208483010152809650505050505061060e608087016104eb565b90509295509295909350565b60006020828403121561062c57600080fd5b8151610637816104da565b9392505050565b6000815180845260005b8181101561066457602081850181015186830182015201610648565b5060006020828601015260207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f83011685010191505092915050565b600073ffffffffffffffffffffffffffffffffffffffff8086168352606060208401528085511660608401525060208401516106f6608084018273ffffffffffffffffffffffffffffffffffffffff169052565b50604084015173ffffffffffffffffffffffffffffffffffffffff811660a084015250606084015173ffffffffffffffffffffffffffffffffffffffff811660c084015250608084015160e083015260a0840151610100818185015260c086015161012085015260e08601519150806101408501525061077a61016084018261063e565b9050828103604084015261078e818561063e565b9695505050505050565b6000806000606084860312156107ad57600080fd5b835192506020840151915060408401519050925092509256fea264697066735822122096bc8c2fe4e7c03521d6276cc5b954661b17e7b6252165a773e142559729e0b564736f6c63430008100033a2646970667358221220ac5f1d19eca2c9bc1bb026006b1b194aa989df53d745cb41149386f21415660364736f6c63430008100033000000000000000000000000f0694acc9e941b176e17b9ef923e71e7b8b2477a0000000000000000000000001111111254eeb25477b68fb85ed929f73a960582000000000000000000000000f0694acc9e941b176e17b9ef923e71e7b8b2477a0000000000000000000000001111111254760f7ab3f16433eea9304126dcd199", + "nonce": "0x1b" + }, + "additionalContracts": [], + "isFixedGasLimit": false + }, + { + "hash": "0xeb42f66b829c3b569a90d3bc9df1108a1803fce3712a3e6cd57d6e0ea25e9224", + "transactionType": "CALL", + "contractName": "OneInchRouterFactory", + "contractAddress": "0x8ea1Cec74fA7CDdfE8056198ef1A3718aDae2895", + "function": "deploy(uint8,address):(address)", + "arguments": ["1", "0x7F5c764cBc14f9669B88837ca1490cCa17c31607"], + "rpc": "", + "transaction": { + "type": "0x00", + "from": "0xeac5f0d4a9a45e1f9fdd0e7e2882e9f60e301156", + "to": "0x8ea1cec74fa7cddfe8056198ef1a3718adae2895", + "gas": "0x95633", + "value": "0x0", + "data": "0x44b6b33300000000000000000000000000000000000000000000000000000000000000010000000000000000000000007f5c764cbc14f9669b88837ca1490cca17c31607", + "nonce": "0x1c" + }, + "additionalContracts": [ + { + "transactionType": "CREATE2", + "address": "0xB17cCEE669aB2cc40A6564DA84Db66dD8D144CB4", + "initCode": "61010060405234801561001157600080fd5b506040516108b83803806108b88339810160408190526100309161006a565b6001600160a01b0392831660805292821660a052811660c0521660e0526100c9565b6001600160a01b038116811461006757600080fd5b50565b6000806000806080858703121561008057600080fd5b845161008b81610052565b602086015190945061009c81610052565b60408601519093506100ad81610052565b60608601519092506100be81610052565b939692955090935050565b60805160a05160c05160e051610786610132600039600081816102c1015261047201526000818160b70152818161019101528181610269015261043e0152600081816101620152818161020101526103ad01526000818161023d015261040a01526107866000f3fe6080604052600436106100435760003560e01c80630621153b1461039b5780634803f27a146103f857806382bfefc81461042c578063ff8ce5d0146104605761004a565b3661004a57005b60008080808061005a36826104e4565b6040517f23b872dd000000000000000000000000000000000000000000000000000000008152336004820152306024820152604481018590529499509297509095509350915073ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000000000000000000000000000000000000000000016906323b872dd906064016020604051808303816000875af1158015610100573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906101249190610603565b506040517f095ea7b300000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000000000000000000000000000000000000000000081166004830152602482018690527f0000000000000000000000000000000000000000000000000000000000000000169063095ea7b3906044016020604051808303816000875af11580156101da573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906101fe9190610603565b507f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff166312aa3caf7f00000000000000000000000000000000000000000000000000000000000000006040518060e001604052807f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff1681526020018973ffffffffffffffffffffffffffffffffffffffff1681526020017f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff1681526020013373ffffffffffffffffffffffffffffffffffffffff1681526020018881526020018781526020018561032f576000610332565b60015b60ff16815250856040518463ffffffff1660e01b81526004016103579392919061068b565b60408051808303816000875af1158015610375573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610399919061072c565b005b3480156103a757600080fd5b506103cf7f000000000000000000000000000000000000000000000000000000000000000081565b60405173ffffffffffffffffffffffffffffffffffffffff909116815260200160405180910390f35b34801561040457600080fd5b506103cf7f000000000000000000000000000000000000000000000000000000000000000081565b34801561043857600080fd5b506103cf7f000000000000000000000000000000000000000000000000000000000000000081565b34801561046c57600080fd5b506103cf7f000000000000000000000000000000000000000000000000000000000000000081565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b80151581146104d157600080fd5b50565b80356104df816104c3565b919050565b600080600080600060a086880312156104fc57600080fd5b853573ffffffffffffffffffffffffffffffffffffffff8116811461052057600080fd5b94506020860135935060408601359250606086013567ffffffffffffffff8082111561054b57600080fd5b818801915088601f83011261055f57600080fd5b81358181111561057157610571610494565b604051601f82017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0908116603f011681019083821181831017156105b7576105b7610494565b816040528281528b60208487010111156105d057600080fd5b8260208601602083013760006020848301015280965050505050506105f7608087016104d4565b90509295509295909350565b60006020828403121561061557600080fd5b8151610620816104c3565b9392505050565b6000815180845260005b8181101561064d57602081850181015186830182015201610631565b5060006020828601015260207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f83011685010191505092915050565b600061014073ffffffffffffffffffffffffffffffffffffffff808716845280865116602085015280602087015116604085015280604087015116606085015280606087015116608085015250608085015160a084015260a085015160c084015260c085015160e08401528061010084015261070d8184016000815260200190565b90508281036101208401526107228185610627565b9695505050505050565b6000806040838503121561073f57600080fd5b50508051602090910151909290915056fea26469706673582212201cb8a535426b4a44845edc534db759da911a7856b5044dd9b2aab90ecab41fa964736f6c634300081000330000000000000000000000001111111254eeb25477b68fb85ed929f73a960582000000000000000000000000f0694acc9e941b176e17b9ef923e71e7b8b2477a0000000000000000000000007f5c764cbc14f9669b88837ca1490cca17c31607000000000000000000000000f0694acc9e941b176e17b9ef923e71e7b8b2477a" + } + ], + "isFixedGasLimit": false + }, + { + "hash": "0x27fbaa8e6c4abe793fad7d09a756fae18199bf4416a44d932b4e47994cb2fad8", + "transactionType": "CALL", + "contractName": "OneInchRouterFactory", + "contractAddress": "0x8ea1Cec74fA7CDdfE8056198ef1A3718aDae2895", + "function": "deploy(uint8,address):(address)", + "arguments": ["0", "0x7F5c764cBc14f9669B88837ca1490cCa17c31607"], + "rpc": "", + "transaction": { + "type": "0x00", + "from": "0xeac5f0d4a9a45e1f9fdd0e7e2882e9f60e301156", + "to": "0x8ea1cec74fa7cddfe8056198ef1a3718adae2895", + "gas": "0xa6a3b", + "value": "0x0", + "data": "0x44b6b33300000000000000000000000000000000000000000000000000000000000000000000000000000000000000007f5c764cbc14f9669b88837ca1490cca17c31607", + "nonce": "0x1d" + }, + "additionalContracts": [ + { + "transactionType": "CREATE2", + "address": "0x444A406C15e6F87Aee894999cb13B4ff1D61a85B", + "initCode": "61010060405234801561001157600080fd5b5060405161092e38038061092e8339810160408190526100309161006a565b6001600160a01b0392831660805292821660a052811660c0521660e0526100c9565b6001600160a01b038116811461006757600080fd5b50565b6000806000806080858703121561008057600080fd5b845161008b81610052565b602086015190945061009c81610052565b60408601519093506100ad81610052565b60608601519092506100be81610052565b939692955090935050565b60805160a05160c05160e0516107fc610132600039600081816102c2015261048901526000818160b7015281816101910152818161026a01526104550152600081816101620152818161020101526103c401526000818161023d015261042101526107fc6000f3fe6080604052600436106100435760003560e01c80630621153b146103b25780634803f27a1461040f57806382bfefc814610443578063ff8ce5d0146104775761004a565b3661004a57005b60008080808061005a36826104fb565b6040517f23b872dd000000000000000000000000000000000000000000000000000000008152336004820152306024820152604481018590529499509297509095509350915073ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000000000000000000000000000000000000000000016906323b872dd906064016020604051808303816000875af1158015610100573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610124919061061a565b506040517f095ea7b300000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000000000000000000000000000000000000000000081166004830152602482018690527f0000000000000000000000000000000000000000000000000000000000000000169063095ea7b3906044016020604051808303816000875af11580156101da573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906101fe919061061a565b507f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff16637c0252007f00000000000000000000000000000000000000000000000000000000000000006040518061010001604052807f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff1681526020018973ffffffffffffffffffffffffffffffffffffffff1681526020017f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff1681526020013373ffffffffffffffffffffffffffffffffffffffff16815260200188815260200187815260200185610330576000610333565b60015b60ff16815260200160405180602001604052806000815250815250856040518463ffffffff1660e01b815260040161036d939291906106a2565b6060604051808303816000875af115801561038c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906103b09190610798565b005b3480156103be57600080fd5b506103e67f000000000000000000000000000000000000000000000000000000000000000081565b60405173ffffffffffffffffffffffffffffffffffffffff909116815260200160405180910390f35b34801561041b57600080fd5b506103e67f000000000000000000000000000000000000000000000000000000000000000081565b34801561044f57600080fd5b506103e67f000000000000000000000000000000000000000000000000000000000000000081565b34801561048357600080fd5b506103e67f000000000000000000000000000000000000000000000000000000000000000081565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b80151581146104e857600080fd5b50565b80356104f6816104da565b919050565b600080600080600060a0868803121561051357600080fd5b853573ffffffffffffffffffffffffffffffffffffffff8116811461053757600080fd5b94506020860135935060408601359250606086013567ffffffffffffffff8082111561056257600080fd5b818801915088601f83011261057657600080fd5b813581811115610588576105886104ab565b604051601f82017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0908116603f011681019083821181831017156105ce576105ce6104ab565b816040528281528b60208487010111156105e757600080fd5b82602086016020830137600060208483010152809650505050505061060e608087016104eb565b90509295509295909350565b60006020828403121561062c57600080fd5b8151610637816104da565b9392505050565b6000815180845260005b8181101561066457602081850181015186830182015201610648565b5060006020828601015260207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f83011685010191505092915050565b600073ffffffffffffffffffffffffffffffffffffffff8086168352606060208401528085511660608401525060208401516106f6608084018273ffffffffffffffffffffffffffffffffffffffff169052565b50604084015173ffffffffffffffffffffffffffffffffffffffff811660a084015250606084015173ffffffffffffffffffffffffffffffffffffffff811660c084015250608084015160e083015260a0840151610100818185015260c086015161012085015260e08601519150806101408501525061077a61016084018261063e565b9050828103604084015261078e818561063e565b9695505050505050565b6000806000606084860312156107ad57600080fd5b835192506020840151915060408401519050925092509256fea264697066735822122096bc8c2fe4e7c03521d6276cc5b954661b17e7b6252165a773e142559729e0b564736f6c634300081000330000000000000000000000001111111254760f7ab3f16433eea9304126dcd199000000000000000000000000f0694acc9e941b176e17b9ef923e71e7b8b2477a0000000000000000000000007f5c764cbc14f9669b88837ca1490cca17c31607000000000000000000000000f0694acc9e941b176e17b9ef923e71e7b8b2477a" + } + ], + "isFixedGasLimit": false + } + ], + "receipts": [ + { + "transactionHash": "0x007eeabf910018da20ef36241f5474d69fa6a608e7991d41d65a90767bcf9349", + "transactionIndex": "0x0", + "blockHash": "0x545f7a5f24b1e94a9487bdbb34214846f580e7880122d3d8b9095e734e11e361", + "blockNumber": "0x5b1f8ea", + "from": "0xEAC5F0d4A9a45E1f9FdD0e7e2882e9f60E301156", + "to": null, + "cumulativeGasUsed": "0x16e59d", + "gasUsed": "0x16e59d", + "contractAddress": "0x8ea1Cec74fA7CDdfE8056198ef1A3718aDae2895", + "logs": [], + "status": "0x1", + "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000" + }, + { + "transactionHash": "0xeb42f66b829c3b569a90d3bc9df1108a1803fce3712a3e6cd57d6e0ea25e9224", + "transactionIndex": "0x0", + "blockHash": "0xf9e514b19458ff3c30783a26e64edaaabb7ebce28f18f0dea582cc99765a9d3e", + "blockNumber": "0x5b1f900", + "from": "0xEAC5F0d4A9a45E1f9FdD0e7e2882e9f60E301156", + "to": "0x8ea1Cec74fA7CDdfE8056198ef1A3718aDae2895", + "cumulativeGasUsed": "0x6c277", + "gasUsed": "0x6c277", + "contractAddress": null, + "logs": [ + { + "address": "0x8ea1Cec74fA7CDdfE8056198ef1A3718aDae2895", + "topics": [ + "0x8b7908ccc516745a211cceb7b00399a7bc2db042629feefb1daf11d8fa7eda99", + "0x0000000000000000000000007f5c764cbc14f9669b88837ca1490cca17c31607" + ], + "data": "0x0000000000000000000000000000000000000000000000000000000000000001", + "blockHash": "0xf9e514b19458ff3c30783a26e64edaaabb7ebce28f18f0dea582cc99765a9d3e", + "blockNumber": "0x5b1f900", + "transactionHash": "0xeb42f66b829c3b569a90d3bc9df1108a1803fce3712a3e6cd57d6e0ea25e9224", + "transactionIndex": "0x0", + "logIndex": "0x0", + "removed": false + } + ], + "status": "0x1", + "logsBloom": "0x00000000000000000004001100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002000000000000000000000002000000000000000000000000000000000000000000000000000000000008000400000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000" + }, + { + "transactionHash": "0x27fbaa8e6c4abe793fad7d09a756fae18199bf4416a44d932b4e47994cb2fad8", + "transactionIndex": "0x0", + "blockHash": "0x27e794efc4a1064cfa8f1c3ac4dbe931d31e9cff58007f17f106de0c10385966", + "blockNumber": "0x5b1f910", + "from": "0xEAC5F0d4A9a45E1f9FdD0e7e2882e9f60E301156", + "to": "0x8ea1Cec74fA7CDdfE8056198ef1A3718aDae2895", + "cumulativeGasUsed": "0x71f11", + "gasUsed": "0x71f11", + "contractAddress": null, + "logs": [ + { + "address": "0x8ea1Cec74fA7CDdfE8056198ef1A3718aDae2895", + "topics": [ + "0x8b7908ccc516745a211cceb7b00399a7bc2db042629feefb1daf11d8fa7eda99", + "0x0000000000000000000000007f5c764cbc14f9669b88837ca1490cca17c31607" + ], + "data": "0x0000000000000000000000000000000000000000000000000000000000000000", + "blockHash": "0x27e794efc4a1064cfa8f1c3ac4dbe931d31e9cff58007f17f106de0c10385966", + "blockNumber": "0x5b1f910", + "transactionHash": "0x27fbaa8e6c4abe793fad7d09a756fae18199bf4416a44d932b4e47994cb2fad8", + "transactionIndex": "0x0", + "logIndex": "0x0", + "removed": false + } + ], + "status": "0x1", + "logsBloom": "0x00000000000000000004001100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002000000000000000000000002000000000000000000000000000000000000000000000000000000000008000400000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000" + } + ], + "libraries": [], + "pending": [], + "path": "", + "returns": {}, + "timestamp": 1682875572, + "chain": 10, + "multi": false, + "commit": "950f1ff" +} diff --git a/broadcast/Deploy.s.sol/10/run-latest.json b/broadcast/Deploy.s.sol/10/run-latest.json new file mode 100644 index 0000000..7aa893d --- /dev/null +++ b/broadcast/Deploy.s.sol/10/run-latest.json @@ -0,0 +1,162 @@ +{ + "transactions": [ + { + "hash": "0x007eeabf910018da20ef36241f5474d69fa6a608e7991d41d65a90767bcf9349", + "transactionType": "CREATE", + "contractName": "OneInchRouterFactory", + "contractAddress": "0x8ea1Cec74fA7CDdfE8056198ef1A3718aDae2895", + "function": null, + "arguments": [ + "0xf0694ACc9E941B176E17B9Ef923e71E7B8b2477A", + "0x1111111254EEB25477B68fb85Ed929f73A960582", + "0xf0694ACc9E941B176E17B9Ef923e71E7B8b2477A", + "0x1111111254760F7ab3F16433eea9304126DCd199" + ], + "rpc": "https://opt-mainnet.g.alchemy.com/v2/_A7lZ2J0FrbUnvsj0wE0ZDiyHBg8C148", + "transaction": { + "type": "0x00", + "from": "0xeac5f0d4a9a45e1f9fdd0e7e2882e9f60e301156", + "gas": "0x1dc418", + "value": "0x0", + "data": "0x61014060405234801561001157600080fd5b50604051611bde380380611bde8339810160408190526100309161007a565b6001600160a01b03938416608081905292841660a05261010092909252821660c0819052911660e052610120526100d9565b6001600160a01b038116811461007757600080fd5b50565b6000806000806080858703121561009057600080fd5b845161009b81610062565b60208601519094506100ac81610062565b60408601519093506100bd81610062565b60608601519092506100ce81610062565b939692955090935050565b60805160a05160c05160e0516101005161012051611a6461017a6000396000818161011c015281816103a901526104fc01526000818161017d015281816102c2015261060b0152600081816101a40152818161036601526104a201526000818160ce0152818161038701526104ca01526000818160f50152818161027f01526105b1015260008181610156015281816102a001526105d90152611a646000f3fe608060405234801561001057600080fd5b50600436106100885760003560e01c806344b6b3331161005b57806344b6b3331461013e578063ced156d914610151578063d0a32a3b14610178578063eafc4d611461019f57600080fd5b80630e6e0fb21461008d57806312d69f9a146100c957806333e81795146100f05780633cffdecc14610117575b600080fd5b6100a061009b366004610735565b6101c6565b60405173ffffffffffffffffffffffffffffffffffffffff909116815260200160405180910390f35b6100a07f000000000000000000000000000000000000000000000000000000000000000081565b6100a07f000000000000000000000000000000000000000000000000000000000000000081565b6100a07f000000000000000000000000000000000000000000000000000000000000000081565b6100a061014c366004610735565b61024a565b6100a07f000000000000000000000000000000000000000000000000000000000000000081565b6100a07f000000000000000000000000000000000000000000000000000000000000000081565b6100a07f000000000000000000000000000000000000000000000000000000000000000081565b6000808360018111156101db576101db61078b565b036101f0576101e98261042a565b9050610244565b60018360018111156102045761020461078b565b03610212576101e982610539565b6040517fe34f15ca00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b92915050565b600073ffffffffffffffffffffffffffffffffffffffff821681600185818111156102775761027761078b565b0361034a57817f00000000000000000000000000000000000000000000000000000000000000007f0000000000000000000000000000000000000000000000000000000000000000867f00000000000000000000000000000000000000000000000000000000000000006040516102ed9061071b565b73ffffffffffffffffffffffffffffffffffffffff94851681529284166020840152908316604083015290911660608201526080018190604051809103906000f5905080158015610342573d6000803e3d6000fd5b5090506103d4565b600085600181111561035e5761035e61078b565b0361021257817f00000000000000000000000000000000000000000000000000000000000000007f0000000000000000000000000000000000000000000000000000000000000000867f00000000000000000000000000000000000000000000000000000000000000006040516102ed90610728565b8373ffffffffffffffffffffffffffffffffffffffff167f8b7908ccc516745a211cceb7b00399a7bc2db042629feefb1daf11d8fa7eda998660405161041a91906107ba565b60405180910390a2949350505050565b600061024473ffffffffffffffffffffffffffffffffffffffff8316306040518060200161045790610728565b8181037fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe09081018352601f90910116604081815273ffffffffffffffffffffffffffffffffffffffff7f0000000000000000000000000000000000000000000000000000000000000000811660208401527f000000000000000000000000000000000000000000000000000000000000000081169183019190915280881660608301527f000000000000000000000000000000000000000000000000000000000000000016608082015260a0015b604051602081830303815290604052610638565b600061024473ffffffffffffffffffffffffffffffffffffffff831630604051806020016105669061071b565b8181037fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe09081018352601f90910116604081815273ffffffffffffffffffffffffffffffffffffffff7f0000000000000000000000000000000000000000000000000000000000000000811660208401527f000000000000000000000000000000000000000000000000000000000000000081169183019190915280881660608301527f000000000000000000000000000000000000000000000000000000000000000016608082015260a001610525565b600060ff60f81b8486858560405160200161065492919061082b565b604051602081830303815290604052805190602001206040516020016106dc94939291907fff0000000000000000000000000000000000000000000000000000000000000094909416845260609290921b7fffffffffffffffffffffffffffffffffffffffff0000000000000000000000001660018401526015830152603582015260550190565b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0818403018152919052805160209091012095945050505050565b6108b88061084983390190565b61092e8061110183390190565b6000806040838503121561074857600080fd5b82356002811061075757600080fd5b9150602083013573ffffffffffffffffffffffffffffffffffffffff8116811461078057600080fd5b809150509250929050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fd5b60208101600283106107f5577f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fd5b91905290565b6000815160005b8181101561081c5760208185018101518683015201610802565b50600093019283525090919050565b600061084061083a83866107fb565b846107fb565b94935050505056fe61010060405234801561001157600080fd5b506040516108b83803806108b88339810160408190526100309161006a565b6001600160a01b0392831660805292821660a052811660c0521660e0526100c9565b6001600160a01b038116811461006757600080fd5b50565b6000806000806080858703121561008057600080fd5b845161008b81610052565b602086015190945061009c81610052565b60408601519093506100ad81610052565b60608601519092506100be81610052565b939692955090935050565b60805160a05160c05160e051610786610132600039600081816102c1015261047201526000818160b70152818161019101528181610269015261043e0152600081816101620152818161020101526103ad01526000818161023d015261040a01526107866000f3fe6080604052600436106100435760003560e01c80630621153b1461039b5780634803f27a146103f857806382bfefc81461042c578063ff8ce5d0146104605761004a565b3661004a57005b60008080808061005a36826104e4565b6040517f23b872dd000000000000000000000000000000000000000000000000000000008152336004820152306024820152604481018590529499509297509095509350915073ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000000000000000000000000000000000000000000016906323b872dd906064016020604051808303816000875af1158015610100573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906101249190610603565b506040517f095ea7b300000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000000000000000000000000000000000000000000081166004830152602482018690527f0000000000000000000000000000000000000000000000000000000000000000169063095ea7b3906044016020604051808303816000875af11580156101da573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906101fe9190610603565b507f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff166312aa3caf7f00000000000000000000000000000000000000000000000000000000000000006040518060e001604052807f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff1681526020018973ffffffffffffffffffffffffffffffffffffffff1681526020017f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff1681526020013373ffffffffffffffffffffffffffffffffffffffff1681526020018881526020018781526020018561032f576000610332565b60015b60ff16815250856040518463ffffffff1660e01b81526004016103579392919061068b565b60408051808303816000875af1158015610375573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610399919061072c565b005b3480156103a757600080fd5b506103cf7f000000000000000000000000000000000000000000000000000000000000000081565b60405173ffffffffffffffffffffffffffffffffffffffff909116815260200160405180910390f35b34801561040457600080fd5b506103cf7f000000000000000000000000000000000000000000000000000000000000000081565b34801561043857600080fd5b506103cf7f000000000000000000000000000000000000000000000000000000000000000081565b34801561046c57600080fd5b506103cf7f000000000000000000000000000000000000000000000000000000000000000081565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b80151581146104d157600080fd5b50565b80356104df816104c3565b919050565b600080600080600060a086880312156104fc57600080fd5b853573ffffffffffffffffffffffffffffffffffffffff8116811461052057600080fd5b94506020860135935060408601359250606086013567ffffffffffffffff8082111561054b57600080fd5b818801915088601f83011261055f57600080fd5b81358181111561057157610571610494565b604051601f82017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0908116603f011681019083821181831017156105b7576105b7610494565b816040528281528b60208487010111156105d057600080fd5b8260208601602083013760006020848301015280965050505050506105f7608087016104d4565b90509295509295909350565b60006020828403121561061557600080fd5b8151610620816104c3565b9392505050565b6000815180845260005b8181101561064d57602081850181015186830182015201610631565b5060006020828601015260207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f83011685010191505092915050565b600061014073ffffffffffffffffffffffffffffffffffffffff808716845280865116602085015280602087015116604085015280604087015116606085015280606087015116608085015250608085015160a084015260a085015160c084015260c085015160e08401528061010084015261070d8184016000815260200190565b90508281036101208401526107228185610627565b9695505050505050565b6000806040838503121561073f57600080fd5b50508051602090910151909290915056fea26469706673582212201cb8a535426b4a44845edc534db759da911a7856b5044dd9b2aab90ecab41fa964736f6c6343000810003361010060405234801561001157600080fd5b5060405161092e38038061092e8339810160408190526100309161006a565b6001600160a01b0392831660805292821660a052811660c0521660e0526100c9565b6001600160a01b038116811461006757600080fd5b50565b6000806000806080858703121561008057600080fd5b845161008b81610052565b602086015190945061009c81610052565b60408601519093506100ad81610052565b60608601519092506100be81610052565b939692955090935050565b60805160a05160c05160e0516107fc610132600039600081816102c2015261048901526000818160b7015281816101910152818161026a01526104550152600081816101620152818161020101526103c401526000818161023d015261042101526107fc6000f3fe6080604052600436106100435760003560e01c80630621153b146103b25780634803f27a1461040f57806382bfefc814610443578063ff8ce5d0146104775761004a565b3661004a57005b60008080808061005a36826104fb565b6040517f23b872dd000000000000000000000000000000000000000000000000000000008152336004820152306024820152604481018590529499509297509095509350915073ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000000000000000000000000000000000000000000016906323b872dd906064016020604051808303816000875af1158015610100573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610124919061061a565b506040517f095ea7b300000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000000000000000000000000000000000000000000081166004830152602482018690527f0000000000000000000000000000000000000000000000000000000000000000169063095ea7b3906044016020604051808303816000875af11580156101da573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906101fe919061061a565b507f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff16637c0252007f00000000000000000000000000000000000000000000000000000000000000006040518061010001604052807f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff1681526020018973ffffffffffffffffffffffffffffffffffffffff1681526020017f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff1681526020013373ffffffffffffffffffffffffffffffffffffffff16815260200188815260200187815260200185610330576000610333565b60015b60ff16815260200160405180602001604052806000815250815250856040518463ffffffff1660e01b815260040161036d939291906106a2565b6060604051808303816000875af115801561038c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906103b09190610798565b005b3480156103be57600080fd5b506103e67f000000000000000000000000000000000000000000000000000000000000000081565b60405173ffffffffffffffffffffffffffffffffffffffff909116815260200160405180910390f35b34801561041b57600080fd5b506103e67f000000000000000000000000000000000000000000000000000000000000000081565b34801561044f57600080fd5b506103e67f000000000000000000000000000000000000000000000000000000000000000081565b34801561048357600080fd5b506103e67f000000000000000000000000000000000000000000000000000000000000000081565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b80151581146104e857600080fd5b50565b80356104f6816104da565b919050565b600080600080600060a0868803121561051357600080fd5b853573ffffffffffffffffffffffffffffffffffffffff8116811461053757600080fd5b94506020860135935060408601359250606086013567ffffffffffffffff8082111561056257600080fd5b818801915088601f83011261057657600080fd5b813581811115610588576105886104ab565b604051601f82017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0908116603f011681019083821181831017156105ce576105ce6104ab565b816040528281528b60208487010111156105e757600080fd5b82602086016020830137600060208483010152809650505050505061060e608087016104eb565b90509295509295909350565b60006020828403121561062c57600080fd5b8151610637816104da565b9392505050565b6000815180845260005b8181101561066457602081850181015186830182015201610648565b5060006020828601015260207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f83011685010191505092915050565b600073ffffffffffffffffffffffffffffffffffffffff8086168352606060208401528085511660608401525060208401516106f6608084018273ffffffffffffffffffffffffffffffffffffffff169052565b50604084015173ffffffffffffffffffffffffffffffffffffffff811660a084015250606084015173ffffffffffffffffffffffffffffffffffffffff811660c084015250608084015160e083015260a0840151610100818185015260c086015161012085015260e08601519150806101408501525061077a61016084018261063e565b9050828103604084015261078e818561063e565b9695505050505050565b6000806000606084860312156107ad57600080fd5b835192506020840151915060408401519050925092509256fea264697066735822122096bc8c2fe4e7c03521d6276cc5b954661b17e7b6252165a773e142559729e0b564736f6c63430008100033a2646970667358221220ac5f1d19eca2c9bc1bb026006b1b194aa989df53d745cb41149386f21415660364736f6c63430008100033000000000000000000000000f0694acc9e941b176e17b9ef923e71e7b8b2477a0000000000000000000000001111111254eeb25477b68fb85ed929f73a960582000000000000000000000000f0694acc9e941b176e17b9ef923e71e7b8b2477a0000000000000000000000001111111254760f7ab3f16433eea9304126dcd199", + "nonce": "0x1b" + }, + "additionalContracts": [], + "isFixedGasLimit": false + }, + { + "hash": "0xeb42f66b829c3b569a90d3bc9df1108a1803fce3712a3e6cd57d6e0ea25e9224", + "transactionType": "CALL", + "contractName": "OneInchRouterFactory", + "contractAddress": "0x8ea1Cec74fA7CDdfE8056198ef1A3718aDae2895", + "function": "deploy(uint8,address):(address)", + "arguments": ["1", "0x7F5c764cBc14f9669B88837ca1490cCa17c31607"], + "rpc": "https://opt-mainnet.g.alchemy.com/v2/_A7lZ2J0FrbUnvsj0wE0ZDiyHBg8C148", + "transaction": { + "type": "0x00", + "from": "0xeac5f0d4a9a45e1f9fdd0e7e2882e9f60e301156", + "to": "0x8ea1cec74fa7cddfe8056198ef1a3718adae2895", + "gas": "0x95633", + "value": "0x0", + "data": "0x44b6b33300000000000000000000000000000000000000000000000000000000000000010000000000000000000000007f5c764cbc14f9669b88837ca1490cca17c31607", + "nonce": "0x1c" + }, + "additionalContracts": [ + { + "transactionType": "CREATE2", + "address": "0xB17cCEE669aB2cc40A6564DA84Db66dD8D144CB4", + "initCode": "61010060405234801561001157600080fd5b506040516108b83803806108b88339810160408190526100309161006a565b6001600160a01b0392831660805292821660a052811660c0521660e0526100c9565b6001600160a01b038116811461006757600080fd5b50565b6000806000806080858703121561008057600080fd5b845161008b81610052565b602086015190945061009c81610052565b60408601519093506100ad81610052565b60608601519092506100be81610052565b939692955090935050565b60805160a05160c05160e051610786610132600039600081816102c1015261047201526000818160b70152818161019101528181610269015261043e0152600081816101620152818161020101526103ad01526000818161023d015261040a01526107866000f3fe6080604052600436106100435760003560e01c80630621153b1461039b5780634803f27a146103f857806382bfefc81461042c578063ff8ce5d0146104605761004a565b3661004a57005b60008080808061005a36826104e4565b6040517f23b872dd000000000000000000000000000000000000000000000000000000008152336004820152306024820152604481018590529499509297509095509350915073ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000000000000000000000000000000000000000000016906323b872dd906064016020604051808303816000875af1158015610100573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906101249190610603565b506040517f095ea7b300000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000000000000000000000000000000000000000000081166004830152602482018690527f0000000000000000000000000000000000000000000000000000000000000000169063095ea7b3906044016020604051808303816000875af11580156101da573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906101fe9190610603565b507f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff166312aa3caf7f00000000000000000000000000000000000000000000000000000000000000006040518060e001604052807f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff1681526020018973ffffffffffffffffffffffffffffffffffffffff1681526020017f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff1681526020013373ffffffffffffffffffffffffffffffffffffffff1681526020018881526020018781526020018561032f576000610332565b60015b60ff16815250856040518463ffffffff1660e01b81526004016103579392919061068b565b60408051808303816000875af1158015610375573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610399919061072c565b005b3480156103a757600080fd5b506103cf7f000000000000000000000000000000000000000000000000000000000000000081565b60405173ffffffffffffffffffffffffffffffffffffffff909116815260200160405180910390f35b34801561040457600080fd5b506103cf7f000000000000000000000000000000000000000000000000000000000000000081565b34801561043857600080fd5b506103cf7f000000000000000000000000000000000000000000000000000000000000000081565b34801561046c57600080fd5b506103cf7f000000000000000000000000000000000000000000000000000000000000000081565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b80151581146104d157600080fd5b50565b80356104df816104c3565b919050565b600080600080600060a086880312156104fc57600080fd5b853573ffffffffffffffffffffffffffffffffffffffff8116811461052057600080fd5b94506020860135935060408601359250606086013567ffffffffffffffff8082111561054b57600080fd5b818801915088601f83011261055f57600080fd5b81358181111561057157610571610494565b604051601f82017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0908116603f011681019083821181831017156105b7576105b7610494565b816040528281528b60208487010111156105d057600080fd5b8260208601602083013760006020848301015280965050505050506105f7608087016104d4565b90509295509295909350565b60006020828403121561061557600080fd5b8151610620816104c3565b9392505050565b6000815180845260005b8181101561064d57602081850181015186830182015201610631565b5060006020828601015260207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f83011685010191505092915050565b600061014073ffffffffffffffffffffffffffffffffffffffff808716845280865116602085015280602087015116604085015280604087015116606085015280606087015116608085015250608085015160a084015260a085015160c084015260c085015160e08401528061010084015261070d8184016000815260200190565b90508281036101208401526107228185610627565b9695505050505050565b6000806040838503121561073f57600080fd5b50508051602090910151909290915056fea26469706673582212201cb8a535426b4a44845edc534db759da911a7856b5044dd9b2aab90ecab41fa964736f6c634300081000330000000000000000000000001111111254eeb25477b68fb85ed929f73a960582000000000000000000000000f0694acc9e941b176e17b9ef923e71e7b8b2477a0000000000000000000000007f5c764cbc14f9669b88837ca1490cca17c31607000000000000000000000000f0694acc9e941b176e17b9ef923e71e7b8b2477a" + } + ], + "isFixedGasLimit": false + }, + { + "hash": "0x27fbaa8e6c4abe793fad7d09a756fae18199bf4416a44d932b4e47994cb2fad8", + "transactionType": "CALL", + "contractName": "OneInchRouterFactory", + "contractAddress": "0x8ea1Cec74fA7CDdfE8056198ef1A3718aDae2895", + "function": "deploy(uint8,address):(address)", + "arguments": ["0", "0x7F5c764cBc14f9669B88837ca1490cCa17c31607"], + "rpc": "https://opt-mainnet.g.alchemy.com/v2/_A7lZ2J0FrbUnvsj0wE0ZDiyHBg8C148", + "transaction": { + "type": "0x00", + "from": "0xeac5f0d4a9a45e1f9fdd0e7e2882e9f60e301156", + "to": "0x8ea1cec74fa7cddfe8056198ef1a3718adae2895", + "gas": "0xa6a3b", + "value": "0x0", + "data": "0x44b6b33300000000000000000000000000000000000000000000000000000000000000000000000000000000000000007f5c764cbc14f9669b88837ca1490cca17c31607", + "nonce": "0x1d" + }, + "additionalContracts": [ + { + "transactionType": "CREATE2", + "address": "0x444A406C15e6F87Aee894999cb13B4ff1D61a85B", + "initCode": "61010060405234801561001157600080fd5b5060405161092e38038061092e8339810160408190526100309161006a565b6001600160a01b0392831660805292821660a052811660c0521660e0526100c9565b6001600160a01b038116811461006757600080fd5b50565b6000806000806080858703121561008057600080fd5b845161008b81610052565b602086015190945061009c81610052565b60408601519093506100ad81610052565b60608601519092506100be81610052565b939692955090935050565b60805160a05160c05160e0516107fc610132600039600081816102c2015261048901526000818160b7015281816101910152818161026a01526104550152600081816101620152818161020101526103c401526000818161023d015261042101526107fc6000f3fe6080604052600436106100435760003560e01c80630621153b146103b25780634803f27a1461040f57806382bfefc814610443578063ff8ce5d0146104775761004a565b3661004a57005b60008080808061005a36826104fb565b6040517f23b872dd000000000000000000000000000000000000000000000000000000008152336004820152306024820152604481018590529499509297509095509350915073ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000000000000000000000000000000000000000000016906323b872dd906064016020604051808303816000875af1158015610100573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610124919061061a565b506040517f095ea7b300000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000000000000000000000000000000000000000000081166004830152602482018690527f0000000000000000000000000000000000000000000000000000000000000000169063095ea7b3906044016020604051808303816000875af11580156101da573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906101fe919061061a565b507f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff16637c0252007f00000000000000000000000000000000000000000000000000000000000000006040518061010001604052807f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff1681526020018973ffffffffffffffffffffffffffffffffffffffff1681526020017f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff1681526020013373ffffffffffffffffffffffffffffffffffffffff16815260200188815260200187815260200185610330576000610333565b60015b60ff16815260200160405180602001604052806000815250815250856040518463ffffffff1660e01b815260040161036d939291906106a2565b6060604051808303816000875af115801561038c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906103b09190610798565b005b3480156103be57600080fd5b506103e67f000000000000000000000000000000000000000000000000000000000000000081565b60405173ffffffffffffffffffffffffffffffffffffffff909116815260200160405180910390f35b34801561041b57600080fd5b506103e67f000000000000000000000000000000000000000000000000000000000000000081565b34801561044f57600080fd5b506103e67f000000000000000000000000000000000000000000000000000000000000000081565b34801561048357600080fd5b506103e67f000000000000000000000000000000000000000000000000000000000000000081565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b80151581146104e857600080fd5b50565b80356104f6816104da565b919050565b600080600080600060a0868803121561051357600080fd5b853573ffffffffffffffffffffffffffffffffffffffff8116811461053757600080fd5b94506020860135935060408601359250606086013567ffffffffffffffff8082111561056257600080fd5b818801915088601f83011261057657600080fd5b813581811115610588576105886104ab565b604051601f82017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0908116603f011681019083821181831017156105ce576105ce6104ab565b816040528281528b60208487010111156105e757600080fd5b82602086016020830137600060208483010152809650505050505061060e608087016104eb565b90509295509295909350565b60006020828403121561062c57600080fd5b8151610637816104da565b9392505050565b6000815180845260005b8181101561066457602081850181015186830182015201610648565b5060006020828601015260207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f83011685010191505092915050565b600073ffffffffffffffffffffffffffffffffffffffff8086168352606060208401528085511660608401525060208401516106f6608084018273ffffffffffffffffffffffffffffffffffffffff169052565b50604084015173ffffffffffffffffffffffffffffffffffffffff811660a084015250606084015173ffffffffffffffffffffffffffffffffffffffff811660c084015250608084015160e083015260a0840151610100818185015260c086015161012085015260e08601519150806101408501525061077a61016084018261063e565b9050828103604084015261078e818561063e565b9695505050505050565b6000806000606084860312156107ad57600080fd5b835192506020840151915060408401519050925092509256fea264697066735822122096bc8c2fe4e7c03521d6276cc5b954661b17e7b6252165a773e142559729e0b564736f6c634300081000330000000000000000000000001111111254760f7ab3f16433eea9304126dcd199000000000000000000000000f0694acc9e941b176e17b9ef923e71e7b8b2477a0000000000000000000000007f5c764cbc14f9669b88837ca1490cca17c31607000000000000000000000000f0694acc9e941b176e17b9ef923e71e7b8b2477a" + } + ], + "isFixedGasLimit": false + } + ], + "receipts": [ + { + "transactionHash": "0x007eeabf910018da20ef36241f5474d69fa6a608e7991d41d65a90767bcf9349", + "transactionIndex": "0x0", + "blockHash": "0x545f7a5f24b1e94a9487bdbb34214846f580e7880122d3d8b9095e734e11e361", + "blockNumber": "0x5b1f8ea", + "from": "0xEAC5F0d4A9a45E1f9FdD0e7e2882e9f60E301156", + "to": null, + "cumulativeGasUsed": "0x16e59d", + "gasUsed": "0x16e59d", + "contractAddress": "0x8ea1Cec74fA7CDdfE8056198ef1A3718aDae2895", + "logs": [], + "status": "0x1", + "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000" + }, + { + "transactionHash": "0xeb42f66b829c3b569a90d3bc9df1108a1803fce3712a3e6cd57d6e0ea25e9224", + "transactionIndex": "0x0", + "blockHash": "0xf9e514b19458ff3c30783a26e64edaaabb7ebce28f18f0dea582cc99765a9d3e", + "blockNumber": "0x5b1f900", + "from": "0xEAC5F0d4A9a45E1f9FdD0e7e2882e9f60E301156", + "to": "0x8ea1Cec74fA7CDdfE8056198ef1A3718aDae2895", + "cumulativeGasUsed": "0x6c277", + "gasUsed": "0x6c277", + "contractAddress": null, + "logs": [ + { + "address": "0x8ea1Cec74fA7CDdfE8056198ef1A3718aDae2895", + "topics": [ + "0x8b7908ccc516745a211cceb7b00399a7bc2db042629feefb1daf11d8fa7eda99", + "0x0000000000000000000000007f5c764cbc14f9669b88837ca1490cca17c31607" + ], + "data": "0x0000000000000000000000000000000000000000000000000000000000000001", + "blockHash": "0xf9e514b19458ff3c30783a26e64edaaabb7ebce28f18f0dea582cc99765a9d3e", + "blockNumber": "0x5b1f900", + "transactionHash": "0xeb42f66b829c3b569a90d3bc9df1108a1803fce3712a3e6cd57d6e0ea25e9224", + "transactionIndex": "0x0", + "logIndex": "0x0", + "removed": false + } + ], + "status": "0x1", + "logsBloom": "0x00000000000000000004001100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002000000000000000000000002000000000000000000000000000000000000000000000000000000000008000400000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000" + }, + { + "transactionHash": "0x27fbaa8e6c4abe793fad7d09a756fae18199bf4416a44d932b4e47994cb2fad8", + "transactionIndex": "0x0", + "blockHash": "0x27e794efc4a1064cfa8f1c3ac4dbe931d31e9cff58007f17f106de0c10385966", + "blockNumber": "0x5b1f910", + "from": "0xEAC5F0d4A9a45E1f9FdD0e7e2882e9f60E301156", + "to": "0x8ea1Cec74fA7CDdfE8056198ef1A3718aDae2895", + "cumulativeGasUsed": "0x71f11", + "gasUsed": "0x71f11", + "contractAddress": null, + "logs": [ + { + "address": "0x8ea1Cec74fA7CDdfE8056198ef1A3718aDae2895", + "topics": [ + "0x8b7908ccc516745a211cceb7b00399a7bc2db042629feefb1daf11d8fa7eda99", + "0x0000000000000000000000007f5c764cbc14f9669b88837ca1490cca17c31607" + ], + "data": "0x0000000000000000000000000000000000000000000000000000000000000000", + "blockHash": "0x27e794efc4a1064cfa8f1c3ac4dbe931d31e9cff58007f17f106de0c10385966", + "blockNumber": "0x5b1f910", + "transactionHash": "0x27fbaa8e6c4abe793fad7d09a756fae18199bf4416a44d932b4e47994cb2fad8", + "transactionIndex": "0x0", + "logIndex": "0x0", + "removed": false + } + ], + "status": "0x1", + "logsBloom": "0x00000000000000000004001100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002000000000000000000000002000000000000000000000000000000000000000000000000000000000008000400000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000" + } + ], + "libraries": [], + "pending": [], + "path": "", + "returns": {}, + "timestamp": 1682875572, + "chain": 10, + "multi": false, + "commit": "950f1ff" +} From ff4a407361c4f3a567b42c426c1a3318fb3158cd Mon Sep 17 00:00:00 2001 From: Keating Date: Mon, 1 May 2023 09:10:54 -0400 Subject: [PATCH 12/48] Cleanup --- foundry.toml | 2 +- script/Benchmark.s.sol | 149 ++++++++---------- script/Deploy.s.sol | 28 ++-- src/AggregationBaseRouter.sol | 87 +++++++---- src/RouterFactory.sol | 179 ++++++++++------------ src/V4Router.sol | 76 ++++----- src/V5Router.sol | 78 +++++----- src/interfaces/IV4AggregationExecutor.sol | 7 +- src/interfaces/IV4AggregationRouter.sol | 36 ++--- src/interfaces/IV5AggregationExecutor.sol | 4 +- src/interfaces/IV5AggregationRouter.sol | 30 ++-- test/1InchContracts.sol | 30 ++-- test/RouterFactory.t.sol | 39 +++-- test/V4Router.t.sol | 102 ++++++------ test/V5Router.t.sol | 112 ++++++-------- 15 files changed, 449 insertions(+), 510 deletions(-) diff --git a/foundry.toml b/foundry.toml index 9a15856..c3b4854 100644 --- a/foundry.toml +++ b/foundry.toml @@ -1,9 +1,9 @@ [profile.default] + fs_permissions = [{ access = "read", path = "./broadcast" }] optimizer = true optimizer_runs = 10_000_000 solc_version = "0.8.16" verbosity = 3 - fs_permissions = [{ access = "read", path = "./broadcast" }] [profile.ci] fuzz = { runs = 5000 } diff --git a/script/Benchmark.s.sol b/script/Benchmark.s.sol index 5f8b1eb..786ee62 100644 --- a/script/Benchmark.s.sol +++ b/script/Benchmark.s.sol @@ -13,88 +13,69 @@ import "forge-std/console.sol"; // to be swapped out for new data as it is meant // to be used by a specific test wallet contract Benchmark is Script, OneInchContracts { - using stdJson for string; - error OptimizedV4RouterFailed(); - error OptimizedV5RouterFailed(); - - bytes public v5DataParams = - hex"12aa3caf000000000000000000000000f0694acc9e941b176e17b9ef923e71e7b8b2477a0000000000000000000000007f5c764cbc14f9669b88837ca1490cca17c316070000000000000000000000006fd9d7ad17242c41f7131d257212c54a0e816691000000000000000000000000f0694acc9e941b176e17b9ef923e71e7b8b2477a000000000000000000000000eac5f0d4a9a45e1f9fdd0e7e2882e9f60e30115600000000000000000000000000000000000000000000000000000000000186a0000000000000000000000000000000000000000000000000003e530a0ee30f45000000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000001400000000000000000000000000000000000000000000000000000000000000160000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001f50000000000000000000000000000000000000000000000000000000001d700a007e5c0d20000000000000000000000000000000000000000000000000001b30001505126a132dab612db5cb9fc9ac426a0cc215a3423f9c97f5c764cbc14f9669b88837ca1490cca17c316070004f41766d8000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002e2669c6242f00000000000000000000000000000000000000000000000000000000000000a0000000000000000000000000f0694acc9e941b176e17b9ef923e71e7b8b2477a00000000000000000000000000000000000000000000000000000000644fdfe900000000000000000000000000000000000000000000000000000000000000010000000000000000000000007f5c764cbc14f9669b88837ca1490cca17c316070000000000000000000000004200000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000102a0000000000000000000000000000000000000000000000000003e530a0ee30f45ee63c1e581ad4c666fc170b468b19988959eb931a3676f0e9f42000000000000000000000000000000000000061111111254eeb25477b68fb85ed929f73a9605820000000000000000000000cfee7c08"; - bytes public v4DataParams = - hex"7c025200000000000000000000000000f0694acc9e941b176e17b9ef923e71e7b8b2477a000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000001800000000000000000000000007f5c764cbc14f9669b88837ca1490cca17c316070000000000000000000000006fd9d7ad17242c41f7131d257212c54a0e816691000000000000000000000000f0694acc9e941b176e17b9ef923e71e7b8b2477a000000000000000000000000eac5f0d4a9a45e1f9fdd0e7e2882e9f60e30115600000000000000000000000000000000000000000000000000000000000186a0000000000000000000000000000000000000000000000000003e1aba8fed6bc100000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001e10000000000000000000000000000000000000000000000000000000001a300a007e5c0d200000000000000000000000000000000000000000000000000017f00011c4330f9d5940c2313636546ab9852354860dce275dbad00000000000000000000000000000000000000000000000000002ecaf7212e2f002424b31a0c000000000000000000000000f0694acc9e941b176e17b9ef923e71e7b8b2477a00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000fffd8963efd1fc6a506488495d951d5263988d2500000000000000000000000000000000000000000000000000000000000000a000000000000000000000000000000000000000000000000000000000000000200000000000000000000000007f5c764cbc14f9669b88837ca1490cca17c3160702a0000000000000000000000000000000000000000000000000003e1aba8fed6bc1ee63c1e581ad4c666fc170b468b19988959eb931a3676f0e9f42000000000000000000000000000000000000061111111254760f7ab3f16433eea9304126dcd19900000000000000000000000000000000000000000000000000000000000186a000000000000000000000000000000000000000000000000000000000000000cfee7c08"; - - function run() public { - require(block.chainid == 10, "script can only be run on optimism"); - string memory file = "broadcast/Deploy.s.sol/10/run-latest.json"; - string memory json = vm.readFile(file); - address v5Rtr = json.readAddress( - ".transactions[1].additionalContracts[0].address" - ); - - address v4Rtr = json.readAddress( - ".transactions[2].additionalContracts[0].address" - ); - - // =========================== - // ======== Execution ======== - // =========================== - - vm.startBroadcast(); - // Optimized v5 router approval - IERC20(USDC).approve(v5Rtr, 100_000); - // Regular v5 router approval - IERC20(USDC).approve(address(v5AggregationRouter), 100_000); - - // Parse calldata returned by the api to get params - ( - , - IV5AggregationRouter.SwapDescription memory v5Desc, - bytes memory v5Permit, - bytes memory v5Data - ) = abi.decode( - this.returnSliceBytes(v5DataParams), - (address, IV5AggregationRouter.SwapDescription, bytes, bytes) - ); - // Regular v5 swap call - v5AggregationRouter.swap( - v5AggregationExecutor, - v5Desc, - v5Permit, - v5Data - ); - - // Opitmized router v5 swap call - (bool v5Ok, ) = payable(v5Rtr).call( - abi.encode(UNI, 100_000, v5Desc.minReturnAmount, v5Data, false) - ); - - if (!v5Ok) { - revert OptimizedV5RouterFailed(); - } - - // Parse v4 calldata returned by the 1inch api - ( - , - IV4AggregationRouter.SwapDescription memory v4Desc, - bytes memory v4Data - ) = abi.decode( - this.returnSliceBytes(v4DataParams), - (address, IV4AggregationRouter.SwapDescription, bytes) - ); - - // Optimized v4 router approval - IERC20(USDC).approve(v4Rtr, 100_000); - // Regular v4 router approval - IERC20(USDC).approve(address(v4AggregationRouter), 100_000); - - // Regular v4 swap call - v4AggregationRouter.swap(v4AggregationExecutor, v4Desc, v4Data); - - // Optimized v4 swap call - (bool v4Ok, ) = payable(v4Rtr).call( - abi.encode(UNI, 100_000, v4Desc.minReturnAmount, v4Data, false) - ); - if (!v4Ok) { - revert OptimizedV4RouterFailed(); - } - } + using stdJson for string; + + error OptimizedV4RouterFailed(); + error OptimizedV5RouterFailed(); + + bytes public v5DataParams = + hex"12aa3caf000000000000000000000000f0694acc9e941b176e17b9ef923e71e7b8b2477a0000000000000000000000007f5c764cbc14f9669b88837ca1490cca17c316070000000000000000000000006fd9d7ad17242c41f7131d257212c54a0e816691000000000000000000000000f0694acc9e941b176e17b9ef923e71e7b8b2477a000000000000000000000000eac5f0d4a9a45e1f9fdd0e7e2882e9f60e30115600000000000000000000000000000000000000000000000000000000000186a0000000000000000000000000000000000000000000000000003e530a0ee30f45000000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000001400000000000000000000000000000000000000000000000000000000000000160000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001f50000000000000000000000000000000000000000000000000000000001d700a007e5c0d20000000000000000000000000000000000000000000000000001b30001505126a132dab612db5cb9fc9ac426a0cc215a3423f9c97f5c764cbc14f9669b88837ca1490cca17c316070004f41766d8000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002e2669c6242f00000000000000000000000000000000000000000000000000000000000000a0000000000000000000000000f0694acc9e941b176e17b9ef923e71e7b8b2477a00000000000000000000000000000000000000000000000000000000644fdfe900000000000000000000000000000000000000000000000000000000000000010000000000000000000000007f5c764cbc14f9669b88837ca1490cca17c316070000000000000000000000004200000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000102a0000000000000000000000000000000000000000000000000003e530a0ee30f45ee63c1e581ad4c666fc170b468b19988959eb931a3676f0e9f42000000000000000000000000000000000000061111111254eeb25477b68fb85ed929f73a9605820000000000000000000000cfee7c08"; + bytes public v4DataParams = + hex"7c025200000000000000000000000000f0694acc9e941b176e17b9ef923e71e7b8b2477a000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000001800000000000000000000000007f5c764cbc14f9669b88837ca1490cca17c316070000000000000000000000006fd9d7ad17242c41f7131d257212c54a0e816691000000000000000000000000f0694acc9e941b176e17b9ef923e71e7b8b2477a000000000000000000000000eac5f0d4a9a45e1f9fdd0e7e2882e9f60e30115600000000000000000000000000000000000000000000000000000000000186a0000000000000000000000000000000000000000000000000003e1aba8fed6bc100000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001e10000000000000000000000000000000000000000000000000000000001a300a007e5c0d200000000000000000000000000000000000000000000000000017f00011c4330f9d5940c2313636546ab9852354860dce275dbad00000000000000000000000000000000000000000000000000002ecaf7212e2f002424b31a0c000000000000000000000000f0694acc9e941b176e17b9ef923e71e7b8b2477a00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000fffd8963efd1fc6a506488495d951d5263988d2500000000000000000000000000000000000000000000000000000000000000a000000000000000000000000000000000000000000000000000000000000000200000000000000000000000007f5c764cbc14f9669b88837ca1490cca17c3160702a0000000000000000000000000000000000000000000000000003e1aba8fed6bc1ee63c1e581ad4c666fc170b468b19988959eb931a3676f0e9f42000000000000000000000000000000000000061111111254760f7ab3f16433eea9304126dcd19900000000000000000000000000000000000000000000000000000000000186a000000000000000000000000000000000000000000000000000000000000000cfee7c08"; + + function run() public { + require(block.chainid == 10, "script can only be run on optimism"); + string memory file = "broadcast/Deploy.s.sol/10/run-latest.json"; + string memory json = vm.readFile(file); + address v5Rtr = json.readAddress(".transactions[1].additionalContracts[0].address"); + + address v4Rtr = json.readAddress(".transactions[2].additionalContracts[0].address"); + + // =========================== + // ======== Execution ======== + // =========================== + + vm.startBroadcast(); + // Optimized v5 router approval + IERC20(USDC).approve(v5Rtr, 100_000); + // Regular v5 router approval + IERC20(USDC).approve(address(v5AggregationRouter), 100_000); + + // Parse calldata returned by the api to get params + ( + , + IV5AggregationRouter.SwapDescription memory v5Desc, + bytes memory v5Permit, + bytes memory v5Data + ) = abi.decode( + this.returnSliceBytes(v5DataParams), + (address, IV5AggregationRouter.SwapDescription, bytes, bytes) + ); + // Regular v5 swap call + v5AggregationRouter.swap(v5AggregationExecutor, v5Desc, v5Permit, v5Data); + + // Opitmized router v5 swap call + (bool v5Ok,) = + payable(v5Rtr).call(abi.encode(UNI, 100_000, v5Desc.minReturnAmount, v5Data, false)); + + if (!v5Ok) revert OptimizedV5RouterFailed(); + + // Parse v4 calldata returned by the 1inch api + (, IV4AggregationRouter.SwapDescription memory v4Desc, bytes memory v4Data) = abi.decode( + this.returnSliceBytes(v4DataParams), (address, IV4AggregationRouter.SwapDescription, bytes) + ); + + // Optimized v4 router approval + IERC20(USDC).approve(v4Rtr, 100_000); + // Regular v4 router approval + IERC20(USDC).approve(address(v4AggregationRouter), 100_000); + + // Regular v4 swap call + v4AggregationRouter.swap(v4AggregationExecutor, v4Desc, v4Data); + + // Optimized v4 swap call + (bool v4Ok,) = + payable(v4Rtr).call(abi.encode(UNI, 100_000, v4Desc.minReturnAmount, v4Data, false)); + if (!v4Ok) revert OptimizedV4RouterFailed(); + } } diff --git a/script/Deploy.s.sol b/script/Deploy.s.sol index d4e2e7d..6d6d959 100644 --- a/script/Deploy.s.sol +++ b/script/Deploy.s.sol @@ -13,28 +13,22 @@ import {OneInchRouterFactory} from "src/RouterFactory.sol"; // 100_000 //); contract Deploy is Script, OneInchContracts { - function run() public { - // Deploy the optimized router factory - vm.broadcast(); - OneInchRouterFactory factory = new OneInchRouterFactory( + function run() public { + // Deploy the optimized router factory + vm.broadcast(); + OneInchRouterFactory factory = new OneInchRouterFactory( v5AggregationExecutor, v5AggregationRouter, v4AggregationExecutor, v4AggregationRouter ); - // Deploy the optimized router for V5Aggregation - vm.broadcast(); - factory.deploy( - OneInchRouterFactory.RouterTypes.V5AggregationRouter, - USDC - ); + // Deploy the optimized router for V5Aggregation + vm.broadcast(); + factory.deploy(OneInchRouterFactory.RouterTypes.V5AggregationRouter, USDC); - // Deploy the optimized router for V4Aggregation - vm.broadcast(); - factory.deploy( - OneInchRouterFactory.RouterTypes.V4AggregationRouter, - USDC - ); - } + // Deploy the optimized router for V4Aggregation + vm.broadcast(); + factory.deploy(OneInchRouterFactory.RouterTypes.V4AggregationRouter, USDC); + } } diff --git a/src/AggregationBaseRouter.sol b/src/AggregationBaseRouter.sol index 029915d..5e0ddbc 100644 --- a/src/AggregationBaseRouter.sol +++ b/src/AggregationBaseRouter.sol @@ -1,44 +1,63 @@ +// SPDX-License-Identifier: MIT +pragma solidity >=0.8.0; + import {IV5AggregationExecutor} from "src/interfaces/IV5AggregationExecutor.sol"; import {IV5AggregationRouter} from "src/interfaces/IV5AggregationRouter.sol"; import {IV4AggregationExecutor} from "src/interfaces/IV4AggregationExecutor.sol"; import {IV4AggregationRouter} from "src/interfaces/IV4AggregationRouter.sol"; +/// @notice An abstract class with the necessary class variables to make a aggregation v5 optimized +/// router abstract contract AggregationV5BaseRouter { - IV5AggregationExecutor public immutable AGGREGATION_EXECUTOR; - IV5AggregationRouter public immutable AGGREGATION_ROUTER; - - address public immutable TOKEN; - address public immutable SOURCE_RECEIVER; - - constructor( - IV5AggregationExecutor aggregationExecutor, - IV5AggregationRouter aggregationRouter, - address token, - address sourceReceiver - ) { - AGGREGATION_EXECUTOR = aggregationExecutor; - AGGREGATION_ROUTER = aggregationRouter; - TOKEN = token; - SOURCE_RECEIVER = sourceReceiver; - } + /// @notice The contract used to execute the swap along an optimized path + IV5AggregationExecutor public immutable AGGREGATION_EXECUTOR; + + /// @notice The 1inch contract with the unoptimized route + IV5AggregationRouter public immutable AGGREGATION_ROUTER; + + /// @notice The token being from a user to be swapped + address public immutable TOKEN; + + /// @notice Where the tokens are going in the router and it should match the executor + address public immutable SOURCE_RECEIVER; + + constructor( + IV5AggregationExecutor aggregationExecutor, + IV5AggregationRouter aggregationRouter, + address token, + address sourceReceiver + ) { + AGGREGATION_EXECUTOR = aggregationExecutor; + AGGREGATION_ROUTER = aggregationRouter; + TOKEN = token; + SOURCE_RECEIVER = sourceReceiver; + } } +/// @notice An abstract class with the necessary class variables to make a aggregation v4 optimized +/// router abstract contract AggregationV4BaseRouter { - IV4AggregationExecutor public immutable AGGREGATION_EXECUTOR; - IV4AggregationRouter public immutable AGGREGATION_ROUTER; - - address public immutable TOKEN; - address public immutable SOURCE_RECEIVER; - - constructor( - IV4AggregationExecutor aggregationExecutor, - IV4AggregationRouter aggregationRouter, - address token, - address sourceReceiver - ) { - AGGREGATION_EXECUTOR = aggregationExecutor; - AGGREGATION_ROUTER = aggregationRouter; - TOKEN = token; - SOURCE_RECEIVER = sourceReceiver; - } + /// @notice The contract used to execute the swap along an optimized path + IV4AggregationExecutor public immutable AGGREGATION_EXECUTOR; + + /// @notice The 1inch contract with the unoptimized route + IV4AggregationRouter public immutable AGGREGATION_ROUTER; + + /// @notice The token being from a user to be swapped + address public immutable TOKEN; + + /// @notice Where the tokens are going in the router and it should match the executor + address public immutable SOURCE_RECEIVER; + + constructor( + IV4AggregationExecutor aggregationExecutor, + IV4AggregationRouter aggregationRouter, + address token, + address sourceReceiver + ) { + AGGREGATION_EXECUTOR = aggregationExecutor; + AGGREGATION_ROUTER = aggregationRouter; + TOKEN = token; + SOURCE_RECEIVER = sourceReceiver; + } } diff --git a/src/RouterFactory.sol b/src/RouterFactory.sol index bfae9ce..deb2955 100644 --- a/src/RouterFactory.sol +++ b/src/RouterFactory.sol @@ -9,120 +9,107 @@ import {Create2} from "src/lib/Create2.sol"; import {V5Router} from "src/V5Router.sol"; import {V4Router} from "src/V4Router.sol"; +/// @notice a factory for deploying a router for a given asset and router type contract OneInchRouterFactory { - error RouterTypeDoesNotExist(); + error RouterTypeDoesNotExist(); - enum RouterTypes { - V4AggregationRouter, - V5AggregationRouter - } + enum RouterTypes { + V4AggregationRouter, + V5AggregationRouter + } - IV5AggregationExecutor public immutable V5_AGGREGATION_EXECUTOR; - IV5AggregationRouter public immutable V5_AGGREGATION_ROUTER; - IV4AggregationExecutor public immutable V4_AGGREGATION_EXECUTOR; - IV4AggregationRouter public immutable V4_AGGREGATION_ROUTER; - address public immutable V5_SOURCE_RECEIVER; - address public immutable V4_SOURCE_RECEIVER; - - event RouterDeployed(RouterTypes type_, address indexed asset); - - // Add V4 params - constructor( - IV5AggregationExecutor v5AggregationExecutor, - IV5AggregationRouter v5AggregationRouter, - IV4AggregationExecutor v4AggregationExecutor, - IV4AggregationRouter v4AggregationRouter - ) { - V5_AGGREGATION_EXECUTOR = v5AggregationExecutor; - V5_AGGREGATION_ROUTER = v5AggregationRouter; - V5_SOURCE_RECEIVER = address(v5AggregationExecutor); - V4_AGGREGATION_EXECUTOR = v4AggregationExecutor; - V4_AGGREGATION_ROUTER = v4AggregationRouter; - V4_SOURCE_RECEIVER = address(v4AggregationExecutor); - } + /// @notice The v5 contract used to execute the swap along an optimized path + IV5AggregationExecutor public immutable V5_AGGREGATION_EXECUTOR; + + /// @notice The v5 1inch contract with the unoptimized route + IV5AggregationRouter public immutable V5_AGGREGATION_ROUTER; + + /// @notice The v4 contract used to execute the swap along an optimized path + IV4AggregationExecutor public immutable V4_AGGREGATION_EXECUTOR; + + /// @notice The v4 1inch contract with the unoptimized route + IV4AggregationRouter public immutable V4_AGGREGATION_ROUTER; + + /// @notice Where the tokens are going in the v5 router and it should match the executor + address public immutable V5_SOURCE_RECEIVER; - function deploy(RouterTypes type_, address asset) - external - returns (address) - { - bytes32 salt = _salt(asset); - address router; - if (type_ == RouterTypes.V5AggregationRouter) { - router = address( - new V5Router{salt: salt}( + /// @notice Where the tokens are going in the v4 router and it should match the executor + address public immutable V4_SOURCE_RECEIVER; + + event RouterDeployed(RouterTypes type_, address indexed asset); + + // Add V4 params + constructor( + IV5AggregationExecutor v5AggregationExecutor, + IV5AggregationRouter v5AggregationRouter, + IV4AggregationExecutor v4AggregationExecutor, + IV4AggregationRouter v4AggregationRouter + ) { + V5_AGGREGATION_EXECUTOR = v5AggregationExecutor; + V5_AGGREGATION_ROUTER = v5AggregationRouter; + V5_SOURCE_RECEIVER = address(v5AggregationExecutor); + V4_AGGREGATION_EXECUTOR = v4AggregationExecutor; + V4_AGGREGATION_ROUTER = v4AggregationRouter; + V4_SOURCE_RECEIVER = address(v4AggregationExecutor); + } + + function deploy(RouterTypes type_, address asset) external returns (address) { + bytes32 salt = _salt(asset); + address router; + if (type_ == RouterTypes.V5AggregationRouter) { + router = address( + new V5Router{salt: salt}( V5_AGGREGATION_ROUTER, V5_AGGREGATION_EXECUTOR, asset, V5_SOURCE_RECEIVER ) - ); - } else if (type_ == RouterTypes.V4AggregationRouter) { - router = address( - new V4Router{salt: salt}( + ); + } else if (type_ == RouterTypes.V4AggregationRouter) { + router = address( + new V4Router{salt: salt}( V4_AGGREGATION_ROUTER, V4_AGGREGATION_EXECUTOR, asset, V4_SOURCE_RECEIVER ) - ); - } else { - revert RouterTypeDoesNotExist(); - } - emit RouterDeployed(type_, asset); - return router; + ); + } else { + revert RouterTypeDoesNotExist(); } + emit RouterDeployed(type_, asset); + return router; + } - function computeAddress(RouterTypes type_, address asset) - external - view - returns (address) - { - if (type_ == RouterTypes.V4AggregationRouter) - return _computeV4AggregationRouterAddress(asset); - else if (type_ == RouterTypes.V5AggregationRouter) - return _computeV5AggregationRouterAddress(asset); - else revert RouterTypeDoesNotExist(); + function computeAddress(RouterTypes type_, address asset) external view returns (address) { + if (type_ == RouterTypes.V4AggregationRouter) { + return _computeV4AggregationRouterAddress(asset); + } else if (type_ == RouterTypes.V5AggregationRouter) { + return _computeV5AggregationRouterAddress(asset); + } else { + revert RouterTypeDoesNotExist(); } + } - function _computeV4AggregationRouterAddress(address asset) - internal - view - returns (address) - { - return - Create2.computeCreate2Address( - _salt(asset), - address(this), - type(V4Router).creationCode, - abi.encode( - V4_AGGREGATION_ROUTER, - V4_AGGREGATION_EXECUTOR, - asset, - V4_SOURCE_RECEIVER - ) - ); - } + function _computeV4AggregationRouterAddress(address asset) internal view returns (address) { + return Create2.computeCreate2Address( + _salt(asset), + address(this), + type(V4Router).creationCode, + abi.encode(V4_AGGREGATION_ROUTER, V4_AGGREGATION_EXECUTOR, asset, V4_SOURCE_RECEIVER) + ); + } - function _computeV5AggregationRouterAddress(address asset) - internal - view - returns (address) - { - return - Create2.computeCreate2Address( - _salt(asset), - address(this), - type(V5Router).creationCode, - abi.encode( - V5_AGGREGATION_ROUTER, - V5_AGGREGATION_EXECUTOR, - asset, - V5_SOURCE_RECEIVER - ) - ); - } + function _computeV5AggregationRouterAddress(address asset) internal view returns (address) { + return Create2.computeCreate2Address( + _salt(asset), + address(this), + type(V5Router).creationCode, + abi.encode(V5_AGGREGATION_ROUTER, V5_AGGREGATION_EXECUTOR, asset, V5_SOURCE_RECEIVER) + ); + } - function _salt(address asset) internal pure returns (bytes32) { - return bytes32(uint256(uint160(asset))); - } + function _salt(address asset) internal pure returns (bytes32) { + return bytes32(uint256(uint160(asset))); + } } diff --git a/src/V4Router.sol b/src/V4Router.sol index a1fd15c..d6dc93c 100644 --- a/src/V4Router.sol +++ b/src/V4Router.sol @@ -2,53 +2,45 @@ pragma solidity >=0.8.0; import {IERC20} from "openzeppelin-contracts/contracts/token/ERC20/IERC20.sol"; + import {IV4AggregationExecutor} from "src/interfaces/IV4AggregationExecutor.sol"; import {IV4AggregationRouter} from "src/interfaces/IV4AggregationRouter.sol"; import {AggregationV4BaseRouter} from "src/AggregationBaseRouter.sol"; +/// @notice A router to swap tokens using 1inch v4 aggregation contract V4Router is AggregationV4BaseRouter { - constructor( - IV4AggregationRouter aggregationRouter, - IV4AggregationExecutor aggregationExecutor, - address token, - address sourceReceiver - ) - AggregationV4BaseRouter( - aggregationExecutor, - aggregationRouter, - token, - sourceReceiver - ) - {} + constructor( + IV4AggregationRouter aggregationRouter, + IV4AggregationExecutor aggregationExecutor, + address token, + address sourceReceiver + ) AggregationV4BaseRouter(aggregationExecutor, aggregationRouter, token, sourceReceiver) {} - receive() external payable {} + receive() external payable {} - // TODO: minReturnAmount is the minimum allowed output amount, and can probably reduced to a max int of 500. - // - // the flags match specific constant masks. there is no documentation on these, and there seems to be no specific logic on them - fallback() external payable { - ( - address dstToken, - uint256 amount, - uint256 minReturnAmount, - bytes memory data, - bool flags - ) = abi.decode(msg.data, (address, uint256, uint256, bytes, bool)); - IERC20(TOKEN).transferFrom(msg.sender, address(this), amount); - IERC20(TOKEN).approve(address(AGGREGATION_ROUTER), amount); - AGGREGATION_ROUTER.swap( - AGGREGATION_EXECUTOR, - IV4AggregationRouter.SwapDescription({ - srcToken: IERC20(TOKEN), - dstToken: IERC20(dstToken), - srcReceiver: payable(SOURCE_RECEIVER), - dstReceiver: payable(msg.sender), - amount: amount, - minReturnAmount: minReturnAmount, - flags: flags ? 1 : 0, - permit: "" - }), - data - ); - } + // TODO: minReturnAmount is the minimum allowed output amount, and can probably reduced to a max + // int of 500. Also, amount and destination have opportunities to be optimized. + // + // the flags match specific constant masks. there is no documentation on these, and there seems to + // be no specific logic on them + fallback() external payable { + (address dstToken, uint256 amount, uint256 minReturnAmount, bytes memory data, bool flags) = + abi.decode(msg.data, (address, uint256, uint256, bytes, bool)); + IERC20(TOKEN).transferFrom(msg.sender, address(this), amount); + IERC20(TOKEN).approve(address(AGGREGATION_ROUTER), amount); + AGGREGATION_ROUTER.swap( + AGGREGATION_EXECUTOR, + IV4AggregationRouter.SwapDescription({ + srcToken: IERC20(TOKEN), + dstToken: IERC20(dstToken), + srcReceiver: payable(SOURCE_RECEIVER), + dstReceiver: payable(msg.sender), + amount: amount, + minReturnAmount: minReturnAmount, + flags: flags ? 1 : 0, + permit: "" + }), + data + ); + } } diff --git a/src/V5Router.sol b/src/V5Router.sol index 3321fbd..984f024 100644 --- a/src/V5Router.sol +++ b/src/V5Router.sol @@ -1,54 +1,46 @@ // SPDX-License-Identifier: MIT pragma solidity >=0.8.0; +import {IERC20} from "openzeppelin-contracts/contracts/token/ERC20/IERC20.sol"; + import {IV5AggregationExecutor} from "src/interfaces/IV5AggregationExecutor.sol"; import {IV5AggregationRouter} from "src/interfaces/IV5AggregationRouter.sol"; -import {IERC20} from "openzeppelin-contracts/contracts/token/ERC20/IERC20.sol"; import {AggregationV5BaseRouter} from "src/AggregationBaseRouter.sol"; +/// @notice A router to swap tokens using 1inch v5 aggregation contract V5Router is AggregationV5BaseRouter { - constructor( - IV5AggregationRouter aggregationRouter, - IV5AggregationExecutor aggregationExecutor, - address token, - address sourceReceiver - ) - AggregationV5BaseRouter( - aggregationExecutor, - aggregationRouter, - token, - sourceReceiver - ) - {} + constructor( + IV5AggregationRouter aggregationRouter, + IV5AggregationExecutor aggregationExecutor, + address token, + address sourceReceiver + ) AggregationV5BaseRouter(aggregationExecutor, aggregationRouter, token, sourceReceiver) {} - receive() external payable {} + receive() external payable {} - // TODO: minReturnAmount is the minimum allowed output amount, and can probably reduced to a max int of 500. - // - // the flags match specific constant masks. there is no documentation on these, and there seems to be no specific logic on them - fallback() external payable { - ( - address dstToken, - uint256 amount, - uint256 minReturnAmount, - bytes memory data, - bool flags - ) = abi.decode(msg.data, (address, uint256, uint256, bytes, bool)); - IERC20(TOKEN).transferFrom(msg.sender, address(this), amount); - IERC20(TOKEN).approve(address(AGGREGATION_ROUTER), amount); - AGGREGATION_ROUTER.swap( - AGGREGATION_EXECUTOR, - IV5AggregationRouter.SwapDescription({ - srcToken: IERC20(TOKEN), - dstToken: IERC20(dstToken), - srcReceiver: payable(SOURCE_RECEIVER), - dstReceiver: payable(msg.sender), - amount: amount, - minReturnAmount: minReturnAmount, - flags: flags ? 1 : 0 - }), - "", - data - ); - } + // TODO: minReturnAmount is the minimum allowed output amount, and can probably reduced to a max + // int of 500. + // + // the flags match specific constant masks. there is no documentation on these, and there seems to + // be no specific logic on them + fallback() external payable { + (address dstToken, uint256 amount, uint256 minReturnAmount, bytes memory data, bool flags) = + abi.decode(msg.data, (address, uint256, uint256, bytes, bool)); + IERC20(TOKEN).transferFrom(msg.sender, address(this), amount); + IERC20(TOKEN).approve(address(AGGREGATION_ROUTER), amount); + AGGREGATION_ROUTER.swap( + AGGREGATION_EXECUTOR, + IV5AggregationRouter.SwapDescription({ + srcToken: IERC20(TOKEN), + dstToken: IERC20(dstToken), + srcReceiver: payable(SOURCE_RECEIVER), + dstReceiver: payable(msg.sender), + amount: amount, + minReturnAmount: minReturnAmount, + flags: flags ? 1 : 0 + }), + "", + data + ); + } } diff --git a/src/interfaces/IV4AggregationExecutor.sol b/src/interfaces/IV4AggregationExecutor.sol index 96fe2b2..410149b 100644 --- a/src/interfaces/IV4AggregationExecutor.sol +++ b/src/interfaces/IV4AggregationExecutor.sol @@ -1,9 +1,10 @@ // SPDX-License-Identifier: MIT -// permalink: https://optimistic.etherscan.io/address/0x1111111254760f7ab3f16433eea9304126dcd199#code#L990 +// permalink: +// https://optimistic.etherscan.io/address/0x1111111254760f7ab3f16433eea9304126dcd199#code#L990 pragma solidity >=0.8.0; /// @title Interface for making arbitrary calls during swap interface IV4AggregationExecutor { - /// @notice Make calls on `msgSender` with specified data - function callBytes(address msgSender, bytes calldata data) external payable; // 0x2636f7f8 + /// @notice Make calls on `msgSender` with specified data + function callBytes(address msgSender, bytes calldata data) external payable; // 0x2636f7f8 } diff --git a/src/interfaces/IV4AggregationRouter.sol b/src/interfaces/IV4AggregationRouter.sol index ddb8c2b..39ea372 100644 --- a/src/interfaces/IV4AggregationRouter.sol +++ b/src/interfaces/IV4AggregationRouter.sol @@ -4,27 +4,19 @@ import {IV4AggregationExecutor} from "src/interfaces/IV4AggregationExecutor.sol" import {IERC20} from "openzeppelin-contracts/contracts/token/ERC20/IERC20.sol"; interface IV4AggregationRouter { - struct SwapDescription { - IERC20 srcToken; - IERC20 dstToken; - address payable srcReceiver; - address payable dstReceiver; - uint256 amount; - uint256 minReturnAmount; - uint256 flags; - bytes permit; - } + struct SwapDescription { + IERC20 srcToken; + IERC20 dstToken; + address payable srcReceiver; + address payable dstReceiver; + uint256 amount; + uint256 minReturnAmount; + uint256 flags; + bytes permit; + } - function swap( - IV4AggregationExecutor executor, - SwapDescription calldata desc, - bytes calldata data - ) - external - payable - returns ( - uint256 returnAmount, - uint256 spentAmount, - uint256 gasLeft - ); + function swap(IV4AggregationExecutor executor, SwapDescription calldata desc, bytes calldata data) + external + payable + returns (uint256 returnAmount, uint256 spentAmount, uint256 gasLeft); } diff --git a/src/interfaces/IV5AggregationExecutor.sol b/src/interfaces/IV5AggregationExecutor.sol index f13c3e6..c13b694 100644 --- a/src/interfaces/IV5AggregationExecutor.sol +++ b/src/interfaces/IV5AggregationExecutor.sol @@ -2,6 +2,6 @@ pragma solidity >=0.8.0; /// @title Interface for making arbitrary calls during swap interface IV5AggregationExecutor { - /// @notice propagates information about original msg.sender and executes arbitrary data - function execute(address msgSender) external payable; // 0x4b64e492 + /// @notice propagates information about original msg.sender and executes arbitrary data + function execute(address msgSender) external payable; // 0x4b64e492 } diff --git a/src/interfaces/IV5AggregationRouter.sol b/src/interfaces/IV5AggregationRouter.sol index c9d197c..2eaaa82 100644 --- a/src/interfaces/IV5AggregationRouter.sol +++ b/src/interfaces/IV5AggregationRouter.sol @@ -5,20 +5,20 @@ import {IERC20} from "openzeppelin-contracts/contracts/token/ERC20/IERC20.sol"; // V5 router interface interface IV5AggregationRouter { - struct SwapDescription { - IERC20 srcToken; - IERC20 dstToken; - address payable srcReceiver; - address payable dstReceiver; - uint256 amount; - uint256 minReturnAmount; - uint256 flags; - } + struct SwapDescription { + IERC20 srcToken; + IERC20 dstToken; + address payable srcReceiver; + address payable dstReceiver; + uint256 amount; + uint256 minReturnAmount; + uint256 flags; + } - function swap( - IV5AggregationExecutor executor, - SwapDescription calldata desc, - bytes calldata permit, - bytes calldata data - ) external payable returns (uint256 returnAmount, uint256 spentAmount); + function swap( + IV5AggregationExecutor executor, + SwapDescription calldata desc, + bytes calldata permit, + bytes calldata data + ) external payable returns (uint256 returnAmount, uint256 spentAmount); } diff --git a/test/1InchContracts.sol b/test/1InchContracts.sol index a7a4640..c85d4a6 100644 --- a/test/1InchContracts.sol +++ b/test/1InchContracts.sol @@ -7,23 +7,19 @@ import {IV4AggregationExecutor} from "src/interfaces/IV4AggregationExecutor.sol" import {IV4AggregationRouter} from "src/interfaces/IV4AggregationRouter.sol"; contract OneInchContracts { - IV5AggregationRouter v5AggregationRouter = - IV5AggregationRouter(0x1111111254EEB25477B68fb85Ed929f73A960582); - IV5AggregationExecutor v5AggregationExecutor = - IV5AggregationExecutor(0xf0694ACc9E941B176E17B9Ef923e71E7B8b2477A); - IV4AggregationRouter v4AggregationRouter = - IV4AggregationRouter(0x1111111254760F7ab3F16433eea9304126DCd199); - IV4AggregationExecutor v4AggregationExecutor = - IV4AggregationExecutor(0xf0694ACc9E941B176E17B9Ef923e71E7B8b2477A); + IV5AggregationRouter v5AggregationRouter = + IV5AggregationRouter(0x1111111254EEB25477B68fb85Ed929f73A960582); + IV5AggregationExecutor v5AggregationExecutor = + IV5AggregationExecutor(0xf0694ACc9E941B176E17B9Ef923e71E7B8b2477A); + IV4AggregationRouter v4AggregationRouter = + IV4AggregationRouter(0x1111111254760F7ab3F16433eea9304126DCd199); + IV4AggregationExecutor v4AggregationExecutor = + IV4AggregationExecutor(0xf0694ACc9E941B176E17B9Ef923e71E7B8b2477A); - address public immutable USDC = 0x7F5c764cBc14f9669B88837ca1490cCa17c31607; - address public immutable UNI = 0x6fd9d7AD17242c41f7131d257212c54A0e816691; + address public immutable USDC = 0x7F5c764cBc14f9669B88837ca1490cCa17c31607; + address public immutable UNI = 0x6fd9d7AD17242c41f7131d257212c54A0e816691; - function returnSliceBytes(bytes calldata d) - public - pure - returns (bytes memory) - { - return d[4:]; - } + function returnSliceBytes(bytes calldata d) public pure returns (bytes memory) { + return d[4:]; + } } diff --git a/test/RouterFactory.t.sol b/test/RouterFactory.t.sol index 68446d0..59c026b 100644 --- a/test/RouterFactory.t.sol +++ b/test/RouterFactory.t.sol @@ -6,26 +6,35 @@ import {OneInchRouterFactory} from "src/RouterFactory.sol"; import {OneInchContracts} from "test/1InchContracts.sol"; contract RouterFactoryTest is Test, OneInchContracts { - OneInchRouterFactory factory; + OneInchRouterFactory factory; - function test_deployV5Router() public { - factory = new OneInchRouterFactory( + function test_deployV5Router() public { + factory = new OneInchRouterFactory( v5AggregationExecutor, v5AggregationRouter, v4AggregationExecutor, v4AggregationRouter ); - address V5Router = factory.deploy( - OneInchRouterFactory.RouterTypes.V5AggregationRouter, - USDC - ); - assertEq( - V5Router, - factory.computeAddress( - OneInchRouterFactory.RouterTypes.V5AggregationRouter, - USDC - ), - "V5Router address should be correct" + address V5Router = factory.deploy(OneInchRouterFactory.RouterTypes.V5AggregationRouter, USDC); + assertEq( + V5Router, + factory.computeAddress(OneInchRouterFactory.RouterTypes.V5AggregationRouter, USDC), + "V5Router address should be correct" + ); + } + + function test_deployV4Router() public { + factory = new OneInchRouterFactory( + v5AggregationExecutor, + v5AggregationRouter, + v4AggregationExecutor, + v4AggregationRouter ); - } + address V4Router = factory.deploy(OneInchRouterFactory.RouterTypes.V4AggregationRouter, USDC); + assertEq( + V4Router, + factory.computeAddress(OneInchRouterFactory.RouterTypes.V4AggregationRouter, USDC), + "V4Router address should be correct" + ); + } } diff --git a/test/V4Router.t.sol b/test/V4Router.t.sol index 050c1a3..f6aa687 100644 --- a/test/V4Router.t.sol +++ b/test/V4Router.t.sol @@ -1,79 +1,69 @@ // SPDX-License-Identifier: MIT pragma solidity >=0.8.0; -import "forge-std/Test.sol"; +import {IERC20} from "openzeppelin-contracts/contracts/token/ERC20/IERC20.sol"; +import {Test} from "forge-std/Test.sol"; + import {OneInchRouterFactory} from "src/RouterFactory.sol"; import {OneInchContracts} from "test/1InchContracts.sol"; import {IV4AggregationRouter} from "src/interfaces/IV4AggregationRouter.sol"; -import {IERC20} from "openzeppelin-contracts/contracts/token/ERC20/IERC20.sol"; contract V4RouterForkTestBase is Test, OneInchContracts { - OneInchRouterFactory factory; - address addr; + OneInchRouterFactory factory; + address addr; - function setUp() public { - vm.createSelectFork(vm.rpcUrl("optimism"), 95_544_472); - factory = new OneInchRouterFactory( + function setUp() public { + vm.createSelectFork(vm.rpcUrl("optimism"), 95_544_472); + factory = new OneInchRouterFactory( v5AggregationExecutor, v5AggregationRouter, v4AggregationExecutor, v4AggregationRouter ); - factory.deploy( - OneInchRouterFactory.RouterTypes.V4AggregationRouter, - USDC - ); - deal(USDC, address(this), 100_000_000); - addr = 0xEAC5F0d4A9a45E1f9FdD0e7e2882e9f60E301156; - } + factory.deploy(OneInchRouterFactory.RouterTypes.V4AggregationRouter, USDC); + deal(USDC, address(this), 100_000_000); + addr = 0xEAC5F0d4A9a45E1f9FdD0e7e2882e9f60E301156; + } } contract V4RouterForkTest is V4RouterForkTestBase { - function nativeSwap( - IV4AggregationRouter.SwapDescription memory desc, - bytes memory data, - uint256 snapshotId - ) public returns (uint256) { - vm.revertTo(snapshotId); - v4AggregationRouter.swap(v4AggregationExecutor, desc, data); - return IERC20(UNI).balanceOf(addr); - } + function nativeSwap( + IV4AggregationRouter.SwapDescription memory desc, + bytes memory data, + uint256 snapshotId + ) public returns (uint256) { + vm.revertTo(snapshotId); + v4AggregationRouter.swap(v4AggregationExecutor, desc, data); + return IERC20(UNI).balanceOf(addr); + } - function test_swapUSDC() public { - uint256 snapshotId = vm.snapshot(); - // Calldata generated from calling 1inch's api - bytes - memory dataParams = hex"7c025200000000000000000000000000f0694acc9e941b176e17b9ef923e71e7b8b2477a000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000001800000000000000000000000007f5c764cbc14f9669b88837ca1490cca17c316070000000000000000000000006fd9d7ad17242c41f7131d257212c54a0e816691000000000000000000000000f0694acc9e941b176e17b9ef923e71e7b8b2477a000000000000000000000000eac5f0d4a9a45e1f9fdd0e7e2882e9f60e30115600000000000000000000000000000000000000000000000000000000000186a0000000000000000000000000000000000000000000000000003e1aba8fed6bc100000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001e10000000000000000000000000000000000000000000000000000000001a300a007e5c0d200000000000000000000000000000000000000000000000000017f00011c4330f9d5940c2313636546ab9852354860dce275dbad00000000000000000000000000000000000000000000000000002ecaf7212e2f002424b31a0c000000000000000000000000f0694acc9e941b176e17b9ef923e71e7b8b2477a00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000fffd8963efd1fc6a506488495d951d5263988d2500000000000000000000000000000000000000000000000000000000000000a000000000000000000000000000000000000000000000000000000000000000200000000000000000000000007f5c764cbc14f9669b88837ca1490cca17c3160702a0000000000000000000000000000000000000000000000000003e1aba8fed6bc1ee63c1e581ad4c666fc170b468b19988959eb931a3676f0e9f42000000000000000000000000000000000000061111111254760f7ab3f16433eea9304126dcd19900000000000000000000000000000000000000000000000000000000000186a000000000000000000000000000000000000000000000000000000000000000cfee7c08"; - // Decode api calldata to get the data parameter needed for both calls - ( - , - IV4AggregationRouter.SwapDescription memory desc, - bytes memory data - ) = abi.decode( - this.returnSliceBytes(dataParams), - (address, IV4AggregationRouter.SwapDescription, bytes) - ); + function test_swapUSDC() public { + uint256 snapshotId = vm.snapshot(); + // Calldata generated from calling 1inch's api + bytes memory dataParams = + hex"7c025200000000000000000000000000f0694acc9e941b176e17b9ef923e71e7b8b2477a000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000001800000000000000000000000007f5c764cbc14f9669b88837ca1490cca17c316070000000000000000000000006fd9d7ad17242c41f7131d257212c54a0e816691000000000000000000000000f0694acc9e941b176e17b9ef923e71e7b8b2477a000000000000000000000000eac5f0d4a9a45e1f9fdd0e7e2882e9f60e30115600000000000000000000000000000000000000000000000000000000000186a0000000000000000000000000000000000000000000000000003e1aba8fed6bc100000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001e10000000000000000000000000000000000000000000000000000000001a300a007e5c0d200000000000000000000000000000000000000000000000000017f00011c4330f9d5940c2313636546ab9852354860dce275dbad00000000000000000000000000000000000000000000000000002ecaf7212e2f002424b31a0c000000000000000000000000f0694acc9e941b176e17b9ef923e71e7b8b2477a00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000fffd8963efd1fc6a506488495d951d5263988d2500000000000000000000000000000000000000000000000000000000000000a000000000000000000000000000000000000000000000000000000000000000200000000000000000000000007f5c764cbc14f9669b88837ca1490cca17c3160702a0000000000000000000000000000000000000000000000000003e1aba8fed6bc1ee63c1e581ad4c666fc170b468b19988959eb931a3676f0e9f42000000000000000000000000000000000000061111111254760f7ab3f16433eea9304126dcd19900000000000000000000000000000000000000000000000000000000000186a000000000000000000000000000000000000000000000000000000000000000cfee7c08"; + // Decode api calldata to get the data parameter needed for both calls + (, IV4AggregationRouter.SwapDescription memory desc, bytes memory data) = abi.decode( + this.returnSliceBytes(dataParams), (address, IV4AggregationRouter.SwapDescription, bytes) + ); - // Setup optimized router call - vm.startPrank(0xEAC5F0d4A9a45E1f9FdD0e7e2882e9f60E301156); - address routerAddr = factory.computeAddress( - OneInchRouterFactory.RouterTypes.V4AggregationRouter, - USDC - ); - IERC20(USDC).approve(routerAddr, 100_000); - uint256 startingBalance = IERC20(UNI).balanceOf(addr); - assertTrue(startingBalance == 0); + // Setup optimized router call + vm.startPrank(0xEAC5F0d4A9a45E1f9FdD0e7e2882e9f60E301156); + address routerAddr = + factory.computeAddress(OneInchRouterFactory.RouterTypes.V4AggregationRouter, USDC); + IERC20(USDC).approve(routerAddr, 100_000); + uint256 startingBalance = IERC20(UNI).balanceOf(addr); + assertTrue(startingBalance == 0); - // Opitmized router call - (bool ok, ) = payable(routerAddr).call( - abi.encode(UNI, 100_000, desc.minReturnAmount, data, false) - ); + // Opitmized router call + (bool ok,) = + payable(routerAddr).call(abi.encode(UNI, 100_000, desc.minReturnAmount, data, false)); - assertTrue(ok); + assertTrue(ok); - // Compare balance to native aggregation router call - uint256 endingBalance = IERC20(UNI).balanceOf(addr); - uint256 nativeEndingBalance = nativeSwap(desc, data, snapshotId); - assertTrue(endingBalance == nativeEndingBalance); - } + // Compare balance to native aggregation router call + uint256 endingBalance = IERC20(UNI).balanceOf(addr); + uint256 nativeEndingBalance = nativeSwap(desc, data, snapshotId); + assertTrue(endingBalance == nativeEndingBalance); + } } diff --git a/test/V5Router.t.sol b/test/V5Router.t.sol index 06e60ff..0512a84 100644 --- a/test/V5Router.t.sol +++ b/test/V5Router.t.sol @@ -1,86 +1,72 @@ // SPDX-License-Identifier: MIT pragma solidity >=0.8.0; -import "forge-std/Test.sol"; +import {IERC20} from "openzeppelin-contracts/contracts/token/ERC20/IERC20.sol"; +import {Test} from "forge-std/Test.sol"; + import {OneInchRouterFactory} from "src/RouterFactory.sol"; import {OneInchContracts} from "test/1InchContracts.sol"; import {IV5AggregationRouter} from "src/interfaces/IV5AggregationRouter.sol"; -import {IERC20} from "openzeppelin-contracts/contracts/token/ERC20/IERC20.sol"; contract V5RouterForkTestBase is Test, OneInchContracts { - OneInchRouterFactory factory; - address addr; + OneInchRouterFactory factory; + address addr; - function setUp() public { - vm.createSelectFork(vm.rpcUrl("optimism"), 94_524_034); - factory = new OneInchRouterFactory( + function setUp() public { + vm.createSelectFork(vm.rpcUrl("optimism"), 94_524_034); + factory = new OneInchRouterFactory( v5AggregationExecutor, v5AggregationRouter, v4AggregationExecutor, v4AggregationRouter ); - factory.deploy( - OneInchRouterFactory.RouterTypes.V5AggregationRouter, - USDC - ); - deal(USDC, address(this), 100_000_000); - addr = 0xEAC5F0d4A9a45E1f9FdD0e7e2882e9f60E301156; - } + factory.deploy(OneInchRouterFactory.RouterTypes.V5AggregationRouter, USDC); + deal(USDC, address(this), 100_000_000); + addr = 0xEAC5F0d4A9a45E1f9FdD0e7e2882e9f60E301156; + } } contract V5RouterForkTest is V5RouterForkTestBase { - function nativeSwap( - IV5AggregationRouter.SwapDescription memory desc, - bytes memory permit, - bytes memory data, - uint256 snapshotId - ) public returns (uint256) { - vm.revertTo(snapshotId); - v5AggregationRouter.swap(v5AggregationExecutor, desc, permit, data); - return IERC20(UNI).balanceOf(addr); - } + function nativeSwap( + IV5AggregationRouter.SwapDescription memory desc, + bytes memory permit, + bytes memory data, + uint256 snapshotId + ) public returns (uint256) { + vm.revertTo(snapshotId); + v5AggregationRouter.swap(v5AggregationExecutor, desc, permit, data); + return IERC20(UNI).balanceOf(addr); + } - function test_swapUSDC() public { - uint256 snapshotId = vm.snapshot(); - // Calldata generated from calling 1inch's api - bytes - memory dataParams = hex"12aa3caf000000000000000000000000f0694acc9e941b176e17b9ef923e71e7b8b2477a0000000000000000000000007f5c764cbc14f9669b88837ca1490cca17c316070000000000000000000000006fd9d7ad17242c41f7131d257212c54a0e816691000000000000000000000000f0694acc9e941b176e17b9ef923e71e7b8b2477a000000000000000000000000eac5f0d4a9a45e1f9fdd0e7e2882e9f60e30115600000000000000000000000000000000000000000000000000000000000186a0000000000000000000000000000000000000000000000000003e530a0ee30f45000000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000001400000000000000000000000000000000000000000000000000000000000000160000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001f50000000000000000000000000000000000000000000000000000000001d700a007e5c0d20000000000000000000000000000000000000000000000000001b30001505126a132dab612db5cb9fc9ac426a0cc215a3423f9c97f5c764cbc14f9669b88837ca1490cca17c316070004f41766d8000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002e2669c6242f00000000000000000000000000000000000000000000000000000000000000a0000000000000000000000000f0694acc9e941b176e17b9ef923e71e7b8b2477a00000000000000000000000000000000000000000000000000000000644fdfe900000000000000000000000000000000000000000000000000000000000000010000000000000000000000007f5c764cbc14f9669b88837ca1490cca17c316070000000000000000000000004200000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000102a0000000000000000000000000000000000000000000000000003e530a0ee30f45ee63c1e581ad4c666fc170b468b19988959eb931a3676f0e9f42000000000000000000000000000000000000061111111254eeb25477b68fb85ed929f73a9605820000000000000000000000cfee7c08"; - // Decode api calldata to get the data parameter needed for both calls - ( - , - IV5AggregationRouter.SwapDescription memory desc, - bytes memory permit, - bytes memory data - ) = abi.decode( - this.returnSliceBytes(dataParams), - (address, IV5AggregationRouter.SwapDescription, bytes, bytes) - ); + function test_swapUSDC() public { + uint256 snapshotId = vm.snapshot(); + // Calldata generated from calling 1inch's api + bytes memory dataParams = + hex"12aa3caf000000000000000000000000f0694acc9e941b176e17b9ef923e71e7b8b2477a0000000000000000000000007f5c764cbc14f9669b88837ca1490cca17c316070000000000000000000000006fd9d7ad17242c41f7131d257212c54a0e816691000000000000000000000000f0694acc9e941b176e17b9ef923e71e7b8b2477a000000000000000000000000eac5f0d4a9a45e1f9fdd0e7e2882e9f60e30115600000000000000000000000000000000000000000000000000000000000186a0000000000000000000000000000000000000000000000000003e530a0ee30f45000000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000001400000000000000000000000000000000000000000000000000000000000000160000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001f50000000000000000000000000000000000000000000000000000000001d700a007e5c0d20000000000000000000000000000000000000000000000000001b30001505126a132dab612db5cb9fc9ac426a0cc215a3423f9c97f5c764cbc14f9669b88837ca1490cca17c316070004f41766d8000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002e2669c6242f00000000000000000000000000000000000000000000000000000000000000a0000000000000000000000000f0694acc9e941b176e17b9ef923e71e7b8b2477a00000000000000000000000000000000000000000000000000000000644fdfe900000000000000000000000000000000000000000000000000000000000000010000000000000000000000007f5c764cbc14f9669b88837ca1490cca17c316070000000000000000000000004200000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000102a0000000000000000000000000000000000000000000000000003e530a0ee30f45ee63c1e581ad4c666fc170b468b19988959eb931a3676f0e9f42000000000000000000000000000000000000061111111254eeb25477b68fb85ed929f73a9605820000000000000000000000cfee7c08"; + // Decode api calldata to get the data parameter needed for both calls + (, IV5AggregationRouter.SwapDescription memory desc, bytes memory permit, bytes memory data) = + abi.decode( + this.returnSliceBytes(dataParams), + (address, IV5AggregationRouter.SwapDescription, bytes, bytes) + ); - // Setup optimized router call - vm.startPrank(0xEAC5F0d4A9a45E1f9FdD0e7e2882e9f60E301156); - address routerAddr = factory.computeAddress( - OneInchRouterFactory.RouterTypes.V5AggregationRouter, - USDC - ); - IERC20(USDC).approve(routerAddr, 100_000); - uint256 startingBalance = IERC20(UNI).balanceOf(addr); - assertTrue(startingBalance == 0); + // Setup optimized router call + vm.startPrank(0xEAC5F0d4A9a45E1f9FdD0e7e2882e9f60E301156); + address routerAddr = + factory.computeAddress(OneInchRouterFactory.RouterTypes.V5AggregationRouter, USDC); + IERC20(USDC).approve(routerAddr, 100_000); + uint256 startingBalance = IERC20(UNI).balanceOf(addr); + assertTrue(startingBalance == 0); - // Opitmized router call - (bool ok, ) = payable(routerAddr).call( - abi.encode(UNI, 100_000, desc.minReturnAmount, data, false) - ); + // Opitmized router call + (bool ok,) = + payable(routerAddr).call(abi.encode(UNI, 100_000, desc.minReturnAmount, data, false)); - assertTrue(ok); + assertTrue(ok); - // Compare balance to native aggregation router call - uint256 endingBalance = IERC20(UNI).balanceOf(addr); - uint256 nativeEndingBalance = nativeSwap( - desc, - permit, - data, - snapshotId - ); - assertTrue(endingBalance == nativeEndingBalance); - } + // Compare balance to native aggregation router call + uint256 endingBalance = IERC20(UNI).balanceOf(addr); + uint256 nativeEndingBalance = nativeSwap(desc, permit, data, snapshotId); + assertTrue(endingBalance == nativeEndingBalance); + } } From c401035b366b03ce9ee56a4f9bfe044ace776af1 Mon Sep 17 00:00:00 2001 From: Keating Date: Mon, 1 May 2023 09:13:10 -0400 Subject: [PATCH 13/48] Change coverage --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 510a0c4..32e22f7 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -75,7 +75,7 @@ jobs: uses: zgosalvez/github-actions-report-lcov@v2 with: coverage-files: ./lcov.info - minimum-coverage: 100 # Set coverage threshold. + minimum-coverage: 80 # Set coverage threshold. lint: runs-on: ubuntu-latest From a4decbee0237d733736c421973bb4d1b1d1684c1 Mon Sep 17 00:00:00 2001 From: Keating Date: Mon, 1 May 2023 09:27:59 -0400 Subject: [PATCH 14/48] Fix build --- .github/workflows/ci.yml | 1 + test/lib/Create2.t.sol | 21 +++++++++++++++++++++ 2 files changed, 22 insertions(+) create mode 100644 test/lib/Create2.t.sol diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 32e22f7..fcf12b1 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -9,6 +9,7 @@ on: env: FOUNDRY_PROFILE: ci + OPTIMISM_RPC_URL: ${{ secrets.OPTIMISM_RPC_URL }} jobs: build: diff --git a/test/lib/Create2.t.sol b/test/lib/Create2.t.sol new file mode 100644 index 0000000..d6f9dca --- /dev/null +++ b/test/lib/Create2.t.sol @@ -0,0 +1,21 @@ +// SPDX-License-Identifier: MIT +pragma solidity >=0.8.0; + +import {Test} from "forge-std/Test.sol"; + +import {Create2} from "src/lib/Create2.sol"; + +contract Create2Test is Test { + function test_GenerateCreate2Address() external { + bytes32 salt = bytes32(uint256(31415)); + bytes memory initcodeHash = abi.encode(0x6080); + address deployer = 0x6C9FC64A53c1b71FB3f9Af64d1ae3A4931A5f4E9; + address create2Address = Create2.computeCreate2Address( + salt, + deployer, + initcodeHash, + "" + ); + assertEq(create2Address, 0xB147a5d25748fda14b463EB04B111027C290f4d3); + } +} From daf6cc95ec251688649bcae47b787253b8fc22fa Mon Sep 17 00:00:00 2001 From: Keating Date: Mon, 1 May 2023 09:28:42 -0400 Subject: [PATCH 15/48] Fix format --- test/lib/Create2.t.sol | 19 +++++++------------ 1 file changed, 7 insertions(+), 12 deletions(-) diff --git a/test/lib/Create2.t.sol b/test/lib/Create2.t.sol index d6f9dca..ac26e44 100644 --- a/test/lib/Create2.t.sol +++ b/test/lib/Create2.t.sol @@ -6,16 +6,11 @@ import {Test} from "forge-std/Test.sol"; import {Create2} from "src/lib/Create2.sol"; contract Create2Test is Test { - function test_GenerateCreate2Address() external { - bytes32 salt = bytes32(uint256(31415)); - bytes memory initcodeHash = abi.encode(0x6080); - address deployer = 0x6C9FC64A53c1b71FB3f9Af64d1ae3A4931A5f4E9; - address create2Address = Create2.computeCreate2Address( - salt, - deployer, - initcodeHash, - "" - ); - assertEq(create2Address, 0xB147a5d25748fda14b463EB04B111027C290f4d3); - } + function test_GenerateCreate2Address() external { + bytes32 salt = bytes32(uint256(31_415)); + bytes memory initcodeHash = abi.encode(0x6080); + address deployer = 0x6C9FC64A53c1b71FB3f9Af64d1ae3A4931A5f4E9; + address create2Address = Create2.computeCreate2Address(salt, deployer, initcodeHash, ""); + assertEq(create2Address, 0xB147a5d25748fda14b463EB04B111027C290f4d3); + } } From 5829f050bc4c0cf2a29467746027925efbb67bcc Mon Sep 17 00:00:00 2001 From: Keating Date: Thu, 4 May 2023 19:57:08 -0400 Subject: [PATCH 16/48] Fix typo --- src/AggregationBaseRouter.sol | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/AggregationBaseRouter.sol b/src/AggregationBaseRouter.sol index 5e0ddbc..fb640ad 100644 --- a/src/AggregationBaseRouter.sol +++ b/src/AggregationBaseRouter.sol @@ -43,7 +43,7 @@ abstract contract AggregationV4BaseRouter { /// @notice The 1inch contract with the unoptimized route IV4AggregationRouter public immutable AGGREGATION_ROUTER; - /// @notice The token being from a user to be swapped + /// @notice The input token being swapped address public immutable TOKEN; /// @notice Where the tokens are going in the router and it should match the executor From 66148dd80844d116564171a14ff668897774855c Mon Sep 17 00:00:00 2001 From: Keating Date: Thu, 4 May 2023 20:23:14 -0400 Subject: [PATCH 17/48] Change flags to uint256 --- src/V4Router.sol | 6 +++--- src/V5Router.sol | 6 +++--- test/V4Router.t.sol | 3 +-- test/V5Router.t.sol | 3 +-- 4 files changed, 8 insertions(+), 10 deletions(-) diff --git a/src/V4Router.sol b/src/V4Router.sol index d6dc93c..c9214e8 100644 --- a/src/V4Router.sol +++ b/src/V4Router.sol @@ -24,8 +24,8 @@ contract V4Router is AggregationV4BaseRouter { // the flags match specific constant masks. there is no documentation on these, and there seems to // be no specific logic on them fallback() external payable { - (address dstToken, uint256 amount, uint256 minReturnAmount, bytes memory data, bool flags) = - abi.decode(msg.data, (address, uint256, uint256, bytes, bool)); + (address dstToken, uint256 amount, uint256 minReturnAmount, bytes memory data, uint256 flags) = + abi.decode(msg.data, (address, uint256, uint256, bytes, uint256)); IERC20(TOKEN).transferFrom(msg.sender, address(this), amount); IERC20(TOKEN).approve(address(AGGREGATION_ROUTER), amount); AGGREGATION_ROUTER.swap( @@ -37,7 +37,7 @@ contract V4Router is AggregationV4BaseRouter { dstReceiver: payable(msg.sender), amount: amount, minReturnAmount: minReturnAmount, - flags: flags ? 1 : 0, + flags: flags, permit: "" }), data diff --git a/src/V5Router.sol b/src/V5Router.sol index 984f024..ae9202f 100644 --- a/src/V5Router.sol +++ b/src/V5Router.sol @@ -24,8 +24,8 @@ contract V5Router is AggregationV5BaseRouter { // the flags match specific constant masks. there is no documentation on these, and there seems to // be no specific logic on them fallback() external payable { - (address dstToken, uint256 amount, uint256 minReturnAmount, bytes memory data, bool flags) = - abi.decode(msg.data, (address, uint256, uint256, bytes, bool)); + (address dstToken, uint256 amount, uint256 minReturnAmount, bytes memory data, uint256 flags) = + abi.decode(msg.data, (address, uint256, uint256, bytes, uint256)); IERC20(TOKEN).transferFrom(msg.sender, address(this), amount); IERC20(TOKEN).approve(address(AGGREGATION_ROUTER), amount); AGGREGATION_ROUTER.swap( @@ -37,7 +37,7 @@ contract V5Router is AggregationV5BaseRouter { dstReceiver: payable(msg.sender), amount: amount, minReturnAmount: minReturnAmount, - flags: flags ? 1 : 0 + flags: flags }), "", data diff --git a/test/V4Router.t.sol b/test/V4Router.t.sol index f6aa687..0086edf 100644 --- a/test/V4Router.t.sol +++ b/test/V4Router.t.sol @@ -56,8 +56,7 @@ contract V4RouterForkTest is V4RouterForkTestBase { assertTrue(startingBalance == 0); // Opitmized router call - (bool ok,) = - payable(routerAddr).call(abi.encode(UNI, 100_000, desc.minReturnAmount, data, false)); + (bool ok,) = payable(routerAddr).call(abi.encode(UNI, 100_000, desc.minReturnAmount, data, 0)); assertTrue(ok); diff --git a/test/V5Router.t.sol b/test/V5Router.t.sol index 0512a84..6a807c9 100644 --- a/test/V5Router.t.sol +++ b/test/V5Router.t.sol @@ -59,8 +59,7 @@ contract V5RouterForkTest is V5RouterForkTestBase { assertTrue(startingBalance == 0); // Opitmized router call - (bool ok,) = - payable(routerAddr).call(abi.encode(UNI, 100_000, desc.minReturnAmount, data, false)); + (bool ok,) = payable(routerAddr).call(abi.encode(UNI, 100_000, desc.minReturnAmount, data, 0)); assertTrue(ok); From fb7f2359fe9d016e9b39979673b667165dd4a00b Mon Sep 17 00:00:00 2001 From: Keating Date: Thu, 4 May 2023 20:40:07 -0400 Subject: [PATCH 18/48] Change approval to max uint --- src/V4Router.sol | 2 +- src/V5Router.sol | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/V4Router.sol b/src/V4Router.sol index c9214e8..d154e21 100644 --- a/src/V4Router.sol +++ b/src/V4Router.sol @@ -27,7 +27,7 @@ contract V4Router is AggregationV4BaseRouter { (address dstToken, uint256 amount, uint256 minReturnAmount, bytes memory data, uint256 flags) = abi.decode(msg.data, (address, uint256, uint256, bytes, uint256)); IERC20(TOKEN).transferFrom(msg.sender, address(this), amount); - IERC20(TOKEN).approve(address(AGGREGATION_ROUTER), amount); + IERC20(TOKEN).approve(address(AGGREGATION_ROUTER), type(uint256).max); AGGREGATION_ROUTER.swap( AGGREGATION_EXECUTOR, IV4AggregationRouter.SwapDescription({ diff --git a/src/V5Router.sol b/src/V5Router.sol index ae9202f..18973c9 100644 --- a/src/V5Router.sol +++ b/src/V5Router.sol @@ -27,7 +27,7 @@ contract V5Router is AggregationV5BaseRouter { (address dstToken, uint256 amount, uint256 minReturnAmount, bytes memory data, uint256 flags) = abi.decode(msg.data, (address, uint256, uint256, bytes, uint256)); IERC20(TOKEN).transferFrom(msg.sender, address(this), amount); - IERC20(TOKEN).approve(address(AGGREGATION_ROUTER), amount); + IERC20(TOKEN).approve(address(AGGREGATION_ROUTER), type(uint256).max); AGGREGATION_ROUTER.swap( AGGREGATION_EXECUTOR, IV5AggregationRouter.SwapDescription({ From 936d174663cdc566bc629f3368a7a471e524fa11 Mon Sep 17 00:00:00 2001 From: Keating Date: Thu, 4 May 2023 21:19:14 -0400 Subject: [PATCH 19/48] Make sure comments are sentences and fix typos --- script/Benchmark.s.sol | 2 +- script/Deploy.s.sol | 5 ----- src/AggregationBaseRouter.sol | 13 +++++++------ src/RouterFactory.sol | 18 ++++++++++-------- src/V4Router.sol | 12 +++++++----- src/V5Router.sol | 12 +++++++----- test/V4Router.t.sol | 6 +++--- test/V5Router.t.sol | 2 +- 8 files changed, 36 insertions(+), 34 deletions(-) diff --git a/script/Benchmark.s.sol b/script/Benchmark.s.sol index 786ee62..6f17043 100644 --- a/script/Benchmark.s.sol +++ b/script/Benchmark.s.sol @@ -54,7 +54,7 @@ contract Benchmark is Script, OneInchContracts { // Regular v5 swap call v5AggregationRouter.swap(v5AggregationExecutor, v5Desc, v5Permit, v5Data); - // Opitmized router v5 swap call + // Optimized router v5 swap call (bool v5Ok,) = payable(v5Rtr).call(abi.encode(UNI, 100_000, v5Desc.minReturnAmount, v5Data, false)); diff --git a/script/Deploy.s.sol b/script/Deploy.s.sol index 6d6d959..88bc342 100644 --- a/script/Deploy.s.sol +++ b/script/Deploy.s.sol @@ -7,11 +7,6 @@ import {IERC20} from "openzeppelin-contracts/contracts/token/ERC20/IERC20.sol"; import {OneInchContracts} from "test/1InchContracts.sol"; import {OneInchRouterFactory} from "src/RouterFactory.sol"; -// IERC20(USDC).approve(0x1111111254EEB25477B68fb85Ed929f73A960582, 100_000); -//IERC20(USDC).approve( -// 0x1111111254760F7ab3F16433eea9304126DCd199, -// 100_000 -//); contract Deploy is Script, OneInchContracts { function run() public { // Deploy the optimized router factory diff --git a/src/AggregationBaseRouter.sol b/src/AggregationBaseRouter.sol index fb640ad..57db776 100644 --- a/src/AggregationBaseRouter.sol +++ b/src/AggregationBaseRouter.sol @@ -34,19 +34,20 @@ abstract contract AggregationV5BaseRouter { } } -/// @notice An abstract class with the necessary class variables to make a aggregation v4 optimized -/// router +/// @notice An abstract class with the necessary class variables +/// to make a 1inch v4 aggregation router optimized. abstract contract AggregationV4BaseRouter { - /// @notice The contract used to execute the swap along an optimized path + /// @notice The contract used to execute the swap along an optimized path. IV4AggregationExecutor public immutable AGGREGATION_EXECUTOR; - /// @notice The 1inch contract with the unoptimized route + /// @notice The 1inch v4 aggregation router contract. IV4AggregationRouter public immutable AGGREGATION_ROUTER; - /// @notice The input token being swapped + /// @notice The input token being swapped. address public immutable TOKEN; - /// @notice Where the tokens are going in the router and it should match the executor + /// @notice Where the tokens are transferred in the 1inch v4 aggregation router. + /// It will match the AGGREGATION_EXECUTOR address. address public immutable SOURCE_RECEIVER; constructor( diff --git a/src/RouterFactory.sol b/src/RouterFactory.sol index deb2955..f3dfb8c 100644 --- a/src/RouterFactory.sol +++ b/src/RouterFactory.sol @@ -9,7 +9,7 @@ import {Create2} from "src/lib/Create2.sol"; import {V5Router} from "src/V5Router.sol"; import {V4Router} from "src/V4Router.sol"; -/// @notice a factory for deploying a router for a given asset and router type +/// @notice A factory for deploying an optimized router for a given asset and router type. contract OneInchRouterFactory { error RouterTypeDoesNotExist(); @@ -18,27 +18,29 @@ contract OneInchRouterFactory { V5AggregationRouter } - /// @notice The v5 contract used to execute the swap along an optimized path + /// @notice The 1inch v5 contract used to execute the swap along an optimized token swapping path. IV5AggregationExecutor public immutable V5_AGGREGATION_EXECUTOR; - /// @notice The v5 1inch contract with the unoptimized route + /// @notice The 1inch v5 aggregation router contract. IV5AggregationRouter public immutable V5_AGGREGATION_ROUTER; - /// @notice The v4 contract used to execute the swap along an optimized path + /// @notice The 1inch v4 aggregation router contract used to execute the swap along an optimized + /// token swapping path. IV4AggregationExecutor public immutable V4_AGGREGATION_EXECUTOR; - /// @notice The v4 1inch contract with the unoptimized route + /// @notice The 1inch v4 aggregation router contract. IV4AggregationRouter public immutable V4_AGGREGATION_ROUTER; - /// @notice Where the tokens are going in the v5 router and it should match the executor + /// @notice The address the 1inch v5 aggregation router will send the the input tokens. + /// This will match the V5_AGGREGATION_EXECUTOR address. address public immutable V5_SOURCE_RECEIVER; - /// @notice Where the tokens are going in the v4 router and it should match the executor + /// @notice The address the 1inch v4 aggregation router will send the the input tokens. + /// This will match the V4_AGGREGATION_EXECUTOR address. address public immutable V4_SOURCE_RECEIVER; event RouterDeployed(RouterTypes type_, address indexed asset); - // Add V4 params constructor( IV5AggregationExecutor v5AggregationExecutor, IV5AggregationRouter v5AggregationRouter, diff --git a/src/V4Router.sol b/src/V4Router.sol index d154e21..af45624 100644 --- a/src/V4Router.sol +++ b/src/V4Router.sol @@ -7,7 +7,7 @@ import {IV4AggregationExecutor} from "src/interfaces/IV4AggregationExecutor.sol" import {IV4AggregationRouter} from "src/interfaces/IV4AggregationRouter.sol"; import {AggregationV4BaseRouter} from "src/AggregationBaseRouter.sol"; -/// @notice A router to swap tokens using 1inch v4 aggregation +/// @notice An optimized router to swap tokens using 1inch's v4 aggregation router. contract V4Router is AggregationV4BaseRouter { constructor( IV4AggregationRouter aggregationRouter, @@ -16,13 +16,15 @@ contract V4Router is AggregationV4BaseRouter { address sourceReceiver ) AggregationV4BaseRouter(aggregationExecutor, aggregationRouter, token, sourceReceiver) {} + // TODO: Update to handle receiving ETH receive() external payable {} - // TODO: minReturnAmount is the minimum allowed output amount, and can probably reduced to a max - // int of 500. Also, amount and destination have opportunities to be optimized. + // TODO: minReturnAmount is the minimum allowed output amount, and + // can probably be reduced to a max integer of 500 or something of + // a similar magnitude. Also, amount and destination have + // opportunities to be optimized. // - // the flags match specific constant masks. there is no documentation on these, and there seems to - // be no specific logic on them + // Flags match specific constant masks. There is no documentation on these. fallback() external payable { (address dstToken, uint256 amount, uint256 minReturnAmount, bytes memory data, uint256 flags) = abi.decode(msg.data, (address, uint256, uint256, bytes, uint256)); diff --git a/src/V5Router.sol b/src/V5Router.sol index 18973c9..dacc443 100644 --- a/src/V5Router.sol +++ b/src/V5Router.sol @@ -7,7 +7,7 @@ import {IV5AggregationExecutor} from "src/interfaces/IV5AggregationExecutor.sol" import {IV5AggregationRouter} from "src/interfaces/IV5AggregationRouter.sol"; import {AggregationV5BaseRouter} from "src/AggregationBaseRouter.sol"; -/// @notice A router to swap tokens using 1inch v5 aggregation +/// @notice A router to swap tokens using 1inch's v5 aggregation router. contract V5Router is AggregationV5BaseRouter { constructor( IV5AggregationRouter aggregationRouter, @@ -16,13 +16,15 @@ contract V5Router is AggregationV5BaseRouter { address sourceReceiver ) AggregationV5BaseRouter(aggregationExecutor, aggregationRouter, token, sourceReceiver) {} + // TODO: Update to handle receiving ETH receive() external payable {} - // TODO: minReturnAmount is the minimum allowed output amount, and can probably reduced to a max - // int of 500. + // TODO: minReturnAmount is the minimum allowed output amount, and + // can probably be reduced to a max integer of 500 or something of + // a similar magnitude. Also, amount and destination have + // opportunities to be optimized. // - // the flags match specific constant masks. there is no documentation on these, and there seems to - // be no specific logic on them + // Flags match specific constant masks. There is no documentation on these. fallback() external payable { (address dstToken, uint256 amount, uint256 minReturnAmount, bytes memory data, uint256 flags) = abi.decode(msg.data, (address, uint256, uint256, bytes, uint256)); diff --git a/test/V4Router.t.sol b/test/V4Router.t.sol index 0086edf..0b9dd81 100644 --- a/test/V4Router.t.sol +++ b/test/V4Router.t.sol @@ -42,12 +42,12 @@ contract V4RouterForkTest is V4RouterForkTestBase { // Calldata generated from calling 1inch's api bytes memory dataParams = hex"7c025200000000000000000000000000f0694acc9e941b176e17b9ef923e71e7b8b2477a000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000001800000000000000000000000007f5c764cbc14f9669b88837ca1490cca17c316070000000000000000000000006fd9d7ad17242c41f7131d257212c54a0e816691000000000000000000000000f0694acc9e941b176e17b9ef923e71e7b8b2477a000000000000000000000000eac5f0d4a9a45e1f9fdd0e7e2882e9f60e30115600000000000000000000000000000000000000000000000000000000000186a0000000000000000000000000000000000000000000000000003e1aba8fed6bc100000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001e10000000000000000000000000000000000000000000000000000000001a300a007e5c0d200000000000000000000000000000000000000000000000000017f00011c4330f9d5940c2313636546ab9852354860dce275dbad00000000000000000000000000000000000000000000000000002ecaf7212e2f002424b31a0c000000000000000000000000f0694acc9e941b176e17b9ef923e71e7b8b2477a00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000fffd8963efd1fc6a506488495d951d5263988d2500000000000000000000000000000000000000000000000000000000000000a000000000000000000000000000000000000000000000000000000000000000200000000000000000000000007f5c764cbc14f9669b88837ca1490cca17c3160702a0000000000000000000000000000000000000000000000000003e1aba8fed6bc1ee63c1e581ad4c666fc170b468b19988959eb931a3676f0e9f42000000000000000000000000000000000000061111111254760f7ab3f16433eea9304126dcd19900000000000000000000000000000000000000000000000000000000000186a000000000000000000000000000000000000000000000000000000000000000cfee7c08"; - // Decode api calldata to get the data parameter needed for both calls + // Decode the api calldata to get the data parameter needed for both calls (, IV4AggregationRouter.SwapDescription memory desc, bytes memory data) = abi.decode( this.returnSliceBytes(dataParams), (address, IV4AggregationRouter.SwapDescription, bytes) ); - // Setup optimized router call + // Setup the optimized router call vm.startPrank(0xEAC5F0d4A9a45E1f9FdD0e7e2882e9f60E301156); address routerAddr = factory.computeAddress(OneInchRouterFactory.RouterTypes.V4AggregationRouter, USDC); @@ -55,7 +55,7 @@ contract V4RouterForkTest is V4RouterForkTestBase { uint256 startingBalance = IERC20(UNI).balanceOf(addr); assertTrue(startingBalance == 0); - // Opitmized router call + // Optimized router call (bool ok,) = payable(routerAddr).call(abi.encode(UNI, 100_000, desc.minReturnAmount, data, 0)); assertTrue(ok); diff --git a/test/V5Router.t.sol b/test/V5Router.t.sol index 6a807c9..645719c 100644 --- a/test/V5Router.t.sol +++ b/test/V5Router.t.sol @@ -58,7 +58,7 @@ contract V5RouterForkTest is V5RouterForkTestBase { uint256 startingBalance = IERC20(UNI).balanceOf(addr); assertTrue(startingBalance == 0); - // Opitmized router call + // Optimized router call (bool ok,) = payable(routerAddr).call(abi.encode(UNI, 100_000, desc.minReturnAmount, data, 0)); assertTrue(ok); From cefdbccb09c7e70b9d7fb9a3603a9ee140c3d007 Mon Sep 17 00:00:00 2001 From: Keating Date: Thu, 4 May 2023 21:25:42 -0400 Subject: [PATCH 20/48] Make RouterTypes singular --- script/Deploy.s.sol | 4 ++-- src/RouterFactory.sol | 16 ++++++++-------- test/RouterFactory.t.sol | 8 ++++---- test/V4Router.t.sol | 4 ++-- test/V5Router.t.sol | 4 ++-- 5 files changed, 18 insertions(+), 18 deletions(-) diff --git a/script/Deploy.s.sol b/script/Deploy.s.sol index 88bc342..ba84259 100644 --- a/script/Deploy.s.sol +++ b/script/Deploy.s.sol @@ -20,10 +20,10 @@ contract Deploy is Script, OneInchContracts { // Deploy the optimized router for V5Aggregation vm.broadcast(); - factory.deploy(OneInchRouterFactory.RouterTypes.V5AggregationRouter, USDC); + factory.deploy(OneInchRouterFactory.RouterType.V5AggregationRouter, USDC); // Deploy the optimized router for V4Aggregation vm.broadcast(); - factory.deploy(OneInchRouterFactory.RouterTypes.V4AggregationRouter, USDC); + factory.deploy(OneInchRouterFactory.RouterType.V4AggregationRouter, USDC); } } diff --git a/src/RouterFactory.sol b/src/RouterFactory.sol index f3dfb8c..8f9e967 100644 --- a/src/RouterFactory.sol +++ b/src/RouterFactory.sol @@ -13,7 +13,7 @@ import {V4Router} from "src/V4Router.sol"; contract OneInchRouterFactory { error RouterTypeDoesNotExist(); - enum RouterTypes { + enum RouterType { V4AggregationRouter, V5AggregationRouter } @@ -39,7 +39,7 @@ contract OneInchRouterFactory { /// This will match the V4_AGGREGATION_EXECUTOR address. address public immutable V4_SOURCE_RECEIVER; - event RouterDeployed(RouterTypes type_, address indexed asset); + event RouterDeployed(RouterType type_, address indexed asset); constructor( IV5AggregationExecutor v5AggregationExecutor, @@ -55,10 +55,10 @@ contract OneInchRouterFactory { V4_SOURCE_RECEIVER = address(v4AggregationExecutor); } - function deploy(RouterTypes type_, address asset) external returns (address) { + function deploy(RouterType type_, address asset) external returns (address) { bytes32 salt = _salt(asset); address router; - if (type_ == RouterTypes.V5AggregationRouter) { + if (type_ == RouterType.V5AggregationRouter) { router = address( new V5Router{salt: salt}( V5_AGGREGATION_ROUTER, @@ -67,7 +67,7 @@ contract OneInchRouterFactory { V5_SOURCE_RECEIVER ) ); - } else if (type_ == RouterTypes.V4AggregationRouter) { + } else if (type_ == RouterType.V4AggregationRouter) { router = address( new V4Router{salt: salt}( V4_AGGREGATION_ROUTER, @@ -83,10 +83,10 @@ contract OneInchRouterFactory { return router; } - function computeAddress(RouterTypes type_, address asset) external view returns (address) { - if (type_ == RouterTypes.V4AggregationRouter) { + function computeAddress(RouterType type_, address asset) external view returns (address) { + if (type_ == RouterType.V4AggregationRouter) { return _computeV4AggregationRouterAddress(asset); - } else if (type_ == RouterTypes.V5AggregationRouter) { + } else if (type_ == RouterType.V5AggregationRouter) { return _computeV5AggregationRouterAddress(asset); } else { revert RouterTypeDoesNotExist(); diff --git a/test/RouterFactory.t.sol b/test/RouterFactory.t.sol index 59c026b..0d5578a 100644 --- a/test/RouterFactory.t.sol +++ b/test/RouterFactory.t.sol @@ -15,10 +15,10 @@ contract RouterFactoryTest is Test, OneInchContracts { v4AggregationExecutor, v4AggregationRouter ); - address V5Router = factory.deploy(OneInchRouterFactory.RouterTypes.V5AggregationRouter, USDC); + address V5Router = factory.deploy(OneInchRouterFactory.RouterType.V5AggregationRouter, USDC); assertEq( V5Router, - factory.computeAddress(OneInchRouterFactory.RouterTypes.V5AggregationRouter, USDC), + factory.computeAddress(OneInchRouterFactory.RouterType.V5AggregationRouter, USDC), "V5Router address should be correct" ); } @@ -30,10 +30,10 @@ contract RouterFactoryTest is Test, OneInchContracts { v4AggregationExecutor, v4AggregationRouter ); - address V4Router = factory.deploy(OneInchRouterFactory.RouterTypes.V4AggregationRouter, USDC); + address V4Router = factory.deploy(OneInchRouterFactory.RouterType.V4AggregationRouter, USDC); assertEq( V4Router, - factory.computeAddress(OneInchRouterFactory.RouterTypes.V4AggregationRouter, USDC), + factory.computeAddress(OneInchRouterFactory.RouterType.V4AggregationRouter, USDC), "V4Router address should be correct" ); } diff --git a/test/V4Router.t.sol b/test/V4Router.t.sol index 0b9dd81..1086d5b 100644 --- a/test/V4Router.t.sol +++ b/test/V4Router.t.sol @@ -20,7 +20,7 @@ contract V4RouterForkTestBase is Test, OneInchContracts { v4AggregationExecutor, v4AggregationRouter ); - factory.deploy(OneInchRouterFactory.RouterTypes.V4AggregationRouter, USDC); + factory.deploy(OneInchRouterFactory.RouterType.V4AggregationRouter, USDC); deal(USDC, address(this), 100_000_000); addr = 0xEAC5F0d4A9a45E1f9FdD0e7e2882e9f60E301156; } @@ -50,7 +50,7 @@ contract V4RouterForkTest is V4RouterForkTestBase { // Setup the optimized router call vm.startPrank(0xEAC5F0d4A9a45E1f9FdD0e7e2882e9f60E301156); address routerAddr = - factory.computeAddress(OneInchRouterFactory.RouterTypes.V4AggregationRouter, USDC); + factory.computeAddress(OneInchRouterFactory.RouterType.V4AggregationRouter, USDC); IERC20(USDC).approve(routerAddr, 100_000); uint256 startingBalance = IERC20(UNI).balanceOf(addr); assertTrue(startingBalance == 0); diff --git a/test/V5Router.t.sol b/test/V5Router.t.sol index 645719c..5d87c99 100644 --- a/test/V5Router.t.sol +++ b/test/V5Router.t.sol @@ -20,7 +20,7 @@ contract V5RouterForkTestBase is Test, OneInchContracts { v4AggregationExecutor, v4AggregationRouter ); - factory.deploy(OneInchRouterFactory.RouterTypes.V5AggregationRouter, USDC); + factory.deploy(OneInchRouterFactory.RouterType.V5AggregationRouter, USDC); deal(USDC, address(this), 100_000_000); addr = 0xEAC5F0d4A9a45E1f9FdD0e7e2882e9f60E301156; } @@ -53,7 +53,7 @@ contract V5RouterForkTest is V5RouterForkTestBase { // Setup optimized router call vm.startPrank(0xEAC5F0d4A9a45E1f9FdD0e7e2882e9f60E301156); address routerAddr = - factory.computeAddress(OneInchRouterFactory.RouterTypes.V5AggregationRouter, USDC); + factory.computeAddress(OneInchRouterFactory.RouterType.V5AggregationRouter, USDC); IERC20(USDC).approve(routerAddr, 100_000); uint256 startingBalance = IERC20(UNI).balanceOf(addr); assertTrue(startingBalance == 0); From 14bd0979799c13bebe577d40a07b9108745f4d10 Mon Sep 17 00:00:00 2001 From: Keating Date: Mon, 8 May 2023 08:44:29 -0400 Subject: [PATCH 21/48] Remove source receiver arg --- src/AggregationBaseRouter.sol | 10 ++++------ src/RouterFactory.sol | 20 ++++---------------- src/V4Router.sol | 5 ++--- src/V5Router.sol | 5 ++--- 4 files changed, 12 insertions(+), 28 deletions(-) diff --git a/src/AggregationBaseRouter.sol b/src/AggregationBaseRouter.sol index 57db776..7991a03 100644 --- a/src/AggregationBaseRouter.sol +++ b/src/AggregationBaseRouter.sol @@ -24,13 +24,12 @@ abstract contract AggregationV5BaseRouter { constructor( IV5AggregationExecutor aggregationExecutor, IV5AggregationRouter aggregationRouter, - address token, - address sourceReceiver + address token ) { AGGREGATION_EXECUTOR = aggregationExecutor; AGGREGATION_ROUTER = aggregationRouter; TOKEN = token; - SOURCE_RECEIVER = sourceReceiver; + SOURCE_RECEIVER = address(aggregationExecutor); } } @@ -53,12 +52,11 @@ abstract contract AggregationV4BaseRouter { constructor( IV4AggregationExecutor aggregationExecutor, IV4AggregationRouter aggregationRouter, - address token, - address sourceReceiver + address token ) { AGGREGATION_EXECUTOR = aggregationExecutor; AGGREGATION_ROUTER = aggregationRouter; TOKEN = token; - SOURCE_RECEIVER = sourceReceiver; + SOURCE_RECEIVER = address(aggregationExecutor); } } diff --git a/src/RouterFactory.sol b/src/RouterFactory.sol index 8f9e967..9dcacc8 100644 --- a/src/RouterFactory.sol +++ b/src/RouterFactory.sol @@ -31,14 +31,6 @@ contract OneInchRouterFactory { /// @notice The 1inch v4 aggregation router contract. IV4AggregationRouter public immutable V4_AGGREGATION_ROUTER; - /// @notice The address the 1inch v5 aggregation router will send the the input tokens. - /// This will match the V5_AGGREGATION_EXECUTOR address. - address public immutable V5_SOURCE_RECEIVER; - - /// @notice The address the 1inch v4 aggregation router will send the the input tokens. - /// This will match the V4_AGGREGATION_EXECUTOR address. - address public immutable V4_SOURCE_RECEIVER; - event RouterDeployed(RouterType type_, address indexed asset); constructor( @@ -49,10 +41,8 @@ contract OneInchRouterFactory { ) { V5_AGGREGATION_EXECUTOR = v5AggregationExecutor; V5_AGGREGATION_ROUTER = v5AggregationRouter; - V5_SOURCE_RECEIVER = address(v5AggregationExecutor); V4_AGGREGATION_EXECUTOR = v4AggregationExecutor; V4_AGGREGATION_ROUTER = v4AggregationRouter; - V4_SOURCE_RECEIVER = address(v4AggregationExecutor); } function deploy(RouterType type_, address asset) external returns (address) { @@ -63,8 +53,7 @@ contract OneInchRouterFactory { new V5Router{salt: salt}( V5_AGGREGATION_ROUTER, V5_AGGREGATION_EXECUTOR, - asset, - V5_SOURCE_RECEIVER + asset ) ); } else if (type_ == RouterType.V4AggregationRouter) { @@ -72,8 +61,7 @@ contract OneInchRouterFactory { new V4Router{salt: salt}( V4_AGGREGATION_ROUTER, V4_AGGREGATION_EXECUTOR, - asset, - V4_SOURCE_RECEIVER + asset ) ); } else { @@ -98,7 +86,7 @@ contract OneInchRouterFactory { _salt(asset), address(this), type(V4Router).creationCode, - abi.encode(V4_AGGREGATION_ROUTER, V4_AGGREGATION_EXECUTOR, asset, V4_SOURCE_RECEIVER) + abi.encode(V4_AGGREGATION_ROUTER, V4_AGGREGATION_EXECUTOR, asset) ); } @@ -107,7 +95,7 @@ contract OneInchRouterFactory { _salt(asset), address(this), type(V5Router).creationCode, - abi.encode(V5_AGGREGATION_ROUTER, V5_AGGREGATION_EXECUTOR, asset, V5_SOURCE_RECEIVER) + abi.encode(V5_AGGREGATION_ROUTER, V5_AGGREGATION_EXECUTOR, asset) ); } diff --git a/src/V4Router.sol b/src/V4Router.sol index af45624..69f809a 100644 --- a/src/V4Router.sol +++ b/src/V4Router.sol @@ -12,9 +12,8 @@ contract V4Router is AggregationV4BaseRouter { constructor( IV4AggregationRouter aggregationRouter, IV4AggregationExecutor aggregationExecutor, - address token, - address sourceReceiver - ) AggregationV4BaseRouter(aggregationExecutor, aggregationRouter, token, sourceReceiver) {} + address token + ) AggregationV4BaseRouter(aggregationExecutor, aggregationRouter, token) {} // TODO: Update to handle receiving ETH receive() external payable {} diff --git a/src/V5Router.sol b/src/V5Router.sol index dacc443..aed95da 100644 --- a/src/V5Router.sol +++ b/src/V5Router.sol @@ -12,9 +12,8 @@ contract V5Router is AggregationV5BaseRouter { constructor( IV5AggregationRouter aggregationRouter, IV5AggregationExecutor aggregationExecutor, - address token, - address sourceReceiver - ) AggregationV5BaseRouter(aggregationExecutor, aggregationRouter, token, sourceReceiver) {} + address token + ) AggregationV5BaseRouter(aggregationExecutor, aggregationRouter, token) {} // TODO: Update to handle receiving ETH receive() external payable {} From 4a6dd7fd6d075140163191eebb8ebc50d071f522 Mon Sep 17 00:00:00 2001 From: Keating Date: Mon, 8 May 2023 08:48:48 -0400 Subject: [PATCH 22/48] Add tests for router factory deploy --- test/RouterFactory.t.sol | 147 ++++++++++++++++++++++++++++++++++----- 1 file changed, 128 insertions(+), 19 deletions(-) diff --git a/test/RouterFactory.t.sol b/test/RouterFactory.t.sol index 0d5578a..a317422 100644 --- a/test/RouterFactory.t.sol +++ b/test/RouterFactory.t.sol @@ -2,39 +2,148 @@ pragma solidity >=0.8.0; import {Test} from "forge-std/Test.sol"; + +import {IV5AggregationExecutor} from "src/interfaces/IV5AggregationExecutor.sol"; +import {IV5AggregationRouter} from "src/interfaces/IV5AggregationRouter.sol"; +import {IV4AggregationExecutor} from "src/interfaces/IV4AggregationExecutor.sol"; +import {IV4AggregationRouter} from "src/interfaces/IV4AggregationRouter.sol"; import {OneInchRouterFactory} from "src/RouterFactory.sol"; +import {V4Router} from "src/V4Router.sol"; import {OneInchContracts} from "test/1InchContracts.sol"; -contract RouterFactoryTest is Test, OneInchContracts { - OneInchRouterFactory factory; +interface IBadOneInchRouterFactory { + enum BadRouterType { + V4AggregationRouter, + V5AggregationRouter, + MadeUpRouter + } + + function deploy(BadRouterType type_, address asset) + external + returns (address); +} + +contract RouterFactoryTest is Test, OneInchContracts {} + +contract Constructor is RouterFactoryTest { + function testFuzz_CorrectlySetsAllConstructorArgs( + address v5AggregationExecutorAddress, + address v5AggregationRouterAddress, + address v4AggregationExecutorAddress, + address v4AggregationRouterAddress + ) public { + IV5AggregationExecutor v5AggregationExecutor = IV5AggregationExecutor( + v5AggregationExecutorAddress + ); + IV5AggregationRouter v5AggregationRouter = IV5AggregationRouter( + v5AggregationRouterAddress + ); + IV4AggregationExecutor v4AggregationExecutor = IV4AggregationExecutor( + v4AggregationExecutor + ); + IV4AggregationRouter v4AggregationRouter = IV4AggregationRouter( + v4AggregationRouterAddress + ); - function test_deployV5Router() public { - factory = new OneInchRouterFactory( + OneInchRouterFactory factory = new OneInchRouterFactory( v5AggregationExecutor, v5AggregationRouter, v4AggregationExecutor, v4AggregationRouter ); - address V5Router = factory.deploy(OneInchRouterFactory.RouterType.V5AggregationRouter, USDC); - assertEq( - V5Router, - factory.computeAddress(OneInchRouterFactory.RouterType.V5AggregationRouter, USDC), - "V5Router address should be correct" + assertEq( + address(factory.V5_AGGREGATION_EXECUTOR()), + address(v5AggregationExecutor), + "V5_AGGREGATION_EXECUTOR not set correctly" + ); + assertEq( + address(factory.V5_AGGREGATION_ROUTER()), + address(v5AggregationRouter), + "V5_AGGREGATION_ROUTER was not set correctly" + ); + assertEq( + address(factory.V4_AGGREGATION_EXECUTOR()), + address(v4AggregationExecutor), + "V4_AGGREGATION_EXECUTOR was not set correctly" + ); + assertEq( + address(factory.V4_AGGREGATION_ROUTER()), + address(v4AggregationRouter), + "V4_AGGREGATION_ROUTER was not set correctly" + ); + } +} + +contract Deploy is RouterFactoryTest { + OneInchRouterFactory factory; + + event RouterDeployed( + OneInchRouterFactory.RouterType type_, + address indexed asset ); - } - function test_deployV4Router() public { - factory = new OneInchRouterFactory( + function setUp() public { + factory = new OneInchRouterFactory( v5AggregationExecutor, v5AggregationRouter, v4AggregationExecutor, v4AggregationRouter ); - address V4Router = factory.deploy(OneInchRouterFactory.RouterType.V4AggregationRouter, USDC); - assertEq( - V4Router, - factory.computeAddress(OneInchRouterFactory.RouterType.V4AggregationRouter, USDC), - "V4Router address should be correct" - ); - } + } + + function testFuzz_CorrectlyDeployV4Router(address asset) public { + vm.expectEmit(true, true, true, true); + emit RouterDeployed( + OneInchRouterFactory.RouterType.V4AggregationRouter, + asset + ); + + address deployedRouterAddress = factory.deploy( + OneInchRouterFactory.RouterType.V4AggregationRouter, + asset + ); + + factory.computeAddress( + OneInchRouterFactory.RouterType.V4AggregationRouter, + asset + ); + assertEq( + deployedRouterAddress, + factory.computeAddress( + OneInchRouterFactory.RouterType.V4AggregationRouter, + asset + ), + "Address not equal to computed v4 router address" + ); + } + + function testFuzz_CorrectlyDeployV5Router(address asset) public { + vm.expectEmit(true, true, true, true); + emit RouterDeployed( + OneInchRouterFactory.RouterType.V5AggregationRouter, + asset + ); + + address deployedRouterAddress = factory.deploy( + OneInchRouterFactory.RouterType.V5AggregationRouter, + asset + ); + + assertEq( + deployedRouterAddress, + factory.computeAddress( + OneInchRouterFactory.RouterType.V5AggregationRouter, + asset + ), + "Address not equal to computed v5 router address" + ); + } + + function test_RevertIfUnsupportedRouterType() public { + vm.expectRevert(); + IBadOneInchRouterFactory(address(factory)).deploy( + IBadOneInchRouterFactory.BadRouterType.MadeUpRouter, + USDC + ); + } } From cc515ef015d8396c7fcdc2a4e4990020a0353b74 Mon Sep 17 00:00:00 2001 From: Keating Date: Mon, 8 May 2023 09:21:02 -0400 Subject: [PATCH 23/48] Add compute address tests --- test/RouterFactory.t.sol | 238 +++++++++++++++++++++------------------ 1 file changed, 126 insertions(+), 112 deletions(-) diff --git a/test/RouterFactory.t.sol b/test/RouterFactory.t.sol index a317422..4286a35 100644 --- a/test/RouterFactory.t.sol +++ b/test/RouterFactory.t.sol @@ -3,147 +3,161 @@ pragma solidity >=0.8.0; import {Test} from "forge-std/Test.sol"; +import {Create2} from "src/lib/Create2.sol"; import {IV5AggregationExecutor} from "src/interfaces/IV5AggregationExecutor.sol"; import {IV5AggregationRouter} from "src/interfaces/IV5AggregationRouter.sol"; import {IV4AggregationExecutor} from "src/interfaces/IV4AggregationExecutor.sol"; import {IV4AggregationRouter} from "src/interfaces/IV4AggregationRouter.sol"; import {OneInchRouterFactory} from "src/RouterFactory.sol"; +import {V5Router} from "src/V5Router.sol"; import {V4Router} from "src/V4Router.sol"; import {OneInchContracts} from "test/1InchContracts.sol"; interface IBadOneInchRouterFactory { - enum BadRouterType { - V4AggregationRouter, - V5AggregationRouter, - MadeUpRouter - } - - function deploy(BadRouterType type_, address asset) - external - returns (address); + enum BadRouterType { + V4AggregationRouter, + V5AggregationRouter, + MadeUpRouter + } + + function deploy(BadRouterType type_, address asset) external returns (address); } -contract RouterFactoryTest is Test, OneInchContracts {} +contract RouterFactoryTest is Test, OneInchContracts { + OneInchRouterFactory factory; -contract Constructor is RouterFactoryTest { - function testFuzz_CorrectlySetsAllConstructorArgs( - address v5AggregationExecutorAddress, - address v5AggregationRouterAddress, - address v4AggregationExecutorAddress, - address v4AggregationRouterAddress - ) public { - IV5AggregationExecutor v5AggregationExecutor = IV5AggregationExecutor( - v5AggregationExecutorAddress - ); - IV5AggregationRouter v5AggregationRouter = IV5AggregationRouter( - v5AggregationRouterAddress - ); - IV4AggregationExecutor v4AggregationExecutor = IV4AggregationExecutor( - v4AggregationExecutor - ); - IV4AggregationRouter v4AggregationRouter = IV4AggregationRouter( - v4AggregationRouterAddress - ); + event RouterDeployed(OneInchRouterFactory.RouterType type_, address indexed asset); - OneInchRouterFactory factory = new OneInchRouterFactory( + function setUp() public { + factory = new OneInchRouterFactory( v5AggregationExecutor, v5AggregationRouter, v4AggregationExecutor, v4AggregationRouter ); - assertEq( - address(factory.V5_AGGREGATION_EXECUTOR()), - address(v5AggregationExecutor), - "V5_AGGREGATION_EXECUTOR not set correctly" - ); - assertEq( - address(factory.V5_AGGREGATION_ROUTER()), - address(v5AggregationRouter), - "V5_AGGREGATION_ROUTER was not set correctly" - ); - assertEq( - address(factory.V4_AGGREGATION_EXECUTOR()), - address(v4AggregationExecutor), - "V4_AGGREGATION_EXECUTOR was not set correctly" - ); - assertEq( - address(factory.V4_AGGREGATION_ROUTER()), - address(v4AggregationRouter), - "V4_AGGREGATION_ROUTER was not set correctly" - ); - } + } } -contract Deploy is RouterFactoryTest { - OneInchRouterFactory factory; - - event RouterDeployed( - OneInchRouterFactory.RouterType type_, - address indexed asset - ); - - function setUp() public { - factory = new OneInchRouterFactory( +contract Constructor is RouterFactoryTest { + function testFuzz_CorrectlySetsAllConstructorArgs( + address v5AggregationExecutorAddress, + address v5AggregationRouterAddress, + address v4AggregationExecutorAddress, + address v4AggregationRouterAddress + ) public { + IV5AggregationExecutor v5AggregationExecutor = + IV5AggregationExecutor(v5AggregationExecutorAddress); + IV5AggregationRouter v5AggregationRouter = IV5AggregationRouter(v5AggregationRouterAddress); + IV4AggregationExecutor v4AggregationExecutor = IV4AggregationExecutor(v4AggregationExecutor); + IV4AggregationRouter v4AggregationRouter = IV4AggregationRouter(v4AggregationRouterAddress); + + OneInchRouterFactory factory = new OneInchRouterFactory( v5AggregationExecutor, v5AggregationRouter, v4AggregationExecutor, v4AggregationRouter ); - } - - function testFuzz_CorrectlyDeployV4Router(address asset) public { - vm.expectEmit(true, true, true, true); - emit RouterDeployed( - OneInchRouterFactory.RouterType.V4AggregationRouter, - asset - ); + assertEq( + address(factory.V5_AGGREGATION_EXECUTOR()), + address(v5AggregationExecutor), + "V5_AGGREGATION_EXECUTOR not set correctly" + ); + assertEq( + address(factory.V5_AGGREGATION_ROUTER()), + address(v5AggregationRouter), + "V5_AGGREGATION_ROUTER was not set correctly" + ); + assertEq( + address(factory.V4_AGGREGATION_EXECUTOR()), + address(v4AggregationExecutor), + "V4_AGGREGATION_EXECUTOR was not set correctly" + ); + assertEq( + address(factory.V4_AGGREGATION_ROUTER()), + address(v4AggregationRouter), + "V4_AGGREGATION_ROUTER was not set correctly" + ); + } +} - address deployedRouterAddress = factory.deploy( - OneInchRouterFactory.RouterType.V4AggregationRouter, - asset - ); +contract Deploy is RouterFactoryTest { + function testFuzz_CorrectlyDeployV4Router(address asset) public { + vm.expectEmit(true, true, true, true); + emit RouterDeployed(OneInchRouterFactory.RouterType.V4AggregationRouter, asset); + + address deployedRouterAddress = + factory.deploy(OneInchRouterFactory.RouterType.V4AggregationRouter, asset); + + factory.computeAddress(OneInchRouterFactory.RouterType.V4AggregationRouter, asset); + assertEq( + deployedRouterAddress, + factory.computeAddress(OneInchRouterFactory.RouterType.V4AggregationRouter, asset), + "Address not equal to computed v4 router address" + ); + } - factory.computeAddress( - OneInchRouterFactory.RouterType.V4AggregationRouter, - asset - ); - assertEq( - deployedRouterAddress, - factory.computeAddress( - OneInchRouterFactory.RouterType.V4AggregationRouter, - asset - ), - "Address not equal to computed v4 router address" - ); - } + function testFuzz_CorrectlyDeployV5Router(address asset) public { + vm.expectEmit(true, true, true, true); + emit RouterDeployed(OneInchRouterFactory.RouterType.V5AggregationRouter, asset); - function testFuzz_CorrectlyDeployV5Router(address asset) public { - vm.expectEmit(true, true, true, true); - emit RouterDeployed( - OneInchRouterFactory.RouterType.V5AggregationRouter, - asset - ); + address deployedRouterAddress = + factory.deploy(OneInchRouterFactory.RouterType.V5AggregationRouter, asset); - address deployedRouterAddress = factory.deploy( - OneInchRouterFactory.RouterType.V5AggregationRouter, - asset - ); + assertEq( + deployedRouterAddress, + factory.computeAddress(OneInchRouterFactory.RouterType.V5AggregationRouter, asset), + "Address not equal to computed v5 router address" + ); + } - assertEq( - deployedRouterAddress, - factory.computeAddress( - OneInchRouterFactory.RouterType.V5AggregationRouter, - asset - ), - "Address not equal to computed v5 router address" - ); - } + function test_RevertIfUnsupportedRouterType() public { + vm.expectRevert(); + IBadOneInchRouterFactory(address(factory)).deploy( + IBadOneInchRouterFactory.BadRouterType.MadeUpRouter, USDC + ); + } +} - function test_RevertIfUnsupportedRouterType() public { - vm.expectRevert(); - IBadOneInchRouterFactory(address(factory)).deploy( - IBadOneInchRouterFactory.BadRouterType.MadeUpRouter, - USDC - ); - } +contract ComputeAddress is RouterFactoryTest { + function helper_salt(address asset) internal returns (bytes32) { + return bytes32(uint256(uint160(asset))); + } + + function helper_computeV4Address(address asset, address factoryAddr) internal returns (address) { + return Create2.computeCreate2Address( + helper_salt(asset), + factoryAddr, + type(V4Router).creationCode, + abi.encode(v4AggregationRouter, v4AggregationExecutor, asset) + ); + } + + function helper_computeV5Address(address asset, address factoryAddr) internal returns (address) { + return Create2.computeCreate2Address( + helper_salt(asset), + factoryAddr, + type(V5Router).creationCode, + abi.encode(v5AggregationRouter, v5AggregationExecutor, asset) + ); + } + + function testFuzz_ComputeV4Address(address asset) public { + address computedAddress = + factory.computeAddress(OneInchRouterFactory.RouterType.V4AggregationRouter, asset); + assertEq( + computedAddress, + helper_computeV4Address(asset, address(factory)), + "V4 computed address is not equal to its expected address" + ); + } + + function testFuzz_ComputeV5Address(address asset) public { + address computedAddress = + factory.computeAddress(OneInchRouterFactory.RouterType.V5AggregationRouter, asset); + assertEq( + computedAddress, + helper_computeV5Address(asset, address(factory)), + "V5 computed address is not equal to its expected address" + ); + } } From cf688109ec243b434bd6ce1e987328fa3136ee9f Mon Sep 17 00:00:00 2001 From: Keating Date: Mon, 8 May 2023 10:36:16 -0400 Subject: [PATCH 24/48] Reorganize v5 tests --- test/V5Router.t.sol | 79 ++++++++++++++++++++++++++++++++------------- 1 file changed, 57 insertions(+), 22 deletions(-) diff --git a/test/V5Router.t.sol b/test/V5Router.t.sol index 5d87c99..f841c59 100644 --- a/test/V5Router.t.sol +++ b/test/V5Router.t.sol @@ -8,9 +8,11 @@ import {OneInchRouterFactory} from "src/RouterFactory.sol"; import {OneInchContracts} from "test/1InchContracts.sol"; import {IV5AggregationRouter} from "src/interfaces/IV5AggregationRouter.sol"; -contract V5RouterForkTestBase is Test, OneInchContracts { +contract V5RouterTest is Test, OneInchContracts {} + +contract Fallback is V5RouterTest { OneInchRouterFactory factory; - address addr; + address swappingAddress; function setUp() public { vm.createSelectFork(vm.rpcUrl("optimism"), 94_524_034); @@ -22,24 +24,15 @@ contract V5RouterForkTestBase is Test, OneInchContracts { ); factory.deploy(OneInchRouterFactory.RouterType.V5AggregationRouter, USDC); deal(USDC, address(this), 100_000_000); - addr = 0xEAC5F0d4A9a45E1f9FdD0e7e2882e9f60E301156; - } -} - -contract V5RouterForkTest is V5RouterForkTestBase { - function nativeSwap( - IV5AggregationRouter.SwapDescription memory desc, - bytes memory permit, - bytes memory data, - uint256 snapshotId - ) public returns (uint256) { - vm.revertTo(snapshotId); - v5AggregationRouter.swap(v5AggregationExecutor, desc, permit, data); - return IERC20(UNI).balanceOf(addr); + // Address the api calldata uses as the swapper + swappingAddress = 0xEAC5F0d4A9a45E1f9FdD0e7e2882e9f60E301156; } - function test_swapUSDC() public { - uint256 snapshotId = vm.snapshot(); + function helper_apiParams() + public + view + returns (IV5AggregationRouter.SwapDescription memory, bytes memory, bytes memory) + { // Calldata generated from calling 1inch's api bytes memory dataParams = hex"12aa3caf000000000000000000000000f0694acc9e941b176e17b9ef923e71e7b8b2477a0000000000000000000000007f5c764cbc14f9669b88837ca1490cca17c316070000000000000000000000006fd9d7ad17242c41f7131d257212c54a0e816691000000000000000000000000f0694acc9e941b176e17b9ef923e71e7b8b2477a000000000000000000000000eac5f0d4a9a45e1f9fdd0e7e2882e9f60e30115600000000000000000000000000000000000000000000000000000000000186a0000000000000000000000000000000000000000000000000003e530a0ee30f45000000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000001400000000000000000000000000000000000000000000000000000000000000160000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001f50000000000000000000000000000000000000000000000000000000001d700a007e5c0d20000000000000000000000000000000000000000000000000001b30001505126a132dab612db5cb9fc9ac426a0cc215a3423f9c97f5c764cbc14f9669b88837ca1490cca17c316070004f41766d8000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002e2669c6242f00000000000000000000000000000000000000000000000000000000000000a0000000000000000000000000f0694acc9e941b176e17b9ef923e71e7b8b2477a00000000000000000000000000000000000000000000000000000000644fdfe900000000000000000000000000000000000000000000000000000000000000010000000000000000000000007f5c764cbc14f9669b88837ca1490cca17c316070000000000000000000000004200000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000102a0000000000000000000000000000000000000000000000000003e530a0ee30f45ee63c1e581ad4c666fc170b468b19988959eb931a3676f0e9f42000000000000000000000000000000000000061111111254eeb25477b68fb85ed929f73a9605820000000000000000000000cfee7c08"; @@ -49,13 +42,55 @@ contract V5RouterForkTest is V5RouterForkTestBase { this.returnSliceBytes(dataParams), (address, IV5AggregationRouter.SwapDescription, bytes, bytes) ); + return (desc, permit, data); + } + + function helper_nativeSwap( + IV5AggregationRouter.SwapDescription memory desc, + bytes memory permit, + bytes memory data, + uint256 snapshotId + ) public returns (uint256) { + vm.revertTo(snapshotId); + v5AggregationRouter.swap(v5AggregationExecutor, desc, permit, data); + return IERC20(UNI).balanceOf(swappingAddress); + } + + function testFork_RevertIf_NotEnoughFunds() public { + (IV5AggregationRouter.SwapDescription memory desc, bytes memory permit, bytes memory data) = + helper_apiParams(); + + address routerAddr = + factory.computeAddress(OneInchRouterFactory.RouterType.V5AggregationRouter, USDC); + uint256 balance = IERC20(USDC).balanceOf(swappingAddress); + vm.startPrank(swappingAddress); + IERC20(USDC).approve(routerAddr, 10_000_000); + (bool ok,) = + payable(routerAddr).call(abi.encode(UNI, 10_000_000, desc.minReturnAmount, data, 0)); + assertTrue(!ok, "Swap succeeded"); + } + + function testFork_RevertIf_zeroAddress() public { + (IV5AggregationRouter.SwapDescription memory desc, bytes memory permit, bytes memory data) = + helper_apiParams(); + address routerAddr = + factory.computeAddress(OneInchRouterFactory.RouterType.V5AggregationRouter, USDC); + IERC20(USDC).approve(routerAddr, 250_000); + (bool ok,) = + payable(routerAddr).call(abi.encode(address(0), 250_000, desc.minReturnAmount, data, 0)); + assertTrue(!ok, "Swap succeeded"); + } + function testFork_swapUSDC() public { + uint256 snapshotId = vm.snapshot(); + (IV5AggregationRouter.SwapDescription memory desc, bytes memory permit, bytes memory data) = + helper_apiParams(); // Setup optimized router call - vm.startPrank(0xEAC5F0d4A9a45E1f9FdD0e7e2882e9f60E301156); + vm.startPrank(swappingAddress); address routerAddr = factory.computeAddress(OneInchRouterFactory.RouterType.V5AggregationRouter, USDC); IERC20(USDC).approve(routerAddr, 100_000); - uint256 startingBalance = IERC20(UNI).balanceOf(addr); + uint256 startingBalance = IERC20(UNI).balanceOf(swappingAddress); assertTrue(startingBalance == 0); // Optimized router call @@ -64,8 +99,8 @@ contract V5RouterForkTest is V5RouterForkTestBase { assertTrue(ok); // Compare balance to native aggregation router call - uint256 endingBalance = IERC20(UNI).balanceOf(addr); - uint256 nativeEndingBalance = nativeSwap(desc, permit, data, snapshotId); + uint256 endingBalance = IERC20(UNI).balanceOf(swappingAddress); + uint256 nativeEndingBalance = helper_nativeSwap(desc, permit, data, snapshotId); assertTrue(endingBalance == nativeEndingBalance); } } From 56796ca709a05e12447b6cefa77c41a63a9d0ab1 Mon Sep 17 00:00:00 2001 From: Keating Date: Mon, 8 May 2023 10:36:48 -0400 Subject: [PATCH 25/48] Rename router factory revert --- test/RouterFactory.t.sol | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/RouterFactory.t.sol b/test/RouterFactory.t.sol index 4286a35..789cbb5 100644 --- a/test/RouterFactory.t.sol +++ b/test/RouterFactory.t.sol @@ -110,7 +110,7 @@ contract Deploy is RouterFactoryTest { ); } - function test_RevertIfUnsupportedRouterType() public { + function test_RevertIf_UnsupportedRouterType() public { vm.expectRevert(); IBadOneInchRouterFactory(address(factory)).deploy( IBadOneInchRouterFactory.BadRouterType.MadeUpRouter, USDC From 3e873fbebf4d37898cf72d76e80738725dba0d0e Mon Sep 17 00:00:00 2001 From: Keating Date: Mon, 8 May 2023 10:57:10 -0400 Subject: [PATCH 26/48] Reorganize v4 tests --- test/V4Router.t.sol | 57 ++++++++++++++++++++++++++++++++++----------- 1 file changed, 44 insertions(+), 13 deletions(-) diff --git a/test/V4Router.t.sol b/test/V4Router.t.sol index 1086d5b..8be4ca9 100644 --- a/test/V4Router.t.sol +++ b/test/V4Router.t.sol @@ -8,9 +8,11 @@ import {OneInchRouterFactory} from "src/RouterFactory.sol"; import {OneInchContracts} from "test/1InchContracts.sol"; import {IV4AggregationRouter} from "src/interfaces/IV4AggregationRouter.sol"; -contract V4RouterForkTestBase is Test, OneInchContracts { +contract V4RouterTest is Test, OneInchContracts {} + +contract Fallback is V4RouterTest { OneInchRouterFactory factory; - address addr; + address swappingAddress; function setUp() public { vm.createSelectFork(vm.rpcUrl("optimism"), 95_544_472); @@ -22,23 +24,24 @@ contract V4RouterForkTestBase is Test, OneInchContracts { ); factory.deploy(OneInchRouterFactory.RouterType.V4AggregationRouter, USDC); deal(USDC, address(this), 100_000_000); - addr = 0xEAC5F0d4A9a45E1f9FdD0e7e2882e9f60E301156; + swappingAddress = 0xEAC5F0d4A9a45E1f9FdD0e7e2882e9f60E301156; } -} -contract V4RouterForkTest is V4RouterForkTestBase { - function nativeSwap( + function helper_nativeSwap( IV4AggregationRouter.SwapDescription memory desc, bytes memory data, uint256 snapshotId ) public returns (uint256) { vm.revertTo(snapshotId); v4AggregationRouter.swap(v4AggregationExecutor, desc, data); - return IERC20(UNI).balanceOf(addr); + return IERC20(UNI).balanceOf(swappingAddress); } - function test_swapUSDC() public { - uint256 snapshotId = vm.snapshot(); + function helper_apiParams() + public + view + returns (IV4AggregationRouter.SwapDescription memory, bytes memory) + { // Calldata generated from calling 1inch's api bytes memory dataParams = hex"7c025200000000000000000000000000f0694acc9e941b176e17b9ef923e71e7b8b2477a000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000001800000000000000000000000007f5c764cbc14f9669b88837ca1490cca17c316070000000000000000000000006fd9d7ad17242c41f7131d257212c54a0e816691000000000000000000000000f0694acc9e941b176e17b9ef923e71e7b8b2477a000000000000000000000000eac5f0d4a9a45e1f9fdd0e7e2882e9f60e30115600000000000000000000000000000000000000000000000000000000000186a0000000000000000000000000000000000000000000000000003e1aba8fed6bc100000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001e10000000000000000000000000000000000000000000000000000000001a300a007e5c0d200000000000000000000000000000000000000000000000000017f00011c4330f9d5940c2313636546ab9852354860dce275dbad00000000000000000000000000000000000000000000000000002ecaf7212e2f002424b31a0c000000000000000000000000f0694acc9e941b176e17b9ef923e71e7b8b2477a00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000fffd8963efd1fc6a506488495d951d5263988d2500000000000000000000000000000000000000000000000000000000000000a000000000000000000000000000000000000000000000000000000000000000200000000000000000000000007f5c764cbc14f9669b88837ca1490cca17c3160702a0000000000000000000000000000000000000000000000000003e1aba8fed6bc1ee63c1e581ad4c666fc170b468b19988959eb931a3676f0e9f42000000000000000000000000000000000000061111111254760f7ab3f16433eea9304126dcd19900000000000000000000000000000000000000000000000000000000000186a000000000000000000000000000000000000000000000000000000000000000cfee7c08"; @@ -46,13 +49,41 @@ contract V4RouterForkTest is V4RouterForkTestBase { (, IV4AggregationRouter.SwapDescription memory desc, bytes memory data) = abi.decode( this.returnSliceBytes(dataParams), (address, IV4AggregationRouter.SwapDescription, bytes) ); + return (desc, data); + } + + function testFork_RevertIf_NotEnoughFunds() public { + (IV4AggregationRouter.SwapDescription memory desc, bytes memory data) = helper_apiParams(); + + address routerAddr = + factory.computeAddress(OneInchRouterFactory.RouterType.V4AggregationRouter, USDC); + uint256 balance = IERC20(USDC).balanceOf(swappingAddress); + vm.startPrank(swappingAddress); + IERC20(USDC).approve(routerAddr, 10_000_000); + (bool ok,) = + payable(routerAddr).call(abi.encode(UNI, 10_000_000, desc.minReturnAmount, data, 0)); + assertTrue(!ok, "Swap succeeded"); + } + function testFork_RevertIf_zeroAddress() public { + (IV4AggregationRouter.SwapDescription memory desc, bytes memory data) = helper_apiParams(); + address routerAddr = + factory.computeAddress(OneInchRouterFactory.RouterType.V4AggregationRouter, USDC); + IERC20(USDC).approve(routerAddr, 250_000); + (bool ok,) = + payable(routerAddr).call(abi.encode(address(0), 250_000, desc.minReturnAmount, data, 0)); + assertTrue(!ok, "Swap succeeded"); + } + + function testFork_swapUSDC() public { + uint256 snapshotId = vm.snapshot(); + (IV4AggregationRouter.SwapDescription memory desc, bytes memory data) = helper_apiParams(); // Setup the optimized router call - vm.startPrank(0xEAC5F0d4A9a45E1f9FdD0e7e2882e9f60E301156); + vm.startPrank(swappingAddress); address routerAddr = factory.computeAddress(OneInchRouterFactory.RouterType.V4AggregationRouter, USDC); IERC20(USDC).approve(routerAddr, 100_000); - uint256 startingBalance = IERC20(UNI).balanceOf(addr); + uint256 startingBalance = IERC20(UNI).balanceOf(swappingAddress); assertTrue(startingBalance == 0); // Optimized router call @@ -61,8 +92,8 @@ contract V4RouterForkTest is V4RouterForkTestBase { assertTrue(ok); // Compare balance to native aggregation router call - uint256 endingBalance = IERC20(UNI).balanceOf(addr); - uint256 nativeEndingBalance = nativeSwap(desc, data, snapshotId); + uint256 endingBalance = IERC20(UNI).balanceOf(swappingAddress); + uint256 nativeEndingBalance = helper_nativeSwap(desc, data, snapshotId); assertTrue(endingBalance == nativeEndingBalance); } } From 1ea7fcfaecd98fada43c474b4d2bfc318ad1e7a7 Mon Sep 17 00:00:00 2001 From: Keating Date: Mon, 8 May 2023 11:43:54 -0400 Subject: [PATCH 27/48] Make sure tests are recognized by scoplint spec --- script/Deploy.s.sol | 8 +++---- src/RouterFactory.sol | 2 +- test/RouterFactory.t.sol | 34 +++++++++++++-------------- test/V4Router.t.sol | 17 ++++++-------- test/V5Router.t.sol | 50 +++++++++++++++++++++++++++++++--------- test/lib/Create2.t.sol | 2 +- 6 files changed, 68 insertions(+), 45 deletions(-) diff --git a/script/Deploy.s.sol b/script/Deploy.s.sol index ba84259..9214ea8 100644 --- a/script/Deploy.s.sol +++ b/script/Deploy.s.sol @@ -5,13 +5,13 @@ pragma solidity ^0.8.16; import {Script} from "forge-std/Script.sol"; import {IERC20} from "openzeppelin-contracts/contracts/token/ERC20/IERC20.sol"; import {OneInchContracts} from "test/1InchContracts.sol"; -import {OneInchRouterFactory} from "src/RouterFactory.sol"; +import {RouterFactory} from "src/RouterFactory.sol"; contract Deploy is Script, OneInchContracts { function run() public { // Deploy the optimized router factory vm.broadcast(); - OneInchRouterFactory factory = new OneInchRouterFactory( + RouterFactory factory = new RouterFactory( v5AggregationExecutor, v5AggregationRouter, v4AggregationExecutor, @@ -20,10 +20,10 @@ contract Deploy is Script, OneInchContracts { // Deploy the optimized router for V5Aggregation vm.broadcast(); - factory.deploy(OneInchRouterFactory.RouterType.V5AggregationRouter, USDC); + factory.deploy(RouterFactory.RouterType.V5AggregationRouter, USDC); // Deploy the optimized router for V4Aggregation vm.broadcast(); - factory.deploy(OneInchRouterFactory.RouterType.V4AggregationRouter, USDC); + factory.deploy(RouterFactory.RouterType.V4AggregationRouter, USDC); } } diff --git a/src/RouterFactory.sol b/src/RouterFactory.sol index 9dcacc8..a8fc411 100644 --- a/src/RouterFactory.sol +++ b/src/RouterFactory.sol @@ -10,7 +10,7 @@ import {V5Router} from "src/V5Router.sol"; import {V4Router} from "src/V4Router.sol"; /// @notice A factory for deploying an optimized router for a given asset and router type. -contract OneInchRouterFactory { +contract RouterFactory { error RouterTypeDoesNotExist(); enum RouterType { diff --git a/test/RouterFactory.t.sol b/test/RouterFactory.t.sol index 789cbb5..fe75561 100644 --- a/test/RouterFactory.t.sol +++ b/test/RouterFactory.t.sol @@ -8,12 +8,12 @@ import {IV5AggregationExecutor} from "src/interfaces/IV5AggregationExecutor.sol" import {IV5AggregationRouter} from "src/interfaces/IV5AggregationRouter.sol"; import {IV4AggregationExecutor} from "src/interfaces/IV4AggregationExecutor.sol"; import {IV4AggregationRouter} from "src/interfaces/IV4AggregationRouter.sol"; -import {OneInchRouterFactory} from "src/RouterFactory.sol"; +import {RouterFactory} from "src/RouterFactory.sol"; import {V5Router} from "src/V5Router.sol"; import {V4Router} from "src/V4Router.sol"; import {OneInchContracts} from "test/1InchContracts.sol"; -interface IBadOneInchRouterFactory { +interface IBadRouterFactory { enum BadRouterType { V4AggregationRouter, V5AggregationRouter, @@ -24,12 +24,12 @@ interface IBadOneInchRouterFactory { } contract RouterFactoryTest is Test, OneInchContracts { - OneInchRouterFactory factory; + RouterFactory factory; - event RouterDeployed(OneInchRouterFactory.RouterType type_, address indexed asset); + event RouterDeployed(RouterFactory.RouterType type_, address indexed asset); function setUp() public { - factory = new OneInchRouterFactory( + factory = new RouterFactory( v5AggregationExecutor, v5AggregationRouter, v4AggregationExecutor, @@ -51,7 +51,7 @@ contract Constructor is RouterFactoryTest { IV4AggregationExecutor v4AggregationExecutor = IV4AggregationExecutor(v4AggregationExecutor); IV4AggregationRouter v4AggregationRouter = IV4AggregationRouter(v4AggregationRouterAddress); - OneInchRouterFactory factory = new OneInchRouterFactory( + RouterFactory factory = new RouterFactory( v5AggregationExecutor, v5AggregationRouter, v4AggregationExecutor, @@ -83,38 +83,36 @@ contract Constructor is RouterFactoryTest { contract Deploy is RouterFactoryTest { function testFuzz_CorrectlyDeployV4Router(address asset) public { vm.expectEmit(true, true, true, true); - emit RouterDeployed(OneInchRouterFactory.RouterType.V4AggregationRouter, asset); + emit RouterDeployed(RouterFactory.RouterType.V4AggregationRouter, asset); address deployedRouterAddress = - factory.deploy(OneInchRouterFactory.RouterType.V4AggregationRouter, asset); + factory.deploy(RouterFactory.RouterType.V4AggregationRouter, asset); - factory.computeAddress(OneInchRouterFactory.RouterType.V4AggregationRouter, asset); + factory.computeAddress(RouterFactory.RouterType.V4AggregationRouter, asset); assertEq( deployedRouterAddress, - factory.computeAddress(OneInchRouterFactory.RouterType.V4AggregationRouter, asset), + factory.computeAddress(RouterFactory.RouterType.V4AggregationRouter, asset), "Address not equal to computed v4 router address" ); } function testFuzz_CorrectlyDeployV5Router(address asset) public { vm.expectEmit(true, true, true, true); - emit RouterDeployed(OneInchRouterFactory.RouterType.V5AggregationRouter, asset); + emit RouterDeployed(RouterFactory.RouterType.V5AggregationRouter, asset); address deployedRouterAddress = - factory.deploy(OneInchRouterFactory.RouterType.V5AggregationRouter, asset); + factory.deploy(RouterFactory.RouterType.V5AggregationRouter, asset); assertEq( deployedRouterAddress, - factory.computeAddress(OneInchRouterFactory.RouterType.V5AggregationRouter, asset), + factory.computeAddress(RouterFactory.RouterType.V5AggregationRouter, asset), "Address not equal to computed v5 router address" ); } function test_RevertIf_UnsupportedRouterType() public { vm.expectRevert(); - IBadOneInchRouterFactory(address(factory)).deploy( - IBadOneInchRouterFactory.BadRouterType.MadeUpRouter, USDC - ); + IBadRouterFactory(address(factory)).deploy(IBadRouterFactory.BadRouterType.MadeUpRouter, USDC); } } @@ -143,7 +141,7 @@ contract ComputeAddress is RouterFactoryTest { function testFuzz_ComputeV4Address(address asset) public { address computedAddress = - factory.computeAddress(OneInchRouterFactory.RouterType.V4AggregationRouter, asset); + factory.computeAddress(RouterFactory.RouterType.V4AggregationRouter, asset); assertEq( computedAddress, helper_computeV4Address(asset, address(factory)), @@ -153,7 +151,7 @@ contract ComputeAddress is RouterFactoryTest { function testFuzz_ComputeV5Address(address asset) public { address computedAddress = - factory.computeAddress(OneInchRouterFactory.RouterType.V5AggregationRouter, asset); + factory.computeAddress(RouterFactory.RouterType.V5AggregationRouter, asset); assertEq( computedAddress, helper_computeV5Address(asset, address(factory)), diff --git a/test/V4Router.t.sol b/test/V4Router.t.sol index 8be4ca9..aa327ea 100644 --- a/test/V4Router.t.sol +++ b/test/V4Router.t.sol @@ -4,25 +4,25 @@ pragma solidity >=0.8.0; import {IERC20} from "openzeppelin-contracts/contracts/token/ERC20/IERC20.sol"; import {Test} from "forge-std/Test.sol"; -import {OneInchRouterFactory} from "src/RouterFactory.sol"; +import {RouterFactory} from "src/RouterFactory.sol"; import {OneInchContracts} from "test/1InchContracts.sol"; import {IV4AggregationRouter} from "src/interfaces/IV4AggregationRouter.sol"; contract V4RouterTest is Test, OneInchContracts {} contract Fallback is V4RouterTest { - OneInchRouterFactory factory; + RouterFactory factory; address swappingAddress; function setUp() public { vm.createSelectFork(vm.rpcUrl("optimism"), 95_544_472); - factory = new OneInchRouterFactory( + factory = new RouterFactory( v5AggregationExecutor, v5AggregationRouter, v4AggregationExecutor, v4AggregationRouter ); - factory.deploy(OneInchRouterFactory.RouterType.V4AggregationRouter, USDC); + factory.deploy(RouterFactory.RouterType.V4AggregationRouter, USDC); deal(USDC, address(this), 100_000_000); swappingAddress = 0xEAC5F0d4A9a45E1f9FdD0e7e2882e9f60E301156; } @@ -55,8 +55,7 @@ contract Fallback is V4RouterTest { function testFork_RevertIf_NotEnoughFunds() public { (IV4AggregationRouter.SwapDescription memory desc, bytes memory data) = helper_apiParams(); - address routerAddr = - factory.computeAddress(OneInchRouterFactory.RouterType.V4AggregationRouter, USDC); + address routerAddr = factory.computeAddress(RouterFactory.RouterType.V4AggregationRouter, USDC); uint256 balance = IERC20(USDC).balanceOf(swappingAddress); vm.startPrank(swappingAddress); IERC20(USDC).approve(routerAddr, 10_000_000); @@ -67,8 +66,7 @@ contract Fallback is V4RouterTest { function testFork_RevertIf_zeroAddress() public { (IV4AggregationRouter.SwapDescription memory desc, bytes memory data) = helper_apiParams(); - address routerAddr = - factory.computeAddress(OneInchRouterFactory.RouterType.V4AggregationRouter, USDC); + address routerAddr = factory.computeAddress(RouterFactory.RouterType.V4AggregationRouter, USDC); IERC20(USDC).approve(routerAddr, 250_000); (bool ok,) = payable(routerAddr).call(abi.encode(address(0), 250_000, desc.minReturnAmount, data, 0)); @@ -80,8 +78,7 @@ contract Fallback is V4RouterTest { (IV4AggregationRouter.SwapDescription memory desc, bytes memory data) = helper_apiParams(); // Setup the optimized router call vm.startPrank(swappingAddress); - address routerAddr = - factory.computeAddress(OneInchRouterFactory.RouterType.V4AggregationRouter, USDC); + address routerAddr = factory.computeAddress(RouterFactory.RouterType.V4AggregationRouter, USDC); IERC20(USDC).approve(routerAddr, 100_000); uint256 startingBalance = IERC20(UNI).balanceOf(swappingAddress); assertTrue(startingBalance == 0); diff --git a/test/V5Router.t.sol b/test/V5Router.t.sol index f841c59..8acd526 100644 --- a/test/V5Router.t.sol +++ b/test/V5Router.t.sol @@ -4,25 +4,56 @@ pragma solidity >=0.8.0; import {IERC20} from "openzeppelin-contracts/contracts/token/ERC20/IERC20.sol"; import {Test} from "forge-std/Test.sol"; -import {OneInchRouterFactory} from "src/RouterFactory.sol"; -import {OneInchContracts} from "test/1InchContracts.sol"; import {IV5AggregationRouter} from "src/interfaces/IV5AggregationRouter.sol"; +import {IV5AggregationExecutor} from "src/interfaces/IV5AggregationExecutor.sol"; +import {RouterFactory} from "src/RouterFactory.sol"; +import {V5Router} from "src/V5Router.sol"; +import {OneInchContracts} from "test/1InchContracts.sol"; contract V5RouterTest is Test, OneInchContracts {} +contract Constructor is V5RouterTest { + function testFuzz_CorrectlySetsAllConstructorArgs( + address aggregationRouterAddress, + address aggregationExecutorAddress, + address token + ) public { + IV5AggregationRouter aggregationRouter = IV5AggregationRouter(aggregationRouterAddress); + IV5AggregationExecutor aggregationExecutor = IV5AggregationExecutor(aggregationExecutorAddress); + V5Router router = new V5Router( + aggregationRouter, + aggregationExecutor, + token + ); + assertEq( + address(router.AGGREGATION_ROUTER()), + aggregationRouterAddress, + "AGGREGATION_ROUTER not set correctly" + ); + assertEq( + address(router.AGGREGATION_EXECUTOR()), + aggregationExecutorAddress, + "AGGREGATION_EXECUTOR not set correctly" + ); + assertEq( + router.SOURCE_RECEIVER(), aggregationExecutorAddress, "SOURCE_RECEIVER not set correctly" + ); + } +} + contract Fallback is V5RouterTest { - OneInchRouterFactory factory; + RouterFactory factory; address swappingAddress; function setUp() public { vm.createSelectFork(vm.rpcUrl("optimism"), 94_524_034); - factory = new OneInchRouterFactory( + factory = new RouterFactory( v5AggregationExecutor, v5AggregationRouter, v4AggregationExecutor, v4AggregationRouter ); - factory.deploy(OneInchRouterFactory.RouterType.V5AggregationRouter, USDC); + factory.deploy(RouterFactory.RouterType.V5AggregationRouter, USDC); deal(USDC, address(this), 100_000_000); // Address the api calldata uses as the swapper swappingAddress = 0xEAC5F0d4A9a45E1f9FdD0e7e2882e9f60E301156; @@ -60,8 +91,7 @@ contract Fallback is V5RouterTest { (IV5AggregationRouter.SwapDescription memory desc, bytes memory permit, bytes memory data) = helper_apiParams(); - address routerAddr = - factory.computeAddress(OneInchRouterFactory.RouterType.V5AggregationRouter, USDC); + address routerAddr = factory.computeAddress(RouterFactory.RouterType.V5AggregationRouter, USDC); uint256 balance = IERC20(USDC).balanceOf(swappingAddress); vm.startPrank(swappingAddress); IERC20(USDC).approve(routerAddr, 10_000_000); @@ -73,8 +103,7 @@ contract Fallback is V5RouterTest { function testFork_RevertIf_zeroAddress() public { (IV5AggregationRouter.SwapDescription memory desc, bytes memory permit, bytes memory data) = helper_apiParams(); - address routerAddr = - factory.computeAddress(OneInchRouterFactory.RouterType.V5AggregationRouter, USDC); + address routerAddr = factory.computeAddress(RouterFactory.RouterType.V5AggregationRouter, USDC); IERC20(USDC).approve(routerAddr, 250_000); (bool ok,) = payable(routerAddr).call(abi.encode(address(0), 250_000, desc.minReturnAmount, data, 0)); @@ -87,8 +116,7 @@ contract Fallback is V5RouterTest { helper_apiParams(); // Setup optimized router call vm.startPrank(swappingAddress); - address routerAddr = - factory.computeAddress(OneInchRouterFactory.RouterType.V5AggregationRouter, USDC); + address routerAddr = factory.computeAddress(RouterFactory.RouterType.V5AggregationRouter, USDC); IERC20(USDC).approve(routerAddr, 100_000); uint256 startingBalance = IERC20(UNI).balanceOf(swappingAddress); assertTrue(startingBalance == 0); diff --git a/test/lib/Create2.t.sol b/test/lib/Create2.t.sol index ac26e44..b907949 100644 --- a/test/lib/Create2.t.sol +++ b/test/lib/Create2.t.sol @@ -5,7 +5,7 @@ import {Test} from "forge-std/Test.sol"; import {Create2} from "src/lib/Create2.sol"; -contract Create2Test is Test { +contract ComputeCreate2Address is Test { function test_GenerateCreate2Address() external { bytes32 salt = bytes32(uint256(31_415)); bytes memory initcodeHash = abi.encode(0x6080); From eec3e6188e9596b47d9c11383e6e3145dab025eb Mon Sep 17 00:00:00 2001 From: Keating Date: Mon, 8 May 2023 11:47:54 -0400 Subject: [PATCH 28/48] Add V4Router constructor test --- test/V4Router.t.sol | 33 ++++++++++++++++++++++++++++++++- 1 file changed, 32 insertions(+), 1 deletion(-) diff --git a/test/V4Router.t.sol b/test/V4Router.t.sol index aa327ea..cc64d0b 100644 --- a/test/V4Router.t.sol +++ b/test/V4Router.t.sol @@ -4,12 +4,43 @@ pragma solidity >=0.8.0; import {IERC20} from "openzeppelin-contracts/contracts/token/ERC20/IERC20.sol"; import {Test} from "forge-std/Test.sol"; +import {IV4AggregationExecutor} from "src/interfaces/IV4AggregationExecutor.sol"; +import {IV4AggregationRouter} from "src/interfaces/IV4AggregationRouter.sol"; import {RouterFactory} from "src/RouterFactory.sol"; +import {V4Router} from "src/V4Router.sol"; import {OneInchContracts} from "test/1InchContracts.sol"; -import {IV4AggregationRouter} from "src/interfaces/IV4AggregationRouter.sol"; contract V4RouterTest is Test, OneInchContracts {} +contract Constructor is V4RouterTest { + function testFuzz_CorrectlySetsAllConstructorArgs( + address aggregationRouterAddress, + address aggregationExecutorAddress, + address token + ) public { + IV4AggregationRouter aggregationRouter = IV4AggregationRouter(aggregationRouterAddress); + IV4AggregationExecutor aggregationExecutor = IV4AggregationExecutor(aggregationExecutorAddress); + V4Router router = new V4Router( + aggregationRouter, + aggregationExecutor, + token + ); + assertEq( + address(router.AGGREGATION_ROUTER()), + aggregationRouterAddress, + "AGGREGATION_ROUTER not set correctly" + ); + assertEq( + address(router.AGGREGATION_EXECUTOR()), + aggregationExecutorAddress, + "AGGREGATION_EXECUTOR not set correctly" + ); + assertEq( + router.SOURCE_RECEIVER(), aggregationExecutorAddress, "SOURCE_RECEIVER not set correctly" + ); + } +} + contract Fallback is V4RouterTest { RouterFactory factory; address swappingAddress; From 46920bc4e2caf367c805ac3b885d8959e32ac38e Mon Sep 17 00:00:00 2001 From: Keating Date: Mon, 8 May 2023 11:49:57 -0400 Subject: [PATCH 29/48] Fix test names --- test/V4Router.t.sol | 2 +- test/V5Router.t.sol | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/test/V4Router.t.sol b/test/V4Router.t.sol index cc64d0b..5059a85 100644 --- a/test/V4Router.t.sol +++ b/test/V4Router.t.sol @@ -95,7 +95,7 @@ contract Fallback is V4RouterTest { assertTrue(!ok, "Swap succeeded"); } - function testFork_RevertIf_zeroAddress() public { + function testFork_RevertIf_ZeroAddress() public { (IV4AggregationRouter.SwapDescription memory desc, bytes memory data) = helper_apiParams(); address routerAddr = factory.computeAddress(RouterFactory.RouterType.V4AggregationRouter, USDC); IERC20(USDC).approve(routerAddr, 250_000); diff --git a/test/V5Router.t.sol b/test/V5Router.t.sol index 8acd526..1f0d841 100644 --- a/test/V5Router.t.sol +++ b/test/V5Router.t.sol @@ -100,7 +100,7 @@ contract Fallback is V5RouterTest { assertTrue(!ok, "Swap succeeded"); } - function testFork_RevertIf_zeroAddress() public { + function testFork_RevertIf_ZeroAddress() public { (IV5AggregationRouter.SwapDescription memory desc, bytes memory permit, bytes memory data) = helper_apiParams(); address routerAddr = factory.computeAddress(RouterFactory.RouterType.V5AggregationRouter, USDC); From 3605258553f81f397699d61ddfb27a1ec74e0428 Mon Sep 17 00:00:00 2001 From: Keating Date: Mon, 8 May 2023 13:20:07 -0400 Subject: [PATCH 30/48] Update aggregationBaseRouter comments --- src/AggregationBaseRouter.sol | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/src/AggregationBaseRouter.sol b/src/AggregationBaseRouter.sol index 7991a03..26c6d80 100644 --- a/src/AggregationBaseRouter.sol +++ b/src/AggregationBaseRouter.sol @@ -6,19 +6,20 @@ import {IV5AggregationRouter} from "src/interfaces/IV5AggregationRouter.sol"; import {IV4AggregationExecutor} from "src/interfaces/IV4AggregationExecutor.sol"; import {IV4AggregationRouter} from "src/interfaces/IV4AggregationRouter.sol"; -/// @notice An abstract class with the necessary class variables to make a aggregation v5 optimized -/// router +/// @notice An abstract class with the necessary class variables +/// to make a 1inch v5 aggregation router optimized. abstract contract AggregationV5BaseRouter { - /// @notice The contract used to execute the swap along an optimized path + /// @notice The contract used to execute the swap along an optimized path. IV5AggregationExecutor public immutable AGGREGATION_EXECUTOR; - /// @notice The 1inch contract with the unoptimized route + /// @notice The 1inch v5 aggregation router contract. IV5AggregationRouter public immutable AGGREGATION_ROUTER; - /// @notice The token being from a user to be swapped + /// @notice The input token being swapped. address public immutable TOKEN; - /// @notice Where the tokens are going in the router and it should match the executor + /// @notice Where the tokens are transferred in the 1inch v5 aggregation router. + /// It will match the AGGREGATION_EXECUTOR address. address public immutable SOURCE_RECEIVER; constructor( From 02ac94425f9c1fb40e2e5034c8aaaada8ab47771 Mon Sep 17 00:00:00 2001 From: Keating Date: Mon, 8 May 2023 13:33:53 -0400 Subject: [PATCH 31/48] Change max approval to be in constructor --- src/V4Router.sol | 5 +++-- src/V5Router.sol | 5 +++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/V4Router.sol b/src/V4Router.sol index 69f809a..2e8b326 100644 --- a/src/V4Router.sol +++ b/src/V4Router.sol @@ -13,7 +13,9 @@ contract V4Router is AggregationV4BaseRouter { IV4AggregationRouter aggregationRouter, IV4AggregationExecutor aggregationExecutor, address token - ) AggregationV4BaseRouter(aggregationExecutor, aggregationRouter, token) {} + ) AggregationV4BaseRouter(aggregationExecutor, aggregationRouter, token) { + IERC20(TOKEN).approve(address(AGGREGATION_ROUTER), type(uint256).max); + } // TODO: Update to handle receiving ETH receive() external payable {} @@ -28,7 +30,6 @@ contract V4Router is AggregationV4BaseRouter { (address dstToken, uint256 amount, uint256 minReturnAmount, bytes memory data, uint256 flags) = abi.decode(msg.data, (address, uint256, uint256, bytes, uint256)); IERC20(TOKEN).transferFrom(msg.sender, address(this), amount); - IERC20(TOKEN).approve(address(AGGREGATION_ROUTER), type(uint256).max); AGGREGATION_ROUTER.swap( AGGREGATION_EXECUTOR, IV4AggregationRouter.SwapDescription({ diff --git a/src/V5Router.sol b/src/V5Router.sol index aed95da..656f42c 100644 --- a/src/V5Router.sol +++ b/src/V5Router.sol @@ -13,7 +13,9 @@ contract V5Router is AggregationV5BaseRouter { IV5AggregationRouter aggregationRouter, IV5AggregationExecutor aggregationExecutor, address token - ) AggregationV5BaseRouter(aggregationExecutor, aggregationRouter, token) {} + ) AggregationV5BaseRouter(aggregationExecutor, aggregationRouter, token) { + IERC20(TOKEN).approve(address(AGGREGATION_ROUTER), type(uint256).max); + } // TODO: Update to handle receiving ETH receive() external payable {} @@ -28,7 +30,6 @@ contract V5Router is AggregationV5BaseRouter { (address dstToken, uint256 amount, uint256 minReturnAmount, bytes memory data, uint256 flags) = abi.decode(msg.data, (address, uint256, uint256, bytes, uint256)); IERC20(TOKEN).transferFrom(msg.sender, address(this), amount); - IERC20(TOKEN).approve(address(AGGREGATION_ROUTER), type(uint256).max); AGGREGATION_ROUTER.swap( AGGREGATION_EXECUTOR, IV5AggregationRouter.SwapDescription({ From ca4b78d0d0a96bb8c1150c94cc29d8e039a0bca0 Mon Sep 17 00:00:00 2001 From: Keating Date: Mon, 8 May 2023 13:54:09 -0400 Subject: [PATCH 32/48] Change constructor to do max approval with passing tests --- src/V4Router.sol | 2 +- src/V5Router.sol | 2 +- test/RouterFactory.t.sol | 61 +++++++++++++++++++++------------------- test/V4Router.t.sol | 24 ++++++++-------- test/V5Router.t.sol | 24 ++++++++-------- 5 files changed, 56 insertions(+), 57 deletions(-) diff --git a/src/V4Router.sol b/src/V4Router.sol index 2e8b326..2b4cbb0 100644 --- a/src/V4Router.sol +++ b/src/V4Router.sol @@ -14,7 +14,7 @@ contract V4Router is AggregationV4BaseRouter { IV4AggregationExecutor aggregationExecutor, address token ) AggregationV4BaseRouter(aggregationExecutor, aggregationRouter, token) { - IERC20(TOKEN).approve(address(AGGREGATION_ROUTER), type(uint256).max); + IERC20(token).approve(address(aggregationRouter), type(uint256).max); } // TODO: Update to handle receiving ETH diff --git a/src/V5Router.sol b/src/V5Router.sol index 656f42c..d5566ef 100644 --- a/src/V5Router.sol +++ b/src/V5Router.sol @@ -14,7 +14,7 @@ contract V5Router is AggregationV5BaseRouter { IV5AggregationExecutor aggregationExecutor, address token ) AggregationV5BaseRouter(aggregationExecutor, aggregationRouter, token) { - IERC20(TOKEN).approve(address(AGGREGATION_ROUTER), type(uint256).max); + IERC20(token).approve(address(aggregationRouter), type(uint256).max); } // TODO: Update to handle receiving ETH diff --git a/test/RouterFactory.t.sol b/test/RouterFactory.t.sol index fe75561..9ba48cf 100644 --- a/test/RouterFactory.t.sol +++ b/test/RouterFactory.t.sol @@ -27,30 +27,14 @@ contract RouterFactoryTest is Test, OneInchContracts { RouterFactory factory; event RouterDeployed(RouterFactory.RouterType type_, address indexed asset); - - function setUp() public { - factory = new RouterFactory( - v5AggregationExecutor, - v5AggregationRouter, - v4AggregationExecutor, - v4AggregationRouter - ); - } } contract Constructor is RouterFactoryTest { - function testFuzz_CorrectlySetsAllConstructorArgs( - address v5AggregationExecutorAddress, - address v5AggregationRouterAddress, - address v4AggregationExecutorAddress, - address v4AggregationRouterAddress - ) public { - IV5AggregationExecutor v5AggregationExecutor = - IV5AggregationExecutor(v5AggregationExecutorAddress); - IV5AggregationRouter v5AggregationRouter = IV5AggregationRouter(v5AggregationRouterAddress); - IV4AggregationExecutor v4AggregationExecutor = IV4AggregationExecutor(v4AggregationExecutor); - IV4AggregationRouter v4AggregationRouter = IV4AggregationRouter(v4AggregationRouterAddress); + function setUp() public { + vm.createSelectFork(vm.rpcUrl("optimism"), 95_544_472); + } + function testFork_CorrectlySetsAllConstructorArgs() public { RouterFactory factory = new RouterFactory( v5AggregationExecutor, v5AggregationRouter, @@ -81,31 +65,41 @@ contract Constructor is RouterFactoryTest { } contract Deploy is RouterFactoryTest { - function testFuzz_CorrectlyDeployV4Router(address asset) public { + function setUp() public { + vm.createSelectFork(vm.rpcUrl("optimism"), 95_544_472); + factory = new RouterFactory( + v5AggregationExecutor, + v5AggregationRouter, + v4AggregationExecutor, + v4AggregationRouter + ); + } + + function testFork_CorrectlyDeployV4Router() public { vm.expectEmit(true, true, true, true); - emit RouterDeployed(RouterFactory.RouterType.V4AggregationRouter, asset); + emit RouterDeployed(RouterFactory.RouterType.V4AggregationRouter, USDC); address deployedRouterAddress = - factory.deploy(RouterFactory.RouterType.V4AggregationRouter, asset); + factory.deploy(RouterFactory.RouterType.V4AggregationRouter, USDC); - factory.computeAddress(RouterFactory.RouterType.V4AggregationRouter, asset); + factory.computeAddress(RouterFactory.RouterType.V4AggregationRouter, USDC); assertEq( deployedRouterAddress, - factory.computeAddress(RouterFactory.RouterType.V4AggregationRouter, asset), + factory.computeAddress(RouterFactory.RouterType.V4AggregationRouter, USDC), "Address not equal to computed v4 router address" ); } - function testFuzz_CorrectlyDeployV5Router(address asset) public { + function testFork_CorrectlyDeployV5Router() public { vm.expectEmit(true, true, true, true); - emit RouterDeployed(RouterFactory.RouterType.V5AggregationRouter, asset); + emit RouterDeployed(RouterFactory.RouterType.V5AggregationRouter, USDC); address deployedRouterAddress = - factory.deploy(RouterFactory.RouterType.V5AggregationRouter, asset); + factory.deploy(RouterFactory.RouterType.V5AggregationRouter, USDC); assertEq( deployedRouterAddress, - factory.computeAddress(RouterFactory.RouterType.V5AggregationRouter, asset), + factory.computeAddress(RouterFactory.RouterType.V5AggregationRouter, USDC), "Address not equal to computed v5 router address" ); } @@ -117,6 +111,15 @@ contract Deploy is RouterFactoryTest { } contract ComputeAddress is RouterFactoryTest { + function setUp() public { + factory = new RouterFactory( + v5AggregationExecutor, + v5AggregationRouter, + v4AggregationExecutor, + v4AggregationRouter + ); + } + function helper_salt(address asset) internal returns (bytes32) { return bytes32(uint256(uint160(asset))); } diff --git a/test/V4Router.t.sol b/test/V4Router.t.sol index 5059a85..5524da4 100644 --- a/test/V4Router.t.sol +++ b/test/V4Router.t.sol @@ -13,30 +13,28 @@ import {OneInchContracts} from "test/1InchContracts.sol"; contract V4RouterTest is Test, OneInchContracts {} contract Constructor is V4RouterTest { - function testFuzz_CorrectlySetsAllConstructorArgs( - address aggregationRouterAddress, - address aggregationExecutorAddress, - address token - ) public { - IV4AggregationRouter aggregationRouter = IV4AggregationRouter(aggregationRouterAddress); - IV4AggregationExecutor aggregationExecutor = IV4AggregationExecutor(aggregationExecutorAddress); + function setUp() public { + vm.createSelectFork(vm.rpcUrl("optimism"), 95_544_472); + } + + function testFork_CorrectlySetsAllConstructorArgs() public { V4Router router = new V4Router( - aggregationRouter, - aggregationExecutor, - token + v4AggregationRouter, + v4AggregationExecutor, + USDC ); assertEq( address(router.AGGREGATION_ROUTER()), - aggregationRouterAddress, + address(v4AggregationRouter), "AGGREGATION_ROUTER not set correctly" ); assertEq( address(router.AGGREGATION_EXECUTOR()), - aggregationExecutorAddress, + address(v4AggregationExecutor), "AGGREGATION_EXECUTOR not set correctly" ); assertEq( - router.SOURCE_RECEIVER(), aggregationExecutorAddress, "SOURCE_RECEIVER not set correctly" + router.SOURCE_RECEIVER(), address(v4AggregationExecutor), "SOURCE_RECEIVER not set correctly" ); } } diff --git a/test/V5Router.t.sol b/test/V5Router.t.sol index 1f0d841..056dd45 100644 --- a/test/V5Router.t.sol +++ b/test/V5Router.t.sol @@ -13,30 +13,28 @@ import {OneInchContracts} from "test/1InchContracts.sol"; contract V5RouterTest is Test, OneInchContracts {} contract Constructor is V5RouterTest { - function testFuzz_CorrectlySetsAllConstructorArgs( - address aggregationRouterAddress, - address aggregationExecutorAddress, - address token - ) public { - IV5AggregationRouter aggregationRouter = IV5AggregationRouter(aggregationRouterAddress); - IV5AggregationExecutor aggregationExecutor = IV5AggregationExecutor(aggregationExecutorAddress); + function setUp() public { + vm.createSelectFork(vm.rpcUrl("optimism"), 95_544_472); + } + + function testFork_CorrectlySetsAllConstructorArgs() public { V5Router router = new V5Router( - aggregationRouter, - aggregationExecutor, - token + v5AggregationRouter, + v5AggregationExecutor, + USDC ); assertEq( address(router.AGGREGATION_ROUTER()), - aggregationRouterAddress, + address(v5AggregationRouter), "AGGREGATION_ROUTER not set correctly" ); assertEq( address(router.AGGREGATION_EXECUTOR()), - aggregationExecutorAddress, + address(v5AggregationExecutor), "AGGREGATION_EXECUTOR not set correctly" ); assertEq( - router.SOURCE_RECEIVER(), aggregationExecutorAddress, "SOURCE_RECEIVER not set correctly" + router.SOURCE_RECEIVER(), address(v5AggregationExecutor), "SOURCE_RECEIVER not set correctly" ); } } From 0bb07ea5303547e285c0ff2a7d0eac9fe0fe2a31 Mon Sep 17 00:00:00 2001 From: Keating Date: Mon, 8 May 2023 14:39:19 -0400 Subject: [PATCH 33/48] Cleanup --- script/Benchmark.s.sol | 2 +- script/Deploy.s.sol | 2 +- src/V4Router.sol | 5 ----- src/V5Router.sol | 5 ----- src/interfaces/IV5AggregationRouter.sol | 1 - test/{1InchContracts.sol => OneInchContracts.sol} | 0 test/RouterFactory.t.sol | 2 +- test/V4Router.t.sol | 3 +-- test/V5Router.t.sol | 6 ++---- 9 files changed, 6 insertions(+), 20 deletions(-) rename test/{1InchContracts.sol => OneInchContracts.sol} (100%) diff --git a/script/Benchmark.s.sol b/script/Benchmark.s.sol index 6f17043..24cc381 100644 --- a/script/Benchmark.s.sol +++ b/script/Benchmark.s.sol @@ -6,7 +6,7 @@ import {Script, stdJson} from "forge-std/Script.sol"; import {IV5AggregationRouter} from "src/interfaces/IV5AggregationRouter.sol"; import {IV4AggregationRouter} from "src/interfaces/IV4AggregationRouter.sol"; -import {OneInchContracts} from "test/1InchContracts.sol"; +import {OneInchContracts} from "test/OneInchContracts.sol"; import "forge-std/console.sol"; // Script to get benchmarks the test will need diff --git a/script/Deploy.s.sol b/script/Deploy.s.sol index 9214ea8..436eced 100644 --- a/script/Deploy.s.sol +++ b/script/Deploy.s.sol @@ -4,7 +4,7 @@ pragma solidity ^0.8.16; import {Script} from "forge-std/Script.sol"; import {IERC20} from "openzeppelin-contracts/contracts/token/ERC20/IERC20.sol"; -import {OneInchContracts} from "test/1InchContracts.sol"; +import {OneInchContracts} from "test/OneInchContracts.sol"; import {RouterFactory} from "src/RouterFactory.sol"; contract Deploy is Script, OneInchContracts { diff --git a/src/V4Router.sol b/src/V4Router.sol index 2b4cbb0..d36ab33 100644 --- a/src/V4Router.sol +++ b/src/V4Router.sol @@ -20,11 +20,6 @@ contract V4Router is AggregationV4BaseRouter { // TODO: Update to handle receiving ETH receive() external payable {} - // TODO: minReturnAmount is the minimum allowed output amount, and - // can probably be reduced to a max integer of 500 or something of - // a similar magnitude. Also, amount and destination have - // opportunities to be optimized. - // // Flags match specific constant masks. There is no documentation on these. fallback() external payable { (address dstToken, uint256 amount, uint256 minReturnAmount, bytes memory data, uint256 flags) = diff --git a/src/V5Router.sol b/src/V5Router.sol index d5566ef..4c10a01 100644 --- a/src/V5Router.sol +++ b/src/V5Router.sol @@ -20,11 +20,6 @@ contract V5Router is AggregationV5BaseRouter { // TODO: Update to handle receiving ETH receive() external payable {} - // TODO: minReturnAmount is the minimum allowed output amount, and - // can probably be reduced to a max integer of 500 or something of - // a similar magnitude. Also, amount and destination have - // opportunities to be optimized. - // // Flags match specific constant masks. There is no documentation on these. fallback() external payable { (address dstToken, uint256 amount, uint256 minReturnAmount, bytes memory data, uint256 flags) = diff --git a/src/interfaces/IV5AggregationRouter.sol b/src/interfaces/IV5AggregationRouter.sol index 2eaaa82..3658f4c 100644 --- a/src/interfaces/IV5AggregationRouter.sol +++ b/src/interfaces/IV5AggregationRouter.sol @@ -3,7 +3,6 @@ pragma solidity >=0.8.0; import {IV5AggregationExecutor} from "src/interfaces/IV5AggregationExecutor.sol"; import {IERC20} from "openzeppelin-contracts/contracts/token/ERC20/IERC20.sol"; -// V5 router interface interface IV5AggregationRouter { struct SwapDescription { IERC20 srcToken; diff --git a/test/1InchContracts.sol b/test/OneInchContracts.sol similarity index 100% rename from test/1InchContracts.sol rename to test/OneInchContracts.sol diff --git a/test/RouterFactory.t.sol b/test/RouterFactory.t.sol index 9ba48cf..7593e68 100644 --- a/test/RouterFactory.t.sol +++ b/test/RouterFactory.t.sol @@ -11,7 +11,7 @@ import {IV4AggregationRouter} from "src/interfaces/IV4AggregationRouter.sol"; import {RouterFactory} from "src/RouterFactory.sol"; import {V5Router} from "src/V5Router.sol"; import {V4Router} from "src/V4Router.sol"; -import {OneInchContracts} from "test/1InchContracts.sol"; +import {OneInchContracts} from "test/OneInchContracts.sol"; interface IBadRouterFactory { enum BadRouterType { diff --git a/test/V4Router.t.sol b/test/V4Router.t.sol index 5524da4..6fb18e7 100644 --- a/test/V4Router.t.sol +++ b/test/V4Router.t.sol @@ -8,7 +8,7 @@ import {IV4AggregationExecutor} from "src/interfaces/IV4AggregationExecutor.sol" import {IV4AggregationRouter} from "src/interfaces/IV4AggregationRouter.sol"; import {RouterFactory} from "src/RouterFactory.sol"; import {V4Router} from "src/V4Router.sol"; -import {OneInchContracts} from "test/1InchContracts.sol"; +import {OneInchContracts} from "test/OneInchContracts.sol"; contract V4RouterTest is Test, OneInchContracts {} @@ -85,7 +85,6 @@ contract Fallback is V4RouterTest { (IV4AggregationRouter.SwapDescription memory desc, bytes memory data) = helper_apiParams(); address routerAddr = factory.computeAddress(RouterFactory.RouterType.V4AggregationRouter, USDC); - uint256 balance = IERC20(USDC).balanceOf(swappingAddress); vm.startPrank(swappingAddress); IERC20(USDC).approve(routerAddr, 10_000_000); (bool ok,) = diff --git a/test/V5Router.t.sol b/test/V5Router.t.sol index 056dd45..70fb271 100644 --- a/test/V5Router.t.sol +++ b/test/V5Router.t.sol @@ -8,7 +8,7 @@ import {IV5AggregationRouter} from "src/interfaces/IV5AggregationRouter.sol"; import {IV5AggregationExecutor} from "src/interfaces/IV5AggregationExecutor.sol"; import {RouterFactory} from "src/RouterFactory.sol"; import {V5Router} from "src/V5Router.sol"; -import {OneInchContracts} from "test/1InchContracts.sol"; +import {OneInchContracts} from "test/OneInchContracts.sol"; contract V5RouterTest is Test, OneInchContracts {} @@ -86,11 +86,9 @@ contract Fallback is V5RouterTest { } function testFork_RevertIf_NotEnoughFunds() public { - (IV5AggregationRouter.SwapDescription memory desc, bytes memory permit, bytes memory data) = - helper_apiParams(); + (IV5AggregationRouter.SwapDescription memory desc,, bytes memory data) = helper_apiParams(); address routerAddr = factory.computeAddress(RouterFactory.RouterType.V5AggregationRouter, USDC); - uint256 balance = IERC20(USDC).balanceOf(swappingAddress); vm.startPrank(swappingAddress); IERC20(USDC).approve(routerAddr, 10_000_000); (bool ok,) = From ab331f5a1e33bdff4226288ce2e5842e1eda4775 Mon Sep 17 00:00:00 2001 From: Keating Date: Mon, 8 May 2023 14:41:00 -0400 Subject: [PATCH 34/48] Fix Benchmark call --- script/Benchmark.s.sol | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/script/Benchmark.s.sol b/script/Benchmark.s.sol index 24cc381..058e87e 100644 --- a/script/Benchmark.s.sol +++ b/script/Benchmark.s.sol @@ -55,8 +55,7 @@ contract Benchmark is Script, OneInchContracts { v5AggregationRouter.swap(v5AggregationExecutor, v5Desc, v5Permit, v5Data); // Optimized router v5 swap call - (bool v5Ok,) = - payable(v5Rtr).call(abi.encode(UNI, 100_000, v5Desc.minReturnAmount, v5Data, false)); + (bool v5Ok,) = payable(v5Rtr).call(abi.encode(UNI, 100_000, v5Desc.minReturnAmount, v5Data, 0)); if (!v5Ok) revert OptimizedV5RouterFailed(); @@ -74,8 +73,7 @@ contract Benchmark is Script, OneInchContracts { v4AggregationRouter.swap(v4AggregationExecutor, v4Desc, v4Data); // Optimized v4 swap call - (bool v4Ok,) = - payable(v4Rtr).call(abi.encode(UNI, 100_000, v4Desc.minReturnAmount, v4Data, false)); + (bool v4Ok,) = payable(v4Rtr).call(abi.encode(UNI, 100_000, v4Desc.minReturnAmount, v4Data, 0)); if (!v4Ok) revert OptimizedV4RouterFailed(); } } From ad68cbf60eda1e1484214d105b53259470ee7434 Mon Sep 17 00:00:00 2001 From: Keating Date: Mon, 8 May 2023 14:54:07 -0400 Subject: [PATCH 35/48] Add a couple more tests --- test/RouterFactory.t.sol | 30 +++++++++++++++++++++++++--- test/V4Router.t.sol | 42 +++++++++++++++++++-------------------- test/V5Router.t.sol | 43 ++++++++++++++++++++-------------------- 3 files changed, 69 insertions(+), 46 deletions(-) diff --git a/test/RouterFactory.t.sol b/test/RouterFactory.t.sol index 7593e68..f574902 100644 --- a/test/RouterFactory.t.sol +++ b/test/RouterFactory.t.sol @@ -21,6 +21,8 @@ interface IBadRouterFactory { } function deploy(BadRouterType type_, address asset) external returns (address); + + function computeAddress(BadRouterType type_, address asset) external returns (address); } contract RouterFactoryTest is Test, OneInchContracts { @@ -108,6 +110,13 @@ contract Deploy is RouterFactoryTest { vm.expectRevert(); IBadRouterFactory(address(factory)).deploy(IBadRouterFactory.BadRouterType.MadeUpRouter, USDC); } + + function test_RevertIf_RouterIsAlreadyDeployed() public { + factory.deploy(RouterFactory.RouterType.V5AggregationRouter, USDC); + + vm.expectRevert(); + factory.deploy(RouterFactory.RouterType.V5AggregationRouter, USDC); + } } contract ComputeAddress is RouterFactoryTest { @@ -120,11 +129,15 @@ contract ComputeAddress is RouterFactoryTest { ); } - function helper_salt(address asset) internal returns (bytes32) { + function helper_salt(address asset) internal pure returns (bytes32) { return bytes32(uint256(uint160(asset))); } - function helper_computeV4Address(address asset, address factoryAddr) internal returns (address) { + function helper_computeV4Address(address asset, address factoryAddr) + internal + view + returns (address) + { return Create2.computeCreate2Address( helper_salt(asset), factoryAddr, @@ -133,7 +146,11 @@ contract ComputeAddress is RouterFactoryTest { ); } - function helper_computeV5Address(address asset, address factoryAddr) internal returns (address) { + function helper_computeV5Address(address asset, address factoryAddr) + internal + view + returns (address) + { return Create2.computeCreate2Address( helper_salt(asset), factoryAddr, @@ -161,4 +178,11 @@ contract ComputeAddress is RouterFactoryTest { "V5 computed address is not equal to its expected address" ); } + + function test_RevertIf_InvalidRouterTypeIsProvided() public { + vm.expectRevert(); + IBadRouterFactory(address(factory)).computeAddress( + IBadRouterFactory.BadRouterType.MadeUpRouter, USDC + ); + } } diff --git a/test/V4Router.t.sol b/test/V4Router.t.sol index 6fb18e7..0532d55 100644 --- a/test/V4Router.t.sol +++ b/test/V4Router.t.sol @@ -81,27 +81,7 @@ contract Fallback is V4RouterTest { return (desc, data); } - function testFork_RevertIf_NotEnoughFunds() public { - (IV4AggregationRouter.SwapDescription memory desc, bytes memory data) = helper_apiParams(); - - address routerAddr = factory.computeAddress(RouterFactory.RouterType.V4AggregationRouter, USDC); - vm.startPrank(swappingAddress); - IERC20(USDC).approve(routerAddr, 10_000_000); - (bool ok,) = - payable(routerAddr).call(abi.encode(UNI, 10_000_000, desc.minReturnAmount, data, 0)); - assertTrue(!ok, "Swap succeeded"); - } - - function testFork_RevertIf_ZeroAddress() public { - (IV4AggregationRouter.SwapDescription memory desc, bytes memory data) = helper_apiParams(); - address routerAddr = factory.computeAddress(RouterFactory.RouterType.V4AggregationRouter, USDC); - IERC20(USDC).approve(routerAddr, 250_000); - (bool ok,) = - payable(routerAddr).call(abi.encode(address(0), 250_000, desc.minReturnAmount, data, 0)); - assertTrue(!ok, "Swap succeeded"); - } - - function testFork_swapUSDC() public { + function testFork_SwapUSDC() public { uint256 snapshotId = vm.snapshot(); (IV4AggregationRouter.SwapDescription memory desc, bytes memory data) = helper_apiParams(); // Setup the optimized router call @@ -121,4 +101,24 @@ contract Fallback is V4RouterTest { uint256 nativeEndingBalance = helper_nativeSwap(desc, data, snapshotId); assertTrue(endingBalance == nativeEndingBalance); } + + function testFork_RevertIf_NotEnoughFunds() public { + (IV4AggregationRouter.SwapDescription memory desc, bytes memory data) = helper_apiParams(); + + address routerAddr = factory.computeAddress(RouterFactory.RouterType.V4AggregationRouter, USDC); + vm.startPrank(swappingAddress); + IERC20(USDC).approve(routerAddr, 10_000_000); + (bool ok,) = + payable(routerAddr).call(abi.encode(UNI, 10_000_000, desc.minReturnAmount, data, 0)); + assertTrue(!ok, "Swap succeeded"); + } + + function testFork_RevertIf_ZeroAddress() public { + (IV4AggregationRouter.SwapDescription memory desc, bytes memory data) = helper_apiParams(); + address routerAddr = factory.computeAddress(RouterFactory.RouterType.V4AggregationRouter, USDC); + IERC20(USDC).approve(routerAddr, 250_000); + (bool ok,) = + payable(routerAddr).call(abi.encode(address(0), 250_000, desc.minReturnAmount, data, 0)); + assertTrue(!ok, "Swap succeeded"); + } } diff --git a/test/V5Router.t.sol b/test/V5Router.t.sol index 70fb271..3807894 100644 --- a/test/V5Router.t.sol +++ b/test/V5Router.t.sol @@ -85,28 +85,7 @@ contract Fallback is V5RouterTest { return IERC20(UNI).balanceOf(swappingAddress); } - function testFork_RevertIf_NotEnoughFunds() public { - (IV5AggregationRouter.SwapDescription memory desc,, bytes memory data) = helper_apiParams(); - - address routerAddr = factory.computeAddress(RouterFactory.RouterType.V5AggregationRouter, USDC); - vm.startPrank(swappingAddress); - IERC20(USDC).approve(routerAddr, 10_000_000); - (bool ok,) = - payable(routerAddr).call(abi.encode(UNI, 10_000_000, desc.minReturnAmount, data, 0)); - assertTrue(!ok, "Swap succeeded"); - } - - function testFork_RevertIf_ZeroAddress() public { - (IV5AggregationRouter.SwapDescription memory desc, bytes memory permit, bytes memory data) = - helper_apiParams(); - address routerAddr = factory.computeAddress(RouterFactory.RouterType.V5AggregationRouter, USDC); - IERC20(USDC).approve(routerAddr, 250_000); - (bool ok,) = - payable(routerAddr).call(abi.encode(address(0), 250_000, desc.minReturnAmount, data, 0)); - assertTrue(!ok, "Swap succeeded"); - } - - function testFork_swapUSDC() public { + function testFork_SwapUSDC() public { uint256 snapshotId = vm.snapshot(); (IV5AggregationRouter.SwapDescription memory desc, bytes memory permit, bytes memory data) = helper_apiParams(); @@ -127,4 +106,24 @@ contract Fallback is V5RouterTest { uint256 nativeEndingBalance = helper_nativeSwap(desc, permit, data, snapshotId); assertTrue(endingBalance == nativeEndingBalance); } + + function testFork_RevertIf_NotEnoughFunds() public { + (IV5AggregationRouter.SwapDescription memory desc,, bytes memory data) = helper_apiParams(); + + address routerAddr = factory.computeAddress(RouterFactory.RouterType.V5AggregationRouter, USDC); + vm.startPrank(swappingAddress); + IERC20(USDC).approve(routerAddr, 10_000_000); + (bool ok,) = + payable(routerAddr).call(abi.encode(UNI, 10_000_000, desc.minReturnAmount, data, 0)); + assertTrue(!ok, "Swap succeeded"); + } + + function testFork_RevertIf_ZeroAddress() public { + (IV5AggregationRouter.SwapDescription memory desc,, bytes memory data) = helper_apiParams(); + address routerAddr = factory.computeAddress(RouterFactory.RouterType.V5AggregationRouter, USDC); + IERC20(USDC).approve(routerAddr, 250_000); + (bool ok,) = + payable(routerAddr).call(abi.encode(address(0), 250_000, desc.minReturnAmount, data, 0)); + assertTrue(!ok, "Swap succeeded"); + } } From d19dabc2bc096384285aa68794e69881f9b1f84d Mon Sep 17 00:00:00 2001 From: Keating Date: Wed, 10 May 2023 12:11:40 -0400 Subject: [PATCH 36/48] Make expectRevert stricter and add comment --- src/RouterFactory.sol | 4 ++++ test/RouterFactory.t.sol | 6 +++--- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/src/RouterFactory.sol b/src/RouterFactory.sol index a8fc411..2e9b150 100644 --- a/src/RouterFactory.sol +++ b/src/RouterFactory.sol @@ -77,6 +77,10 @@ contract RouterFactory { } else if (type_ == RouterType.V5AggregationRouter) { return _computeV5AggregationRouterAddress(asset); } else { + // In practice this branch will never be hit, and is + // meant to catch situations in development when a + // new RouterType has been added and it is not yet + // supported in this function. revert RouterTypeDoesNotExist(); } } diff --git a/test/RouterFactory.t.sol b/test/RouterFactory.t.sol index f574902..27dda93 100644 --- a/test/RouterFactory.t.sol +++ b/test/RouterFactory.t.sol @@ -107,14 +107,14 @@ contract Deploy is RouterFactoryTest { } function test_RevertIf_UnsupportedRouterType() public { - vm.expectRevert(); + vm.expectRevert(bytes("")); IBadRouterFactory(address(factory)).deploy(IBadRouterFactory.BadRouterType.MadeUpRouter, USDC); } function test_RevertIf_RouterIsAlreadyDeployed() public { factory.deploy(RouterFactory.RouterType.V5AggregationRouter, USDC); - vm.expectRevert(); + vm.expectRevert(bytes("")); factory.deploy(RouterFactory.RouterType.V5AggregationRouter, USDC); } } @@ -180,7 +180,7 @@ contract ComputeAddress is RouterFactoryTest { } function test_RevertIf_InvalidRouterTypeIsProvided() public { - vm.expectRevert(); + vm.expectRevert(bytes("")); IBadRouterFactory(address(factory)).computeAddress( IBadRouterFactory.BadRouterType.MadeUpRouter, USDC ); From a770e859e308d18134e619bc326979f3672d53a3 Mon Sep 17 00:00:00 2001 From: Keating Date: Wed, 10 May 2023 12:23:44 -0400 Subject: [PATCH 37/48] Make expectEmit more concise --- lib/forge-std | 2 +- test/RouterFactory.t.sol | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/forge-std b/lib/forge-std index 76e89e5..7f7cb06 160000 --- a/lib/forge-std +++ b/lib/forge-std @@ -1 +1 @@ -Subproject commit 76e89e592ac58df4f0d16202ee230bbf0b8098fc +Subproject commit 7f7cb06aa55fc75d2280d7d54713dc4368d71fd3 diff --git a/test/RouterFactory.t.sol b/test/RouterFactory.t.sol index 27dda93..2dc4e77 100644 --- a/test/RouterFactory.t.sol +++ b/test/RouterFactory.t.sol @@ -78,7 +78,7 @@ contract Deploy is RouterFactoryTest { } function testFork_CorrectlyDeployV4Router() public { - vm.expectEmit(true, true, true, true); + vm.expectEmit(); emit RouterDeployed(RouterFactory.RouterType.V4AggregationRouter, USDC); address deployedRouterAddress = @@ -93,7 +93,7 @@ contract Deploy is RouterFactoryTest { } function testFork_CorrectlyDeployV5Router() public { - vm.expectEmit(true, true, true, true); + vm.expectEmit(); emit RouterDeployed(RouterFactory.RouterType.V5AggregationRouter, USDC); address deployedRouterAddress = From 2c6205d3e14a8eaced1228caaebba598ce83ed71 Mon Sep 17 00:00:00 2001 From: Keating Date: Wed, 10 May 2023 13:03:14 -0400 Subject: [PATCH 38/48] Rename RouterFactory correctly deploys test * Rename test * Add correctly deploys test * Create separate test for event emit --- test/RouterFactory.t.sol | 24 ++++++++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) diff --git a/test/RouterFactory.t.sol b/test/RouterFactory.t.sol index 2dc4e77..9f4fdf5 100644 --- a/test/RouterFactory.t.sol +++ b/test/RouterFactory.t.sol @@ -77,10 +77,14 @@ contract Deploy is RouterFactoryTest { ); } - function testFork_CorrectlyDeployV4Router() public { + function testFork_EmitV4RouterDeployedEvent() public { vm.expectEmit(); emit RouterDeployed(RouterFactory.RouterType.V4AggregationRouter, USDC); + factory.deploy(RouterFactory.RouterType.V4AggregationRouter, USDC); + } + + function testFork_ReturnsV4RouterAddress() public { address deployedRouterAddress = factory.deploy(RouterFactory.RouterType.V4AggregationRouter, USDC); @@ -92,10 +96,20 @@ contract Deploy is RouterFactoryTest { ); } - function testFork_CorrectlyDeployV5Router() public { + function testFork_CorrectlyDeploysV4Router() public { + address deployedRouterAddress = + factory.deploy(RouterFactory.RouterType.V4AggregationRouter, USDC); + assertGt(deployedRouterAddress.code.length, 0, "no code"); + } + + function testFork_EmitV5RouterDeployedEvent() public { vm.expectEmit(); emit RouterDeployed(RouterFactory.RouterType.V5AggregationRouter, USDC); + factory.deploy(RouterFactory.RouterType.V5AggregationRouter, USDC); + } + + function testFork_ReturnsV5RouterAddress() public { address deployedRouterAddress = factory.deploy(RouterFactory.RouterType.V5AggregationRouter, USDC); @@ -106,6 +120,12 @@ contract Deploy is RouterFactoryTest { ); } + function testFork_CorrectlyDeploysV5Router() public { + address deployedRouterAddress = + factory.deploy(RouterFactory.RouterType.V5AggregationRouter, USDC); + assertGt(deployedRouterAddress.code.length, 0, "no code"); + } + function test_RevertIf_UnsupportedRouterType() public { vm.expectRevert(bytes("")); IBadRouterFactory(address(factory)).deploy(IBadRouterFactory.BadRouterType.MadeUpRouter, USDC); From ad6f6bded0e0627b097097c1dcddd816e3085924 Mon Sep 17 00:00:00 2001 From: Keating Date: Wed, 10 May 2023 15:51:28 -0400 Subject: [PATCH 39/48] Change name of swappingAddress and add comment --- test/V4Router.t.sol | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/test/V4Router.t.sol b/test/V4Router.t.sol index 0532d55..86bf346 100644 --- a/test/V4Router.t.sol +++ b/test/V4Router.t.sol @@ -41,7 +41,14 @@ contract Constructor is V4RouterTest { contract Fallback is V4RouterTest { RouterFactory factory; - address swappingAddress; + // The address that is initiating the swap on 1inch. + // This address is hardcoded because it needs to + // match the address used to generate the data argument + // needed for a swap. + // + // If the data argument in these tests is recreated than this + // address will potentially need to change. + address swapSenderAddress; function setUp() public { vm.createSelectFork(vm.rpcUrl("optimism"), 95_544_472); @@ -53,7 +60,7 @@ contract Fallback is V4RouterTest { ); factory.deploy(RouterFactory.RouterType.V4AggregationRouter, USDC); deal(USDC, address(this), 100_000_000); - swappingAddress = 0xEAC5F0d4A9a45E1f9FdD0e7e2882e9f60E301156; + swapSenderAddress = 0xEAC5F0d4A9a45E1f9FdD0e7e2882e9f60E301156; } function helper_nativeSwap( @@ -63,7 +70,7 @@ contract Fallback is V4RouterTest { ) public returns (uint256) { vm.revertTo(snapshotId); v4AggregationRouter.swap(v4AggregationExecutor, desc, data); - return IERC20(UNI).balanceOf(swappingAddress); + return IERC20(UNI).balanceOf(swapSenderAddress); } function helper_apiParams() @@ -85,10 +92,10 @@ contract Fallback is V4RouterTest { uint256 snapshotId = vm.snapshot(); (IV4AggregationRouter.SwapDescription memory desc, bytes memory data) = helper_apiParams(); // Setup the optimized router call - vm.startPrank(swappingAddress); + vm.startPrank(swapSenderAddress); address routerAddr = factory.computeAddress(RouterFactory.RouterType.V4AggregationRouter, USDC); IERC20(USDC).approve(routerAddr, 100_000); - uint256 startingBalance = IERC20(UNI).balanceOf(swappingAddress); + uint256 startingBalance = IERC20(UNI).balanceOf(swapSenderAddress); assertTrue(startingBalance == 0); // Optimized router call @@ -97,7 +104,7 @@ contract Fallback is V4RouterTest { assertTrue(ok); // Compare balance to native aggregation router call - uint256 endingBalance = IERC20(UNI).balanceOf(swappingAddress); + uint256 endingBalance = IERC20(UNI).balanceOf(swapSenderAddress); uint256 nativeEndingBalance = helper_nativeSwap(desc, data, snapshotId); assertTrue(endingBalance == nativeEndingBalance); } @@ -106,7 +113,7 @@ contract Fallback is V4RouterTest { (IV4AggregationRouter.SwapDescription memory desc, bytes memory data) = helper_apiParams(); address routerAddr = factory.computeAddress(RouterFactory.RouterType.V4AggregationRouter, USDC); - vm.startPrank(swappingAddress); + vm.startPrank(swapSenderAddress); IERC20(USDC).approve(routerAddr, 10_000_000); (bool ok,) = payable(routerAddr).call(abi.encode(UNI, 10_000_000, desc.minReturnAmount, data, 0)); From f93620f6cbeef874e541622d076874019b2d887c Mon Sep 17 00:00:00 2001 From: Keating Date: Wed, 10 May 2023 17:26:51 -0400 Subject: [PATCH 40/48] Add enpoints used to get calldata --- test/V4Router.t.sol | 4 +++- test/V5Router.t.sol | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/test/V4Router.t.sol b/test/V4Router.t.sol index 86bf346..c6db664 100644 --- a/test/V4Router.t.sol +++ b/test/V4Router.t.sol @@ -78,7 +78,9 @@ contract Fallback is V4RouterTest { view returns (IV4AggregationRouter.SwapDescription memory, bytes memory) { - // Calldata generated from calling 1inch's api + // Calldata generated from calling the below api endpoint + // + // https://api.1inch.io/v5.0/10/swap?fromTokenAddress=0x7F5c764cBc14f9669B88837ca1490cCa17c31607&toTokenAddress=0x6fd9d7AD17242c41f7131d257212c54A0e816691&amount=250000&fromAddress=0xEAC5F0d4A9a45E1f9FdD0e7e2882e9f60E301156&slippage=1 bytes memory dataParams = hex"7c025200000000000000000000000000f0694acc9e941b176e17b9ef923e71e7b8b2477a000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000001800000000000000000000000007f5c764cbc14f9669b88837ca1490cca17c316070000000000000000000000006fd9d7ad17242c41f7131d257212c54a0e816691000000000000000000000000f0694acc9e941b176e17b9ef923e71e7b8b2477a000000000000000000000000eac5f0d4a9a45e1f9fdd0e7e2882e9f60e30115600000000000000000000000000000000000000000000000000000000000186a0000000000000000000000000000000000000000000000000003e1aba8fed6bc100000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001e10000000000000000000000000000000000000000000000000000000001a300a007e5c0d200000000000000000000000000000000000000000000000000017f00011c4330f9d5940c2313636546ab9852354860dce275dbad00000000000000000000000000000000000000000000000000002ecaf7212e2f002424b31a0c000000000000000000000000f0694acc9e941b176e17b9ef923e71e7b8b2477a00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000fffd8963efd1fc6a506488495d951d5263988d2500000000000000000000000000000000000000000000000000000000000000a000000000000000000000000000000000000000000000000000000000000000200000000000000000000000007f5c764cbc14f9669b88837ca1490cca17c3160702a0000000000000000000000000000000000000000000000000003e1aba8fed6bc1ee63c1e581ad4c666fc170b468b19988959eb931a3676f0e9f42000000000000000000000000000000000000061111111254760f7ab3f16433eea9304126dcd19900000000000000000000000000000000000000000000000000000000000186a000000000000000000000000000000000000000000000000000000000000000cfee7c08"; // Decode the api calldata to get the data parameter needed for both calls diff --git a/test/V5Router.t.sol b/test/V5Router.t.sol index 3807894..ab75488 100644 --- a/test/V5Router.t.sol +++ b/test/V5Router.t.sol @@ -62,7 +62,9 @@ contract Fallback is V5RouterTest { view returns (IV5AggregationRouter.SwapDescription memory, bytes memory, bytes memory) { - // Calldata generated from calling 1inch's api + // Calldata generated from calling the below endpoint + // + // https://api.1inch.io/v5.0/10/swap?fromTokenAddress=0x7F5c764cBc14f9669B88837ca1490cCa17c31607&toTokenAddress=0x6fd9d7AD17242c41f7131d257212c54A0e816691&amount=250000&fromAddress=0xEAC5F0d4A9a45E1f9FdD0e7e2882e9f60E301156&slippage=1 bytes memory dataParams = hex"12aa3caf000000000000000000000000f0694acc9e941b176e17b9ef923e71e7b8b2477a0000000000000000000000007f5c764cbc14f9669b88837ca1490cca17c316070000000000000000000000006fd9d7ad17242c41f7131d257212c54a0e816691000000000000000000000000f0694acc9e941b176e17b9ef923e71e7b8b2477a000000000000000000000000eac5f0d4a9a45e1f9fdd0e7e2882e9f60e30115600000000000000000000000000000000000000000000000000000000000186a0000000000000000000000000000000000000000000000000003e530a0ee30f45000000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000001400000000000000000000000000000000000000000000000000000000000000160000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001f50000000000000000000000000000000000000000000000000000000001d700a007e5c0d20000000000000000000000000000000000000000000000000001b30001505126a132dab612db5cb9fc9ac426a0cc215a3423f9c97f5c764cbc14f9669b88837ca1490cca17c316070004f41766d8000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002e2669c6242f00000000000000000000000000000000000000000000000000000000000000a0000000000000000000000000f0694acc9e941b176e17b9ef923e71e7b8b2477a00000000000000000000000000000000000000000000000000000000644fdfe900000000000000000000000000000000000000000000000000000000000000010000000000000000000000007f5c764cbc14f9669b88837ca1490cca17c316070000000000000000000000004200000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000102a0000000000000000000000000000000000000000000000000003e530a0ee30f45ee63c1e581ad4c666fc170b468b19988959eb931a3676f0e9f42000000000000000000000000000000000000061111111254eeb25477b68fb85ed929f73a9605820000000000000000000000cfee7c08"; // Decode api calldata to get the data parameter needed for both calls From 97cfd914173bce4580a9548302433f2b1b8e6b4d Mon Sep 17 00:00:00 2001 From: Keating Date: Wed, 10 May 2023 17:39:16 -0400 Subject: [PATCH 41/48] Replace asserTrue with assertEq --- test/V4Router.t.sol | 10 +++++++--- test/V5Router.t.sol | 10 +++++++--- 2 files changed, 14 insertions(+), 6 deletions(-) diff --git a/test/V4Router.t.sol b/test/V4Router.t.sol index c6db664..ea9fe55 100644 --- a/test/V4Router.t.sol +++ b/test/V4Router.t.sol @@ -98,17 +98,21 @@ contract Fallback is V4RouterTest { address routerAddr = factory.computeAddress(RouterFactory.RouterType.V4AggregationRouter, USDC); IERC20(USDC).approve(routerAddr, 100_000); uint256 startingBalance = IERC20(UNI).balanceOf(swapSenderAddress); - assertTrue(startingBalance == 0); + assertEq(startingBalance, 0, "Starting balance is incorrect"); // Optimized router call (bool ok,) = payable(routerAddr).call(abi.encode(UNI, 100_000, desc.minReturnAmount, data, 0)); - assertTrue(ok); + assertTrue(ok, "Swap failed"); // Compare balance to native aggregation router call uint256 endingBalance = IERC20(UNI).balanceOf(swapSenderAddress); uint256 nativeEndingBalance = helper_nativeSwap(desc, data, snapshotId); - assertTrue(endingBalance == nativeEndingBalance); + assertEq( + endingBalance, + nativeEndingBalance, + "Ending balance does not match the balance when calling 1inch directly" + ); } function testFork_RevertIf_NotEnoughFunds() public { diff --git a/test/V5Router.t.sol b/test/V5Router.t.sol index ab75488..c633536 100644 --- a/test/V5Router.t.sol +++ b/test/V5Router.t.sol @@ -96,17 +96,21 @@ contract Fallback is V5RouterTest { address routerAddr = factory.computeAddress(RouterFactory.RouterType.V5AggregationRouter, USDC); IERC20(USDC).approve(routerAddr, 100_000); uint256 startingBalance = IERC20(UNI).balanceOf(swappingAddress); - assertTrue(startingBalance == 0); + assertEq(startingBalance, 0, "Starting balance is not 0"); // Optimized router call (bool ok,) = payable(routerAddr).call(abi.encode(UNI, 100_000, desc.minReturnAmount, data, 0)); - assertTrue(ok); + assertTrue(ok, "Swap failed"); // Compare balance to native aggregation router call uint256 endingBalance = IERC20(UNI).balanceOf(swappingAddress); uint256 nativeEndingBalance = helper_nativeSwap(desc, permit, data, snapshotId); - assertTrue(endingBalance == nativeEndingBalance); + assertEq( + endingBalance, + nativeEndingBalance, + "Ending balance does not match the balance when calling 1inch directly" + ); } function testFork_RevertIf_NotEnoughFunds() public { From ef0b88d61d746523454727c52065e0491eed5ddd Mon Sep 17 00:00:00 2001 From: Keating Date: Wed, 10 May 2023 20:28:29 -0400 Subject: [PATCH 42/48] Change compute address tests --- test/RouterFactory.t.sol | 55 ++++++++-------------------------------- 1 file changed, 11 insertions(+), 44 deletions(-) diff --git a/test/RouterFactory.t.sol b/test/RouterFactory.t.sol index 9f4fdf5..a53a395 100644 --- a/test/RouterFactory.t.sol +++ b/test/RouterFactory.t.sol @@ -141,6 +141,7 @@ contract Deploy is RouterFactoryTest { contract ComputeAddress is RouterFactoryTest { function setUp() public { + vm.createSelectFork(vm.rpcUrl("optimism"), 95_544_472); factory = new RouterFactory( v5AggregationExecutor, v5AggregationRouter, @@ -149,54 +150,20 @@ contract ComputeAddress is RouterFactoryTest { ); } - function helper_salt(address asset) internal pure returns (bytes32) { - return bytes32(uint256(uint160(asset))); - } - - function helper_computeV4Address(address asset, address factoryAddr) - internal - view - returns (address) - { - return Create2.computeCreate2Address( - helper_salt(asset), - factoryAddr, - type(V4Router).creationCode, - abi.encode(v4AggregationRouter, v4AggregationExecutor, asset) - ); - } - - function helper_computeV5Address(address asset, address factoryAddr) - internal - view - returns (address) - { - return Create2.computeCreate2Address( - helper_salt(asset), - factoryAddr, - type(V5Router).creationCode, - abi.encode(v5AggregationRouter, v5AggregationExecutor, asset) - ); - } - - function testFuzz_ComputeV4Address(address asset) public { + function testFork_ComputeV4Address() public { address computedAddress = - factory.computeAddress(RouterFactory.RouterType.V4AggregationRouter, asset); - assertEq( - computedAddress, - helper_computeV4Address(asset, address(factory)), - "V4 computed address is not equal to its expected address" - ); + factory.computeAddress(RouterFactory.RouterType.V4AggregationRouter, USDC); + assertEq(computedAddress.code.length, 0, "There is code at the computed address"); + factory.deploy(RouterFactory.RouterType.V4AggregationRouter, USDC); + assertGt(computedAddress.code.length, 0, "There should be code at the computed address"); } - function testFuzz_ComputeV5Address(address asset) public { + function testFork_ComputeV5Address() public { address computedAddress = - factory.computeAddress(RouterFactory.RouterType.V5AggregationRouter, asset); - assertEq( - computedAddress, - helper_computeV5Address(asset, address(factory)), - "V5 computed address is not equal to its expected address" - ); + factory.computeAddress(RouterFactory.RouterType.V5AggregationRouter, USDC); + assertEq(computedAddress.code.length, 0, "There is code at the computed address"); + factory.deploy(RouterFactory.RouterType.V5AggregationRouter, USDC); + assertGt(computedAddress.code.length, 0, "There should be code at the computed address"); } function test_RevertIf_InvalidRouterTypeIsProvided() public { From dfeaadf721b5efc8fe3870c27851f18fc6a617c1 Mon Sep 17 00:00:00 2001 From: Keating Date: Wed, 10 May 2023 20:33:37 -0400 Subject: [PATCH 43/48] Update V5 variable name --- test/V4Router.t.sol | 4 ++-- test/V5Router.t.sol | 21 ++++++++++++++------- 2 files changed, 16 insertions(+), 9 deletions(-) diff --git a/test/V4Router.t.sol b/test/V4Router.t.sol index ea9fe55..5b6d08a 100644 --- a/test/V4Router.t.sol +++ b/test/V4Router.t.sol @@ -46,8 +46,8 @@ contract Fallback is V4RouterTest { // match the address used to generate the data argument // needed for a swap. // - // If the data argument in these tests is recreated than this - // address will potentially need to change. + // If the data argument in these tests is recreated + // than this address will potentially need to change. address swapSenderAddress; function setUp() public { diff --git a/test/V5Router.t.sol b/test/V5Router.t.sol index c633536..ea1220a 100644 --- a/test/V5Router.t.sol +++ b/test/V5Router.t.sol @@ -41,7 +41,14 @@ contract Constructor is V5RouterTest { contract Fallback is V5RouterTest { RouterFactory factory; - address swappingAddress; + // The address that is initiating the swap on 1inch. + // This address is hardcoded because it needs to + // match the address used to generate the data argument + // needed for a swap. + // + // If the data argument in these tests is recreated + // than this address will potentially need to change. + address swapSenderAddress; function setUp() public { vm.createSelectFork(vm.rpcUrl("optimism"), 94_524_034); @@ -54,7 +61,7 @@ contract Fallback is V5RouterTest { factory.deploy(RouterFactory.RouterType.V5AggregationRouter, USDC); deal(USDC, address(this), 100_000_000); // Address the api calldata uses as the swapper - swappingAddress = 0xEAC5F0d4A9a45E1f9FdD0e7e2882e9f60E301156; + swapSenderAddress = 0xEAC5F0d4A9a45E1f9FdD0e7e2882e9f60E301156; } function helper_apiParams() @@ -84,7 +91,7 @@ contract Fallback is V5RouterTest { ) public returns (uint256) { vm.revertTo(snapshotId); v5AggregationRouter.swap(v5AggregationExecutor, desc, permit, data); - return IERC20(UNI).balanceOf(swappingAddress); + return IERC20(UNI).balanceOf(swapSenderAddress); } function testFork_SwapUSDC() public { @@ -92,10 +99,10 @@ contract Fallback is V5RouterTest { (IV5AggregationRouter.SwapDescription memory desc, bytes memory permit, bytes memory data) = helper_apiParams(); // Setup optimized router call - vm.startPrank(swappingAddress); + vm.startPrank(swapSenderAddress); address routerAddr = factory.computeAddress(RouterFactory.RouterType.V5AggregationRouter, USDC); IERC20(USDC).approve(routerAddr, 100_000); - uint256 startingBalance = IERC20(UNI).balanceOf(swappingAddress); + uint256 startingBalance = IERC20(UNI).balanceOf(swapSenderAddress); assertEq(startingBalance, 0, "Starting balance is not 0"); // Optimized router call @@ -104,7 +111,7 @@ contract Fallback is V5RouterTest { assertTrue(ok, "Swap failed"); // Compare balance to native aggregation router call - uint256 endingBalance = IERC20(UNI).balanceOf(swappingAddress); + uint256 endingBalance = IERC20(UNI).balanceOf(swapSenderAddress); uint256 nativeEndingBalance = helper_nativeSwap(desc, permit, data, snapshotId); assertEq( endingBalance, @@ -117,7 +124,7 @@ contract Fallback is V5RouterTest { (IV5AggregationRouter.SwapDescription memory desc,, bytes memory data) = helper_apiParams(); address routerAddr = factory.computeAddress(RouterFactory.RouterType.V5AggregationRouter, USDC); - vm.startPrank(swappingAddress); + vm.startPrank(swapSenderAddress); IERC20(USDC).approve(routerAddr, 10_000_000); (bool ok,) = payable(routerAddr).call(abi.encode(UNI, 10_000_000, desc.minReturnAmount, data, 0)); From 16c2959069c7a5a425e322bbb2cb076aeb3d5453 Mon Sep 17 00:00:00 2001 From: Keating Date: Fri, 12 May 2023 14:07:54 -0400 Subject: [PATCH 44/48] Remove scripts and JSON --- .../Benchmark.s.sol/10/run-1682891249.json | 1128 ----------------- broadcast/Benchmark.s.sol/10/run-latest.json | 1128 ----------------- broadcast/Deploy.s.sol/10/run-1682875572.json | 162 --- broadcast/Deploy.s.sol/10/run-latest.json | 162 --- script/Benchmark.s.sol | 79 -- script/Deploy.s.sol | 29 - 6 files changed, 2688 deletions(-) delete mode 100644 broadcast/Benchmark.s.sol/10/run-1682891249.json delete mode 100644 broadcast/Benchmark.s.sol/10/run-latest.json delete mode 100644 broadcast/Deploy.s.sol/10/run-1682875572.json delete mode 100644 broadcast/Deploy.s.sol/10/run-latest.json delete mode 100644 script/Benchmark.s.sol delete mode 100644 script/Deploy.s.sol diff --git a/broadcast/Benchmark.s.sol/10/run-1682891249.json b/broadcast/Benchmark.s.sol/10/run-1682891249.json deleted file mode 100644 index 5934876..0000000 --- a/broadcast/Benchmark.s.sol/10/run-1682891249.json +++ /dev/null @@ -1,1128 +0,0 @@ -{ - "transactions": [ - { - "hash": "0x348866c854cc363d7aa16f63f8dbc467180c9b42f49d0601760e883e9f34c75b", - "transactionType": "CALL", - "contractName": null, - "contractAddress": "0x7F5c764cBc14f9669B88837ca1490cCa17c31607", - "function": null, - "arguments": null, - "rpc": "", - "transaction": { - "type": "0x00", - "from": "0xeac5f0d4a9a45e1f9fdd0e7e2882e9f60e301156", - "to": "0x7f5c764cbc14f9669b88837ca1490cca17c31607", - "gas": "0x11e41", - "value": "0x0", - "data": "0x095ea7b3000000000000000000000000b17ccee669ab2cc40a6564da84db66dd8d144cb400000000000000000000000000000000000000000000000000000000000186a0", - "nonce": "0x1f" - }, - "additionalContracts": [], - "isFixedGasLimit": false - }, - { - "hash": "0x922fbc3c0c94e49f79c5bd2483f9d2be8644150654bc6b6b677f4debe097c6f7", - "transactionType": "CALL", - "contractName": null, - "contractAddress": "0x7F5c764cBc14f9669B88837ca1490cCa17c31607", - "function": null, - "arguments": null, - "rpc": "", - "transaction": { - "type": "0x00", - "from": "0xeac5f0d4a9a45e1f9fdd0e7e2882e9f60e301156", - "to": "0x7f5c764cbc14f9669b88837ca1490cca17c31607", - "gas": "0xbd68", - "value": "0x0", - "data": "0x095ea7b30000000000000000000000001111111254eeb25477b68fb85ed929f73a96058200000000000000000000000000000000000000000000000000000000000186a0", - "nonce": "0x20" - }, - "additionalContracts": [], - "isFixedGasLimit": false - }, - { - "hash": "0x0d1fbde82bd92ed22f1cd21788c5b734f7caa8b3523b0dba63cb65c1fd2cca4f", - "transactionType": "CALL", - "contractName": null, - "contractAddress": "0x1111111254EEB25477B68fb85Ed929f73A960582", - "function": null, - "arguments": null, - "rpc": "", - "transaction": { - "type": "0x00", - "from": "0xeac5f0d4a9a45e1f9fdd0e7e2882e9f60e301156", - "to": "0x1111111254eeb25477b68fb85ed929f73a960582", - "gas": "0x67bb8", - "value": "0x0", - "data": "0x12aa3caf000000000000000000000000f0694acc9e941b176e17b9ef923e71e7b8b2477a0000000000000000000000007f5c764cbc14f9669b88837ca1490cca17c316070000000000000000000000006fd9d7ad17242c41f7131d257212c54a0e816691000000000000000000000000f0694acc9e941b176e17b9ef923e71e7b8b2477a000000000000000000000000eac5f0d4a9a45e1f9fdd0e7e2882e9f60e30115600000000000000000000000000000000000000000000000000000000000186a0000000000000000000000000000000000000000000000000003e530a0ee30f45000000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000001400000000000000000000000000000000000000000000000000000000000000160000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001f50000000000000000000000000000000000000000000000000000000001d700a007e5c0d20000000000000000000000000000000000000000000000000001b30001505126a132dab612db5cb9fc9ac426a0cc215a3423f9c97f5c764cbc14f9669b88837ca1490cca17c316070004f41766d8000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002e2669c6242f00000000000000000000000000000000000000000000000000000000000000a0000000000000000000000000f0694acc9e941b176e17b9ef923e71e7b8b2477a00000000000000000000000000000000000000000000000000000000644fdfe900000000000000000000000000000000000000000000000000000000000000010000000000000000000000007f5c764cbc14f9669b88837ca1490cca17c316070000000000000000000000004200000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000102a0000000000000000000000000000000000000000000000000003e530a0ee30f45ee63c1e581ad4c666fc170b468b19988959eb931a3676f0e9f42000000000000000000000000000000000000061111111254eeb25477b68fb85ed929f73a9605820000000000000000000000", - "nonce": "0x21" - }, - "additionalContracts": [], - "isFixedGasLimit": false - }, - { - "hash": "0xe7bfb6d05f570a42721bb6168e20a3d23bd38bcdd9d14b19740af210f2382b13", - "transactionType": "CALL", - "contractName": null, - "contractAddress": "0xB17cCEE669aB2cc40A6564DA84Db66dD8D144CB4", - "function": null, - "arguments": null, - "rpc": "", - "transaction": { - "type": "0x00", - "from": "0xeac5f0d4a9a45e1f9fdd0e7e2882e9f60e301156", - "to": "0xb17ccee669ab2cc40a6564da84db66dd8d144cb4", - "gas": "0x68a35", - "value": "0x0", - "data": "0x0000000000000000000000006fd9d7ad17242c41f7131d257212c54a0e81669100000000000000000000000000000000000000000000000000000000000186a0000000000000000000000000000000000000000000000000003e530a0ee30f4500000000000000000000000000000000000000000000000000000000000000a0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001f50000000000000000000000000000000000000000000000000000000001d700a007e5c0d20000000000000000000000000000000000000000000000000001b30001505126a132dab612db5cb9fc9ac426a0cc215a3423f9c97f5c764cbc14f9669b88837ca1490cca17c316070004f41766d8000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002e2669c6242f00000000000000000000000000000000000000000000000000000000000000a0000000000000000000000000f0694acc9e941b176e17b9ef923e71e7b8b2477a00000000000000000000000000000000000000000000000000000000644fdfe900000000000000000000000000000000000000000000000000000000000000010000000000000000000000007f5c764cbc14f9669b88837ca1490cca17c316070000000000000000000000004200000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000102a0000000000000000000000000000000000000000000000000003e530a0ee30f45ee63c1e581ad4c666fc170b468b19988959eb931a3676f0e9f42000000000000000000000000000000000000061111111254eeb25477b68fb85ed929f73a9605820000000000000000000000", - "nonce": "0x22" - }, - "additionalContracts": [], - "isFixedGasLimit": false - }, - { - "hash": "0x71f79f21650241187d3e637351677f73d2fee7591f2600ecc768226d7d9a3178", - "transactionType": "CALL", - "contractName": null, - "contractAddress": "0x7F5c764cBc14f9669B88837ca1490cCa17c31607", - "function": null, - "arguments": null, - "rpc": "", - "transaction": { - "type": "0x00", - "from": "0xeac5f0d4a9a45e1f9fdd0e7e2882e9f60e301156", - "to": "0x7f5c764cbc14f9669b88837ca1490cca17c31607", - "gas": "0x11e41", - "value": "0x0", - "data": "0x095ea7b3000000000000000000000000444a406c15e6f87aee894999cb13b4ff1d61a85b00000000000000000000000000000000000000000000000000000000000186a0", - "nonce": "0x23" - }, - "additionalContracts": [], - "isFixedGasLimit": false - }, - { - "hash": "0x179019d502a67838533b07634ad619d39514b55a10599b250f80c5cb219ab04e", - "transactionType": "CALL", - "contractName": null, - "contractAddress": "0x7F5c764cBc14f9669B88837ca1490cCa17c31607", - "function": null, - "arguments": null, - "rpc": "", - "transaction": { - "type": "0x00", - "from": "0xeac5f0d4a9a45e1f9fdd0e7e2882e9f60e301156", - "to": "0x7f5c764cbc14f9669b88837ca1490cca17c31607", - "gas": "0xbd68", - "value": "0x0", - "data": "0x095ea7b30000000000000000000000001111111254760f7ab3f16433eea9304126dcd19900000000000000000000000000000000000000000000000000000000000186a0", - "nonce": "0x24" - }, - "additionalContracts": [], - "isFixedGasLimit": false - }, - { - "hash": "0x5445be7f53975a21d639f41e3e607903bc47ab5f1c87c2005c657dbf0efafe48", - "transactionType": "CALL", - "contractName": null, - "contractAddress": "0x1111111254760F7ab3F16433eea9304126DCd199", - "function": null, - "arguments": null, - "rpc": "", - "transaction": { - "type": "0x00", - "from": "0xeac5f0d4a9a45e1f9fdd0e7e2882e9f60e301156", - "to": "0x1111111254760f7ab3f16433eea9304126dcd199", - "gas": "0x41e7f", - "value": "0x0", - "data": "0x7c025200000000000000000000000000f0694acc9e941b176e17b9ef923e71e7b8b2477a000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000001800000000000000000000000007f5c764cbc14f9669b88837ca1490cca17c316070000000000000000000000006fd9d7ad17242c41f7131d257212c54a0e816691000000000000000000000000f0694acc9e941b176e17b9ef923e71e7b8b2477a000000000000000000000000eac5f0d4a9a45e1f9fdd0e7e2882e9f60e30115600000000000000000000000000000000000000000000000000000000000186a0000000000000000000000000000000000000000000000000003e1aba8fed6bc100000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001e10000000000000000000000000000000000000000000000000000000001a300a007e5c0d200000000000000000000000000000000000000000000000000017f00011c4330f9d5940c2313636546ab9852354860dce275dbad00000000000000000000000000000000000000000000000000002ecaf7212e2f002424b31a0c000000000000000000000000f0694acc9e941b176e17b9ef923e71e7b8b2477a00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000fffd8963efd1fc6a506488495d951d5263988d2500000000000000000000000000000000000000000000000000000000000000a000000000000000000000000000000000000000000000000000000000000000200000000000000000000000007f5c764cbc14f9669b88837ca1490cca17c3160702a0000000000000000000000000000000000000000000000000003e1aba8fed6bc1ee63c1e581ad4c666fc170b468b19988959eb931a3676f0e9f42000000000000000000000000000000000000061111111254760f7ab3f16433eea9304126dcd19900000000000000000000000000000000000000000000000000000000000186a000000000000000000000000000000000000000000000000000000000000000", - "nonce": "0x25" - }, - "additionalContracts": [], - "isFixedGasLimit": false - }, - { - "hash": "0x0d8dc46ad33862e3379182916a1539b58385d98e309f72b63179c594ca783ad0", - "transactionType": "CALL", - "contractName": null, - "contractAddress": "0x444A406C15e6F87Aee894999cb13B4ff1D61a85B", - "function": null, - "arguments": null, - "rpc": "", - "transaction": { - "type": "0x00", - "from": "0xeac5f0d4a9a45e1f9fdd0e7e2882e9f60e301156", - "to": "0x444a406c15e6f87aee894999cb13b4ff1d61a85b", - "gas": "0x4d893", - "value": "0x0", - "data": "0x0000000000000000000000006fd9d7ad17242c41f7131d257212c54a0e81669100000000000000000000000000000000000000000000000000000000000186a0000000000000000000000000000000000000000000000000003e1aba8fed6bc100000000000000000000000000000000000000000000000000000000000000a0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001e10000000000000000000000000000000000000000000000000000000001a300a007e5c0d200000000000000000000000000000000000000000000000000017f00011c4330f9d5940c2313636546ab9852354860dce275dbad00000000000000000000000000000000000000000000000000002ecaf7212e2f002424b31a0c000000000000000000000000f0694acc9e941b176e17b9ef923e71e7b8b2477a00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000fffd8963efd1fc6a506488495d951d5263988d2500000000000000000000000000000000000000000000000000000000000000a000000000000000000000000000000000000000000000000000000000000000200000000000000000000000007f5c764cbc14f9669b88837ca1490cca17c3160702a0000000000000000000000000000000000000000000000000003e1aba8fed6bc1ee63c1e581ad4c666fc170b468b19988959eb931a3676f0e9f42000000000000000000000000000000000000061111111254760f7ab3f16433eea9304126dcd19900000000000000000000000000000000000000000000000000000000000186a000000000000000000000000000000000000000000000000000000000000000", - "nonce": "0x26" - }, - "additionalContracts": [], - "isFixedGasLimit": false - } - ], - "receipts": [ - { - "transactionHash": "0x348866c854cc363d7aa16f63f8dbc467180c9b42f49d0601760e883e9f34c75b", - "transactionIndex": "0x0", - "blockHash": "0x9a259c5bfb1e00100a957619cbe9e496e05a3f84ea5a705ed9743237c49058e7", - "blockNumber": "0x5b287f3", - "from": "0xEAC5F0d4A9a45E1f9FdD0e7e2882e9f60E301156", - "to": "0x7F5c764cBc14f9669B88837ca1490cCa17c31607", - "cumulativeGasUsed": "0xcf3f", - "gasUsed": "0xcf3f", - "contractAddress": null, - "logs": [ - { - "address": "0x7F5c764cBc14f9669B88837ca1490cCa17c31607", - "topics": [ - "0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925", - "0x000000000000000000000000eac5f0d4a9a45e1f9fdd0e7e2882e9f60e301156", - "0x000000000000000000000000b17ccee669ab2cc40a6564da84db66dd8d144cb4" - ], - "data": "0x00000000000000000000000000000000000000000000000000000000000186a0", - "blockHash": "0x9a259c5bfb1e00100a957619cbe9e496e05a3f84ea5a705ed9743237c49058e7", - "blockNumber": "0x5b287f3", - "transactionHash": "0x348866c854cc363d7aa16f63f8dbc467180c9b42f49d0601760e883e9f34c75b", - "transactionIndex": "0x0", - "logIndex": "0x0", - "removed": false - } - ], - "status": "0x1", - "logsBloom": "0x00000000000000000000008000000000000000000000000000000000000000000000000000000000000040000000000000000040000000000000000000200000000000000000000000800000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000200000000000000000000000040000000020000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000800000000000000000000000010000" - }, - { - "transactionHash": "0x922fbc3c0c94e49f79c5bd2483f9d2be8644150654bc6b6b677f4debe097c6f7", - "transactionIndex": "0x0", - "blockHash": "0xe1ecbe29525ebdfe584d37b4d8930c701264f1ff8b15669d75ee919f6c76fad7", - "blockNumber": "0x5b287ff", - "from": "0xEAC5F0d4A9a45E1f9FdD0e7e2882e9f60E301156", - "to": "0x7F5c764cBc14f9669B88837ca1490cCa17c31607", - "cumulativeGasUsed": "0x8183", - "gasUsed": "0x8183", - "contractAddress": null, - "logs": [ - { - "address": "0x7F5c764cBc14f9669B88837ca1490cCa17c31607", - "topics": [ - "0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925", - "0x000000000000000000000000eac5f0d4a9a45e1f9fdd0e7e2882e9f60e301156", - "0x0000000000000000000000001111111254eeb25477b68fb85ed929f73a960582" - ], - "data": "0x00000000000000000000000000000000000000000000000000000000000186a0", - "blockHash": "0xe1ecbe29525ebdfe584d37b4d8930c701264f1ff8b15669d75ee919f6c76fad7", - "blockNumber": "0x5b287ff", - "transactionHash": "0x922fbc3c0c94e49f79c5bd2483f9d2be8644150654bc6b6b677f4debe097c6f7", - "transactionIndex": "0x0", - "logIndex": "0x0", - "removed": false - } - ], - "status": "0x1", - "logsBloom": "0x00000000000000000000008000000000000000000000000000000000000000000000000000000000000000000000000000000040000000000000000000200000000000000000080000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000040000000020000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010000000000000000400000000000000800000000000000000000000010000" - }, - { - "transactionHash": "0x0d1fbde82bd92ed22f1cd21788c5b734f7caa8b3523b0dba63cb65c1fd2cca4f", - "transactionIndex": "0x0", - "blockHash": "0x75dc10b02430f6ab2e7a19748dea56351e6b1a705d8f75142477f491b250ebae", - "blockNumber": "0x5b2880f", - "from": "0xEAC5F0d4A9a45E1f9FdD0e7e2882e9f60E301156", - "to": "0x1111111254EEB25477B68fb85Ed929f73A960582", - "cumulativeGasUsed": "0x46eda", - "gasUsed": "0x46eda", - "contractAddress": null, - "logs": [ - { - "address": "0x7F5c764cBc14f9669B88837ca1490cCa17c31607", - "topics": [ - "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef", - "0x000000000000000000000000eac5f0d4a9a45e1f9fdd0e7e2882e9f60e301156", - "0x000000000000000000000000f0694acc9e941b176e17b9ef923e71e7b8b2477a" - ], - "data": "0x00000000000000000000000000000000000000000000000000000000000186a0", - "blockHash": "0x75dc10b02430f6ab2e7a19748dea56351e6b1a705d8f75142477f491b250ebae", - "blockNumber": "0x5b2880f", - "transactionHash": "0x0d1fbde82bd92ed22f1cd21788c5b734f7caa8b3523b0dba63cb65c1fd2cca4f", - "transactionIndex": "0x0", - "logIndex": "0x0", - "removed": false - }, - { - "address": "0x7F5c764cBc14f9669B88837ca1490cCa17c31607", - "topics": [ - "0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925", - "0x000000000000000000000000eac5f0d4a9a45e1f9fdd0e7e2882e9f60e301156", - "0x0000000000000000000000001111111254eeb25477b68fb85ed929f73a960582" - ], - "data": "0x0000000000000000000000000000000000000000000000000000000000000000", - "blockHash": "0x75dc10b02430f6ab2e7a19748dea56351e6b1a705d8f75142477f491b250ebae", - "blockNumber": "0x5b2880f", - "transactionHash": "0x0d1fbde82bd92ed22f1cd21788c5b734f7caa8b3523b0dba63cb65c1fd2cca4f", - "transactionIndex": "0x0", - "logIndex": "0x1", - "removed": false - }, - { - "address": "0x7F5c764cBc14f9669B88837ca1490cCa17c31607", - "topics": [ - "0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925", - "0x000000000000000000000000f0694acc9e941b176e17b9ef923e71e7b8b2477a", - "0x000000000000000000000000a132dab612db5cb9fc9ac426a0cc215a3423f9c9" - ], - "data": "0x00000000000000000000000000000000000000000000000000000000000186a0", - "blockHash": "0x75dc10b02430f6ab2e7a19748dea56351e6b1a705d8f75142477f491b250ebae", - "blockNumber": "0x5b2880f", - "transactionHash": "0x0d1fbde82bd92ed22f1cd21788c5b734f7caa8b3523b0dba63cb65c1fd2cca4f", - "transactionIndex": "0x0", - "logIndex": "0x2", - "removed": false - }, - { - "address": "0x7F5c764cBc14f9669B88837ca1490cCa17c31607", - "topics": [ - "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef", - "0x000000000000000000000000f0694acc9e941b176e17b9ef923e71e7b8b2477a", - "0x00000000000000000000000048e18e3d1efa7f0e15f1b2bf01b232534c30a3ef" - ], - "data": "0x00000000000000000000000000000000000000000000000000000000000186a0", - "blockHash": "0x75dc10b02430f6ab2e7a19748dea56351e6b1a705d8f75142477f491b250ebae", - "blockNumber": "0x5b2880f", - "transactionHash": "0x0d1fbde82bd92ed22f1cd21788c5b734f7caa8b3523b0dba63cb65c1fd2cca4f", - "transactionIndex": "0x0", - "logIndex": "0x3", - "removed": false - }, - { - "address": "0x7F5c764cBc14f9669B88837ca1490cCa17c31607", - "topics": [ - "0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925", - "0x000000000000000000000000f0694acc9e941b176e17b9ef923e71e7b8b2477a", - "0x000000000000000000000000a132dab612db5cb9fc9ac426a0cc215a3423f9c9" - ], - "data": "0x0000000000000000000000000000000000000000000000000000000000000000", - "blockHash": "0x75dc10b02430f6ab2e7a19748dea56351e6b1a705d8f75142477f491b250ebae", - "blockNumber": "0x5b2880f", - "transactionHash": "0x0d1fbde82bd92ed22f1cd21788c5b734f7caa8b3523b0dba63cb65c1fd2cca4f", - "transactionIndex": "0x0", - "logIndex": "0x4", - "removed": false - }, - { - "address": "0x4200000000000000000000000000000000000006", - "topics": [ - "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef", - "0x00000000000000000000000048e18e3d1efa7f0e15f1b2bf01b232534c30a3ef", - "0x000000000000000000000000f0694acc9e941b176e17b9ef923e71e7b8b2477a" - ], - "data": "0x00000000000000000000000000000000000000000000000000002ff6128b1096", - "blockHash": "0x75dc10b02430f6ab2e7a19748dea56351e6b1a705d8f75142477f491b250ebae", - "blockNumber": "0x5b2880f", - "transactionHash": "0x0d1fbde82bd92ed22f1cd21788c5b734f7caa8b3523b0dba63cb65c1fd2cca4f", - "transactionIndex": "0x0", - "logIndex": "0x5", - "removed": false - }, - { - "address": "0x7F5c764cBc14f9669B88837ca1490cCa17c31607", - "topics": [ - "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef", - "0x00000000000000000000000048e18e3d1efa7f0e15f1b2bf01b232534c30a3ef", - "0x000000000000000000000000d5b6cfc309fd839fb33b826d8501ec90e6d9f45c" - ], - "data": "0x0000000000000000000000000000000000000000000000000000000000000032", - "blockHash": "0x75dc10b02430f6ab2e7a19748dea56351e6b1a705d8f75142477f491b250ebae", - "blockNumber": "0x5b2880f", - "transactionHash": "0x0d1fbde82bd92ed22f1cd21788c5b734f7caa8b3523b0dba63cb65c1fd2cca4f", - "transactionIndex": "0x0", - "logIndex": "0x6", - "removed": false - }, - { - "address": "0x48e18E3d1eFA7F0E15F1b2Bf01b232534c30a3EF", - "topics": [ - "0x112c256902bf554b6ed882d2936687aaeb4225e8cd5b51303c90ca6cf43a8602", - "0x000000000000000000000000a132dab612db5cb9fc9ac426a0cc215a3423f9c9" - ], - "data": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000032", - "blockHash": "0x75dc10b02430f6ab2e7a19748dea56351e6b1a705d8f75142477f491b250ebae", - "blockNumber": "0x5b2880f", - "transactionHash": "0x0d1fbde82bd92ed22f1cd21788c5b734f7caa8b3523b0dba63cb65c1fd2cca4f", - "transactionIndex": "0x0", - "logIndex": "0x7", - "removed": false - }, - { - "address": "0x48e18E3d1eFA7F0E15F1b2Bf01b232534c30a3EF", - "topics": [ - "0xcf2aa50876cdfbb541206f89af0ee78d44a2abf8d328e37fa4917f982149848a" - ], - "data": "0x00000000000000000000000000000000000000000000000007e321af0bc01ed400000000000000000000000000000000000000000000000000000000c0a170f8", - "blockHash": "0x75dc10b02430f6ab2e7a19748dea56351e6b1a705d8f75142477f491b250ebae", - "blockNumber": "0x5b2880f", - "transactionHash": "0x0d1fbde82bd92ed22f1cd21788c5b734f7caa8b3523b0dba63cb65c1fd2cca4f", - "transactionIndex": "0x0", - "logIndex": "0x8", - "removed": false - }, - { - "address": "0x48e18E3d1eFA7F0E15F1b2Bf01b232534c30a3EF", - "topics": [ - "0xd78ad95fa46c994b6551d0da85fc275fe613ce37657fb8d5e3d130840159d822", - "0x000000000000000000000000a132dab612db5cb9fc9ac426a0cc215a3423f9c9", - "0x000000000000000000000000f0694acc9e941b176e17b9ef923e71e7b8b2477a" - ], - "data": "0x000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000186a000000000000000000000000000000000000000000000000000002ff6128b10960000000000000000000000000000000000000000000000000000000000000000", - "blockHash": "0x75dc10b02430f6ab2e7a19748dea56351e6b1a705d8f75142477f491b250ebae", - "blockNumber": "0x5b2880f", - "transactionHash": "0x0d1fbde82bd92ed22f1cd21788c5b734f7caa8b3523b0dba63cb65c1fd2cca4f", - "transactionIndex": "0x0", - "logIndex": "0x9", - "removed": false - }, - { - "address": "0x6fd9d7AD17242c41f7131d257212c54A0e816691", - "topics": [ - "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef", - "0x000000000000000000000000ad4c666fc170b468b19988959eb931a3676f0e9f", - "0x0000000000000000000000001111111254eeb25477b68fb85ed929f73a960582" - ], - "data": "0x000000000000000000000000000000000000000000000000004038818da9a205", - "blockHash": "0x75dc10b02430f6ab2e7a19748dea56351e6b1a705d8f75142477f491b250ebae", - "blockNumber": "0x5b2880f", - "transactionHash": "0x0d1fbde82bd92ed22f1cd21788c5b734f7caa8b3523b0dba63cb65c1fd2cca4f", - "transactionIndex": "0x0", - "logIndex": "0xa", - "removed": false - }, - { - "address": "0x4200000000000000000000000000000000000006", - "topics": [ - "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef", - "0x000000000000000000000000f0694acc9e941b176e17b9ef923e71e7b8b2477a", - "0x000000000000000000000000ad4c666fc170b468b19988959eb931a3676f0e9f" - ], - "data": "0x00000000000000000000000000000000000000000000000000002ff6128b1096", - "blockHash": "0x75dc10b02430f6ab2e7a19748dea56351e6b1a705d8f75142477f491b250ebae", - "blockNumber": "0x5b2880f", - "transactionHash": "0x0d1fbde82bd92ed22f1cd21788c5b734f7caa8b3523b0dba63cb65c1fd2cca4f", - "transactionIndex": "0x0", - "logIndex": "0xb", - "removed": false - }, - { - "address": "0xAD4c666fC170B468B19988959eb931a3676f0e9F", - "topics": [ - "0xc42079f94a6350d7e6235f29174924f928cc2ac818eb64fed8004e115fbcca67", - "0x000000000000000000000000f0694acc9e941b176e17b9ef923e71e7b8b2477a", - "0x0000000000000000000000001111111254eeb25477b68fb85ed929f73a960582" - ], - "data": "0x00000000000000000000000000000000000000000000000000002ff6128b1096ffffffffffffffffffffffffffffffffffffffffffffffffffbfc77e72565dfb00000000000000000000000000000000000000128ad641fa7eee7279f2ce0f01000000000000000000000000000000000000000000000014da5c0b160a447bb8000000000000000000000000000000000000000000000000000000000000e424", - "blockHash": "0x75dc10b02430f6ab2e7a19748dea56351e6b1a705d8f75142477f491b250ebae", - "blockNumber": "0x5b2880f", - "transactionHash": "0x0d1fbde82bd92ed22f1cd21788c5b734f7caa8b3523b0dba63cb65c1fd2cca4f", - "transactionIndex": "0x0", - "logIndex": "0xc", - "removed": false - }, - { - "address": "0x6fd9d7AD17242c41f7131d257212c54A0e816691", - "topics": [ - "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef", - "0x0000000000000000000000001111111254eeb25477b68fb85ed929f73a960582", - "0x000000000000000000000000eac5f0d4a9a45e1f9fdd0e7e2882e9f60e301156" - ], - "data": "0x000000000000000000000000000000000000000000000000004038818da9a205", - "blockHash": "0x75dc10b02430f6ab2e7a19748dea56351e6b1a705d8f75142477f491b250ebae", - "blockNumber": "0x5b2880f", - "transactionHash": "0x0d1fbde82bd92ed22f1cd21788c5b734f7caa8b3523b0dba63cb65c1fd2cca4f", - "transactionIndex": "0x0", - "logIndex": "0xd", - "removed": false - } - ], - "status": "0x1", - "logsBloom": "0x00200000000000000000008000080000000000000000000000440000000000000004000000000000000000500000000000000040008020000010000000200000000200000000080800000008000000200020000000000000000000101000000000000000000400000008000000000000010000000000000000000010000800000000000000000000000002000000000000001000002000000000004040000000020000000000000000000000080204010000000000000000000000000000000000000002000000000000000400000000000000800000020020080000000400000010004000000000000400000020011000810000000010000000100000010000" - }, - { - "transactionHash": "0xe7bfb6d05f570a42721bb6168e20a3d23bd38bcdd9d14b19740af210f2382b13", - "transactionIndex": "0x0", - "blockHash": "0x8285656676e8f3a63a32f65fb6f729bd19bfc37a6da2ae05bed156d7088994fc", - "blockNumber": "0x5b28822", - "from": "0xEAC5F0d4A9a45E1f9FdD0e7e2882e9f60E301156", - "to": "0xB17cCEE669aB2cc40A6564DA84Db66dD8D144CB4", - "cumulativeGasUsed": "0x4a2c7", - "gasUsed": "0x4a2c7", - "contractAddress": null, - "logs": [ - { - "address": "0x7F5c764cBc14f9669B88837ca1490cCa17c31607", - "topics": [ - "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef", - "0x000000000000000000000000eac5f0d4a9a45e1f9fdd0e7e2882e9f60e301156", - "0x000000000000000000000000b17ccee669ab2cc40a6564da84db66dd8d144cb4" - ], - "data": "0x00000000000000000000000000000000000000000000000000000000000186a0", - "blockHash": "0x8285656676e8f3a63a32f65fb6f729bd19bfc37a6da2ae05bed156d7088994fc", - "blockNumber": "0x5b28822", - "transactionHash": "0xe7bfb6d05f570a42721bb6168e20a3d23bd38bcdd9d14b19740af210f2382b13", - "transactionIndex": "0x0", - "logIndex": "0x0", - "removed": false - }, - { - "address": "0x7F5c764cBc14f9669B88837ca1490cCa17c31607", - "topics": [ - "0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925", - "0x000000000000000000000000eac5f0d4a9a45e1f9fdd0e7e2882e9f60e301156", - "0x000000000000000000000000b17ccee669ab2cc40a6564da84db66dd8d144cb4" - ], - "data": "0x0000000000000000000000000000000000000000000000000000000000000000", - "blockHash": "0x8285656676e8f3a63a32f65fb6f729bd19bfc37a6da2ae05bed156d7088994fc", - "blockNumber": "0x5b28822", - "transactionHash": "0xe7bfb6d05f570a42721bb6168e20a3d23bd38bcdd9d14b19740af210f2382b13", - "transactionIndex": "0x0", - "logIndex": "0x1", - "removed": false - }, - { - "address": "0x7F5c764cBc14f9669B88837ca1490cCa17c31607", - "topics": [ - "0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925", - "0x000000000000000000000000b17ccee669ab2cc40a6564da84db66dd8d144cb4", - "0x0000000000000000000000001111111254eeb25477b68fb85ed929f73a960582" - ], - "data": "0x00000000000000000000000000000000000000000000000000000000000186a0", - "blockHash": "0x8285656676e8f3a63a32f65fb6f729bd19bfc37a6da2ae05bed156d7088994fc", - "blockNumber": "0x5b28822", - "transactionHash": "0xe7bfb6d05f570a42721bb6168e20a3d23bd38bcdd9d14b19740af210f2382b13", - "transactionIndex": "0x0", - "logIndex": "0x2", - "removed": false - }, - { - "address": "0x7F5c764cBc14f9669B88837ca1490cCa17c31607", - "topics": [ - "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef", - "0x000000000000000000000000b17ccee669ab2cc40a6564da84db66dd8d144cb4", - "0x000000000000000000000000f0694acc9e941b176e17b9ef923e71e7b8b2477a" - ], - "data": "0x00000000000000000000000000000000000000000000000000000000000186a0", - "blockHash": "0x8285656676e8f3a63a32f65fb6f729bd19bfc37a6da2ae05bed156d7088994fc", - "blockNumber": "0x5b28822", - "transactionHash": "0xe7bfb6d05f570a42721bb6168e20a3d23bd38bcdd9d14b19740af210f2382b13", - "transactionIndex": "0x0", - "logIndex": "0x3", - "removed": false - }, - { - "address": "0x7F5c764cBc14f9669B88837ca1490cCa17c31607", - "topics": [ - "0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925", - "0x000000000000000000000000b17ccee669ab2cc40a6564da84db66dd8d144cb4", - "0x0000000000000000000000001111111254eeb25477b68fb85ed929f73a960582" - ], - "data": "0x0000000000000000000000000000000000000000000000000000000000000000", - "blockHash": "0x8285656676e8f3a63a32f65fb6f729bd19bfc37a6da2ae05bed156d7088994fc", - "blockNumber": "0x5b28822", - "transactionHash": "0xe7bfb6d05f570a42721bb6168e20a3d23bd38bcdd9d14b19740af210f2382b13", - "transactionIndex": "0x0", - "logIndex": "0x4", - "removed": false - }, - { - "address": "0x7F5c764cBc14f9669B88837ca1490cCa17c31607", - "topics": [ - "0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925", - "0x000000000000000000000000f0694acc9e941b176e17b9ef923e71e7b8b2477a", - "0x000000000000000000000000a132dab612db5cb9fc9ac426a0cc215a3423f9c9" - ], - "data": "0x00000000000000000000000000000000000000000000000000000000000186a0", - "blockHash": "0x8285656676e8f3a63a32f65fb6f729bd19bfc37a6da2ae05bed156d7088994fc", - "blockNumber": "0x5b28822", - "transactionHash": "0xe7bfb6d05f570a42721bb6168e20a3d23bd38bcdd9d14b19740af210f2382b13", - "transactionIndex": "0x0", - "logIndex": "0x5", - "removed": false - }, - { - "address": "0x7F5c764cBc14f9669B88837ca1490cCa17c31607", - "topics": [ - "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef", - "0x000000000000000000000000f0694acc9e941b176e17b9ef923e71e7b8b2477a", - "0x00000000000000000000000048e18e3d1efa7f0e15f1b2bf01b232534c30a3ef" - ], - "data": "0x00000000000000000000000000000000000000000000000000000000000186a0", - "blockHash": "0x8285656676e8f3a63a32f65fb6f729bd19bfc37a6da2ae05bed156d7088994fc", - "blockNumber": "0x5b28822", - "transactionHash": "0xe7bfb6d05f570a42721bb6168e20a3d23bd38bcdd9d14b19740af210f2382b13", - "transactionIndex": "0x0", - "logIndex": "0x6", - "removed": false - }, - { - "address": "0x7F5c764cBc14f9669B88837ca1490cCa17c31607", - "topics": [ - "0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925", - "0x000000000000000000000000f0694acc9e941b176e17b9ef923e71e7b8b2477a", - "0x000000000000000000000000a132dab612db5cb9fc9ac426a0cc215a3423f9c9" - ], - "data": "0x0000000000000000000000000000000000000000000000000000000000000000", - "blockHash": "0x8285656676e8f3a63a32f65fb6f729bd19bfc37a6da2ae05bed156d7088994fc", - "blockNumber": "0x5b28822", - "transactionHash": "0xe7bfb6d05f570a42721bb6168e20a3d23bd38bcdd9d14b19740af210f2382b13", - "transactionIndex": "0x0", - "logIndex": "0x7", - "removed": false - }, - { - "address": "0x4200000000000000000000000000000000000006", - "topics": [ - "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef", - "0x00000000000000000000000048e18e3d1efa7f0e15f1b2bf01b232534c30a3ef", - "0x000000000000000000000000f0694acc9e941b176e17b9ef923e71e7b8b2477a" - ], - "data": "0x00000000000000000000000000000000000000000000000000002ff48dbaf1bd", - "blockHash": "0x8285656676e8f3a63a32f65fb6f729bd19bfc37a6da2ae05bed156d7088994fc", - "blockNumber": "0x5b28822", - "transactionHash": "0xe7bfb6d05f570a42721bb6168e20a3d23bd38bcdd9d14b19740af210f2382b13", - "transactionIndex": "0x0", - "logIndex": "0x8", - "removed": false - }, - { - "address": "0x7F5c764cBc14f9669B88837ca1490cCa17c31607", - "topics": [ - "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef", - "0x00000000000000000000000048e18e3d1efa7f0e15f1b2bf01b232534c30a3ef", - "0x000000000000000000000000d5b6cfc309fd839fb33b826d8501ec90e6d9f45c" - ], - "data": "0x0000000000000000000000000000000000000000000000000000000000000032", - "blockHash": "0x8285656676e8f3a63a32f65fb6f729bd19bfc37a6da2ae05bed156d7088994fc", - "blockNumber": "0x5b28822", - "transactionHash": "0xe7bfb6d05f570a42721bb6168e20a3d23bd38bcdd9d14b19740af210f2382b13", - "transactionIndex": "0x0", - "logIndex": "0x9", - "removed": false - }, - { - "address": "0x48e18E3d1eFA7F0E15F1b2Bf01b232534c30a3EF", - "topics": [ - "0x112c256902bf554b6ed882d2936687aaeb4225e8cd5b51303c90ca6cf43a8602", - "0x000000000000000000000000a132dab612db5cb9fc9ac426a0cc215a3423f9c9" - ], - "data": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000032", - "blockHash": "0x8285656676e8f3a63a32f65fb6f729bd19bfc37a6da2ae05bed156d7088994fc", - "blockNumber": "0x5b28822", - "transactionHash": "0xe7bfb6d05f570a42721bb6168e20a3d23bd38bcdd9d14b19740af210f2382b13", - "transactionIndex": "0x0", - "logIndex": "0xa", - "removed": false - }, - { - "address": "0x48e18E3d1eFA7F0E15F1b2Bf01b232534c30a3EF", - "topics": [ - "0xcf2aa50876cdfbb541206f89af0ee78d44a2abf8d328e37fa4917f982149848a" - ], - "data": "0x00000000000000000000000000000000000000000000000007e2f1ba7e052d1700000000000000000000000000000000000000000000000000000000c0a2f766", - "blockHash": "0x8285656676e8f3a63a32f65fb6f729bd19bfc37a6da2ae05bed156d7088994fc", - "blockNumber": "0x5b28822", - "transactionHash": "0xe7bfb6d05f570a42721bb6168e20a3d23bd38bcdd9d14b19740af210f2382b13", - "transactionIndex": "0x0", - "logIndex": "0xb", - "removed": false - }, - { - "address": "0x48e18E3d1eFA7F0E15F1b2Bf01b232534c30a3EF", - "topics": [ - "0xd78ad95fa46c994b6551d0da85fc275fe613ce37657fb8d5e3d130840159d822", - "0x000000000000000000000000a132dab612db5cb9fc9ac426a0cc215a3423f9c9", - "0x000000000000000000000000f0694acc9e941b176e17b9ef923e71e7b8b2477a" - ], - "data": "0x000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000186a000000000000000000000000000000000000000000000000000002ff48dbaf1bd0000000000000000000000000000000000000000000000000000000000000000", - "blockHash": "0x8285656676e8f3a63a32f65fb6f729bd19bfc37a6da2ae05bed156d7088994fc", - "blockNumber": "0x5b28822", - "transactionHash": "0xe7bfb6d05f570a42721bb6168e20a3d23bd38bcdd9d14b19740af210f2382b13", - "transactionIndex": "0x0", - "logIndex": "0xc", - "removed": false - }, - { - "address": "0x6fd9d7AD17242c41f7131d257212c54A0e816691", - "topics": [ - "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef", - "0x000000000000000000000000ad4c666fc170b468b19988959eb931a3676f0e9f", - "0x0000000000000000000000001111111254eeb25477b68fb85ed929f73a960582" - ], - "data": "0x0000000000000000000000000000000000000000000000000040366399484adb", - "blockHash": "0x8285656676e8f3a63a32f65fb6f729bd19bfc37a6da2ae05bed156d7088994fc", - "blockNumber": "0x5b28822", - "transactionHash": "0xe7bfb6d05f570a42721bb6168e20a3d23bd38bcdd9d14b19740af210f2382b13", - "transactionIndex": "0x0", - "logIndex": "0xd", - "removed": false - }, - { - "address": "0x4200000000000000000000000000000000000006", - "topics": [ - "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef", - "0x000000000000000000000000f0694acc9e941b176e17b9ef923e71e7b8b2477a", - "0x000000000000000000000000ad4c666fc170b468b19988959eb931a3676f0e9f" - ], - "data": "0x00000000000000000000000000000000000000000000000000002ff48dbaf1bd", - "blockHash": "0x8285656676e8f3a63a32f65fb6f729bd19bfc37a6da2ae05bed156d7088994fc", - "blockNumber": "0x5b28822", - "transactionHash": "0xe7bfb6d05f570a42721bb6168e20a3d23bd38bcdd9d14b19740af210f2382b13", - "transactionIndex": "0x0", - "logIndex": "0xe", - "removed": false - }, - { - "address": "0xAD4c666fC170B468B19988959eb931a3676f0e9F", - "topics": [ - "0xc42079f94a6350d7e6235f29174924f928cc2ac818eb64fed8004e115fbcca67", - "0x000000000000000000000000f0694acc9e941b176e17b9ef923e71e7b8b2477a", - "0x0000000000000000000000001111111254eeb25477b68fb85ed929f73a960582" - ], - "data": "0x00000000000000000000000000000000000000000000000000002ff48dbaf1bdffffffffffffffffffffffffffffffffffffffffffffffffffbfc99c66b7b52500000000000000000000000000000000000000128ad32dadc13af14735933691000000000000000000000000000000000000000000000014da5c0b160a447bb8000000000000000000000000000000000000000000000000000000000000e423", - "blockHash": "0x8285656676e8f3a63a32f65fb6f729bd19bfc37a6da2ae05bed156d7088994fc", - "blockNumber": "0x5b28822", - "transactionHash": "0xe7bfb6d05f570a42721bb6168e20a3d23bd38bcdd9d14b19740af210f2382b13", - "transactionIndex": "0x0", - "logIndex": "0xf", - "removed": false - }, - { - "address": "0x6fd9d7AD17242c41f7131d257212c54A0e816691", - "topics": [ - "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef", - "0x0000000000000000000000001111111254eeb25477b68fb85ed929f73a960582", - "0x000000000000000000000000eac5f0d4a9a45e1f9fdd0e7e2882e9f60e301156" - ], - "data": "0x0000000000000000000000000000000000000000000000000040366399484adb", - "blockHash": "0x8285656676e8f3a63a32f65fb6f729bd19bfc37a6da2ae05bed156d7088994fc", - "blockNumber": "0x5b28822", - "transactionHash": "0xe7bfb6d05f570a42721bb6168e20a3d23bd38bcdd9d14b19740af210f2382b13", - "transactionIndex": "0x0", - "logIndex": "0x10", - "removed": false - } - ], - "status": "0x1", - "logsBloom": "0x00200000000000000000008000080000000000000000000000440000000000000004000000000000000040500000000000000040008020000010000000200000000200000000080800800008000000200020000000000000000000101000000000000000000400000008000000000000010000000000000000000010000800000000000000000000000002000000000200001000002000000000004040000000020000000000000000000000080204010000000000000000000000000000000000000002000000000000000400000000000000800000020020080000000400000010004000000000000400000020011000810000000010000000100000010000" - }, - { - "transactionHash": "0x71f79f21650241187d3e637351677f73d2fee7591f2600ecc768226d7d9a3178", - "transactionIndex": "0x0", - "blockHash": "0x6c97deaa4f5ba68fb7a4f9bb0b3cdc9a09c3a49b65c76915e63f0becbd6f1cfb", - "blockNumber": "0x5b2882e", - "from": "0xEAC5F0d4A9a45E1f9FdD0e7e2882e9f60E301156", - "to": "0x7F5c764cBc14f9669B88837ca1490cCa17c31607", - "cumulativeGasUsed": "0xcf3f", - "gasUsed": "0xcf3f", - "contractAddress": null, - "logs": [ - { - "address": "0x7F5c764cBc14f9669B88837ca1490cCa17c31607", - "topics": [ - "0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925", - "0x000000000000000000000000eac5f0d4a9a45e1f9fdd0e7e2882e9f60e301156", - "0x000000000000000000000000444a406c15e6f87aee894999cb13b4ff1d61a85b" - ], - "data": "0x00000000000000000000000000000000000000000000000000000000000186a0", - "blockHash": "0x6c97deaa4f5ba68fb7a4f9bb0b3cdc9a09c3a49b65c76915e63f0becbd6f1cfb", - "blockNumber": "0x5b2882e", - "transactionHash": "0x71f79f21650241187d3e637351677f73d2fee7591f2600ecc768226d7d9a3178", - "transactionIndex": "0x0", - "logIndex": "0x0", - "removed": false - } - ], - "status": "0x1", - "logsBloom": "0x00000000000000000000008000000000000000000000000000000000000000000000000000000000000000000000000000000040000000000000000000200000000000000000000000000000000000000000000001000008000000100000000000000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000040000000020000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000800000000000000000000000010000" - }, - { - "transactionHash": "0x179019d502a67838533b07634ad619d39514b55a10599b250f80c5cb219ab04e", - "transactionIndex": "0x0", - "blockHash": "0x57eb61011139e2d87ffb3b6d29e7bac69e17919330e0d928403ddcc9b6b59261", - "blockNumber": "0x5b28839", - "from": "0xEAC5F0d4A9a45E1f9FdD0e7e2882e9f60E301156", - "to": "0x7F5c764cBc14f9669B88837ca1490cCa17c31607", - "cumulativeGasUsed": "0x8183", - "gasUsed": "0x8183", - "contractAddress": null, - "logs": [ - { - "address": "0x7F5c764cBc14f9669B88837ca1490cCa17c31607", - "topics": [ - "0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925", - "0x000000000000000000000000eac5f0d4a9a45e1f9fdd0e7e2882e9f60e301156", - "0x0000000000000000000000001111111254760f7ab3f16433eea9304126dcd199" - ], - "data": "0x00000000000000000000000000000000000000000000000000000000000186a0", - "blockHash": "0x57eb61011139e2d87ffb3b6d29e7bac69e17919330e0d928403ddcc9b6b59261", - "blockNumber": "0x5b28839", - "transactionHash": "0x179019d502a67838533b07634ad619d39514b55a10599b250f80c5cb219ab04e", - "transactionIndex": "0x0", - "logIndex": "0x0", - "removed": false - } - ], - "status": "0x1", - "logsBloom": "0x00000000000000000000008000000000000000000000000000000000000000000000000000000000000000000000000000000040000000000000400000200000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000040000000020000000000000200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000800000080000000000000000010000" - }, - { - "transactionHash": "0x5445be7f53975a21d639f41e3e607903bc47ab5f1c87c2005c657dbf0efafe48", - "transactionIndex": "0x0", - "blockHash": "0xde962d5313c54e9a1490d0f1cf82130a7fedcb011b11b3c8dac57ed0405b544f", - "blockNumber": "0x5b28846", - "from": "0xEAC5F0d4A9a45E1f9FdD0e7e2882e9f60E301156", - "to": "0x1111111254760F7ab3F16433eea9304126DCd199", - "cumulativeGasUsed": "0x2fb70", - "gasUsed": "0x2fb70", - "contractAddress": null, - "logs": [ - { - "address": "0x7F5c764cBc14f9669B88837ca1490cCa17c31607", - "topics": [ - "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef", - "0x000000000000000000000000eac5f0d4a9a45e1f9fdd0e7e2882e9f60e301156", - "0x000000000000000000000000f0694acc9e941b176e17b9ef923e71e7b8b2477a" - ], - "data": "0x00000000000000000000000000000000000000000000000000000000000186a0", - "blockHash": "0xde962d5313c54e9a1490d0f1cf82130a7fedcb011b11b3c8dac57ed0405b544f", - "blockNumber": "0x5b28846", - "transactionHash": "0x5445be7f53975a21d639f41e3e607903bc47ab5f1c87c2005c657dbf0efafe48", - "transactionIndex": "0x0", - "logIndex": "0x0", - "removed": false - }, - { - "address": "0x7F5c764cBc14f9669B88837ca1490cCa17c31607", - "topics": [ - "0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925", - "0x000000000000000000000000eac5f0d4a9a45e1f9fdd0e7e2882e9f60e301156", - "0x0000000000000000000000001111111254760f7ab3f16433eea9304126dcd199" - ], - "data": "0x0000000000000000000000000000000000000000000000000000000000000000", - "blockHash": "0xde962d5313c54e9a1490d0f1cf82130a7fedcb011b11b3c8dac57ed0405b544f", - "blockNumber": "0x5b28846", - "transactionHash": "0x5445be7f53975a21d639f41e3e607903bc47ab5f1c87c2005c657dbf0efafe48", - "transactionIndex": "0x0", - "logIndex": "0x1", - "removed": false - }, - { - "address": "0x4200000000000000000000000000000000000006", - "topics": [ - "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef", - "0x000000000000000000000000f9d5940c2313636546ab9852354860dce275dbad", - "0x000000000000000000000000f0694acc9e941b176e17b9ef923e71e7b8b2477a" - ], - "data": "0x00000000000000000000000000000000000000000000000000002ff8d9b2edfd", - "blockHash": "0xde962d5313c54e9a1490d0f1cf82130a7fedcb011b11b3c8dac57ed0405b544f", - "blockNumber": "0x5b28846", - "transactionHash": "0x5445be7f53975a21d639f41e3e607903bc47ab5f1c87c2005c657dbf0efafe48", - "transactionIndex": "0x0", - "logIndex": "0x2", - "removed": false - }, - { - "address": "0x7F5c764cBc14f9669B88837ca1490cCa17c31607", - "topics": [ - "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef", - "0x000000000000000000000000f0694acc9e941b176e17b9ef923e71e7b8b2477a", - "0x000000000000000000000000f9d5940c2313636546ab9852354860dce275dbad" - ], - "data": "0x00000000000000000000000000000000000000000000000000000000000186a0", - "blockHash": "0xde962d5313c54e9a1490d0f1cf82130a7fedcb011b11b3c8dac57ed0405b544f", - "blockNumber": "0x5b28846", - "transactionHash": "0x5445be7f53975a21d639f41e3e607903bc47ab5f1c87c2005c657dbf0efafe48", - "transactionIndex": "0x0", - "logIndex": "0x3", - "removed": false - }, - { - "address": "0xf9D5940c2313636546Ab9852354860dCE275DBaD", - "topics": [ - "0xc42079f94a6350d7e6235f29174924f928cc2ac818eb64fed8004e115fbcca67", - "0x000000000000000000000000f0694acc9e941b176e17b9ef923e71e7b8b2477a", - "0x000000000000000000000000f0694acc9e941b176e17b9ef923e71e7b8b2477a" - ], - "data": "0xffffffffffffffffffffffffffffffffffffffffffffffffffffd007264d120300000000000000000000000000000000000000000000000000000000000186a000000000000000000000000000000000000000000002da5e92e5b4199d8c66740000000000000000000000000000000000000000000000000000775b02e74881fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffcef6e", - "blockHash": "0xde962d5313c54e9a1490d0f1cf82130a7fedcb011b11b3c8dac57ed0405b544f", - "blockNumber": "0x5b28846", - "transactionHash": "0x5445be7f53975a21d639f41e3e607903bc47ab5f1c87c2005c657dbf0efafe48", - "transactionIndex": "0x0", - "logIndex": "0x4", - "removed": false - }, - { - "address": "0x6fd9d7AD17242c41f7131d257212c54A0e816691", - "topics": [ - "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef", - "0x000000000000000000000000ad4c666fc170b468b19988959eb931a3676f0e9f", - "0x0000000000000000000000001111111254760f7ab3f16433eea9304126dcd199" - ], - "data": "0x00000000000000000000000000000000000000000000000000403c0f203947a1", - "blockHash": "0xde962d5313c54e9a1490d0f1cf82130a7fedcb011b11b3c8dac57ed0405b544f", - "blockNumber": "0x5b28846", - "transactionHash": "0x5445be7f53975a21d639f41e3e607903bc47ab5f1c87c2005c657dbf0efafe48", - "transactionIndex": "0x0", - "logIndex": "0x5", - "removed": false - }, - { - "address": "0x4200000000000000000000000000000000000006", - "topics": [ - "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef", - "0x000000000000000000000000f0694acc9e941b176e17b9ef923e71e7b8b2477a", - "0x000000000000000000000000ad4c666fc170b468b19988959eb931a3676f0e9f" - ], - "data": "0x00000000000000000000000000000000000000000000000000002ff8d9b2edfd", - "blockHash": "0xde962d5313c54e9a1490d0f1cf82130a7fedcb011b11b3c8dac57ed0405b544f", - "blockNumber": "0x5b28846", - "transactionHash": "0x5445be7f53975a21d639f41e3e607903bc47ab5f1c87c2005c657dbf0efafe48", - "transactionIndex": "0x0", - "logIndex": "0x6", - "removed": false - }, - { - "address": "0xAD4c666fC170B468B19988959eb931a3676f0e9F", - "topics": [ - "0xc42079f94a6350d7e6235f29174924f928cc2ac818eb64fed8004e115fbcca67", - "0x000000000000000000000000f0694acc9e941b176e17b9ef923e71e7b8b2477a", - "0x0000000000000000000000001111111254760f7ab3f16433eea9304126dcd199" - ], - "data": "0x00000000000000000000000000000000000000000000000000002ff8d9b2edfdffffffffffffffffffffffffffffffffffffffffffffffffffbfc3f0dfc6b85f00000000000000000000000000000000000000128ad0191b67f5111972c2a4fd000000000000000000000000000000000000000000000014da5c0b160a447bb8000000000000000000000000000000000000000000000000000000000000e423", - "blockHash": "0xde962d5313c54e9a1490d0f1cf82130a7fedcb011b11b3c8dac57ed0405b544f", - "blockNumber": "0x5b28846", - "transactionHash": "0x5445be7f53975a21d639f41e3e607903bc47ab5f1c87c2005c657dbf0efafe48", - "transactionIndex": "0x0", - "logIndex": "0x7", - "removed": false - }, - { - "address": "0x6fd9d7AD17242c41f7131d257212c54A0e816691", - "topics": [ - "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef", - "0x0000000000000000000000001111111254760f7ab3f16433eea9304126dcd199", - "0x000000000000000000000000eac5f0d4a9a45e1f9fdd0e7e2882e9f60e301156" - ], - "data": "0x00000000000000000000000000000000000000000000000000403c0f203947a1", - "blockHash": "0xde962d5313c54e9a1490d0f1cf82130a7fedcb011b11b3c8dac57ed0405b544f", - "blockNumber": "0x5b28846", - "transactionHash": "0x5445be7f53975a21d639f41e3e607903bc47ab5f1c87c2005c657dbf0efafe48", - "transactionIndex": "0x0", - "logIndex": "0x8", - "removed": false - } - ], - "status": "0x1", - "logsBloom": "0x00000000000000000000008000080000000000008000000000440000000000000000000000000000000000100000000000000040008020000000400000200000000200000000000800000008000000000000000000000000000000101000000000000000000000000008000000000000000000000000000000000010000810000000000000000000000000000000000000000020002000000000000040000000020100000000000200000000000200000000000000000000000000000000000000000002000000000000000000000000000000800000000000000000000400000090004000000000000008000000001000800000080010000000000000010000" - }, - { - "transactionHash": "0x0d8dc46ad33862e3379182916a1539b58385d98e309f72b63179c594ca783ad0", - "transactionIndex": "0x0", - "blockHash": "0x6d3d3e03ea03bda1127f71bd4c31444568c19e1a65ce6c0f7a9024308a4814d6", - "blockNumber": "0x5b28853", - "from": "0xEAC5F0d4A9a45E1f9FdD0e7e2882e9f60E301156", - "to": "0x444A406C15e6F87Aee894999cb13B4ff1D61a85B", - "cumulativeGasUsed": "0x350dd", - "gasUsed": "0x350dd", - "contractAddress": null, - "logs": [ - { - "address": "0x7F5c764cBc14f9669B88837ca1490cCa17c31607", - "topics": [ - "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef", - "0x000000000000000000000000eac5f0d4a9a45e1f9fdd0e7e2882e9f60e301156", - "0x000000000000000000000000444a406c15e6f87aee894999cb13b4ff1d61a85b" - ], - "data": "0x00000000000000000000000000000000000000000000000000000000000186a0", - "blockHash": "0x6d3d3e03ea03bda1127f71bd4c31444568c19e1a65ce6c0f7a9024308a4814d6", - "blockNumber": "0x5b28853", - "transactionHash": "0x0d8dc46ad33862e3379182916a1539b58385d98e309f72b63179c594ca783ad0", - "transactionIndex": "0x0", - "logIndex": "0x0", - "removed": false - }, - { - "address": "0x7F5c764cBc14f9669B88837ca1490cCa17c31607", - "topics": [ - "0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925", - "0x000000000000000000000000eac5f0d4a9a45e1f9fdd0e7e2882e9f60e301156", - "0x000000000000000000000000444a406c15e6f87aee894999cb13b4ff1d61a85b" - ], - "data": "0x0000000000000000000000000000000000000000000000000000000000000000", - "blockHash": "0x6d3d3e03ea03bda1127f71bd4c31444568c19e1a65ce6c0f7a9024308a4814d6", - "blockNumber": "0x5b28853", - "transactionHash": "0x0d8dc46ad33862e3379182916a1539b58385d98e309f72b63179c594ca783ad0", - "transactionIndex": "0x0", - "logIndex": "0x1", - "removed": false - }, - { - "address": "0x7F5c764cBc14f9669B88837ca1490cCa17c31607", - "topics": [ - "0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925", - "0x000000000000000000000000444a406c15e6f87aee894999cb13b4ff1d61a85b", - "0x0000000000000000000000001111111254760f7ab3f16433eea9304126dcd199" - ], - "data": "0x00000000000000000000000000000000000000000000000000000000000186a0", - "blockHash": "0x6d3d3e03ea03bda1127f71bd4c31444568c19e1a65ce6c0f7a9024308a4814d6", - "blockNumber": "0x5b28853", - "transactionHash": "0x0d8dc46ad33862e3379182916a1539b58385d98e309f72b63179c594ca783ad0", - "transactionIndex": "0x0", - "logIndex": "0x2", - "removed": false - }, - { - "address": "0x7F5c764cBc14f9669B88837ca1490cCa17c31607", - "topics": [ - "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef", - "0x000000000000000000000000444a406c15e6f87aee894999cb13b4ff1d61a85b", - "0x000000000000000000000000f0694acc9e941b176e17b9ef923e71e7b8b2477a" - ], - "data": "0x00000000000000000000000000000000000000000000000000000000000186a0", - "blockHash": "0x6d3d3e03ea03bda1127f71bd4c31444568c19e1a65ce6c0f7a9024308a4814d6", - "blockNumber": "0x5b28853", - "transactionHash": "0x0d8dc46ad33862e3379182916a1539b58385d98e309f72b63179c594ca783ad0", - "transactionIndex": "0x0", - "logIndex": "0x3", - "removed": false - }, - { - "address": "0x7F5c764cBc14f9669B88837ca1490cCa17c31607", - "topics": [ - "0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925", - "0x000000000000000000000000444a406c15e6f87aee894999cb13b4ff1d61a85b", - "0x0000000000000000000000001111111254760f7ab3f16433eea9304126dcd199" - ], - "data": "0x0000000000000000000000000000000000000000000000000000000000000000", - "blockHash": "0x6d3d3e03ea03bda1127f71bd4c31444568c19e1a65ce6c0f7a9024308a4814d6", - "blockNumber": "0x5b28853", - "transactionHash": "0x0d8dc46ad33862e3379182916a1539b58385d98e309f72b63179c594ca783ad0", - "transactionIndex": "0x0", - "logIndex": "0x4", - "removed": false - }, - { - "address": "0x4200000000000000000000000000000000000006", - "topics": [ - "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef", - "0x000000000000000000000000f9d5940c2313636546ab9852354860dce275dbad", - "0x000000000000000000000000f0694acc9e941b176e17b9ef923e71e7b8b2477a" - ], - "data": "0x00000000000000000000000000000000000000000000000000002ff86e060a93", - "blockHash": "0x6d3d3e03ea03bda1127f71bd4c31444568c19e1a65ce6c0f7a9024308a4814d6", - "blockNumber": "0x5b28853", - "transactionHash": "0x0d8dc46ad33862e3379182916a1539b58385d98e309f72b63179c594ca783ad0", - "transactionIndex": "0x0", - "logIndex": "0x5", - "removed": false - }, - { - "address": "0x7F5c764cBc14f9669B88837ca1490cCa17c31607", - "topics": [ - "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef", - "0x000000000000000000000000f0694acc9e941b176e17b9ef923e71e7b8b2477a", - "0x000000000000000000000000f9d5940c2313636546ab9852354860dce275dbad" - ], - "data": "0x00000000000000000000000000000000000000000000000000000000000186a0", - "blockHash": "0x6d3d3e03ea03bda1127f71bd4c31444568c19e1a65ce6c0f7a9024308a4814d6", - "blockNumber": "0x5b28853", - "transactionHash": "0x0d8dc46ad33862e3379182916a1539b58385d98e309f72b63179c594ca783ad0", - "transactionIndex": "0x0", - "logIndex": "0x6", - "removed": false - }, - { - "address": "0xf9D5940c2313636546Ab9852354860dCE275DBaD", - "topics": [ - "0xc42079f94a6350d7e6235f29174924f928cc2ac818eb64fed8004e115fbcca67", - "0x000000000000000000000000f0694acc9e941b176e17b9ef923e71e7b8b2477a", - "0x000000000000000000000000f0694acc9e941b176e17b9ef923e71e7b8b2477a" - ], - "data": "0xffffffffffffffffffffffffffffffffffffffffffffffffffffd00791f9f56d00000000000000000000000000000000000000000000000000000000000186a000000000000000000000000000000000000000000002da61c695cf08e951b8590000000000000000000000000000000000000000000000000000775b02e74881fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffcef6e", - "blockHash": "0x6d3d3e03ea03bda1127f71bd4c31444568c19e1a65ce6c0f7a9024308a4814d6", - "blockNumber": "0x5b28853", - "transactionHash": "0x0d8dc46ad33862e3379182916a1539b58385d98e309f72b63179c594ca783ad0", - "transactionIndex": "0x0", - "logIndex": "0x7", - "removed": false - }, - { - "address": "0x6fd9d7AD17242c41f7131d257212c54A0e816691", - "topics": [ - "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef", - "0x000000000000000000000000ad4c666fc170b468b19988959eb931a3676f0e9f", - "0x0000000000000000000000001111111254760f7ab3f16433eea9304126dcd199" - ], - "data": "0x00000000000000000000000000000000000000000000000000403b699b8e50db", - "blockHash": "0x6d3d3e03ea03bda1127f71bd4c31444568c19e1a65ce6c0f7a9024308a4814d6", - "blockNumber": "0x5b28853", - "transactionHash": "0x0d8dc46ad33862e3379182916a1539b58385d98e309f72b63179c594ca783ad0", - "transactionIndex": "0x0", - "logIndex": "0x8", - "removed": false - }, - { - "address": "0x4200000000000000000000000000000000000006", - "topics": [ - "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef", - "0x000000000000000000000000f0694acc9e941b176e17b9ef923e71e7b8b2477a", - "0x000000000000000000000000ad4c666fc170b468b19988959eb931a3676f0e9f" - ], - "data": "0x00000000000000000000000000000000000000000000000000002ff86e060a93", - "blockHash": "0x6d3d3e03ea03bda1127f71bd4c31444568c19e1a65ce6c0f7a9024308a4814d6", - "blockNumber": "0x5b28853", - "transactionHash": "0x0d8dc46ad33862e3379182916a1539b58385d98e309f72b63179c594ca783ad0", - "transactionIndex": "0x0", - "logIndex": "0x9", - "removed": false - }, - { - "address": "0xAD4c666fC170B468B19988959eb931a3676f0e9F", - "topics": [ - "0xc42079f94a6350d7e6235f29174924f928cc2ac818eb64fed8004e115fbcca67", - "0x000000000000000000000000f0694acc9e941b176e17b9ef923e71e7b8b2477a", - "0x0000000000000000000000001111111254760f7ab3f16433eea9304126dcd199" - ], - "data": "0x00000000000000000000000000000000000000000000000000002ff86e060a93ffffffffffffffffffffffffffffffffffffffffffffffffffbfc4966471af2500000000000000000000000000000000000000128acd0490fea84da8de9e7ce5000000000000000000000000000000000000000000000014da5c0b160a447bb8000000000000000000000000000000000000000000000000000000000000e423", - "blockHash": "0x6d3d3e03ea03bda1127f71bd4c31444568c19e1a65ce6c0f7a9024308a4814d6", - "blockNumber": "0x5b28853", - "transactionHash": "0x0d8dc46ad33862e3379182916a1539b58385d98e309f72b63179c594ca783ad0", - "transactionIndex": "0x0", - "logIndex": "0xa", - "removed": false - }, - { - "address": "0x6fd9d7AD17242c41f7131d257212c54A0e816691", - "topics": [ - "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef", - "0x0000000000000000000000001111111254760f7ab3f16433eea9304126dcd199", - "0x000000000000000000000000eac5f0d4a9a45e1f9fdd0e7e2882e9f60e301156" - ], - "data": "0x00000000000000000000000000000000000000000000000000403b699b8e50db", - "blockHash": "0x6d3d3e03ea03bda1127f71bd4c31444568c19e1a65ce6c0f7a9024308a4814d6", - "blockNumber": "0x5b28853", - "transactionHash": "0x0d8dc46ad33862e3379182916a1539b58385d98e309f72b63179c594ca783ad0", - "transactionIndex": "0x0", - "logIndex": "0xb", - "removed": false - } - ], - "status": "0x1", - "logsBloom": "0x00000000000000000000008000080000000000008000000000440000000000000000000000000000000000100000000000000040008020000000400000200000000200000000000800000008000000000000000001000008000000101000000000000000000000000008000000000000000000000000000000000010000810040000000000000000000000000000000000000020002000000000000040000000020100000000000200000000000200000000000000000000000000000000000000000002000000000000000000000000000000800000000000000000000400000090004000000000000008000000001000800000080010000000000000010000" - } - ], - "libraries": [], - "pending": [], - "path": "", - "returns": {}, - "timestamp": 1682891249, - "chain": 10, - "multi": false, - "commit": "580f0ba" -} diff --git a/broadcast/Benchmark.s.sol/10/run-latest.json b/broadcast/Benchmark.s.sol/10/run-latest.json deleted file mode 100644 index 5934876..0000000 --- a/broadcast/Benchmark.s.sol/10/run-latest.json +++ /dev/null @@ -1,1128 +0,0 @@ -{ - "transactions": [ - { - "hash": "0x348866c854cc363d7aa16f63f8dbc467180c9b42f49d0601760e883e9f34c75b", - "transactionType": "CALL", - "contractName": null, - "contractAddress": "0x7F5c764cBc14f9669B88837ca1490cCa17c31607", - "function": null, - "arguments": null, - "rpc": "", - "transaction": { - "type": "0x00", - "from": "0xeac5f0d4a9a45e1f9fdd0e7e2882e9f60e301156", - "to": "0x7f5c764cbc14f9669b88837ca1490cca17c31607", - "gas": "0x11e41", - "value": "0x0", - "data": "0x095ea7b3000000000000000000000000b17ccee669ab2cc40a6564da84db66dd8d144cb400000000000000000000000000000000000000000000000000000000000186a0", - "nonce": "0x1f" - }, - "additionalContracts": [], - "isFixedGasLimit": false - }, - { - "hash": "0x922fbc3c0c94e49f79c5bd2483f9d2be8644150654bc6b6b677f4debe097c6f7", - "transactionType": "CALL", - "contractName": null, - "contractAddress": "0x7F5c764cBc14f9669B88837ca1490cCa17c31607", - "function": null, - "arguments": null, - "rpc": "", - "transaction": { - "type": "0x00", - "from": "0xeac5f0d4a9a45e1f9fdd0e7e2882e9f60e301156", - "to": "0x7f5c764cbc14f9669b88837ca1490cca17c31607", - "gas": "0xbd68", - "value": "0x0", - "data": "0x095ea7b30000000000000000000000001111111254eeb25477b68fb85ed929f73a96058200000000000000000000000000000000000000000000000000000000000186a0", - "nonce": "0x20" - }, - "additionalContracts": [], - "isFixedGasLimit": false - }, - { - "hash": "0x0d1fbde82bd92ed22f1cd21788c5b734f7caa8b3523b0dba63cb65c1fd2cca4f", - "transactionType": "CALL", - "contractName": null, - "contractAddress": "0x1111111254EEB25477B68fb85Ed929f73A960582", - "function": null, - "arguments": null, - "rpc": "", - "transaction": { - "type": "0x00", - "from": "0xeac5f0d4a9a45e1f9fdd0e7e2882e9f60e301156", - "to": "0x1111111254eeb25477b68fb85ed929f73a960582", - "gas": "0x67bb8", - "value": "0x0", - "data": "0x12aa3caf000000000000000000000000f0694acc9e941b176e17b9ef923e71e7b8b2477a0000000000000000000000007f5c764cbc14f9669b88837ca1490cca17c316070000000000000000000000006fd9d7ad17242c41f7131d257212c54a0e816691000000000000000000000000f0694acc9e941b176e17b9ef923e71e7b8b2477a000000000000000000000000eac5f0d4a9a45e1f9fdd0e7e2882e9f60e30115600000000000000000000000000000000000000000000000000000000000186a0000000000000000000000000000000000000000000000000003e530a0ee30f45000000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000001400000000000000000000000000000000000000000000000000000000000000160000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001f50000000000000000000000000000000000000000000000000000000001d700a007e5c0d20000000000000000000000000000000000000000000000000001b30001505126a132dab612db5cb9fc9ac426a0cc215a3423f9c97f5c764cbc14f9669b88837ca1490cca17c316070004f41766d8000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002e2669c6242f00000000000000000000000000000000000000000000000000000000000000a0000000000000000000000000f0694acc9e941b176e17b9ef923e71e7b8b2477a00000000000000000000000000000000000000000000000000000000644fdfe900000000000000000000000000000000000000000000000000000000000000010000000000000000000000007f5c764cbc14f9669b88837ca1490cca17c316070000000000000000000000004200000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000102a0000000000000000000000000000000000000000000000000003e530a0ee30f45ee63c1e581ad4c666fc170b468b19988959eb931a3676f0e9f42000000000000000000000000000000000000061111111254eeb25477b68fb85ed929f73a9605820000000000000000000000", - "nonce": "0x21" - }, - "additionalContracts": [], - "isFixedGasLimit": false - }, - { - "hash": "0xe7bfb6d05f570a42721bb6168e20a3d23bd38bcdd9d14b19740af210f2382b13", - "transactionType": "CALL", - "contractName": null, - "contractAddress": "0xB17cCEE669aB2cc40A6564DA84Db66dD8D144CB4", - "function": null, - "arguments": null, - "rpc": "", - "transaction": { - "type": "0x00", - "from": "0xeac5f0d4a9a45e1f9fdd0e7e2882e9f60e301156", - "to": "0xb17ccee669ab2cc40a6564da84db66dd8d144cb4", - "gas": "0x68a35", - "value": "0x0", - "data": "0x0000000000000000000000006fd9d7ad17242c41f7131d257212c54a0e81669100000000000000000000000000000000000000000000000000000000000186a0000000000000000000000000000000000000000000000000003e530a0ee30f4500000000000000000000000000000000000000000000000000000000000000a0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001f50000000000000000000000000000000000000000000000000000000001d700a007e5c0d20000000000000000000000000000000000000000000000000001b30001505126a132dab612db5cb9fc9ac426a0cc215a3423f9c97f5c764cbc14f9669b88837ca1490cca17c316070004f41766d8000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002e2669c6242f00000000000000000000000000000000000000000000000000000000000000a0000000000000000000000000f0694acc9e941b176e17b9ef923e71e7b8b2477a00000000000000000000000000000000000000000000000000000000644fdfe900000000000000000000000000000000000000000000000000000000000000010000000000000000000000007f5c764cbc14f9669b88837ca1490cca17c316070000000000000000000000004200000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000102a0000000000000000000000000000000000000000000000000003e530a0ee30f45ee63c1e581ad4c666fc170b468b19988959eb931a3676f0e9f42000000000000000000000000000000000000061111111254eeb25477b68fb85ed929f73a9605820000000000000000000000", - "nonce": "0x22" - }, - "additionalContracts": [], - "isFixedGasLimit": false - }, - { - "hash": "0x71f79f21650241187d3e637351677f73d2fee7591f2600ecc768226d7d9a3178", - "transactionType": "CALL", - "contractName": null, - "contractAddress": "0x7F5c764cBc14f9669B88837ca1490cCa17c31607", - "function": null, - "arguments": null, - "rpc": "", - "transaction": { - "type": "0x00", - "from": "0xeac5f0d4a9a45e1f9fdd0e7e2882e9f60e301156", - "to": "0x7f5c764cbc14f9669b88837ca1490cca17c31607", - "gas": "0x11e41", - "value": "0x0", - "data": "0x095ea7b3000000000000000000000000444a406c15e6f87aee894999cb13b4ff1d61a85b00000000000000000000000000000000000000000000000000000000000186a0", - "nonce": "0x23" - }, - "additionalContracts": [], - "isFixedGasLimit": false - }, - { - "hash": "0x179019d502a67838533b07634ad619d39514b55a10599b250f80c5cb219ab04e", - "transactionType": "CALL", - "contractName": null, - "contractAddress": "0x7F5c764cBc14f9669B88837ca1490cCa17c31607", - "function": null, - "arguments": null, - "rpc": "", - "transaction": { - "type": "0x00", - "from": "0xeac5f0d4a9a45e1f9fdd0e7e2882e9f60e301156", - "to": "0x7f5c764cbc14f9669b88837ca1490cca17c31607", - "gas": "0xbd68", - "value": "0x0", - "data": "0x095ea7b30000000000000000000000001111111254760f7ab3f16433eea9304126dcd19900000000000000000000000000000000000000000000000000000000000186a0", - "nonce": "0x24" - }, - "additionalContracts": [], - "isFixedGasLimit": false - }, - { - "hash": "0x5445be7f53975a21d639f41e3e607903bc47ab5f1c87c2005c657dbf0efafe48", - "transactionType": "CALL", - "contractName": null, - "contractAddress": "0x1111111254760F7ab3F16433eea9304126DCd199", - "function": null, - "arguments": null, - "rpc": "", - "transaction": { - "type": "0x00", - "from": "0xeac5f0d4a9a45e1f9fdd0e7e2882e9f60e301156", - "to": "0x1111111254760f7ab3f16433eea9304126dcd199", - "gas": "0x41e7f", - "value": "0x0", - "data": "0x7c025200000000000000000000000000f0694acc9e941b176e17b9ef923e71e7b8b2477a000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000001800000000000000000000000007f5c764cbc14f9669b88837ca1490cca17c316070000000000000000000000006fd9d7ad17242c41f7131d257212c54a0e816691000000000000000000000000f0694acc9e941b176e17b9ef923e71e7b8b2477a000000000000000000000000eac5f0d4a9a45e1f9fdd0e7e2882e9f60e30115600000000000000000000000000000000000000000000000000000000000186a0000000000000000000000000000000000000000000000000003e1aba8fed6bc100000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001e10000000000000000000000000000000000000000000000000000000001a300a007e5c0d200000000000000000000000000000000000000000000000000017f00011c4330f9d5940c2313636546ab9852354860dce275dbad00000000000000000000000000000000000000000000000000002ecaf7212e2f002424b31a0c000000000000000000000000f0694acc9e941b176e17b9ef923e71e7b8b2477a00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000fffd8963efd1fc6a506488495d951d5263988d2500000000000000000000000000000000000000000000000000000000000000a000000000000000000000000000000000000000000000000000000000000000200000000000000000000000007f5c764cbc14f9669b88837ca1490cca17c3160702a0000000000000000000000000000000000000000000000000003e1aba8fed6bc1ee63c1e581ad4c666fc170b468b19988959eb931a3676f0e9f42000000000000000000000000000000000000061111111254760f7ab3f16433eea9304126dcd19900000000000000000000000000000000000000000000000000000000000186a000000000000000000000000000000000000000000000000000000000000000", - "nonce": "0x25" - }, - "additionalContracts": [], - "isFixedGasLimit": false - }, - { - "hash": "0x0d8dc46ad33862e3379182916a1539b58385d98e309f72b63179c594ca783ad0", - "transactionType": "CALL", - "contractName": null, - "contractAddress": "0x444A406C15e6F87Aee894999cb13B4ff1D61a85B", - "function": null, - "arguments": null, - "rpc": "", - "transaction": { - "type": "0x00", - "from": "0xeac5f0d4a9a45e1f9fdd0e7e2882e9f60e301156", - "to": "0x444a406c15e6f87aee894999cb13b4ff1d61a85b", - "gas": "0x4d893", - "value": "0x0", - "data": "0x0000000000000000000000006fd9d7ad17242c41f7131d257212c54a0e81669100000000000000000000000000000000000000000000000000000000000186a0000000000000000000000000000000000000000000000000003e1aba8fed6bc100000000000000000000000000000000000000000000000000000000000000a0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001e10000000000000000000000000000000000000000000000000000000001a300a007e5c0d200000000000000000000000000000000000000000000000000017f00011c4330f9d5940c2313636546ab9852354860dce275dbad00000000000000000000000000000000000000000000000000002ecaf7212e2f002424b31a0c000000000000000000000000f0694acc9e941b176e17b9ef923e71e7b8b2477a00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000fffd8963efd1fc6a506488495d951d5263988d2500000000000000000000000000000000000000000000000000000000000000a000000000000000000000000000000000000000000000000000000000000000200000000000000000000000007f5c764cbc14f9669b88837ca1490cca17c3160702a0000000000000000000000000000000000000000000000000003e1aba8fed6bc1ee63c1e581ad4c666fc170b468b19988959eb931a3676f0e9f42000000000000000000000000000000000000061111111254760f7ab3f16433eea9304126dcd19900000000000000000000000000000000000000000000000000000000000186a000000000000000000000000000000000000000000000000000000000000000", - "nonce": "0x26" - }, - "additionalContracts": [], - "isFixedGasLimit": false - } - ], - "receipts": [ - { - "transactionHash": "0x348866c854cc363d7aa16f63f8dbc467180c9b42f49d0601760e883e9f34c75b", - "transactionIndex": "0x0", - "blockHash": "0x9a259c5bfb1e00100a957619cbe9e496e05a3f84ea5a705ed9743237c49058e7", - "blockNumber": "0x5b287f3", - "from": "0xEAC5F0d4A9a45E1f9FdD0e7e2882e9f60E301156", - "to": "0x7F5c764cBc14f9669B88837ca1490cCa17c31607", - "cumulativeGasUsed": "0xcf3f", - "gasUsed": "0xcf3f", - "contractAddress": null, - "logs": [ - { - "address": "0x7F5c764cBc14f9669B88837ca1490cCa17c31607", - "topics": [ - "0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925", - "0x000000000000000000000000eac5f0d4a9a45e1f9fdd0e7e2882e9f60e301156", - "0x000000000000000000000000b17ccee669ab2cc40a6564da84db66dd8d144cb4" - ], - "data": "0x00000000000000000000000000000000000000000000000000000000000186a0", - "blockHash": "0x9a259c5bfb1e00100a957619cbe9e496e05a3f84ea5a705ed9743237c49058e7", - "blockNumber": "0x5b287f3", - "transactionHash": "0x348866c854cc363d7aa16f63f8dbc467180c9b42f49d0601760e883e9f34c75b", - "transactionIndex": "0x0", - "logIndex": "0x0", - "removed": false - } - ], - "status": "0x1", - "logsBloom": "0x00000000000000000000008000000000000000000000000000000000000000000000000000000000000040000000000000000040000000000000000000200000000000000000000000800000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000200000000000000000000000040000000020000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000800000000000000000000000010000" - }, - { - "transactionHash": "0x922fbc3c0c94e49f79c5bd2483f9d2be8644150654bc6b6b677f4debe097c6f7", - "transactionIndex": "0x0", - "blockHash": "0xe1ecbe29525ebdfe584d37b4d8930c701264f1ff8b15669d75ee919f6c76fad7", - "blockNumber": "0x5b287ff", - "from": "0xEAC5F0d4A9a45E1f9FdD0e7e2882e9f60E301156", - "to": "0x7F5c764cBc14f9669B88837ca1490cCa17c31607", - "cumulativeGasUsed": "0x8183", - "gasUsed": "0x8183", - "contractAddress": null, - "logs": [ - { - "address": "0x7F5c764cBc14f9669B88837ca1490cCa17c31607", - "topics": [ - "0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925", - "0x000000000000000000000000eac5f0d4a9a45e1f9fdd0e7e2882e9f60e301156", - "0x0000000000000000000000001111111254eeb25477b68fb85ed929f73a960582" - ], - "data": "0x00000000000000000000000000000000000000000000000000000000000186a0", - "blockHash": "0xe1ecbe29525ebdfe584d37b4d8930c701264f1ff8b15669d75ee919f6c76fad7", - "blockNumber": "0x5b287ff", - "transactionHash": "0x922fbc3c0c94e49f79c5bd2483f9d2be8644150654bc6b6b677f4debe097c6f7", - "transactionIndex": "0x0", - "logIndex": "0x0", - "removed": false - } - ], - "status": "0x1", - "logsBloom": "0x00000000000000000000008000000000000000000000000000000000000000000000000000000000000000000000000000000040000000000000000000200000000000000000080000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000040000000020000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010000000000000000400000000000000800000000000000000000000010000" - }, - { - "transactionHash": "0x0d1fbde82bd92ed22f1cd21788c5b734f7caa8b3523b0dba63cb65c1fd2cca4f", - "transactionIndex": "0x0", - "blockHash": "0x75dc10b02430f6ab2e7a19748dea56351e6b1a705d8f75142477f491b250ebae", - "blockNumber": "0x5b2880f", - "from": "0xEAC5F0d4A9a45E1f9FdD0e7e2882e9f60E301156", - "to": "0x1111111254EEB25477B68fb85Ed929f73A960582", - "cumulativeGasUsed": "0x46eda", - "gasUsed": "0x46eda", - "contractAddress": null, - "logs": [ - { - "address": "0x7F5c764cBc14f9669B88837ca1490cCa17c31607", - "topics": [ - "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef", - "0x000000000000000000000000eac5f0d4a9a45e1f9fdd0e7e2882e9f60e301156", - "0x000000000000000000000000f0694acc9e941b176e17b9ef923e71e7b8b2477a" - ], - "data": "0x00000000000000000000000000000000000000000000000000000000000186a0", - "blockHash": "0x75dc10b02430f6ab2e7a19748dea56351e6b1a705d8f75142477f491b250ebae", - "blockNumber": "0x5b2880f", - "transactionHash": "0x0d1fbde82bd92ed22f1cd21788c5b734f7caa8b3523b0dba63cb65c1fd2cca4f", - "transactionIndex": "0x0", - "logIndex": "0x0", - "removed": false - }, - { - "address": "0x7F5c764cBc14f9669B88837ca1490cCa17c31607", - "topics": [ - "0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925", - "0x000000000000000000000000eac5f0d4a9a45e1f9fdd0e7e2882e9f60e301156", - "0x0000000000000000000000001111111254eeb25477b68fb85ed929f73a960582" - ], - "data": "0x0000000000000000000000000000000000000000000000000000000000000000", - "blockHash": "0x75dc10b02430f6ab2e7a19748dea56351e6b1a705d8f75142477f491b250ebae", - "blockNumber": "0x5b2880f", - "transactionHash": "0x0d1fbde82bd92ed22f1cd21788c5b734f7caa8b3523b0dba63cb65c1fd2cca4f", - "transactionIndex": "0x0", - "logIndex": "0x1", - "removed": false - }, - { - "address": "0x7F5c764cBc14f9669B88837ca1490cCa17c31607", - "topics": [ - "0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925", - "0x000000000000000000000000f0694acc9e941b176e17b9ef923e71e7b8b2477a", - "0x000000000000000000000000a132dab612db5cb9fc9ac426a0cc215a3423f9c9" - ], - "data": "0x00000000000000000000000000000000000000000000000000000000000186a0", - "blockHash": "0x75dc10b02430f6ab2e7a19748dea56351e6b1a705d8f75142477f491b250ebae", - "blockNumber": "0x5b2880f", - "transactionHash": "0x0d1fbde82bd92ed22f1cd21788c5b734f7caa8b3523b0dba63cb65c1fd2cca4f", - "transactionIndex": "0x0", - "logIndex": "0x2", - "removed": false - }, - { - "address": "0x7F5c764cBc14f9669B88837ca1490cCa17c31607", - "topics": [ - "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef", - "0x000000000000000000000000f0694acc9e941b176e17b9ef923e71e7b8b2477a", - "0x00000000000000000000000048e18e3d1efa7f0e15f1b2bf01b232534c30a3ef" - ], - "data": "0x00000000000000000000000000000000000000000000000000000000000186a0", - "blockHash": "0x75dc10b02430f6ab2e7a19748dea56351e6b1a705d8f75142477f491b250ebae", - "blockNumber": "0x5b2880f", - "transactionHash": "0x0d1fbde82bd92ed22f1cd21788c5b734f7caa8b3523b0dba63cb65c1fd2cca4f", - "transactionIndex": "0x0", - "logIndex": "0x3", - "removed": false - }, - { - "address": "0x7F5c764cBc14f9669B88837ca1490cCa17c31607", - "topics": [ - "0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925", - "0x000000000000000000000000f0694acc9e941b176e17b9ef923e71e7b8b2477a", - "0x000000000000000000000000a132dab612db5cb9fc9ac426a0cc215a3423f9c9" - ], - "data": "0x0000000000000000000000000000000000000000000000000000000000000000", - "blockHash": "0x75dc10b02430f6ab2e7a19748dea56351e6b1a705d8f75142477f491b250ebae", - "blockNumber": "0x5b2880f", - "transactionHash": "0x0d1fbde82bd92ed22f1cd21788c5b734f7caa8b3523b0dba63cb65c1fd2cca4f", - "transactionIndex": "0x0", - "logIndex": "0x4", - "removed": false - }, - { - "address": "0x4200000000000000000000000000000000000006", - "topics": [ - "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef", - "0x00000000000000000000000048e18e3d1efa7f0e15f1b2bf01b232534c30a3ef", - "0x000000000000000000000000f0694acc9e941b176e17b9ef923e71e7b8b2477a" - ], - "data": "0x00000000000000000000000000000000000000000000000000002ff6128b1096", - "blockHash": "0x75dc10b02430f6ab2e7a19748dea56351e6b1a705d8f75142477f491b250ebae", - "blockNumber": "0x5b2880f", - "transactionHash": "0x0d1fbde82bd92ed22f1cd21788c5b734f7caa8b3523b0dba63cb65c1fd2cca4f", - "transactionIndex": "0x0", - "logIndex": "0x5", - "removed": false - }, - { - "address": "0x7F5c764cBc14f9669B88837ca1490cCa17c31607", - "topics": [ - "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef", - "0x00000000000000000000000048e18e3d1efa7f0e15f1b2bf01b232534c30a3ef", - "0x000000000000000000000000d5b6cfc309fd839fb33b826d8501ec90e6d9f45c" - ], - "data": "0x0000000000000000000000000000000000000000000000000000000000000032", - "blockHash": "0x75dc10b02430f6ab2e7a19748dea56351e6b1a705d8f75142477f491b250ebae", - "blockNumber": "0x5b2880f", - "transactionHash": "0x0d1fbde82bd92ed22f1cd21788c5b734f7caa8b3523b0dba63cb65c1fd2cca4f", - "transactionIndex": "0x0", - "logIndex": "0x6", - "removed": false - }, - { - "address": "0x48e18E3d1eFA7F0E15F1b2Bf01b232534c30a3EF", - "topics": [ - "0x112c256902bf554b6ed882d2936687aaeb4225e8cd5b51303c90ca6cf43a8602", - "0x000000000000000000000000a132dab612db5cb9fc9ac426a0cc215a3423f9c9" - ], - "data": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000032", - "blockHash": "0x75dc10b02430f6ab2e7a19748dea56351e6b1a705d8f75142477f491b250ebae", - "blockNumber": "0x5b2880f", - "transactionHash": "0x0d1fbde82bd92ed22f1cd21788c5b734f7caa8b3523b0dba63cb65c1fd2cca4f", - "transactionIndex": "0x0", - "logIndex": "0x7", - "removed": false - }, - { - "address": "0x48e18E3d1eFA7F0E15F1b2Bf01b232534c30a3EF", - "topics": [ - "0xcf2aa50876cdfbb541206f89af0ee78d44a2abf8d328e37fa4917f982149848a" - ], - "data": "0x00000000000000000000000000000000000000000000000007e321af0bc01ed400000000000000000000000000000000000000000000000000000000c0a170f8", - "blockHash": "0x75dc10b02430f6ab2e7a19748dea56351e6b1a705d8f75142477f491b250ebae", - "blockNumber": "0x5b2880f", - "transactionHash": "0x0d1fbde82bd92ed22f1cd21788c5b734f7caa8b3523b0dba63cb65c1fd2cca4f", - "transactionIndex": "0x0", - "logIndex": "0x8", - "removed": false - }, - { - "address": "0x48e18E3d1eFA7F0E15F1b2Bf01b232534c30a3EF", - "topics": [ - "0xd78ad95fa46c994b6551d0da85fc275fe613ce37657fb8d5e3d130840159d822", - "0x000000000000000000000000a132dab612db5cb9fc9ac426a0cc215a3423f9c9", - "0x000000000000000000000000f0694acc9e941b176e17b9ef923e71e7b8b2477a" - ], - "data": "0x000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000186a000000000000000000000000000000000000000000000000000002ff6128b10960000000000000000000000000000000000000000000000000000000000000000", - "blockHash": "0x75dc10b02430f6ab2e7a19748dea56351e6b1a705d8f75142477f491b250ebae", - "blockNumber": "0x5b2880f", - "transactionHash": "0x0d1fbde82bd92ed22f1cd21788c5b734f7caa8b3523b0dba63cb65c1fd2cca4f", - "transactionIndex": "0x0", - "logIndex": "0x9", - "removed": false - }, - { - "address": "0x6fd9d7AD17242c41f7131d257212c54A0e816691", - "topics": [ - "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef", - "0x000000000000000000000000ad4c666fc170b468b19988959eb931a3676f0e9f", - "0x0000000000000000000000001111111254eeb25477b68fb85ed929f73a960582" - ], - "data": "0x000000000000000000000000000000000000000000000000004038818da9a205", - "blockHash": "0x75dc10b02430f6ab2e7a19748dea56351e6b1a705d8f75142477f491b250ebae", - "blockNumber": "0x5b2880f", - "transactionHash": "0x0d1fbde82bd92ed22f1cd21788c5b734f7caa8b3523b0dba63cb65c1fd2cca4f", - "transactionIndex": "0x0", - "logIndex": "0xa", - "removed": false - }, - { - "address": "0x4200000000000000000000000000000000000006", - "topics": [ - "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef", - "0x000000000000000000000000f0694acc9e941b176e17b9ef923e71e7b8b2477a", - "0x000000000000000000000000ad4c666fc170b468b19988959eb931a3676f0e9f" - ], - "data": "0x00000000000000000000000000000000000000000000000000002ff6128b1096", - "blockHash": "0x75dc10b02430f6ab2e7a19748dea56351e6b1a705d8f75142477f491b250ebae", - "blockNumber": "0x5b2880f", - "transactionHash": "0x0d1fbde82bd92ed22f1cd21788c5b734f7caa8b3523b0dba63cb65c1fd2cca4f", - "transactionIndex": "0x0", - "logIndex": "0xb", - "removed": false - }, - { - "address": "0xAD4c666fC170B468B19988959eb931a3676f0e9F", - "topics": [ - "0xc42079f94a6350d7e6235f29174924f928cc2ac818eb64fed8004e115fbcca67", - "0x000000000000000000000000f0694acc9e941b176e17b9ef923e71e7b8b2477a", - "0x0000000000000000000000001111111254eeb25477b68fb85ed929f73a960582" - ], - "data": "0x00000000000000000000000000000000000000000000000000002ff6128b1096ffffffffffffffffffffffffffffffffffffffffffffffffffbfc77e72565dfb00000000000000000000000000000000000000128ad641fa7eee7279f2ce0f01000000000000000000000000000000000000000000000014da5c0b160a447bb8000000000000000000000000000000000000000000000000000000000000e424", - "blockHash": "0x75dc10b02430f6ab2e7a19748dea56351e6b1a705d8f75142477f491b250ebae", - "blockNumber": "0x5b2880f", - "transactionHash": "0x0d1fbde82bd92ed22f1cd21788c5b734f7caa8b3523b0dba63cb65c1fd2cca4f", - "transactionIndex": "0x0", - "logIndex": "0xc", - "removed": false - }, - { - "address": "0x6fd9d7AD17242c41f7131d257212c54A0e816691", - "topics": [ - "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef", - "0x0000000000000000000000001111111254eeb25477b68fb85ed929f73a960582", - "0x000000000000000000000000eac5f0d4a9a45e1f9fdd0e7e2882e9f60e301156" - ], - "data": "0x000000000000000000000000000000000000000000000000004038818da9a205", - "blockHash": "0x75dc10b02430f6ab2e7a19748dea56351e6b1a705d8f75142477f491b250ebae", - "blockNumber": "0x5b2880f", - "transactionHash": "0x0d1fbde82bd92ed22f1cd21788c5b734f7caa8b3523b0dba63cb65c1fd2cca4f", - "transactionIndex": "0x0", - "logIndex": "0xd", - "removed": false - } - ], - "status": "0x1", - "logsBloom": "0x00200000000000000000008000080000000000000000000000440000000000000004000000000000000000500000000000000040008020000010000000200000000200000000080800000008000000200020000000000000000000101000000000000000000400000008000000000000010000000000000000000010000800000000000000000000000002000000000000001000002000000000004040000000020000000000000000000000080204010000000000000000000000000000000000000002000000000000000400000000000000800000020020080000000400000010004000000000000400000020011000810000000010000000100000010000" - }, - { - "transactionHash": "0xe7bfb6d05f570a42721bb6168e20a3d23bd38bcdd9d14b19740af210f2382b13", - "transactionIndex": "0x0", - "blockHash": "0x8285656676e8f3a63a32f65fb6f729bd19bfc37a6da2ae05bed156d7088994fc", - "blockNumber": "0x5b28822", - "from": "0xEAC5F0d4A9a45E1f9FdD0e7e2882e9f60E301156", - "to": "0xB17cCEE669aB2cc40A6564DA84Db66dD8D144CB4", - "cumulativeGasUsed": "0x4a2c7", - "gasUsed": "0x4a2c7", - "contractAddress": null, - "logs": [ - { - "address": "0x7F5c764cBc14f9669B88837ca1490cCa17c31607", - "topics": [ - "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef", - "0x000000000000000000000000eac5f0d4a9a45e1f9fdd0e7e2882e9f60e301156", - "0x000000000000000000000000b17ccee669ab2cc40a6564da84db66dd8d144cb4" - ], - "data": "0x00000000000000000000000000000000000000000000000000000000000186a0", - "blockHash": "0x8285656676e8f3a63a32f65fb6f729bd19bfc37a6da2ae05bed156d7088994fc", - "blockNumber": "0x5b28822", - "transactionHash": "0xe7bfb6d05f570a42721bb6168e20a3d23bd38bcdd9d14b19740af210f2382b13", - "transactionIndex": "0x0", - "logIndex": "0x0", - "removed": false - }, - { - "address": "0x7F5c764cBc14f9669B88837ca1490cCa17c31607", - "topics": [ - "0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925", - "0x000000000000000000000000eac5f0d4a9a45e1f9fdd0e7e2882e9f60e301156", - "0x000000000000000000000000b17ccee669ab2cc40a6564da84db66dd8d144cb4" - ], - "data": "0x0000000000000000000000000000000000000000000000000000000000000000", - "blockHash": "0x8285656676e8f3a63a32f65fb6f729bd19bfc37a6da2ae05bed156d7088994fc", - "blockNumber": "0x5b28822", - "transactionHash": "0xe7bfb6d05f570a42721bb6168e20a3d23bd38bcdd9d14b19740af210f2382b13", - "transactionIndex": "0x0", - "logIndex": "0x1", - "removed": false - }, - { - "address": "0x7F5c764cBc14f9669B88837ca1490cCa17c31607", - "topics": [ - "0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925", - "0x000000000000000000000000b17ccee669ab2cc40a6564da84db66dd8d144cb4", - "0x0000000000000000000000001111111254eeb25477b68fb85ed929f73a960582" - ], - "data": "0x00000000000000000000000000000000000000000000000000000000000186a0", - "blockHash": "0x8285656676e8f3a63a32f65fb6f729bd19bfc37a6da2ae05bed156d7088994fc", - "blockNumber": "0x5b28822", - "transactionHash": "0xe7bfb6d05f570a42721bb6168e20a3d23bd38bcdd9d14b19740af210f2382b13", - "transactionIndex": "0x0", - "logIndex": "0x2", - "removed": false - }, - { - "address": "0x7F5c764cBc14f9669B88837ca1490cCa17c31607", - "topics": [ - "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef", - "0x000000000000000000000000b17ccee669ab2cc40a6564da84db66dd8d144cb4", - "0x000000000000000000000000f0694acc9e941b176e17b9ef923e71e7b8b2477a" - ], - "data": "0x00000000000000000000000000000000000000000000000000000000000186a0", - "blockHash": "0x8285656676e8f3a63a32f65fb6f729bd19bfc37a6da2ae05bed156d7088994fc", - "blockNumber": "0x5b28822", - "transactionHash": "0xe7bfb6d05f570a42721bb6168e20a3d23bd38bcdd9d14b19740af210f2382b13", - "transactionIndex": "0x0", - "logIndex": "0x3", - "removed": false - }, - { - "address": "0x7F5c764cBc14f9669B88837ca1490cCa17c31607", - "topics": [ - "0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925", - "0x000000000000000000000000b17ccee669ab2cc40a6564da84db66dd8d144cb4", - "0x0000000000000000000000001111111254eeb25477b68fb85ed929f73a960582" - ], - "data": "0x0000000000000000000000000000000000000000000000000000000000000000", - "blockHash": "0x8285656676e8f3a63a32f65fb6f729bd19bfc37a6da2ae05bed156d7088994fc", - "blockNumber": "0x5b28822", - "transactionHash": "0xe7bfb6d05f570a42721bb6168e20a3d23bd38bcdd9d14b19740af210f2382b13", - "transactionIndex": "0x0", - "logIndex": "0x4", - "removed": false - }, - { - "address": "0x7F5c764cBc14f9669B88837ca1490cCa17c31607", - "topics": [ - "0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925", - "0x000000000000000000000000f0694acc9e941b176e17b9ef923e71e7b8b2477a", - "0x000000000000000000000000a132dab612db5cb9fc9ac426a0cc215a3423f9c9" - ], - "data": "0x00000000000000000000000000000000000000000000000000000000000186a0", - "blockHash": "0x8285656676e8f3a63a32f65fb6f729bd19bfc37a6da2ae05bed156d7088994fc", - "blockNumber": "0x5b28822", - "transactionHash": "0xe7bfb6d05f570a42721bb6168e20a3d23bd38bcdd9d14b19740af210f2382b13", - "transactionIndex": "0x0", - "logIndex": "0x5", - "removed": false - }, - { - "address": "0x7F5c764cBc14f9669B88837ca1490cCa17c31607", - "topics": [ - "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef", - "0x000000000000000000000000f0694acc9e941b176e17b9ef923e71e7b8b2477a", - "0x00000000000000000000000048e18e3d1efa7f0e15f1b2bf01b232534c30a3ef" - ], - "data": "0x00000000000000000000000000000000000000000000000000000000000186a0", - "blockHash": "0x8285656676e8f3a63a32f65fb6f729bd19bfc37a6da2ae05bed156d7088994fc", - "blockNumber": "0x5b28822", - "transactionHash": "0xe7bfb6d05f570a42721bb6168e20a3d23bd38bcdd9d14b19740af210f2382b13", - "transactionIndex": "0x0", - "logIndex": "0x6", - "removed": false - }, - { - "address": "0x7F5c764cBc14f9669B88837ca1490cCa17c31607", - "topics": [ - "0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925", - "0x000000000000000000000000f0694acc9e941b176e17b9ef923e71e7b8b2477a", - "0x000000000000000000000000a132dab612db5cb9fc9ac426a0cc215a3423f9c9" - ], - "data": "0x0000000000000000000000000000000000000000000000000000000000000000", - "blockHash": "0x8285656676e8f3a63a32f65fb6f729bd19bfc37a6da2ae05bed156d7088994fc", - "blockNumber": "0x5b28822", - "transactionHash": "0xe7bfb6d05f570a42721bb6168e20a3d23bd38bcdd9d14b19740af210f2382b13", - "transactionIndex": "0x0", - "logIndex": "0x7", - "removed": false - }, - { - "address": "0x4200000000000000000000000000000000000006", - "topics": [ - "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef", - "0x00000000000000000000000048e18e3d1efa7f0e15f1b2bf01b232534c30a3ef", - "0x000000000000000000000000f0694acc9e941b176e17b9ef923e71e7b8b2477a" - ], - "data": "0x00000000000000000000000000000000000000000000000000002ff48dbaf1bd", - "blockHash": "0x8285656676e8f3a63a32f65fb6f729bd19bfc37a6da2ae05bed156d7088994fc", - "blockNumber": "0x5b28822", - "transactionHash": "0xe7bfb6d05f570a42721bb6168e20a3d23bd38bcdd9d14b19740af210f2382b13", - "transactionIndex": "0x0", - "logIndex": "0x8", - "removed": false - }, - { - "address": "0x7F5c764cBc14f9669B88837ca1490cCa17c31607", - "topics": [ - "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef", - "0x00000000000000000000000048e18e3d1efa7f0e15f1b2bf01b232534c30a3ef", - "0x000000000000000000000000d5b6cfc309fd839fb33b826d8501ec90e6d9f45c" - ], - "data": "0x0000000000000000000000000000000000000000000000000000000000000032", - "blockHash": "0x8285656676e8f3a63a32f65fb6f729bd19bfc37a6da2ae05bed156d7088994fc", - "blockNumber": "0x5b28822", - "transactionHash": "0xe7bfb6d05f570a42721bb6168e20a3d23bd38bcdd9d14b19740af210f2382b13", - "transactionIndex": "0x0", - "logIndex": "0x9", - "removed": false - }, - { - "address": "0x48e18E3d1eFA7F0E15F1b2Bf01b232534c30a3EF", - "topics": [ - "0x112c256902bf554b6ed882d2936687aaeb4225e8cd5b51303c90ca6cf43a8602", - "0x000000000000000000000000a132dab612db5cb9fc9ac426a0cc215a3423f9c9" - ], - "data": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000032", - "blockHash": "0x8285656676e8f3a63a32f65fb6f729bd19bfc37a6da2ae05bed156d7088994fc", - "blockNumber": "0x5b28822", - "transactionHash": "0xe7bfb6d05f570a42721bb6168e20a3d23bd38bcdd9d14b19740af210f2382b13", - "transactionIndex": "0x0", - "logIndex": "0xa", - "removed": false - }, - { - "address": "0x48e18E3d1eFA7F0E15F1b2Bf01b232534c30a3EF", - "topics": [ - "0xcf2aa50876cdfbb541206f89af0ee78d44a2abf8d328e37fa4917f982149848a" - ], - "data": "0x00000000000000000000000000000000000000000000000007e2f1ba7e052d1700000000000000000000000000000000000000000000000000000000c0a2f766", - "blockHash": "0x8285656676e8f3a63a32f65fb6f729bd19bfc37a6da2ae05bed156d7088994fc", - "blockNumber": "0x5b28822", - "transactionHash": "0xe7bfb6d05f570a42721bb6168e20a3d23bd38bcdd9d14b19740af210f2382b13", - "transactionIndex": "0x0", - "logIndex": "0xb", - "removed": false - }, - { - "address": "0x48e18E3d1eFA7F0E15F1b2Bf01b232534c30a3EF", - "topics": [ - "0xd78ad95fa46c994b6551d0da85fc275fe613ce37657fb8d5e3d130840159d822", - "0x000000000000000000000000a132dab612db5cb9fc9ac426a0cc215a3423f9c9", - "0x000000000000000000000000f0694acc9e941b176e17b9ef923e71e7b8b2477a" - ], - "data": "0x000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000186a000000000000000000000000000000000000000000000000000002ff48dbaf1bd0000000000000000000000000000000000000000000000000000000000000000", - "blockHash": "0x8285656676e8f3a63a32f65fb6f729bd19bfc37a6da2ae05bed156d7088994fc", - "blockNumber": "0x5b28822", - "transactionHash": "0xe7bfb6d05f570a42721bb6168e20a3d23bd38bcdd9d14b19740af210f2382b13", - "transactionIndex": "0x0", - "logIndex": "0xc", - "removed": false - }, - { - "address": "0x6fd9d7AD17242c41f7131d257212c54A0e816691", - "topics": [ - "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef", - "0x000000000000000000000000ad4c666fc170b468b19988959eb931a3676f0e9f", - "0x0000000000000000000000001111111254eeb25477b68fb85ed929f73a960582" - ], - "data": "0x0000000000000000000000000000000000000000000000000040366399484adb", - "blockHash": "0x8285656676e8f3a63a32f65fb6f729bd19bfc37a6da2ae05bed156d7088994fc", - "blockNumber": "0x5b28822", - "transactionHash": "0xe7bfb6d05f570a42721bb6168e20a3d23bd38bcdd9d14b19740af210f2382b13", - "transactionIndex": "0x0", - "logIndex": "0xd", - "removed": false - }, - { - "address": "0x4200000000000000000000000000000000000006", - "topics": [ - "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef", - "0x000000000000000000000000f0694acc9e941b176e17b9ef923e71e7b8b2477a", - "0x000000000000000000000000ad4c666fc170b468b19988959eb931a3676f0e9f" - ], - "data": "0x00000000000000000000000000000000000000000000000000002ff48dbaf1bd", - "blockHash": "0x8285656676e8f3a63a32f65fb6f729bd19bfc37a6da2ae05bed156d7088994fc", - "blockNumber": "0x5b28822", - "transactionHash": "0xe7bfb6d05f570a42721bb6168e20a3d23bd38bcdd9d14b19740af210f2382b13", - "transactionIndex": "0x0", - "logIndex": "0xe", - "removed": false - }, - { - "address": "0xAD4c666fC170B468B19988959eb931a3676f0e9F", - "topics": [ - "0xc42079f94a6350d7e6235f29174924f928cc2ac818eb64fed8004e115fbcca67", - "0x000000000000000000000000f0694acc9e941b176e17b9ef923e71e7b8b2477a", - "0x0000000000000000000000001111111254eeb25477b68fb85ed929f73a960582" - ], - "data": "0x00000000000000000000000000000000000000000000000000002ff48dbaf1bdffffffffffffffffffffffffffffffffffffffffffffffffffbfc99c66b7b52500000000000000000000000000000000000000128ad32dadc13af14735933691000000000000000000000000000000000000000000000014da5c0b160a447bb8000000000000000000000000000000000000000000000000000000000000e423", - "blockHash": "0x8285656676e8f3a63a32f65fb6f729bd19bfc37a6da2ae05bed156d7088994fc", - "blockNumber": "0x5b28822", - "transactionHash": "0xe7bfb6d05f570a42721bb6168e20a3d23bd38bcdd9d14b19740af210f2382b13", - "transactionIndex": "0x0", - "logIndex": "0xf", - "removed": false - }, - { - "address": "0x6fd9d7AD17242c41f7131d257212c54A0e816691", - "topics": [ - "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef", - "0x0000000000000000000000001111111254eeb25477b68fb85ed929f73a960582", - "0x000000000000000000000000eac5f0d4a9a45e1f9fdd0e7e2882e9f60e301156" - ], - "data": "0x0000000000000000000000000000000000000000000000000040366399484adb", - "blockHash": "0x8285656676e8f3a63a32f65fb6f729bd19bfc37a6da2ae05bed156d7088994fc", - "blockNumber": "0x5b28822", - "transactionHash": "0xe7bfb6d05f570a42721bb6168e20a3d23bd38bcdd9d14b19740af210f2382b13", - "transactionIndex": "0x0", - "logIndex": "0x10", - "removed": false - } - ], - "status": "0x1", - "logsBloom": "0x00200000000000000000008000080000000000000000000000440000000000000004000000000000000040500000000000000040008020000010000000200000000200000000080800800008000000200020000000000000000000101000000000000000000400000008000000000000010000000000000000000010000800000000000000000000000002000000000200001000002000000000004040000000020000000000000000000000080204010000000000000000000000000000000000000002000000000000000400000000000000800000020020080000000400000010004000000000000400000020011000810000000010000000100000010000" - }, - { - "transactionHash": "0x71f79f21650241187d3e637351677f73d2fee7591f2600ecc768226d7d9a3178", - "transactionIndex": "0x0", - "blockHash": "0x6c97deaa4f5ba68fb7a4f9bb0b3cdc9a09c3a49b65c76915e63f0becbd6f1cfb", - "blockNumber": "0x5b2882e", - "from": "0xEAC5F0d4A9a45E1f9FdD0e7e2882e9f60E301156", - "to": "0x7F5c764cBc14f9669B88837ca1490cCa17c31607", - "cumulativeGasUsed": "0xcf3f", - "gasUsed": "0xcf3f", - "contractAddress": null, - "logs": [ - { - "address": "0x7F5c764cBc14f9669B88837ca1490cCa17c31607", - "topics": [ - "0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925", - "0x000000000000000000000000eac5f0d4a9a45e1f9fdd0e7e2882e9f60e301156", - "0x000000000000000000000000444a406c15e6f87aee894999cb13b4ff1d61a85b" - ], - "data": "0x00000000000000000000000000000000000000000000000000000000000186a0", - "blockHash": "0x6c97deaa4f5ba68fb7a4f9bb0b3cdc9a09c3a49b65c76915e63f0becbd6f1cfb", - "blockNumber": "0x5b2882e", - "transactionHash": "0x71f79f21650241187d3e637351677f73d2fee7591f2600ecc768226d7d9a3178", - "transactionIndex": "0x0", - "logIndex": "0x0", - "removed": false - } - ], - "status": "0x1", - "logsBloom": "0x00000000000000000000008000000000000000000000000000000000000000000000000000000000000000000000000000000040000000000000000000200000000000000000000000000000000000000000000001000008000000100000000000000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000040000000020000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000800000000000000000000000010000" - }, - { - "transactionHash": "0x179019d502a67838533b07634ad619d39514b55a10599b250f80c5cb219ab04e", - "transactionIndex": "0x0", - "blockHash": "0x57eb61011139e2d87ffb3b6d29e7bac69e17919330e0d928403ddcc9b6b59261", - "blockNumber": "0x5b28839", - "from": "0xEAC5F0d4A9a45E1f9FdD0e7e2882e9f60E301156", - "to": "0x7F5c764cBc14f9669B88837ca1490cCa17c31607", - "cumulativeGasUsed": "0x8183", - "gasUsed": "0x8183", - "contractAddress": null, - "logs": [ - { - "address": "0x7F5c764cBc14f9669B88837ca1490cCa17c31607", - "topics": [ - "0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925", - "0x000000000000000000000000eac5f0d4a9a45e1f9fdd0e7e2882e9f60e301156", - "0x0000000000000000000000001111111254760f7ab3f16433eea9304126dcd199" - ], - "data": "0x00000000000000000000000000000000000000000000000000000000000186a0", - "blockHash": "0x57eb61011139e2d87ffb3b6d29e7bac69e17919330e0d928403ddcc9b6b59261", - "blockNumber": "0x5b28839", - "transactionHash": "0x179019d502a67838533b07634ad619d39514b55a10599b250f80c5cb219ab04e", - "transactionIndex": "0x0", - "logIndex": "0x0", - "removed": false - } - ], - "status": "0x1", - "logsBloom": "0x00000000000000000000008000000000000000000000000000000000000000000000000000000000000000000000000000000040000000000000400000200000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000040000000020000000000000200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000800000080000000000000000010000" - }, - { - "transactionHash": "0x5445be7f53975a21d639f41e3e607903bc47ab5f1c87c2005c657dbf0efafe48", - "transactionIndex": "0x0", - "blockHash": "0xde962d5313c54e9a1490d0f1cf82130a7fedcb011b11b3c8dac57ed0405b544f", - "blockNumber": "0x5b28846", - "from": "0xEAC5F0d4A9a45E1f9FdD0e7e2882e9f60E301156", - "to": "0x1111111254760F7ab3F16433eea9304126DCd199", - "cumulativeGasUsed": "0x2fb70", - "gasUsed": "0x2fb70", - "contractAddress": null, - "logs": [ - { - "address": "0x7F5c764cBc14f9669B88837ca1490cCa17c31607", - "topics": [ - "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef", - "0x000000000000000000000000eac5f0d4a9a45e1f9fdd0e7e2882e9f60e301156", - "0x000000000000000000000000f0694acc9e941b176e17b9ef923e71e7b8b2477a" - ], - "data": "0x00000000000000000000000000000000000000000000000000000000000186a0", - "blockHash": "0xde962d5313c54e9a1490d0f1cf82130a7fedcb011b11b3c8dac57ed0405b544f", - "blockNumber": "0x5b28846", - "transactionHash": "0x5445be7f53975a21d639f41e3e607903bc47ab5f1c87c2005c657dbf0efafe48", - "transactionIndex": "0x0", - "logIndex": "0x0", - "removed": false - }, - { - "address": "0x7F5c764cBc14f9669B88837ca1490cCa17c31607", - "topics": [ - "0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925", - "0x000000000000000000000000eac5f0d4a9a45e1f9fdd0e7e2882e9f60e301156", - "0x0000000000000000000000001111111254760f7ab3f16433eea9304126dcd199" - ], - "data": "0x0000000000000000000000000000000000000000000000000000000000000000", - "blockHash": "0xde962d5313c54e9a1490d0f1cf82130a7fedcb011b11b3c8dac57ed0405b544f", - "blockNumber": "0x5b28846", - "transactionHash": "0x5445be7f53975a21d639f41e3e607903bc47ab5f1c87c2005c657dbf0efafe48", - "transactionIndex": "0x0", - "logIndex": "0x1", - "removed": false - }, - { - "address": "0x4200000000000000000000000000000000000006", - "topics": [ - "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef", - "0x000000000000000000000000f9d5940c2313636546ab9852354860dce275dbad", - "0x000000000000000000000000f0694acc9e941b176e17b9ef923e71e7b8b2477a" - ], - "data": "0x00000000000000000000000000000000000000000000000000002ff8d9b2edfd", - "blockHash": "0xde962d5313c54e9a1490d0f1cf82130a7fedcb011b11b3c8dac57ed0405b544f", - "blockNumber": "0x5b28846", - "transactionHash": "0x5445be7f53975a21d639f41e3e607903bc47ab5f1c87c2005c657dbf0efafe48", - "transactionIndex": "0x0", - "logIndex": "0x2", - "removed": false - }, - { - "address": "0x7F5c764cBc14f9669B88837ca1490cCa17c31607", - "topics": [ - "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef", - "0x000000000000000000000000f0694acc9e941b176e17b9ef923e71e7b8b2477a", - "0x000000000000000000000000f9d5940c2313636546ab9852354860dce275dbad" - ], - "data": "0x00000000000000000000000000000000000000000000000000000000000186a0", - "blockHash": "0xde962d5313c54e9a1490d0f1cf82130a7fedcb011b11b3c8dac57ed0405b544f", - "blockNumber": "0x5b28846", - "transactionHash": "0x5445be7f53975a21d639f41e3e607903bc47ab5f1c87c2005c657dbf0efafe48", - "transactionIndex": "0x0", - "logIndex": "0x3", - "removed": false - }, - { - "address": "0xf9D5940c2313636546Ab9852354860dCE275DBaD", - "topics": [ - "0xc42079f94a6350d7e6235f29174924f928cc2ac818eb64fed8004e115fbcca67", - "0x000000000000000000000000f0694acc9e941b176e17b9ef923e71e7b8b2477a", - "0x000000000000000000000000f0694acc9e941b176e17b9ef923e71e7b8b2477a" - ], - "data": "0xffffffffffffffffffffffffffffffffffffffffffffffffffffd007264d120300000000000000000000000000000000000000000000000000000000000186a000000000000000000000000000000000000000000002da5e92e5b4199d8c66740000000000000000000000000000000000000000000000000000775b02e74881fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffcef6e", - "blockHash": "0xde962d5313c54e9a1490d0f1cf82130a7fedcb011b11b3c8dac57ed0405b544f", - "blockNumber": "0x5b28846", - "transactionHash": "0x5445be7f53975a21d639f41e3e607903bc47ab5f1c87c2005c657dbf0efafe48", - "transactionIndex": "0x0", - "logIndex": "0x4", - "removed": false - }, - { - "address": "0x6fd9d7AD17242c41f7131d257212c54A0e816691", - "topics": [ - "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef", - "0x000000000000000000000000ad4c666fc170b468b19988959eb931a3676f0e9f", - "0x0000000000000000000000001111111254760f7ab3f16433eea9304126dcd199" - ], - "data": "0x00000000000000000000000000000000000000000000000000403c0f203947a1", - "blockHash": "0xde962d5313c54e9a1490d0f1cf82130a7fedcb011b11b3c8dac57ed0405b544f", - "blockNumber": "0x5b28846", - "transactionHash": "0x5445be7f53975a21d639f41e3e607903bc47ab5f1c87c2005c657dbf0efafe48", - "transactionIndex": "0x0", - "logIndex": "0x5", - "removed": false - }, - { - "address": "0x4200000000000000000000000000000000000006", - "topics": [ - "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef", - "0x000000000000000000000000f0694acc9e941b176e17b9ef923e71e7b8b2477a", - "0x000000000000000000000000ad4c666fc170b468b19988959eb931a3676f0e9f" - ], - "data": "0x00000000000000000000000000000000000000000000000000002ff8d9b2edfd", - "blockHash": "0xde962d5313c54e9a1490d0f1cf82130a7fedcb011b11b3c8dac57ed0405b544f", - "blockNumber": "0x5b28846", - "transactionHash": "0x5445be7f53975a21d639f41e3e607903bc47ab5f1c87c2005c657dbf0efafe48", - "transactionIndex": "0x0", - "logIndex": "0x6", - "removed": false - }, - { - "address": "0xAD4c666fC170B468B19988959eb931a3676f0e9F", - "topics": [ - "0xc42079f94a6350d7e6235f29174924f928cc2ac818eb64fed8004e115fbcca67", - "0x000000000000000000000000f0694acc9e941b176e17b9ef923e71e7b8b2477a", - "0x0000000000000000000000001111111254760f7ab3f16433eea9304126dcd199" - ], - "data": "0x00000000000000000000000000000000000000000000000000002ff8d9b2edfdffffffffffffffffffffffffffffffffffffffffffffffffffbfc3f0dfc6b85f00000000000000000000000000000000000000128ad0191b67f5111972c2a4fd000000000000000000000000000000000000000000000014da5c0b160a447bb8000000000000000000000000000000000000000000000000000000000000e423", - "blockHash": "0xde962d5313c54e9a1490d0f1cf82130a7fedcb011b11b3c8dac57ed0405b544f", - "blockNumber": "0x5b28846", - "transactionHash": "0x5445be7f53975a21d639f41e3e607903bc47ab5f1c87c2005c657dbf0efafe48", - "transactionIndex": "0x0", - "logIndex": "0x7", - "removed": false - }, - { - "address": "0x6fd9d7AD17242c41f7131d257212c54A0e816691", - "topics": [ - "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef", - "0x0000000000000000000000001111111254760f7ab3f16433eea9304126dcd199", - "0x000000000000000000000000eac5f0d4a9a45e1f9fdd0e7e2882e9f60e301156" - ], - "data": "0x00000000000000000000000000000000000000000000000000403c0f203947a1", - "blockHash": "0xde962d5313c54e9a1490d0f1cf82130a7fedcb011b11b3c8dac57ed0405b544f", - "blockNumber": "0x5b28846", - "transactionHash": "0x5445be7f53975a21d639f41e3e607903bc47ab5f1c87c2005c657dbf0efafe48", - "transactionIndex": "0x0", - "logIndex": "0x8", - "removed": false - } - ], - "status": "0x1", - "logsBloom": "0x00000000000000000000008000080000000000008000000000440000000000000000000000000000000000100000000000000040008020000000400000200000000200000000000800000008000000000000000000000000000000101000000000000000000000000008000000000000000000000000000000000010000810000000000000000000000000000000000000000020002000000000000040000000020100000000000200000000000200000000000000000000000000000000000000000002000000000000000000000000000000800000000000000000000400000090004000000000000008000000001000800000080010000000000000010000" - }, - { - "transactionHash": "0x0d8dc46ad33862e3379182916a1539b58385d98e309f72b63179c594ca783ad0", - "transactionIndex": "0x0", - "blockHash": "0x6d3d3e03ea03bda1127f71bd4c31444568c19e1a65ce6c0f7a9024308a4814d6", - "blockNumber": "0x5b28853", - "from": "0xEAC5F0d4A9a45E1f9FdD0e7e2882e9f60E301156", - "to": "0x444A406C15e6F87Aee894999cb13B4ff1D61a85B", - "cumulativeGasUsed": "0x350dd", - "gasUsed": "0x350dd", - "contractAddress": null, - "logs": [ - { - "address": "0x7F5c764cBc14f9669B88837ca1490cCa17c31607", - "topics": [ - "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef", - "0x000000000000000000000000eac5f0d4a9a45e1f9fdd0e7e2882e9f60e301156", - "0x000000000000000000000000444a406c15e6f87aee894999cb13b4ff1d61a85b" - ], - "data": "0x00000000000000000000000000000000000000000000000000000000000186a0", - "blockHash": "0x6d3d3e03ea03bda1127f71bd4c31444568c19e1a65ce6c0f7a9024308a4814d6", - "blockNumber": "0x5b28853", - "transactionHash": "0x0d8dc46ad33862e3379182916a1539b58385d98e309f72b63179c594ca783ad0", - "transactionIndex": "0x0", - "logIndex": "0x0", - "removed": false - }, - { - "address": "0x7F5c764cBc14f9669B88837ca1490cCa17c31607", - "topics": [ - "0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925", - "0x000000000000000000000000eac5f0d4a9a45e1f9fdd0e7e2882e9f60e301156", - "0x000000000000000000000000444a406c15e6f87aee894999cb13b4ff1d61a85b" - ], - "data": "0x0000000000000000000000000000000000000000000000000000000000000000", - "blockHash": "0x6d3d3e03ea03bda1127f71bd4c31444568c19e1a65ce6c0f7a9024308a4814d6", - "blockNumber": "0x5b28853", - "transactionHash": "0x0d8dc46ad33862e3379182916a1539b58385d98e309f72b63179c594ca783ad0", - "transactionIndex": "0x0", - "logIndex": "0x1", - "removed": false - }, - { - "address": "0x7F5c764cBc14f9669B88837ca1490cCa17c31607", - "topics": [ - "0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925", - "0x000000000000000000000000444a406c15e6f87aee894999cb13b4ff1d61a85b", - "0x0000000000000000000000001111111254760f7ab3f16433eea9304126dcd199" - ], - "data": "0x00000000000000000000000000000000000000000000000000000000000186a0", - "blockHash": "0x6d3d3e03ea03bda1127f71bd4c31444568c19e1a65ce6c0f7a9024308a4814d6", - "blockNumber": "0x5b28853", - "transactionHash": "0x0d8dc46ad33862e3379182916a1539b58385d98e309f72b63179c594ca783ad0", - "transactionIndex": "0x0", - "logIndex": "0x2", - "removed": false - }, - { - "address": "0x7F5c764cBc14f9669B88837ca1490cCa17c31607", - "topics": [ - "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef", - "0x000000000000000000000000444a406c15e6f87aee894999cb13b4ff1d61a85b", - "0x000000000000000000000000f0694acc9e941b176e17b9ef923e71e7b8b2477a" - ], - "data": "0x00000000000000000000000000000000000000000000000000000000000186a0", - "blockHash": "0x6d3d3e03ea03bda1127f71bd4c31444568c19e1a65ce6c0f7a9024308a4814d6", - "blockNumber": "0x5b28853", - "transactionHash": "0x0d8dc46ad33862e3379182916a1539b58385d98e309f72b63179c594ca783ad0", - "transactionIndex": "0x0", - "logIndex": "0x3", - "removed": false - }, - { - "address": "0x7F5c764cBc14f9669B88837ca1490cCa17c31607", - "topics": [ - "0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925", - "0x000000000000000000000000444a406c15e6f87aee894999cb13b4ff1d61a85b", - "0x0000000000000000000000001111111254760f7ab3f16433eea9304126dcd199" - ], - "data": "0x0000000000000000000000000000000000000000000000000000000000000000", - "blockHash": "0x6d3d3e03ea03bda1127f71bd4c31444568c19e1a65ce6c0f7a9024308a4814d6", - "blockNumber": "0x5b28853", - "transactionHash": "0x0d8dc46ad33862e3379182916a1539b58385d98e309f72b63179c594ca783ad0", - "transactionIndex": "0x0", - "logIndex": "0x4", - "removed": false - }, - { - "address": "0x4200000000000000000000000000000000000006", - "topics": [ - "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef", - "0x000000000000000000000000f9d5940c2313636546ab9852354860dce275dbad", - "0x000000000000000000000000f0694acc9e941b176e17b9ef923e71e7b8b2477a" - ], - "data": "0x00000000000000000000000000000000000000000000000000002ff86e060a93", - "blockHash": "0x6d3d3e03ea03bda1127f71bd4c31444568c19e1a65ce6c0f7a9024308a4814d6", - "blockNumber": "0x5b28853", - "transactionHash": "0x0d8dc46ad33862e3379182916a1539b58385d98e309f72b63179c594ca783ad0", - "transactionIndex": "0x0", - "logIndex": "0x5", - "removed": false - }, - { - "address": "0x7F5c764cBc14f9669B88837ca1490cCa17c31607", - "topics": [ - "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef", - "0x000000000000000000000000f0694acc9e941b176e17b9ef923e71e7b8b2477a", - "0x000000000000000000000000f9d5940c2313636546ab9852354860dce275dbad" - ], - "data": "0x00000000000000000000000000000000000000000000000000000000000186a0", - "blockHash": "0x6d3d3e03ea03bda1127f71bd4c31444568c19e1a65ce6c0f7a9024308a4814d6", - "blockNumber": "0x5b28853", - "transactionHash": "0x0d8dc46ad33862e3379182916a1539b58385d98e309f72b63179c594ca783ad0", - "transactionIndex": "0x0", - "logIndex": "0x6", - "removed": false - }, - { - "address": "0xf9D5940c2313636546Ab9852354860dCE275DBaD", - "topics": [ - "0xc42079f94a6350d7e6235f29174924f928cc2ac818eb64fed8004e115fbcca67", - "0x000000000000000000000000f0694acc9e941b176e17b9ef923e71e7b8b2477a", - "0x000000000000000000000000f0694acc9e941b176e17b9ef923e71e7b8b2477a" - ], - "data": "0xffffffffffffffffffffffffffffffffffffffffffffffffffffd00791f9f56d00000000000000000000000000000000000000000000000000000000000186a000000000000000000000000000000000000000000002da61c695cf08e951b8590000000000000000000000000000000000000000000000000000775b02e74881fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffcef6e", - "blockHash": "0x6d3d3e03ea03bda1127f71bd4c31444568c19e1a65ce6c0f7a9024308a4814d6", - "blockNumber": "0x5b28853", - "transactionHash": "0x0d8dc46ad33862e3379182916a1539b58385d98e309f72b63179c594ca783ad0", - "transactionIndex": "0x0", - "logIndex": "0x7", - "removed": false - }, - { - "address": "0x6fd9d7AD17242c41f7131d257212c54A0e816691", - "topics": [ - "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef", - "0x000000000000000000000000ad4c666fc170b468b19988959eb931a3676f0e9f", - "0x0000000000000000000000001111111254760f7ab3f16433eea9304126dcd199" - ], - "data": "0x00000000000000000000000000000000000000000000000000403b699b8e50db", - "blockHash": "0x6d3d3e03ea03bda1127f71bd4c31444568c19e1a65ce6c0f7a9024308a4814d6", - "blockNumber": "0x5b28853", - "transactionHash": "0x0d8dc46ad33862e3379182916a1539b58385d98e309f72b63179c594ca783ad0", - "transactionIndex": "0x0", - "logIndex": "0x8", - "removed": false - }, - { - "address": "0x4200000000000000000000000000000000000006", - "topics": [ - "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef", - "0x000000000000000000000000f0694acc9e941b176e17b9ef923e71e7b8b2477a", - "0x000000000000000000000000ad4c666fc170b468b19988959eb931a3676f0e9f" - ], - "data": "0x00000000000000000000000000000000000000000000000000002ff86e060a93", - "blockHash": "0x6d3d3e03ea03bda1127f71bd4c31444568c19e1a65ce6c0f7a9024308a4814d6", - "blockNumber": "0x5b28853", - "transactionHash": "0x0d8dc46ad33862e3379182916a1539b58385d98e309f72b63179c594ca783ad0", - "transactionIndex": "0x0", - "logIndex": "0x9", - "removed": false - }, - { - "address": "0xAD4c666fC170B468B19988959eb931a3676f0e9F", - "topics": [ - "0xc42079f94a6350d7e6235f29174924f928cc2ac818eb64fed8004e115fbcca67", - "0x000000000000000000000000f0694acc9e941b176e17b9ef923e71e7b8b2477a", - "0x0000000000000000000000001111111254760f7ab3f16433eea9304126dcd199" - ], - "data": "0x00000000000000000000000000000000000000000000000000002ff86e060a93ffffffffffffffffffffffffffffffffffffffffffffffffffbfc4966471af2500000000000000000000000000000000000000128acd0490fea84da8de9e7ce5000000000000000000000000000000000000000000000014da5c0b160a447bb8000000000000000000000000000000000000000000000000000000000000e423", - "blockHash": "0x6d3d3e03ea03bda1127f71bd4c31444568c19e1a65ce6c0f7a9024308a4814d6", - "blockNumber": "0x5b28853", - "transactionHash": "0x0d8dc46ad33862e3379182916a1539b58385d98e309f72b63179c594ca783ad0", - "transactionIndex": "0x0", - "logIndex": "0xa", - "removed": false - }, - { - "address": "0x6fd9d7AD17242c41f7131d257212c54A0e816691", - "topics": [ - "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef", - "0x0000000000000000000000001111111254760f7ab3f16433eea9304126dcd199", - "0x000000000000000000000000eac5f0d4a9a45e1f9fdd0e7e2882e9f60e301156" - ], - "data": "0x00000000000000000000000000000000000000000000000000403b699b8e50db", - "blockHash": "0x6d3d3e03ea03bda1127f71bd4c31444568c19e1a65ce6c0f7a9024308a4814d6", - "blockNumber": "0x5b28853", - "transactionHash": "0x0d8dc46ad33862e3379182916a1539b58385d98e309f72b63179c594ca783ad0", - "transactionIndex": "0x0", - "logIndex": "0xb", - "removed": false - } - ], - "status": "0x1", - "logsBloom": "0x00000000000000000000008000080000000000008000000000440000000000000000000000000000000000100000000000000040008020000000400000200000000200000000000800000008000000000000000001000008000000101000000000000000000000000008000000000000000000000000000000000010000810040000000000000000000000000000000000000020002000000000000040000000020100000000000200000000000200000000000000000000000000000000000000000002000000000000000000000000000000800000000000000000000400000090004000000000000008000000001000800000080010000000000000010000" - } - ], - "libraries": [], - "pending": [], - "path": "", - "returns": {}, - "timestamp": 1682891249, - "chain": 10, - "multi": false, - "commit": "580f0ba" -} diff --git a/broadcast/Deploy.s.sol/10/run-1682875572.json b/broadcast/Deploy.s.sol/10/run-1682875572.json deleted file mode 100644 index bea4375..0000000 --- a/broadcast/Deploy.s.sol/10/run-1682875572.json +++ /dev/null @@ -1,162 +0,0 @@ -{ - "transactions": [ - { - "hash": "0x007eeabf910018da20ef36241f5474d69fa6a608e7991d41d65a90767bcf9349", - "transactionType": "CREATE", - "contractName": "OneInchRouterFactory", - "contractAddress": "0x8ea1Cec74fA7CDdfE8056198ef1A3718aDae2895", - "function": null, - "arguments": [ - "0xf0694ACc9E941B176E17B9Ef923e71E7B8b2477A", - "0x1111111254EEB25477B68fb85Ed929f73A960582", - "0xf0694ACc9E941B176E17B9Ef923e71E7B8b2477A", - "0x1111111254760F7ab3F16433eea9304126DCd199" - ], - "rpc": "", - "transaction": { - "type": "0x00", - "from": "0xeac5f0d4a9a45e1f9fdd0e7e2882e9f60e301156", - "gas": "0x1dc418", - "value": "0x0", - "data": "0x61014060405234801561001157600080fd5b50604051611bde380380611bde8339810160408190526100309161007a565b6001600160a01b03938416608081905292841660a05261010092909252821660c0819052911660e052610120526100d9565b6001600160a01b038116811461007757600080fd5b50565b6000806000806080858703121561009057600080fd5b845161009b81610062565b60208601519094506100ac81610062565b60408601519093506100bd81610062565b60608601519092506100ce81610062565b939692955090935050565b60805160a05160c05160e0516101005161012051611a6461017a6000396000818161011c015281816103a901526104fc01526000818161017d015281816102c2015261060b0152600081816101a40152818161036601526104a201526000818160ce0152818161038701526104ca01526000818160f50152818161027f01526105b1015260008181610156015281816102a001526105d90152611a646000f3fe608060405234801561001057600080fd5b50600436106100885760003560e01c806344b6b3331161005b57806344b6b3331461013e578063ced156d914610151578063d0a32a3b14610178578063eafc4d611461019f57600080fd5b80630e6e0fb21461008d57806312d69f9a146100c957806333e81795146100f05780633cffdecc14610117575b600080fd5b6100a061009b366004610735565b6101c6565b60405173ffffffffffffffffffffffffffffffffffffffff909116815260200160405180910390f35b6100a07f000000000000000000000000000000000000000000000000000000000000000081565b6100a07f000000000000000000000000000000000000000000000000000000000000000081565b6100a07f000000000000000000000000000000000000000000000000000000000000000081565b6100a061014c366004610735565b61024a565b6100a07f000000000000000000000000000000000000000000000000000000000000000081565b6100a07f000000000000000000000000000000000000000000000000000000000000000081565b6100a07f000000000000000000000000000000000000000000000000000000000000000081565b6000808360018111156101db576101db61078b565b036101f0576101e98261042a565b9050610244565b60018360018111156102045761020461078b565b03610212576101e982610539565b6040517fe34f15ca00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b92915050565b600073ffffffffffffffffffffffffffffffffffffffff821681600185818111156102775761027761078b565b0361034a57817f00000000000000000000000000000000000000000000000000000000000000007f0000000000000000000000000000000000000000000000000000000000000000867f00000000000000000000000000000000000000000000000000000000000000006040516102ed9061071b565b73ffffffffffffffffffffffffffffffffffffffff94851681529284166020840152908316604083015290911660608201526080018190604051809103906000f5905080158015610342573d6000803e3d6000fd5b5090506103d4565b600085600181111561035e5761035e61078b565b0361021257817f00000000000000000000000000000000000000000000000000000000000000007f0000000000000000000000000000000000000000000000000000000000000000867f00000000000000000000000000000000000000000000000000000000000000006040516102ed90610728565b8373ffffffffffffffffffffffffffffffffffffffff167f8b7908ccc516745a211cceb7b00399a7bc2db042629feefb1daf11d8fa7eda998660405161041a91906107ba565b60405180910390a2949350505050565b600061024473ffffffffffffffffffffffffffffffffffffffff8316306040518060200161045790610728565b8181037fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe09081018352601f90910116604081815273ffffffffffffffffffffffffffffffffffffffff7f0000000000000000000000000000000000000000000000000000000000000000811660208401527f000000000000000000000000000000000000000000000000000000000000000081169183019190915280881660608301527f000000000000000000000000000000000000000000000000000000000000000016608082015260a0015b604051602081830303815290604052610638565b600061024473ffffffffffffffffffffffffffffffffffffffff831630604051806020016105669061071b565b8181037fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe09081018352601f90910116604081815273ffffffffffffffffffffffffffffffffffffffff7f0000000000000000000000000000000000000000000000000000000000000000811660208401527f000000000000000000000000000000000000000000000000000000000000000081169183019190915280881660608301527f000000000000000000000000000000000000000000000000000000000000000016608082015260a001610525565b600060ff60f81b8486858560405160200161065492919061082b565b604051602081830303815290604052805190602001206040516020016106dc94939291907fff0000000000000000000000000000000000000000000000000000000000000094909416845260609290921b7fffffffffffffffffffffffffffffffffffffffff0000000000000000000000001660018401526015830152603582015260550190565b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0818403018152919052805160209091012095945050505050565b6108b88061084983390190565b61092e8061110183390190565b6000806040838503121561074857600080fd5b82356002811061075757600080fd5b9150602083013573ffffffffffffffffffffffffffffffffffffffff8116811461078057600080fd5b809150509250929050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fd5b60208101600283106107f5577f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fd5b91905290565b6000815160005b8181101561081c5760208185018101518683015201610802565b50600093019283525090919050565b600061084061083a83866107fb565b846107fb565b94935050505056fe61010060405234801561001157600080fd5b506040516108b83803806108b88339810160408190526100309161006a565b6001600160a01b0392831660805292821660a052811660c0521660e0526100c9565b6001600160a01b038116811461006757600080fd5b50565b6000806000806080858703121561008057600080fd5b845161008b81610052565b602086015190945061009c81610052565b60408601519093506100ad81610052565b60608601519092506100be81610052565b939692955090935050565b60805160a05160c05160e051610786610132600039600081816102c1015261047201526000818160b70152818161019101528181610269015261043e0152600081816101620152818161020101526103ad01526000818161023d015261040a01526107866000f3fe6080604052600436106100435760003560e01c80630621153b1461039b5780634803f27a146103f857806382bfefc81461042c578063ff8ce5d0146104605761004a565b3661004a57005b60008080808061005a36826104e4565b6040517f23b872dd000000000000000000000000000000000000000000000000000000008152336004820152306024820152604481018590529499509297509095509350915073ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000000000000000000000000000000000000000000016906323b872dd906064016020604051808303816000875af1158015610100573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906101249190610603565b506040517f095ea7b300000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000000000000000000000000000000000000000000081166004830152602482018690527f0000000000000000000000000000000000000000000000000000000000000000169063095ea7b3906044016020604051808303816000875af11580156101da573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906101fe9190610603565b507f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff166312aa3caf7f00000000000000000000000000000000000000000000000000000000000000006040518060e001604052807f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff1681526020018973ffffffffffffffffffffffffffffffffffffffff1681526020017f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff1681526020013373ffffffffffffffffffffffffffffffffffffffff1681526020018881526020018781526020018561032f576000610332565b60015b60ff16815250856040518463ffffffff1660e01b81526004016103579392919061068b565b60408051808303816000875af1158015610375573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610399919061072c565b005b3480156103a757600080fd5b506103cf7f000000000000000000000000000000000000000000000000000000000000000081565b60405173ffffffffffffffffffffffffffffffffffffffff909116815260200160405180910390f35b34801561040457600080fd5b506103cf7f000000000000000000000000000000000000000000000000000000000000000081565b34801561043857600080fd5b506103cf7f000000000000000000000000000000000000000000000000000000000000000081565b34801561046c57600080fd5b506103cf7f000000000000000000000000000000000000000000000000000000000000000081565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b80151581146104d157600080fd5b50565b80356104df816104c3565b919050565b600080600080600060a086880312156104fc57600080fd5b853573ffffffffffffffffffffffffffffffffffffffff8116811461052057600080fd5b94506020860135935060408601359250606086013567ffffffffffffffff8082111561054b57600080fd5b818801915088601f83011261055f57600080fd5b81358181111561057157610571610494565b604051601f82017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0908116603f011681019083821181831017156105b7576105b7610494565b816040528281528b60208487010111156105d057600080fd5b8260208601602083013760006020848301015280965050505050506105f7608087016104d4565b90509295509295909350565b60006020828403121561061557600080fd5b8151610620816104c3565b9392505050565b6000815180845260005b8181101561064d57602081850181015186830182015201610631565b5060006020828601015260207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f83011685010191505092915050565b600061014073ffffffffffffffffffffffffffffffffffffffff808716845280865116602085015280602087015116604085015280604087015116606085015280606087015116608085015250608085015160a084015260a085015160c084015260c085015160e08401528061010084015261070d8184016000815260200190565b90508281036101208401526107228185610627565b9695505050505050565b6000806040838503121561073f57600080fd5b50508051602090910151909290915056fea26469706673582212201cb8a535426b4a44845edc534db759da911a7856b5044dd9b2aab90ecab41fa964736f6c6343000810003361010060405234801561001157600080fd5b5060405161092e38038061092e8339810160408190526100309161006a565b6001600160a01b0392831660805292821660a052811660c0521660e0526100c9565b6001600160a01b038116811461006757600080fd5b50565b6000806000806080858703121561008057600080fd5b845161008b81610052565b602086015190945061009c81610052565b60408601519093506100ad81610052565b60608601519092506100be81610052565b939692955090935050565b60805160a05160c05160e0516107fc610132600039600081816102c2015261048901526000818160b7015281816101910152818161026a01526104550152600081816101620152818161020101526103c401526000818161023d015261042101526107fc6000f3fe6080604052600436106100435760003560e01c80630621153b146103b25780634803f27a1461040f57806382bfefc814610443578063ff8ce5d0146104775761004a565b3661004a57005b60008080808061005a36826104fb565b6040517f23b872dd000000000000000000000000000000000000000000000000000000008152336004820152306024820152604481018590529499509297509095509350915073ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000000000000000000000000000000000000000000016906323b872dd906064016020604051808303816000875af1158015610100573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610124919061061a565b506040517f095ea7b300000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000000000000000000000000000000000000000000081166004830152602482018690527f0000000000000000000000000000000000000000000000000000000000000000169063095ea7b3906044016020604051808303816000875af11580156101da573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906101fe919061061a565b507f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff16637c0252007f00000000000000000000000000000000000000000000000000000000000000006040518061010001604052807f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff1681526020018973ffffffffffffffffffffffffffffffffffffffff1681526020017f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff1681526020013373ffffffffffffffffffffffffffffffffffffffff16815260200188815260200187815260200185610330576000610333565b60015b60ff16815260200160405180602001604052806000815250815250856040518463ffffffff1660e01b815260040161036d939291906106a2565b6060604051808303816000875af115801561038c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906103b09190610798565b005b3480156103be57600080fd5b506103e67f000000000000000000000000000000000000000000000000000000000000000081565b60405173ffffffffffffffffffffffffffffffffffffffff909116815260200160405180910390f35b34801561041b57600080fd5b506103e67f000000000000000000000000000000000000000000000000000000000000000081565b34801561044f57600080fd5b506103e67f000000000000000000000000000000000000000000000000000000000000000081565b34801561048357600080fd5b506103e67f000000000000000000000000000000000000000000000000000000000000000081565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b80151581146104e857600080fd5b50565b80356104f6816104da565b919050565b600080600080600060a0868803121561051357600080fd5b853573ffffffffffffffffffffffffffffffffffffffff8116811461053757600080fd5b94506020860135935060408601359250606086013567ffffffffffffffff8082111561056257600080fd5b818801915088601f83011261057657600080fd5b813581811115610588576105886104ab565b604051601f82017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0908116603f011681019083821181831017156105ce576105ce6104ab565b816040528281528b60208487010111156105e757600080fd5b82602086016020830137600060208483010152809650505050505061060e608087016104eb565b90509295509295909350565b60006020828403121561062c57600080fd5b8151610637816104da565b9392505050565b6000815180845260005b8181101561066457602081850181015186830182015201610648565b5060006020828601015260207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f83011685010191505092915050565b600073ffffffffffffffffffffffffffffffffffffffff8086168352606060208401528085511660608401525060208401516106f6608084018273ffffffffffffffffffffffffffffffffffffffff169052565b50604084015173ffffffffffffffffffffffffffffffffffffffff811660a084015250606084015173ffffffffffffffffffffffffffffffffffffffff811660c084015250608084015160e083015260a0840151610100818185015260c086015161012085015260e08601519150806101408501525061077a61016084018261063e565b9050828103604084015261078e818561063e565b9695505050505050565b6000806000606084860312156107ad57600080fd5b835192506020840151915060408401519050925092509256fea264697066735822122096bc8c2fe4e7c03521d6276cc5b954661b17e7b6252165a773e142559729e0b564736f6c63430008100033a2646970667358221220ac5f1d19eca2c9bc1bb026006b1b194aa989df53d745cb41149386f21415660364736f6c63430008100033000000000000000000000000f0694acc9e941b176e17b9ef923e71e7b8b2477a0000000000000000000000001111111254eeb25477b68fb85ed929f73a960582000000000000000000000000f0694acc9e941b176e17b9ef923e71e7b8b2477a0000000000000000000000001111111254760f7ab3f16433eea9304126dcd199", - "nonce": "0x1b" - }, - "additionalContracts": [], - "isFixedGasLimit": false - }, - { - "hash": "0xeb42f66b829c3b569a90d3bc9df1108a1803fce3712a3e6cd57d6e0ea25e9224", - "transactionType": "CALL", - "contractName": "OneInchRouterFactory", - "contractAddress": "0x8ea1Cec74fA7CDdfE8056198ef1A3718aDae2895", - "function": "deploy(uint8,address):(address)", - "arguments": ["1", "0x7F5c764cBc14f9669B88837ca1490cCa17c31607"], - "rpc": "", - "transaction": { - "type": "0x00", - "from": "0xeac5f0d4a9a45e1f9fdd0e7e2882e9f60e301156", - "to": "0x8ea1cec74fa7cddfe8056198ef1a3718adae2895", - "gas": "0x95633", - "value": "0x0", - "data": "0x44b6b33300000000000000000000000000000000000000000000000000000000000000010000000000000000000000007f5c764cbc14f9669b88837ca1490cca17c31607", - "nonce": "0x1c" - }, - "additionalContracts": [ - { - "transactionType": "CREATE2", - "address": "0xB17cCEE669aB2cc40A6564DA84Db66dD8D144CB4", - "initCode": "61010060405234801561001157600080fd5b506040516108b83803806108b88339810160408190526100309161006a565b6001600160a01b0392831660805292821660a052811660c0521660e0526100c9565b6001600160a01b038116811461006757600080fd5b50565b6000806000806080858703121561008057600080fd5b845161008b81610052565b602086015190945061009c81610052565b60408601519093506100ad81610052565b60608601519092506100be81610052565b939692955090935050565b60805160a05160c05160e051610786610132600039600081816102c1015261047201526000818160b70152818161019101528181610269015261043e0152600081816101620152818161020101526103ad01526000818161023d015261040a01526107866000f3fe6080604052600436106100435760003560e01c80630621153b1461039b5780634803f27a146103f857806382bfefc81461042c578063ff8ce5d0146104605761004a565b3661004a57005b60008080808061005a36826104e4565b6040517f23b872dd000000000000000000000000000000000000000000000000000000008152336004820152306024820152604481018590529499509297509095509350915073ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000000000000000000000000000000000000000000016906323b872dd906064016020604051808303816000875af1158015610100573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906101249190610603565b506040517f095ea7b300000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000000000000000000000000000000000000000000081166004830152602482018690527f0000000000000000000000000000000000000000000000000000000000000000169063095ea7b3906044016020604051808303816000875af11580156101da573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906101fe9190610603565b507f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff166312aa3caf7f00000000000000000000000000000000000000000000000000000000000000006040518060e001604052807f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff1681526020018973ffffffffffffffffffffffffffffffffffffffff1681526020017f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff1681526020013373ffffffffffffffffffffffffffffffffffffffff1681526020018881526020018781526020018561032f576000610332565b60015b60ff16815250856040518463ffffffff1660e01b81526004016103579392919061068b565b60408051808303816000875af1158015610375573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610399919061072c565b005b3480156103a757600080fd5b506103cf7f000000000000000000000000000000000000000000000000000000000000000081565b60405173ffffffffffffffffffffffffffffffffffffffff909116815260200160405180910390f35b34801561040457600080fd5b506103cf7f000000000000000000000000000000000000000000000000000000000000000081565b34801561043857600080fd5b506103cf7f000000000000000000000000000000000000000000000000000000000000000081565b34801561046c57600080fd5b506103cf7f000000000000000000000000000000000000000000000000000000000000000081565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b80151581146104d157600080fd5b50565b80356104df816104c3565b919050565b600080600080600060a086880312156104fc57600080fd5b853573ffffffffffffffffffffffffffffffffffffffff8116811461052057600080fd5b94506020860135935060408601359250606086013567ffffffffffffffff8082111561054b57600080fd5b818801915088601f83011261055f57600080fd5b81358181111561057157610571610494565b604051601f82017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0908116603f011681019083821181831017156105b7576105b7610494565b816040528281528b60208487010111156105d057600080fd5b8260208601602083013760006020848301015280965050505050506105f7608087016104d4565b90509295509295909350565b60006020828403121561061557600080fd5b8151610620816104c3565b9392505050565b6000815180845260005b8181101561064d57602081850181015186830182015201610631565b5060006020828601015260207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f83011685010191505092915050565b600061014073ffffffffffffffffffffffffffffffffffffffff808716845280865116602085015280602087015116604085015280604087015116606085015280606087015116608085015250608085015160a084015260a085015160c084015260c085015160e08401528061010084015261070d8184016000815260200190565b90508281036101208401526107228185610627565b9695505050505050565b6000806040838503121561073f57600080fd5b50508051602090910151909290915056fea26469706673582212201cb8a535426b4a44845edc534db759da911a7856b5044dd9b2aab90ecab41fa964736f6c634300081000330000000000000000000000001111111254eeb25477b68fb85ed929f73a960582000000000000000000000000f0694acc9e941b176e17b9ef923e71e7b8b2477a0000000000000000000000007f5c764cbc14f9669b88837ca1490cca17c31607000000000000000000000000f0694acc9e941b176e17b9ef923e71e7b8b2477a" - } - ], - "isFixedGasLimit": false - }, - { - "hash": "0x27fbaa8e6c4abe793fad7d09a756fae18199bf4416a44d932b4e47994cb2fad8", - "transactionType": "CALL", - "contractName": "OneInchRouterFactory", - "contractAddress": "0x8ea1Cec74fA7CDdfE8056198ef1A3718aDae2895", - "function": "deploy(uint8,address):(address)", - "arguments": ["0", "0x7F5c764cBc14f9669B88837ca1490cCa17c31607"], - "rpc": "", - "transaction": { - "type": "0x00", - "from": "0xeac5f0d4a9a45e1f9fdd0e7e2882e9f60e301156", - "to": "0x8ea1cec74fa7cddfe8056198ef1a3718adae2895", - "gas": "0xa6a3b", - "value": "0x0", - "data": "0x44b6b33300000000000000000000000000000000000000000000000000000000000000000000000000000000000000007f5c764cbc14f9669b88837ca1490cca17c31607", - "nonce": "0x1d" - }, - "additionalContracts": [ - { - "transactionType": "CREATE2", - "address": "0x444A406C15e6F87Aee894999cb13B4ff1D61a85B", - "initCode": "61010060405234801561001157600080fd5b5060405161092e38038061092e8339810160408190526100309161006a565b6001600160a01b0392831660805292821660a052811660c0521660e0526100c9565b6001600160a01b038116811461006757600080fd5b50565b6000806000806080858703121561008057600080fd5b845161008b81610052565b602086015190945061009c81610052565b60408601519093506100ad81610052565b60608601519092506100be81610052565b939692955090935050565b60805160a05160c05160e0516107fc610132600039600081816102c2015261048901526000818160b7015281816101910152818161026a01526104550152600081816101620152818161020101526103c401526000818161023d015261042101526107fc6000f3fe6080604052600436106100435760003560e01c80630621153b146103b25780634803f27a1461040f57806382bfefc814610443578063ff8ce5d0146104775761004a565b3661004a57005b60008080808061005a36826104fb565b6040517f23b872dd000000000000000000000000000000000000000000000000000000008152336004820152306024820152604481018590529499509297509095509350915073ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000000000000000000000000000000000000000000016906323b872dd906064016020604051808303816000875af1158015610100573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610124919061061a565b506040517f095ea7b300000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000000000000000000000000000000000000000000081166004830152602482018690527f0000000000000000000000000000000000000000000000000000000000000000169063095ea7b3906044016020604051808303816000875af11580156101da573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906101fe919061061a565b507f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff16637c0252007f00000000000000000000000000000000000000000000000000000000000000006040518061010001604052807f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff1681526020018973ffffffffffffffffffffffffffffffffffffffff1681526020017f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff1681526020013373ffffffffffffffffffffffffffffffffffffffff16815260200188815260200187815260200185610330576000610333565b60015b60ff16815260200160405180602001604052806000815250815250856040518463ffffffff1660e01b815260040161036d939291906106a2565b6060604051808303816000875af115801561038c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906103b09190610798565b005b3480156103be57600080fd5b506103e67f000000000000000000000000000000000000000000000000000000000000000081565b60405173ffffffffffffffffffffffffffffffffffffffff909116815260200160405180910390f35b34801561041b57600080fd5b506103e67f000000000000000000000000000000000000000000000000000000000000000081565b34801561044f57600080fd5b506103e67f000000000000000000000000000000000000000000000000000000000000000081565b34801561048357600080fd5b506103e67f000000000000000000000000000000000000000000000000000000000000000081565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b80151581146104e857600080fd5b50565b80356104f6816104da565b919050565b600080600080600060a0868803121561051357600080fd5b853573ffffffffffffffffffffffffffffffffffffffff8116811461053757600080fd5b94506020860135935060408601359250606086013567ffffffffffffffff8082111561056257600080fd5b818801915088601f83011261057657600080fd5b813581811115610588576105886104ab565b604051601f82017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0908116603f011681019083821181831017156105ce576105ce6104ab565b816040528281528b60208487010111156105e757600080fd5b82602086016020830137600060208483010152809650505050505061060e608087016104eb565b90509295509295909350565b60006020828403121561062c57600080fd5b8151610637816104da565b9392505050565b6000815180845260005b8181101561066457602081850181015186830182015201610648565b5060006020828601015260207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f83011685010191505092915050565b600073ffffffffffffffffffffffffffffffffffffffff8086168352606060208401528085511660608401525060208401516106f6608084018273ffffffffffffffffffffffffffffffffffffffff169052565b50604084015173ffffffffffffffffffffffffffffffffffffffff811660a084015250606084015173ffffffffffffffffffffffffffffffffffffffff811660c084015250608084015160e083015260a0840151610100818185015260c086015161012085015260e08601519150806101408501525061077a61016084018261063e565b9050828103604084015261078e818561063e565b9695505050505050565b6000806000606084860312156107ad57600080fd5b835192506020840151915060408401519050925092509256fea264697066735822122096bc8c2fe4e7c03521d6276cc5b954661b17e7b6252165a773e142559729e0b564736f6c634300081000330000000000000000000000001111111254760f7ab3f16433eea9304126dcd199000000000000000000000000f0694acc9e941b176e17b9ef923e71e7b8b2477a0000000000000000000000007f5c764cbc14f9669b88837ca1490cca17c31607000000000000000000000000f0694acc9e941b176e17b9ef923e71e7b8b2477a" - } - ], - "isFixedGasLimit": false - } - ], - "receipts": [ - { - "transactionHash": "0x007eeabf910018da20ef36241f5474d69fa6a608e7991d41d65a90767bcf9349", - "transactionIndex": "0x0", - "blockHash": "0x545f7a5f24b1e94a9487bdbb34214846f580e7880122d3d8b9095e734e11e361", - "blockNumber": "0x5b1f8ea", - "from": "0xEAC5F0d4A9a45E1f9FdD0e7e2882e9f60E301156", - "to": null, - "cumulativeGasUsed": "0x16e59d", - "gasUsed": "0x16e59d", - "contractAddress": "0x8ea1Cec74fA7CDdfE8056198ef1A3718aDae2895", - "logs": [], - "status": "0x1", - "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000" - }, - { - "transactionHash": "0xeb42f66b829c3b569a90d3bc9df1108a1803fce3712a3e6cd57d6e0ea25e9224", - "transactionIndex": "0x0", - "blockHash": "0xf9e514b19458ff3c30783a26e64edaaabb7ebce28f18f0dea582cc99765a9d3e", - "blockNumber": "0x5b1f900", - "from": "0xEAC5F0d4A9a45E1f9FdD0e7e2882e9f60E301156", - "to": "0x8ea1Cec74fA7CDdfE8056198ef1A3718aDae2895", - "cumulativeGasUsed": "0x6c277", - "gasUsed": "0x6c277", - "contractAddress": null, - "logs": [ - { - "address": "0x8ea1Cec74fA7CDdfE8056198ef1A3718aDae2895", - "topics": [ - "0x8b7908ccc516745a211cceb7b00399a7bc2db042629feefb1daf11d8fa7eda99", - "0x0000000000000000000000007f5c764cbc14f9669b88837ca1490cca17c31607" - ], - "data": "0x0000000000000000000000000000000000000000000000000000000000000001", - "blockHash": "0xf9e514b19458ff3c30783a26e64edaaabb7ebce28f18f0dea582cc99765a9d3e", - "blockNumber": "0x5b1f900", - "transactionHash": "0xeb42f66b829c3b569a90d3bc9df1108a1803fce3712a3e6cd57d6e0ea25e9224", - "transactionIndex": "0x0", - "logIndex": "0x0", - "removed": false - } - ], - "status": "0x1", - "logsBloom": "0x00000000000000000004001100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002000000000000000000000002000000000000000000000000000000000000000000000000000000000008000400000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000" - }, - { - "transactionHash": "0x27fbaa8e6c4abe793fad7d09a756fae18199bf4416a44d932b4e47994cb2fad8", - "transactionIndex": "0x0", - "blockHash": "0x27e794efc4a1064cfa8f1c3ac4dbe931d31e9cff58007f17f106de0c10385966", - "blockNumber": "0x5b1f910", - "from": "0xEAC5F0d4A9a45E1f9FdD0e7e2882e9f60E301156", - "to": "0x8ea1Cec74fA7CDdfE8056198ef1A3718aDae2895", - "cumulativeGasUsed": "0x71f11", - "gasUsed": "0x71f11", - "contractAddress": null, - "logs": [ - { - "address": "0x8ea1Cec74fA7CDdfE8056198ef1A3718aDae2895", - "topics": [ - "0x8b7908ccc516745a211cceb7b00399a7bc2db042629feefb1daf11d8fa7eda99", - "0x0000000000000000000000007f5c764cbc14f9669b88837ca1490cca17c31607" - ], - "data": "0x0000000000000000000000000000000000000000000000000000000000000000", - "blockHash": "0x27e794efc4a1064cfa8f1c3ac4dbe931d31e9cff58007f17f106de0c10385966", - "blockNumber": "0x5b1f910", - "transactionHash": "0x27fbaa8e6c4abe793fad7d09a756fae18199bf4416a44d932b4e47994cb2fad8", - "transactionIndex": "0x0", - "logIndex": "0x0", - "removed": false - } - ], - "status": "0x1", - "logsBloom": "0x00000000000000000004001100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002000000000000000000000002000000000000000000000000000000000000000000000000000000000008000400000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000" - } - ], - "libraries": [], - "pending": [], - "path": "", - "returns": {}, - "timestamp": 1682875572, - "chain": 10, - "multi": false, - "commit": "950f1ff" -} diff --git a/broadcast/Deploy.s.sol/10/run-latest.json b/broadcast/Deploy.s.sol/10/run-latest.json deleted file mode 100644 index 7aa893d..0000000 --- a/broadcast/Deploy.s.sol/10/run-latest.json +++ /dev/null @@ -1,162 +0,0 @@ -{ - "transactions": [ - { - "hash": "0x007eeabf910018da20ef36241f5474d69fa6a608e7991d41d65a90767bcf9349", - "transactionType": "CREATE", - "contractName": "OneInchRouterFactory", - "contractAddress": "0x8ea1Cec74fA7CDdfE8056198ef1A3718aDae2895", - "function": null, - "arguments": [ - "0xf0694ACc9E941B176E17B9Ef923e71E7B8b2477A", - "0x1111111254EEB25477B68fb85Ed929f73A960582", - "0xf0694ACc9E941B176E17B9Ef923e71E7B8b2477A", - "0x1111111254760F7ab3F16433eea9304126DCd199" - ], - "rpc": "https://opt-mainnet.g.alchemy.com/v2/_A7lZ2J0FrbUnvsj0wE0ZDiyHBg8C148", - "transaction": { - "type": "0x00", - "from": "0xeac5f0d4a9a45e1f9fdd0e7e2882e9f60e301156", - "gas": "0x1dc418", - "value": "0x0", - "data": "0x61014060405234801561001157600080fd5b50604051611bde380380611bde8339810160408190526100309161007a565b6001600160a01b03938416608081905292841660a05261010092909252821660c0819052911660e052610120526100d9565b6001600160a01b038116811461007757600080fd5b50565b6000806000806080858703121561009057600080fd5b845161009b81610062565b60208601519094506100ac81610062565b60408601519093506100bd81610062565b60608601519092506100ce81610062565b939692955090935050565b60805160a05160c05160e0516101005161012051611a6461017a6000396000818161011c015281816103a901526104fc01526000818161017d015281816102c2015261060b0152600081816101a40152818161036601526104a201526000818160ce0152818161038701526104ca01526000818160f50152818161027f01526105b1015260008181610156015281816102a001526105d90152611a646000f3fe608060405234801561001057600080fd5b50600436106100885760003560e01c806344b6b3331161005b57806344b6b3331461013e578063ced156d914610151578063d0a32a3b14610178578063eafc4d611461019f57600080fd5b80630e6e0fb21461008d57806312d69f9a146100c957806333e81795146100f05780633cffdecc14610117575b600080fd5b6100a061009b366004610735565b6101c6565b60405173ffffffffffffffffffffffffffffffffffffffff909116815260200160405180910390f35b6100a07f000000000000000000000000000000000000000000000000000000000000000081565b6100a07f000000000000000000000000000000000000000000000000000000000000000081565b6100a07f000000000000000000000000000000000000000000000000000000000000000081565b6100a061014c366004610735565b61024a565b6100a07f000000000000000000000000000000000000000000000000000000000000000081565b6100a07f000000000000000000000000000000000000000000000000000000000000000081565b6100a07f000000000000000000000000000000000000000000000000000000000000000081565b6000808360018111156101db576101db61078b565b036101f0576101e98261042a565b9050610244565b60018360018111156102045761020461078b565b03610212576101e982610539565b6040517fe34f15ca00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b92915050565b600073ffffffffffffffffffffffffffffffffffffffff821681600185818111156102775761027761078b565b0361034a57817f00000000000000000000000000000000000000000000000000000000000000007f0000000000000000000000000000000000000000000000000000000000000000867f00000000000000000000000000000000000000000000000000000000000000006040516102ed9061071b565b73ffffffffffffffffffffffffffffffffffffffff94851681529284166020840152908316604083015290911660608201526080018190604051809103906000f5905080158015610342573d6000803e3d6000fd5b5090506103d4565b600085600181111561035e5761035e61078b565b0361021257817f00000000000000000000000000000000000000000000000000000000000000007f0000000000000000000000000000000000000000000000000000000000000000867f00000000000000000000000000000000000000000000000000000000000000006040516102ed90610728565b8373ffffffffffffffffffffffffffffffffffffffff167f8b7908ccc516745a211cceb7b00399a7bc2db042629feefb1daf11d8fa7eda998660405161041a91906107ba565b60405180910390a2949350505050565b600061024473ffffffffffffffffffffffffffffffffffffffff8316306040518060200161045790610728565b8181037fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe09081018352601f90910116604081815273ffffffffffffffffffffffffffffffffffffffff7f0000000000000000000000000000000000000000000000000000000000000000811660208401527f000000000000000000000000000000000000000000000000000000000000000081169183019190915280881660608301527f000000000000000000000000000000000000000000000000000000000000000016608082015260a0015b604051602081830303815290604052610638565b600061024473ffffffffffffffffffffffffffffffffffffffff831630604051806020016105669061071b565b8181037fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe09081018352601f90910116604081815273ffffffffffffffffffffffffffffffffffffffff7f0000000000000000000000000000000000000000000000000000000000000000811660208401527f000000000000000000000000000000000000000000000000000000000000000081169183019190915280881660608301527f000000000000000000000000000000000000000000000000000000000000000016608082015260a001610525565b600060ff60f81b8486858560405160200161065492919061082b565b604051602081830303815290604052805190602001206040516020016106dc94939291907fff0000000000000000000000000000000000000000000000000000000000000094909416845260609290921b7fffffffffffffffffffffffffffffffffffffffff0000000000000000000000001660018401526015830152603582015260550190565b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0818403018152919052805160209091012095945050505050565b6108b88061084983390190565b61092e8061110183390190565b6000806040838503121561074857600080fd5b82356002811061075757600080fd5b9150602083013573ffffffffffffffffffffffffffffffffffffffff8116811461078057600080fd5b809150509250929050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fd5b60208101600283106107f5577f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fd5b91905290565b6000815160005b8181101561081c5760208185018101518683015201610802565b50600093019283525090919050565b600061084061083a83866107fb565b846107fb565b94935050505056fe61010060405234801561001157600080fd5b506040516108b83803806108b88339810160408190526100309161006a565b6001600160a01b0392831660805292821660a052811660c0521660e0526100c9565b6001600160a01b038116811461006757600080fd5b50565b6000806000806080858703121561008057600080fd5b845161008b81610052565b602086015190945061009c81610052565b60408601519093506100ad81610052565b60608601519092506100be81610052565b939692955090935050565b60805160a05160c05160e051610786610132600039600081816102c1015261047201526000818160b70152818161019101528181610269015261043e0152600081816101620152818161020101526103ad01526000818161023d015261040a01526107866000f3fe6080604052600436106100435760003560e01c80630621153b1461039b5780634803f27a146103f857806382bfefc81461042c578063ff8ce5d0146104605761004a565b3661004a57005b60008080808061005a36826104e4565b6040517f23b872dd000000000000000000000000000000000000000000000000000000008152336004820152306024820152604481018590529499509297509095509350915073ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000000000000000000000000000000000000000000016906323b872dd906064016020604051808303816000875af1158015610100573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906101249190610603565b506040517f095ea7b300000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000000000000000000000000000000000000000000081166004830152602482018690527f0000000000000000000000000000000000000000000000000000000000000000169063095ea7b3906044016020604051808303816000875af11580156101da573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906101fe9190610603565b507f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff166312aa3caf7f00000000000000000000000000000000000000000000000000000000000000006040518060e001604052807f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff1681526020018973ffffffffffffffffffffffffffffffffffffffff1681526020017f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff1681526020013373ffffffffffffffffffffffffffffffffffffffff1681526020018881526020018781526020018561032f576000610332565b60015b60ff16815250856040518463ffffffff1660e01b81526004016103579392919061068b565b60408051808303816000875af1158015610375573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610399919061072c565b005b3480156103a757600080fd5b506103cf7f000000000000000000000000000000000000000000000000000000000000000081565b60405173ffffffffffffffffffffffffffffffffffffffff909116815260200160405180910390f35b34801561040457600080fd5b506103cf7f000000000000000000000000000000000000000000000000000000000000000081565b34801561043857600080fd5b506103cf7f000000000000000000000000000000000000000000000000000000000000000081565b34801561046c57600080fd5b506103cf7f000000000000000000000000000000000000000000000000000000000000000081565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b80151581146104d157600080fd5b50565b80356104df816104c3565b919050565b600080600080600060a086880312156104fc57600080fd5b853573ffffffffffffffffffffffffffffffffffffffff8116811461052057600080fd5b94506020860135935060408601359250606086013567ffffffffffffffff8082111561054b57600080fd5b818801915088601f83011261055f57600080fd5b81358181111561057157610571610494565b604051601f82017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0908116603f011681019083821181831017156105b7576105b7610494565b816040528281528b60208487010111156105d057600080fd5b8260208601602083013760006020848301015280965050505050506105f7608087016104d4565b90509295509295909350565b60006020828403121561061557600080fd5b8151610620816104c3565b9392505050565b6000815180845260005b8181101561064d57602081850181015186830182015201610631565b5060006020828601015260207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f83011685010191505092915050565b600061014073ffffffffffffffffffffffffffffffffffffffff808716845280865116602085015280602087015116604085015280604087015116606085015280606087015116608085015250608085015160a084015260a085015160c084015260c085015160e08401528061010084015261070d8184016000815260200190565b90508281036101208401526107228185610627565b9695505050505050565b6000806040838503121561073f57600080fd5b50508051602090910151909290915056fea26469706673582212201cb8a535426b4a44845edc534db759da911a7856b5044dd9b2aab90ecab41fa964736f6c6343000810003361010060405234801561001157600080fd5b5060405161092e38038061092e8339810160408190526100309161006a565b6001600160a01b0392831660805292821660a052811660c0521660e0526100c9565b6001600160a01b038116811461006757600080fd5b50565b6000806000806080858703121561008057600080fd5b845161008b81610052565b602086015190945061009c81610052565b60408601519093506100ad81610052565b60608601519092506100be81610052565b939692955090935050565b60805160a05160c05160e0516107fc610132600039600081816102c2015261048901526000818160b7015281816101910152818161026a01526104550152600081816101620152818161020101526103c401526000818161023d015261042101526107fc6000f3fe6080604052600436106100435760003560e01c80630621153b146103b25780634803f27a1461040f57806382bfefc814610443578063ff8ce5d0146104775761004a565b3661004a57005b60008080808061005a36826104fb565b6040517f23b872dd000000000000000000000000000000000000000000000000000000008152336004820152306024820152604481018590529499509297509095509350915073ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000000000000000000000000000000000000000000016906323b872dd906064016020604051808303816000875af1158015610100573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610124919061061a565b506040517f095ea7b300000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000000000000000000000000000000000000000000081166004830152602482018690527f0000000000000000000000000000000000000000000000000000000000000000169063095ea7b3906044016020604051808303816000875af11580156101da573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906101fe919061061a565b507f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff16637c0252007f00000000000000000000000000000000000000000000000000000000000000006040518061010001604052807f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff1681526020018973ffffffffffffffffffffffffffffffffffffffff1681526020017f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff1681526020013373ffffffffffffffffffffffffffffffffffffffff16815260200188815260200187815260200185610330576000610333565b60015b60ff16815260200160405180602001604052806000815250815250856040518463ffffffff1660e01b815260040161036d939291906106a2565b6060604051808303816000875af115801561038c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906103b09190610798565b005b3480156103be57600080fd5b506103e67f000000000000000000000000000000000000000000000000000000000000000081565b60405173ffffffffffffffffffffffffffffffffffffffff909116815260200160405180910390f35b34801561041b57600080fd5b506103e67f000000000000000000000000000000000000000000000000000000000000000081565b34801561044f57600080fd5b506103e67f000000000000000000000000000000000000000000000000000000000000000081565b34801561048357600080fd5b506103e67f000000000000000000000000000000000000000000000000000000000000000081565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b80151581146104e857600080fd5b50565b80356104f6816104da565b919050565b600080600080600060a0868803121561051357600080fd5b853573ffffffffffffffffffffffffffffffffffffffff8116811461053757600080fd5b94506020860135935060408601359250606086013567ffffffffffffffff8082111561056257600080fd5b818801915088601f83011261057657600080fd5b813581811115610588576105886104ab565b604051601f82017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0908116603f011681019083821181831017156105ce576105ce6104ab565b816040528281528b60208487010111156105e757600080fd5b82602086016020830137600060208483010152809650505050505061060e608087016104eb565b90509295509295909350565b60006020828403121561062c57600080fd5b8151610637816104da565b9392505050565b6000815180845260005b8181101561066457602081850181015186830182015201610648565b5060006020828601015260207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f83011685010191505092915050565b600073ffffffffffffffffffffffffffffffffffffffff8086168352606060208401528085511660608401525060208401516106f6608084018273ffffffffffffffffffffffffffffffffffffffff169052565b50604084015173ffffffffffffffffffffffffffffffffffffffff811660a084015250606084015173ffffffffffffffffffffffffffffffffffffffff811660c084015250608084015160e083015260a0840151610100818185015260c086015161012085015260e08601519150806101408501525061077a61016084018261063e565b9050828103604084015261078e818561063e565b9695505050505050565b6000806000606084860312156107ad57600080fd5b835192506020840151915060408401519050925092509256fea264697066735822122096bc8c2fe4e7c03521d6276cc5b954661b17e7b6252165a773e142559729e0b564736f6c63430008100033a2646970667358221220ac5f1d19eca2c9bc1bb026006b1b194aa989df53d745cb41149386f21415660364736f6c63430008100033000000000000000000000000f0694acc9e941b176e17b9ef923e71e7b8b2477a0000000000000000000000001111111254eeb25477b68fb85ed929f73a960582000000000000000000000000f0694acc9e941b176e17b9ef923e71e7b8b2477a0000000000000000000000001111111254760f7ab3f16433eea9304126dcd199", - "nonce": "0x1b" - }, - "additionalContracts": [], - "isFixedGasLimit": false - }, - { - "hash": "0xeb42f66b829c3b569a90d3bc9df1108a1803fce3712a3e6cd57d6e0ea25e9224", - "transactionType": "CALL", - "contractName": "OneInchRouterFactory", - "contractAddress": "0x8ea1Cec74fA7CDdfE8056198ef1A3718aDae2895", - "function": "deploy(uint8,address):(address)", - "arguments": ["1", "0x7F5c764cBc14f9669B88837ca1490cCa17c31607"], - "rpc": "https://opt-mainnet.g.alchemy.com/v2/_A7lZ2J0FrbUnvsj0wE0ZDiyHBg8C148", - "transaction": { - "type": "0x00", - "from": "0xeac5f0d4a9a45e1f9fdd0e7e2882e9f60e301156", - "to": "0x8ea1cec74fa7cddfe8056198ef1a3718adae2895", - "gas": "0x95633", - "value": "0x0", - "data": "0x44b6b33300000000000000000000000000000000000000000000000000000000000000010000000000000000000000007f5c764cbc14f9669b88837ca1490cca17c31607", - "nonce": "0x1c" - }, - "additionalContracts": [ - { - "transactionType": "CREATE2", - "address": "0xB17cCEE669aB2cc40A6564DA84Db66dD8D144CB4", - "initCode": "61010060405234801561001157600080fd5b506040516108b83803806108b88339810160408190526100309161006a565b6001600160a01b0392831660805292821660a052811660c0521660e0526100c9565b6001600160a01b038116811461006757600080fd5b50565b6000806000806080858703121561008057600080fd5b845161008b81610052565b602086015190945061009c81610052565b60408601519093506100ad81610052565b60608601519092506100be81610052565b939692955090935050565b60805160a05160c05160e051610786610132600039600081816102c1015261047201526000818160b70152818161019101528181610269015261043e0152600081816101620152818161020101526103ad01526000818161023d015261040a01526107866000f3fe6080604052600436106100435760003560e01c80630621153b1461039b5780634803f27a146103f857806382bfefc81461042c578063ff8ce5d0146104605761004a565b3661004a57005b60008080808061005a36826104e4565b6040517f23b872dd000000000000000000000000000000000000000000000000000000008152336004820152306024820152604481018590529499509297509095509350915073ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000000000000000000000000000000000000000000016906323b872dd906064016020604051808303816000875af1158015610100573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906101249190610603565b506040517f095ea7b300000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000000000000000000000000000000000000000000081166004830152602482018690527f0000000000000000000000000000000000000000000000000000000000000000169063095ea7b3906044016020604051808303816000875af11580156101da573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906101fe9190610603565b507f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff166312aa3caf7f00000000000000000000000000000000000000000000000000000000000000006040518060e001604052807f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff1681526020018973ffffffffffffffffffffffffffffffffffffffff1681526020017f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff1681526020013373ffffffffffffffffffffffffffffffffffffffff1681526020018881526020018781526020018561032f576000610332565b60015b60ff16815250856040518463ffffffff1660e01b81526004016103579392919061068b565b60408051808303816000875af1158015610375573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610399919061072c565b005b3480156103a757600080fd5b506103cf7f000000000000000000000000000000000000000000000000000000000000000081565b60405173ffffffffffffffffffffffffffffffffffffffff909116815260200160405180910390f35b34801561040457600080fd5b506103cf7f000000000000000000000000000000000000000000000000000000000000000081565b34801561043857600080fd5b506103cf7f000000000000000000000000000000000000000000000000000000000000000081565b34801561046c57600080fd5b506103cf7f000000000000000000000000000000000000000000000000000000000000000081565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b80151581146104d157600080fd5b50565b80356104df816104c3565b919050565b600080600080600060a086880312156104fc57600080fd5b853573ffffffffffffffffffffffffffffffffffffffff8116811461052057600080fd5b94506020860135935060408601359250606086013567ffffffffffffffff8082111561054b57600080fd5b818801915088601f83011261055f57600080fd5b81358181111561057157610571610494565b604051601f82017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0908116603f011681019083821181831017156105b7576105b7610494565b816040528281528b60208487010111156105d057600080fd5b8260208601602083013760006020848301015280965050505050506105f7608087016104d4565b90509295509295909350565b60006020828403121561061557600080fd5b8151610620816104c3565b9392505050565b6000815180845260005b8181101561064d57602081850181015186830182015201610631565b5060006020828601015260207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f83011685010191505092915050565b600061014073ffffffffffffffffffffffffffffffffffffffff808716845280865116602085015280602087015116604085015280604087015116606085015280606087015116608085015250608085015160a084015260a085015160c084015260c085015160e08401528061010084015261070d8184016000815260200190565b90508281036101208401526107228185610627565b9695505050505050565b6000806040838503121561073f57600080fd5b50508051602090910151909290915056fea26469706673582212201cb8a535426b4a44845edc534db759da911a7856b5044dd9b2aab90ecab41fa964736f6c634300081000330000000000000000000000001111111254eeb25477b68fb85ed929f73a960582000000000000000000000000f0694acc9e941b176e17b9ef923e71e7b8b2477a0000000000000000000000007f5c764cbc14f9669b88837ca1490cca17c31607000000000000000000000000f0694acc9e941b176e17b9ef923e71e7b8b2477a" - } - ], - "isFixedGasLimit": false - }, - { - "hash": "0x27fbaa8e6c4abe793fad7d09a756fae18199bf4416a44d932b4e47994cb2fad8", - "transactionType": "CALL", - "contractName": "OneInchRouterFactory", - "contractAddress": "0x8ea1Cec74fA7CDdfE8056198ef1A3718aDae2895", - "function": "deploy(uint8,address):(address)", - "arguments": ["0", "0x7F5c764cBc14f9669B88837ca1490cCa17c31607"], - "rpc": "https://opt-mainnet.g.alchemy.com/v2/_A7lZ2J0FrbUnvsj0wE0ZDiyHBg8C148", - "transaction": { - "type": "0x00", - "from": "0xeac5f0d4a9a45e1f9fdd0e7e2882e9f60e301156", - "to": "0x8ea1cec74fa7cddfe8056198ef1a3718adae2895", - "gas": "0xa6a3b", - "value": "0x0", - "data": "0x44b6b33300000000000000000000000000000000000000000000000000000000000000000000000000000000000000007f5c764cbc14f9669b88837ca1490cca17c31607", - "nonce": "0x1d" - }, - "additionalContracts": [ - { - "transactionType": "CREATE2", - "address": "0x444A406C15e6F87Aee894999cb13B4ff1D61a85B", - "initCode": "61010060405234801561001157600080fd5b5060405161092e38038061092e8339810160408190526100309161006a565b6001600160a01b0392831660805292821660a052811660c0521660e0526100c9565b6001600160a01b038116811461006757600080fd5b50565b6000806000806080858703121561008057600080fd5b845161008b81610052565b602086015190945061009c81610052565b60408601519093506100ad81610052565b60608601519092506100be81610052565b939692955090935050565b60805160a05160c05160e0516107fc610132600039600081816102c2015261048901526000818160b7015281816101910152818161026a01526104550152600081816101620152818161020101526103c401526000818161023d015261042101526107fc6000f3fe6080604052600436106100435760003560e01c80630621153b146103b25780634803f27a1461040f57806382bfefc814610443578063ff8ce5d0146104775761004a565b3661004a57005b60008080808061005a36826104fb565b6040517f23b872dd000000000000000000000000000000000000000000000000000000008152336004820152306024820152604481018590529499509297509095509350915073ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000000000000000000000000000000000000000000016906323b872dd906064016020604051808303816000875af1158015610100573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610124919061061a565b506040517f095ea7b300000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000000000000000000000000000000000000000000081166004830152602482018690527f0000000000000000000000000000000000000000000000000000000000000000169063095ea7b3906044016020604051808303816000875af11580156101da573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906101fe919061061a565b507f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff16637c0252007f00000000000000000000000000000000000000000000000000000000000000006040518061010001604052807f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff1681526020018973ffffffffffffffffffffffffffffffffffffffff1681526020017f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff1681526020013373ffffffffffffffffffffffffffffffffffffffff16815260200188815260200187815260200185610330576000610333565b60015b60ff16815260200160405180602001604052806000815250815250856040518463ffffffff1660e01b815260040161036d939291906106a2565b6060604051808303816000875af115801561038c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906103b09190610798565b005b3480156103be57600080fd5b506103e67f000000000000000000000000000000000000000000000000000000000000000081565b60405173ffffffffffffffffffffffffffffffffffffffff909116815260200160405180910390f35b34801561041b57600080fd5b506103e67f000000000000000000000000000000000000000000000000000000000000000081565b34801561044f57600080fd5b506103e67f000000000000000000000000000000000000000000000000000000000000000081565b34801561048357600080fd5b506103e67f000000000000000000000000000000000000000000000000000000000000000081565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b80151581146104e857600080fd5b50565b80356104f6816104da565b919050565b600080600080600060a0868803121561051357600080fd5b853573ffffffffffffffffffffffffffffffffffffffff8116811461053757600080fd5b94506020860135935060408601359250606086013567ffffffffffffffff8082111561056257600080fd5b818801915088601f83011261057657600080fd5b813581811115610588576105886104ab565b604051601f82017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0908116603f011681019083821181831017156105ce576105ce6104ab565b816040528281528b60208487010111156105e757600080fd5b82602086016020830137600060208483010152809650505050505061060e608087016104eb565b90509295509295909350565b60006020828403121561062c57600080fd5b8151610637816104da565b9392505050565b6000815180845260005b8181101561066457602081850181015186830182015201610648565b5060006020828601015260207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f83011685010191505092915050565b600073ffffffffffffffffffffffffffffffffffffffff8086168352606060208401528085511660608401525060208401516106f6608084018273ffffffffffffffffffffffffffffffffffffffff169052565b50604084015173ffffffffffffffffffffffffffffffffffffffff811660a084015250606084015173ffffffffffffffffffffffffffffffffffffffff811660c084015250608084015160e083015260a0840151610100818185015260c086015161012085015260e08601519150806101408501525061077a61016084018261063e565b9050828103604084015261078e818561063e565b9695505050505050565b6000806000606084860312156107ad57600080fd5b835192506020840151915060408401519050925092509256fea264697066735822122096bc8c2fe4e7c03521d6276cc5b954661b17e7b6252165a773e142559729e0b564736f6c634300081000330000000000000000000000001111111254760f7ab3f16433eea9304126dcd199000000000000000000000000f0694acc9e941b176e17b9ef923e71e7b8b2477a0000000000000000000000007f5c764cbc14f9669b88837ca1490cca17c31607000000000000000000000000f0694acc9e941b176e17b9ef923e71e7b8b2477a" - } - ], - "isFixedGasLimit": false - } - ], - "receipts": [ - { - "transactionHash": "0x007eeabf910018da20ef36241f5474d69fa6a608e7991d41d65a90767bcf9349", - "transactionIndex": "0x0", - "blockHash": "0x545f7a5f24b1e94a9487bdbb34214846f580e7880122d3d8b9095e734e11e361", - "blockNumber": "0x5b1f8ea", - "from": "0xEAC5F0d4A9a45E1f9FdD0e7e2882e9f60E301156", - "to": null, - "cumulativeGasUsed": "0x16e59d", - "gasUsed": "0x16e59d", - "contractAddress": "0x8ea1Cec74fA7CDdfE8056198ef1A3718aDae2895", - "logs": [], - "status": "0x1", - "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000" - }, - { - "transactionHash": "0xeb42f66b829c3b569a90d3bc9df1108a1803fce3712a3e6cd57d6e0ea25e9224", - "transactionIndex": "0x0", - "blockHash": "0xf9e514b19458ff3c30783a26e64edaaabb7ebce28f18f0dea582cc99765a9d3e", - "blockNumber": "0x5b1f900", - "from": "0xEAC5F0d4A9a45E1f9FdD0e7e2882e9f60E301156", - "to": "0x8ea1Cec74fA7CDdfE8056198ef1A3718aDae2895", - "cumulativeGasUsed": "0x6c277", - "gasUsed": "0x6c277", - "contractAddress": null, - "logs": [ - { - "address": "0x8ea1Cec74fA7CDdfE8056198ef1A3718aDae2895", - "topics": [ - "0x8b7908ccc516745a211cceb7b00399a7bc2db042629feefb1daf11d8fa7eda99", - "0x0000000000000000000000007f5c764cbc14f9669b88837ca1490cca17c31607" - ], - "data": "0x0000000000000000000000000000000000000000000000000000000000000001", - "blockHash": "0xf9e514b19458ff3c30783a26e64edaaabb7ebce28f18f0dea582cc99765a9d3e", - "blockNumber": "0x5b1f900", - "transactionHash": "0xeb42f66b829c3b569a90d3bc9df1108a1803fce3712a3e6cd57d6e0ea25e9224", - "transactionIndex": "0x0", - "logIndex": "0x0", - "removed": false - } - ], - "status": "0x1", - "logsBloom": "0x00000000000000000004001100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002000000000000000000000002000000000000000000000000000000000000000000000000000000000008000400000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000" - }, - { - "transactionHash": "0x27fbaa8e6c4abe793fad7d09a756fae18199bf4416a44d932b4e47994cb2fad8", - "transactionIndex": "0x0", - "blockHash": "0x27e794efc4a1064cfa8f1c3ac4dbe931d31e9cff58007f17f106de0c10385966", - "blockNumber": "0x5b1f910", - "from": "0xEAC5F0d4A9a45E1f9FdD0e7e2882e9f60E301156", - "to": "0x8ea1Cec74fA7CDdfE8056198ef1A3718aDae2895", - "cumulativeGasUsed": "0x71f11", - "gasUsed": "0x71f11", - "contractAddress": null, - "logs": [ - { - "address": "0x8ea1Cec74fA7CDdfE8056198ef1A3718aDae2895", - "topics": [ - "0x8b7908ccc516745a211cceb7b00399a7bc2db042629feefb1daf11d8fa7eda99", - "0x0000000000000000000000007f5c764cbc14f9669b88837ca1490cca17c31607" - ], - "data": "0x0000000000000000000000000000000000000000000000000000000000000000", - "blockHash": "0x27e794efc4a1064cfa8f1c3ac4dbe931d31e9cff58007f17f106de0c10385966", - "blockNumber": "0x5b1f910", - "transactionHash": "0x27fbaa8e6c4abe793fad7d09a756fae18199bf4416a44d932b4e47994cb2fad8", - "transactionIndex": "0x0", - "logIndex": "0x0", - "removed": false - } - ], - "status": "0x1", - "logsBloom": "0x00000000000000000004001100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002000000000000000000000002000000000000000000000000000000000000000000000000000000000008000400000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000" - } - ], - "libraries": [], - "pending": [], - "path": "", - "returns": {}, - "timestamp": 1682875572, - "chain": 10, - "multi": false, - "commit": "950f1ff" -} diff --git a/script/Benchmark.s.sol b/script/Benchmark.s.sol deleted file mode 100644 index 058e87e..0000000 --- a/script/Benchmark.s.sol +++ /dev/null @@ -1,79 +0,0 @@ -// SPDX-License-Identifier: MIT -pragma solidity >=0.8.0; - -import {IERC20} from "openzeppelin-contracts/contracts/token/ERC20/IERC20.sol"; -import {Script, stdJson} from "forge-std/Script.sol"; - -import {IV5AggregationRouter} from "src/interfaces/IV5AggregationRouter.sol"; -import {IV4AggregationRouter} from "src/interfaces/IV4AggregationRouter.sol"; -import {OneInchContracts} from "test/OneInchContracts.sol"; -import "forge-std/console.sol"; - -// Script to get benchmarks the test will need -// to be swapped out for new data as it is meant -// to be used by a specific test wallet -contract Benchmark is Script, OneInchContracts { - using stdJson for string; - - error OptimizedV4RouterFailed(); - error OptimizedV5RouterFailed(); - - bytes public v5DataParams = - hex"12aa3caf000000000000000000000000f0694acc9e941b176e17b9ef923e71e7b8b2477a0000000000000000000000007f5c764cbc14f9669b88837ca1490cca17c316070000000000000000000000006fd9d7ad17242c41f7131d257212c54a0e816691000000000000000000000000f0694acc9e941b176e17b9ef923e71e7b8b2477a000000000000000000000000eac5f0d4a9a45e1f9fdd0e7e2882e9f60e30115600000000000000000000000000000000000000000000000000000000000186a0000000000000000000000000000000000000000000000000003e530a0ee30f45000000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000001400000000000000000000000000000000000000000000000000000000000000160000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001f50000000000000000000000000000000000000000000000000000000001d700a007e5c0d20000000000000000000000000000000000000000000000000001b30001505126a132dab612db5cb9fc9ac426a0cc215a3423f9c97f5c764cbc14f9669b88837ca1490cca17c316070004f41766d8000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002e2669c6242f00000000000000000000000000000000000000000000000000000000000000a0000000000000000000000000f0694acc9e941b176e17b9ef923e71e7b8b2477a00000000000000000000000000000000000000000000000000000000644fdfe900000000000000000000000000000000000000000000000000000000000000010000000000000000000000007f5c764cbc14f9669b88837ca1490cca17c316070000000000000000000000004200000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000102a0000000000000000000000000000000000000000000000000003e530a0ee30f45ee63c1e581ad4c666fc170b468b19988959eb931a3676f0e9f42000000000000000000000000000000000000061111111254eeb25477b68fb85ed929f73a9605820000000000000000000000cfee7c08"; - bytes public v4DataParams = - hex"7c025200000000000000000000000000f0694acc9e941b176e17b9ef923e71e7b8b2477a000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000001800000000000000000000000007f5c764cbc14f9669b88837ca1490cca17c316070000000000000000000000006fd9d7ad17242c41f7131d257212c54a0e816691000000000000000000000000f0694acc9e941b176e17b9ef923e71e7b8b2477a000000000000000000000000eac5f0d4a9a45e1f9fdd0e7e2882e9f60e30115600000000000000000000000000000000000000000000000000000000000186a0000000000000000000000000000000000000000000000000003e1aba8fed6bc100000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001e10000000000000000000000000000000000000000000000000000000001a300a007e5c0d200000000000000000000000000000000000000000000000000017f00011c4330f9d5940c2313636546ab9852354860dce275dbad00000000000000000000000000000000000000000000000000002ecaf7212e2f002424b31a0c000000000000000000000000f0694acc9e941b176e17b9ef923e71e7b8b2477a00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000fffd8963efd1fc6a506488495d951d5263988d2500000000000000000000000000000000000000000000000000000000000000a000000000000000000000000000000000000000000000000000000000000000200000000000000000000000007f5c764cbc14f9669b88837ca1490cca17c3160702a0000000000000000000000000000000000000000000000000003e1aba8fed6bc1ee63c1e581ad4c666fc170b468b19988959eb931a3676f0e9f42000000000000000000000000000000000000061111111254760f7ab3f16433eea9304126dcd19900000000000000000000000000000000000000000000000000000000000186a000000000000000000000000000000000000000000000000000000000000000cfee7c08"; - - function run() public { - require(block.chainid == 10, "script can only be run on optimism"); - string memory file = "broadcast/Deploy.s.sol/10/run-latest.json"; - string memory json = vm.readFile(file); - address v5Rtr = json.readAddress(".transactions[1].additionalContracts[0].address"); - - address v4Rtr = json.readAddress(".transactions[2].additionalContracts[0].address"); - - // =========================== - // ======== Execution ======== - // =========================== - - vm.startBroadcast(); - // Optimized v5 router approval - IERC20(USDC).approve(v5Rtr, 100_000); - // Regular v5 router approval - IERC20(USDC).approve(address(v5AggregationRouter), 100_000); - - // Parse calldata returned by the api to get params - ( - , - IV5AggregationRouter.SwapDescription memory v5Desc, - bytes memory v5Permit, - bytes memory v5Data - ) = abi.decode( - this.returnSliceBytes(v5DataParams), - (address, IV5AggregationRouter.SwapDescription, bytes, bytes) - ); - // Regular v5 swap call - v5AggregationRouter.swap(v5AggregationExecutor, v5Desc, v5Permit, v5Data); - - // Optimized router v5 swap call - (bool v5Ok,) = payable(v5Rtr).call(abi.encode(UNI, 100_000, v5Desc.minReturnAmount, v5Data, 0)); - - if (!v5Ok) revert OptimizedV5RouterFailed(); - - // Parse v4 calldata returned by the 1inch api - (, IV4AggregationRouter.SwapDescription memory v4Desc, bytes memory v4Data) = abi.decode( - this.returnSliceBytes(v4DataParams), (address, IV4AggregationRouter.SwapDescription, bytes) - ); - - // Optimized v4 router approval - IERC20(USDC).approve(v4Rtr, 100_000); - // Regular v4 router approval - IERC20(USDC).approve(address(v4AggregationRouter), 100_000); - - // Regular v4 swap call - v4AggregationRouter.swap(v4AggregationExecutor, v4Desc, v4Data); - - // Optimized v4 swap call - (bool v4Ok,) = payable(v4Rtr).call(abi.encode(UNI, 100_000, v4Desc.minReturnAmount, v4Data, 0)); - if (!v4Ok) revert OptimizedV4RouterFailed(); - } -} diff --git a/script/Deploy.s.sol b/script/Deploy.s.sol deleted file mode 100644 index 436eced..0000000 --- a/script/Deploy.s.sol +++ /dev/null @@ -1,29 +0,0 @@ -// SPDX-License-Identifier: UNLICENSED - -pragma solidity ^0.8.16; - -import {Script} from "forge-std/Script.sol"; -import {IERC20} from "openzeppelin-contracts/contracts/token/ERC20/IERC20.sol"; -import {OneInchContracts} from "test/OneInchContracts.sol"; -import {RouterFactory} from "src/RouterFactory.sol"; - -contract Deploy is Script, OneInchContracts { - function run() public { - // Deploy the optimized router factory - vm.broadcast(); - RouterFactory factory = new RouterFactory( - v5AggregationExecutor, - v5AggregationRouter, - v4AggregationExecutor, - v4AggregationRouter - ); - - // Deploy the optimized router for V5Aggregation - vm.broadcast(); - factory.deploy(RouterFactory.RouterType.V5AggregationRouter, USDC); - - // Deploy the optimized router for V4Aggregation - vm.broadcast(); - factory.deploy(RouterFactory.RouterType.V4AggregationRouter, USDC); - } -} From 53055f95dad74d90bb766eafc79b9418f56727c5 Mon Sep 17 00:00:00 2001 From: Keating Date: Sun, 21 May 2023 15:43:27 -0400 Subject: [PATCH 45/48] Change solidity version in create 2 --- test/lib/Create2.t.sol | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/lib/Create2.t.sol b/test/lib/Create2.t.sol index b907949..ce2591d 100644 --- a/test/lib/Create2.t.sol +++ b/test/lib/Create2.t.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: MIT -pragma solidity >=0.8.0; +pragma solidity ^0.8.0; import {Test} from "forge-std/Test.sol"; From d561bbe1df7f49c62f0a144e40f28c3f22974095 Mon Sep 17 00:00:00 2001 From: Keating Date: Sun, 21 May 2023 15:52:58 -0400 Subject: [PATCH 46/48] Change routerAddr to be set in the setup --- test/V4Router.t.sol | 5 ++--- test/V5Router.t.sol | 13 ++++++------- 2 files changed, 8 insertions(+), 10 deletions(-) diff --git a/test/V4Router.t.sol b/test/V4Router.t.sol index 5b6d08a..545c31b 100644 --- a/test/V4Router.t.sol +++ b/test/V4Router.t.sol @@ -49,6 +49,7 @@ contract Fallback is V4RouterTest { // If the data argument in these tests is recreated // than this address will potentially need to change. address swapSenderAddress; + address routerAddr; function setUp() public { vm.createSelectFork(vm.rpcUrl("optimism"), 95_544_472); @@ -61,6 +62,7 @@ contract Fallback is V4RouterTest { factory.deploy(RouterFactory.RouterType.V4AggregationRouter, USDC); deal(USDC, address(this), 100_000_000); swapSenderAddress = 0xEAC5F0d4A9a45E1f9FdD0e7e2882e9f60E301156; + routerAddr = factory.computeAddress(RouterFactory.RouterType.V4AggregationRouter, USDC); } function helper_nativeSwap( @@ -95,7 +97,6 @@ contract Fallback is V4RouterTest { (IV4AggregationRouter.SwapDescription memory desc, bytes memory data) = helper_apiParams(); // Setup the optimized router call vm.startPrank(swapSenderAddress); - address routerAddr = factory.computeAddress(RouterFactory.RouterType.V4AggregationRouter, USDC); IERC20(USDC).approve(routerAddr, 100_000); uint256 startingBalance = IERC20(UNI).balanceOf(swapSenderAddress); assertEq(startingBalance, 0, "Starting balance is incorrect"); @@ -118,7 +119,6 @@ contract Fallback is V4RouterTest { function testFork_RevertIf_NotEnoughFunds() public { (IV4AggregationRouter.SwapDescription memory desc, bytes memory data) = helper_apiParams(); - address routerAddr = factory.computeAddress(RouterFactory.RouterType.V4AggregationRouter, USDC); vm.startPrank(swapSenderAddress); IERC20(USDC).approve(routerAddr, 10_000_000); (bool ok,) = @@ -128,7 +128,6 @@ contract Fallback is V4RouterTest { function testFork_RevertIf_ZeroAddress() public { (IV4AggregationRouter.SwapDescription memory desc, bytes memory data) = helper_apiParams(); - address routerAddr = factory.computeAddress(RouterFactory.RouterType.V4AggregationRouter, USDC); IERC20(USDC).approve(routerAddr, 250_000); (bool ok,) = payable(routerAddr).call(abi.encode(address(0), 250_000, desc.minReturnAmount, data, 0)); diff --git a/test/V5Router.t.sol b/test/V5Router.t.sol index ea1220a..62b9cc5 100644 --- a/test/V5Router.t.sol +++ b/test/V5Router.t.sol @@ -49,6 +49,7 @@ contract Fallback is V5RouterTest { // If the data argument in these tests is recreated // than this address will potentially need to change. address swapSenderAddress; + address routerAddr; function setUp() public { vm.createSelectFork(vm.rpcUrl("optimism"), 94_524_034); @@ -62,6 +63,8 @@ contract Fallback is V5RouterTest { deal(USDC, address(this), 100_000_000); // Address the api calldata uses as the swapper swapSenderAddress = 0xEAC5F0d4A9a45E1f9FdD0e7e2882e9f60E301156; + + routerAddr = factory.computeAddress(RouterFactory.RouterType.V5AggregationRouter, USDC); } function helper_apiParams() @@ -86,10 +89,8 @@ contract Fallback is V5RouterTest { function helper_nativeSwap( IV5AggregationRouter.SwapDescription memory desc, bytes memory permit, - bytes memory data, - uint256 snapshotId + bytes memory data ) public returns (uint256) { - vm.revertTo(snapshotId); v5AggregationRouter.swap(v5AggregationExecutor, desc, permit, data); return IERC20(UNI).balanceOf(swapSenderAddress); } @@ -100,7 +101,6 @@ contract Fallback is V5RouterTest { helper_apiParams(); // Setup optimized router call vm.startPrank(swapSenderAddress); - address routerAddr = factory.computeAddress(RouterFactory.RouterType.V5AggregationRouter, USDC); IERC20(USDC).approve(routerAddr, 100_000); uint256 startingBalance = IERC20(UNI).balanceOf(swapSenderAddress); assertEq(startingBalance, 0, "Starting balance is not 0"); @@ -112,7 +112,8 @@ contract Fallback is V5RouterTest { // Compare balance to native aggregation router call uint256 endingBalance = IERC20(UNI).balanceOf(swapSenderAddress); - uint256 nativeEndingBalance = helper_nativeSwap(desc, permit, data, snapshotId); + vm.revertTo(snapshotId); + uint256 nativeEndingBalance = helper_nativeSwap(desc, permit, data); assertEq( endingBalance, nativeEndingBalance, @@ -123,7 +124,6 @@ contract Fallback is V5RouterTest { function testFork_RevertIf_NotEnoughFunds() public { (IV5AggregationRouter.SwapDescription memory desc,, bytes memory data) = helper_apiParams(); - address routerAddr = factory.computeAddress(RouterFactory.RouterType.V5AggregationRouter, USDC); vm.startPrank(swapSenderAddress); IERC20(USDC).approve(routerAddr, 10_000_000); (bool ok,) = @@ -133,7 +133,6 @@ contract Fallback is V5RouterTest { function testFork_RevertIf_ZeroAddress() public { (IV5AggregationRouter.SwapDescription memory desc,, bytes memory data) = helper_apiParams(); - address routerAddr = factory.computeAddress(RouterFactory.RouterType.V5AggregationRouter, USDC); IERC20(USDC).approve(routerAddr, 250_000); (bool ok,) = payable(routerAddr).call(abi.encode(address(0), 250_000, desc.minReturnAmount, data, 0)); From f9f8900a340152d3d239f25711dfa3d651bc93a7 Mon Sep 17 00:00:00 2001 From: Keating Date: Sun, 21 May 2023 20:36:57 -0400 Subject: [PATCH 47/48] Add USDC check --- test/V4Router.t.sol | 24 ++++++++++++++++-------- test/V5Router.t.sol | 24 +++++++++++++++++------- 2 files changed, 33 insertions(+), 15 deletions(-) diff --git a/test/V4Router.t.sol b/test/V4Router.t.sol index 545c31b..a333cc7 100644 --- a/test/V4Router.t.sol +++ b/test/V4Router.t.sol @@ -68,9 +68,7 @@ contract Fallback is V4RouterTest { function helper_nativeSwap( IV4AggregationRouter.SwapDescription memory desc, bytes memory data, - uint256 snapshotId ) public returns (uint256) { - vm.revertTo(snapshotId); v4AggregationRouter.swap(v4AggregationExecutor, desc, data); return IERC20(UNI).balanceOf(swapSenderAddress); } @@ -92,13 +90,14 @@ contract Fallback is V4RouterTest { return (desc, data); } - function testFork_SwapUSDC() public { + function testFork_SwapUSDCForUni() public { uint256 snapshotId = vm.snapshot(); (IV4AggregationRouter.SwapDescription memory desc, bytes memory data) = helper_apiParams(); // Setup the optimized router call vm.startPrank(swapSenderAddress); IERC20(USDC).approve(routerAddr, 100_000); - uint256 startingBalance = IERC20(UNI).balanceOf(swapSenderAddress); + uint256 startingUNIBalance = IERC20(UNI).balanceOf(swapSenderAddress); + uint256 startingUSDCBalance = IERC20(USDC).balanceOf(swapSenderAddress); assertEq(startingBalance, 0, "Starting balance is incorrect"); // Optimized router call @@ -107,12 +106,21 @@ contract Fallback is V4RouterTest { assertTrue(ok, "Swap failed"); // Compare balance to native aggregation router call + uint256 endingBalance = IERC20(UNI).balanceOf(swapSenderAddress); - uint256 nativeEndingBalance = helper_nativeSwap(desc, data, snapshotId); + vm.revertTo(snapshotId); + uint256 nativeEndingUNIBalance = helper_nativeSwap(desc, data); + uint256 nativeEndingUSDCBalance = IERC20(USDC).balanceOf(swapSenderAddress); + + assertEq( + endingUNIBalance, + nativeEndingUNIBalance, + "Ending UNI balance does not match the balance when calling 1inch directly" + ); assertEq( - endingBalance, - nativeEndingBalance, - "Ending balance does not match the balance when calling 1inch directly" + endingUSDCBalance, + nativeEndingUSDCBalance, + "Ending USDC balance does not match the balance when calling 1inch directly" ); } diff --git a/test/V5Router.t.sol b/test/V5Router.t.sol index 62b9cc5..2a7a8ee 100644 --- a/test/V5Router.t.sol +++ b/test/V5Router.t.sol @@ -95,14 +95,15 @@ contract Fallback is V5RouterTest { return IERC20(UNI).balanceOf(swapSenderAddress); } - function testFork_SwapUSDC() public { + function testFork_SwapUSDCForUni() public { uint256 snapshotId = vm.snapshot(); (IV5AggregationRouter.SwapDescription memory desc, bytes memory permit, bytes memory data) = helper_apiParams(); // Setup optimized router call vm.startPrank(swapSenderAddress); IERC20(USDC).approve(routerAddr, 100_000); - uint256 startingBalance = IERC20(UNI).balanceOf(swapSenderAddress); + uint256 startingUNIBalance = IERC20(UNI).balanceOf(swapSenderAddress); + uint256 startingUSDCBalance = IERC20(USDC).balanceOf(swapSenderAddress); assertEq(startingBalance, 0, "Starting balance is not 0"); // Optimized router call @@ -111,13 +112,22 @@ contract Fallback is V5RouterTest { assertTrue(ok, "Swap failed"); // Compare balance to native aggregation router call - uint256 endingBalance = IERC20(UNI).balanceOf(swapSenderAddress); + uint256 endingUNIBalance = IERC20(UNI).balanceOf(swapSenderAddress); + uint256 endingUSDCBalance = IERC20(USDC).balanceOf(swapSenderAddress); + vm.revertTo(snapshotId); - uint256 nativeEndingBalance = helper_nativeSwap(desc, permit, data); + uint256 nativeEndingUNIBalance = helper_nativeSwap(desc, permit, data); + uint256 nativeEndingUSDCBalance = IERC20(USDC).balanceOf(swapSenderAddress); + + assertEq( + endingUNIBalance, + nativeEndingUNIBalance, + "Ending UNI balance does not match the balance when calling 1inch directly" + ); assertEq( - endingBalance, - nativeEndingBalance, - "Ending balance does not match the balance when calling 1inch directly" + endingUSDCBalance, + nativeEndingUSDCBalance, + "Ending USDC balance does not match the balance when calling 1inch directly" ); } From bf0a132dbbf37048467c3f6cae7022f36ed22de1 Mon Sep 17 00:00:00 2001 From: Keating Date: Sun, 21 May 2023 20:53:07 -0400 Subject: [PATCH 48/48] Check USDC balances have not changed --- test/V4Router.t.sol | 24 ++++++++++++++++-------- test/V5Router.t.sol | 10 ++++++++-- 2 files changed, 24 insertions(+), 10 deletions(-) diff --git a/test/V4Router.t.sol b/test/V4Router.t.sol index a333cc7..b7959e5 100644 --- a/test/V4Router.t.sol +++ b/test/V4Router.t.sol @@ -65,10 +65,10 @@ contract Fallback is V4RouterTest { routerAddr = factory.computeAddress(RouterFactory.RouterType.V4AggregationRouter, USDC); } - function helper_nativeSwap( - IV4AggregationRouter.SwapDescription memory desc, - bytes memory data, - ) public returns (uint256) { + function helper_nativeSwap(IV4AggregationRouter.SwapDescription memory desc, bytes memory data) + public + returns (uint256) + { v4AggregationRouter.swap(v4AggregationExecutor, desc, data); return IERC20(UNI).balanceOf(swapSenderAddress); } @@ -90,15 +90,14 @@ contract Fallback is V4RouterTest { return (desc, data); } - function testFork_SwapUSDCForUni() public { + function testFork_SwapUsdcForUni() public { uint256 snapshotId = vm.snapshot(); (IV4AggregationRouter.SwapDescription memory desc, bytes memory data) = helper_apiParams(); // Setup the optimized router call vm.startPrank(swapSenderAddress); IERC20(USDC).approve(routerAddr, 100_000); uint256 startingUNIBalance = IERC20(UNI).balanceOf(swapSenderAddress); - uint256 startingUSDCBalance = IERC20(USDC).balanceOf(swapSenderAddress); - assertEq(startingBalance, 0, "Starting balance is incorrect"); + assertEq(startingUNIBalance, 0, "Starting balance is incorrect"); // Optimized router call (bool ok,) = payable(routerAddr).call(abi.encode(UNI, 100_000, desc.minReturnAmount, data, 0)); @@ -107,7 +106,8 @@ contract Fallback is V4RouterTest { // Compare balance to native aggregation router call - uint256 endingBalance = IERC20(UNI).balanceOf(swapSenderAddress); + uint256 endingUNIBalance = IERC20(UNI).balanceOf(swapSenderAddress); + uint256 endingUSDCBalance = IERC20(USDC).balanceOf(swapSenderAddress); vm.revertTo(snapshotId); uint256 nativeEndingUNIBalance = helper_nativeSwap(desc, data); uint256 nativeEndingUSDCBalance = IERC20(USDC).balanceOf(swapSenderAddress); @@ -129,16 +129,24 @@ contract Fallback is V4RouterTest { vm.startPrank(swapSenderAddress); IERC20(USDC).approve(routerAddr, 10_000_000); + uint256 startingBalance = IERC20(USDC).balanceOf(swapSenderAddress); (bool ok,) = payable(routerAddr).call(abi.encode(UNI, 10_000_000, desc.minReturnAmount, data, 0)); + uint256 endingBalance = IERC20(USDC).balanceOf(swapSenderAddress); + assertTrue(!ok, "Swap succeeded"); + assertEq(startingBalance, endingBalance, "Funds were held by the router contract"); } function testFork_RevertIf_ZeroAddress() public { (IV4AggregationRouter.SwapDescription memory desc, bytes memory data) = helper_apiParams(); IERC20(USDC).approve(routerAddr, 250_000); + uint256 startingBalance = IERC20(USDC).balanceOf(swapSenderAddress); (bool ok,) = payable(routerAddr).call(abi.encode(address(0), 250_000, desc.minReturnAmount, data, 0)); + uint256 endingBalance = IERC20(USDC).balanceOf(swapSenderAddress); + assertTrue(!ok, "Swap succeeded"); + assertEq(startingBalance, endingBalance, "Funds were held by the router contract"); } } diff --git a/test/V5Router.t.sol b/test/V5Router.t.sol index 2a7a8ee..afe6d15 100644 --- a/test/V5Router.t.sol +++ b/test/V5Router.t.sol @@ -103,8 +103,7 @@ contract Fallback is V5RouterTest { vm.startPrank(swapSenderAddress); IERC20(USDC).approve(routerAddr, 100_000); uint256 startingUNIBalance = IERC20(UNI).balanceOf(swapSenderAddress); - uint256 startingUSDCBalance = IERC20(USDC).balanceOf(swapSenderAddress); - assertEq(startingBalance, 0, "Starting balance is not 0"); + assertEq(startingUNIBalance, 0, "Starting balance is not 0"); // Optimized router call (bool ok,) = payable(routerAddr).call(abi.encode(UNI, 100_000, desc.minReturnAmount, data, 0)); @@ -136,16 +135,23 @@ contract Fallback is V5RouterTest { vm.startPrank(swapSenderAddress); IERC20(USDC).approve(routerAddr, 10_000_000); + uint256 startingBalance = IERC20(USDC).balanceOf(swapSenderAddress); (bool ok,) = payable(routerAddr).call(abi.encode(UNI, 10_000_000, desc.minReturnAmount, data, 0)); + uint256 endingBalance = IERC20(USDC).balanceOf(swapSenderAddress); + assertTrue(!ok, "Swap succeeded"); + assertEq(startingBalance, endingBalance, "Funds were held by the router contract"); } function testFork_RevertIf_ZeroAddress() public { (IV5AggregationRouter.SwapDescription memory desc,, bytes memory data) = helper_apiParams(); IERC20(USDC).approve(routerAddr, 250_000); + uint256 startingBalance = IERC20(USDC).balanceOf(swapSenderAddress); (bool ok,) = payable(routerAddr).call(abi.encode(address(0), 250_000, desc.minReturnAmount, data, 0)); + uint256 endingBalance = IERC20(USDC).balanceOf(swapSenderAddress); assertTrue(!ok, "Swap succeeded"); + assertEq(startingBalance, endingBalance, "Funds were held by the router contract"); } }