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/RaindexV6SubParser.json

Large diffs are not rendered by default.

12 changes: 6 additions & 6 deletions src/generated/RaindexV6SubParser.pointers.sol

Large diffs are not rendered by default.

5 changes: 3 additions & 2 deletions src/lib/LibRaindexSubParser.sol
Original file line number Diff line number Diff line change
Expand Up @@ -277,14 +277,15 @@ library LibRaindexSubParser {
}

/// @dev Maps the "signers" word to the signed context signers column.
/// Uses the operand to select the row.
/// The low byte of the operand selects the row.
function subParserSigners(uint256, uint256, OperandV2 operand)
internal
pure
returns (bool, bytes memory, bytes32[] memory)
{
uint256 row = uint256(OperandV2.unwrap(operand)) & 0xFF;
//slither-disable-next-line unused-return
return LibSubParse.subParserContext(CONTEXT_SIGNED_CONTEXT_SIGNERS_COLUMN, uint256(OperandV2.unwrap(operand)));
return LibSubParse.subParserContext(CONTEXT_SIGNED_CONTEXT_SIGNERS_COLUMN, row);
}

/// @dev Maps the "deposit-token" word to the calling context column.
Expand Down
56 changes: 56 additions & 0 deletions src/lib/deploy/LibRaindexDeploy.sol
Original file line number Diff line number Diff line change
Expand Up @@ -762,6 +762,62 @@ 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. (Unchanged from `0.1.12`.)
address constant RAINDEX_DEPLOYED_ADDRESS_0_1_13 = 0x37FC0EFec37D19f8A221aa4F8F7600C9ba2AcD20;

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

/// The deployed address of the `RaindexV6SubParser` contract at the
/// published `0.1.13` tag. (Changed in 0.1.13 — mask signer row operand to
/// low byte.)
address constant SUB_PARSER_DEPLOYED_ADDRESS_0_1_13 = 0x420f597688A249eC28aBA121960ada4d9091cbAa;

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

/// 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. (Unchanged from `0.1.12`.)
address constant GENERIC_POOL_ARB_ORDER_TAKER_DEPLOYED_ADDRESS_0_1_13 = 0xE84c106B0A89A164d2D65205B9EBAE37c15Fd84a;

/// 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 =
0x02b17ab238a36ebcedee19fa5a374d6122865be8fff61bf45ad15822c8482030;

/// The deployed address of the `RouteProcessorRaindexV6ArbOrderTaker`
/// contract at the published `0.1.13` tag. (Unchanged from `0.1.12`.)
address constant ROUTE_PROCESSOR_ARB_ORDER_TAKER_DEPLOYED_ADDRESS_0_1_13 =
0x1350420cbf3E9eb8F1734bbe466e0F303579eE24;

/// 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 =
0x9a0d64fd312dc16761f28a7e13e48a8e8ad2f0ba5995c16710514e7524f43ee2;

/// The deployed address of the `GenericPoolRaindexV6FlashBorrower` contract
/// at the published `0.1.13` tag. (Unchanged from `0.1.12`.)
address constant GENERIC_POOL_FLASH_BORROWER_DEPLOYED_ADDRESS_0_1_13 = 0x032d9D94A79909F3b337ECFE6f73f4e86bA79c7E;

/// 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 =
0x03cde49152f7b5e29826ea8c561481b747b86be1f5cb4136fa064be6e4ac1c0d;

uint256 constant RAINDEX_START_BLOCK_ARBITRUM = 473899359;
uint256 constant RAINDEX_START_BLOCK_BASE = 47387582;
uint256 constant RAINDEX_START_BLOCK_FLARE = 63011168;
Expand Down
16 changes: 16 additions & 0 deletions test/concrete/parser/RaindexV6SubParser.signers.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -72,4 +72,20 @@ contract RaindexV6SubParserSignersTest is OpTest {

checkUnhappyParse2(rainlang, abi.encodeWithSelector(StackAllocationMismatch.selector, 2, 1));
}

/// signer<256>() must resolve to the same row as signer<0>(): the row
/// operand is masked to its low byte so 256 wraps to 0.
function testSubParserContextSignerRowMaskLowByte() external view {
address subParserAddress = LibRaindexDeploy.SUB_PARSER_DEPLOYED_ADDRESS;

StackItem[] memory expectedStack = new StackItem[](1);
expectedStack[0] = StackItem.wrap(keccak256(bytes("signer-0")));

bytes memory rainlang =
bytes(string.concat("using-words-from ", subParserAddress.toHexString(), " _: signer<256>();"));

checkHappy(
rainlang, LibRaindexSubParserContextFixture.hashedNamesContext(), expectedStack, "signer-256-wraps-to-0"
);
}
}
Loading