Skip to content
This repository was archived by the owner on Mar 18, 2019. It is now read-only.
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
18 changes: 9 additions & 9 deletions contracts/helper/RingHelper.sol
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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)
}
Expand Down
2 changes: 1 addition & 1 deletion contracts/impl/RingSubmitter.sol
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
18 changes: 9 additions & 9 deletions test/testExchangeUtil.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down