diff --git a/package.json b/package.json index fffd976..ae196e6 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "seaport-types", - "version": "0.0.1", + "version": "1.6.0", "description": "Core types and interfaces for Seaport", "main": "src/", "repository": "https://github.com/ProjectOpenSea/seaport-types.git", diff --git a/src/helpers/PointerLibraries.sol b/src/helpers/PointerLibraries.sol index 298d6c0..6bfafad 100644 --- a/src/helpers/PointerLibraries.sol +++ b/src/helpers/PointerLibraries.sol @@ -18,6 +18,7 @@ using MemoryWriters for MemoryPointer global; CalldataPointer constant CalldataStart = CalldataPointer.wrap(0x04); MemoryPointer constant FreeMemoryPPtr = MemoryPointer.wrap(0x40); +MemoryPointer constant ZeroSlotPtr = MemoryPointer.wrap(0x60); uint256 constant IdentityPrecompileAddress = 0x4; uint256 constant OffsetOrLengthMask = 0xffffffff; uint256 constant _OneWord = 0x20; @@ -47,28 +48,31 @@ function setFreeMemoryPointer(MemoryPointer mPtr) pure { } library CalldataPointerLib { - function lt( - CalldataPointer a, - CalldataPointer b - ) internal pure returns (bool c) { + function lt(CalldataPointer a, CalldataPointer b) + internal + pure + returns (bool c) + { assembly { c := lt(a, b) } } - function gt( - CalldataPointer a, - CalldataPointer b - ) internal pure returns (bool c) { + function gt(CalldataPointer a, CalldataPointer b) + internal + pure + returns (bool c) + { assembly { c := gt(a, b) } } - function eq( - CalldataPointer a, - CalldataPointer b - ) internal pure returns (bool c) { + function eq(CalldataPointer a, CalldataPointer b) + internal + pure + returns (bool c) + { assembly { c := eq(a, b) } @@ -83,10 +87,11 @@ library CalldataPointerLib { /// @dev Resolves an offset stored at `cdPtr + headOffset` to a calldata. /// pointer `cdPtr` must point to some parent object with a dynamic /// type's head stored at `cdPtr + headOffset`. - function pptr( - CalldataPointer cdPtr, - uint256 headOffset - ) internal pure returns (CalldataPointer cdPtrChild) { + function pptrOffset(CalldataPointer cdPtr, uint256 headOffset) + internal + pure + returns (CalldataPointer cdPtrChild) + { cdPtrChild = cdPtr.offset( cdPtr.offset(headOffset).readUint256() & OffsetOrLengthMask ); @@ -95,26 +100,31 @@ library CalldataPointerLib { /// @dev Resolves an offset stored at `cdPtr` to a calldata pointer. /// `cdPtr` must point to some parent object with a dynamic type as its /// first member, e.g. `struct { bytes data; }` - function pptr( - CalldataPointer cdPtr - ) internal pure returns (CalldataPointer cdPtrChild) { + function pptr(CalldataPointer cdPtr) + internal + pure + returns (CalldataPointer cdPtrChild) + { cdPtrChild = cdPtr.offset(cdPtr.readUint256() & OffsetOrLengthMask); } /// @dev Returns the calldata pointer one word after `cdPtr`. - function next( - CalldataPointer cdPtr - ) internal pure returns (CalldataPointer cdPtrNext) { + function next(CalldataPointer cdPtr) + internal + pure + returns (CalldataPointer cdPtrNext) + { assembly { cdPtrNext := add(cdPtr, _OneWord) } } /// @dev Returns the calldata pointer `_offset` bytes after `cdPtr`. - function offset( - CalldataPointer cdPtr, - uint256 _offset - ) internal pure returns (CalldataPointer cdPtrNext) { + function offset(CalldataPointer cdPtr, uint256 _offset) + internal + pure + returns (CalldataPointer cdPtrNext) + { assembly { cdPtrNext := add(cdPtr, _offset) } @@ -122,11 +132,10 @@ library CalldataPointerLib { /// @dev Copies `size` bytes from calldata starting at `src` to memory at /// `dst`. - function copy( - CalldataPointer src, - MemoryPointer dst, - uint256 size - ) internal pure { + function copy(CalldataPointer src, MemoryPointer dst, uint256 size) + internal + pure + { assembly { calldatacopy(dst, src, size) } @@ -134,28 +143,31 @@ library CalldataPointerLib { } library ReturndataPointerLib { - function lt( - ReturndataPointer a, - ReturndataPointer b - ) internal pure returns (bool c) { + function lt(ReturndataPointer a, ReturndataPointer b) + internal + pure + returns (bool c) + { assembly { c := lt(a, b) } } - function gt( - ReturndataPointer a, - ReturndataPointer b - ) internal pure returns (bool c) { + function gt(ReturndataPointer a, ReturndataPointer b) + internal + pure + returns (bool c) + { assembly { c := gt(a, b) } } - function eq( - ReturndataPointer a, - ReturndataPointer b - ) internal pure returns (bool c) { + function eq(ReturndataPointer a, ReturndataPointer b) + internal + pure + returns (bool c) + { assembly { c := eq(a, b) } @@ -170,10 +182,11 @@ library ReturndataPointerLib { /// @dev Resolves an offset stored at `rdPtr + headOffset` to a returndata /// pointer. `rdPtr` must point to some parent object with a dynamic /// type's head stored at `rdPtr + headOffset`. - function pptr( - ReturndataPointer rdPtr, - uint256 headOffset - ) internal pure returns (ReturndataPointer rdPtrChild) { + function pptrOffset(ReturndataPointer rdPtr, uint256 headOffset) + internal + pure + returns (ReturndataPointer rdPtrChild) + { rdPtrChild = rdPtr.offset( rdPtr.offset(headOffset).readUint256() & OffsetOrLengthMask ); @@ -182,26 +195,31 @@ library ReturndataPointerLib { /// @dev Resolves an offset stored at `rdPtr` to a returndata pointer. /// `rdPtr` must point to some parent object with a dynamic type as its /// first member, e.g. `struct { bytes data; }` - function pptr( - ReturndataPointer rdPtr - ) internal pure returns (ReturndataPointer rdPtrChild) { + function pptr(ReturndataPointer rdPtr) + internal + pure + returns (ReturndataPointer rdPtrChild) + { rdPtrChild = rdPtr.offset(rdPtr.readUint256() & OffsetOrLengthMask); } /// @dev Returns the returndata pointer one word after `cdPtr`. - function next( - ReturndataPointer rdPtr - ) internal pure returns (ReturndataPointer rdPtrNext) { + function next(ReturndataPointer rdPtr) + internal + pure + returns (ReturndataPointer rdPtrNext) + { assembly { rdPtrNext := add(rdPtr, _OneWord) } } /// @dev Returns the returndata pointer `_offset` bytes after `cdPtr`. - function offset( - ReturndataPointer rdPtr, - uint256 _offset - ) internal pure returns (ReturndataPointer rdPtrNext) { + function offset(ReturndataPointer rdPtr, uint256 _offset) + internal + pure + returns (ReturndataPointer rdPtrNext) + { assembly { rdPtrNext := add(rdPtr, _offset) } @@ -209,11 +227,10 @@ library ReturndataPointerLib { /// @dev Copies `size` bytes from returndata starting at `src` to memory at /// `dst`. - function copy( - ReturndataPointer src, - MemoryPointer dst, - uint256 size - ) internal pure { + function copy(ReturndataPointer src, MemoryPointer dst, uint256 size) + internal + pure + { assembly { returndatacopy(dst, src, size) } @@ -221,48 +238,42 @@ library ReturndataPointerLib { } library MemoryPointerLib { - function copy( - MemoryPointer src, - MemoryPointer dst, - uint256 size - ) internal view { - assembly { - let success := staticcall( - gas(), - IdentityPrecompileAddress, - src, - size, - dst, - size - ) - if or(iszero(returndatasize()), iszero(success)) { - revert(0, 0) - } - } - } - - function lt( - MemoryPointer a, - MemoryPointer b - ) internal pure returns (bool c) { + function copy(MemoryPointer src, MemoryPointer dst, uint256 size) + internal + view + { + assembly { + let success := + staticcall(gas(), IdentityPrecompileAddress, src, size, dst, size) + if or(iszero(returndatasize()), iszero(success)) { revert(0, 0) } + } + } + + function lt(MemoryPointer a, MemoryPointer b) + internal + pure + returns (bool c) + { assembly { c := lt(a, b) } } - function gt( - MemoryPointer a, - MemoryPointer b - ) internal pure returns (bool c) { + function gt(MemoryPointer a, MemoryPointer b) + internal + pure + returns (bool c) + { assembly { c := gt(a, b) } } - function eq( - MemoryPointer a, - MemoryPointer b - ) internal pure returns (bool c) { + function eq(MemoryPointer a, MemoryPointer b) + internal + pure + returns (bool c) + { assembly { c := eq(a, b) } @@ -274,29 +285,33 @@ library MemoryPointerLib { } } - function hash( - MemoryPointer ptr, - uint256 length - ) internal pure returns (bytes32 _hash) { + function hash(MemoryPointer ptr, uint256 length) + internal + pure + returns (bytes32 _hash) + { assembly { _hash := keccak256(ptr, length) } } /// @dev Returns the memory pointer one word after `mPtr`. - function next( - MemoryPointer mPtr - ) internal pure returns (MemoryPointer mPtrNext) { + function next(MemoryPointer mPtr) + internal + pure + returns (MemoryPointer mPtrNext) + { assembly { mPtrNext := add(mPtr, _OneWord) } } /// @dev Returns the memory pointer `_offset` bytes after `mPtr`. - function offset( - MemoryPointer mPtr, - uint256 _offset - ) internal pure returns (MemoryPointer mPtrNext) { + function offset(MemoryPointer mPtr, uint256 _offset) + internal + pure + returns (MemoryPointer mPtrNext) + { assembly { mPtrNext := add(mPtr, _offset) } @@ -305,19 +320,22 @@ library MemoryPointerLib { /// @dev Resolves a pointer at `mPtr + headOffset` to a memory /// pointer. `mPtr` must point to some parent object with a dynamic /// type's pointer stored at `mPtr + headOffset`. - function pptr( - MemoryPointer mPtr, - uint256 headOffset - ) internal pure returns (MemoryPointer mPtrChild) { + function pptrOffset(MemoryPointer mPtr, uint256 headOffset) + internal + pure + returns (MemoryPointer mPtrChild) + { mPtrChild = mPtr.offset(headOffset).readMemoryPointer(); } /// @dev Resolves a pointer stored at `mPtr` to a memory pointer. /// `mPtr` must point to some parent object with a dynamic type as its /// first member, e.g. `struct { bytes data; }` - function pptr( - MemoryPointer mPtr - ) internal pure returns (MemoryPointer mPtrChild) { + function pptr(MemoryPointer mPtr) + internal + pure + returns (MemoryPointer mPtrChild) + { mPtrChild = mPtr.readMemoryPointer(); } } @@ -325,889 +343,1087 @@ library MemoryPointerLib { library CalldataReaders { /// @dev Reads the value at `cdPtr` and applies a mask to return only the /// last 4 bytes. - function readMaskedUint256( - CalldataPointer cdPtr - ) internal pure returns (uint256 value) { + function readMaskedUint256(CalldataPointer cdPtr) + internal + pure + returns (uint256 value) + { value = cdPtr.readUint256() & OffsetOrLengthMask; } /// @dev Reads the bool at `cdPtr` in calldata. - function readBool( - CalldataPointer cdPtr - ) internal pure returns (bool value) { + function readBool(CalldataPointer cdPtr) + internal + pure + returns (bool value) + { assembly { value := calldataload(cdPtr) } } /// @dev Reads the address at `cdPtr` in calldata. - function readAddress( - CalldataPointer cdPtr - ) internal pure returns (address value) { + function readAddress(CalldataPointer cdPtr) + internal + pure + returns (address value) + { assembly { value := calldataload(cdPtr) } } /// @dev Reads the bytes1 at `cdPtr` in calldata. - function readBytes1( - CalldataPointer cdPtr - ) internal pure returns (bytes1 value) { + function readBytes1(CalldataPointer cdPtr) + internal + pure + returns (bytes1 value) + { assembly { value := calldataload(cdPtr) } } /// @dev Reads the bytes2 at `cdPtr` in calldata. - function readBytes2( - CalldataPointer cdPtr - ) internal pure returns (bytes2 value) { + function readBytes2(CalldataPointer cdPtr) + internal + pure + returns (bytes2 value) + { assembly { value := calldataload(cdPtr) } } /// @dev Reads the bytes3 at `cdPtr` in calldata. - function readBytes3( - CalldataPointer cdPtr - ) internal pure returns (bytes3 value) { + function readBytes3(CalldataPointer cdPtr) + internal + pure + returns (bytes3 value) + { assembly { value := calldataload(cdPtr) } } /// @dev Reads the bytes4 at `cdPtr` in calldata. - function readBytes4( - CalldataPointer cdPtr - ) internal pure returns (bytes4 value) { + function readBytes4(CalldataPointer cdPtr) + internal + pure + returns (bytes4 value) + { assembly { value := calldataload(cdPtr) } } /// @dev Reads the bytes5 at `cdPtr` in calldata. - function readBytes5( - CalldataPointer cdPtr - ) internal pure returns (bytes5 value) { + function readBytes5(CalldataPointer cdPtr) + internal + pure + returns (bytes5 value) + { assembly { value := calldataload(cdPtr) } } /// @dev Reads the bytes6 at `cdPtr` in calldata. - function readBytes6( - CalldataPointer cdPtr - ) internal pure returns (bytes6 value) { + function readBytes6(CalldataPointer cdPtr) + internal + pure + returns (bytes6 value) + { assembly { value := calldataload(cdPtr) } } /// @dev Reads the bytes7 at `cdPtr` in calldata. - function readBytes7( - CalldataPointer cdPtr - ) internal pure returns (bytes7 value) { + function readBytes7(CalldataPointer cdPtr) + internal + pure + returns (bytes7 value) + { assembly { value := calldataload(cdPtr) } } /// @dev Reads the bytes8 at `cdPtr` in calldata. - function readBytes8( - CalldataPointer cdPtr - ) internal pure returns (bytes8 value) { + function readBytes8(CalldataPointer cdPtr) + internal + pure + returns (bytes8 value) + { assembly { value := calldataload(cdPtr) } } /// @dev Reads the bytes9 at `cdPtr` in calldata. - function readBytes9( - CalldataPointer cdPtr - ) internal pure returns (bytes9 value) { + function readBytes9(CalldataPointer cdPtr) + internal + pure + returns (bytes9 value) + { assembly { value := calldataload(cdPtr) } } /// @dev Reads the bytes10 at `cdPtr` in calldata. - function readBytes10( - CalldataPointer cdPtr - ) internal pure returns (bytes10 value) { + function readBytes10(CalldataPointer cdPtr) + internal + pure + returns (bytes10 value) + { assembly { value := calldataload(cdPtr) } } /// @dev Reads the bytes11 at `cdPtr` in calldata. - function readBytes11( - CalldataPointer cdPtr - ) internal pure returns (bytes11 value) { + function readBytes11(CalldataPointer cdPtr) + internal + pure + returns (bytes11 value) + { assembly { value := calldataload(cdPtr) } } /// @dev Reads the bytes12 at `cdPtr` in calldata. - function readBytes12( - CalldataPointer cdPtr - ) internal pure returns (bytes12 value) { + function readBytes12(CalldataPointer cdPtr) + internal + pure + returns (bytes12 value) + { assembly { value := calldataload(cdPtr) } } /// @dev Reads the bytes13 at `cdPtr` in calldata. - function readBytes13( - CalldataPointer cdPtr - ) internal pure returns (bytes13 value) { + function readBytes13(CalldataPointer cdPtr) + internal + pure + returns (bytes13 value) + { assembly { value := calldataload(cdPtr) } } /// @dev Reads the bytes14 at `cdPtr` in calldata. - function readBytes14( - CalldataPointer cdPtr - ) internal pure returns (bytes14 value) { + function readBytes14(CalldataPointer cdPtr) + internal + pure + returns (bytes14 value) + { assembly { value := calldataload(cdPtr) } } /// @dev Reads the bytes15 at `cdPtr` in calldata. - function readBytes15( - CalldataPointer cdPtr - ) internal pure returns (bytes15 value) { + function readBytes15(CalldataPointer cdPtr) + internal + pure + returns (bytes15 value) + { assembly { value := calldataload(cdPtr) } } /// @dev Reads the bytes16 at `cdPtr` in calldata. - function readBytes16( - CalldataPointer cdPtr - ) internal pure returns (bytes16 value) { + function readBytes16(CalldataPointer cdPtr) + internal + pure + returns (bytes16 value) + { assembly { value := calldataload(cdPtr) } } /// @dev Reads the bytes17 at `cdPtr` in calldata. - function readBytes17( - CalldataPointer cdPtr - ) internal pure returns (bytes17 value) { + function readBytes17(CalldataPointer cdPtr) + internal + pure + returns (bytes17 value) + { assembly { value := calldataload(cdPtr) } } /// @dev Reads the bytes18 at `cdPtr` in calldata. - function readBytes18( - CalldataPointer cdPtr - ) internal pure returns (bytes18 value) { + function readBytes18(CalldataPointer cdPtr) + internal + pure + returns (bytes18 value) + { assembly { value := calldataload(cdPtr) } } /// @dev Reads the bytes19 at `cdPtr` in calldata. - function readBytes19( - CalldataPointer cdPtr - ) internal pure returns (bytes19 value) { + function readBytes19(CalldataPointer cdPtr) + internal + pure + returns (bytes19 value) + { assembly { value := calldataload(cdPtr) } } /// @dev Reads the bytes20 at `cdPtr` in calldata. - function readBytes20( - CalldataPointer cdPtr - ) internal pure returns (bytes20 value) { + function readBytes20(CalldataPointer cdPtr) + internal + pure + returns (bytes20 value) + { assembly { value := calldataload(cdPtr) } } /// @dev Reads the bytes21 at `cdPtr` in calldata. - function readBytes21( - CalldataPointer cdPtr - ) internal pure returns (bytes21 value) { + function readBytes21(CalldataPointer cdPtr) + internal + pure + returns (bytes21 value) + { assembly { value := calldataload(cdPtr) } } /// @dev Reads the bytes22 at `cdPtr` in calldata. - function readBytes22( - CalldataPointer cdPtr - ) internal pure returns (bytes22 value) { + function readBytes22(CalldataPointer cdPtr) + internal + pure + returns (bytes22 value) + { assembly { value := calldataload(cdPtr) } } /// @dev Reads the bytes23 at `cdPtr` in calldata. - function readBytes23( - CalldataPointer cdPtr - ) internal pure returns (bytes23 value) { + function readBytes23(CalldataPointer cdPtr) + internal + pure + returns (bytes23 value) + { assembly { value := calldataload(cdPtr) } } /// @dev Reads the bytes24 at `cdPtr` in calldata. - function readBytes24( - CalldataPointer cdPtr - ) internal pure returns (bytes24 value) { + function readBytes24(CalldataPointer cdPtr) + internal + pure + returns (bytes24 value) + { assembly { value := calldataload(cdPtr) } } /// @dev Reads the bytes25 at `cdPtr` in calldata. - function readBytes25( - CalldataPointer cdPtr - ) internal pure returns (bytes25 value) { + function readBytes25(CalldataPointer cdPtr) + internal + pure + returns (bytes25 value) + { assembly { value := calldataload(cdPtr) } } /// @dev Reads the bytes26 at `cdPtr` in calldata. - function readBytes26( - CalldataPointer cdPtr - ) internal pure returns (bytes26 value) { + function readBytes26(CalldataPointer cdPtr) + internal + pure + returns (bytes26 value) + { assembly { value := calldataload(cdPtr) } } /// @dev Reads the bytes27 at `cdPtr` in calldata. - function readBytes27( - CalldataPointer cdPtr - ) internal pure returns (bytes27 value) { + function readBytes27(CalldataPointer cdPtr) + internal + pure + returns (bytes27 value) + { assembly { value := calldataload(cdPtr) } } /// @dev Reads the bytes28 at `cdPtr` in calldata. - function readBytes28( - CalldataPointer cdPtr - ) internal pure returns (bytes28 value) { + function readBytes28(CalldataPointer cdPtr) + internal + pure + returns (bytes28 value) + { assembly { value := calldataload(cdPtr) } } /// @dev Reads the bytes29 at `cdPtr` in calldata. - function readBytes29( - CalldataPointer cdPtr - ) internal pure returns (bytes29 value) { + function readBytes29(CalldataPointer cdPtr) + internal + pure + returns (bytes29 value) + { assembly { value := calldataload(cdPtr) } } /// @dev Reads the bytes30 at `cdPtr` in calldata. - function readBytes30( - CalldataPointer cdPtr - ) internal pure returns (bytes30 value) { + function readBytes30(CalldataPointer cdPtr) + internal + pure + returns (bytes30 value) + { assembly { value := calldataload(cdPtr) } } /// @dev Reads the bytes31 at `cdPtr` in calldata. - function readBytes31( - CalldataPointer cdPtr - ) internal pure returns (bytes31 value) { + function readBytes31(CalldataPointer cdPtr) + internal + pure + returns (bytes31 value) + { assembly { value := calldataload(cdPtr) } } /// @dev Reads the bytes32 at `cdPtr` in calldata. - function readBytes32( - CalldataPointer cdPtr - ) internal pure returns (bytes32 value) { + function readBytes32(CalldataPointer cdPtr) + internal + pure + returns (bytes32 value) + { assembly { value := calldataload(cdPtr) } } /// @dev Reads the uint8 at `cdPtr` in calldata. - function readUint8( - CalldataPointer cdPtr - ) internal pure returns (uint8 value) { + function readUint8(CalldataPointer cdPtr) + internal + pure + returns (uint8 value) + { assembly { value := calldataload(cdPtr) } } /// @dev Reads the uint16 at `cdPtr` in calldata. - function readUint16( - CalldataPointer cdPtr - ) internal pure returns (uint16 value) { + function readUint16(CalldataPointer cdPtr) + internal + pure + returns (uint16 value) + { assembly { value := calldataload(cdPtr) } } /// @dev Reads the uint24 at `cdPtr` in calldata. - function readUint24( - CalldataPointer cdPtr - ) internal pure returns (uint24 value) { + function readUint24(CalldataPointer cdPtr) + internal + pure + returns (uint24 value) + { assembly { value := calldataload(cdPtr) } } /// @dev Reads the uint32 at `cdPtr` in calldata. - function readUint32( - CalldataPointer cdPtr - ) internal pure returns (uint32 value) { + function readUint32(CalldataPointer cdPtr) + internal + pure + returns (uint32 value) + { assembly { value := calldataload(cdPtr) } } /// @dev Reads the uint40 at `cdPtr` in calldata. - function readUint40( - CalldataPointer cdPtr - ) internal pure returns (uint40 value) { + function readUint40(CalldataPointer cdPtr) + internal + pure + returns (uint40 value) + { assembly { value := calldataload(cdPtr) } } /// @dev Reads the uint48 at `cdPtr` in calldata. - function readUint48( - CalldataPointer cdPtr - ) internal pure returns (uint48 value) { + function readUint48(CalldataPointer cdPtr) + internal + pure + returns (uint48 value) + { assembly { value := calldataload(cdPtr) } } /// @dev Reads the uint56 at `cdPtr` in calldata. - function readUint56( - CalldataPointer cdPtr - ) internal pure returns (uint56 value) { + function readUint56(CalldataPointer cdPtr) + internal + pure + returns (uint56 value) + { assembly { value := calldataload(cdPtr) } } /// @dev Reads the uint64 at `cdPtr` in calldata. - function readUint64( - CalldataPointer cdPtr - ) internal pure returns (uint64 value) { + function readUint64(CalldataPointer cdPtr) + internal + pure + returns (uint64 value) + { assembly { value := calldataload(cdPtr) } } /// @dev Reads the uint72 at `cdPtr` in calldata. - function readUint72( - CalldataPointer cdPtr - ) internal pure returns (uint72 value) { + function readUint72(CalldataPointer cdPtr) + internal + pure + returns (uint72 value) + { assembly { value := calldataload(cdPtr) } } /// @dev Reads the uint80 at `cdPtr` in calldata. - function readUint80( - CalldataPointer cdPtr - ) internal pure returns (uint80 value) { + function readUint80(CalldataPointer cdPtr) + internal + pure + returns (uint80 value) + { assembly { value := calldataload(cdPtr) } } /// @dev Reads the uint88 at `cdPtr` in calldata. - function readUint88( - CalldataPointer cdPtr - ) internal pure returns (uint88 value) { + function readUint88(CalldataPointer cdPtr) + internal + pure + returns (uint88 value) + { assembly { value := calldataload(cdPtr) } } /// @dev Reads the uint96 at `cdPtr` in calldata. - function readUint96( - CalldataPointer cdPtr - ) internal pure returns (uint96 value) { + function readUint96(CalldataPointer cdPtr) + internal + pure + returns (uint96 value) + { assembly { value := calldataload(cdPtr) } } /// @dev Reads the uint104 at `cdPtr` in calldata. - function readUint104( - CalldataPointer cdPtr - ) internal pure returns (uint104 value) { + function readUint104(CalldataPointer cdPtr) + internal + pure + returns (uint104 value) + { assembly { value := calldataload(cdPtr) } } /// @dev Reads the uint112 at `cdPtr` in calldata. - function readUint112( - CalldataPointer cdPtr - ) internal pure returns (uint112 value) { + function readUint112(CalldataPointer cdPtr) + internal + pure + returns (uint112 value) + { assembly { value := calldataload(cdPtr) } } /// @dev Reads the uint120 at `cdPtr` in calldata. - function readUint120( - CalldataPointer cdPtr - ) internal pure returns (uint120 value) { + function readUint120(CalldataPointer cdPtr) + internal + pure + returns (uint120 value) + { assembly { value := calldataload(cdPtr) } } /// @dev Reads the uint128 at `cdPtr` in calldata. - function readUint128( - CalldataPointer cdPtr - ) internal pure returns (uint128 value) { + function readUint128(CalldataPointer cdPtr) + internal + pure + returns (uint128 value) + { assembly { value := calldataload(cdPtr) } } /// @dev Reads the uint136 at `cdPtr` in calldata. - function readUint136( - CalldataPointer cdPtr - ) internal pure returns (uint136 value) { + function readUint136(CalldataPointer cdPtr) + internal + pure + returns (uint136 value) + { assembly { value := calldataload(cdPtr) } } /// @dev Reads the uint144 at `cdPtr` in calldata. - function readUint144( - CalldataPointer cdPtr - ) internal pure returns (uint144 value) { + function readUint144(CalldataPointer cdPtr) + internal + pure + returns (uint144 value) + { assembly { value := calldataload(cdPtr) } } /// @dev Reads the uint152 at `cdPtr` in calldata. - function readUint152( - CalldataPointer cdPtr - ) internal pure returns (uint152 value) { + function readUint152(CalldataPointer cdPtr) + internal + pure + returns (uint152 value) + { assembly { value := calldataload(cdPtr) } } /// @dev Reads the uint160 at `cdPtr` in calldata. - function readUint160( - CalldataPointer cdPtr - ) internal pure returns (uint160 value) { + function readUint160(CalldataPointer cdPtr) + internal + pure + returns (uint160 value) + { assembly { value := calldataload(cdPtr) } } /// @dev Reads the uint168 at `cdPtr` in calldata. - function readUint168( - CalldataPointer cdPtr - ) internal pure returns (uint168 value) { + function readUint168(CalldataPointer cdPtr) + internal + pure + returns (uint168 value) + { assembly { value := calldataload(cdPtr) } } /// @dev Reads the uint176 at `cdPtr` in calldata. - function readUint176( - CalldataPointer cdPtr - ) internal pure returns (uint176 value) { + function readUint176(CalldataPointer cdPtr) + internal + pure + returns (uint176 value) + { assembly { value := calldataload(cdPtr) } } /// @dev Reads the uint184 at `cdPtr` in calldata. - function readUint184( - CalldataPointer cdPtr - ) internal pure returns (uint184 value) { + function readUint184(CalldataPointer cdPtr) + internal + pure + returns (uint184 value) + { assembly { value := calldataload(cdPtr) } } /// @dev Reads the uint192 at `cdPtr` in calldata. - function readUint192( - CalldataPointer cdPtr - ) internal pure returns (uint192 value) { + function readUint192(CalldataPointer cdPtr) + internal + pure + returns (uint192 value) + { assembly { value := calldataload(cdPtr) } } /// @dev Reads the uint200 at `cdPtr` in calldata. - function readUint200( - CalldataPointer cdPtr - ) internal pure returns (uint200 value) { + function readUint200(CalldataPointer cdPtr) + internal + pure + returns (uint200 value) + { assembly { value := calldataload(cdPtr) } } /// @dev Reads the uint208 at `cdPtr` in calldata. - function readUint208( - CalldataPointer cdPtr - ) internal pure returns (uint208 value) { + function readUint208(CalldataPointer cdPtr) + internal + pure + returns (uint208 value) + { assembly { value := calldataload(cdPtr) } } /// @dev Reads the uint216 at `cdPtr` in calldata. - function readUint216( - CalldataPointer cdPtr - ) internal pure returns (uint216 value) { + function readUint216(CalldataPointer cdPtr) + internal + pure + returns (uint216 value) + { assembly { value := calldataload(cdPtr) } } /// @dev Reads the uint224 at `cdPtr` in calldata. - function readUint224( - CalldataPointer cdPtr - ) internal pure returns (uint224 value) { + function readUint224(CalldataPointer cdPtr) + internal + pure + returns (uint224 value) + { assembly { value := calldataload(cdPtr) } } /// @dev Reads the uint232 at `cdPtr` in calldata. - function readUint232( - CalldataPointer cdPtr - ) internal pure returns (uint232 value) { + function readUint232(CalldataPointer cdPtr) + internal + pure + returns (uint232 value) + { assembly { value := calldataload(cdPtr) } } /// @dev Reads the uint240 at `cdPtr` in calldata. - function readUint240( - CalldataPointer cdPtr - ) internal pure returns (uint240 value) { + function readUint240(CalldataPointer cdPtr) + internal + pure + returns (uint240 value) + { assembly { value := calldataload(cdPtr) } } /// @dev Reads the uint248 at `cdPtr` in calldata. - function readUint248( - CalldataPointer cdPtr - ) internal pure returns (uint248 value) { + function readUint248(CalldataPointer cdPtr) + internal + pure + returns (uint248 value) + { assembly { value := calldataload(cdPtr) } } /// @dev Reads the uint256 at `cdPtr` in calldata. - function readUint256( - CalldataPointer cdPtr - ) internal pure returns (uint256 value) { + function readUint256(CalldataPointer cdPtr) + internal + pure + returns (uint256 value) + { assembly { value := calldataload(cdPtr) } } /// @dev Reads the int8 at `cdPtr` in calldata. - function readInt8( - CalldataPointer cdPtr - ) internal pure returns (int8 value) { + function readInt8(CalldataPointer cdPtr) + internal + pure + returns (int8 value) + { assembly { value := calldataload(cdPtr) } } /// @dev Reads the int16 at `cdPtr` in calldata. - function readInt16( - CalldataPointer cdPtr - ) internal pure returns (int16 value) { + function readInt16(CalldataPointer cdPtr) + internal + pure + returns (int16 value) + { assembly { value := calldataload(cdPtr) } } /// @dev Reads the int24 at `cdPtr` in calldata. - function readInt24( - CalldataPointer cdPtr - ) internal pure returns (int24 value) { + function readInt24(CalldataPointer cdPtr) + internal + pure + returns (int24 value) + { assembly { value := calldataload(cdPtr) } } /// @dev Reads the int32 at `cdPtr` in calldata. - function readInt32( - CalldataPointer cdPtr - ) internal pure returns (int32 value) { + function readInt32(CalldataPointer cdPtr) + internal + pure + returns (int32 value) + { assembly { value := calldataload(cdPtr) } } /// @dev Reads the int40 at `cdPtr` in calldata. - function readInt40( - CalldataPointer cdPtr - ) internal pure returns (int40 value) { + function readInt40(CalldataPointer cdPtr) + internal + pure + returns (int40 value) + { assembly { value := calldataload(cdPtr) } } /// @dev Reads the int48 at `cdPtr` in calldata. - function readInt48( - CalldataPointer cdPtr - ) internal pure returns (int48 value) { + function readInt48(CalldataPointer cdPtr) + internal + pure + returns (int48 value) + { assembly { value := calldataload(cdPtr) } } /// @dev Reads the int56 at `cdPtr` in calldata. - function readInt56( - CalldataPointer cdPtr - ) internal pure returns (int56 value) { + function readInt56(CalldataPointer cdPtr) + internal + pure + returns (int56 value) + { assembly { value := calldataload(cdPtr) } } /// @dev Reads the int64 at `cdPtr` in calldata. - function readInt64( - CalldataPointer cdPtr - ) internal pure returns (int64 value) { + function readInt64(CalldataPointer cdPtr) + internal + pure + returns (int64 value) + { assembly { value := calldataload(cdPtr) } } /// @dev Reads the int72 at `cdPtr` in calldata. - function readInt72( - CalldataPointer cdPtr - ) internal pure returns (int72 value) { + function readInt72(CalldataPointer cdPtr) + internal + pure + returns (int72 value) + { assembly { value := calldataload(cdPtr) } } /// @dev Reads the int80 at `cdPtr` in calldata. - function readInt80( - CalldataPointer cdPtr - ) internal pure returns (int80 value) { + function readInt80(CalldataPointer cdPtr) + internal + pure + returns (int80 value) + { assembly { value := calldataload(cdPtr) } } /// @dev Reads the int88 at `cdPtr` in calldata. - function readInt88( - CalldataPointer cdPtr - ) internal pure returns (int88 value) { + function readInt88(CalldataPointer cdPtr) + internal + pure + returns (int88 value) + { assembly { value := calldataload(cdPtr) } } /// @dev Reads the int96 at `cdPtr` in calldata. - function readInt96( - CalldataPointer cdPtr - ) internal pure returns (int96 value) { + function readInt96(CalldataPointer cdPtr) + internal + pure + returns (int96 value) + { assembly { value := calldataload(cdPtr) } } /// @dev Reads the int104 at `cdPtr` in calldata. - function readInt104( - CalldataPointer cdPtr - ) internal pure returns (int104 value) { + function readInt104(CalldataPointer cdPtr) + internal + pure + returns (int104 value) + { assembly { value := calldataload(cdPtr) } } /// @dev Reads the int112 at `cdPtr` in calldata. - function readInt112( - CalldataPointer cdPtr - ) internal pure returns (int112 value) { + function readInt112(CalldataPointer cdPtr) + internal + pure + returns (int112 value) + { assembly { value := calldataload(cdPtr) } } /// @dev Reads the int120 at `cdPtr` in calldata. - function readInt120( - CalldataPointer cdPtr - ) internal pure returns (int120 value) { + function readInt120(CalldataPointer cdPtr) + internal + pure + returns (int120 value) + { assembly { value := calldataload(cdPtr) } } /// @dev Reads the int128 at `cdPtr` in calldata. - function readInt128( - CalldataPointer cdPtr - ) internal pure returns (int128 value) { + function readInt128(CalldataPointer cdPtr) + internal + pure + returns (int128 value) + { assembly { value := calldataload(cdPtr) } } /// @dev Reads the int136 at `cdPtr` in calldata. - function readInt136( - CalldataPointer cdPtr - ) internal pure returns (int136 value) { + function readInt136(CalldataPointer cdPtr) + internal + pure + returns (int136 value) + { assembly { value := calldataload(cdPtr) } } /// @dev Reads the int144 at `cdPtr` in calldata. - function readInt144( - CalldataPointer cdPtr - ) internal pure returns (int144 value) { + function readInt144(CalldataPointer cdPtr) + internal + pure + returns (int144 value) + { assembly { value := calldataload(cdPtr) } } /// @dev Reads the int152 at `cdPtr` in calldata. - function readInt152( - CalldataPointer cdPtr - ) internal pure returns (int152 value) { + function readInt152(CalldataPointer cdPtr) + internal + pure + returns (int152 value) + { assembly { value := calldataload(cdPtr) } } /// @dev Reads the int160 at `cdPtr` in calldata. - function readInt160( - CalldataPointer cdPtr - ) internal pure returns (int160 value) { + function readInt160(CalldataPointer cdPtr) + internal + pure + returns (int160 value) + { assembly { value := calldataload(cdPtr) } } /// @dev Reads the int168 at `cdPtr` in calldata. - function readInt168( - CalldataPointer cdPtr - ) internal pure returns (int168 value) { + function readInt168(CalldataPointer cdPtr) + internal + pure + returns (int168 value) + { assembly { value := calldataload(cdPtr) } } /// @dev Reads the int176 at `cdPtr` in calldata. - function readInt176( - CalldataPointer cdPtr - ) internal pure returns (int176 value) { + function readInt176(CalldataPointer cdPtr) + internal + pure + returns (int176 value) + { assembly { value := calldataload(cdPtr) } } /// @dev Reads the int184 at `cdPtr` in calldata. - function readInt184( - CalldataPointer cdPtr - ) internal pure returns (int184 value) { + function readInt184(CalldataPointer cdPtr) + internal + pure + returns (int184 value) + { assembly { value := calldataload(cdPtr) } } /// @dev Reads the int192 at `cdPtr` in calldata. - function readInt192( - CalldataPointer cdPtr - ) internal pure returns (int192 value) { + function readInt192(CalldataPointer cdPtr) + internal + pure + returns (int192 value) + { assembly { value := calldataload(cdPtr) } } /// @dev Reads the int200 at `cdPtr` in calldata. - function readInt200( - CalldataPointer cdPtr - ) internal pure returns (int200 value) { + function readInt200(CalldataPointer cdPtr) + internal + pure + returns (int200 value) + { assembly { value := calldataload(cdPtr) } } /// @dev Reads the int208 at `cdPtr` in calldata. - function readInt208( - CalldataPointer cdPtr - ) internal pure returns (int208 value) { + function readInt208(CalldataPointer cdPtr) + internal + pure + returns (int208 value) + { assembly { value := calldataload(cdPtr) } } /// @dev Reads the int216 at `cdPtr` in calldata. - function readInt216( - CalldataPointer cdPtr - ) internal pure returns (int216 value) { + function readInt216(CalldataPointer cdPtr) + internal + pure + returns (int216 value) + { assembly { value := calldataload(cdPtr) } } /// @dev Reads the int224 at `cdPtr` in calldata. - function readInt224( - CalldataPointer cdPtr - ) internal pure returns (int224 value) { + function readInt224(CalldataPointer cdPtr) + internal + pure + returns (int224 value) + { assembly { value := calldataload(cdPtr) } } /// @dev Reads the int232 at `cdPtr` in calldata. - function readInt232( - CalldataPointer cdPtr - ) internal pure returns (int232 value) { + function readInt232(CalldataPointer cdPtr) + internal + pure + returns (int232 value) + { assembly { value := calldataload(cdPtr) } } /// @dev Reads the int240 at `cdPtr` in calldata. - function readInt240( - CalldataPointer cdPtr - ) internal pure returns (int240 value) { + function readInt240(CalldataPointer cdPtr) + internal + pure + returns (int240 value) + { assembly { value := calldataload(cdPtr) } } /// @dev Reads the int248 at `cdPtr` in calldata. - function readInt248( - CalldataPointer cdPtr - ) internal pure returns (int248 value) { + function readInt248(CalldataPointer cdPtr) + internal + pure + returns (int248 value) + { assembly { value := calldataload(cdPtr) } } /// @dev Reads the int256 at `cdPtr` in calldata. - function readInt256( - CalldataPointer cdPtr - ) internal pure returns (int256 value) { + function readInt256(CalldataPointer cdPtr) + internal + pure + returns (int256 value) + { assembly { value := calldataload(cdPtr) } @@ -1216,16 +1432,20 @@ library CalldataReaders { library ReturndataReaders { /// @dev Reads value at `rdPtr` & applies a mask to return only last 4 bytes - function readMaskedUint256( - ReturndataPointer rdPtr - ) internal pure returns (uint256 value) { + function readMaskedUint256(ReturndataPointer rdPtr) + internal + pure + returns (uint256 value) + { value = rdPtr.readUint256() & OffsetOrLengthMask; } /// @dev Reads the bool at `rdPtr` in returndata. - function readBool( - ReturndataPointer rdPtr - ) internal pure returns (bool value) { + function readBool(ReturndataPointer rdPtr) + internal + pure + returns (bool value) + { assembly { returndatacopy(0, rdPtr, _OneWord) value := mload(0) @@ -1233,9 +1453,11 @@ library ReturndataReaders { } /// @dev Reads the address at `rdPtr` in returndata. - function readAddress( - ReturndataPointer rdPtr - ) internal pure returns (address value) { + function readAddress(ReturndataPointer rdPtr) + internal + pure + returns (address value) + { assembly { returndatacopy(0, rdPtr, _OneWord) value := mload(0) @@ -1243,9 +1465,11 @@ library ReturndataReaders { } /// @dev Reads the bytes1 at `rdPtr` in returndata. - function readBytes1( - ReturndataPointer rdPtr - ) internal pure returns (bytes1 value) { + function readBytes1(ReturndataPointer rdPtr) + internal + pure + returns (bytes1 value) + { assembly { returndatacopy(0, rdPtr, _OneWord) value := mload(0) @@ -1253,9 +1477,11 @@ library ReturndataReaders { } /// @dev Reads the bytes2 at `rdPtr` in returndata. - function readBytes2( - ReturndataPointer rdPtr - ) internal pure returns (bytes2 value) { + function readBytes2(ReturndataPointer rdPtr) + internal + pure + returns (bytes2 value) + { assembly { returndatacopy(0, rdPtr, _OneWord) value := mload(0) @@ -1263,9 +1489,11 @@ library ReturndataReaders { } /// @dev Reads the bytes3 at `rdPtr` in returndata. - function readBytes3( - ReturndataPointer rdPtr - ) internal pure returns (bytes3 value) { + function readBytes3(ReturndataPointer rdPtr) + internal + pure + returns (bytes3 value) + { assembly { returndatacopy(0, rdPtr, _OneWord) value := mload(0) @@ -1273,9 +1501,11 @@ library ReturndataReaders { } /// @dev Reads the bytes4 at `rdPtr` in returndata. - function readBytes4( - ReturndataPointer rdPtr - ) internal pure returns (bytes4 value) { + function readBytes4(ReturndataPointer rdPtr) + internal + pure + returns (bytes4 value) + { assembly { returndatacopy(0, rdPtr, _OneWord) value := mload(0) @@ -1283,9 +1513,11 @@ library ReturndataReaders { } /// @dev Reads the bytes5 at `rdPtr` in returndata. - function readBytes5( - ReturndataPointer rdPtr - ) internal pure returns (bytes5 value) { + function readBytes5(ReturndataPointer rdPtr) + internal + pure + returns (bytes5 value) + { assembly { returndatacopy(0, rdPtr, _OneWord) value := mload(0) @@ -1293,9 +1525,11 @@ library ReturndataReaders { } /// @dev Reads the bytes6 at `rdPtr` in returndata. - function readBytes6( - ReturndataPointer rdPtr - ) internal pure returns (bytes6 value) { + function readBytes6(ReturndataPointer rdPtr) + internal + pure + returns (bytes6 value) + { assembly { returndatacopy(0, rdPtr, _OneWord) value := mload(0) @@ -1303,9 +1537,11 @@ library ReturndataReaders { } /// @dev Reads the bytes7 at `rdPtr` in returndata. - function readBytes7( - ReturndataPointer rdPtr - ) internal pure returns (bytes7 value) { + function readBytes7(ReturndataPointer rdPtr) + internal + pure + returns (bytes7 value) + { assembly { returndatacopy(0, rdPtr, _OneWord) value := mload(0) @@ -1313,9 +1549,11 @@ library ReturndataReaders { } /// @dev Reads the bytes8 at `rdPtr` in returndata. - function readBytes8( - ReturndataPointer rdPtr - ) internal pure returns (bytes8 value) { + function readBytes8(ReturndataPointer rdPtr) + internal + pure + returns (bytes8 value) + { assembly { returndatacopy(0, rdPtr, _OneWord) value := mload(0) @@ -1323,9 +1561,11 @@ library ReturndataReaders { } /// @dev Reads the bytes9 at `rdPtr` in returndata. - function readBytes9( - ReturndataPointer rdPtr - ) internal pure returns (bytes9 value) { + function readBytes9(ReturndataPointer rdPtr) + internal + pure + returns (bytes9 value) + { assembly { returndatacopy(0, rdPtr, _OneWord) value := mload(0) @@ -1333,9 +1573,11 @@ library ReturndataReaders { } /// @dev Reads the bytes10 at `rdPtr` in returndata. - function readBytes10( - ReturndataPointer rdPtr - ) internal pure returns (bytes10 value) { + function readBytes10(ReturndataPointer rdPtr) + internal + pure + returns (bytes10 value) + { assembly { returndatacopy(0, rdPtr, _OneWord) value := mload(0) @@ -1343,9 +1585,11 @@ library ReturndataReaders { } /// @dev Reads the bytes11 at `rdPtr` in returndata. - function readBytes11( - ReturndataPointer rdPtr - ) internal pure returns (bytes11 value) { + function readBytes11(ReturndataPointer rdPtr) + internal + pure + returns (bytes11 value) + { assembly { returndatacopy(0, rdPtr, _OneWord) value := mload(0) @@ -1353,9 +1597,11 @@ library ReturndataReaders { } /// @dev Reads the bytes12 at `rdPtr` in returndata. - function readBytes12( - ReturndataPointer rdPtr - ) internal pure returns (bytes12 value) { + function readBytes12(ReturndataPointer rdPtr) + internal + pure + returns (bytes12 value) + { assembly { returndatacopy(0, rdPtr, _OneWord) value := mload(0) @@ -1363,9 +1609,11 @@ library ReturndataReaders { } /// @dev Reads the bytes13 at `rdPtr` in returndata. - function readBytes13( - ReturndataPointer rdPtr - ) internal pure returns (bytes13 value) { + function readBytes13(ReturndataPointer rdPtr) + internal + pure + returns (bytes13 value) + { assembly { returndatacopy(0, rdPtr, _OneWord) value := mload(0) @@ -1373,9 +1621,11 @@ library ReturndataReaders { } /// @dev Reads the bytes14 at `rdPtr` in returndata. - function readBytes14( - ReturndataPointer rdPtr - ) internal pure returns (bytes14 value) { + function readBytes14(ReturndataPointer rdPtr) + internal + pure + returns (bytes14 value) + { assembly { returndatacopy(0, rdPtr, _OneWord) value := mload(0) @@ -1383,9 +1633,11 @@ library ReturndataReaders { } /// @dev Reads the bytes15 at `rdPtr` in returndata. - function readBytes15( - ReturndataPointer rdPtr - ) internal pure returns (bytes15 value) { + function readBytes15(ReturndataPointer rdPtr) + internal + pure + returns (bytes15 value) + { assembly { returndatacopy(0, rdPtr, _OneWord) value := mload(0) @@ -1393,9 +1645,11 @@ library ReturndataReaders { } /// @dev Reads the bytes16 at `rdPtr` in returndata. - function readBytes16( - ReturndataPointer rdPtr - ) internal pure returns (bytes16 value) { + function readBytes16(ReturndataPointer rdPtr) + internal + pure + returns (bytes16 value) + { assembly { returndatacopy(0, rdPtr, _OneWord) value := mload(0) @@ -1403,9 +1657,11 @@ library ReturndataReaders { } /// @dev Reads the bytes17 at `rdPtr` in returndata. - function readBytes17( - ReturndataPointer rdPtr - ) internal pure returns (bytes17 value) { + function readBytes17(ReturndataPointer rdPtr) + internal + pure + returns (bytes17 value) + { assembly { returndatacopy(0, rdPtr, _OneWord) value := mload(0) @@ -1413,9 +1669,11 @@ library ReturndataReaders { } /// @dev Reads the bytes18 at `rdPtr` in returndata. - function readBytes18( - ReturndataPointer rdPtr - ) internal pure returns (bytes18 value) { + function readBytes18(ReturndataPointer rdPtr) + internal + pure + returns (bytes18 value) + { assembly { returndatacopy(0, rdPtr, _OneWord) value := mload(0) @@ -1423,9 +1681,11 @@ library ReturndataReaders { } /// @dev Reads the bytes19 at `rdPtr` in returndata. - function readBytes19( - ReturndataPointer rdPtr - ) internal pure returns (bytes19 value) { + function readBytes19(ReturndataPointer rdPtr) + internal + pure + returns (bytes19 value) + { assembly { returndatacopy(0, rdPtr, _OneWord) value := mload(0) @@ -1433,9 +1693,11 @@ library ReturndataReaders { } /// @dev Reads the bytes20 at `rdPtr` in returndata. - function readBytes20( - ReturndataPointer rdPtr - ) internal pure returns (bytes20 value) { + function readBytes20(ReturndataPointer rdPtr) + internal + pure + returns (bytes20 value) + { assembly { returndatacopy(0, rdPtr, _OneWord) value := mload(0) @@ -1443,9 +1705,11 @@ library ReturndataReaders { } /// @dev Reads the bytes21 at `rdPtr` in returndata. - function readBytes21( - ReturndataPointer rdPtr - ) internal pure returns (bytes21 value) { + function readBytes21(ReturndataPointer rdPtr) + internal + pure + returns (bytes21 value) + { assembly { returndatacopy(0, rdPtr, _OneWord) value := mload(0) @@ -1453,9 +1717,11 @@ library ReturndataReaders { } /// @dev Reads the bytes22 at `rdPtr` in returndata. - function readBytes22( - ReturndataPointer rdPtr - ) internal pure returns (bytes22 value) { + function readBytes22(ReturndataPointer rdPtr) + internal + pure + returns (bytes22 value) + { assembly { returndatacopy(0, rdPtr, _OneWord) value := mload(0) @@ -1463,9 +1729,11 @@ library ReturndataReaders { } /// @dev Reads the bytes23 at `rdPtr` in returndata. - function readBytes23( - ReturndataPointer rdPtr - ) internal pure returns (bytes23 value) { + function readBytes23(ReturndataPointer rdPtr) + internal + pure + returns (bytes23 value) + { assembly { returndatacopy(0, rdPtr, _OneWord) value := mload(0) @@ -1473,9 +1741,11 @@ library ReturndataReaders { } /// @dev Reads the bytes24 at `rdPtr` in returndata. - function readBytes24( - ReturndataPointer rdPtr - ) internal pure returns (bytes24 value) { + function readBytes24(ReturndataPointer rdPtr) + internal + pure + returns (bytes24 value) + { assembly { returndatacopy(0, rdPtr, _OneWord) value := mload(0) @@ -1483,9 +1753,11 @@ library ReturndataReaders { } /// @dev Reads the bytes25 at `rdPtr` in returndata. - function readBytes25( - ReturndataPointer rdPtr - ) internal pure returns (bytes25 value) { + function readBytes25(ReturndataPointer rdPtr) + internal + pure + returns (bytes25 value) + { assembly { returndatacopy(0, rdPtr, _OneWord) value := mload(0) @@ -1493,9 +1765,11 @@ library ReturndataReaders { } /// @dev Reads the bytes26 at `rdPtr` in returndata. - function readBytes26( - ReturndataPointer rdPtr - ) internal pure returns (bytes26 value) { + function readBytes26(ReturndataPointer rdPtr) + internal + pure + returns (bytes26 value) + { assembly { returndatacopy(0, rdPtr, _OneWord) value := mload(0) @@ -1503,9 +1777,11 @@ library ReturndataReaders { } /// @dev Reads the bytes27 at `rdPtr` in returndata. - function readBytes27( - ReturndataPointer rdPtr - ) internal pure returns (bytes27 value) { + function readBytes27(ReturndataPointer rdPtr) + internal + pure + returns (bytes27 value) + { assembly { returndatacopy(0, rdPtr, _OneWord) value := mload(0) @@ -1513,9 +1789,11 @@ library ReturndataReaders { } /// @dev Reads the bytes28 at `rdPtr` in returndata. - function readBytes28( - ReturndataPointer rdPtr - ) internal pure returns (bytes28 value) { + function readBytes28(ReturndataPointer rdPtr) + internal + pure + returns (bytes28 value) + { assembly { returndatacopy(0, rdPtr, _OneWord) value := mload(0) @@ -1523,9 +1801,11 @@ library ReturndataReaders { } /// @dev Reads the bytes29 at `rdPtr` in returndata. - function readBytes29( - ReturndataPointer rdPtr - ) internal pure returns (bytes29 value) { + function readBytes29(ReturndataPointer rdPtr) + internal + pure + returns (bytes29 value) + { assembly { returndatacopy(0, rdPtr, _OneWord) value := mload(0) @@ -1533,9 +1813,11 @@ library ReturndataReaders { } /// @dev Reads the bytes30 at `rdPtr` in returndata. - function readBytes30( - ReturndataPointer rdPtr - ) internal pure returns (bytes30 value) { + function readBytes30(ReturndataPointer rdPtr) + internal + pure + returns (bytes30 value) + { assembly { returndatacopy(0, rdPtr, _OneWord) value := mload(0) @@ -1543,9 +1825,11 @@ library ReturndataReaders { } /// @dev Reads the bytes31 at `rdPtr` in returndata. - function readBytes31( - ReturndataPointer rdPtr - ) internal pure returns (bytes31 value) { + function readBytes31(ReturndataPointer rdPtr) + internal + pure + returns (bytes31 value) + { assembly { returndatacopy(0, rdPtr, _OneWord) value := mload(0) @@ -1553,9 +1837,11 @@ library ReturndataReaders { } /// @dev Reads the bytes32 at `rdPtr` in returndata. - function readBytes32( - ReturndataPointer rdPtr - ) internal pure returns (bytes32 value) { + function readBytes32(ReturndataPointer rdPtr) + internal + pure + returns (bytes32 value) + { assembly { returndatacopy(0, rdPtr, _OneWord) value := mload(0) @@ -1563,9 +1849,11 @@ library ReturndataReaders { } /// @dev Reads the uint8 at `rdPtr` in returndata. - function readUint8( - ReturndataPointer rdPtr - ) internal pure returns (uint8 value) { + function readUint8(ReturndataPointer rdPtr) + internal + pure + returns (uint8 value) + { assembly { returndatacopy(0, rdPtr, _OneWord) value := mload(0) @@ -1573,9 +1861,11 @@ library ReturndataReaders { } /// @dev Reads the uint16 at `rdPtr` in returndata. - function readUint16( - ReturndataPointer rdPtr - ) internal pure returns (uint16 value) { + function readUint16(ReturndataPointer rdPtr) + internal + pure + returns (uint16 value) + { assembly { returndatacopy(0, rdPtr, _OneWord) value := mload(0) @@ -1583,9 +1873,11 @@ library ReturndataReaders { } /// @dev Reads the uint24 at `rdPtr` in returndata. - function readUint24( - ReturndataPointer rdPtr - ) internal pure returns (uint24 value) { + function readUint24(ReturndataPointer rdPtr) + internal + pure + returns (uint24 value) + { assembly { returndatacopy(0, rdPtr, _OneWord) value := mload(0) @@ -1593,9 +1885,11 @@ library ReturndataReaders { } /// @dev Reads the uint32 at `rdPtr` in returndata. - function readUint32( - ReturndataPointer rdPtr - ) internal pure returns (uint32 value) { + function readUint32(ReturndataPointer rdPtr) + internal + pure + returns (uint32 value) + { assembly { returndatacopy(0, rdPtr, _OneWord) value := mload(0) @@ -1603,9 +1897,11 @@ library ReturndataReaders { } /// @dev Reads the uint40 at `rdPtr` in returndata. - function readUint40( - ReturndataPointer rdPtr - ) internal pure returns (uint40 value) { + function readUint40(ReturndataPointer rdPtr) + internal + pure + returns (uint40 value) + { assembly { returndatacopy(0, rdPtr, _OneWord) value := mload(0) @@ -1613,9 +1909,11 @@ library ReturndataReaders { } /// @dev Reads the uint48 at `rdPtr` in returndata. - function readUint48( - ReturndataPointer rdPtr - ) internal pure returns (uint48 value) { + function readUint48(ReturndataPointer rdPtr) + internal + pure + returns (uint48 value) + { assembly { returndatacopy(0, rdPtr, _OneWord) value := mload(0) @@ -1623,9 +1921,11 @@ library ReturndataReaders { } /// @dev Reads the uint56 at `rdPtr` in returndata. - function readUint56( - ReturndataPointer rdPtr - ) internal pure returns (uint56 value) { + function readUint56(ReturndataPointer rdPtr) + internal + pure + returns (uint56 value) + { assembly { returndatacopy(0, rdPtr, _OneWord) value := mload(0) @@ -1633,9 +1933,11 @@ library ReturndataReaders { } /// @dev Reads the uint64 at `rdPtr` in returndata. - function readUint64( - ReturndataPointer rdPtr - ) internal pure returns (uint64 value) { + function readUint64(ReturndataPointer rdPtr) + internal + pure + returns (uint64 value) + { assembly { returndatacopy(0, rdPtr, _OneWord) value := mload(0) @@ -1643,9 +1945,11 @@ library ReturndataReaders { } /// @dev Reads the uint72 at `rdPtr` in returndata. - function readUint72( - ReturndataPointer rdPtr - ) internal pure returns (uint72 value) { + function readUint72(ReturndataPointer rdPtr) + internal + pure + returns (uint72 value) + { assembly { returndatacopy(0, rdPtr, _OneWord) value := mload(0) @@ -1653,9 +1957,11 @@ library ReturndataReaders { } /// @dev Reads the uint80 at `rdPtr` in returndata. - function readUint80( - ReturndataPointer rdPtr - ) internal pure returns (uint80 value) { + function readUint80(ReturndataPointer rdPtr) + internal + pure + returns (uint80 value) + { assembly { returndatacopy(0, rdPtr, _OneWord) value := mload(0) @@ -1663,9 +1969,11 @@ library ReturndataReaders { } /// @dev Reads the uint88 at `rdPtr` in returndata. - function readUint88( - ReturndataPointer rdPtr - ) internal pure returns (uint88 value) { + function readUint88(ReturndataPointer rdPtr) + internal + pure + returns (uint88 value) + { assembly { returndatacopy(0, rdPtr, _OneWord) value := mload(0) @@ -1673,9 +1981,11 @@ library ReturndataReaders { } /// @dev Reads the uint96 at `rdPtr` in returndata. - function readUint96( - ReturndataPointer rdPtr - ) internal pure returns (uint96 value) { + function readUint96(ReturndataPointer rdPtr) + internal + pure + returns (uint96 value) + { assembly { returndatacopy(0, rdPtr, _OneWord) value := mload(0) @@ -1683,9 +1993,11 @@ library ReturndataReaders { } /// @dev Reads the uint104 at `rdPtr` in returndata. - function readUint104( - ReturndataPointer rdPtr - ) internal pure returns (uint104 value) { + function readUint104(ReturndataPointer rdPtr) + internal + pure + returns (uint104 value) + { assembly { returndatacopy(0, rdPtr, _OneWord) value := mload(0) @@ -1693,9 +2005,11 @@ library ReturndataReaders { } /// @dev Reads the uint112 at `rdPtr` in returndata. - function readUint112( - ReturndataPointer rdPtr - ) internal pure returns (uint112 value) { + function readUint112(ReturndataPointer rdPtr) + internal + pure + returns (uint112 value) + { assembly { returndatacopy(0, rdPtr, _OneWord) value := mload(0) @@ -1703,9 +2017,11 @@ library ReturndataReaders { } /// @dev Reads the uint120 at `rdPtr` in returndata. - function readUint120( - ReturndataPointer rdPtr - ) internal pure returns (uint120 value) { + function readUint120(ReturndataPointer rdPtr) + internal + pure + returns (uint120 value) + { assembly { returndatacopy(0, rdPtr, _OneWord) value := mload(0) @@ -1713,9 +2029,11 @@ library ReturndataReaders { } /// @dev Reads the uint128 at `rdPtr` in returndata. - function readUint128( - ReturndataPointer rdPtr - ) internal pure returns (uint128 value) { + function readUint128(ReturndataPointer rdPtr) + internal + pure + returns (uint128 value) + { assembly { returndatacopy(0, rdPtr, _OneWord) value := mload(0) @@ -1723,9 +2041,11 @@ library ReturndataReaders { } /// @dev Reads the uint136 at `rdPtr` in returndata. - function readUint136( - ReturndataPointer rdPtr - ) internal pure returns (uint136 value) { + function readUint136(ReturndataPointer rdPtr) + internal + pure + returns (uint136 value) + { assembly { returndatacopy(0, rdPtr, _OneWord) value := mload(0) @@ -1733,9 +2053,11 @@ library ReturndataReaders { } /// @dev Reads the uint144 at `rdPtr` in returndata. - function readUint144( - ReturndataPointer rdPtr - ) internal pure returns (uint144 value) { + function readUint144(ReturndataPointer rdPtr) + internal + pure + returns (uint144 value) + { assembly { returndatacopy(0, rdPtr, _OneWord) value := mload(0) @@ -1743,9 +2065,11 @@ library ReturndataReaders { } /// @dev Reads the uint152 at `rdPtr` in returndata. - function readUint152( - ReturndataPointer rdPtr - ) internal pure returns (uint152 value) { + function readUint152(ReturndataPointer rdPtr) + internal + pure + returns (uint152 value) + { assembly { returndatacopy(0, rdPtr, _OneWord) value := mload(0) @@ -1753,9 +2077,11 @@ library ReturndataReaders { } /// @dev Reads the uint160 at `rdPtr` in returndata. - function readUint160( - ReturndataPointer rdPtr - ) internal pure returns (uint160 value) { + function readUint160(ReturndataPointer rdPtr) + internal + pure + returns (uint160 value) + { assembly { returndatacopy(0, rdPtr, _OneWord) value := mload(0) @@ -1763,9 +2089,11 @@ library ReturndataReaders { } /// @dev Reads the uint168 at `rdPtr` in returndata. - function readUint168( - ReturndataPointer rdPtr - ) internal pure returns (uint168 value) { + function readUint168(ReturndataPointer rdPtr) + internal + pure + returns (uint168 value) + { assembly { returndatacopy(0, rdPtr, _OneWord) value := mload(0) @@ -1773,9 +2101,11 @@ library ReturndataReaders { } /// @dev Reads the uint176 at `rdPtr` in returndata. - function readUint176( - ReturndataPointer rdPtr - ) internal pure returns (uint176 value) { + function readUint176(ReturndataPointer rdPtr) + internal + pure + returns (uint176 value) + { assembly { returndatacopy(0, rdPtr, _OneWord) value := mload(0) @@ -1783,9 +2113,11 @@ library ReturndataReaders { } /// @dev Reads the uint184 at `rdPtr` in returndata. - function readUint184( - ReturndataPointer rdPtr - ) internal pure returns (uint184 value) { + function readUint184(ReturndataPointer rdPtr) + internal + pure + returns (uint184 value) + { assembly { returndatacopy(0, rdPtr, _OneWord) value := mload(0) @@ -1793,9 +2125,11 @@ library ReturndataReaders { } /// @dev Reads the uint192 at `rdPtr` in returndata. - function readUint192( - ReturndataPointer rdPtr - ) internal pure returns (uint192 value) { + function readUint192(ReturndataPointer rdPtr) + internal + pure + returns (uint192 value) + { assembly { returndatacopy(0, rdPtr, _OneWord) value := mload(0) @@ -1803,9 +2137,11 @@ library ReturndataReaders { } /// @dev Reads the uint200 at `rdPtr` in returndata. - function readUint200( - ReturndataPointer rdPtr - ) internal pure returns (uint200 value) { + function readUint200(ReturndataPointer rdPtr) + internal + pure + returns (uint200 value) + { assembly { returndatacopy(0, rdPtr, _OneWord) value := mload(0) @@ -1813,9 +2149,11 @@ library ReturndataReaders { } /// @dev Reads the uint208 at `rdPtr` in returndata. - function readUint208( - ReturndataPointer rdPtr - ) internal pure returns (uint208 value) { + function readUint208(ReturndataPointer rdPtr) + internal + pure + returns (uint208 value) + { assembly { returndatacopy(0, rdPtr, _OneWord) value := mload(0) @@ -1823,9 +2161,11 @@ library ReturndataReaders { } /// @dev Reads the uint216 at `rdPtr` in returndata. - function readUint216( - ReturndataPointer rdPtr - ) internal pure returns (uint216 value) { + function readUint216(ReturndataPointer rdPtr) + internal + pure + returns (uint216 value) + { assembly { returndatacopy(0, rdPtr, _OneWord) value := mload(0) @@ -1833,9 +2173,11 @@ library ReturndataReaders { } /// @dev Reads the uint224 at `rdPtr` in returndata. - function readUint224( - ReturndataPointer rdPtr - ) internal pure returns (uint224 value) { + function readUint224(ReturndataPointer rdPtr) + internal + pure + returns (uint224 value) + { assembly { returndatacopy(0, rdPtr, _OneWord) value := mload(0) @@ -1843,9 +2185,11 @@ library ReturndataReaders { } /// @dev Reads the uint232 at `rdPtr` in returndata. - function readUint232( - ReturndataPointer rdPtr - ) internal pure returns (uint232 value) { + function readUint232(ReturndataPointer rdPtr) + internal + pure + returns (uint232 value) + { assembly { returndatacopy(0, rdPtr, _OneWord) value := mload(0) @@ -1853,9 +2197,11 @@ library ReturndataReaders { } /// @dev Reads the uint240 at `rdPtr` in returndata. - function readUint240( - ReturndataPointer rdPtr - ) internal pure returns (uint240 value) { + function readUint240(ReturndataPointer rdPtr) + internal + pure + returns (uint240 value) + { assembly { returndatacopy(0, rdPtr, _OneWord) value := mload(0) @@ -1863,9 +2209,11 @@ library ReturndataReaders { } /// @dev Reads the uint248 at `rdPtr` in returndata. - function readUint248( - ReturndataPointer rdPtr - ) internal pure returns (uint248 value) { + function readUint248(ReturndataPointer rdPtr) + internal + pure + returns (uint248 value) + { assembly { returndatacopy(0, rdPtr, _OneWord) value := mload(0) @@ -1873,9 +2221,11 @@ library ReturndataReaders { } /// @dev Reads the uint256 at `rdPtr` in returndata. - function readUint256( - ReturndataPointer rdPtr - ) internal pure returns (uint256 value) { + function readUint256(ReturndataPointer rdPtr) + internal + pure + returns (uint256 value) + { assembly { returndatacopy(0, rdPtr, _OneWord) value := mload(0) @@ -1883,9 +2233,11 @@ library ReturndataReaders { } /// @dev Reads the int8 at `rdPtr` in returndata. - function readInt8( - ReturndataPointer rdPtr - ) internal pure returns (int8 value) { + function readInt8(ReturndataPointer rdPtr) + internal + pure + returns (int8 value) + { assembly { returndatacopy(0, rdPtr, _OneWord) value := mload(0) @@ -1893,9 +2245,11 @@ library ReturndataReaders { } /// @dev Reads the int16 at `rdPtr` in returndata. - function readInt16( - ReturndataPointer rdPtr - ) internal pure returns (int16 value) { + function readInt16(ReturndataPointer rdPtr) + internal + pure + returns (int16 value) + { assembly { returndatacopy(0, rdPtr, _OneWord) value := mload(0) @@ -1903,9 +2257,11 @@ library ReturndataReaders { } /// @dev Reads the int24 at `rdPtr` in returndata. - function readInt24( - ReturndataPointer rdPtr - ) internal pure returns (int24 value) { + function readInt24(ReturndataPointer rdPtr) + internal + pure + returns (int24 value) + { assembly { returndatacopy(0, rdPtr, _OneWord) value := mload(0) @@ -1913,9 +2269,11 @@ library ReturndataReaders { } /// @dev Reads the int32 at `rdPtr` in returndata. - function readInt32( - ReturndataPointer rdPtr - ) internal pure returns (int32 value) { + function readInt32(ReturndataPointer rdPtr) + internal + pure + returns (int32 value) + { assembly { returndatacopy(0, rdPtr, _OneWord) value := mload(0) @@ -1923,9 +2281,11 @@ library ReturndataReaders { } /// @dev Reads the int40 at `rdPtr` in returndata. - function readInt40( - ReturndataPointer rdPtr - ) internal pure returns (int40 value) { + function readInt40(ReturndataPointer rdPtr) + internal + pure + returns (int40 value) + { assembly { returndatacopy(0, rdPtr, _OneWord) value := mload(0) @@ -1933,9 +2293,11 @@ library ReturndataReaders { } /// @dev Reads the int48 at `rdPtr` in returndata. - function readInt48( - ReturndataPointer rdPtr - ) internal pure returns (int48 value) { + function readInt48(ReturndataPointer rdPtr) + internal + pure + returns (int48 value) + { assembly { returndatacopy(0, rdPtr, _OneWord) value := mload(0) @@ -1943,9 +2305,11 @@ library ReturndataReaders { } /// @dev Reads the int56 at `rdPtr` in returndata. - function readInt56( - ReturndataPointer rdPtr - ) internal pure returns (int56 value) { + function readInt56(ReturndataPointer rdPtr) + internal + pure + returns (int56 value) + { assembly { returndatacopy(0, rdPtr, _OneWord) value := mload(0) @@ -1953,9 +2317,11 @@ library ReturndataReaders { } /// @dev Reads the int64 at `rdPtr` in returndata. - function readInt64( - ReturndataPointer rdPtr - ) internal pure returns (int64 value) { + function readInt64(ReturndataPointer rdPtr) + internal + pure + returns (int64 value) + { assembly { returndatacopy(0, rdPtr, _OneWord) value := mload(0) @@ -1963,9 +2329,11 @@ library ReturndataReaders { } /// @dev Reads the int72 at `rdPtr` in returndata. - function readInt72( - ReturndataPointer rdPtr - ) internal pure returns (int72 value) { + function readInt72(ReturndataPointer rdPtr) + internal + pure + returns (int72 value) + { assembly { returndatacopy(0, rdPtr, _OneWord) value := mload(0) @@ -1973,9 +2341,11 @@ library ReturndataReaders { } /// @dev Reads the int80 at `rdPtr` in returndata. - function readInt80( - ReturndataPointer rdPtr - ) internal pure returns (int80 value) { + function readInt80(ReturndataPointer rdPtr) + internal + pure + returns (int80 value) + { assembly { returndatacopy(0, rdPtr, _OneWord) value := mload(0) @@ -1983,9 +2353,11 @@ library ReturndataReaders { } /// @dev Reads the int88 at `rdPtr` in returndata. - function readInt88( - ReturndataPointer rdPtr - ) internal pure returns (int88 value) { + function readInt88(ReturndataPointer rdPtr) + internal + pure + returns (int88 value) + { assembly { returndatacopy(0, rdPtr, _OneWord) value := mload(0) @@ -1993,9 +2365,11 @@ library ReturndataReaders { } /// @dev Reads the int96 at `rdPtr` in returndata. - function readInt96( - ReturndataPointer rdPtr - ) internal pure returns (int96 value) { + function readInt96(ReturndataPointer rdPtr) + internal + pure + returns (int96 value) + { assembly { returndatacopy(0, rdPtr, _OneWord) value := mload(0) @@ -2003,9 +2377,11 @@ library ReturndataReaders { } /// @dev Reads the int104 at `rdPtr` in returndata. - function readInt104( - ReturndataPointer rdPtr - ) internal pure returns (int104 value) { + function readInt104(ReturndataPointer rdPtr) + internal + pure + returns (int104 value) + { assembly { returndatacopy(0, rdPtr, _OneWord) value := mload(0) @@ -2013,9 +2389,11 @@ library ReturndataReaders { } /// @dev Reads the int112 at `rdPtr` in returndata. - function readInt112( - ReturndataPointer rdPtr - ) internal pure returns (int112 value) { + function readInt112(ReturndataPointer rdPtr) + internal + pure + returns (int112 value) + { assembly { returndatacopy(0, rdPtr, _OneWord) value := mload(0) @@ -2023,9 +2401,11 @@ library ReturndataReaders { } /// @dev Reads the int120 at `rdPtr` in returndata. - function readInt120( - ReturndataPointer rdPtr - ) internal pure returns (int120 value) { + function readInt120(ReturndataPointer rdPtr) + internal + pure + returns (int120 value) + { assembly { returndatacopy(0, rdPtr, _OneWord) value := mload(0) @@ -2033,9 +2413,11 @@ library ReturndataReaders { } /// @dev Reads the int128 at `rdPtr` in returndata. - function readInt128( - ReturndataPointer rdPtr - ) internal pure returns (int128 value) { + function readInt128(ReturndataPointer rdPtr) + internal + pure + returns (int128 value) + { assembly { returndatacopy(0, rdPtr, _OneWord) value := mload(0) @@ -2043,9 +2425,11 @@ library ReturndataReaders { } /// @dev Reads the int136 at `rdPtr` in returndata. - function readInt136( - ReturndataPointer rdPtr - ) internal pure returns (int136 value) { + function readInt136(ReturndataPointer rdPtr) + internal + pure + returns (int136 value) + { assembly { returndatacopy(0, rdPtr, _OneWord) value := mload(0) @@ -2053,9 +2437,11 @@ library ReturndataReaders { } /// @dev Reads the int144 at `rdPtr` in returndata. - function readInt144( - ReturndataPointer rdPtr - ) internal pure returns (int144 value) { + function readInt144(ReturndataPointer rdPtr) + internal + pure + returns (int144 value) + { assembly { returndatacopy(0, rdPtr, _OneWord) value := mload(0) @@ -2063,9 +2449,11 @@ library ReturndataReaders { } /// @dev Reads the int152 at `rdPtr` in returndata. - function readInt152( - ReturndataPointer rdPtr - ) internal pure returns (int152 value) { + function readInt152(ReturndataPointer rdPtr) + internal + pure + returns (int152 value) + { assembly { returndatacopy(0, rdPtr, _OneWord) value := mload(0) @@ -2073,9 +2461,11 @@ library ReturndataReaders { } /// @dev Reads the int160 at `rdPtr` in returndata. - function readInt160( - ReturndataPointer rdPtr - ) internal pure returns (int160 value) { + function readInt160(ReturndataPointer rdPtr) + internal + pure + returns (int160 value) + { assembly { returndatacopy(0, rdPtr, _OneWord) value := mload(0) @@ -2083,9 +2473,11 @@ library ReturndataReaders { } /// @dev Reads the int168 at `rdPtr` in returndata. - function readInt168( - ReturndataPointer rdPtr - ) internal pure returns (int168 value) { + function readInt168(ReturndataPointer rdPtr) + internal + pure + returns (int168 value) + { assembly { returndatacopy(0, rdPtr, _OneWord) value := mload(0) @@ -2093,9 +2485,11 @@ library ReturndataReaders { } /// @dev Reads the int176 at `rdPtr` in returndata. - function readInt176( - ReturndataPointer rdPtr - ) internal pure returns (int176 value) { + function readInt176(ReturndataPointer rdPtr) + internal + pure + returns (int176 value) + { assembly { returndatacopy(0, rdPtr, _OneWord) value := mload(0) @@ -2103,9 +2497,11 @@ library ReturndataReaders { } /// @dev Reads the int184 at `rdPtr` in returndata. - function readInt184( - ReturndataPointer rdPtr - ) internal pure returns (int184 value) { + function readInt184(ReturndataPointer rdPtr) + internal + pure + returns (int184 value) + { assembly { returndatacopy(0, rdPtr, _OneWord) value := mload(0) @@ -2113,9 +2509,11 @@ library ReturndataReaders { } /// @dev Reads the int192 at `rdPtr` in returndata. - function readInt192( - ReturndataPointer rdPtr - ) internal pure returns (int192 value) { + function readInt192(ReturndataPointer rdPtr) + internal + pure + returns (int192 value) + { assembly { returndatacopy(0, rdPtr, _OneWord) value := mload(0) @@ -2123,9 +2521,11 @@ library ReturndataReaders { } /// @dev Reads the int200 at `rdPtr` in returndata. - function readInt200( - ReturndataPointer rdPtr - ) internal pure returns (int200 value) { + function readInt200(ReturndataPointer rdPtr) + internal + pure + returns (int200 value) + { assembly { returndatacopy(0, rdPtr, _OneWord) value := mload(0) @@ -2133,9 +2533,11 @@ library ReturndataReaders { } /// @dev Reads the int208 at `rdPtr` in returndata. - function readInt208( - ReturndataPointer rdPtr - ) internal pure returns (int208 value) { + function readInt208(ReturndataPointer rdPtr) + internal + pure + returns (int208 value) + { assembly { returndatacopy(0, rdPtr, _OneWord) value := mload(0) @@ -2143,9 +2545,11 @@ library ReturndataReaders { } /// @dev Reads the int216 at `rdPtr` in returndata. - function readInt216( - ReturndataPointer rdPtr - ) internal pure returns (int216 value) { + function readInt216(ReturndataPointer rdPtr) + internal + pure + returns (int216 value) + { assembly { returndatacopy(0, rdPtr, _OneWord) value := mload(0) @@ -2153,9 +2557,11 @@ library ReturndataReaders { } /// @dev Reads the int224 at `rdPtr` in returndata. - function readInt224( - ReturndataPointer rdPtr - ) internal pure returns (int224 value) { + function readInt224(ReturndataPointer rdPtr) + internal + pure + returns (int224 value) + { assembly { returndatacopy(0, rdPtr, _OneWord) value := mload(0) @@ -2163,9 +2569,11 @@ library ReturndataReaders { } /// @dev Reads the int232 at `rdPtr` in returndata. - function readInt232( - ReturndataPointer rdPtr - ) internal pure returns (int232 value) { + function readInt232(ReturndataPointer rdPtr) + internal + pure + returns (int232 value) + { assembly { returndatacopy(0, rdPtr, _OneWord) value := mload(0) @@ -2173,9 +2581,11 @@ library ReturndataReaders { } /// @dev Reads the int240 at `rdPtr` in returndata. - function readInt240( - ReturndataPointer rdPtr - ) internal pure returns (int240 value) { + function readInt240(ReturndataPointer rdPtr) + internal + pure + returns (int240 value) + { assembly { returndatacopy(0, rdPtr, _OneWord) value := mload(0) @@ -2183,9 +2593,11 @@ library ReturndataReaders { } /// @dev Reads the int248 at `rdPtr` in returndata. - function readInt248( - ReturndataPointer rdPtr - ) internal pure returns (int248 value) { + function readInt248(ReturndataPointer rdPtr) + internal + pure + returns (int248 value) + { assembly { returndatacopy(0, rdPtr, _OneWord) value := mload(0) @@ -2193,9 +2605,11 @@ library ReturndataReaders { } /// @dev Reads the int256 at `rdPtr` in returndata. - function readInt256( - ReturndataPointer rdPtr - ) internal pure returns (int256 value) { + function readInt256(ReturndataPointer rdPtr) + internal + pure + returns (int256 value) + { assembly { returndatacopy(0, rdPtr, _OneWord) value := mload(0) @@ -2205,18 +2619,22 @@ library ReturndataReaders { library MemoryReaders { /// @dev Reads the memory pointer at `mPtr` in memory. - function readMemoryPointer( - MemoryPointer mPtr - ) internal pure returns (MemoryPointer value) { + function readMemoryPointer(MemoryPointer mPtr) + internal + pure + returns (MemoryPointer value) + { assembly { value := mload(mPtr) } } /// @dev Reads value at `mPtr` & applies a mask to return only last 4 bytes - function readMaskedUint256( - MemoryPointer mPtr - ) internal pure returns (uint256 value) { + function readMaskedUint256(MemoryPointer mPtr) + internal + pure + returns (uint256 value) + { value = mPtr.readUint256() & OffsetOrLengthMask; } @@ -2228,583 +2646,715 @@ library MemoryReaders { } /// @dev Reads the address at `mPtr` in memory. - function readAddress( - MemoryPointer mPtr - ) internal pure returns (address value) { + function readAddress(MemoryPointer mPtr) + internal + pure + returns (address value) + { assembly { value := mload(mPtr) } } /// @dev Reads the bytes1 at `mPtr` in memory. - function readBytes1( - MemoryPointer mPtr - ) internal pure returns (bytes1 value) { + function readBytes1(MemoryPointer mPtr) + internal + pure + returns (bytes1 value) + { assembly { value := mload(mPtr) } } /// @dev Reads the bytes2 at `mPtr` in memory. - function readBytes2( - MemoryPointer mPtr - ) internal pure returns (bytes2 value) { + function readBytes2(MemoryPointer mPtr) + internal + pure + returns (bytes2 value) + { assembly { value := mload(mPtr) } } /// @dev Reads the bytes3 at `mPtr` in memory. - function readBytes3( - MemoryPointer mPtr - ) internal pure returns (bytes3 value) { + function readBytes3(MemoryPointer mPtr) + internal + pure + returns (bytes3 value) + { assembly { value := mload(mPtr) } } /// @dev Reads the bytes4 at `mPtr` in memory. - function readBytes4( - MemoryPointer mPtr - ) internal pure returns (bytes4 value) { + function readBytes4(MemoryPointer mPtr) + internal + pure + returns (bytes4 value) + { assembly { value := mload(mPtr) } } /// @dev Reads the bytes5 at `mPtr` in memory. - function readBytes5( - MemoryPointer mPtr - ) internal pure returns (bytes5 value) { + function readBytes5(MemoryPointer mPtr) + internal + pure + returns (bytes5 value) + { assembly { value := mload(mPtr) } } /// @dev Reads the bytes6 at `mPtr` in memory. - function readBytes6( - MemoryPointer mPtr - ) internal pure returns (bytes6 value) { + function readBytes6(MemoryPointer mPtr) + internal + pure + returns (bytes6 value) + { assembly { value := mload(mPtr) } } /// @dev Reads the bytes7 at `mPtr` in memory. - function readBytes7( - MemoryPointer mPtr - ) internal pure returns (bytes7 value) { + function readBytes7(MemoryPointer mPtr) + internal + pure + returns (bytes7 value) + { assembly { value := mload(mPtr) } } /// @dev Reads the bytes8 at `mPtr` in memory. - function readBytes8( - MemoryPointer mPtr - ) internal pure returns (bytes8 value) { + function readBytes8(MemoryPointer mPtr) + internal + pure + returns (bytes8 value) + { assembly { value := mload(mPtr) } } /// @dev Reads the bytes9 at `mPtr` in memory. - function readBytes9( - MemoryPointer mPtr - ) internal pure returns (bytes9 value) { + function readBytes9(MemoryPointer mPtr) + internal + pure + returns (bytes9 value) + { assembly { value := mload(mPtr) } } /// @dev Reads the bytes10 at `mPtr` in memory. - function readBytes10( - MemoryPointer mPtr - ) internal pure returns (bytes10 value) { + function readBytes10(MemoryPointer mPtr) + internal + pure + returns (bytes10 value) + { assembly { value := mload(mPtr) } } /// @dev Reads the bytes11 at `mPtr` in memory. - function readBytes11( - MemoryPointer mPtr - ) internal pure returns (bytes11 value) { + function readBytes11(MemoryPointer mPtr) + internal + pure + returns (bytes11 value) + { assembly { value := mload(mPtr) } } /// @dev Reads the bytes12 at `mPtr` in memory. - function readBytes12( - MemoryPointer mPtr - ) internal pure returns (bytes12 value) { + function readBytes12(MemoryPointer mPtr) + internal + pure + returns (bytes12 value) + { assembly { value := mload(mPtr) } } /// @dev Reads the bytes13 at `mPtr` in memory. - function readBytes13( - MemoryPointer mPtr - ) internal pure returns (bytes13 value) { + function readBytes13(MemoryPointer mPtr) + internal + pure + returns (bytes13 value) + { assembly { value := mload(mPtr) } } /// @dev Reads the bytes14 at `mPtr` in memory. - function readBytes14( - MemoryPointer mPtr - ) internal pure returns (bytes14 value) { + function readBytes14(MemoryPointer mPtr) + internal + pure + returns (bytes14 value) + { assembly { value := mload(mPtr) } } /// @dev Reads the bytes15 at `mPtr` in memory. - function readBytes15( - MemoryPointer mPtr - ) internal pure returns (bytes15 value) { + function readBytes15(MemoryPointer mPtr) + internal + pure + returns (bytes15 value) + { assembly { value := mload(mPtr) } } /// @dev Reads the bytes16 at `mPtr` in memory. - function readBytes16( - MemoryPointer mPtr - ) internal pure returns (bytes16 value) { + function readBytes16(MemoryPointer mPtr) + internal + pure + returns (bytes16 value) + { assembly { value := mload(mPtr) } } /// @dev Reads the bytes17 at `mPtr` in memory. - function readBytes17( - MemoryPointer mPtr - ) internal pure returns (bytes17 value) { + function readBytes17(MemoryPointer mPtr) + internal + pure + returns (bytes17 value) + { assembly { value := mload(mPtr) } } /// @dev Reads the bytes18 at `mPtr` in memory. - function readBytes18( - MemoryPointer mPtr - ) internal pure returns (bytes18 value) { + function readBytes18(MemoryPointer mPtr) + internal + pure + returns (bytes18 value) + { assembly { value := mload(mPtr) } } /// @dev Reads the bytes19 at `mPtr` in memory. - function readBytes19( - MemoryPointer mPtr - ) internal pure returns (bytes19 value) { + function readBytes19(MemoryPointer mPtr) + internal + pure + returns (bytes19 value) + { assembly { value := mload(mPtr) } } /// @dev Reads the bytes20 at `mPtr` in memory. - function readBytes20( - MemoryPointer mPtr - ) internal pure returns (bytes20 value) { + function readBytes20(MemoryPointer mPtr) + internal + pure + returns (bytes20 value) + { assembly { value := mload(mPtr) } } /// @dev Reads the bytes21 at `mPtr` in memory. - function readBytes21( - MemoryPointer mPtr - ) internal pure returns (bytes21 value) { + function readBytes21(MemoryPointer mPtr) + internal + pure + returns (bytes21 value) + { assembly { value := mload(mPtr) } } /// @dev Reads the bytes22 at `mPtr` in memory. - function readBytes22( - MemoryPointer mPtr - ) internal pure returns (bytes22 value) { + function readBytes22(MemoryPointer mPtr) + internal + pure + returns (bytes22 value) + { assembly { value := mload(mPtr) } } /// @dev Reads the bytes23 at `mPtr` in memory. - function readBytes23( - MemoryPointer mPtr - ) internal pure returns (bytes23 value) { + function readBytes23(MemoryPointer mPtr) + internal + pure + returns (bytes23 value) + { assembly { value := mload(mPtr) } } /// @dev Reads the bytes24 at `mPtr` in memory. - function readBytes24( - MemoryPointer mPtr - ) internal pure returns (bytes24 value) { + function readBytes24(MemoryPointer mPtr) + internal + pure + returns (bytes24 value) + { assembly { value := mload(mPtr) } } /// @dev Reads the bytes25 at `mPtr` in memory. - function readBytes25( - MemoryPointer mPtr - ) internal pure returns (bytes25 value) { + function readBytes25(MemoryPointer mPtr) + internal + pure + returns (bytes25 value) + { assembly { value := mload(mPtr) } } /// @dev Reads the bytes26 at `mPtr` in memory. - function readBytes26( - MemoryPointer mPtr - ) internal pure returns (bytes26 value) { + function readBytes26(MemoryPointer mPtr) + internal + pure + returns (bytes26 value) + { assembly { value := mload(mPtr) } } /// @dev Reads the bytes27 at `mPtr` in memory. - function readBytes27( - MemoryPointer mPtr - ) internal pure returns (bytes27 value) { + function readBytes27(MemoryPointer mPtr) + internal + pure + returns (bytes27 value) + { assembly { value := mload(mPtr) } } /// @dev Reads the bytes28 at `mPtr` in memory. - function readBytes28( - MemoryPointer mPtr - ) internal pure returns (bytes28 value) { + function readBytes28(MemoryPointer mPtr) + internal + pure + returns (bytes28 value) + { assembly { value := mload(mPtr) } } /// @dev Reads the bytes29 at `mPtr` in memory. - function readBytes29( - MemoryPointer mPtr - ) internal pure returns (bytes29 value) { + function readBytes29(MemoryPointer mPtr) + internal + pure + returns (bytes29 value) + { assembly { value := mload(mPtr) } } /// @dev Reads the bytes30 at `mPtr` in memory. - function readBytes30( - MemoryPointer mPtr - ) internal pure returns (bytes30 value) { + function readBytes30(MemoryPointer mPtr) + internal + pure + returns (bytes30 value) + { assembly { value := mload(mPtr) } } /// @dev Reads the bytes31 at `mPtr` in memory. - function readBytes31( - MemoryPointer mPtr - ) internal pure returns (bytes31 value) { + function readBytes31(MemoryPointer mPtr) + internal + pure + returns (bytes31 value) + { assembly { value := mload(mPtr) } } /// @dev Reads the bytes32 at `mPtr` in memory. - function readBytes32( - MemoryPointer mPtr - ) internal pure returns (bytes32 value) { + function readBytes32(MemoryPointer mPtr) + internal + pure + returns (bytes32 value) + { assembly { value := mload(mPtr) } } /// @dev Reads the uint8 at `mPtr` in memory. - function readUint8(MemoryPointer mPtr) internal pure returns (uint8 value) { + function readUint8(MemoryPointer mPtr) + internal + pure + returns (uint8 value) + { assembly { value := mload(mPtr) } } /// @dev Reads the uint16 at `mPtr` in memory. - function readUint16( - MemoryPointer mPtr - ) internal pure returns (uint16 value) { + function readUint16(MemoryPointer mPtr) + internal + pure + returns (uint16 value) + { assembly { value := mload(mPtr) } } /// @dev Reads the uint24 at `mPtr` in memory. - function readUint24( - MemoryPointer mPtr - ) internal pure returns (uint24 value) { + function readUint24(MemoryPointer mPtr) + internal + pure + returns (uint24 value) + { assembly { value := mload(mPtr) } } /// @dev Reads the uint32 at `mPtr` in memory. - function readUint32( - MemoryPointer mPtr - ) internal pure returns (uint32 value) { + function readUint32(MemoryPointer mPtr) + internal + pure + returns (uint32 value) + { assembly { value := mload(mPtr) } } /// @dev Reads the uint40 at `mPtr` in memory. - function readUint40( - MemoryPointer mPtr - ) internal pure returns (uint40 value) { + function readUint40(MemoryPointer mPtr) + internal + pure + returns (uint40 value) + { assembly { value := mload(mPtr) } } /// @dev Reads the uint48 at `mPtr` in memory. - function readUint48( - MemoryPointer mPtr - ) internal pure returns (uint48 value) { + function readUint48(MemoryPointer mPtr) + internal + pure + returns (uint48 value) + { assembly { value := mload(mPtr) } } /// @dev Reads the uint56 at `mPtr` in memory. - function readUint56( - MemoryPointer mPtr - ) internal pure returns (uint56 value) { + function readUint56(MemoryPointer mPtr) + internal + pure + returns (uint56 value) + { assembly { value := mload(mPtr) } } /// @dev Reads the uint64 at `mPtr` in memory. - function readUint64( - MemoryPointer mPtr - ) internal pure returns (uint64 value) { + function readUint64(MemoryPointer mPtr) + internal + pure + returns (uint64 value) + { assembly { value := mload(mPtr) } } /// @dev Reads the uint72 at `mPtr` in memory. - function readUint72( - MemoryPointer mPtr - ) internal pure returns (uint72 value) { + function readUint72(MemoryPointer mPtr) + internal + pure + returns (uint72 value) + { assembly { value := mload(mPtr) } } /// @dev Reads the uint80 at `mPtr` in memory. - function readUint80( - MemoryPointer mPtr - ) internal pure returns (uint80 value) { + function readUint80(MemoryPointer mPtr) + internal + pure + returns (uint80 value) + { assembly { value := mload(mPtr) } } /// @dev Reads the uint88 at `mPtr` in memory. - function readUint88( - MemoryPointer mPtr - ) internal pure returns (uint88 value) { + function readUint88(MemoryPointer mPtr) + internal + pure + returns (uint88 value) + { assembly { value := mload(mPtr) } } /// @dev Reads the uint96 at `mPtr` in memory. - function readUint96( - MemoryPointer mPtr - ) internal pure returns (uint96 value) { + function readUint96(MemoryPointer mPtr) + internal + pure + returns (uint96 value) + { assembly { value := mload(mPtr) } } /// @dev Reads the uint104 at `mPtr` in memory. - function readUint104( - MemoryPointer mPtr - ) internal pure returns (uint104 value) { + function readUint104(MemoryPointer mPtr) + internal + pure + returns (uint104 value) + { assembly { value := mload(mPtr) } } /// @dev Reads the uint112 at `mPtr` in memory. - function readUint112( - MemoryPointer mPtr - ) internal pure returns (uint112 value) { + function readUint112(MemoryPointer mPtr) + internal + pure + returns (uint112 value) + { assembly { value := mload(mPtr) } } /// @dev Reads the uint120 at `mPtr` in memory. - function readUint120( - MemoryPointer mPtr - ) internal pure returns (uint120 value) { + function readUint120(MemoryPointer mPtr) + internal + pure + returns (uint120 value) + { assembly { value := mload(mPtr) } } /// @dev Reads the uint128 at `mPtr` in memory. - function readUint128( - MemoryPointer mPtr - ) internal pure returns (uint128 value) { + function readUint128(MemoryPointer mPtr) + internal + pure + returns (uint128 value) + { assembly { value := mload(mPtr) } } /// @dev Reads the uint136 at `mPtr` in memory. - function readUint136( - MemoryPointer mPtr - ) internal pure returns (uint136 value) { + function readUint136(MemoryPointer mPtr) + internal + pure + returns (uint136 value) + { assembly { value := mload(mPtr) } } /// @dev Reads the uint144 at `mPtr` in memory. - function readUint144( - MemoryPointer mPtr - ) internal pure returns (uint144 value) { + function readUint144(MemoryPointer mPtr) + internal + pure + returns (uint144 value) + { assembly { value := mload(mPtr) } } /// @dev Reads the uint152 at `mPtr` in memory. - function readUint152( - MemoryPointer mPtr - ) internal pure returns (uint152 value) { + function readUint152(MemoryPointer mPtr) + internal + pure + returns (uint152 value) + { assembly { value := mload(mPtr) } } /// @dev Reads the uint160 at `mPtr` in memory. - function readUint160( - MemoryPointer mPtr - ) internal pure returns (uint160 value) { + function readUint160(MemoryPointer mPtr) + internal + pure + returns (uint160 value) + { assembly { value := mload(mPtr) } } /// @dev Reads the uint168 at `mPtr` in memory. - function readUint168( - MemoryPointer mPtr - ) internal pure returns (uint168 value) { + function readUint168(MemoryPointer mPtr) + internal + pure + returns (uint168 value) + { assembly { value := mload(mPtr) } } /// @dev Reads the uint176 at `mPtr` in memory. - function readUint176( - MemoryPointer mPtr - ) internal pure returns (uint176 value) { + function readUint176(MemoryPointer mPtr) + internal + pure + returns (uint176 value) + { assembly { value := mload(mPtr) } } /// @dev Reads the uint184 at `mPtr` in memory. - function readUint184( - MemoryPointer mPtr - ) internal pure returns (uint184 value) { + function readUint184(MemoryPointer mPtr) + internal + pure + returns (uint184 value) + { assembly { value := mload(mPtr) } } /// @dev Reads the uint192 at `mPtr` in memory. - function readUint192( - MemoryPointer mPtr - ) internal pure returns (uint192 value) { + function readUint192(MemoryPointer mPtr) + internal + pure + returns (uint192 value) + { assembly { value := mload(mPtr) } } /// @dev Reads the uint200 at `mPtr` in memory. - function readUint200( - MemoryPointer mPtr - ) internal pure returns (uint200 value) { + function readUint200(MemoryPointer mPtr) + internal + pure + returns (uint200 value) + { assembly { value := mload(mPtr) } } /// @dev Reads the uint208 at `mPtr` in memory. - function readUint208( - MemoryPointer mPtr - ) internal pure returns (uint208 value) { + function readUint208(MemoryPointer mPtr) + internal + pure + returns (uint208 value) + { assembly { value := mload(mPtr) } } /// @dev Reads the uint216 at `mPtr` in memory. - function readUint216( - MemoryPointer mPtr - ) internal pure returns (uint216 value) { + function readUint216(MemoryPointer mPtr) + internal + pure + returns (uint216 value) + { assembly { value := mload(mPtr) } } /// @dev Reads the uint224 at `mPtr` in memory. - function readUint224( - MemoryPointer mPtr - ) internal pure returns (uint224 value) { + function readUint224(MemoryPointer mPtr) + internal + pure + returns (uint224 value) + { assembly { value := mload(mPtr) } } /// @dev Reads the uint232 at `mPtr` in memory. - function readUint232( - MemoryPointer mPtr - ) internal pure returns (uint232 value) { + function readUint232(MemoryPointer mPtr) + internal + pure + returns (uint232 value) + { assembly { value := mload(mPtr) } } /// @dev Reads the uint240 at `mPtr` in memory. - function readUint240( - MemoryPointer mPtr - ) internal pure returns (uint240 value) { + function readUint240(MemoryPointer mPtr) + internal + pure + returns (uint240 value) + { assembly { value := mload(mPtr) } } /// @dev Reads the uint248 at `mPtr` in memory. - function readUint248( - MemoryPointer mPtr - ) internal pure returns (uint248 value) { + function readUint248(MemoryPointer mPtr) + internal + pure + returns (uint248 value) + { assembly { value := mload(mPtr) } } /// @dev Reads the uint256 at `mPtr` in memory. - function readUint256( - MemoryPointer mPtr - ) internal pure returns (uint256 value) { + function readUint256(MemoryPointer mPtr) + internal + pure + returns (uint256 value) + { assembly { value := mload(mPtr) } @@ -2818,257 +3368,341 @@ library MemoryReaders { } /// @dev Reads the int16 at `mPtr` in memory. - function readInt16(MemoryPointer mPtr) internal pure returns (int16 value) { + function readInt16(MemoryPointer mPtr) + internal + pure + returns (int16 value) + { assembly { value := mload(mPtr) } } /// @dev Reads the int24 at `mPtr` in memory. - function readInt24(MemoryPointer mPtr) internal pure returns (int24 value) { + function readInt24(MemoryPointer mPtr) + internal + pure + returns (int24 value) + { assembly { value := mload(mPtr) } } /// @dev Reads the int32 at `mPtr` in memory. - function readInt32(MemoryPointer mPtr) internal pure returns (int32 value) { + function readInt32(MemoryPointer mPtr) + internal + pure + returns (int32 value) + { assembly { value := mload(mPtr) } } /// @dev Reads the int40 at `mPtr` in memory. - function readInt40(MemoryPointer mPtr) internal pure returns (int40 value) { + function readInt40(MemoryPointer mPtr) + internal + pure + returns (int40 value) + { assembly { value := mload(mPtr) } } /// @dev Reads the int48 at `mPtr` in memory. - function readInt48(MemoryPointer mPtr) internal pure returns (int48 value) { + function readInt48(MemoryPointer mPtr) + internal + pure + returns (int48 value) + { assembly { value := mload(mPtr) } } /// @dev Reads the int56 at `mPtr` in memory. - function readInt56(MemoryPointer mPtr) internal pure returns (int56 value) { + function readInt56(MemoryPointer mPtr) + internal + pure + returns (int56 value) + { assembly { value := mload(mPtr) } } /// @dev Reads the int64 at `mPtr` in memory. - function readInt64(MemoryPointer mPtr) internal pure returns (int64 value) { + function readInt64(MemoryPointer mPtr) + internal + pure + returns (int64 value) + { assembly { value := mload(mPtr) } } /// @dev Reads the int72 at `mPtr` in memory. - function readInt72(MemoryPointer mPtr) internal pure returns (int72 value) { + function readInt72(MemoryPointer mPtr) + internal + pure + returns (int72 value) + { assembly { value := mload(mPtr) } } /// @dev Reads the int80 at `mPtr` in memory. - function readInt80(MemoryPointer mPtr) internal pure returns (int80 value) { + function readInt80(MemoryPointer mPtr) + internal + pure + returns (int80 value) + { assembly { value := mload(mPtr) } } /// @dev Reads the int88 at `mPtr` in memory. - function readInt88(MemoryPointer mPtr) internal pure returns (int88 value) { + function readInt88(MemoryPointer mPtr) + internal + pure + returns (int88 value) + { assembly { value := mload(mPtr) } } /// @dev Reads the int96 at `mPtr` in memory. - function readInt96(MemoryPointer mPtr) internal pure returns (int96 value) { + function readInt96(MemoryPointer mPtr) + internal + pure + returns (int96 value) + { assembly { value := mload(mPtr) } } /// @dev Reads the int104 at `mPtr` in memory. - function readInt104( - MemoryPointer mPtr - ) internal pure returns (int104 value) { + function readInt104(MemoryPointer mPtr) + internal + pure + returns (int104 value) + { assembly { value := mload(mPtr) } } /// @dev Reads the int112 at `mPtr` in memory. - function readInt112( - MemoryPointer mPtr - ) internal pure returns (int112 value) { + function readInt112(MemoryPointer mPtr) + internal + pure + returns (int112 value) + { assembly { value := mload(mPtr) } } /// @dev Reads the int120 at `mPtr` in memory. - function readInt120( - MemoryPointer mPtr - ) internal pure returns (int120 value) { + function readInt120(MemoryPointer mPtr) + internal + pure + returns (int120 value) + { assembly { value := mload(mPtr) } } /// @dev Reads the int128 at `mPtr` in memory. - function readInt128( - MemoryPointer mPtr - ) internal pure returns (int128 value) { + function readInt128(MemoryPointer mPtr) + internal + pure + returns (int128 value) + { assembly { value := mload(mPtr) } } /// @dev Reads the int136 at `mPtr` in memory. - function readInt136( - MemoryPointer mPtr - ) internal pure returns (int136 value) { + function readInt136(MemoryPointer mPtr) + internal + pure + returns (int136 value) + { assembly { value := mload(mPtr) } } /// @dev Reads the int144 at `mPtr` in memory. - function readInt144( - MemoryPointer mPtr - ) internal pure returns (int144 value) { + function readInt144(MemoryPointer mPtr) + internal + pure + returns (int144 value) + { assembly { value := mload(mPtr) } } /// @dev Reads the int152 at `mPtr` in memory. - function readInt152( - MemoryPointer mPtr - ) internal pure returns (int152 value) { + function readInt152(MemoryPointer mPtr) + internal + pure + returns (int152 value) + { assembly { value := mload(mPtr) } } /// @dev Reads the int160 at `mPtr` in memory. - function readInt160( - MemoryPointer mPtr - ) internal pure returns (int160 value) { + function readInt160(MemoryPointer mPtr) + internal + pure + returns (int160 value) + { assembly { value := mload(mPtr) } } /// @dev Reads the int168 at `mPtr` in memory. - function readInt168( - MemoryPointer mPtr - ) internal pure returns (int168 value) { + function readInt168(MemoryPointer mPtr) + internal + pure + returns (int168 value) + { assembly { value := mload(mPtr) } } /// @dev Reads the int176 at `mPtr` in memory. - function readInt176( - MemoryPointer mPtr - ) internal pure returns (int176 value) { + function readInt176(MemoryPointer mPtr) + internal + pure + returns (int176 value) + { assembly { value := mload(mPtr) } } /// @dev Reads the int184 at `mPtr` in memory. - function readInt184( - MemoryPointer mPtr - ) internal pure returns (int184 value) { + function readInt184(MemoryPointer mPtr) + internal + pure + returns (int184 value) + { assembly { value := mload(mPtr) } } /// @dev Reads the int192 at `mPtr` in memory. - function readInt192( - MemoryPointer mPtr - ) internal pure returns (int192 value) { + function readInt192(MemoryPointer mPtr) + internal + pure + returns (int192 value) + { assembly { value := mload(mPtr) } } /// @dev Reads the int200 at `mPtr` in memory. - function readInt200( - MemoryPointer mPtr - ) internal pure returns (int200 value) { + function readInt200(MemoryPointer mPtr) + internal + pure + returns (int200 value) + { assembly { value := mload(mPtr) } } /// @dev Reads the int208 at `mPtr` in memory. - function readInt208( - MemoryPointer mPtr - ) internal pure returns (int208 value) { + function readInt208(MemoryPointer mPtr) + internal + pure + returns (int208 value) + { assembly { value := mload(mPtr) } } /// @dev Reads the int216 at `mPtr` in memory. - function readInt216( - MemoryPointer mPtr - ) internal pure returns (int216 value) { + function readInt216(MemoryPointer mPtr) + internal + pure + returns (int216 value) + { assembly { value := mload(mPtr) } } /// @dev Reads the int224 at `mPtr` in memory. - function readInt224( - MemoryPointer mPtr - ) internal pure returns (int224 value) { + function readInt224(MemoryPointer mPtr) + internal + pure + returns (int224 value) + { assembly { value := mload(mPtr) } } /// @dev Reads the int232 at `mPtr` in memory. - function readInt232( - MemoryPointer mPtr - ) internal pure returns (int232 value) { + function readInt232(MemoryPointer mPtr) + internal + pure + returns (int232 value) + { assembly { value := mload(mPtr) } } /// @dev Reads the int240 at `mPtr` in memory. - function readInt240( - MemoryPointer mPtr - ) internal pure returns (int240 value) { + function readInt240(MemoryPointer mPtr) + internal + pure + returns (int240 value) + { assembly { value := mload(mPtr) } } /// @dev Reads the int248 at `mPtr` in memory. - function readInt248( - MemoryPointer mPtr - ) internal pure returns (int248 value) { + function readInt248(MemoryPointer mPtr) + internal + pure + returns (int248 value) + { assembly { value := mload(mPtr) } } /// @dev Reads the int256 at `mPtr` in memory. - function readInt256( - MemoryPointer mPtr - ) internal pure returns (int256 value) { + function readInt256(MemoryPointer mPtr) + internal + pure + returns (int256 value) + { assembly { value := mload(mPtr) } diff --git a/src/interfaces/ConsiderationInterface.sol b/src/interfaces/ConsiderationInterface.sol index 3a3d07d..4db0825 100644 --- a/src/interfaces/ConsiderationInterface.sol +++ b/src/interfaces/ConsiderationInterface.sol @@ -15,7 +15,7 @@ import { /** * @title ConsiderationInterface * @author 0age - * @custom:version 1.5 + * @custom:version 1.6 * @notice Consideration is a generalized native token/ERC20/ERC721/ERC1155 * marketplace. It minimizes external calls to the greatest extent * possible and provides lightweight methods for common routes as well @@ -40,9 +40,10 @@ interface ConsiderationInterface { * @return fulfilled A boolean indicating whether the order has been * successfully fulfilled. */ - function fulfillBasicOrder( - BasicOrderParameters calldata parameters - ) external payable returns (bool fulfilled); + function fulfillBasicOrder(BasicOrderParameters calldata parameters) + external + payable + returns (bool fulfilled); /** * @notice Fulfill an order with an arbitrary number of items for offer and @@ -66,10 +67,10 @@ interface ConsiderationInterface { * @return fulfilled A boolean indicating whether the order has been * successfully fulfilled. */ - function fulfillOrder( - Order calldata order, - bytes32 fulfillerConduitKey - ) external payable returns (bool fulfilled); + function fulfillOrder(Order calldata order, bytes32 fulfillerConduitKey) + external + payable + returns (bool fulfilled); /** * @notice Fill an order, fully or partially, with an arbitrary number of @@ -346,9 +347,9 @@ interface ConsiderationInterface { * @return cancelled A boolean indicating whether the supplied orders have * been successfully cancelled. */ - function cancel( - OrderComponents[] calldata orders - ) external returns (bool cancelled); + function cancel(OrderComponents[] calldata orders) + external + returns (bool cancelled); /** * @notice Validate an arbitrary number of orders, thereby registering their @@ -365,9 +366,9 @@ interface ConsiderationInterface { * @return validated A boolean indicating whether the supplied orders have * been successfully validated. */ - function validate( - Order[] calldata orders - ) external returns (bool validated); + function validate(Order[] calldata orders) + external + returns (bool validated); /** * @notice Cancel all orders from a given offerer with a given zone in bulk @@ -407,9 +408,10 @@ interface ConsiderationInterface { * * @return orderHash The order hash. */ - function getOrderHash( - OrderComponents calldata order - ) external view returns (bytes32 orderHash); + function getOrderHash(OrderComponents calldata order) + external + view + returns (bytes32 orderHash); /** * @notice Retrieve the status of a given order by hash, including whether @@ -428,9 +430,7 @@ interface ConsiderationInterface { * @return totalSize The total size of the order that is either filled or * unfilled (i.e. the "denominator"). */ - function getOrderStatus( - bytes32 orderHash - ) + function getOrderStatus(bytes32 orderHash) external view returns ( @@ -447,9 +447,10 @@ interface ConsiderationInterface { * * @return counter The current counter. */ - function getCounter( - address offerer - ) external view returns (uint256 counter); + function getCounter(address offerer) + external + view + returns (uint256 counter); /** * @notice Retrieve configuration information for this contract. @@ -467,9 +468,10 @@ interface ConsiderationInterface { address conduitController ); - function getContractOffererNonce( - address contractOfferer - ) external view returns (uint256 nonce); + function getContractOffererNonce(address contractOfferer) + external + view + returns (uint256 nonce); /** * @notice Retrieve the name of this contract. diff --git a/src/interfaces/ReentrancyErrors.sol b/src/interfaces/ReentrancyErrors.sol index 9e3685f..e1ba94c 100644 --- a/src/interfaces/ReentrancyErrors.sol +++ b/src/interfaces/ReentrancyErrors.sol @@ -12,4 +12,22 @@ interface ReentrancyErrors { * function. */ error NoReentrantCalls(); + + /** + * @dev Revert with an error when attempting to activate the TSTORE opcode + * when it is already active. + */ + error TStoreAlreadyActivated(); + + /** + * @dev Revert with an error when attempting to activate the TSTORE opcode + * in an EVM environment that does not support it. + */ + error TStoreNotSupported(); + + /** + * @dev Revert with an error when deployment of the contract for testing + * TSTORE support fails. + */ + error TloadTestContractDeploymentFailed(); } diff --git a/src/interfaces/SeaportInterface.sol b/src/interfaces/SeaportInterface.sol index e510ed0..a9c0301 100644 --- a/src/interfaces/SeaportInterface.sol +++ b/src/interfaces/SeaportInterface.sol @@ -15,7 +15,7 @@ import { /** * @title SeaportInterface * @author 0age - * @custom:version 1.5 + * @custom:version 1.6 * @notice Seaport is a generalized native token/ERC20/ERC721/ERC1155 * marketplace. It minimizes external calls to the greatest extent * possible and provides lightweight methods for common routes as well @@ -39,9 +39,10 @@ interface SeaportInterface { * @return fulfilled A boolean indicating whether the order has been * successfully fulfilled. */ - function fulfillBasicOrder( - BasicOrderParameters calldata parameters - ) external payable returns (bool fulfilled); + function fulfillBasicOrder(BasicOrderParameters calldata parameters) + external + payable + returns (bool fulfilled); /** * @notice Fulfill an order with an arbitrary number of items for offer and @@ -65,10 +66,10 @@ interface SeaportInterface { * @return fulfilled A boolean indicating whether the order has been * successfully fulfilled. */ - function fulfillOrder( - Order calldata order, - bytes32 fulfillerConduitKey - ) external payable returns (bool fulfilled); + function fulfillOrder(Order calldata order, bytes32 fulfillerConduitKey) + external + payable + returns (bool fulfilled); /** * @notice Fill an order, fully or partially, with an arbitrary number of @@ -345,9 +346,9 @@ interface SeaportInterface { * @return cancelled A boolean indicating whether the supplied orders have * been successfully cancelled. */ - function cancel( - OrderComponents[] calldata orders - ) external returns (bool cancelled); + function cancel(OrderComponents[] calldata orders) + external + returns (bool cancelled); /** * @notice Validate an arbitrary number of orders, thereby registering their @@ -364,9 +365,9 @@ interface SeaportInterface { * @return validated A boolean indicating whether the supplied orders have * been successfully validated. */ - function validate( - Order[] calldata orders - ) external returns (bool validated); + function validate(Order[] calldata orders) + external + returns (bool validated); /** * @notice Cancel all orders from a given offerer with a given zone in bulk @@ -406,9 +407,10 @@ interface SeaportInterface { * * @return orderHash The order hash. */ - function getOrderHash( - OrderComponents calldata order - ) external view returns (bytes32 orderHash); + function getOrderHash(OrderComponents calldata order) + external + view + returns (bytes32 orderHash); /** * @notice Retrieve the status of a given order by hash, including whether @@ -427,9 +429,7 @@ interface SeaportInterface { * @return totalSize The total size of the order that is either filled or * unfilled (i.e. the "denominator"). */ - function getOrderStatus( - bytes32 orderHash - ) + function getOrderStatus(bytes32 orderHash) external view returns ( @@ -446,9 +446,10 @@ interface SeaportInterface { * * @return counter The current counter. */ - function getCounter( - address offerer - ) external view returns (uint256 counter); + function getCounter(address offerer) + external + view + returns (uint256 counter); /** * @notice Retrieve configuration information for this contract. @@ -466,9 +467,10 @@ interface SeaportInterface { address conduitController ); - function getContractOffererNonce( - address contractOfferer - ) external view returns (uint256 nonce); + function getContractOffererNonce(address contractOfferer) + external + view + returns (uint256 nonce); /** * @notice Retrieve the name of this contract. diff --git a/src/interfaces/ZoneInterface.sol b/src/interfaces/ZoneInterface.sol index 944aebb..9668b54 100644 --- a/src/interfaces/ZoneInterface.sol +++ b/src/interfaces/ZoneInterface.sol @@ -1,9 +1,9 @@ // SPDX-License-Identifier: MIT pragma solidity ^0.8.13; -import {ZoneParameters, Schema} from "../lib/ConsiderationStructs.sol"; +import { ZoneParameters, Schema } from "../lib/ConsiderationStructs.sol"; -import {IERC165} from "./IERC165.sol"; +import { IERC165 } from "./IERC165.sol"; /** * @title ZoneInterface @@ -11,7 +11,20 @@ import {IERC165} from "./IERC165.sol"; */ interface ZoneInterface is IERC165 { /** - * @dev Validates an order. + * @dev Authorizes an order before any token fulfillments from any order have been executed by Seaport. + * + * @param zoneParameters The context about the order fulfillment and any + * supplied extraData. + * + * @return authorizedOrderMagicValue The magic value that indicates a valid + * order. + */ + function authorizeOrder(ZoneParameters calldata zoneParameters) + external + returns (bytes4 authorizedOrderMagicValue); + + /** + * @dev Validates an order after all token fulfillments for all orders have been executed by Seaport. * * @param zoneParameters The context about the order fulfillment and any * supplied extraData. @@ -19,7 +32,9 @@ interface ZoneInterface is IERC165 { * @return validOrderMagicValue The magic value that indicates a valid * order. */ - function validateOrder(ZoneParameters calldata zoneParameters) external returns (bytes4 validOrderMagicValue); + function validateOrder(ZoneParameters calldata zoneParameters) + external + returns (bytes4 validOrderMagicValue); /** * @dev Returns the metadata for this zone. @@ -27,7 +42,14 @@ interface ZoneInterface is IERC165 { * @return name The name of the zone. * @return schemas The schemas that the zone implements. */ - function getSeaportMetadata() external view returns (string memory name, Schema[] memory schemas); // map to Seaport Improvement Proposal IDs + function getSeaportMetadata() + external + view + returns (string memory name, Schema[] memory schemas); // map to Seaport Improvement Proposal IDs - function supportsInterface(bytes4 interfaceId) external view override returns (bool); + function supportsInterface(bytes4 interfaceId) + external + view + override + returns (bool); } diff --git a/src/lib/ConsiderationConstants.sol b/src/lib/ConsiderationConstants.sol index e0b1276..ba85dd5 100644 --- a/src/lib/ConsiderationConstants.sol +++ b/src/lib/ConsiderationConstants.sol @@ -46,21 +46,25 @@ uint256 constant information_version_cd_offset = 0x60; uint256 constant information_domainSeparator_offset = 0x20; uint256 constant information_conduitController_offset = 0x40; uint256 constant information_versionLengthPtr = 0x63; -uint256 constant information_versionWithLength = 0x03312e35; // 1.5 +uint256 constant information_versionWithLength = 0x03312e36; // 1.6 uint256 constant information_length = 0xa0; -uint256 constant _NOT_ENTERED = 1; -uint256 constant _ENTERED = 2; -uint256 constant _ENTERED_AND_ACCEPTING_NATIVE_TOKENS = 3; +uint256 constant _REENTRANCY_GUARD_SLOT = 0x929eee14; +uint256 constant _TSTORE_SUPPORTED_SLOT = 0x54778ab1; +uint256 constant _TLOAD_TEST_PAYLOAD = 0x6002601e613d5c3d52f3; +uint256 constant _TLOAD_TEST_PAYLOAD_LENGTH = 0x0a; +uint256 constant _TLOAD_TEST_PAYLOAD_OFFSET = 0x16; +uint256 constant _NOT_ENTERED = 0; +uint256 constant _ENTERED = 1; +uint256 constant _ENTERED_AND_ACCEPTING_NATIVE_TOKENS = 2; uint256 constant Offset_fulfillAdvancedOrder_criteriaResolvers = 0x20; uint256 constant Offset_fulfillAvailableOrders_offerFulfillments = 0x20; uint256 constant Offset_fulfillAvailableOrders_considerationFulfillments = 0x40; uint256 constant Offset_fulfillAvailableAdvancedOrders_criteriaResolvers = 0x20; uint256 constant Offset_fulfillAvailableAdvancedOrders_offerFulfillments = 0x40; -uint256 constant Offset_fulfillAvailableAdvancedOrders_cnsdrationFlflmnts = ( - 0x60 -); +uint256 constant Offset_fulfillAvailableAdvancedOrders_cnsdrationFlflmnts = + (0x60); uint256 constant Offset_matchOrders_fulfillments = 0x20; @@ -82,7 +86,7 @@ uint256 constant SpentItem_size = 0x80; uint256 constant SpentItem_size_shift = 0x7; uint256 constant OfferItem_size = 0xa0; -uint256 constant OfferItem_size_with_length = 0xc0; +uint256 constant OfferItem_size_with_head_pointer = 0xc0; uint256 constant ReceivedItem_size_excluding_recipient = 0x80; uint256 constant ReceivedItem_size = 0xa0; @@ -92,7 +96,7 @@ uint256 constant ReceivedItem_recipient_offset = 0x80; uint256 constant ReceivedItem_CommonParams_size = 0x60; uint256 constant ConsiderationItem_size = 0xc0; -uint256 constant ConsiderationItem_size_with_length = 0xe0; +uint256 constant ConsiderationItem_size_with_head_pointer = 0xe0; uint256 constant ConsiderationItem_recipient_offset = 0xa0; // Store the same constant in an abbreviated format for a line length fix. @@ -109,7 +113,7 @@ uint256 constant OrderParameters_consideration_head_offset = 0x60; uint256 constant OrderParameters_startTime_offset = 0xa0; uint256 constant OrderParameters_endTime_offset = 0xc0; uint256 constant OrderParameters_zoneHash_offset = 0xe0; -// uint256 constant OrderParameters_salt_offset = 0x100; +uint256 constant OrderParameters_salt_offset = 0x100; uint256 constant OrderParameters_conduit_offset = 0x120; uint256 constant OrderParameters_counter_offset = 0x140; @@ -124,6 +128,9 @@ uint256 constant AdvancedOrder_extraData_offset = 0x80; uint256 constant OrderStatus_ValidatedAndNotCancelled = 1; uint256 constant OrderStatus_filledNumerator_offset = 0x10; uint256 constant OrderStatus_filledDenominator_offset = 0x88; +uint256 constant OrderStatus_ValidatedAndNotCancelledAndFullyFilled = ( + 0x0000000000000000000000000000010000000000000000000000000000010001 +); uint256 constant ThirtyOneBytes = 0x1f; uint256 constant OneWord = 0x20; @@ -145,19 +152,16 @@ uint256 constant DefaultFreeMemoryPointer = 0x80; uint256 constant Slot0x80 = 0x80; uint256 constant Slot0xA0 = 0xa0; -// uint256 constant BasicOrder_endAmount_cdPtr = 0x104; uint256 constant BasicOrder_common_params_size = 0xa0; uint256 constant BasicOrder_considerationHashesArray_ptr = 0x160; -uint256 constant BasicOrder_receivedItemByteMap = ( - 0x0000010102030000000000000000000000000000000000000000000000000000 -); -uint256 constant BasicOrder_offeredItemByteMap = ( - 0x0203020301010000000000000000000000000000000000000000000000000000 -); +uint256 constant BasicOrder_receivedItemByteMap = + (0x0000010102030000000000000000000000000000000000000000000000000000); +uint256 constant BasicOrder_offeredItemByteMap = + (0x0203020301010000000000000000000000000000000000000000000000000000); +uint256 constant BasicOrder_consideration_offset_from_offer = 0xa0; -bytes32 constant OrdersMatchedTopic0 = ( - 0x4b9f2d36e1b4c93de62cc077b00b1a91d84b6c31b4a14e012718dcca230689e7 -); +bytes32 constant OrdersMatchedTopic0 = + (0x4b9f2d36e1b4c93de62cc077b00b1a91d84b6c31b4a14e012718dcca230689e7); uint256 constant EIP712_Order_size = 0x180; uint256 constant EIP712_OfferItem_size = 0xc0; @@ -186,78 +190,54 @@ uint256 constant BulkOrderProof_lengthRangeAfterMask = 0x2; uint256 constant BulkOrderProof_keyShift = 0xe8; uint256 constant BulkOrderProof_keySize = 0x3; -uint256 constant BulkOrder_Typehash_Height_One = ( - 0x3ca2711d29384747a8f61d60aad3c450405f7aaff5613541dee28df2d6986d32 -); -uint256 constant BulkOrder_Typehash_Height_Two = ( - 0xbf8e29b89f29ed9b529c154a63038ffca562f8d7cd1e2545dda53a1b582dde30 -); -uint256 constant BulkOrder_Typehash_Height_Three = ( - 0x53c6f6856e13104584dd0797ca2b2779202dc2597c6066a42e0d8fe990b0024d -); -uint256 constant BulkOrder_Typehash_Height_Four = ( - 0xa02eb7ff164c884e5e2c336dc85f81c6a93329d8e9adf214b32729b894de2af1 -); -uint256 constant BulkOrder_Typehash_Height_Five = ( - 0x39c9d33c18e050dda0aeb9a8086fb16fc12d5d64536780e1da7405a800b0b9f6 -); -uint256 constant BulkOrder_Typehash_Height_Six = ( - 0x1c19f71958cdd8f081b4c31f7caf5c010b29d12950be2fa1c95070dc47e30b55 -); -uint256 constant BulkOrder_Typehash_Height_Seven = ( - 0xca74fab2fece9a1d58234a274220ad05ca096a92ef6a1ca1750b9d90c948955c -); -uint256 constant BulkOrder_Typehash_Height_Eight = ( - 0x7ff98d9d4e55d876c5cfac10b43c04039522f3ddfb0ea9bfe70c68cfb5c7cc14 -); -uint256 constant BulkOrder_Typehash_Height_Nine = ( - 0xbed7be92d41c56f9e59ac7a6272185299b815ddfabc3f25deb51fe55fe2f9e8a -); -uint256 constant BulkOrder_Typehash_Height_Ten = ( - 0xd1d97d1ef5eaa37a4ee5fbf234e6f6d64eb511eb562221cd7edfbdde0848da05 -); -uint256 constant BulkOrder_Typehash_Height_Eleven = ( - 0x896c3f349c4da741c19b37fec49ed2e44d738e775a21d9c9860a69d67a3dae53 -); -uint256 constant BulkOrder_Typehash_Height_Twelve = ( - 0xbb98d87cc12922b83759626c5f07d72266da9702d19ffad6a514c73a89002f5f -); -uint256 constant BulkOrder_Typehash_Height_Thirteen = ( - 0xe6ae19322608dd1f8a8d56aab48ed9c28be489b689f4b6c91268563efc85f20e -); -uint256 constant BulkOrder_Typehash_Height_Fourteen = ( - 0x6b5b04cbae4fcb1a9d78e7b2dfc51a36933d023cf6e347e03d517b472a852590 -); -uint256 constant BulkOrder_Typehash_Height_Fifteen = ( - 0xd1eb68309202b7106b891e109739dbbd334a1817fe5d6202c939e75cf5e35ca9 -); -uint256 constant BulkOrder_Typehash_Height_Sixteen = ( - 0x1da3eed3ecef6ebaa6e5023c057ec2c75150693fd0dac5c90f4a142f9879fde8 -); -uint256 constant BulkOrder_Typehash_Height_Seventeen = ( - 0xeee9a1392aa395c7002308119a58f2582777a75e54e0c1d5d5437bd2e8bf6222 -); -uint256 constant BulkOrder_Typehash_Height_Eighteen = ( - 0xc3939feff011e53ab8c35ca3370aad54c5df1fc2938cd62543174fa6e7d85877 -); -uint256 constant BulkOrder_Typehash_Height_Nineteen = ( - 0x0efca7572ac20f5ae84db0e2940674f7eca0a4726fa1060ffc2d18cef54b203d -); -uint256 constant BulkOrder_Typehash_Height_Twenty = ( - 0x5a4f867d3d458dabecad65f6201ceeaba0096df2d0c491cc32e6ea4e64350017 -); -uint256 constant BulkOrder_Typehash_Height_TwentyOne = ( - 0x80987079d291feebf21c2230e69add0f283cee0b8be492ca8050b4185a2ff719 -); -uint256 constant BulkOrder_Typehash_Height_TwentyTwo = ( - 0x3bd8cff538aba49a9c374c806d277181e9651624b3e31111bc0624574f8bca1d -); -uint256 constant BulkOrder_Typehash_Height_TwentyThree = ( - 0x5d6a3f098a0bc373f808c619b1bb4028208721b3c4f8d6bc8a874d659814eb76 -); -uint256 constant BulkOrder_Typehash_Height_TwentyFour = ( - 0x1d51df90cba8de7637ca3e8fe1e3511d1dc2f23487d05dbdecb781860c21ac1c -); +uint256 constant BulkOrder_Typehash_Height_One = + (0x3ca2711d29384747a8f61d60aad3c450405f7aaff5613541dee28df2d6986d32); +uint256 constant BulkOrder_Typehash_Height_Two = + (0xbf8e29b89f29ed9b529c154a63038ffca562f8d7cd1e2545dda53a1b582dde30); +uint256 constant BulkOrder_Typehash_Height_Three = + (0x53c6f6856e13104584dd0797ca2b2779202dc2597c6066a42e0d8fe990b0024d); +uint256 constant BulkOrder_Typehash_Height_Four = + (0xa02eb7ff164c884e5e2c336dc85f81c6a93329d8e9adf214b32729b894de2af1); +uint256 constant BulkOrder_Typehash_Height_Five = + (0x39c9d33c18e050dda0aeb9a8086fb16fc12d5d64536780e1da7405a800b0b9f6); +uint256 constant BulkOrder_Typehash_Height_Six = + (0x1c19f71958cdd8f081b4c31f7caf5c010b29d12950be2fa1c95070dc47e30b55); +uint256 constant BulkOrder_Typehash_Height_Seven = + (0xca74fab2fece9a1d58234a274220ad05ca096a92ef6a1ca1750b9d90c948955c); +uint256 constant BulkOrder_Typehash_Height_Eight = + (0x7ff98d9d4e55d876c5cfac10b43c04039522f3ddfb0ea9bfe70c68cfb5c7cc14); +uint256 constant BulkOrder_Typehash_Height_Nine = + (0xbed7be92d41c56f9e59ac7a6272185299b815ddfabc3f25deb51fe55fe2f9e8a); +uint256 constant BulkOrder_Typehash_Height_Ten = + (0xd1d97d1ef5eaa37a4ee5fbf234e6f6d64eb511eb562221cd7edfbdde0848da05); +uint256 constant BulkOrder_Typehash_Height_Eleven = + (0x896c3f349c4da741c19b37fec49ed2e44d738e775a21d9c9860a69d67a3dae53); +uint256 constant BulkOrder_Typehash_Height_Twelve = + (0xbb98d87cc12922b83759626c5f07d72266da9702d19ffad6a514c73a89002f5f); +uint256 constant BulkOrder_Typehash_Height_Thirteen = + (0xe6ae19322608dd1f8a8d56aab48ed9c28be489b689f4b6c91268563efc85f20e); +uint256 constant BulkOrder_Typehash_Height_Fourteen = + (0x6b5b04cbae4fcb1a9d78e7b2dfc51a36933d023cf6e347e03d517b472a852590); +uint256 constant BulkOrder_Typehash_Height_Fifteen = + (0xd1eb68309202b7106b891e109739dbbd334a1817fe5d6202c939e75cf5e35ca9); +uint256 constant BulkOrder_Typehash_Height_Sixteen = + (0x1da3eed3ecef6ebaa6e5023c057ec2c75150693fd0dac5c90f4a142f9879fde8); +uint256 constant BulkOrder_Typehash_Height_Seventeen = + (0xeee9a1392aa395c7002308119a58f2582777a75e54e0c1d5d5437bd2e8bf6222); +uint256 constant BulkOrder_Typehash_Height_Eighteen = + (0xc3939feff011e53ab8c35ca3370aad54c5df1fc2938cd62543174fa6e7d85877); +uint256 constant BulkOrder_Typehash_Height_Nineteen = + (0x0efca7572ac20f5ae84db0e2940674f7eca0a4726fa1060ffc2d18cef54b203d); +uint256 constant BulkOrder_Typehash_Height_Twenty = + (0x5a4f867d3d458dabecad65f6201ceeaba0096df2d0c491cc32e6ea4e64350017); +uint256 constant BulkOrder_Typehash_Height_TwentyOne = + (0x80987079d291feebf21c2230e69add0f283cee0b8be492ca8050b4185a2ff719); +uint256 constant BulkOrder_Typehash_Height_TwentyTwo = + (0x3bd8cff538aba49a9c374c806d277181e9651624b3e31111bc0624574f8bca1d); +uint256 constant BulkOrder_Typehash_Height_TwentyThree = + (0x5d6a3f098a0bc373f808c619b1bb4028208721b3c4f8d6bc8a874d659814eb76); +uint256 constant BulkOrder_Typehash_Height_TwentyFour = + (0x1d51df90cba8de7637ca3e8fe1e3511d1dc2f23487d05dbdecb781860c21ac1c); uint256 constant receivedItemsHash_ptr = 0x60; @@ -298,9 +278,8 @@ uint256 constant receivedItemsHash_ptr = 0x60; // Must be added to the size of the ReceivedItem array for additionalRecipients // (0xa0 * additionalRecipients.length) to calculate full size of the buffer. uint256 constant OrderFulfilled_baseSize = 0x1e0; -uint256 constant OrderFulfilled_selector = ( - 0x9d9af8e38d66c62e2c12f0225249fd9d721c54b83f48d9352c97c6cacdcb6f31 -); +uint256 constant OrderFulfilled_selector = + (0x9d9af8e38d66c62e2c12f0225249fd9d721c54b83f48d9352c97c6cacdcb6f31); // Minimum offset in memory to OrderFulfilled event data. // Must be added to the size of the EIP712 hash array for additionalRecipients @@ -309,6 +288,10 @@ uint256 constant OrderFulfilled_baseOffset = 0x180; uint256 constant OrderFulfilled_consideration_length_baseOffset = 0x2a0; uint256 constant OrderFulfilled_offer_length_baseOffset = 0x200; +uint256 constant OrderFulfilled_offer_length_baseOffset_relativeTo_OrderFulfilled_baseOffset = 0x80; +uint256 constant OrderFulfilled_offer_itemType_baseOffset_relativeTo_OrderFulfilled_baseOffset = 0xa0; +uint256 constant OrderFulfilled_offer_token_baseOffset_relativeTo_OrderFulfilled_baseOffset = 0xc0; + // Related constants used for restricted order checks on basic orders. uint256 constant OrderFulfilled_baseDataSize = 0x160; // uint256 constant ValidateOrder_offerDataOffset = 0x184; @@ -321,6 +304,40 @@ uint256 constant OrderFulfilled_offer_body_offset = 0x80; uint256 constant OrderFulfilled_consideration_head_offset = 0x60; uint256 constant OrderFulfilled_consideration_body_offset = 0x120; +/* + * 3 memory slots/words for `authorizeOrder` and `validateOrder` calldata + * to be used for tails of extra data (length 0) and order hashes (length 1) + */ +uint256 constant OrderFulfilled_post_memory_region_reservedBytes = 0x60; + +/* + * OrderFulfilled_offer_length_baseOffset - 12 * 0x20 + * we back up 12 words from where the `OrderFulfilled`'s data + * for spent items start to be rewritten for `authorizeOrder` + * and `validateOrder`. Let the reference pointer be `ptr` + * pointing to the `OrderFulfilled`'s spent item array's length memory + * position then we would have: + * + * ptr - 0x0180 : zero-padded calldata selector + * ptr - 0x0160 : ZoneParameter's struct head (0x20) + * ptr - 0x0140 : order hash + * ptr - 0x0120 : fulfiller (msg.sender) + * ptr - 0x0100 : offerer + * ptr - 0x00e0 : spent items' head + * ptr - 0x00c0 : received items' head + * ptr - 0x00a0 : extra data / context head + * ptr - 0x0080 : order hashes head + * ptr - 0x0060 : start time + * ptr - 0x0040 : end time + * ptr - 0x0020 : zone hash + * ptr - 0x0000 : offer.length (1) + * ... + * + * Note that the padded calldata selector will be at minimum at the + * 0x80 memory slot. + */ +uint256 constant authorizeOrder_calldata_baseOffset = OrderFulfilled_offer_length_baseOffset - 0x180; + // BasicOrderParameters uint256 constant BasicOrder_parameters_cdPtr = 0x04; uint256 constant BasicOrder_considerationToken_cdPtr = 0x24; @@ -331,6 +348,7 @@ uint256 constant BasicOrder_zone_cdPtr = 0xa4; uint256 constant BasicOrder_offerToken_cdPtr = 0xc4; uint256 constant BasicOrder_offerIdentifier_cdPtr = 0xe4; uint256 constant BasicOrder_offerAmount_cdPtr = 0x104; +uint256 constant BasicOrder_basicOrderParameters_cd_offset = 0x24; uint256 constant BasicOrder_basicOrderType_cdPtr = 0x124; uint256 constant BasicOrder_startTime_cdPtr = 0x144; uint256 constant BasicOrder_endTime_cdPtr = 0x164; @@ -342,6 +360,7 @@ uint256 constant BasicOrder_totalOriginalAdditionalRecipients_cdPtr = 0x204; uint256 constant BasicOrder_additionalRecipients_head_cdPtr = 0x224; uint256 constant BasicOrder_signature_cdPtr = 0x244; uint256 constant BasicOrder_additionalRecipients_length_cdPtr = 0x264; +uint256 constant BasicOrder_addlRecipients_length_cdPtr = 0x264; uint256 constant BasicOrder_additionalRecipients_data_cdPtr = 0x284; uint256 constant BasicOrder_parameters_ptr = 0x20; uint256 constant BasicOrder_basicOrderType_range = 0x18; // 24 values @@ -419,27 +438,23 @@ uint256 constant ContractOrder_orderHash_offerer_shift = 0x60; uint256 constant Counter_blockhash_shift = 0x80; // Signature-related -bytes32 constant EIP2098_allButHighestBitMask = ( - 0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -); -bytes32 constant ECDSA_twentySeventhAndTwentyEighthBytesSet = ( - 0x0000000000000000000000000000000000000000000000000000000101000000 -); +bytes32 constant EIP2098_allButHighestBitMask = + (0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff); +bytes32 constant ECDSA_twentySeventhAndTwentyEighthBytesSet = + (0x0000000000000000000000000000000000000000000000000000000101000000); uint256 constant ECDSA_MaxLength = 65; uint256 constant ECDSA_signature_s_offset = 0x40; uint256 constant ECDSA_signature_v_offset = 0x60; -bytes32 constant EIP1271_isValidSignature_selector = ( - 0x1626ba7e00000000000000000000000000000000000000000000000000000000 -); +bytes32 constant EIP1271_isValidSignature_selector = + (0x1626ba7e00000000000000000000000000000000000000000000000000000000); uint256 constant EIP1271_isValidSignature_digest_negativeOffset = 0x40; uint256 constant EIP1271_isValidSignature_selector_negativeOffset = 0x44; uint256 constant EIP1271_isValidSignature_calldata_baseLength = 0x64; uint256 constant EIP1271_isValidSignature_signature_head_offset = 0x40; -uint256 constant EIP_712_PREFIX = ( - 0x1901000000000000000000000000000000000000000000000000000000000000 -); +uint256 constant EIP_712_PREFIX = + (0x1901000000000000000000000000000000000000000000000000000000000000); uint256 constant ExtraGasBuffer = 0x20; uint256 constant CostPerWord = 0x3; @@ -448,22 +463,17 @@ uint256 constant MemoryExpansionCoefficientShift = 0x9; uint256 constant Create2AddressDerivation_ptr = 0x0b; uint256 constant Create2AddressDerivation_length = 0x55; -uint256 constant MaskOverByteTwelve = ( - 0x0000000000000000000000ff0000000000000000000000000000000000000000 -); -uint256 constant MaskOverLastTwentyBytes = ( - 0x000000000000000000000000ffffffffffffffffffffffffffffffffffffffff -); -uint256 constant AddressDirtyUpperBitThreshold = ( - 0x0000000000000000000000010000000000000000000000000000000000000000 -); -uint256 constant MaskOverFirstFourBytes = ( - 0xffffffff00000000000000000000000000000000000000000000000000000000 -); +uint256 constant MaskOverByteTwelve = + (0x0000000000000000000000ff0000000000000000000000000000000000000000); +uint256 constant MaskOverLastTwentyBytes = + (0x000000000000000000000000ffffffffffffffffffffffffffffffffffffffff); +uint256 constant AddressDirtyUpperBitThreshold = + (0x0000000000000000000000010000000000000000000000000000000000000000); +uint256 constant MaskOverFirstFourBytes = + (0xffffffff00000000000000000000000000000000000000000000000000000000); -uint256 constant Conduit_execute_signature = ( - 0x4ce34aa200000000000000000000000000000000000000000000000000000000 -); +uint256 constant Conduit_execute_signature = + (0x4ce34aa200000000000000000000000000000000000000000000000000000000); uint256 constant MaxUint8 = 0xff; uint256 constant MaxUint120 = 0xffffffffffffffffffffffffffffff; @@ -503,15 +513,13 @@ uint256 constant Ecrecover_args_size = 0x80; uint256 constant Signature_lower_v = 27; // Bitmask that only gives a non-zero value if masked with a non-match selector. -uint256 constant NonMatchSelector_MagicMask = ( - 0x4000000000000000000000000000000000000000000000000000000000 -); +uint256 constant NonMatchSelector_MagicMask = + (0x4000000000000000000000000000000000000000000000000000000000); // First bit indicates that a NATIVE offer items has been used and the 231st bit // indicates that a non match selector has been called. -uint256 constant NonMatchSelector_InvalidErrorValue = ( - 0x4000000000000000000000000000000000000000000000000000000001 -); +uint256 constant NonMatchSelector_InvalidErrorValue = + (0x4000000000000000000000000000000000000000000000000000000001); /** * @dev Selector and offsets for generateOrder @@ -530,7 +538,7 @@ uint256 constant generateOrder_minimumReceived_head_offset = 0x20; uint256 constant generateOrder_maximumSpent_head_offset = 0x40; uint256 constant generateOrder_context_head_offset = 0x60; uint256 constant generateOrder_base_tail_offset = 0x80; -uint256 constant generateOrder_maximum_returndatasize = 0xffff; +uint256 constant generateOrder_maximum_returned_array_length = 0xffff; uint256 constant ratifyOrder_selector = 0xf4dd92ce; uint256 constant ratifyOrder_selector_offset = 0x1c; @@ -547,6 +555,11 @@ uint256 constant validateOrder_selector_offset = 0x1c; uint256 constant validateOrder_head_offset = 0x04; uint256 constant validateOrder_zoneParameters_offset = 0x20; +uint256 constant authorizeOrder_selector = 0x01e4d72a; +uint256 constant authorizeOrder_selector_offset = 0x1c; +uint256 constant authorizeOrder_head_offset = 0x04; +uint256 constant authorizeOrder_zoneParameters_offset = 0x20; + // uint256 constant ZoneParameters_orderHash_offset = 0x00; uint256 constant ZoneParameters_fulfiller_offset = 0x20; uint256 constant ZoneParameters_offerer_offset = 0x40; @@ -559,13 +572,12 @@ uint256 constant ZoneParameters_endTime_offset = 0x100; uint256 constant ZoneParameters_zoneHash_offset = 0x120; uint256 constant ZoneParameters_base_tail_offset = 0x140; uint256 constant ZoneParameters_selectorAndPointer_length = 0x24; -uint256 constant ZoneParameters_basicOrderFixedElements_length = 0x64; +uint256 constant ZoneParameters_basicOrderFixedElements_length = 0x44; // ConsiderationDecoder Constants uint256 constant OrderParameters_head_size = 0x0160; -uint256 constant OrderParameters_totalOriginalConsiderationItems_offset = ( - 0x0140 -); +uint256 constant OrderParameters_totalOriginalConsiderationItems_offset = + (0x0140); uint256 constant AdvancedOrderPlusOrderParameters_head_size = 0x0200; uint256 constant Order_signature_offset = 0x20; diff --git a/src/lib/ConsiderationErrorConstants.sol b/src/lib/ConsiderationErrorConstants.sol index 62615a6..f2bee64 100644 --- a/src/lib/ConsiderationErrorConstants.sol +++ b/src/lib/ConsiderationErrorConstants.sol @@ -105,9 +105,7 @@ uint256 constant UnresolvedOfferCriteria_error_length = 0x44; */ uint256 constant UnresolvedConsiderationCriteria_error_selector = 0xa8930e9a; uint256 constant UnresolvedConsiderationCriteria_error_orderIndex_ptr = 0x20; -uint256 constant UnresolvedConsiderationCriteria_error_considerationIdx_ptr = ( - 0x40 -); +uint256 constant UnresolvedConsiderationCriteria_error_itemIndex_ptr = 0x40; uint256 constant UnresolvedConsiderationCriteria_error_length = 0x44; /* diff --git a/src/lib/ConsiderationErrors.sol b/src/lib/ConsiderationErrors.sol index 7c24eae..c61c71b 100644 --- a/src/lib/ConsiderationErrors.sol +++ b/src/lib/ConsiderationErrors.sol @@ -74,7 +74,6 @@ import { OrderPartiallyFilled_error_selector, PartialFillsNotEnabledForOrder_error_length, PartialFillsNotEnabledForOrder_error_selector, - UnresolvedConsiderationCriteria_error_considerationIdx_ptr, UnresolvedConsiderationCriteria_error_length, UnresolvedConsiderationCriteria_error_orderIndex_ptr, UnresolvedConsiderationCriteria_error_selector, @@ -125,8 +124,7 @@ function _revertConsiderationNotMet( // Store arguments. mstore(ConsiderationNotMet_error_orderIndex_ptr, orderIndex) mstore( - ConsiderationNotMet_error_considerationIndex_ptr, - considerationIndex + ConsiderationNotMet_error_considerationIndex_ptr, considerationIndex ) mstore(ConsiderationNotMet_error_shortfallAmount_ptr, shortfallAmount) @@ -167,8 +165,7 @@ function _revertInsufficientNativeTokensSupplied() pure { // revert(abi.encodeWithSignature("InsufficientNativeTokensSupplied()")) revert( - Error_selector_offset, - InsufficientNativeTokensSupplied_error_length + Error_selector_offset, InsufficientNativeTokensSupplied_error_length ) } } @@ -380,38 +377,6 @@ function _revertInvalidTime(uint256 startTime, uint256 endTime) pure { } } -/** - * @dev Reverts execution with a - * "MismatchedFulfillmentOfferAndConsiderationComponents" error message. - * - * @param fulfillmentIndex The index of the fulfillment that caused the - * error. - */ -function _revertMismatchedFulfillmentOfferAndConsiderationComponents( - uint256 fulfillmentIndex -) pure { - assembly { - // Store left-padded selector with push4 (reduces bytecode), - // mem[28:32] = selector - mstore(0, MismatchedOfferAndConsiderationComponents_error_selector) - - // Store fulfillment index argument. - mstore( - MismatchedOfferAndConsiderationComponents_error_idx_ptr, - fulfillmentIndex - ) - - // revert(abi.encodeWithSignature( - // "MismatchedFulfillmentOfferAndConsiderationComponents(uint256)", - // fulfillmentIndex - // )) - revert( - Error_selector_offset, - MismatchedOfferAndConsiderationComponents_error_length - ) - } -} - /** * @dev Reverts execution with a "MissingFulfillmentComponentOnAggregation" * error message. @@ -488,26 +453,6 @@ function _revertNoSpecifiedOrdersAvailable() pure { } } -/** - * @dev Reverts execution with a "OfferAndConsiderationRequiredOnFulfillment" - * error message. - */ -function _revertOfferAndConsiderationRequiredOnFulfillment() pure { - assembly { - // Store left-padded selector with push4 (reduces bytecode), - // mem[28:32] = selector - mstore(0, OfferAndConsiderationRequiredOnFulfillment_error_selector) - - // revert(abi.encodeWithSignature( - // "OfferAndConsiderationRequiredOnFulfillment()" - // )) - revert( - Error_selector_offset, - OfferAndConsiderationRequiredOnFulfillment_error_length - ) - } -} - /** * @dev Reverts execution with an "OrderAlreadyFilled" error message. * @@ -552,8 +497,7 @@ function _revertOrderCriteriaResolverOutOfRange(Side side) pure { // side // )) revert( - Error_selector_offset, - OrderCriteriaResolverOutOfRange_error_length + Error_selector_offset, OrderCriteriaResolverOutOfRange_error_length ) } } @@ -614,69 +558,11 @@ function _revertPartialFillsNotEnabledForOrder() pure { // revert(abi.encodeWithSignature("PartialFillsNotEnabledForOrder()")) revert( - Error_selector_offset, - PartialFillsNotEnabledForOrder_error_length - ) - } -} - -/** - * @dev Reverts execution with an "UnresolvedConsiderationCriteria" error - * message. - */ -function _revertUnresolvedConsiderationCriteria( - uint256 orderIndex, - uint256 considerationIndex -) pure { - assembly { - // Store left-padded selector with push4 (reduces bytecode), - // mem[28:32] = selector - mstore(0, UnresolvedConsiderationCriteria_error_selector) - - // Store orderIndex and considerationIndex arguments. - mstore(UnresolvedConsiderationCriteria_error_orderIndex_ptr, orderIndex) - mstore( - UnresolvedConsiderationCriteria_error_considerationIdx_ptr, - considerationIndex - ) - - // revert(abi.encodeWithSignature( - // "UnresolvedConsiderationCriteria(uint256, uint256)", - // orderIndex, - // considerationIndex - // )) - revert( - Error_selector_offset, - UnresolvedConsiderationCriteria_error_length + Error_selector_offset, PartialFillsNotEnabledForOrder_error_length ) } } -/** - * @dev Reverts execution with an "UnresolvedOfferCriteria" error message. - */ -function _revertUnresolvedOfferCriteria( - uint256 orderIndex, - uint256 offerIndex -) pure { - assembly { - // Store left-padded selector with push4 (reduces bytecode), - // mem[28:32] = selector - mstore(0, UnresolvedOfferCriteria_error_selector) - - // Store arguments. - mstore(UnresolvedOfferCriteria_error_orderIndex_ptr, orderIndex) - mstore(UnresolvedOfferCriteria_error_offerIndex_ptr, offerIndex) - - // revert(abi.encodeWithSignature( - // "UnresolvedOfferCriteria(uint256, uint256)", - // orderIndex, - // offerIndex - // )) - revert(Error_selector_offset, UnresolvedOfferCriteria_error_length) - } -} - /** * @dev Reverts execution with an "UnusedItemParameters" error message. */