diff --git a/contracts/helper/RingHelper.sol b/contracts/helper/RingHelper.sol index 1298276..92fe56a 100644 --- a/contracts/helper/RingHelper.sol +++ b/contracts/helper/RingHelper.sol @@ -240,7 +240,7 @@ library RingHelper { returns (uint fill) { uint ringSize = ring.size; - uint fillSize = 8 * 32; + uint fillSize = 232; assembly { fill := destPtr let participations := mload(add(ring, 32)) // ring.participations @@ -263,14 +263,14 @@ library RingHelper { mload(add(participation, 224)) // participation.rebateFeeB ) - mstore(add(fill, 0), mload(add(order, 864))) // order.hash - mstore(add(fill, 32), mload(add(order, 32))) // order.owner - mstore(add(fill, 64), mload(add(order, 64))) // order.tokenS - mstore(add(fill, 96), mload(add(participation, 256))) // participation.fillAmountS - mstore(add(fill, 128), mload(add(participation, 32))) // participation.splitS - mstore(add(fill, 160), feeAmount) // feeAmount - mstore(add(fill, 192), feeAmountS) // feeAmountS - mstore(add(fill, 224), feeAmountB) // feeAmountB + mstore(add(fill, 200), mload(add(order, 864))) // order.hash + mstore(add(fill, 168), mload(add(order, 32))) // order.owner + mstore(add(fill, 148), mload(add(order, 64))) // order.tokenS + mstore(add(fill, 128), mload(add(participation, 256))) // participation.fillAmountS + mstore(add(fill, 96), mload(add(participation, 32))) // participation.splitS + mstore(add(fill, 64), feeAmount) // feeAmount + mstore(add(fill, 32), feeAmountS) // feeAmountS + mstore(add(fill, 0), feeAmountB) // feeAmountB fill := add(fill, fillSize) } diff --git a/contracts/impl/RingSubmitter.sol b/contracts/impl/RingSubmitter.sol index cee18b7..56a7fbf 100644 --- a/contracts/impl/RingSubmitter.sol +++ b/contracts/impl/RingSubmitter.sol @@ -271,7 +271,7 @@ contract RingSubmitter is IRingSubmitter, NoDefaultFunc { bytes32 ringHash = ring.hash; // keccak256("RingMined(uint256,bytes32,address,bytes)") bytes32 ringMinedSignature = 0xb2ef4bc5209dff0c46d5dfddb2b68a23bd4820e8f33107fde76ed15ba90695c9; - uint fillsSize = ring.size * 8 * 32; + uint fillsSize = ring.size * 232; uint data; uint ptr; diff --git a/test/testExchangeUtil.ts b/test/testExchangeUtil.ts index ea634c8..5d2abd5 100644 --- a/test/testExchangeUtil.ts +++ b/test/testExchangeUtil.ts @@ -63,19 +63,19 @@ export class ExchangeTestUtil { public async getRingMinedEvents(fromBlock: number) { const parseFillsData = (data: string) => { const b = new pjs.Bitstream(data); - const fillSize = 8 * 32; + const fillSize = 232; const numFills = b.length() / fillSize; const fills: pjs.Fill[] = []; for (let offset = 0; offset < b.length(); offset += fillSize) { const fill: pjs.Fill = { - orderHash: "0x" + b.extractBytes32(offset).toString("hex"), - owner: "0x" + b.extractBytes32(offset + 32).toString("hex").slice(24), - tokenS: "0x" + b.extractBytes32(offset + 64).toString("hex").slice(24), - amountS: b.extractUint(offset + 96), - split: b.extractUint(offset + 128), - feeAmount: b.extractUint(offset + 160), - feeAmountS: b.extractUint(offset + 192), - feeAmountB: b.extractUint(offset + 224), + orderHash: "0x" + b.extractBytes32(offset + 200).toString("hex"), + owner: "0x" + b.extractBytes32(offset + 168).toString("hex").slice(24), + tokenS: "0x" + b.extractBytes32(offset + 148).toString("hex").slice(24), + amountS: b.extractUint(offset + 128), + split: b.extractUint(offset + 96), + feeAmount: b.extractUint(offset + 64), + feeAmountS: b.extractUint(offset + 32), + feeAmountB: b.extractUint(offset + 0), }; fills.push(fill); }