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

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion crates/test_fixtures/abis/RaindexV6.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion foundry.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "raindex"
version = "0.1.12"
version = "0.1.13"

[profile.default]
src = 'src'
Expand Down
18 changes: 16 additions & 2 deletions src/concrete/raindex/RaindexV6.sol
Original file line number Diff line number Diff line change
Expand Up @@ -376,7 +376,14 @@ contract RaindexV6 is IRaindexV6, IMetaV1_2, ReentrancyGuard, Multicall, Raindex
emit MetaV1_2(order.owner, orderHash, orderConfig.meta);
}

_doOrderPost(orderHash, post);
LibRaindex.doPost(
LibBytes32Matrix.matrixFrom(
LibBytes32Array.arrayFrom(
orderHash, bytes32(uint256(uint160(msg.sender))), bytes32(uint256(uint160(address(0))))
)
),
post
);
}

return stateChange;
Expand All @@ -397,7 +404,14 @@ contract RaindexV6 is IRaindexV6, IMetaV1_2, ReentrancyGuard, Multicall, Raindex
sOrders[orderHash] = ORDER_DEAD;
emit RemoveOrderV3(msg.sender, orderHash, order);

_doOrderPost(orderHash, post);
LibRaindex.doPost(
LibBytes32Matrix.matrixFrom(
LibBytes32Array.arrayFrom(
orderHash, bytes32(uint256(uint160(msg.sender))), bytes32(uint256(uint160(address(0))))
)
),
post
);
}
}

Expand Down
6 changes: 3 additions & 3 deletions src/generated/GenericPoolRaindexV6ArbOrderTaker.pointers.sol

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions src/generated/GenericPoolRaindexV6FlashBorrower.pointers.sol

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions src/generated/RaindexV6.pointers.sol

Large diffs are not rendered by default.

Large diffs are not rendered by default.

59 changes: 59 additions & 0 deletions src/lib/deploy/LibRaindexDeploy.sol
Original file line number Diff line number Diff line change
Expand Up @@ -762,6 +762,65 @@ library LibRaindexDeploy {
bytes32 constant GENERIC_POOL_FLASH_BORROWER_DEPLOYED_CODEHASH_0_1_12 =
0x03cde49152f7b5e29826ea8c561481b747b86be1f5cb4136fa064be6e4ac1c0d;

/// The deployed address of the `RaindexV6` contract at the published `0.1.13`
/// tag. (Changed in 0.1.13 — order-counterparty() returns address(0) in
/// post-actions.)
address constant RAINDEX_DEPLOYED_ADDRESS_0_1_13 = 0xF634958cD5F0583ad00a60eE6408638481954eD1;

/// The runtime code hash of the `RaindexV6` contract at the published `0.1.13`
/// tag.
bytes32 constant RAINDEX_DEPLOYED_CODEHASH_0_1_13 =
0x0b448817be97eb10589c6c01724ff1af889d25f577368c2a11e0da3a02cc1200;

/// The deployed address of the `RaindexV6SubParser` contract at the
/// published `0.1.13` tag. (Unchanged from `0.1.2`.)
address constant SUB_PARSER_DEPLOYED_ADDRESS_0_1_13 = 0x09Bc7AF266012F44fb41D8Bd682da931666605e1;

/// The runtime code hash of the `RaindexV6SubParser` contract at the
/// published `0.1.13` tag.
bytes32 constant SUB_PARSER_DEPLOYED_CODEHASH_0_1_13 =
0x704aadc1ed56f63ff918ab219e6681a5d2851d774e2ee136bbe7904ea3b2fdcd;

/// The deployed address of the `RouteProcessor4` contract at the published
/// `0.1.13` tag. (Unchanged from `0.1.0`.)
address constant ROUTE_PROCESSOR_DEPLOYED_ADDRESS_0_1_13 = 0x6E2d0e71d900474b262E545Bc4C98b71ab368d21;

/// The runtime code hash of the `RouteProcessor4` contract at the published
/// `0.1.13` tag. (Unchanged from `0.1.0`.)
bytes32 constant ROUTE_PROCESSOR_DEPLOYED_CODEHASH_0_1_13 =
0xeb3745a79c6ba48e8767b9c355b8e7b79f9d6edeca004e4bb91be4de515a7eeb;

/// The deployed address of the `GenericPoolRaindexV6ArbOrderTaker` contract
/// at the published `0.1.13` tag. (Changed in 0.1.13 — embeds new raindex
/// address.)
address constant GENERIC_POOL_ARB_ORDER_TAKER_DEPLOYED_ADDRESS_0_1_13 = 0xE85ee58EBC0e989aAe4fC11070c3507F50459D05;

/// The runtime code hash of the `GenericPoolRaindexV6ArbOrderTaker` contract
/// at the published `0.1.13` tag.
bytes32 constant GENERIC_POOL_ARB_ORDER_TAKER_DEPLOYED_CODEHASH_0_1_13 =
0xf5c1bdfa77ca124ef6598c94a207d431efbed2ab018231201e267b65ddc62ee5;

/// The deployed address of the `RouteProcessorRaindexV6ArbOrderTaker`
/// contract at the published `0.1.13` tag. (Changed in 0.1.13 — embeds new
/// raindex address.)
address constant ROUTE_PROCESSOR_ARB_ORDER_TAKER_DEPLOYED_ADDRESS_0_1_13 =
0x6b3094089F9Ff64f82fC209d97a0F642a13A3013;

/// The runtime code hash of the `RouteProcessorRaindexV6ArbOrderTaker`
/// contract at the published `0.1.13` tag.
bytes32 constant ROUTE_PROCESSOR_ARB_ORDER_TAKER_DEPLOYED_CODEHASH_0_1_13 =
0x9b1c8621d0c8a809419581558177f2f6801598e4c0b97490d903e687ab466a74;

/// The deployed address of the `GenericPoolRaindexV6FlashBorrower` contract
/// at the published `0.1.13` tag. (Changed in 0.1.13 — embeds new raindex
/// address.)
address constant GENERIC_POOL_FLASH_BORROWER_DEPLOYED_ADDRESS_0_1_13 = 0xE85e902dB1eB3897f9D419B53cEB39D14644E621;

/// The runtime code hash of the `GenericPoolRaindexV6FlashBorrower` contract
/// at the published `0.1.13` tag.
bytes32 constant GENERIC_POOL_FLASH_BORROWER_DEPLOYED_CODEHASH_0_1_13 =
0xb5a357e18838d2513e6a67c493adb9467b8bd5a90c22d6e6bbe0cbc218c3f948;

uint256 constant RAINDEX_START_BLOCK_ARBITRUM = 473899359;
uint256 constant RAINDEX_START_BLOCK_BASE = 47387582;
uint256 constant RAINDEX_START_BLOCK_FLARE = 63011168;
Expand Down
22 changes: 22 additions & 0 deletions test/concrete/raindex/RaindexV6.addOrder.entask.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -201,4 +201,26 @@ contract RaindexV6AddOrderEnactTest is RaindexV6ExternalRealTest {

checkAddOrder(alice, config, evals, 0, 0);
}

/// order-counterparty() in an addOrder post-action must return address(0)
/// (no counterparty in an add-order context) rather than panicking with an
/// array OOB access. Fixes #2619.
/// forge-config: default.fuzz.runs = 10
function testAddOrderCounterpartyIsZeroAddress(address alice, OrderConfigV4 memory config) external {
LibTestAddOrder.conformConfig(config, iInterpreter, iStore);

string memory usingWordsFrom = string.concat("using-words-from ", address(iSubParser).toHexString(), "\n");

bytes[] memory evals = new bytes[](1);
evals[0] = bytes(
string.concat(
usingWordsFrom,
":ensure(equal-to(order-counterparty() ",
address(0).toHexString(),
") \"order-counterparty zero\");"
)
);

checkAddOrder(alice, config, evals, 0, 0);
}
}
Loading