From 1ca098faa47e9d28f71bcb87f151e11a562cd2e7 Mon Sep 17 00:00:00 2001 From: thedavidmeister Date: Wed, 6 Sep 2023 15:04:06 +0400 Subject: [PATCH 01/24] bump deps --- .gas-snapshot | 44 ++++++++++++++++++++------------------ .gitmodules | 6 +++--- lib/rain.interpreter | 2 +- src/concrete/OrderBook.sol | 8 +++---- 4 files changed, 31 insertions(+), 29 deletions(-) diff --git a/.gas-snapshot b/.gas-snapshot index 2ff7ba557..4dc140f37 100644 --- a/.gas-snapshot +++ b/.gas-snapshot @@ -3,7 +3,7 @@ GenericPoolOrderBookV3FlashBorrowerTest:testTakeOrdersSender((address,bool,(addr LibOrderTest:testHashEqual((address,bool,(address,address,address),(address,uint8,uint256)[],(address,uint8,uint256)[])) (runs: 5096, μ: 194389, ~: 191140) LibOrderTest:testHashNotEqual((address,bool,(address,address,address),(address,uint8,uint256)[],(address,uint8,uint256)[]),(address,bool,(address,address,address),(address,uint8,uint256)[],(address,uint8,uint256)[])) (runs: 5096, μ: 298734, ~: 298554) OrderBookAddOrderMockTest:testAddOrderSameAccountWithDifferentConfig(address,((address,uint8,uint256)[],(address,uint8,uint256)[],(address,bytes,uint256[]),bytes),((address,uint8,uint256)[],(address,uint8,uint256)[],(address,bytes,uint256[]),bytes),address,address) (runs: 5096, μ: 2771808, ~: 2761475) -OrderBookAddOrderMockTest:testAddOrderTwoAccountsWithDifferentConfig(address,address,((address,uint8,uint256)[],(address,uint8,uint256)[],(address,bytes,uint256[]),bytes),((address,uint8,uint256)[],(address,uint8,uint256)[],(address,bytes,uint256[]),bytes),address,address) (runs: 5096, μ: 2626417, ~: 2600441) +OrderBookAddOrderMockTest:testAddOrderTwoAccountsWithDifferentConfig(address,address,((address,uint8,uint256)[],(address,uint8,uint256)[],(address,bytes,uint256[]),bytes),((address,uint8,uint256)[],(address,uint8,uint256)[],(address,bytes,uint256[]),bytes),address,address) (runs: 5096, μ: 2626717, ~: 2600883) OrderBookAddOrderMockTest:testAddOrderTwoAccountsWithSameConfig(address,address,((address,uint8,uint256)[],(address,uint8,uint256)[],(address,bytes,uint256[]),bytes),address) (runs: 5096, μ: 2493275, ~: 2492266) OrderBookAddOrderMockTest:testAddOrderWithCalculationsInputsAndOutputsSucceeds(address,((address,uint8,uint256)[],(address,uint8,uint256)[],(address,bytes,uint256[]),bytes),address) (runs: 5096, μ: 1295793, ~: 1281958) OrderBookAddOrderMockTest:testAddOrderWithNonEmptyMetaEmitsMetaV1(address,((address,uint8,uint256)[],(address,uint8,uint256)[],(address,bytes,uint256[]),bytes),address) (runs: 5096, μ: 1303904, ~: 1290881) @@ -11,39 +11,41 @@ OrderBookAddOrderMockTest:testAddOrderWithNonEmptyMetaReverts(address,((address, OrderBookAddOrderMockTest:testAddOrderWithoutCalculationsReverts(address,((address,uint8,uint256)[],(address,uint8,uint256)[],(address,bytes,uint256[]),bytes)) (runs: 5096, μ: 226595, ~: 224802) OrderBookAddOrderMockTest:testAddOrderWithoutInputsReverts(address,((address,uint8,uint256)[],(address,uint8,uint256)[],(address,bytes,uint256[]),bytes)) (runs: 5096, μ: 182418, ~: 181902) OrderBookAddOrderMockTest:testAddOrderWithoutOutputsReverts(address,((address,uint8,uint256)[],(address,uint8,uint256)[],(address,bytes,uint256[]),bytes)) (runs: 5096, μ: 182840, ~: 182026) -OrderBookAddOrderTest:testAddOrderRealNoHandleIOReverts(address,((address,uint8,uint256)[],(address,uint8,uint256)[],(address,bytes,uint256[]),bytes)) (runs: 5096, μ: 172787, ~: 171563) +OrderBookAddOrderTest:testAddOrderRealNoHandleIOReverts(address,((address,uint8,uint256)[],(address,uint8,uint256)[],(address,bytes,uint256[]),bytes)) (runs: 5096, μ: 172931, ~: 171707) OrderBookAddOrderTest:testAddOrderRealNoSourcesReverts(address,((address,uint8,uint256)[],(address,uint8,uint256)[],(address,bytes,uint256[]),bytes)) (runs: 5096, μ: 176045, ~: 174413) -OrderBookAddOrderTest:testAddOrderRealOneStackCalculateReverts(address,((address,uint8,uint256)[],(address,uint8,uint256)[],(address,bytes,uint256[]),bytes)) (runs: 5096, μ: 186130, ~: 184907) -OrderBookAddOrderTest:testAddOrderRealThreeStackCalculate(address,((address,uint8,uint256)[],(address,uint8,uint256)[],(address,bytes,uint256[]),bytes)) (runs: 5096, μ: 722153, ~: 718798) -OrderBookAddOrderTest:testAddOrderRealTwoStackCalculateReverts(address,((address,uint8,uint256)[],(address,uint8,uint256)[],(address,bytes,uint256[]),bytes)) (runs: 5096, μ: 715326, ~: 711971) -OrderBookAddOrderTest:testAddOrderRealZeroStackCalculateReverts(address,((address,uint8,uint256)[],(address,uint8,uint256)[],(address,bytes,uint256[]),bytes)) (runs: 5096, μ: 181302, ~: 180079) +OrderBookAddOrderTest:testAddOrderRealOneStackCalculateReverts(address,((address,uint8,uint256)[],(address,uint8,uint256)[],(address,bytes,uint256[]),bytes)) (runs: 5096, μ: 186224, ~: 185001) +OrderBookAddOrderTest:testAddOrderRealThreeStackCalculate(address,((address,uint8,uint256)[],(address,uint8,uint256)[],(address,bytes,uint256[]),bytes)) (runs: 5096, μ: 722003, ~: 718648) +OrderBookAddOrderTest:testAddOrderRealTwoStackCalculateReverts(address,((address,uint8,uint256)[],(address,uint8,uint256)[],(address,bytes,uint256[]),bytes)) (runs: 5096, μ: 715298, ~: 711943) +OrderBookAddOrderTest:testAddOrderRealZeroStackCalculateReverts(address,((address,uint8,uint256)[],(address,uint8,uint256)[],(address,bytes,uint256[]),bytes)) (runs: 5096, μ: 181518, ~: 180295) OrderBookDepositTest:testDepositEvent(address,uint256,uint256) (runs: 5096, μ: 38710, ~: 38710) -OrderBookDepositTest:testDepositFail(address,uint256,uint256) (runs: 5096, μ: 8937393460516740786, ~: 8937393460516740786) +OrderBookDepositTest:testDepositFail(address,uint256,uint256) (runs: 5096, μ: 8937393460516740791, ~: 8937393460516740786) OrderBookDepositTest:testDepositGas00() (gas: 8176) OrderBookDepositTest:testDepositGas01() (gas: 34620) -OrderBookDepositTest:testDepositMany((address,address,uint256,uint248)[]) (runs: 5096, μ: 5184765, ~: 4940766) +OrderBookDepositTest:testDepositMany((address,address,uint256,uint248)[]) (runs: 5096, μ: 5118682, ~: 4755733) OrderBookDepositTest:testDepositOverflow(address,uint256,uint256,uint256) (runs: 5096, μ: 46645, ~: 46645) -OrderBookDepositTest:testDepositReentrancy(address,uint256,uint256,address,uint256,uint256) (runs: 5096, μ: 495218, ~: 496632) +OrderBookDepositTest:testDepositReentrancy(address,uint256,uint256,address,uint256,uint256) (runs: 5096, μ: 495198, ~: 496632) OrderBookDepositTest:testDepositSimple(address,uint256,uint256) (runs: 5096, μ: 37840, ~: 37840) OrderBookDepositTest:testDepositZero(address,uint256) (runs: 5096, μ: 12639, ~: 12639) OrderBookDepositTest:testVaultBalanceNoDeposits(address,uint256) (runs: 5096, μ: 8263, ~: 8263) -OrderBookDepositTest:testVaultBalanceReentrant(address,uint256,uint256,address,address,uint256) (runs: 5096, μ: 494050, ~: 495964) +OrderBookDepositTest:testVaultBalanceReentrant(address,uint256,uint256,address,address,uint256) (runs: 5096, μ: 494014, ~: 495964) OrderBookRemoveOrderMockTest:testRemoveOrderAddRemoveMulti(address,((address,uint8,uint256)[],(address,uint8,uint256)[],(address,bytes,uint256[]),bytes),address) (runs: 5096, μ: 7256622, ~: 7139425) OrderBookRemoveOrderMockTest:testRemoveOrderDifferent(address,((address,uint8,uint256)[],(address,uint8,uint256)[],(address,bytes,uint256[]),bytes),address,((address,uint8,uint256)[],(address,uint8,uint256)[],(address,bytes,uint256[]),bytes),address) (runs: 5096, μ: 5070365, ~: 5046372) -OrderBookRemoveOrderMockTest:testRemoveOrderDifferentOwners(address,address,((address,uint8,uint256)[],(address,uint8,uint256)[],(address,bytes,uint256[]),bytes),address) (runs: 5096, μ: 4854223, ~: 4841901) +OrderBookRemoveOrderMockTest:testRemoveOrderDifferentOwners(address,address,((address,uint8,uint256)[],(address,uint8,uint256)[],(address,bytes,uint256[]),bytes),address) (runs: 5096, μ: 4854788, ~: 4841901) OrderBookRemoveOrderMockTest:testRemoveOrderDifferentOwnersDifferent(address,address,((address,uint8,uint256)[],(address,uint8,uint256)[],(address,bytes,uint256[]),bytes),address,((address,uint8,uint256)[],(address,uint8,uint256)[],(address,bytes,uint256[]),bytes),address) (runs: 5096, μ: 10466985, ~: 10453491) OrderBookRemoveOrderMockTest:testRemoveOrderDoesNotExist(address,((address,uint8,uint256)[],(address,uint8,uint256)[],(address,bytes,uint256[]),bytes),address) (runs: 5096, μ: 386811, ~: 382063) -OrderBookRemoveOrderMockTest:testRemoveOrderOnlyOwner(address,address,((address,uint8,uint256)[],(address,uint8,uint256)[],(address,bytes,uint256[]),bytes),address) (runs: 5096, μ: 2603102, ~: 2601080) -OrderBookTakeOrderNoopTest:testTakeOrderNoopNonLiveOrderOne((address,bool,(address,address,address),(address,uint8,uint256)[],(address,uint8,uint256)[]),uint256,uint256,(address,uint256[],bytes)) (runs: 5096, μ: 428003, ~: 424249) -OrderBookTakeOrderNoopTest:testTakeOrderNoopNonLiveOrderTwo((address,bool,(address,address,address),(address,uint8,uint256)[],(address,uint8,uint256)[]),(address,bool,(address,address,address),(address,uint8,uint256)[],(address,uint8,uint256)[]),uint256,uint256,uint256,uint256,(address,uint256[],bytes),(address,uint256[],bytes)) (runs: 5096, μ: 842490, ~: 838321) +OrderBookRemoveOrderMockTest:testRemoveOrderOnlyOwner(address,address,((address,uint8,uint256)[],(address,uint8,uint256)[],(address,bytes,uint256[]),bytes),address) (runs: 5096, μ: 2603402, ~: 2601080) +OrderBookTakeOrderNoopTest:testTakeOrderNoopNonLiveOrderOne((address,bool,(address,address,address),(address,uint8,uint256)[],(address,uint8,uint256)[]),uint256,uint256,(address,uint256[],bytes)) (runs: 5096, μ: 431665, ~: 427913) +OrderBookTakeOrderNoopTest:testTakeOrderNoopNonLiveOrderTwo((address,bool,(address,address,address),(address,uint8,uint256)[],(address,uint8,uint256)[]),(address,bool,(address,address,address),(address,uint8,uint256)[],(address,uint8,uint256)[]),uint256,uint256,uint256,uint256,(address,uint256[],bytes),(address,uint256[],bytes)) (runs: 5096, μ: 851326, ~: 847158) OrderBookTakeOrderNoopTest:testTakeOrderNoopZeroOrders() (gas: 12403) -OrderBookTakeOrderTest:testTakeOrderPrecisionKnownBad01() (gas: 2576621) -OrderBookTakeOrderTokenMismatchTest:testTokenMismatchInputs((address,bool,(address,address,address),(address,uint8,uint256)[],(address,uint8,uint256)[]),uint256,uint256,(address,bool,(address,address,address),(address,uint8,uint256)[],(address,uint8,uint256)[]),uint256,uint256) (runs: 5096, μ: 613519, ~: 607165) -OrderBookTakeOrderTokenMismatchTest:testTokenMismatchOutputs((address,bool,(address,address,address),(address,uint8,uint256)[],(address,uint8,uint256)[]),uint256,uint256,(address,bool,(address,address,address),(address,uint8,uint256)[],(address,uint8,uint256)[]),uint256,uint256) (runs: 5096, μ: 613634, ~: 607304) +OrderBookTakeOrderTest:testTakeOrderPrecisionKnownBad01() (gas: 2631522) +OrderBookTakeOrderTokenMismatchDecimalsTest:testTokenMismatchInputs((address,bool,(address,address,address),(address,uint8,uint256)[],(address,uint8,uint256)[]),uint256,uint256,(address,bool,(address,address,address),(address,uint8,uint256)[],(address,uint8,uint256)[]),uint256,uint256) (runs: 5096, μ: 622317, ~: 616897) +OrderBookTakeOrderTokenMismatchDecimalsTest:testTokenMismatchOutputs((address,bool,(address,address,address),(address,uint8,uint256)[],(address,uint8,uint256)[]),uint256,uint256,(address,bool,(address,address,address),(address,uint8,uint256)[],(address,uint8,uint256)[]),uint256,uint256) (runs: 5096, μ: 622684, ~: 616897) +OrderBookTakeOrderTokenMismatchTest:testTokenMismatchInputs((address,bool,(address,address,address),(address,uint8,uint256)[],(address,uint8,uint256)[]),uint256,uint256,(address,bool,(address,address,address),(address,uint8,uint256)[],(address,uint8,uint256)[]),uint256,uint256) (runs: 5096, μ: 618341, ~: 611981) +OrderBookTakeOrderTokenMismatchTest:testTokenMismatchOutputs((address,bool,(address,address,address),(address,uint8,uint256)[],(address,uint8,uint256)[]),uint256,uint256,(address,bool,(address,address,address),(address,uint8,uint256)[],(address,uint8,uint256)[]),uint256,uint256) (runs: 5096, μ: 619601, ~: 613241) OrderBookWithdrawTest:testWithdrawEmptyVault(address,address,uint256,uint256) (runs: 5096, μ: 15251, ~: 15251) -OrderBookWithdrawTest:testWithdrawFailure(address,uint256,uint256,uint256) (runs: 5096, μ: 8937393460516719678, ~: 8937393460516738938) -OrderBookWithdrawTest:testWithdrawFullVault(address,uint256,uint256,uint256) (runs: 5096, μ: 41256, ~: 41254) -OrderBookWithdrawTest:testWithdrawMany((bool,address,address,uint256,uint248)[]) (runs: 5096, μ: 1443910, ~: 1381982) +OrderBookWithdrawTest:testWithdrawFailure(address,uint256,uint256,uint256) (runs: 5096, μ: 8937393460516719704, ~: 8937393460516738938) +OrderBookWithdrawTest:testWithdrawFullVault(address,uint256,uint256,uint256) (runs: 5096, μ: 41257, ~: 41256) +OrderBookWithdrawTest:testWithdrawMany((bool,address,address,uint256,uint248)[]) (runs: 5096, μ: 1437729, ~: 1357542) OrderBookWithdrawTest:testWithdrawPartialVault(address,uint256,uint256,uint256) (runs: 5096, μ: 51929, ~: 51929) -OrderBookWithdrawTest:testWithdrawReentrant(address,uint256,uint256,address,address,uint256) (runs: 5096, μ: 506294, ~: 507997) +OrderBookWithdrawTest:testWithdrawReentrant(address,uint256,uint256,address,address,uint256) (runs: 5096, μ: 506228, ~: 507997) OrderBookWithdrawTest:testWithdrawZero(address,address,uint256) (runs: 5096, μ: 12809, ~: 12809) \ No newline at end of file diff --git a/.gitmodules b/.gitmodules index 6bd6cae0f..92539151b 100644 --- a/.gitmodules +++ b/.gitmodules @@ -19,9 +19,9 @@ [submodule "lib/rain.factory"] path = lib/rain.factory url = https://github.com/rainprotocol/rain.factory -[submodule "lib/rain.interpreter"] - path = lib/rain.interpreter - url = https://github.com/rainprotocol/rain.interpreter [submodule "lib/v2-periphery"] path = lib/v2-periphery url = https://github.com/Uniswap/v2-periphery +[submodule "lib/rain.interpreter"] + path = lib/rain.interpreter + url = https://github.com/rainprotocol/rain.interpreter diff --git a/lib/rain.interpreter b/lib/rain.interpreter index 956f02df2..55c6bfdeb 160000 --- a/lib/rain.interpreter +++ b/lib/rain.interpreter @@ -1 +1 @@ -Subproject commit 956f02df2df748b6eccb27bc049f12a95b5b494b +Subproject commit 55c6bfdebda276fbacad2f6004dcf7cbbaee6219 diff --git a/src/concrete/OrderBook.sol b/src/concrete/OrderBook.sol index 357df1c59..d385f83f4 100644 --- a/src/concrete/OrderBook.sol +++ b/src/concrete/OrderBook.sol @@ -7,8 +7,8 @@ import {IERC20} from "openzeppelin-contracts/contracts/token/ERC20/IERC20.sol"; import {SafeERC20} from "openzeppelin-contracts/contracts/token/ERC20/utils/SafeERC20.sol"; import {ReentrancyGuard} from "openzeppelin-contracts/contracts/security/ReentrancyGuard.sol"; -import "rain.math.fixedpoint/FixedPointDecimalArithmeticOpenZeppelin.sol"; -import "rain.math.fixedpoint/FixedPointDecimalScale.sol"; +import "rain.math.fixedpoint/lib/LibFixedPointDecimalArithmeticOpenZeppelin.sol"; +import "rain.math.fixedpoint/lib/LibFixedPointDecimalScale.sol"; import "rain.interpreter/src/lib/caller/LibEncodedDispatch.sol"; import "rain.interpreter/src/lib/caller/LibContext.sol"; import { @@ -177,8 +177,8 @@ contract OrderBook is IOrderBookV3, ReentrancyGuard, Multicall, OrderBookV3Flash using LibOrder for Order; using LibUint256Array for uint256; using Math for uint256; - using FixedPointDecimalScale for uint256; - using FixedPointDecimalArithmeticOpenZeppelin for uint256; + using LibFixedPointDecimalScale for uint256; + using LibFixedPointDecimalArithmeticOpenZeppelin for uint256; /// All hashes of all active orders. There's nothing interesting in the value /// it's just nonzero if the order is live. The key is the hash of the order. From 35192fd6159d8a31dcdda81fd0cd04be146cbc52 Mon Sep 17 00:00:00 2001 From: thedavidmeister Date: Wed, 6 Sep 2023 15:06:32 +0400 Subject: [PATCH 02/24] shallow install for test --- .github/workflows/test.yaml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 4856e4569..c3a76cb83 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -14,9 +14,6 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 - with: - submodules: recursive - - name: Install Foundry uses: foundry-rs/foundry-toolchain@v1 with: @@ -26,6 +23,10 @@ jobs: run: forge --version id: forge-version + - name: Forge install shallow + run: forge install --shallow + id: forge-install-shallow + - name: Run Forge fmt run: forge fmt --check id: fmt From 96c84c1914b17af27ad5b37de8595da4a073350a Mon Sep 17 00:00:00 2001 From: thedavidmeister Date: Wed, 6 Sep 2023 21:52:14 +0400 Subject: [PATCH 03/24] debug --- .github/workflows/test.yaml | 4 ++++ lib/rain.interpreter | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index c3a76cb83..fda96311f 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -27,6 +27,10 @@ jobs: run: forge install --shallow id: forge-install-shallow + - name: git status + run: git status + id: git-status + - name: Run Forge fmt run: forge fmt --check id: fmt diff --git a/lib/rain.interpreter b/lib/rain.interpreter index 55c6bfdeb..956f02df2 160000 --- a/lib/rain.interpreter +++ b/lib/rain.interpreter @@ -1 +1 @@ -Subproject commit 55c6bfdebda276fbacad2f6004dcf7cbbaee6219 +Subproject commit 956f02df2df748b6eccb27bc049f12a95b5b494b From 8fcb2b73620232e85ece6a3b7cbdb79ced7150f6 Mon Sep 17 00:00:00 2001 From: thedavidmeister Date: Wed, 6 Sep 2023 22:18:30 +0400 Subject: [PATCH 04/24] wip on deps --- .gitmodules | 3 +++ foundry.toml | 2 ++ lib/rain.math.fixedpoint | 1 + src/abstract/OrderBookV3ArbOrderTaker.sol | 22 ++++++++--------- src/abstract/OrderBookV3FlashBorrower.sol | 14 +++++------ src/abstract/OrderBookV3FlashLender.sol | 6 ++--- .../GenericPoolOrderBookV3ArbOrderTaker.sol | 4 ++-- src/concrete/OrderBook.sol | 24 +++++++++---------- .../UniV2PoolOrderBookV3ArbOrderTaker.sol | 8 +++---- src/interface/IOrderBookV2.sol | 4 ++-- src/interface/deprecated/IOrderBookV1.sol | 4 ++-- src/interface/unstable/IOrderBookV3.sol | 4 ++-- ...cPoolOrderBookV3FlashBorrower.sender.t.sol | 6 ++--- test/concrete/OrderBook.deposit.t.sol | 2 +- test/concrete/OrderBook.vaultBalance.t.sol | 2 +- test/concrete/OrderBook.withdraw.t.sol | 4 ++-- test/lib/LibOrder.t.sol | 2 +- .../abstract/OrderBookExternalMockTest.sol | 6 ++--- .../abstract/OrderBookExternalRealTest.sol | 8 +++---- test/util/abstract/OrderBookSelfTest.sol | 2 +- test/util/concrete/Reenteroor.sol | 2 +- test/util/lib/LibTestAddOrder.sol | 2 +- 22 files changed, 69 insertions(+), 63 deletions(-) create mode 160000 lib/rain.math.fixedpoint diff --git a/.gitmodules b/.gitmodules index 92539151b..76ddad73f 100644 --- a/.gitmodules +++ b/.gitmodules @@ -25,3 +25,6 @@ [submodule "lib/rain.interpreter"] path = lib/rain.interpreter url = https://github.com/rainprotocol/rain.interpreter +[submodule "lib/rain.math.fixedpoint"] + path = lib/rain.math.fixedpoint + url = https://github.com/rainprotocol/rain.math.fixedpoint diff --git a/foundry.toml b/foundry.toml index 410b434f7..886998648 100644 --- a/foundry.toml +++ b/foundry.toml @@ -17,6 +17,8 @@ solc = "0.8.19" optimizer = true optimizer_runs = 1000000 +auto_detect_remappings = false + bytecode_hash = "none" cbor_metadata = false diff --git a/lib/rain.math.fixedpoint b/lib/rain.math.fixedpoint new file mode 160000 index 000000000..84cb2ae98 --- /dev/null +++ b/lib/rain.math.fixedpoint @@ -0,0 +1 @@ +Subproject commit 84cb2ae98305719574aca4cf754aed8b681eb5d9 diff --git a/src/abstract/OrderBookV3ArbOrderTaker.sol b/src/abstract/OrderBookV3ArbOrderTaker.sol index 5fd61f79a..4b148267c 100644 --- a/src/abstract/OrderBookV3ArbOrderTaker.sol +++ b/src/abstract/OrderBookV3ArbOrderTaker.sol @@ -1,21 +1,21 @@ // SPDX-License-Identifier: CAL pragma solidity =0.8.19; -import {ERC165, IERC165} from "openzeppelin-contracts/contracts/utils/introspection/ERC165.sol"; -import {ReentrancyGuard} from "openzeppelin-contracts/contracts/security/ReentrancyGuard.sol"; -import {IERC20} from "openzeppelin-contracts/contracts/token/ERC20/IERC20.sol"; -import {Initializable} from "openzeppelin-contracts/contracts/proxy/utils/Initializable.sol"; -import {SafeERC20} from "openzeppelin-contracts/contracts/token/ERC20/utils/SafeERC20.sol"; -import {Address} from "openzeppelin-contracts/contracts/utils/Address.sol"; +import {ERC165, IERC165} from "lib/openzeppelin-contracts/contracts/utils/introspection/ERC165.sol"; +import {ReentrancyGuard} from "lib/openzeppelin-contracts/contracts/security/ReentrancyGuard.sol"; +import {IERC20} from "lib/openzeppelin-contracts/contracts/token/ERC20/IERC20.sol"; +import {Initializable} from "lib/openzeppelin-contracts/contracts/proxy/utils/Initializable.sol"; +import {SafeERC20} from "lib/openzeppelin-contracts/contracts/token/ERC20/utils/SafeERC20.sol"; +import {Address} from "lib/openzeppelin-contracts/contracts/utils/Address.sol"; import { DeployerDiscoverableMetaV2, DeployerDiscoverableMetaV2ConstructionConfig, LibMeta -} from "rain.interpreter/src/abstract/DeployerDiscoverableMetaV2.sol"; -import "rain.factory/src/interface/ICloneableV2.sol"; -import "rain.interpreter/src/lib/caller/LibContext.sol"; -import "rain.interpreter/src/lib/caller/LibEncodedDispatch.sol"; -import "rain.interpreter/src/lib/bytecode/LibBytecode.sol"; +} from "lib/rain.interpreter/src/abstract/DeployerDiscoverableMetaV2.sol"; +import "lib/rain.factory/src/interface/ICloneableV2.sol"; +import "lib/rain.interpreter/src/lib/caller/LibContext.sol"; +import "lib/rain.interpreter/src/lib/caller/LibEncodedDispatch.sol"; +import "lib/rain.interpreter/src/lib/bytecode/LibBytecode.sol"; import "../interface/unstable/IOrderBookV3.sol"; import "../interface/unstable/IOrderBookV3OrderTaker.sol"; diff --git a/src/abstract/OrderBookV3FlashBorrower.sol b/src/abstract/OrderBookV3FlashBorrower.sol index 5849154e6..18328be43 100644 --- a/src/abstract/OrderBookV3FlashBorrower.sol +++ b/src/abstract/OrderBookV3FlashBorrower.sol @@ -2,19 +2,19 @@ pragma solidity =0.8.19; import {ERC165, IERC165} from "openzeppelin-contracts/contracts/utils/introspection/ERC165.sol"; -import {SafeERC20} from "openzeppelin-contracts/contracts/token/ERC20/utils/SafeERC20.sol"; +import {SafeERC20} from "lib/openzeppelin-contracts/contracts/token/ERC20/utils/SafeERC20.sol"; import {Address} from "openzeppelin-contracts/contracts/utils/Address.sol"; -import {IERC20} from "openzeppelin-contracts/contracts/token/ERC20/IERC20.sol"; -import {ReentrancyGuard} from "openzeppelin-contracts/contracts/security/ReentrancyGuard.sol"; +import {IERC20} from "lib/openzeppelin-contracts/contracts/token/ERC20/IERC20.sol"; +import {ReentrancyGuard} from "lib/openzeppelin-contracts/contracts/security/ReentrancyGuard.sol"; import {Initializable} from "openzeppelin-contracts/contracts/proxy/utils/Initializable.sol"; import { DeployerDiscoverableMetaV2, DeployerDiscoverableMetaV2ConstructionConfig, LibMeta -} from "rain.interpreter/src/abstract/DeployerDiscoverableMetaV2.sol"; -import "rain.interpreter/src/lib/caller/LibEncodedDispatch.sol"; -import "rain.interpreter/src/lib/caller/LibContext.sol"; -import "rain.interpreter/src/lib/bytecode/LibBytecode.sol"; +} from "lib/rain.interpreter/src/abstract/DeployerDiscoverableMetaV2.sol"; +import "lib/rain.interpreter/src/lib/caller/LibEncodedDispatch.sol"; +import "lib/rain.interpreter/src/lib/caller/LibContext.sol"; +import "lib/rain.interpreter/src/lib/bytecode/LibBytecode.sol"; import "../interface/unstable/IOrderBookV3.sol"; import "rain.factory/src/interface/ICloneableV2.sol"; diff --git a/src/abstract/OrderBookV3FlashLender.sol b/src/abstract/OrderBookV3FlashLender.sol index 3380f192e..54f173492 100644 --- a/src/abstract/OrderBookV3FlashLender.sol +++ b/src/abstract/OrderBookV3FlashLender.sol @@ -1,9 +1,9 @@ // SPDX-License-Identifier: CAL pragma solidity ^0.8.18; -import {Math} from "openzeppelin-contracts/contracts/utils/math/Math.sol"; -import {IERC20} from "openzeppelin-contracts/contracts/token/ERC20/IERC20.sol"; -import {SafeERC20} from "openzeppelin-contracts/contracts/token/ERC20/utils/SafeERC20.sol"; +import {Math} from "lib/openzeppelin-contracts/contracts/utils/math/Math.sol"; +import {IERC20} from "lib/openzeppelin-contracts/contracts/token/ERC20/IERC20.sol"; +import {SafeERC20} from "lib/openzeppelin-contracts/contracts/token/ERC20/utils/SafeERC20.sol"; import "../interface/ierc3156/IERC3156FlashBorrower.sol"; import "../interface/ierc3156/IERC3156FlashLender.sol"; diff --git a/src/concrete/GenericPoolOrderBookV3ArbOrderTaker.sol b/src/concrete/GenericPoolOrderBookV3ArbOrderTaker.sol index e984836a0..bbc6068c9 100644 --- a/src/concrete/GenericPoolOrderBookV3ArbOrderTaker.sol +++ b/src/concrete/GenericPoolOrderBookV3ArbOrderTaker.sol @@ -2,8 +2,8 @@ pragma solidity =0.8.19; import "../abstract/OrderBookV3ArbOrderTaker.sol"; -import {IERC20} from "openzeppelin-contracts/contracts/token/ERC20/IERC20.sol"; -import {SafeERC20} from "openzeppelin-contracts/contracts/token/ERC20/utils/SafeERC20.sol"; +import {IERC20} from "lib/openzeppelin-contracts/contracts/token/ERC20/IERC20.sol"; +import {SafeERC20} from "lib/openzeppelin-contracts/contracts/token/ERC20/utils/SafeERC20.sol"; import {Address} from "openzeppelin-contracts/contracts/utils/Address.sol"; bytes32 constant CALLER_META_HASH = bytes32(0x00); diff --git a/src/concrete/OrderBook.sol b/src/concrete/OrderBook.sol index d385f83f4..4cda442f0 100644 --- a/src/concrete/OrderBook.sol +++ b/src/concrete/OrderBook.sol @@ -1,22 +1,22 @@ // SPDX-License-Identifier: CAL pragma solidity =0.8.19; -import {Math} from "openzeppelin-contracts/contracts/utils/math/Math.sol"; -import {Multicall} from "openzeppelin-contracts/contracts/utils/Multicall.sol"; -import {IERC20} from "openzeppelin-contracts/contracts/token/ERC20/IERC20.sol"; -import {SafeERC20} from "openzeppelin-contracts/contracts/token/ERC20/utils/SafeERC20.sol"; -import {ReentrancyGuard} from "openzeppelin-contracts/contracts/security/ReentrancyGuard.sol"; - -import "rain.math.fixedpoint/lib/LibFixedPointDecimalArithmeticOpenZeppelin.sol"; -import "rain.math.fixedpoint/lib/LibFixedPointDecimalScale.sol"; -import "rain.interpreter/src/lib/caller/LibEncodedDispatch.sol"; -import "rain.interpreter/src/lib/caller/LibContext.sol"; +import {Math} from "lib/openzeppelin-contracts/contracts/utils/math/Math.sol"; +import {Multicall} from "lib/openzeppelin-contracts/contracts/utils/Multicall.sol"; +import {IERC20} from "lib/openzeppelin-contracts/contracts/token/ERC20/IERC20.sol"; +import {SafeERC20} from "lib/openzeppelin-contracts/contracts/token/ERC20/utils/SafeERC20.sol"; +import {ReentrancyGuard} from "lib/openzeppelin-contracts/contracts/security/ReentrancyGuard.sol"; + +import "lib/rain.math.fixedpoint/src/LibFixedPointDecimalArithmeticOpenZeppelin.sol"; +import "lib/rain.math.fixedpoint/src/LibFixedPointDecimalScale.sol"; +import "lib/rain.interpreter/src/lib/caller/LibEncodedDispatch.sol"; +import "lib/rain.interpreter/src/lib/caller/LibContext.sol"; import { DeployerDiscoverableMetaV2, DeployerDiscoverableMetaV2ConstructionConfig, LibMeta -} from "rain.interpreter/src/abstract/DeployerDiscoverableMetaV2.sol"; -import "rain.interpreter/src/lib/bytecode/LibBytecode.sol"; +} from "lib/rain.interpreter/src/abstract/DeployerDiscoverableMetaV2.sol"; +import "lib/rain.interpreter/src/lib/bytecode/LibBytecode.sol"; import "../interface/unstable/IOrderBookV3.sol"; import "../interface/unstable/IOrderBookV3OrderTaker.sol"; diff --git a/src/concrete/UniV2PoolOrderBookV3ArbOrderTaker.sol b/src/concrete/UniV2PoolOrderBookV3ArbOrderTaker.sol index 6d5fc97e8..0a440da25 100644 --- a/src/concrete/UniV2PoolOrderBookV3ArbOrderTaker.sol +++ b/src/concrete/UniV2PoolOrderBookV3ArbOrderTaker.sol @@ -1,12 +1,12 @@ // SPDX-License-Identifier: CAL pragma solidity =0.8.19; -import "v2-periphery/interfaces/IUniswapV2Router02.sol"; +import "lib/v2-periphery/contracts/interfaces/IUniswapV2Router02.sol"; import "../abstract/OrderBookV3ArbOrderTaker.sol"; -import {IERC20} from "openzeppelin-contracts/contracts/token/ERC20/IERC20.sol"; -import {SafeERC20} from "openzeppelin-contracts/contracts/token/ERC20/utils/SafeERC20.sol"; -import {Address} from "openzeppelin-contracts/contracts/utils/Address.sol"; +import {IERC20} from "lib/openzeppelin-contracts/contracts/token/ERC20/IERC20.sol"; +import {SafeERC20} from "lib/openzeppelin-contracts/contracts/token/ERC20/utils/SafeERC20.sol"; +import {Address} from "lib/openzeppelin-contracts/contracts/utils/Address.sol"; bytes32 constant CALLER_META_HASH = bytes32(0x00); diff --git a/src/interface/IOrderBookV2.sol b/src/interface/IOrderBookV2.sol index 8dbd3005d..ffacfbf49 100644 --- a/src/interface/IOrderBookV2.sol +++ b/src/interface/IOrderBookV2.sol @@ -2,8 +2,8 @@ pragma solidity ^0.8.18; import "./ierc3156/IERC3156FlashLender.sol"; -import "rain.interpreter/src/lib/caller/LibEvaluable.sol"; -import "rain.interpreter/src/interface/IInterpreterCallerV2.sol"; +import "lib/rain.interpreter/src/lib/caller/LibEvaluable.sol"; +import "lib/rain.interpreter/src/interface/IInterpreterCallerV2.sol"; /// Configuration for a deposit. All deposits are processed by and for /// `msg.sender` so the vaults are unambiguous here. diff --git a/src/interface/deprecated/IOrderBookV1.sol b/src/interface/deprecated/IOrderBookV1.sol index 8ab020ec0..9126be7ad 100644 --- a/src/interface/deprecated/IOrderBookV1.sol +++ b/src/interface/deprecated/IOrderBookV1.sol @@ -2,8 +2,8 @@ pragma solidity ^0.8.18; import "../ierc3156/IERC3156FlashLender.sol"; -import "rain.interpreter/src/lib/caller/LibEvaluable.sol"; -import "rain.interpreter/src/interface/deprecated/IInterpreterCallerV1.sol"; +import "lib/rain.interpreter/src/lib/caller/LibEvaluable.sol"; +import "lib/rain.interpreter/src/interface/deprecated/IInterpreterCallerV1.sol"; /// Configuration for a deposit. All deposits are processed by and for /// `msg.sender` so the vaults are unambiguous here. diff --git a/src/interface/unstable/IOrderBookV3.sol b/src/interface/unstable/IOrderBookV3.sol index 538b05d94..0d147708b 100644 --- a/src/interface/unstable/IOrderBookV3.sol +++ b/src/interface/unstable/IOrderBookV3.sol @@ -2,8 +2,8 @@ pragma solidity ^0.8.18; import "../ierc3156/IERC3156FlashLender.sol"; -import "rain.interpreter/src/lib/caller/LibEvaluable.sol"; -import "rain.interpreter/src/interface/IInterpreterCallerV2.sol"; +import "lib/rain.interpreter/src/lib/caller/LibEvaluable.sol"; +import "lib/rain.interpreter/src/interface/IInterpreterCallerV2.sol"; /// Import unmodified structures from older versions of `IOrderBook`. import {IO, Order, TakeOrderConfig, ClearConfig, ClearStateChange} from "../IOrderBookV2.sol"; diff --git a/test/concrete/GenericPoolOrderBookV3FlashBorrower.sender.t.sol b/test/concrete/GenericPoolOrderBookV3FlashBorrower.sender.t.sol index 5ca395df1..a6222aea2 100644 --- a/test/concrete/GenericPoolOrderBookV3FlashBorrower.sender.t.sol +++ b/test/concrete/GenericPoolOrderBookV3FlashBorrower.sender.t.sol @@ -1,9 +1,9 @@ // SPDX-License-Identifier: CAL pragma solidity =0.8.19; -import "forge-std/Test.sol"; -import "openzeppelin-contracts/contracts/proxy/Clones.sol"; -import "openzeppelin-contracts/contracts/token/ERC20/ERC20.sol"; +import "lib/forge-std/src/Test.sol"; +import "lib/openzeppelin-contracts/contracts/proxy/Clones.sol"; +import "lib/openzeppelin-contracts/contracts/token/ERC20/ERC20.sol"; import "test/util/lib/LibTestConstants.sol"; import "test/util/lib/LibGenericPoolOrderBookV3FlashBorrowerConstants.sol"; diff --git a/test/concrete/OrderBook.deposit.t.sol b/test/concrete/OrderBook.deposit.t.sol index a96133448..5000ef198 100644 --- a/test/concrete/OrderBook.deposit.t.sol +++ b/test/concrete/OrderBook.deposit.t.sol @@ -1,7 +1,7 @@ // SPDX-License-Identifier: CAL pragma solidity =0.8.19; -import "forge-std/Test.sol"; +import "lib/forge-std/src/Test.sol"; import "test/util/lib/LibTestConstants.sol"; import "test/util/abstract/OrderBookExternalMockTest.sol"; diff --git a/test/concrete/OrderBook.vaultBalance.t.sol b/test/concrete/OrderBook.vaultBalance.t.sol index 8f4089e9e..c26439ce2 100644 --- a/test/concrete/OrderBook.vaultBalance.t.sol +++ b/test/concrete/OrderBook.vaultBalance.t.sol @@ -1,7 +1,7 @@ // SPDX-License-Identifier: CAL pragma solidity =0.8.19; -import "forge-std/Test.sol"; +import "lib/forge-std/src/Test.sol"; import "test/util/abstract/OrderBookExternalMockTest.sol"; import "test/util/concrete/Reenteroor.sol"; diff --git a/test/concrete/OrderBook.withdraw.t.sol b/test/concrete/OrderBook.withdraw.t.sol index 4f0e02150..327cc053b 100644 --- a/test/concrete/OrderBook.withdraw.t.sol +++ b/test/concrete/OrderBook.withdraw.t.sol @@ -1,9 +1,9 @@ // SPDX-License-Identifier: CAL pragma solidity =0.8.19; -import "forge-std/Test.sol"; +import "lib/forge-std/src/Test.sol"; -import {Math} from "openzeppelin-contracts/contracts/utils/math/Math.sol"; +import {Math} from "lib/openzeppelin-contracts/contracts/utils/math/Math.sol"; import "test/util/abstract/OrderBookExternalMockTest.sol"; import "test/util/concrete/Reenteroor.sol"; diff --git a/test/lib/LibOrder.t.sol b/test/lib/LibOrder.t.sol index cf3b00467..414af3dbb 100644 --- a/test/lib/LibOrder.t.sol +++ b/test/lib/LibOrder.t.sol @@ -1,7 +1,7 @@ // SPDX-License-Identifier: CAL pragma solidity =0.8.19; -import "forge-std/Test.sol"; +import "lib/forge-std/src/Test.sol"; import "src/lib/LibOrder.sol"; diff --git a/test/util/abstract/OrderBookExternalMockTest.sol b/test/util/abstract/OrderBookExternalMockTest.sol index 61a83ea52..93b95945f 100644 --- a/test/util/abstract/OrderBookExternalMockTest.sol +++ b/test/util/abstract/OrderBookExternalMockTest.sol @@ -1,10 +1,10 @@ // SPDX-License-Identifier: CAL pragma solidity =0.8.19; -import "forge-std/Test.sol"; +import "lib/forge-std/src/Test.sol"; -import "rain.interpreter/src/interface/unstable/IExpressionDeployerV2.sol"; -import "rain.metadata/LibMeta.sol"; +import "lib/rain.interpreter/src/interface/unstable/IExpressionDeployerV2.sol"; +import "lib/rain.metadata/src/LibMeta.sol"; import "test/util/lib/LibTestConstants.sol"; import "test/util/lib/LibOrderBookConstants.sol"; diff --git a/test/util/abstract/OrderBookExternalRealTest.sol b/test/util/abstract/OrderBookExternalRealTest.sol index 6b9e1ccb2..c97b36158 100644 --- a/test/util/abstract/OrderBookExternalRealTest.sol +++ b/test/util/abstract/OrderBookExternalRealTest.sol @@ -1,10 +1,10 @@ // SPDX-License-Identifier: CAL pragma solidity =0.8.19; -import "forge-std/Test.sol"; -import {RainterpreterNP} from "rain.interpreter/src/concrete/RainterpreterNP.sol"; -import "rain.interpreter/src/concrete/RainterpreterStore.sol"; -import "rain.interpreter/src/concrete/RainterpreterExpressionDeployerNP.sol"; +import "lib/forge-std/src/Test.sol"; +import {RainterpreterNP} from "lib/rain.interpreter/src/concrete/RainterpreterNP.sol"; +import "lib/rain.interpreter/src/concrete/RainterpreterStore.sol"; +import "lib/rain.interpreter/src/concrete/RainterpreterExpressionDeployerNP.sol"; import "test/util/lib/LibTestConstants.sol"; import "test/util/lib/LibOrderBookConstants.sol"; diff --git a/test/util/abstract/OrderBookSelfTest.sol b/test/util/abstract/OrderBookSelfTest.sol index a1f0dc4f7..6635991b3 100644 --- a/test/util/abstract/OrderBookSelfTest.sol +++ b/test/util/abstract/OrderBookSelfTest.sol @@ -1,7 +1,7 @@ // SPDX-License-Identifier: CAL pragma solidity =0.8.19; -import "forge-std/Test.sol"; +import "lib/forge-std/src/Test.sol"; import "test/util/lib/LibTestConstants.sol"; import "test/util/lib/LibOrderBookConstants.sol"; diff --git a/test/util/concrete/Reenteroor.sol b/test/util/concrete/Reenteroor.sol index 80ce0856b..4947426bd 100644 --- a/test/util/concrete/Reenteroor.sol +++ b/test/util/concrete/Reenteroor.sol @@ -1,7 +1,7 @@ // SPDX-License-Identifier: CAL pragma solidity =0.8.19; -import "openzeppelin-contracts/contracts/utils/Address.sol"; +import "lib/openzeppelin-contracts/contracts/utils/Address.sol"; /// @title Reenteroor /// A contract that reenters the caller with a configurable call. diff --git a/test/util/lib/LibTestAddOrder.sol b/test/util/lib/LibTestAddOrder.sol index dfabdfddc..53dedbbe1 100644 --- a/test/util/lib/LibTestAddOrder.sol +++ b/test/util/lib/LibTestAddOrder.sol @@ -1,7 +1,7 @@ // SPDX-License-Identifier: CAL pragma solidity ^0.8.19; -import "rain.metadata/LibMeta.sol"; +import "lib/rain.metadata/src/LibMeta.sol"; import "src/interface/unstable/IOrderBookV3.sol"; import "src/lib/LibOrder.sol"; import "src/concrete/OrderBook.sol"; From 3164ba7f4c96d5dabcec1796353b4c417e2b04d7 Mon Sep 17 00:00:00 2001 From: thedavidmeister Date: Wed, 6 Sep 2023 22:29:09 +0400 Subject: [PATCH 05/24] wip on deps --- foundry.toml | 2 -- lib/rain.math.fixedpoint | 2 +- script/DeployGenericPoolOrderBookV3FlashBorrower.sol | 2 +- script/DeployOrderBook.sol | 2 +- src/abstract/OrderBookV3FlashBorrower.sol | 8 ++++---- src/concrete/GenericPoolOrderBookV3ArbOrderTaker.sol | 2 +- src/concrete/OrderBook.sol | 4 ++-- 7 files changed, 10 insertions(+), 12 deletions(-) diff --git a/foundry.toml b/foundry.toml index 886998648..410b434f7 100644 --- a/foundry.toml +++ b/foundry.toml @@ -17,8 +17,6 @@ solc = "0.8.19" optimizer = true optimizer_runs = 1000000 -auto_detect_remappings = false - bytecode_hash = "none" cbor_metadata = false diff --git a/lib/rain.math.fixedpoint b/lib/rain.math.fixedpoint index 84cb2ae98..65df07e8c 160000 --- a/lib/rain.math.fixedpoint +++ b/lib/rain.math.fixedpoint @@ -1 +1 @@ -Subproject commit 84cb2ae98305719574aca4cf754aed8b681eb5d9 +Subproject commit 65df07e8c1a93adb5766ec00a05a93e474277067 diff --git a/script/DeployGenericPoolOrderBookV3FlashBorrower.sol b/script/DeployGenericPoolOrderBookV3FlashBorrower.sol index f80ed08e4..dec5f75f8 100644 --- a/script/DeployGenericPoolOrderBookV3FlashBorrower.sol +++ b/script/DeployGenericPoolOrderBookV3FlashBorrower.sol @@ -1,7 +1,7 @@ // SPDX-License-Identifier: CAL pragma solidity =0.8.19; -import "forge-std/Script.sol"; +import "lib/forge-std/src/Script.sol"; import "src/concrete/GenericPoolOrderBookV3FlashBorrower.sol"; /// @title DeployGenericPoolOrderBookV3FlashBorrower diff --git a/script/DeployOrderBook.sol b/script/DeployOrderBook.sol index 3a3818894..07a9b5a37 100644 --- a/script/DeployOrderBook.sol +++ b/script/DeployOrderBook.sol @@ -1,7 +1,7 @@ // SPDX-License-Identifier: CAL pragma solidity =0.8.19; -import "forge-std/Script.sol"; +import "lib/forge-std/src/Script.sol"; import "src/concrete/OrderBook.sol"; contract DeployOrderBook is Script { diff --git a/src/abstract/OrderBookV3FlashBorrower.sol b/src/abstract/OrderBookV3FlashBorrower.sol index 18328be43..7a3451bb8 100644 --- a/src/abstract/OrderBookV3FlashBorrower.sol +++ b/src/abstract/OrderBookV3FlashBorrower.sol @@ -1,12 +1,12 @@ // SPDX-License-Identifier: CAL pragma solidity =0.8.19; -import {ERC165, IERC165} from "openzeppelin-contracts/contracts/utils/introspection/ERC165.sol"; +import {ERC165, IERC165} from "lib/openzeppelin-contracts/contracts/utils/introspection/ERC165.sol"; import {SafeERC20} from "lib/openzeppelin-contracts/contracts/token/ERC20/utils/SafeERC20.sol"; -import {Address} from "openzeppelin-contracts/contracts/utils/Address.sol"; +import {Address} from "lib/openzeppelin-contracts/contracts/utils/Address.sol"; import {IERC20} from "lib/openzeppelin-contracts/contracts/token/ERC20/IERC20.sol"; import {ReentrancyGuard} from "lib/openzeppelin-contracts/contracts/security/ReentrancyGuard.sol"; -import {Initializable} from "openzeppelin-contracts/contracts/proxy/utils/Initializable.sol"; +import {Initializable} from "lib/openzeppelin-contracts/contracts/proxy/utils/Initializable.sol"; import { DeployerDiscoverableMetaV2, DeployerDiscoverableMetaV2ConstructionConfig, @@ -17,7 +17,7 @@ import "lib/rain.interpreter/src/lib/caller/LibContext.sol"; import "lib/rain.interpreter/src/lib/bytecode/LibBytecode.sol"; import "../interface/unstable/IOrderBookV3.sol"; -import "rain.factory/src/interface/ICloneableV2.sol"; +import "lib/rain.factory/src/interface/ICloneableV2.sol"; import "./OrderBookV3ArbCommon.sol"; /// Thrown when the initiator is not the order book. diff --git a/src/concrete/GenericPoolOrderBookV3ArbOrderTaker.sol b/src/concrete/GenericPoolOrderBookV3ArbOrderTaker.sol index bbc6068c9..b051799b1 100644 --- a/src/concrete/GenericPoolOrderBookV3ArbOrderTaker.sol +++ b/src/concrete/GenericPoolOrderBookV3ArbOrderTaker.sol @@ -4,7 +4,7 @@ pragma solidity =0.8.19; import "../abstract/OrderBookV3ArbOrderTaker.sol"; import {IERC20} from "lib/openzeppelin-contracts/contracts/token/ERC20/IERC20.sol"; import {SafeERC20} from "lib/openzeppelin-contracts/contracts/token/ERC20/utils/SafeERC20.sol"; -import {Address} from "openzeppelin-contracts/contracts/utils/Address.sol"; +import {Address} from "lib/openzeppelin-contracts/contracts/utils/Address.sol"; bytes32 constant CALLER_META_HASH = bytes32(0x00); diff --git a/src/concrete/OrderBook.sol b/src/concrete/OrderBook.sol index 4cda442f0..ed0f4aab3 100644 --- a/src/concrete/OrderBook.sol +++ b/src/concrete/OrderBook.sol @@ -7,8 +7,8 @@ import {IERC20} from "lib/openzeppelin-contracts/contracts/token/ERC20/IERC20.so import {SafeERC20} from "lib/openzeppelin-contracts/contracts/token/ERC20/utils/SafeERC20.sol"; import {ReentrancyGuard} from "lib/openzeppelin-contracts/contracts/security/ReentrancyGuard.sol"; -import "lib/rain.math.fixedpoint/src/LibFixedPointDecimalArithmeticOpenZeppelin.sol"; -import "lib/rain.math.fixedpoint/src/LibFixedPointDecimalScale.sol"; +import "lib/rain.math.fixedpoint/src/lib/LibFixedPointDecimalArithmeticOpenZeppelin.sol"; +import "lib/rain.math.fixedpoint/src/lib/LibFixedPointDecimalScale.sol"; import "lib/rain.interpreter/src/lib/caller/LibEncodedDispatch.sol"; import "lib/rain.interpreter/src/lib/caller/LibContext.sol"; import { From 2f8d3fabc700a373685406475b85fd258b1166b1 Mon Sep 17 00:00:00 2001 From: thedavidmeister Date: Wed, 6 Sep 2023 23:07:03 +0400 Subject: [PATCH 06/24] wip on deps --- .gitmodules | 9 ++++++--- lib/rain.interpreter | 2 +- lib/rain.solmem | 1 + 3 files changed, 8 insertions(+), 4 deletions(-) create mode 160000 lib/rain.solmem diff --git a/.gitmodules b/.gitmodules index 76ddad73f..260dd892c 100644 --- a/.gitmodules +++ b/.gitmodules @@ -22,9 +22,12 @@ [submodule "lib/v2-periphery"] path = lib/v2-periphery url = https://github.com/Uniswap/v2-periphery -[submodule "lib/rain.interpreter"] - path = lib/rain.interpreter - url = https://github.com/rainprotocol/rain.interpreter [submodule "lib/rain.math.fixedpoint"] path = lib/rain.math.fixedpoint url = https://github.com/rainprotocol/rain.math.fixedpoint +[submodule "lib/rain.interpreter"] + path = lib/rain.interpreter + url = https://github.com/rainprotocol/rain.interpreter +[submodule "lib/rain.solmem"] + path = lib/rain.solmem + url = https://github.com/rainprotocol/rain.solmem diff --git a/lib/rain.interpreter b/lib/rain.interpreter index 956f02df2..55c6bfdeb 160000 --- a/lib/rain.interpreter +++ b/lib/rain.interpreter @@ -1 +1 @@ -Subproject commit 956f02df2df748b6eccb27bc049f12a95b5b494b +Subproject commit 55c6bfdebda276fbacad2f6004dcf7cbbaee6219 diff --git a/lib/rain.solmem b/lib/rain.solmem new file mode 160000 index 000000000..7b2f04d6e --- /dev/null +++ b/lib/rain.solmem @@ -0,0 +1 @@ +Subproject commit 7b2f04d6e0d7d4573e6b0a17bd9c7b84a7fde05f From 90f6844486755987510997d41f1fba92c8611fd0 Mon Sep 17 00:00:00 2001 From: thedavidmeister Date: Wed, 6 Sep 2023 23:55:18 +0400 Subject: [PATCH 07/24] deps --- .gitmodules | 3 --- lib/rain.datacontract | 1 - lib/rain.interpreter | 2 +- 3 files changed, 1 insertion(+), 5 deletions(-) delete mode 160000 lib/rain.datacontract diff --git a/.gitmodules b/.gitmodules index 260dd892c..917247d3b 100644 --- a/.gitmodules +++ b/.gitmodules @@ -13,9 +13,6 @@ [submodule "lib/rain.lib.memkv"] path = lib/rain.lib.memkv url = https://github.com/rainprotocol/rain.lib.memkv -[submodule "lib/rain.datacontract"] - path = lib/rain.datacontract - url = https://github.com/rainprotocol/rain.datacontract [submodule "lib/rain.factory"] path = lib/rain.factory url = https://github.com/rainprotocol/rain.factory diff --git a/lib/rain.datacontract b/lib/rain.datacontract deleted file mode 160000 index 723bc2f27..000000000 --- a/lib/rain.datacontract +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 723bc2f273955071e598023ee325d495fc624089 diff --git a/lib/rain.interpreter b/lib/rain.interpreter index 55c6bfdeb..5ee3c88fb 160000 --- a/lib/rain.interpreter +++ b/lib/rain.interpreter @@ -1 +1 @@ -Subproject commit 55c6bfdebda276fbacad2f6004dcf7cbbaee6219 +Subproject commit 5ee3c88fb8b88dc3f708e59f1f58f286815c0f65 From 541fba34befcbd4ebf94736888abfa02b3ceb31d Mon Sep 17 00:00:00 2001 From: thedavidmeister Date: Thu, 7 Sep 2023 00:01:39 +0400 Subject: [PATCH 08/24] fix i9r deps --- .gitmodules | 6 +++--- lib/rain.interpreter | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.gitmodules b/.gitmodules index 917247d3b..aa6b06841 100644 --- a/.gitmodules +++ b/.gitmodules @@ -22,9 +22,9 @@ [submodule "lib/rain.math.fixedpoint"] path = lib/rain.math.fixedpoint url = https://github.com/rainprotocol/rain.math.fixedpoint -[submodule "lib/rain.interpreter"] - path = lib/rain.interpreter - url = https://github.com/rainprotocol/rain.interpreter [submodule "lib/rain.solmem"] path = lib/rain.solmem url = https://github.com/rainprotocol/rain.solmem +[submodule "lib/rain.interpreter"] + path = lib/rain.interpreter + url = https://github.com/rainprotocol/rain.interpreter diff --git a/lib/rain.interpreter b/lib/rain.interpreter index 5ee3c88fb..08bf44195 160000 --- a/lib/rain.interpreter +++ b/lib/rain.interpreter @@ -1 +1 @@ -Subproject commit 5ee3c88fb8b88dc3f708e59f1f58f286815c0f65 +Subproject commit 08bf44195b6a5bd34243b9798748e6d63c67e195 From 841141c3e1e41f9e38709d6000652965764ccac9 Mon Sep 17 00:00:00 2001 From: thedavidmeister Date: Thu, 7 Sep 2023 00:03:04 +0400 Subject: [PATCH 09/24] fix deploy --- .github/workflows/ci-deploy.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/ci-deploy.yaml b/.github/workflows/ci-deploy.yaml index 76ee97b1c..af3f6daf3 100644 --- a/.github/workflows/ci-deploy.yaml +++ b/.github/workflows/ci-deploy.yaml @@ -14,6 +14,7 @@ jobs: uses: DeterminateSystems/nix-installer-action@v4 - name: Install Foundry uses: foundry-rs/foundry-toolchain@v1 + with: version: nightly - name: Install rain run: nix profile install github:rainprotocol/rain.cli From 5058a1a6113672d7985a6f571549ab2281aafb69 Mon Sep 17 00:00:00 2001 From: thedavidmeister Date: Thu, 7 Sep 2023 00:04:51 +0400 Subject: [PATCH 10/24] simplify deploy --- .github/workflows/ci-deploy.yaml | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/.github/workflows/ci-deploy.yaml b/.github/workflows/ci-deploy.yaml index af3f6daf3..b69093558 100644 --- a/.github/workflows/ci-deploy.yaml +++ b/.github/workflows/ci-deploy.yaml @@ -8,26 +8,16 @@ jobs: DEPLOYMENT_KEY: ${{ github.ref == 'refs/heads/main' && secrets.PRIVATE_KEY || secrets.PRIVATE_KEY_DEV }} steps: - uses: actions/checkout@v3 - with: - submodules: recursive - name: Install Nix uses: DeterminateSystems/nix-installer-action@v4 - name: Install Foundry uses: foundry-rs/foundry-toolchain@v1 with: version: nightly - - name: Install rain - run: nix profile install github:rainprotocol/rain.cli - - run: rain --version - name: Report public key to make it easy to send funds for deployments run: cast wallet address "${DEPLOYMENT_KEY}" - name: Forge deploy contracts to mumbai env: CI_DEPLOY_RPC_URL: ${{ secrets.CI_DEPLOY_RPC_URL }} EXPLORER_VERIFICATION_KEY: ${{ secrets.EXPLORER_VERIFICATION_KEY }} - run: nix run .#deploy-contracts - # - name: Forge deploy contract to mumbai - # env: - # CI_DEPLOY_RPC_URL: ${{ secrets.CI_DEPLOY_RPC_URL }} - # EXPLORER_VERIFICATION_KEY: ${{ secrets.EXPLORER_VERIFICATION_KEY }} - # run: forge build && forge script script/DeployCloneFactory.sol:DeployCloneFactory --legacy --verify --broadcast --rpc-url "${CI_DEPLOY_RPC_URL}" --etherscan-api-key "${EXPLORER_VERIFICATION_KEY}" --sig='run(bytes)' $(rain meta build -i <(rain meta solc artifact -c abi -i out/CloneFactory.sol/CloneFactory.json) -m solidity-abi-v2 -t json -e deflate -l en -E hex) \ No newline at end of file + run: nix run .#deploy-contracts \ No newline at end of file From 9f95357050fe98de3894e849a7791614d204dac0 Mon Sep 17 00:00:00 2001 From: thedavidmeister Date: Thu, 7 Sep 2023 00:05:53 +0400 Subject: [PATCH 11/24] simplify slither --- .github/workflows/slither.yaml | 9 --------- 1 file changed, 9 deletions(-) diff --git a/.github/workflows/slither.yaml b/.github/workflows/slither.yaml index a5241f4f9..50d964610 100644 --- a/.github/workflows/slither.yaml +++ b/.github/workflows/slither.yaml @@ -5,13 +5,4 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 - # This is technically not needed as slither will try to install foundry but - # I found the installer flakey on CI. - - name: Install Foundry - uses: foundry-rs/foundry-toolchain@v1 - with: - version: nightly - - name: Use Node.js - uses: actions/setup-node@v3 - - uses: crytic/slither-action@v0.3.0 From 68ded10ac3c60e23afc3dbb3baf9cdd4cb14e725 Mon Sep 17 00:00:00 2001 From: thedavidmeister Date: Thu, 7 Sep 2023 00:06:22 +0400 Subject: [PATCH 12/24] simplify snapshot --- .github/workflows/snapshot.yml | 4 ---- 1 file changed, 4 deletions(-) diff --git a/.github/workflows/snapshot.yml b/.github/workflows/snapshot.yml index ab8722c1f..a1ef237fb 100644 --- a/.github/workflows/snapshot.yml +++ b/.github/workflows/snapshot.yml @@ -14,14 +14,10 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 - with: - submodules: recursive - - name: Install Foundry uses: foundry-rs/foundry-toolchain@v1 with: version: nightly - - name: Check gas snapshots run: forge snapshot --check id: snapshot From a7fa3f26a1cac12dada75cf5ca9d369b9dc2c8b6 Mon Sep 17 00:00:00 2001 From: thedavidmeister Date: Thu, 7 Sep 2023 00:22:17 +0400 Subject: [PATCH 13/24] shallow install for deploy --- .github/workflows/ci-deploy.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/ci-deploy.yaml b/.github/workflows/ci-deploy.yaml index b69093558..d7be78462 100644 --- a/.github/workflows/ci-deploy.yaml +++ b/.github/workflows/ci-deploy.yaml @@ -16,6 +16,8 @@ jobs: version: nightly - name: Report public key to make it easy to send funds for deployments run: cast wallet address "${DEPLOYMENT_KEY}" + - name: Forge shallow install + run: foundry install --shallow - name: Forge deploy contracts to mumbai env: CI_DEPLOY_RPC_URL: ${{ secrets.CI_DEPLOY_RPC_URL }} From 9b7ec684df4f9f337fe7835127491e4d1bba42e4 Mon Sep 17 00:00:00 2001 From: thedavidmeister Date: Thu, 7 Sep 2023 00:23:02 +0400 Subject: [PATCH 14/24] fix ci --- .github/workflows/ci-deploy.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci-deploy.yaml b/.github/workflows/ci-deploy.yaml index d7be78462..95a3a130d 100644 --- a/.github/workflows/ci-deploy.yaml +++ b/.github/workflows/ci-deploy.yaml @@ -17,7 +17,7 @@ jobs: - name: Report public key to make it easy to send funds for deployments run: cast wallet address "${DEPLOYMENT_KEY}" - name: Forge shallow install - run: foundry install --shallow + run: forge install --shallow - name: Forge deploy contracts to mumbai env: CI_DEPLOY_RPC_URL: ${{ secrets.CI_DEPLOY_RPC_URL }} From 7604a41c961dd315caa8730e3d37b681828d05fe Mon Sep 17 00:00:00 2001 From: thedavidmeister Date: Thu, 7 Sep 2023 00:53:15 +0400 Subject: [PATCH 15/24] rebuild ob meta --- flake.nix | 2 +- meta/OrderBook.rain.meta | Bin 5756 -> 5786 bytes 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/flake.nix b/flake.nix index 4ed0ae37a..6c99b0030 100644 --- a/flake.nix +++ b/flake.nix @@ -15,7 +15,7 @@ in rec { packages = rec { - concrete-contracts = ["OrderBook" "GenericPoolOrderBookFlashBorrower"]; + concrete-contracts = ["OrderBook" "GenericPoolOrderBookV3FlashBorrower"]; build-meta-cmd = contract: '' ${rain-cli} meta build \ -i <(${rain-cli} meta solc artifact -c abi -i out/${contract}.sol/${contract}.json) -m solidity-abi-v2 -t json -e deflate -l en \ diff --git a/meta/OrderBook.rain.meta b/meta/OrderBook.rain.meta index c375be5ef2fbff92250d1fc84a1dde88bded234d..8f567572bbc714dcbd4370e28d0be7b931f36336 100644 GIT binary patch delta 1628 zcmV-i2BZ1>ESfEU{|br5bnbX`r2tt5Iqh6aZ`(K!{woWgb4iL8L2r3(4Ky|2WV65q zKG4!Q;YK12k#cMl{qG&omPx%S$#I>8mo^s3A!j)J=E0F3ehw&`$5ITw;-4N5=bQoC z{G?1m#7Jpwe zQGS$=QS8aTE;ln>QsMChL}VJk4N|y2x!`QwhjNC0&*-C`!%Kf}W|8qc05yw{M8Zuh z$&?0EuCR@9HYcluuI}%pw0X4QXe+5E(L~?@U08~yFk13wU{*t8{C)EIiylfs9y6)O zrX3QlH(kzuP*@ANgsIUDqNtHcwMm~&OeRGf$lNYs2V<`5fQYB>zFsycWAcD~9SN-;~Z#vRpmn2OmW! zSJ95Ug0cyHsNqhbYIhrV!7A(Zh0JeAS}cpgn6sKV-or4Pnm#C&m}kO_AUO`U$2v& z9`~W3*%r7Wl(2><+hr}ftc5z7%>+o?(9!H1t%TolQxm$UhNTIp2X~33x&)7gBoNsp zoK|svV9=QIX*~taLZ;sh6(Nz{Q_n5dEOdjvbosSfqIz^&aKYljat@vZ{~KD>61#iU zOo4bZCPBq`z36{fI#mLv+3vLm@;`|9S*OOXZUvk(WCXJwlC83A*WjD{MukX9xpul$8O(AbOU%sgF!*X<=l5 zW(EV3;ni}U48rImjZyBi=QY<_K3&VetI9N$oPW*(J?^RCtEl$o6=;5kNdq#4|0*YI z>)>u5Tdk{<;4KDPU{V#ygKkQzC0`EC<#FZ}#trc%2uukXkFs%O`+aM7l1|M?yOo81 zwLgR9Vi=AdCME%lrSe{YjuGj z{%GKnS8U1ZlCk+SB&{eN@b)`n=Zu|yGj{LO*eN94foeHOaFF02;axxiI!EmltHwne zj;gYuww~Ua$6j<&kFPJ09V|t$lw^D5>b_D1>{io6rJXZdxU9`Qta4%hy!YBbYa@+^ ziFtMsw1;Ie08qV5?(+Q(kH2HIzF;p<|pU-%m76lKh=mL7mFZpd;>B;`(GjS|C~`s?HZ(ut~3RHgT6E@$HcG#8+` z0PP)KP>dnu3pltt3Wt9V{~Z3kdHm~#cl8X=-Wea>obGA4lY&0l0?{@lVUxC~EH%qc zoh!a>s`5|jwZY#cLGF*ur3kZssgHHLBhPE=V)?Q_hY+3CT@|+@#jCEZjq<{jA(u7U zfxu;H0op6)q0;KNvK_2`JI9$eXWA^qU|X)(=Y_8JW$ZaqBP3x`lp336cW{m7nbON_ zlZ8d^^@f^ZQ_NL(O&1zO7i96x2A36rXQBk5t9|@@q+tDW+bm}4rMU)wlyQ-ci*%eh zc$blmtHyB<;2_{bLx8KksUh+Pt8e5ks%<`Snn~@~Z9}f<1Iq{Xut_?Ttd3>kn%=?5 zZo#}w8mV`Z$KMtk?NJ`xL{ZDfEcv3xH9&p9YDu%m{XCv0IqjWpPsf{izOHqnLM?K)%4WAWE-rO(sf$ZL?j`)h z086t<=q)793!?7-Q8BccJEAbk6)x9Q95@Vi80;|E6+*c}r~@uigp$pLPbN*C`;4S{ zV!B1A4NDLmF3RP0aLf2ma*2&NI_hC5HIY$GN!IH|(e}1y;*){06fq22>FGo-kYh delta 1598 zcmV-E2EqB7E&MEh{|br5bnbX`r2tt58|_?6Z`(K!{woWgb4iL8MQ?d-4Ky|2WV65q zKG4!Q;YK12k#cM-`rmg%TNd>sB{{AW^U}r=XUG|jzIkw@$NvVD&0{GB-|$b5hjY$= zZGKWFAz~!BU(I3gZ9sfK0wD$`14hE+f)De6uOPxJGC$;h*GY+bx{{#Lh9F5sx4!vn za#ExcGKxL<$JJ)0D=Iv`fQU>3xJ3>RXP2C<$577j?-_l{=J3+rn^|N$4?xW#B$03% zOERSal`Fi*IGdAI!Z#c5rM!8xk!Y(alWHRHfG#XmQ=*pq1(+3SjK9x5f5}Km$YUlm z+H^o7^=8O_IVx)bS1{FvK@=H}wx+ErTlyJxvB%uBsePTq$5%ioaq>P4fI7}!i=C#-rT0@#G`L=Qno8^|QM<{i7 zvpoLFDoL}2{^W8LA^%Z+q_qKMbH%I<1hT2dgfjJipr5{#QnKlkSU>r9!u$Y+qrFWy zTr=I*bfZ}Ab-p_uM;__DFok99p&@&PUILYe( zQ3NBc>{cJ0H1fho8BrPo_2Kn$o)BR)p2qBd5BcY{aJPE8mWfCmvR6F+oCg`*bIH}K z`{os7@(z<5C=~vyVw7#bx4mq&u1bb?n0SEBRU{X>8EvNdYH+U3yRI>gjyFkB%1FDE z&#T(+Te~OetDbp!G(=0xKS*EuKZDh37>*t%Is?otib0#w0ggH@EtF!(tr`@UM$FiM za8*&F_9#a=49ZN)z^&xi6(gfxKllAnenwc}#_bneo9(5X;wMqsTJznqQ4G`ikgNH7 zB*QrUus$EQvzp5Q2;w7FaV`^`QmQ%Jf4 z({hmDAi+VxhkyhOj@lbmLx?sU)fE$eZ6m$4jJ^1z5no>>J6MVmDJho9)kCcb*saFI zrCl&vI=swXtP5d(fAnhLwb91oM1OV?w1;Im0Z^lK>5AhHPri0&W}_+_jOxJ5;$V1F z!+i(lr16TU|6*Ofla4G~64Dde;xXjm+hSu}_!i|9<;<>^9)K@y$#P62Rpoh_tJ$~&%_V3qLHmFQ6k`ba0uJts!r`C8KZk$s9{>8`U9$kRcg2UB z%RMc3QqU(`AljBBY|0iE4ez4djBM(9Px_a^-xNU}PW7b-{Z=3Ec28c`-o>(czC(&m zn~sXxvEp^d)>?aEDv+xh?Lgswva$i~jq6Zp_gmEt*1xUdT$^)kmTItVSM2kGQ~NIP zf~ygdFexgXjX4}#qj|3NGJng$qxX7aOYGH2FV(-_-2Ev8o_f}g2=jk{9>kH z{j%3AX6hv}1IoBe$7MRs9el`4$93a42yhT^)DYmhZyK1q!|ofoi*B2LBQ7(k{kk*M znvPgMXon{4O!79C%WHZkC%XmnHf5yVMIL|KY_vyxbW=s69JAyL7dHUS39BW~vh?$u zsandd)i=hMpH4r2QJ>+s;8Db1b$54oUnwy@zdmVf(o(zegA>-Kez5bJL08RXa)e}g zV<$>y%UV!)Z7qsYxQ>8-75kA#y%1r9dh4$@H0?-{ail&jBdU4tbbC6U%=2}x8x?Ai zyEQhuy>WS|%S&Bedc2456Adi&E}{2XI4>OSws~v|C(Lakk^bNILRY;b4x>W9bVH+q zgMJ774*FgHmFvGc;QlLV?zhr;s-3QRV!9>8h9!s&=ksz)+%hdRm0Xgbhm%zFqlW&k ww@umYJ?MUlaFhI)3lb3Ky;TvaQ>ox!ijjsMwoH?+S>IW&n&jkvvqlC~5S%$5egFUf From 99870f296f272a92058fe1d702208bf38b22149c Mon Sep 17 00:00:00 2001 From: thedavidmeister Date: Thu, 7 Sep 2023 01:06:25 +0400 Subject: [PATCH 16/24] cachix --- .github/workflows/ci-deploy.yaml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/ci-deploy.yaml b/.github/workflows/ci-deploy.yaml index 95a3a130d..b0a1ee15c 100644 --- a/.github/workflows/ci-deploy.yaml +++ b/.github/workflows/ci-deploy.yaml @@ -10,6 +10,10 @@ jobs: - uses: actions/checkout@v3 - name: Install Nix uses: DeterminateSystems/nix-installer-action@v4 + - uses: cachix/cachix-action@v12 + with: + name: nixcache + authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}' - name: Install Foundry uses: foundry-rs/foundry-toolchain@v1 with: From 8a24063eb6b2bd66ba95c7e718d3f9b2f9e5869c Mon Sep 17 00:00:00 2001 From: thedavidmeister Date: Thu, 7 Sep 2023 01:07:51 +0400 Subject: [PATCH 17/24] ob meta hash --- src/concrete/OrderBook.sol | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/concrete/OrderBook.sol b/src/concrete/OrderBook.sol index ed0f4aab3..10cb948bb 100644 --- a/src/concrete/OrderBook.sol +++ b/src/concrete/OrderBook.sol @@ -123,7 +123,7 @@ uint256 constant CONTEXT_VAULT_IO_BALANCE_DIFF = 4; uint256 constant CONTEXT_VAULT_IO_ROWS = 5; /// @dev Hash of the caller contract metadata for construction. -bytes32 constant CALLER_META_HASH = bytes32(0xf0c79e4006636a71899066ac45a478da4eafaa3117769678b6f18d96138bc156); +bytes32 constant CALLER_META_HASH = bytes32(0x71fe2f4f68f17dfe6ae7aba2bbd6cbfe5a2a48a93ebbc8b1f1900887b978eeee); /// All information resulting from an order calculation that allows for vault IO /// to be calculated and applied, then the handle IO entrypoint to be dispatched. From 29d68813661e70d3424089f340f567b1ed376af7 Mon Sep 17 00:00:00 2001 From: thedavidmeister Date: Thu, 7 Sep 2023 01:08:42 +0400 Subject: [PATCH 18/24] fix ci --- .github/workflows/ci-deploy.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci-deploy.yaml b/.github/workflows/ci-deploy.yaml index b0a1ee15c..c3a737ee7 100644 --- a/.github/workflows/ci-deploy.yaml +++ b/.github/workflows/ci-deploy.yaml @@ -11,9 +11,9 @@ jobs: - name: Install Nix uses: DeterminateSystems/nix-installer-action@v4 - uses: cachix/cachix-action@v12 - with: - name: nixcache - authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}' + with: + name: nixcache + authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}' - name: Install Foundry uses: foundry-rs/foundry-toolchain@v1 with: From 452b8ca469cd9ef02402c1c80cfa5840e3f6565b Mon Sep 17 00:00:00 2001 From: thedavidmeister Date: Thu, 7 Sep 2023 01:24:19 +0400 Subject: [PATCH 19/24] bump dispair --- script/DeployGenericPoolOrderBookV3FlashBorrower.sol | 4 ++-- script/DeployOrderBook.sol | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/script/DeployGenericPoolOrderBookV3FlashBorrower.sol b/script/DeployGenericPoolOrderBookV3FlashBorrower.sol index dec5f75f8..ba47a04a0 100644 --- a/script/DeployGenericPoolOrderBookV3FlashBorrower.sol +++ b/script/DeployGenericPoolOrderBookV3FlashBorrower.sol @@ -14,8 +14,8 @@ contract DeployGenericPoolOrderBookV3FlashBorrower is Script { function run(bytes memory meta) external { uint256 deployerPrivateKey = vm.envUint("DEPLOYMENT_KEY"); // @todo pull this from subgraph. - // hardcoded from CI https://github.com/rainprotocol/rain-protocol/actions/runs/5365826502/jobs/9934721206 - address i9rDeployer = 0x12CC9A83C200354bc35e19e6ad18a0F444aB5c86; + // https://github.com/rainprotocol/rain.interpreter/actions/runs/6000630847/job/16273099850 + address i9rDeployer = 0xCA0Ef6E0d9cd47d44aF5d87098f8482669303b06; console2.log("DeployGenericPoolOrderBookFlashBorrower meta hash:"); console2.logBytes32(keccak256(meta)); diff --git a/script/DeployOrderBook.sol b/script/DeployOrderBook.sol index 07a9b5a37..e52dd0ab4 100644 --- a/script/DeployOrderBook.sol +++ b/script/DeployOrderBook.sol @@ -8,8 +8,8 @@ contract DeployOrderBook is Script { function run(bytes memory meta) external { uint256 deployerPrivateKey = vm.envUint("DEPLOYMENT_KEY"); // @todo pull this from subgraph. - // hardcoded from CI https://github.com/rainprotocol/rain-protocol/actions/runs/5365826502/jobs/9934721206 - address i9rDeployer = 0x12CC9A83C200354bc35e19e6ad18a0F444aB5c86; + // https://github.com/rainprotocol/rain.interpreter/actions/runs/6000630847/job/16273099850 + address i9rDeployer = 0xCA0Ef6E0d9cd47d44aF5d87098f8482669303b06; console2.log("DeployOrderBook meta hash:"); console2.logBytes32(keccak256(meta)); From 4c75ebea632280c2cad8bec0c60476ba0f80f7a9 Mon Sep 17 00:00:00 2001 From: thedavidmeister Date: Thu, 7 Sep 2023 01:27:25 +0400 Subject: [PATCH 20/24] cache ci --- .github/workflows/ci-deploy.yaml | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/.github/workflows/ci-deploy.yaml b/.github/workflows/ci-deploy.yaml index c3a737ee7..b8a44a368 100644 --- a/.github/workflows/ci-deploy.yaml +++ b/.github/workflows/ci-deploy.yaml @@ -10,10 +10,7 @@ jobs: - uses: actions/checkout@v3 - name: Install Nix uses: DeterminateSystems/nix-installer-action@v4 - - uses: cachix/cachix-action@v12 - with: - name: nixcache - authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}' + - uses: DeterminateSystems/magic-nix-cache-action@v2 - name: Install Foundry uses: foundry-rs/foundry-toolchain@v1 with: From 15f87fc941dbcbf94f8cb4b85b603307183c554e Mon Sep 17 00:00:00 2001 From: thedavidmeister Date: Thu, 7 Sep 2023 09:05:28 +0400 Subject: [PATCH 21/24] flash borrower meta hash --- src/concrete/GenericPoolOrderBookV3FlashBorrower.sol | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/concrete/GenericPoolOrderBookV3FlashBorrower.sol b/src/concrete/GenericPoolOrderBookV3FlashBorrower.sol index 02691245c..ea368ded3 100644 --- a/src/concrete/GenericPoolOrderBookV3FlashBorrower.sol +++ b/src/concrete/GenericPoolOrderBookV3FlashBorrower.sol @@ -9,7 +9,7 @@ import "src/abstract/OrderBookV3FlashBorrower.sol"; /// @dev Metadata hash for `DeployerDiscoverableMetaV1`. /// - ABI for GenericPoolOrderBookFlashBorrower /// - Interpreter caller metadata V1 for GenericPoolOrderBookFlashBorrower -bytes32 constant CALLER_META_HASH = bytes32(0x3d6909481820fc692906b0477e8f98248e84973bc8b8d5ac935132857d4f4125); +bytes32 constant CALLER_META_HASH = bytes32(0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470); /// @title GenericPoolOrderBookV3FlashBorrower /// Implements the OrderBookV3FlashBorrower interface for a external liquidity From c5283b239f04d1a1a696424c98c28c81b6a36a45 Mon Sep 17 00:00:00 2001 From: thedavidmeister Date: Thu, 7 Sep 2023 09:14:59 +0400 Subject: [PATCH 22/24] debug deploy --- ...er.meta.json => GenericPoolOrderBookV3FlashBorrower.meta.json} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename src/concrete/{GenericPoolOrderBookFlashBorrower.meta.json => GenericPoolOrderBookV3FlashBorrower.meta.json} (100%) diff --git a/src/concrete/GenericPoolOrderBookFlashBorrower.meta.json b/src/concrete/GenericPoolOrderBookV3FlashBorrower.meta.json similarity index 100% rename from src/concrete/GenericPoolOrderBookFlashBorrower.meta.json rename to src/concrete/GenericPoolOrderBookV3FlashBorrower.meta.json From ada321e5e6d4dbea0a31f388cf482f695286f924 Mon Sep 17 00:00:00 2001 From: thedavidmeister Date: Thu, 7 Sep 2023 09:26:26 +0400 Subject: [PATCH 23/24] meta hash for flash borrower --- src/concrete/GenericPoolOrderBookV3FlashBorrower.sol | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/concrete/GenericPoolOrderBookV3FlashBorrower.sol b/src/concrete/GenericPoolOrderBookV3FlashBorrower.sol index ea368ded3..00bf425de 100644 --- a/src/concrete/GenericPoolOrderBookV3FlashBorrower.sol +++ b/src/concrete/GenericPoolOrderBookV3FlashBorrower.sol @@ -9,7 +9,7 @@ import "src/abstract/OrderBookV3FlashBorrower.sol"; /// @dev Metadata hash for `DeployerDiscoverableMetaV1`. /// - ABI for GenericPoolOrderBookFlashBorrower /// - Interpreter caller metadata V1 for GenericPoolOrderBookFlashBorrower -bytes32 constant CALLER_META_HASH = bytes32(0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470); +bytes32 constant CALLER_META_HASH = bytes32(0x295e86c45bd31d4c2e939082f69bcace287690253b99ccfc80f39a620167e8a0); /// @title GenericPoolOrderBookV3FlashBorrower /// Implements the OrderBookV3FlashBorrower interface for a external liquidity From a96ae9ea9357a2525815b112169059e17d5f7e43 Mon Sep 17 00:00:00 2001 From: thedavidmeister Date: Thu, 7 Sep 2023 09:38:07 +0400 Subject: [PATCH 24/24] fix meta --- .github/workflows/test-metadata.yaml | 2 +- meta/GenericPoolOrderBookFlashBorrower.rain.meta | Bin 1394 -> 0 bytes ...GenericPoolOrderBookV3FlashBorrower.rain.meta | Bin 0 -> 1408 bytes ...DeployGenericPoolOrderBookV3FlashBorrower.sol | 2 +- src/abstract/OrderBookV3FlashBorrower.sol | 2 +- ...GenericPoolOrderBookV3FlashBorrower.meta.json | 2 +- .../GenericPoolOrderBookV3FlashBorrower.sol | 6 +++--- ...ericPoolOrderBookV3FlashBorrower.sender.t.sol | 2 +- ...ericPoolOrderBookV3FlashBorrowerConstants.sol | 2 +- 9 files changed, 9 insertions(+), 9 deletions(-) delete mode 100644 meta/GenericPoolOrderBookFlashBorrower.rain.meta create mode 100644 meta/GenericPoolOrderBookV3FlashBorrower.rain.meta diff --git a/.github/workflows/test-metadata.yaml b/.github/workflows/test-metadata.yaml index 283d6b0f1..d169945f8 100644 --- a/.github/workflows/test-metadata.yaml +++ b/.github/workflows/test-metadata.yaml @@ -6,7 +6,7 @@ jobs: test: strategy: matrix: - meta-file: [src/concrete/OrderBook.meta.json, src/concrete/GenericPoolOrderBookFlashBorrower.meta.json] + meta-file: [src/concrete/OrderBook.meta.json, src/concrete/GenericPoolOrderBookV3FlashBorrower.meta.json] name: Test metadata runs-on: ubuntu-latest steps: diff --git a/meta/GenericPoolOrderBookFlashBorrower.rain.meta b/meta/GenericPoolOrderBookFlashBorrower.rain.meta deleted file mode 100644 index aa664e479efc3455695db38b1b573b18a8c56a12..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1394 zcmV-&1&#Xu3W>&a?s#;i09gbG?O021)G!eKD`?Mqp*&Q$QQC?~l$BWM0kj8iJZ()A zJF=baE~x*Vah^`%Je;;d0xqjf?3wvIp7~}b-+wI_Pg1QGZ}D#^;zV%Z#UtYyBq!0A zLjsGp3qq*`r54KtC$V`!A&JBRB)-wjE%(cg^!A{^l8r%=S}tF_-z?iwO3O6V&rSVMV7&1eq13iH3_*lP!ywKHwS`JRt|8 zx85I?x`ixGRC#L5HCsXh&NL%Nw(FivweiHc5u}`D^CNHyqXyf%9M8O_&{SZ<19{N zhsou*FbQ=^qCvP9x&BqE5z<6oeiHl}NO1yJLc%+_U278F`kk|txGC>T-O8l?Oc>A7 z^Z5)@FOF(suumY=KtEs%woKx-K9;dHe8Etg+xs!Lfp>LhAgKgy6IVPwoi-DVQ}z-F|7V#kv5 z>@$tuyh(@AFuUiiL5&ZF?s4#8C;30N{Uu}DL&mg$0qx0yHE9s-#DsJ7_5EKiC$x0) zCW3jjat_apFpA*SC(l1lDK#n;yph9jMtgsEgWZLV>XYIARH17~DqW^7?}Wdven zZlwTO0S28=y;8$441N`z=cW(9)($Wgxa-JuP;4df)v=7_06i}6j%`xftZb6}{rLO7 zmB*3PgL)!Q(P{|H4mcW$&@!K)b0|X|W8_bYYNN2V&nwDnX1o-_KI0z?e1Ah55}lzt z=okI99;5*iBs`OVWAp-DuV^{JW?NZYR9i&wR(lWgHQg}^aMHVctNEc>EO22ks~LyyV&ep~u* z79~eq0yf34sX9%OY--@qm$wX15E!_wX{Z^g>`Fs1(x1E%5nIG;A^ zma3?o=F|KG0UQ6q8^4Ck8JhxdVQ_G4X=7n@X>V>XYIARH17~DqW^7?}WdvenZfp9m ArT_o{ diff --git a/meta/GenericPoolOrderBookV3FlashBorrower.rain.meta b/meta/GenericPoolOrderBookV3FlashBorrower.rain.meta new file mode 100644 index 0000000000000000000000000000000000000000..172098fbfeef350fd4bfe1a129cdad558a8f6875 GIT binary patch literal 1408 zcmV-`1%LYg3W>&a?s#;i09gbP?O4rj+c*$@mBMFVn(i*Ty=|HVE1;=?y3L`5541Q* z*hr*6QjXms@7|$)DT$IuCqaR>7sC>VGarXD-^}RC_XXowuGQiV{*6VN2@bq^WL$&f zB>8yAVDV-_D3zepV!7ZXH7_V+i8z47H@YkGupI2(9yC~cQ_!T{S1vwmmi=8y%RJUE z&MHf1OvPdcl57*WL=9IbZv`)9nBe&Tn%%TE;`+I=qVp_)!iv&F!)30?mL*IdaE%L| zk%Q6O%Ez^CA*&NLo|<#bme7bZ&4}4MbkC*{Jar0!ltEkS}T8%5Ow=b z5Pm^e0@QO?d8UMYgEhP1MCTGNc<5fnZ^B%XscJ66>5KlW;Ff{i|FfBu`(y7b}T(t-QtgXOQ9)u7!mE7`HUY_TC zEYlm4`U7FS$mW+vn0j^68iRcXu?G4-hHTFyij9$yt)aYzk^L>`PrNo|aCgO9rSZXhWd0Uu}I2GdV7;Q+3TB4g?MCbd=>_OtK>G|s9 zX^Mk+j0J^3*o-F9mraNEk>3scem0@hc#SznGRRE{C%2B?u|g^Gp8Hal5J|i5mT;Otw6gBetcTEQWEPNF@wd3{nnK#wUbvhJ z*Vtu(tyP&9UitsLd;Uk(g8(zgyW9niH@kd zd2_oVTGDl(*f950Ci{G^J& zn^ZWPcqY8N6VkBP&OT_iXHmnkXl_h5lN8XmrPZsKHWXzqh1~8(atFl?m;H^cQ}jj~ zJ7cELMoGxmhX#Tg_E@@EJ0|3+V!AFGlKx;f5qZ7iz&^&pa|2_IWj)-;Ev||x!-~0Y z*g6dRhMX5)SHk8#It_){oo9<^en4}NWu6_-$VvW;Pru0c^tf?pVo-YaaLqbA>zQ(c z$Yc|r96dU^kTT=i6;djXp}84O5xn_U`O`_IMWv#D??+=l_f@97!Q z@$EFgb8gs#TEgR(_(Z_g)m#$lw!wh&Ouk!LHNXp_MMKX6&K>1{^#;gm5`*2NS3*`6 zsXWVs)GDgQXL6}C{`SY-pwn!A00A5S<^Qy!|191DaA9z8Y-wX*bZKvHFKTmdZUbjz zWoB$)bY%o$Wp1SaSpf^3kTFlgFc5|R$|-Zxg^jHpU@9P0VnG=$_9e0E_>9j1DwO|@ zZBp8-Z1(xy`~2Q_<#43xzIr4_!6@*|7C2}M&@!K(vnWG4hQOZ`s!fHhd0I(clHxfF z_G$n1?jZ~I*L_W*(((@ag|K#nIADZ`ClauXPM`}s0=nBzpwpnzNO%g0fW9IHhZd}P zpNux~d=Z_YMM(^HYCz*)cR2heiVTWB3XTe=c#0=wy1buR1yxS6h2!KshbRf=1Bn=R z*_$+=Qt1voM&tTzZp0dt6mbbyXJB1?>TFq;!1YaqBgKJrlDz%ZFL7#DqHq|v%c5CKl{s93S|H2!;hRhk80&rn)aBOK~VRUJ4ZZB$cZ*Bu; OWMyV-VRU5#Vr6dGTgo>8 literal 0 HcmV?d00001 diff --git a/script/DeployGenericPoolOrderBookV3FlashBorrower.sol b/script/DeployGenericPoolOrderBookV3FlashBorrower.sol index ba47a04a0..ae15b54be 100644 --- a/script/DeployGenericPoolOrderBookV3FlashBorrower.sol +++ b/script/DeployGenericPoolOrderBookV3FlashBorrower.sol @@ -17,7 +17,7 @@ contract DeployGenericPoolOrderBookV3FlashBorrower is Script { // https://github.com/rainprotocol/rain.interpreter/actions/runs/6000630847/job/16273099850 address i9rDeployer = 0xCA0Ef6E0d9cd47d44aF5d87098f8482669303b06; - console2.log("DeployGenericPoolOrderBookFlashBorrower meta hash:"); + console2.log("DeployGenericPoolOrderBookV3FlashBorrower meta hash:"); console2.logBytes32(keccak256(meta)); vm.startBroadcast(deployerPrivateKey); diff --git a/src/abstract/OrderBookV3FlashBorrower.sol b/src/abstract/OrderBookV3FlashBorrower.sol index 7a3451bb8..d12ae846c 100644 --- a/src/abstract/OrderBookV3FlashBorrower.sol +++ b/src/abstract/OrderBookV3FlashBorrower.sol @@ -244,7 +244,7 @@ abstract contract OrderBookV3FlashBorrower is /// @param exchangeData Arbitrary bytes that will be passed to `_exchange` /// after the flash loan is taken. The inheriting contract is responsible /// for decoding this data and defining how it controls interactions with - /// the external liquidity. For example, `GenericPoolOrderBookFlashBorrower` + /// the external liquidity. For example, `GenericPoolOrderBookV3FlashBorrower` /// uses this data as a literal encoded external call. function arb(TakeOrdersConfigV2 calldata takeOrders, uint256 minimumSenderOutput, bytes calldata exchangeData) external diff --git a/src/concrete/GenericPoolOrderBookV3FlashBorrower.meta.json b/src/concrete/GenericPoolOrderBookV3FlashBorrower.meta.json index 748c45bea..7bb058f40 100644 --- a/src/concrete/GenericPoolOrderBookV3FlashBorrower.meta.json +++ b/src/concrete/GenericPoolOrderBookV3FlashBorrower.meta.json @@ -1,6 +1,6 @@ { "name": "Generic pool order book flash borrower", - "abiName": "GenericPoolOrderBookFlashBorrower", + "abiName": "GenericPoolOrderBookV3FlashBorrower", "desc": "A generic flash borrower that takes loans from an order book and can source external liquidity from any basic onchain AMM pool to cover the loan and specific orderbook orders. Supports expression based access gating.", "alias": "generic-pool-order-book-flash-borrower", "methods": [{ diff --git a/src/concrete/GenericPoolOrderBookV3FlashBorrower.sol b/src/concrete/GenericPoolOrderBookV3FlashBorrower.sol index 00bf425de..1a27af1ec 100644 --- a/src/concrete/GenericPoolOrderBookV3FlashBorrower.sol +++ b/src/concrete/GenericPoolOrderBookV3FlashBorrower.sol @@ -7,9 +7,9 @@ import "src/interface/ierc3156/IERC3156FlashBorrower.sol"; import "src/abstract/OrderBookV3FlashBorrower.sol"; /// @dev Metadata hash for `DeployerDiscoverableMetaV1`. -/// - ABI for GenericPoolOrderBookFlashBorrower -/// - Interpreter caller metadata V1 for GenericPoolOrderBookFlashBorrower -bytes32 constant CALLER_META_HASH = bytes32(0x295e86c45bd31d4c2e939082f69bcace287690253b99ccfc80f39a620167e8a0); +/// - ABI for GenericPoolOrderBookV3FlashBorrower +/// - Interpreter caller metadata V1 for GenericPoolOrderBookV3FlashBorrower +bytes32 constant CALLER_META_HASH = bytes32(0x29f743ae23bd47eb7e739052b90fb5dfda4b0528b60f129ce63cdf73213da49f); /// @title GenericPoolOrderBookV3FlashBorrower /// Implements the OrderBookV3FlashBorrower interface for a external liquidity diff --git a/test/concrete/GenericPoolOrderBookV3FlashBorrower.sender.t.sol b/test/concrete/GenericPoolOrderBookV3FlashBorrower.sender.t.sol index a6222aea2..5932749bf 100644 --- a/test/concrete/GenericPoolOrderBookV3FlashBorrower.sender.t.sol +++ b/test/concrete/GenericPoolOrderBookV3FlashBorrower.sender.t.sol @@ -76,7 +76,7 @@ contract GenericPoolOrderBookV3FlashBorrowerTest is Test { abi.encode(address(0), address(0), address(0)) ); bytes memory meta = vm.readFileBinary(GENERIC_POOL_ORDER_BOOK_FLASH_BORROWER_META_PATH); - console2.log("GenericPoolOrderBookFlashBorrowerTest meta hash:"); + console2.log("GenericPoolOrderBookV3FlashBorrowerTest meta hash:"); console2.logBytes32(keccak256(meta)); implementation = address( new GenericPoolOrderBookV3FlashBorrower(DeployerDiscoverableMetaV2ConstructionConfig( diff --git a/test/util/lib/LibGenericPoolOrderBookV3FlashBorrowerConstants.sol b/test/util/lib/LibGenericPoolOrderBookV3FlashBorrowerConstants.sol index e97845618..9e5d4ba06 100644 --- a/test/util/lib/LibGenericPoolOrderBookV3FlashBorrowerConstants.sol +++ b/test/util/lib/LibGenericPoolOrderBookV3FlashBorrowerConstants.sol @@ -1,4 +1,4 @@ // SPDX-License-Identifier: CAL pragma solidity ^0.8.18; -string constant GENERIC_POOL_ORDER_BOOK_FLASH_BORROWER_META_PATH = "meta/GenericPoolOrderBookFlashBorrower.rain.meta"; +string constant GENERIC_POOL_ORDER_BOOK_FLASH_BORROWER_META_PATH = "meta/GenericPoolOrderBookV3FlashBorrower.rain.meta";