Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix V3 Serialization #276

Merged
merged 3 commits into from
Sep 25, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Original file line number Diff line number Diff line change
@@ -1 +1 @@
198132
198780
2 changes: 1 addition & 1 deletion .forge-snapshots/Base-V3DutchOrder-ExecuteBatch.snap
Original file line number Diff line number Diff line change
@@ -1 +1 @@
229797
231116
Original file line number Diff line number Diff line change
@@ -1 +1 @@
243298
244626
Original file line number Diff line number Diff line change
@@ -1 +1 @@
300708
302041
Original file line number Diff line number Diff line change
@@ -1 +1 @@
223323
224642
2 changes: 1 addition & 1 deletion .forge-snapshots/Base-V3DutchOrder-ExecuteSingle.snap
Original file line number Diff line number Diff line change
@@ -1 +1 @@
164517
165165
Original file line number Diff line number Diff line change
@@ -1 +1 @@
150079
150727
Original file line number Diff line number Diff line change
@@ -1 +1 @@
173829
174481
2 changes: 1 addition & 1 deletion .forge-snapshots/Base-V3DutchOrder-RevertInvalidNonce.snap
Original file line number Diff line number Diff line change
@@ -1 +1 @@
43133
43785
2 changes: 1 addition & 1 deletion .forge-snapshots/Base-V3DutchOrder-V3-ExclusiveFiller.snap
Original file line number Diff line number Diff line change
@@ -1 +1 @@
168443
169089
2 changes: 1 addition & 1 deletion .forge-snapshots/Base-V3DutchOrder-V3-InputOverride.snap
Original file line number Diff line number Diff line change
@@ -1 +1 @@
168524
169170
2 changes: 1 addition & 1 deletion .forge-snapshots/Base-V3DutchOrder-V3-OutputOverride.snap
Original file line number Diff line number Diff line change
@@ -1 +1 @@
168467
169113
2 changes: 1 addition & 1 deletion .forge-snapshots/V3-DutchDecay.snap
Original file line number Diff line number Diff line change
@@ -1 +1 @@
20920
13179
2 changes: 1 addition & 1 deletion .forge-snapshots/V3-DutchDecayBounded.snap
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1209
1199
2 changes: 1 addition & 1 deletion .forge-snapshots/V3-DutchDecayFullyDecayed.snap
Original file line number Diff line number Diff line change
@@ -1 +1 @@
11797
6677
2 changes: 1 addition & 1 deletion .forge-snapshots/V3-DutchDecayFullyDecayedNegative.snap
Original file line number Diff line number Diff line change
@@ -1 +1 @@
11485
6365
2 changes: 1 addition & 1 deletion .forge-snapshots/V3-ExtendedMultiPointDutchDecay.snap
Original file line number Diff line number Diff line change
@@ -1 +1 @@
209206
88354
2 changes: 1 addition & 1 deletion .forge-snapshots/V3-LocateCurvePositionMulti.snap
Original file line number Diff line number Diff line change
@@ -1 +1 @@
40525
20492
2 changes: 1 addition & 1 deletion .forge-snapshots/V3-LocateCurvePositionSingle.snap
Original file line number Diff line number Diff line change
@@ -1 +1 @@
12623
6860
2 changes: 1 addition & 1 deletion .forge-snapshots/V3-MultiPointDutchDecay.snap
Original file line number Diff line number Diff line change
@@ -1 +1 @@
48878
26242
8 changes: 7 additions & 1 deletion src/lib/V3DutchOrderLib.sol
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,13 @@ library V3DutchOrderLib {
bytes32 internal constant NON_LINEAR_DECAY_TYPE_HASH = keccak256(NON_LINEAR_DECAY_TYPE);

bytes internal constant ORDER_TYPE =
abi.encodePacked(NON_LINEAR_DECAY_TYPE, V3_DUTCH_ORDER_TYPE, V3_DUTCH_OUTPUT_TYPE, OrderInfoLib.ORDER_INFO_TYPE);
abi.encodePacked(
NON_LINEAR_DECAY_TYPE,
V3_DUTCH_ORDER_TYPE,
V3_DUTCH_INPUT_TYPE,
codyborn marked this conversation as resolved.
Show resolved Hide resolved
V3_DUTCH_OUTPUT_TYPE,
OrderInfoLib.ORDER_INFO_TYPE
);
bytes32 internal constant ORDER_TYPE_HASH = keccak256(ORDER_TYPE);

/// @dev Note that sub-structs have to be defined in alphabetical order in the EIP-712 spec
Expand Down
2 changes: 1 addition & 1 deletion src/types/Uint16Array.sol
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ function toUint16Array(uint16[] memory inputArray) pure returns (Uint16Array uin

library Uint16ArrayLibrary {
// Retrieve the nth uint16 value from a packed uint256
function getElement(Uint16Array packedData, uint256 n) public pure returns (uint16) {
function getElement(Uint16Array packedData, uint256 n) internal pure returns (uint16) {
if (n >= 16) {
revert IndexOutOfBounds();
}
Expand Down
Loading