diff --git a/src/lib/FunctionCastLib.sol b/src/lib/FunctionCastLib.sol index 30f32c2..0f2faed 100644 --- a/src/lib/FunctionCastLib.sol +++ b/src/lib/FunctionCastLib.sol @@ -127,7 +127,7 @@ library FunctionCastLib { * @notice Function cast to provide a SplitBatchClaim calldata struct while * treating it as a uint256 representing a calldata pointer location. * @param fnIn Function pointer to ClaimHashLib._toGenericMessageHash - * @return fnOut Modified function for ClaimHashLib._toBasicMessageHash(SplitBatchClaim calldata) + * @return fnOut Modified function for ClaimHashLib.toClaimHash(SplitBatchClaim calldata) */ function usingSplitBatchClaim(function (uint256, uint256, function(uint256, uint256) internal view returns (bytes32)) internal view returns (bytes32) fnIn) internal @@ -175,7 +175,7 @@ library FunctionCastLib { * @notice Function cast to provide a BatchMultichainClaim calldata struct while * treating it as a uint256 representing a calldata pointer location. * @param fnIn Function pointer to ClaimHashLib._toGenericMessageHash - * @return fnOut Modified function for ClaimHashLib._toBatchMultichainMessageHash(BatchMultichainClaim calldata) + * @return fnOut Modified function for ClaimHashLib.toClaimHash(BatchMultichainClaim calldata) */ function usingBatchMultichainClaim(function (uint256, uint256, function(uint256, uint256) internal view returns (bytes32)) internal view returns (bytes32) fnIn) internal @@ -191,7 +191,7 @@ library FunctionCastLib { * @notice Function cast to provide a SplitBatchMultichainClaim calldata struct while * treating it as a uint256 representing a calldata pointer location. * @param fnIn Function pointer to ClaimHashLib._toGenericMessageHash - * @return fnOut Modified function for ClaimHashLib._toBasicMessageHash(SplitBatchMultichainClaim calldata) + * @return fnOut Modified function for ClaimHashLib.toClaimHash(SplitBatchMultichainClaim calldata) */ function usingSplitBatchMultichainClaim(function (uint256, uint256, function(uint256, uint256) internal view returns (bytes32)) internal view returns (bytes32) fnIn) internal @@ -207,7 +207,7 @@ library FunctionCastLib { * @notice Function cast to provide an ExogenousMultichainClaim calldata struct while * treating it as a uint256 representing a calldata pointer location. * @param fnIn Function pointer to ClaimHashLib._toGenericMessageHash - * @return fnOut Modified function for ClaimHashLib._toExogenousMultichainMessageHash(ExogenousMultichainClaim calldata) + * @return fnOut Modified function for ClaimHashLib.toClaimHash(ExogenousMultichainClaim calldata) */ function usingExogenousMultichainClaim(function (uint256, uint256, function(uint256, uint256) internal view returns (bytes32)) internal view returns (bytes32) fnIn) internal @@ -235,6 +235,12 @@ library FunctionCastLib { } } + /** + * @notice Function cast to provide an ExogenousBatchMultichainClaim calldata struct while + * treating it as a uint256 representing a calldata pointer location. + * @param fnIn Function pointer to ClaimHashLib._toGenericMessageHash + * @return fnOut Modified function for ClaimHashLib.toClaimHash(ExogenousBatchMultichainClaim calldata) + */ function usingExogenousBatchMultichainClaim(function (uint256, uint256, function(uint256, uint256) internal view returns (bytes32)) internal view returns (bytes32) fnIn) internal pure @@ -245,6 +251,12 @@ library FunctionCastLib { } } + /** + * @notice Function cast to provide an ExogenousSplitBatchMultichainClaim calldata struct while + * treating it as a uint256 representing a calldata pointer location. + * @param fnIn Function pointer to ClaimHashLib._toGenericMessageHash + * @return fnOut Modified function for ClaimHashLib.toClaimHash(ExogenousSplitBatchMultichainClaim calldata) + */ function usingExogenousSplitBatchMultichainClaim(function (uint256, uint256, function(uint256, uint256) internal view returns (bytes32)) internal view returns (bytes32) fnIn) internal pure @@ -259,7 +271,7 @@ library FunctionCastLib { * @notice Function cast to provide a QualifiedClaim calldata struct while * treating it as a uint256 representing a calldata pointer location. * @param fnIn Function pointer to ClaimHashLib._toGenericMessageHashWithQualificationHash - * @return fnOut Modified function for ClaimHashLib._toQualifiedMessageHash(QualifiedClaim calldata) + * @return fnOut Modified function for ClaimHashLib.toMessageHashes(QualifiedClaim calldata) */ function usingQualifiedClaim(function (uint256, uint256, function(uint256, uint256) internal view returns (bytes32)) internal view returns (bytes32, bytes32) fnIn) internal @@ -287,6 +299,12 @@ library FunctionCastLib { } } + /** + * @notice Function cast to provide a QualifiedBatchClaim calldata struct while + * treating it as a uint256 representing a calldata pointer location. + * @param fnIn Function pointer to ClaimHashLib._toGenericMessageHashWithQualificationHash + * @return fnOut Modified function for ClaimHashLib.toMessageHashes(QualifiedBatchClaim calldata) + */ function usingQualifiedBatchClaim(function (uint256, uint256, function(uint256, uint256) internal view returns (bytes32)) internal view returns (bytes32, bytes32) fnIn) internal pure @@ -297,6 +315,12 @@ library FunctionCastLib { } } + /** + * @notice Function cast to provide a QualifiedSplitBatchClaim calldata struct while + * treating it as a uint256 representing a calldata pointer location. + * @param fnIn Function pointer to ClaimHashLib._toGenericMessageHashWithQualificationHash + * @return fnOut Modified function for ClaimHashLib.toMessageHashes(QualifiedSplitBatchClaim calldata) + */ function usingQualifiedSplitBatchClaim(function (uint256, uint256, function(uint256, uint256) internal view returns (bytes32)) internal view returns (bytes32, bytes32) fnIn) internal pure @@ -311,7 +335,7 @@ library FunctionCastLib { * @notice Function cast to provide a QualifiedMultichainClaim calldata struct while * treating it as a uint256 representing a calldata pointer location. * @param fnIn Function pointer to ClaimHashLib._toGenericMessageHashWithQualificationHash - * @return fnOut Modified function for ClaimHashLib._toQualifiedMultichainMessageHash(QualifiedMultichainClaim calldata) + * @return fnOut Modified function for ClaimHashLib.toMessageHashes(QualifiedMultichainClaim calldata) */ function usingQualifiedMultichainClaim(function (uint256, uint256, function(uint256, uint256) internal view returns (bytes32)) internal view returns (bytes32, bytes32) fnIn) internal @@ -339,6 +363,12 @@ library FunctionCastLib { } } + /** + * @notice Function cast to provide a QualifiedBatchMultichainClaim calldata struct while + * treating it as a uint256 representing a calldata pointer location. + * @param fnIn Function pointer to ClaimHashLib._toGenericMessageHashWithQualificationHash + * @return fnOut Modified function for ClaimHashLib.toMessageHashes(QualifiedBatchMultichainClaim calldata) + */ function usingQualifiedBatchMultichainClaim(function (uint256, uint256, function(uint256, uint256) internal view returns (bytes32)) internal view returns (bytes32, bytes32) fnIn) internal pure @@ -349,6 +379,12 @@ library FunctionCastLib { } } + /** + * @notice Function cast to provide a QualifiedSplitBatchMultichainClaim calldata struct while + * treating it as a uint256 representing a calldata pointer location. + * @param fnIn Function pointer to ClaimHashLib._toGenericMessageHashWithQualificationHash + * @return fnOut Modified function for ClaimHashLib.toMessageHashes(QualifiedSplitBatchMultichainClaim calldata) + */ function usingQualifiedSplitBatchMultichainClaim(function (uint256, uint256, function(uint256, uint256) internal view returns (bytes32)) internal view returns (bytes32, bytes32) fnIn) internal pure @@ -363,7 +399,7 @@ library FunctionCastLib { * @notice Function cast to provide an ExogenousQualifiedMultichainClaim calldata struct * while treating it as a uint256 representing a calldata pointer location. * @param fnIn Function pointer to ClaimHashLib._toGenericMessageHashWithQualificationHash - * @return fnOut Modified function for ClaimHashLib._toExogenousQualifiedMultichainMessageHash(ExogenousQualifiedMultichainClaim calldata) + * @return fnOut Modified function for ClaimHashLib.toMessageHashes(ExogenousQualifiedMultichainClaim calldata) */ function usingExogenousQualifiedMultichainClaim(function (uint256, uint256, function(uint256, uint256) internal view returns (bytes32)) internal view returns (bytes32, bytes32) fnIn) internal @@ -391,6 +427,12 @@ library FunctionCastLib { } } + /** + * @notice Function cast to provide an ExogenousQualifiedBatchMultichainClaim calldata struct while + * treating it as a uint256 representing a calldata pointer location. + * @param fnIn Function pointer to ClaimHashLib._toGenericMessageHashWithQualificationHash + * @return fnOut Modified function for ClaimHashLib.toMessageHashes(ExogenousQualifiedBatchMultichainClaim calldata) + */ function usingExogenousQualifiedBatchMultichainClaim(function (uint256, uint256, function(uint256, uint256) internal view returns (bytes32)) internal view returns (bytes32, bytes32) fnIn) internal pure @@ -401,6 +443,12 @@ library FunctionCastLib { } } + /** + * @notice Function cast to provide an ExogenousQualifiedSplitBatchMultichainClaim calldata struct while + * treating it as a uint256 representing a calldata pointer location. + * @param fnIn Function pointer to ClaimHashLib._toGenericMessageHashWithQualificationHash + * @return fnOut Modified function for ClaimHashLib.toMessageHashes(ExogenousQualifiedSplitBatchMultichainClaim calldata) + */ function usingExogenousQualifiedSplitBatchMultichainClaim(function (uint256, uint256, function(uint256, uint256) internal view returns (bytes32)) internal view returns (bytes32, bytes32) fnIn) internal pure @@ -415,7 +463,7 @@ library FunctionCastLib { * @notice Function cast to provide a MultichainClaimWithWitness calldata struct while * treating it as a uint256 representing a calldata pointer location with witness data. * @param fnIn Function pointer to ClaimHashLib._toGenericMultichainClaimWithWitnessMessageHash - * @return fnOut Modified function for ClaimHashLib._toMultichainClaimWithWitnessMessageHash(MultichainClaimWithWitness calldata) + * @return fnOut Modified function for ClaimHashLib.toMessageHashes(MultichainClaimWithWitness calldata) */ function usingMultichainClaimWithWitness( function (uint256, uint256, function (uint256, uint256, bytes32, bytes32, uint256) internal view returns (bytes32)) internal view returns (bytes32, bytes32) fnIn @@ -435,7 +483,7 @@ library FunctionCastLib { * @notice Function cast to provide a SplitMultichainClaimWithWitness calldata struct while * treating it as a MultichainClaimWithWitness calldata struct. * @param fnIn Function pointer to ClaimHashLib._toMultichainClaimWithWitnessMessageHash(MultichainClaimWithWitness calldata) - * @return fnOut Modified function for ClaimHashLib.toMessageHashes(SplitMultichainClaimWithWitness calldata) + * @return fnOut Modified function for ClaimHashLib.toMessageHashes(MultichainClaimWithWitness calldata) */ function usingSplitMultichainClaimWithWitness(function (MultichainClaimWithWitness calldata) internal view returns (bytes32, bytes32) fnIn) internal @@ -451,7 +499,7 @@ library FunctionCastLib { * @notice Function cast to provide a BatchMultichainClaimWithWitness calldata struct while * treating it as a uint256 representing a calldata pointer location with witness data. * @param fnIn Function pointer to ClaimHashLib._toGenericMultichainClaimWithWitnessMessageHash - * @return fnOut Modified function for ClaimHashLib._toBatchMultichainClaimWithWitnessMessageHash(BatchMultichainClaimWithWitness calldata) + * @return fnOut Modified function for ClaimHashLib.toMessageHashes(BatchMultichainClaimWithWitness calldata) */ function usingBatchMultichainClaimWithWitness( function (uint256, uint256, function (uint256, uint256, bytes32, bytes32, uint256) internal view returns (bytes32)) internal view returns (bytes32, bytes32) fnIn @@ -471,7 +519,7 @@ library FunctionCastLib { * @notice Function cast to provide a SplitBatchMultichainClaimWithWitness calldata struct * while treating it as a uint256 representing a calldata pointer location with witness data. * @param fnIn Function pointer to ClaimHashLib._toGenericMultichainClaimWithWitnessMessageHash - * @return fnOut Modified function for ClaimHashLib._toSplitBatchMultichainClaimWithWitnessMessageHash(SplitBatchMultichainClaimWithWitness calldata) + * @return fnOut Modified function for ClaimHashLib.toMessageHashes(SplitBatchMultichainClaimWithWitness calldata) */ function usingSplitBatchMultichainClaimWithWitness( function (uint256, uint256, function (uint256, uint256, bytes32, bytes32, uint256) internal view returns (bytes32)) internal view returns (bytes32, bytes32) fnIn @@ -492,7 +540,7 @@ library FunctionCastLib { * @notice Function cast to provide an ExogenousMultichainClaimWithWitness calldata struct * while treating it as a uint256 representing a calldata pointer location with witness data. * @param fnIn Function pointer to ClaimHashLib._toGenericMultichainClaimWithWitnessMessageHash - * @return fnOut Modified function for ClaimHashLib._toExogenousMultichainClaimWithWitnessMessageHash(ExogenousMultichainClaimWithWitness calldata) + * @return fnOut Modified function for ClaimHashLib.toMessageHashes(ExogenousMultichainClaimWithWitness calldata) */ function usingExogenousMultichainClaimWithWitness( function (uint256, uint256, function (uint256, uint256, bytes32, bytes32, uint256) internal view returns (bytes32)) internal view returns (bytes32, bytes32) fnIn @@ -529,7 +577,7 @@ library FunctionCastLib { * @notice Function cast to provide an ExogenousBatchMultichainClaimWithWitness calldata * struct while treating it as a uint256 representing a calldata pointer location with witness data. * @param fnIn Function pointer to ClaimHashLib._toGenericMultichainClaimWithWitnessMessageHash - * @return fnOut Modified function for ClaimHashLib._toExogenousBatchMultichainClaimWithWitnessMessageHash(ExogenousBatchMultichainClaimWithWitness calldata) + * @return fnOut Modified function for ClaimHashLib.toMessageHashes(ExogenousBatchMultichainClaimWithWitness calldata) */ function usingExogenousBatchMultichainClaimWithWitness( function (uint256, uint256, function (uint256, uint256, bytes32, bytes32, uint256) internal view returns (bytes32)) internal view returns (bytes32, bytes32) fnIn @@ -550,7 +598,7 @@ library FunctionCastLib { * @notice Function cast to provide an ExogenousSplitBatchMultichainClaimWithWitness calldata * struct while treating it as a uint256 representing a calldata pointer location with witness data. * @param fnIn Function pointer to ClaimHashLib._toGenericMultichainClaimWithWitnessMessageHash - * @return fnOut Modified function for ClaimHashLib._toExogenousSplitBatchMultichainClaimWithWitnessMessageHash(ExogenousSplitBatchMultichainClaimWithWitness calldata) + * @return fnOut Modified function for ClaimHashLib.toMessageHashes(ExogenousSplitBatchMultichainClaimWithWitness calldata) */ function usingExogenousSplitBatchMultichainClaimWithWitness( function (uint256, uint256, function (uint256, uint256, bytes32, bytes32, uint256) internal view returns (bytes32)) internal view returns (bytes32, bytes32) fnIn @@ -571,7 +619,7 @@ library FunctionCastLib { * @notice Function cast to provide a QualifiedClaimWithWitness calldata struct while * treating it as a uint256 representing a calldata pointer location with witness data. * @param fnIn Function pointer to ClaimHashLib._toGenericQualifiedClaimWithWitnessMessageHash - * @return fnOut Modified function for ClaimHashLib._toQualifiedClaimWithWitnessMessageHash(QualifiedClaimWithWitness calldata) + * @return fnOut Modified function for ClaimHashLib.toMessageHashes(QualifiedClaimWithWitness calldata) */ function usingQualifiedClaimWithWitness(function (uint256, uint256, function(uint256, uint256) internal view returns (bytes32, bytes32)) internal view returns (bytes32, bytes32, bytes32) fnIn) internal @@ -603,7 +651,7 @@ library FunctionCastLib { * @notice Function cast to provide a QualifiedBatchClaimWithWitness calldata struct while * treating it as a uint256 representing a calldata pointer location with witness data. * @param fnIn Function pointer to ClaimHashLib._toGenericQualifiedClaimWithWitnessMessageHash - * @return fnOut Modified function for ClaimHashLib._toQualifiedBatchClaimWithWitnessMessageHash(QualifiedBatchClaimWithWitness calldata) + * @return fnOut Modified function for ClaimHashLib.toMessageHashes(QualifiedBatchClaimWithWitness calldata) */ function usingQualifiedBatchClaimWithWitness( function (uint256, uint256, function(uint256, uint256) internal view returns (bytes32, bytes32)) internal view returns (bytes32, bytes32, bytes32) fnIn @@ -623,7 +671,7 @@ library FunctionCastLib { * @notice Function cast to provide a QualifiedSplitBatchClaimWithWitness calldata struct * while treating it as a uint256 representing a calldata pointer location with witness data. * @param fnIn Function pointer to ClaimHashLib._toGenericQualifiedClaimWithWitnessMessageHash - * @return fnOut Modified function for ClaimHashLib._toQualifiedSplitBatchClaimWithWitnessMessageHash(QualifiedSplitBatchClaimWithWitness calldata) + * @return fnOut Modified function for ClaimHashLib.toMessageHashes(QualifiedSplitBatchClaimWithWitness calldata) */ function usingQualifiedSplitBatchClaimWithWitness( function (uint256, uint256, function(uint256, uint256) internal view returns (bytes32, bytes32)) internal view returns (bytes32, bytes32, bytes32) fnIn @@ -639,6 +687,12 @@ library FunctionCastLib { } } + /** + * @notice Function cast to provide a QualifiedMultichainClaimWithWitness calldata struct + * while treating it as a uint256 representing a calldata pointer location with witness data. + * @param fnIn Function pointer to ClaimHashLib._toGenericQualifiedMultichainClaimWithWitnessMessageHash + * @return fnOut Modified function for ClaimHashLib.toMessageHashes(QualifiedMultichainClaimWithWitness calldata) + */ function usingQualifiedMultichainClaimWithWitness( function (uint256, uint256, function (uint256, uint256, bytes32, bytes32, uint256) internal view returns (bytes32)) internal view returns (bytes32, bytes32, bytes32) fnIn ) @@ -654,6 +708,12 @@ library FunctionCastLib { } } + /** + * @notice Function cast to provide a QualifiedSplitMultichainClaimWithWitness calldata struct + * while treating it as a QualifiedMultichainClaimWithWitness calldata struct. + * @param fnIn Function pointer to ClaimHashLib._toQualifiedMultichainClaimWithWitnessMessageHash(QualifiedMultichainClaimWithWitness calldata) + * @return fnOut Modified function for ClaimHashLib.toMessageHashes(QualifiedSplitMultichainClaimWithWitness calldata) + */ function usingQualifiedSplitMultichainClaimWithWitness(function (QualifiedMultichainClaimWithWitness calldata) internal view returns (bytes32, bytes32, bytes32) fnIn) internal pure @@ -664,6 +724,12 @@ library FunctionCastLib { } } + /** + * @notice Function cast to provide a QualifiedBatchMultichainClaimWithWitness calldata struct + * while treating it as a uint256 representing a calldata pointer location with witness data. + * @param fnIn Function pointer to ClaimHashLib._toGenericQualifiedMultichainClaimWithWitnessMessageHash + * @return fnOut Modified function for ClaimHashLib.toMessageHashes(QualifiedBatchMultichainClaimWithWitness calldata) + */ function usingQualifiedBatchMultichainClaimWithWitness( function (uint256, uint256, function (uint256, uint256, bytes32, bytes32, uint256) internal view returns (bytes32)) internal view returns (bytes32, bytes32, bytes32) fnIn ) @@ -679,6 +745,12 @@ library FunctionCastLib { } } + /** + * @notice Function cast to provide a QualifiedSplitBatchMultichainClaimWithWitness calldata struct + * while treating it as a uint256 representing a calldata pointer location with witness data. + * @param fnIn Function pointer to ClaimHashLib._toGenericQualifiedMultichainClaimWithWitnessMessageHash + * @return fnOut Modified function for ClaimHashLib.toMessageHashes(QualifiedSplitBatchMultichainClaimWithWitness calldata) + */ function usingQualifiedSplitBatchMultichainClaimWithWitness( function (uint256, uint256, function (uint256, uint256, bytes32, bytes32, uint256) internal view returns (bytes32)) internal view returns (bytes32, bytes32, bytes32) fnIn ) @@ -694,6 +766,12 @@ library FunctionCastLib { } } + /** + * @notice Function cast to provide an ExogenousQualifiedMultichainClaimWithWitness calldata struct + * while treating it as a uint256 representing a calldata pointer location with witness data. + * @param fnIn Function pointer to ClaimHashLib._toGenericQualifiedMultichainClaimWithWitnessMessageHash + * @return fnOut Modified function for ClaimHashLib.toMessageHashes(ExogenousQualifiedMultichainClaimWithWitness calldata) + */ function usingExogenousQualifiedMultichainClaimWithWitness( function (uint256, uint256, function (uint256, uint256, bytes32, bytes32, uint256) internal view returns (bytes32)) internal view returns (bytes32, bytes32, bytes32) fnIn ) @@ -709,6 +787,12 @@ library FunctionCastLib { } } + /** + * @notice Function cast to provide an ExogenousQualifiedSplitMultichainClaimWithWitness calldata struct + * while treating it as an ExogenousQualifiedMultichainClaimWithWitness calldata struct. + * @param fnIn Function pointer to ClaimHashLib._toExogenousQualifiedMultichainClaimWithWitnessMessageHash(ExogenousQualifiedMultichainClaimWithWitness calldata) + * @return fnOut Modified function for ClaimHashLib.toMessageHashes(ExogenousQualifiedSplitMultichainClaimWithWitness calldata) + */ function usingExogenousQualifiedSplitMultichainClaimWithWitness(function (ExogenousQualifiedMultichainClaimWithWitness calldata) internal view returns (bytes32, bytes32, bytes32) fnIn) internal pure @@ -719,6 +803,12 @@ library FunctionCastLib { } } + /** + * @notice Function cast to provide an ExogenousQualifiedBatchMultichainClaimWithWitness calldata struct + * while treating it as a uint256 representing a calldata pointer location with witness data. + * @param fnIn Function pointer to ClaimHashLib._toGenericQualifiedMultichainClaimWithWitnessMessageHash + * @return fnOut Modified function for ClaimHashLib.toMessageHashes(ExogenousQualifiedBatchMultichainClaimWithWitness calldata) + */ function usingExogenousQualifiedBatchMultichainClaimWithWitness( function (uint256, uint256, function (uint256, uint256, bytes32, bytes32, uint256) internal view returns (bytes32)) internal view returns (bytes32, bytes32, bytes32) fnIn ) @@ -734,6 +824,12 @@ library FunctionCastLib { } } + /** + * @notice Function cast to provide an ExogenousQualifiedSplitBatchMultichainClaimWithWitness calldata struct + * while treating it as a uint256 representing a calldata pointer location with witness data. + * @param fnIn Function pointer to ClaimHashLib._toGenericQualifiedMultichainClaimWithWitnessMessageHash + * @return fnOut Modified function for ClaimHashLib.toMessageHashes(ExogenousQualifiedSplitBatchMultichainClaimWithWitness calldata) + */ function usingExogenousQualifiedSplitBatchMultichainClaimWithWitness( function (uint256, uint256, function (uint256, uint256, bytes32, bytes32, uint256) internal view returns (bytes32)) internal view returns (bytes32, bytes32, bytes32) fnIn ) @@ -750,61 +846,11 @@ library FunctionCastLib { } /** - * @notice Function cast to provide a SplitTransfer calldata struct while - * treating it as a BasicTransfer calldata struct. - * @param fnIn Function pointer to ClaimProcessorLib._notExpiredAndSignedByAllocator(bytes32, address, BasicTransfer calldata) - * @return fnOut Modified function for ClaimProcessorLib._notExpiredAndSignedByAllocator(bytes32, address, SplitTransfer calldata) - */ - function usingSplitTransfer(function (bytes32, address, BasicTransfer calldata) internal fnIn) internal pure returns (function (bytes32, address, SplitTransfer calldata) internal fnOut) { - assembly ("memory-safe") { - fnOut := fnIn - } - } - - /** - * @notice Function cast to provide a BatchTransfer calldata struct while - * treating it as a BasicTransfer calldata struct. - * @param fnIn Function pointer to ClaimProcessorLib._notExpiredAndSignedByAllocator(bytes32, address, BasicTransfer calldata) - * @return fnOut Modified function for ClaimProcessorLib._notExpiredAndSignedByAllocator(bytes32, address, BatchTransfer calldata) - */ - function usingBatchTransfer(function (bytes32, address, BasicTransfer calldata) internal fnIn) internal pure returns (function (bytes32, address, BatchTransfer calldata) internal fnOut) { - assembly ("memory-safe") { - fnOut := fnIn - } - } - - /** - * @notice Function cast to provide a SplitBatchTransfer calldata struct while - * treating it as a BasicTransfer calldata struct. - * @param fnIn Function pointer to ClaimProcessorLib._notExpiredAndSignedByAllocator(bytes32, address, BasicTransfer calldata) - * @return fnOut Modified function for ClaimProcessorLib._notExpiredAndSignedByAllocator(bytes32, address, SplitBatchTransfer calldata) - */ - function usingSplitBatchTransfer(function (bytes32, address, BasicTransfer calldata) internal fnIn) - internal - pure - returns (function (bytes32, address, SplitBatchTransfer calldata) internal fnOut) - { - assembly ("memory-safe") { - fnOut := fnIn - } - } - - /** - * @notice Function cast to provide a SplitBatchTransfer calldata struct while - * treating it as a BatchTransfer calldata struct. - * @param fnIn Function pointer to HashLib.toBatchTransferMessageHashUsingIdsAndAmountsHash(BatchTransfer calldata, uint256) - * @return fnOut Modified function for HashLib.toBatchTransferMessageHashUsingIdsAndAmountsHash(SplitBatchTransfer calldata, uint256) + * @notice Function cast to provide a BasicClaim calldata struct while + * treating it as a uint256 representing a calldata pointer location. + * @param fnIn Function pointer to ClaimProcessorLib.processSimpleClaim + * @return fnOut Modified function for ClaimProcessorLogic._processBasicClaim */ - function usingSplitBatchTransfer(function(BatchTransfer calldata, uint256) internal view returns (bytes32) fnIn) - internal - pure - returns (function(SplitBatchTransfer calldata, uint256) internal view returns (bytes32) fnOut) - { - assembly ("memory-safe") { - fnOut := fnIn - } - } - function usingBasicClaim( function( bytes32, @@ -833,6 +879,12 @@ library FunctionCastLib { } } + /** + * @notice Function cast to provide a QualifiedClaim calldata struct while + * treating it as a uint256 representing a calldata pointer location. + * @param fnIn Function pointer to ClaimProcessorLib.processClaimWithQualification + * @return fnOut Modified function for ClaimProcessorLogic._processQualifiedClaim + */ function usingQualifiedClaim( function( bytes32, @@ -863,6 +915,12 @@ library FunctionCastLib { } } + /** + * @notice Function cast to provide a ClaimWithWitness calldata struct while + * treating it as a uint256 representing a calldata pointer location. + * @param fnIn Function pointer to ClaimProcessorLib.processClaimWithWitness + * @return fnOut Modified function for ClaimProcessorLogic._processClaimWithWitness + */ function usingClaimWithWitness( function( bytes32, @@ -891,6 +949,12 @@ library FunctionCastLib { } } + /** + * @notice Function cast to provide a QualifiedClaimWithWitness calldata struct while + * treating it as a uint256 representing a calldata pointer location. + * @param fnIn Function pointer to ClaimProcessorLib.processClaimWithQualification + * @return fnOut Modified function for ClaimProcessorLogic._processQualifiedClaimWithWitness + */ function usingQualifiedClaimWithWitness( function( bytes32, @@ -921,6 +985,12 @@ library FunctionCastLib { } } + /** + * @notice Function cast to provide a SplitClaim calldata struct while + * treating it as a uint256 representing a calldata pointer location. + * @param fnIn Function pointer to ClaimProcessorLib.processSplitClaim + * @return fnOut Modified function for ClaimProcessorLogic._processSplitClaim + */ function usingSplitClaim( function( bytes32, @@ -949,6 +1019,12 @@ library FunctionCastLib { } } + /** + * @notice Function cast to provide a QualifiedSplitClaim calldata struct while + * treating it as a uint256 representing a calldata pointer location. + * @param fnIn Function pointer to ClaimProcessorLib.processClaimWithQualification + * @return fnOut Modified function for ClaimProcessorLogic._processQualifiedSplitClaim + */ function usingQualifiedSplitClaim( function( bytes32, @@ -979,6 +1055,12 @@ library FunctionCastLib { } } + /** + * @notice Function cast to provide a SplitClaimWithWitness calldata struct while + * treating it as a uint256 representing a calldata pointer location. + * @param fnIn Function pointer to ClaimProcessorLib.processClaimWithWitness + * @return fnOut Modified function for ClaimProcessorLogic._processSplitClaimWithWitness + */ function usingSplitClaimWithWitness( function( bytes32, @@ -1007,6 +1089,12 @@ library FunctionCastLib { } } + /** + * @notice Function cast to provide a QualifiedSplitClaimWithWitness calldata struct while + * treating it as a uint256 representing a calldata pointer location. + * @param fnIn Function pointer to ClaimProcessorLib.processClaimWithQualification + * @return fnOut Modified function for ClaimProcessorLogic._processQualifiedSplitClaimWithWitness + */ function usingQualifiedSplitClaimWithWitness( function( bytes32, @@ -1037,6 +1125,12 @@ library FunctionCastLib { } } + /** + * @notice Function cast to provide a BatchClaim calldata struct while + * treating it as a uint256 representing a calldata pointer location. + * @param fnIn Function pointer to ClaimProcessorLib.processBatchClaim + * @return fnOut Modified function for ClaimProcessorLogic._processBatchClaim + */ function usingBatchClaim( function( bytes32, @@ -1065,6 +1159,12 @@ library FunctionCastLib { } } + /** + * @notice Function cast to provide a QualifiedBatchClaim calldata struct while + * treating it as a uint256 representing a calldata pointer location. + * @param fnIn Function pointer to ClaimProcessorLib.processClaimWithQualification + * @return fnOut Modified function for ClaimProcessorLogic._processQualifiedBatchClaim + */ function usingQualifiedBatchClaim( function( bytes32, @@ -1095,6 +1195,12 @@ library FunctionCastLib { } } + /** + * @notice Function cast to provide a BatchClaimWithWitness calldata struct while + * treating it as a uint256 representing a calldata pointer location. + * @param fnIn Function pointer to ClaimProcessorLib.processClaimWithWitness + * @return fnOut Modified function for ClaimProcessorLogic._processBatchClaimWithWitness + */ function usingBatchClaimWithWitness( function( bytes32, @@ -1123,6 +1229,12 @@ library FunctionCastLib { } } + /** + * @notice Function cast to provide a QualifiedBatchClaimWithWitness calldata struct while + * treating it as a uint256 representing a calldata pointer location. + * @param fnIn Function pointer to ClaimProcessorLib.processClaimWithQualification + * @return fnOut Modified function for ClaimProcessorLogic._processQualifiedBatchClaimWithWitness + */ function usingQualifiedBatchClaimWithWitness( function( bytes32, @@ -1153,6 +1265,12 @@ library FunctionCastLib { } } + /** + * @notice Function cast to provide a SplitBatchClaim calldata struct while + * treating it as a uint256 representing a calldata pointer location. + * @param fnIn Function pointer to ClaimProcessorLib.processSplitBatchClaim + * @return fnOut Modified function for ClaimProcessorLogic._processSplitBatchClaim + */ function usingSplitBatchClaim( function( bytes32, @@ -1181,6 +1299,12 @@ library FunctionCastLib { } } + /** + * @notice Function cast to provide a QualifiedSplitBatchClaim calldata struct while + * treating it as a uint256 representing a calldata pointer location. + * @param fnIn Function pointer to ClaimProcessorLib.processClaimWithQualification + * @return fnOut Modified function for ClaimProcessorLogic._processQualifiedSplitBatchClaim + */ function usingQualifiedSplitBatchClaim( function( bytes32, @@ -1211,6 +1335,12 @@ library FunctionCastLib { } } + /** + * @notice Function cast to provide a SplitBatchClaimWithWitness calldata struct while + * treating it as a uint256 representing a calldata pointer location. + * @param fnIn Function pointer to ClaimProcessorLib.processClaimWithWitness + * @return fnOut Modified function for ClaimProcessorLogic._processSplitBatchClaimWithWitness + */ function usingSplitBatchClaimWithWitness( function( bytes32, @@ -1239,6 +1369,12 @@ library FunctionCastLib { } } + /** + * @notice Function cast to provide a QualifiedSplitBatchClaimWithWitness calldata struct while + * treating it as a uint256 representing a calldata pointer location. + * @param fnIn Function pointer to ClaimProcessorLib.processClaimWithQualification + * @return fnOut Modified function for ClaimProcessorLogic._processQualifiedSplitBatchClaimWithWitness + */ function usingQualifiedSplitBatchClaimWithWitness( function( bytes32, @@ -1269,6 +1405,12 @@ library FunctionCastLib { } } + /** + * @notice Function cast to provide a MultichainClaim calldata struct while + * treating it as a uint256 representing a calldata pointer location. + * @param fnIn Function pointer to ClaimProcessorLib.processMultichainClaim + * @return fnOut Modified function for ClaimProcessorLogic._processMultichainClaim + */ function usingMultichainClaim( function( bytes32, @@ -1297,6 +1439,12 @@ library FunctionCastLib { } } + /** + * @notice Function cast to provide a QualifiedMultichainClaim calldata struct while + * treating it as a uint256 representing a calldata pointer location. + * @param fnIn Function pointer to ClaimProcessorLib.processClaimWithQualification + * @return fnOut Modified function for ClaimProcessorLogic._processQualifiedMultichainClaim + */ function usingQualifiedMultichainClaim( function( bytes32, @@ -1327,6 +1475,12 @@ library FunctionCastLib { } } + /** + * @notice Function cast to provide a MultichainClaimWithWitness calldata struct while + * treating it as a uint256 representing a calldata pointer location. + * @param fnIn Function pointer to ClaimProcessorLib.processClaimWithWitness + * @return fnOut Modified function for ClaimProcessorLogic._processMultichainClaimWithWitness + */ function usingMultichainClaimWithWitness( function( bytes32, @@ -1355,6 +1509,12 @@ library FunctionCastLib { } } + /** + * @notice Function cast to provide a QualifiedMultichainClaimWithWitness calldata struct while + * treating it as a uint256 representing a calldata pointer location. + * @param fnIn Function pointer to ClaimProcessorLib.processClaimWithQualification + * @return fnOut Modified function for ClaimProcessorLogic._processQualifiedMultichainClaimWithWitness + */ function usingQualifiedMultichainClaimWithWitness( function( bytes32, @@ -1385,6 +1545,12 @@ library FunctionCastLib { } } + /** + * @notice Function cast to provide a SplitMultichainClaim calldata struct while + * treating it as a uint256 representing a calldata pointer location. + * @param fnIn Function pointer to ClaimProcessorLib.processSplitMultichainClaim + * @return fnOut Modified function for ClaimProcessorLogic._processSplitMultichainClaim + */ function usingSplitMultichainClaim( function( bytes32, @@ -1413,6 +1579,12 @@ library FunctionCastLib { } } + /** + * @notice Function cast to provide a QualifiedSplitMultichainClaim calldata struct while + * treating it as a uint256 representing a calldata pointer location. + * @param fnIn Function pointer to ClaimProcessorLib.processClaimWithQualification + * @return fnOut Modified function for ClaimProcessorLogic._processQualifiedSplitMultichainClaim + */ function usingQualifiedSplitMultichainClaim( function( bytes32, @@ -1443,6 +1615,12 @@ library FunctionCastLib { } } + /** + * @notice Function cast to provide a SplitMultichainClaimWithWitness calldata struct while + * treating it as a uint256 representing a calldata pointer location. + * @param fnIn Function pointer to ClaimProcessorLib.processClaimWithWitness + * @return fnOut Modified function for ClaimProcessorLogic._processSplitMultichainClaimWithWitness + */ function usingSplitMultichainClaimWithWitness( function( bytes32, @@ -1471,6 +1649,12 @@ library FunctionCastLib { } } + /** + * @notice Function cast to provide a QualifiedSplitMultichainClaimWithWitness calldata struct while + * treating it as a uint256 representing a calldata pointer location. + * @param fnIn Function pointer to ClaimProcessorLib.processClaimWithQualification + * @return fnOut Modified function for ClaimProcessorLogic._processQualifiedSplitMultichainClaimWithWitness + */ function usingQualifiedSplitMultichainClaimWithWitness( function( bytes32, @@ -1501,6 +1685,12 @@ library FunctionCastLib { } } + /** + * @notice Function cast to provide a BatchMultichainClaim calldata struct while + * treating it as a uint256 representing a calldata pointer location. + * @param fnIn Function pointer to ClaimProcessorLib.processBatchMultichainClaim + * @return fnOut Modified function for ClaimProcessorLogic._processBatchMultichainClaim + */ function usingBatchMultichainClaim( function( bytes32, @@ -1529,6 +1719,12 @@ library FunctionCastLib { } } + /** + * @notice Function cast to provide a QualifiedBatchMultichainClaim calldata struct while + * treating it as a uint256 representing a calldata pointer location. + * @param fnIn Function pointer to ClaimProcessorLib.processClaimWithQualification + * @return fnOut Modified function for ClaimProcessorLogic._processQualifiedBatchMultichainClaim + */ function usingQualifiedBatchMultichainClaim( function( bytes32, @@ -1559,6 +1755,12 @@ library FunctionCastLib { } } + /** + * @notice Function cast to provide a BatchMultichainClaimWithWitness calldata struct while + * treating it as a uint256 representing a calldata pointer location. + * @param fnIn Function pointer to ClaimProcessorLib.processClaimWithWitness + * @return fnOut Modified function for ClaimProcessorLogic._processBatchMultichainClaimWithWitness + */ function usingBatchMultichainClaimWithWitness( function( bytes32, @@ -1587,6 +1789,12 @@ library FunctionCastLib { } } + /** + * @notice Function cast to provide a QualifiedBatchMultichainClaimWithWitness calldata struct while + * treating it as a uint256 representing a calldata pointer location. + * @param fnIn Function pointer to ClaimProcessorLib.processClaimWithQualification + * @return fnOut Modified function for ClaimProcessorLogic._processQualifiedBatchMultichainClaimWithWitness + */ function usingQualifiedBatchMultichainClaimWithWitness( function( bytes32, @@ -1617,6 +1825,12 @@ library FunctionCastLib { } } + /** + * @notice Function cast to provide a SplitBatchMultichainClaim calldata struct while + * treating it as a uint256 representing a calldata pointer location. + * @param fnIn Function pointer to ClaimProcessorLib.processSplitBatchMultichainClaim + * @return fnOut Modified function for ClaimProcessorLogic._processSplitBatchMultichainClaim + */ function usingSplitBatchMultichainClaim( function( bytes32, @@ -1645,6 +1859,12 @@ library FunctionCastLib { } } + /** + * @notice Function cast to provide a QualifiedSplitBatchMultichainClaim calldata struct while + * treating it as a uint256 representing a calldata pointer location. + * @param fnIn Function pointer to ClaimProcessorLib.processClaimWithQualification + * @return fnOut Modified function for ClaimProcessorLogic._processQualifiedSplitBatchMultichainClaim + */ function usingQualifiedSplitBatchMultichainClaim( function( bytes32, @@ -1675,6 +1895,12 @@ library FunctionCastLib { } } + /** + * @notice Function cast to provide a SplitBatchMultichainClaimWithWitness calldata struct while + * treating it as a uint256 representing a calldata pointer location. + * @param fnIn Function pointer to ClaimProcessorLib.processClaimWithWitness + * @return fnOut Modified function for ClaimProcessorLogic._processSplitBatchMultichainClaimWithWitness + */ function usingSplitBatchMultichainClaimWithWitness( function( bytes32, @@ -1703,6 +1929,12 @@ library FunctionCastLib { } } + /** + * @notice Function cast to provide a QualifiedSplitBatchMultichainClaimWithWitness calldata struct while + * treating it as a uint256 representing a calldata pointer location. + * @param fnIn Function pointer to ClaimProcessorLib.processClaimWithQualification + * @return fnOut Modified function for ClaimProcessorLogic._processQualifiedSplitBatchMultichainClaimWithWitness + */ function usingQualifiedSplitBatchMultichainClaimWithWitness( function( bytes32, @@ -1733,6 +1965,12 @@ library FunctionCastLib { } } + /** + * @notice Function cast to provide a ExogenousMultichainClaim calldata struct while + * treating it as a uint256 representing a calldata pointer location. + * @param fnIn Function pointer to ClaimProcessorLib.processExogenousMultichainClaim + * @return fnOut Modified function for ClaimProcessorLogic._processExogenousMultichainClaim + */ function usingExogenousMultichainClaim( function( bytes32, @@ -1763,6 +2001,12 @@ library FunctionCastLib { } } + /** + * @notice Function cast to provide a ExogenousQualifiedMultichainClaim calldata struct while + * treating it as a uint256 representing a calldata pointer location. + * @param fnIn Function pointer to ClaimProcessorLib.processClaimWithQualification + * @return fnOut Modified function for ClaimProcessorLogic._processExogenousQualifiedMultichainClaim + */ function usingExogenousQualifiedMultichainClaim( function( bytes32, @@ -1795,6 +2039,12 @@ library FunctionCastLib { } } + /** + * @notice Function cast to provide a ExogenousMultichainClaimWithWitness calldata struct while + * treating it as a uint256 representing a calldata pointer location. + * @param fnIn Function pointer to ClaimProcessorLib.processClaimWithWitness + * @return fnOut Modified function for ClaimProcessorLogic._processExogenousMultichainClaimWithWitness + */ function usingExogenousMultichainClaimWithWitness( function( bytes32, @@ -1825,6 +2075,12 @@ library FunctionCastLib { } } + /** + * @notice Function cast to provide a ExogenousQualifiedMultichainClaimWithWitness calldata struct while + * treating it as a uint256 representing a calldata pointer location. + * @param fnIn Function pointer to ClaimProcessorLib.processClaimWithQualification + * @return fnOut Modified function for ClaimProcessorLogic._processExogenousQualifiedMultichainClaimWithWitness + */ function usingExogenousQualifiedMultichainClaimWithWitness( function( bytes32, @@ -1857,6 +2113,12 @@ library FunctionCastLib { } } + /** + * @notice Function cast to provide a ExogenousSplitMultichainClaim calldata struct while + * treating it as a uint256 representing a calldata pointer location. + * @param fnIn Function pointer to ClaimProcessorLib.processExogenousSplitMultichainClaim + * @return fnOut Modified function for ClaimProcessorLogic._processExogenousSplitMultichainClaim + */ function usingExogenousSplitMultichainClaim( function( bytes32, @@ -1887,6 +2149,12 @@ library FunctionCastLib { } } + /** + * @notice Function cast to provide a ExogenousQualifiedSplitMultichainClaim calldata struct while + * treating it as a uint256 representing a calldata pointer location. + * @param fnIn Function pointer to ClaimProcessorLib.processClaimWithQualification + * @return fnOut Modified function for ClaimProcessorLogic._processExogenousQualifiedSplitMultichainClaim + */ function usingExogenousQualifiedSplitMultichainClaim( function( bytes32, @@ -1919,6 +2187,12 @@ library FunctionCastLib { } } + /** + * @notice Function cast to provide a ExogenousSplitMultichainClaimWithWitness calldata struct while + * treating it as a uint256 representing a calldata pointer location. + * @param fnIn Function pointer to ClaimProcessorLib.processClaimWithWitness + * @return fnOut Modified function for ClaimProcessorLogic._processExogenousSplitMultichainClaimWithWitness + */ function usingExogenousSplitMultichainClaimWithWitness( function( bytes32, @@ -1949,6 +2223,12 @@ library FunctionCastLib { } } + /** + * @notice Function cast to provide a ExogenousQualifiedSplitMultichainClaimWithWitness calldata struct while + * treating it as a uint256 representing a calldata pointer location. + * @param fnIn Function pointer to ClaimProcessorLib.processClaimWithQualification + * @return fnOut Modified function for ClaimProcessorLogic._processExogenousQualifiedSplitMultichainClaimWithWitness + */ function usingExogenousQualifiedSplitMultichainClaimWithWitness( function( bytes32, @@ -1981,6 +2261,12 @@ library FunctionCastLib { } } + /** + * @notice Function cast to provide a ExogenousBatchMultichainClaim calldata struct while + * treating it as a uint256 representing a calldata pointer location. + * @param fnIn Function pointer to ClaimProcessorLib.processExogenousBatchMultichainClaim + * @return fnOut Modified function for ClaimProcessorLogic._processExogenousBatchMultichainClaim + */ function usingExogenousBatchMultichainClaim( function( bytes32, @@ -2011,6 +2297,12 @@ library FunctionCastLib { } } + /** + * @notice Function cast to provide a ExogenousQualifiedBatchMultichainClaim calldata struct while + * treating it as a uint256 representing a calldata pointer location. + * @param fnIn Function pointer to ClaimProcessorLib.processClaimWithQualification + * @return fnOut Modified function for ClaimProcessorLogic._processExogenousQualifiedBatchMultichainClaim + */ function usingExogenousQualifiedBatchMultichainClaim( function( bytes32, @@ -2043,6 +2335,12 @@ library FunctionCastLib { } } + /** + * @notice Function cast to provide a ExogenousBatchMultichainClaimWithWitness calldata struct while + * treating it as a uint256 representing a calldata pointer location. + * @param fnIn Function pointer to ClaimProcessorLib.processClaimWithWitness + * @return fnOut Modified function for ClaimProcessorLogic._processExogenousBatchMultichainClaimWithWitness + */ function usingExogenousBatchMultichainClaimWithWitness( function( bytes32, @@ -2073,6 +2371,12 @@ library FunctionCastLib { } } + /** + * @notice Function cast to provide a ExogenousQualifiedBatchMultichainClaimWithWitness calldata struct while + * treating it as a uint256 representing a calldata pointer location. + * @param fnIn Function pointer to ClaimProcessorLib.processClaimWithQualification + * @return fnOut Modified function for ClaimProcessorLogic._processExogenousQualifiedBatchMultichainClaimWithWitness + */ function usingExogenousQualifiedBatchMultichainClaimWithWitness( function( bytes32, @@ -2105,6 +2409,12 @@ library FunctionCastLib { } } + /** + * @notice Function cast to provide a ExogenousSplitBatchMultichainClaim calldata struct while + * treating it as a uint256 representing a calldata pointer location. + * @param fnIn Function pointer to ClaimProcessorLib.processSplitBatchMultichainClaim + * @return fnOut Modified function for ClaimProcessorLogic._processExogenousSplitBatchMultichainClaim + */ function usingExogenousSplitBatchMultichainClaim( function( bytes32, @@ -2135,6 +2445,12 @@ library FunctionCastLib { } } + /** + * @notice Function cast to provide a ExogenousQualifiedSplitBatchMultichainClaim calldata struct while + * treating it as a uint256 representing a calldata pointer location. + * @param fnIn Function pointer to ClaimProcessorLib.processClaimWithQualification + * @return fnOut Modified function for ClaimProcessorLogic._processExogenousQualifiedSplitBatchMultichainClaim + */ function usingExogenousQualifiedSplitBatchMultichainClaim( function( bytes32, @@ -2167,6 +2483,12 @@ library FunctionCastLib { } } + /** + * @notice Function cast to provide a ExogenousSplitBatchMultichainClaimWithWitness calldata struct while + * treating it as a uint256 representing a calldata pointer location. + * @param fnIn Function pointer to ClaimProcessorLib.processClaimWithWitness + * @return fnOut Modified function for ClaimProcessorLogic._processExogenousSplitBatchMultichainClaimWithWitness + */ function usingExogenousSplitBatchMultichainClaimWithWitness( function( bytes32, @@ -2197,6 +2519,12 @@ library FunctionCastLib { } } + /** + * @notice Function cast to provide a ExogenousQualifiedSplitBatchMultichainClaimWithWitness calldata struct while + * treating it as a uint256 representing a calldata pointer location. + * @param fnIn Function pointer to ClaimProcessorLib.processClaimWithQualification + * @return fnOut Modified function for ClaimProcessorLogic._processExogenousQualifiedSplitBatchMultichainClaimWithWitness + */ function usingExogenousQualifiedSplitBatchMultichainClaimWithWitness( function( bytes32, @@ -2245,6 +2573,12 @@ library FunctionCastLib { } } + /** + * @notice Function cast to provide a SplitClaimWithWitness calldata struct while + * treating it as a uint256 representing a calldata pointer location. + * @param fnIn Function pointer to HashLib.toMessageHashWithWitness(uint256, uint256) + * @return fnOut Modified function for HashLib.toMessageHashWithWitness(SplitClaimWithWitness calldata, uint256) + */ function usingSplitClaimWithWitness(function (uint256, uint256) internal view returns (bytes32, bytes32) fnIn) internal pure @@ -2271,6 +2605,12 @@ library FunctionCastLib { } } + /** + * @notice Function cast to provide a BatchClaimWithWitness calldata struct while + * treating it as a uint256 representing a calldata pointer location. + * @param fnIn Function pointer to HashLib.toMessageHashWithWitness(uint256, uint256) + * @return fnOut Modified function for HashLib.toMessageHashWithWitness(BatchClaimWithWitness calldata, uint256) + */ function usingBatchClaimWithWitness(function (uint256, uint256) internal view returns (bytes32, bytes32) fnIn) internal pure @@ -2281,6 +2621,12 @@ library FunctionCastLib { } } + /** + * @notice Function cast to provide a SplitBatchClaimWithWitness calldata struct while + * treating it as a uint256 representing a calldata pointer location. + * @param fnIn Function pointer to HashLib.toMessageHashWithWitness(uint256, uint256) + * @return fnOut Modified function for HashLib.toMessageHashWithWitness(SplitBatchClaimWithWitness calldata, uint256) + */ function usingSplitBatchClaimWithWitness(function (uint256, uint256) internal view returns (bytes32, bytes32) fnIn) internal pure @@ -2291,6 +2637,12 @@ library FunctionCastLib { } } + /** + * @notice Function cast to provide an ExogenousQualifiedMultichainClaim calldata struct while + * treating it as a uint256 representing a calldata pointer location. + * @param fnIn Function pointer to ClaimHashLib._toExogenousQualifiedMultichainMessageHash(ExogenousQualifiedMultichainClaim calldata) + * @return fnOut Modified function for ClaimHashLib._toExogenousQualifiedMultichainMessageHash(ExogenousQualifiedMultichainClaim calldata) + */ function usingExogenousQualifiedMultichainClaim(function(uint256, uint256) internal pure returns (uint256) fnIn) internal pure @@ -2301,6 +2653,12 @@ library FunctionCastLib { } } + /** + * @notice Function cast to provide a QualifiedMultichainClaim calldata struct while + * treating it as a uint256 representing a calldata pointer location. + * @param fnIn Function pointer to ClaimHashLib._toQualifiedMultichainMessageHash(QualifiedMultichainClaim calldata) + * @return fnOut Modified function for ClaimHashLib._toQualifiedMultichainMessageHash(QualifiedMultichainClaim calldata) + */ function usingQualifiedMultichainClaim(function (uint256, uint256) internal pure returns (uint256) fnIn) internal pure @@ -2311,6 +2669,12 @@ library FunctionCastLib { } } + /** + * @notice Function cast to provide a QualifiedMultichainClaimWithWitness calldata struct while + * treating it as a uint256 representing a calldata pointer location. + * @param fnIn Function pointer to ClaimHashLib._toQualifiedMultichainClaimWithWitnessMessageHash(QualifiedMultichainClaimWithWitness calldata) + * @return fnOut Modified function for ClaimHashLib._toQualifiedMultichainClaimWithWitnessMessageHash(QualifiedMultichainClaimWithWitness calldata) + */ function usingQualifiedMultichainClaimWithWitness(function (uint256, uint256) internal pure returns (uint256) fnIn) internal pure @@ -2321,6 +2685,12 @@ library FunctionCastLib { } } + /** + * @notice Function cast to provide an ExogenousQualifiedMultichainClaimWithWitness calldata struct while + * treating it as a uint256 representing a calldata pointer location. + * @param fnIn Function pointer to ClaimHashLib._toExogenousQualifiedMultichainClaimWithWitnessMessageHash(ExogenousQualifiedMultichainClaimWithWitness calldata) + * @return fnOut Modified function for ClaimHashLib._toExogenousQualifiedMultichainClaimWithWitnessMessageHash(ExogenousQualifiedMultichainClaimWithWitness calldata) + */ function usingExogenousQualifiedMultichainClaimWithWitness(function (uint256, uint256) internal pure returns (uint256) fnIn) internal pure @@ -2331,6 +2701,12 @@ library FunctionCastLib { } } + /** + * @notice Function cast to provide a MultichainClaim calldata struct while + * treating it as a uint256 representing a calldata pointer location. + * @param fnIn Function pointer to ClaimHashLib._toMultichainMessageHash(MultichainClaim calldata) + * @return fnOut Modified function for ClaimHashLib._toMultichainMessageHash(MultichainClaim calldata) + */ function usingMultichainClaim(function (uint256, uint256) internal pure returns (uint256) fnIn) internal pure @@ -2341,6 +2717,12 @@ library FunctionCastLib { } } + /** + * @notice Function cast to provide a MultichainClaimWithWitness calldata struct while + * treating it as a uint256 representing a calldata pointer location. + * @param fnIn Function pointer to ClaimHashLib._toMultichainClaimWithWitnessMessageHash(MultichainClaimWithWitness calldata) + * @return fnOut Modified function for ClaimHashLib._toMultichainClaimWithWitnessMessageHash(MultichainClaimWithWitness calldata) + */ function usingMultichainClaimWithWitness(function (uint256, uint256) internal pure returns (uint256) fnIn) internal pure @@ -2351,6 +2733,12 @@ library FunctionCastLib { } } + /** + * @notice Function cast to provide an ExogenousMultichainClaimWithWitness calldata struct while + * treating it as a uint256 representing a calldata pointer location. + * @param fnIn Function pointer to ClaimHashLib._toExogenousMultichainClaimWithWitnessMessageHash(ExogenousMultichainClaimWithWitness calldata) + * @return fnOut Modified function for ClaimHashLib._toExogenousMultichainClaimWithWitnessMessageHash(ExogenousMultichainClaimWithWitness calldata) + */ function usingExogenousMultichainClaimWithWitness(function (uint256, uint256) internal pure returns (uint256) fnIn) internal pure @@ -2361,6 +2749,12 @@ library FunctionCastLib { } } + /** + * @notice Function cast to provide an ExogenousMultichainClaim calldata struct while + * treating it as a uint256 representing a calldata pointer location. + * @param fnIn Function pointer to ClaimHashLib._toExogenousMultichainMessageHash(ExogenousMultichainClaim calldata) + * @return fnOut Modified function for ClaimHashLib._toExogenousMultichainMessageHash(ExogenousMultichainClaim calldata) + */ function usingExogenousMultichainClaim(function (uint256, uint256) internal pure returns (uint256) fnIn) internal pure @@ -2372,15 +2766,15 @@ library FunctionCastLib { } /** - * @notice Function cast to provide a SplitByIdComponent array while treating it - * as a TransferComponent array in the allocator consistency check. - * @param fnIn Function pointer to TransferLogic._deriveConsistentAllocatorAndConsumeNonce(TransferComponent[], uint256, function) - * @return fnOut Modified function for TransferLogic._deriveConsistentAllocatorAndConsumeNonce(SplitByIdComponent[], uint256, function) + * @notice Function cast to provide a SplitBatchTransfer calldata struct while + * treating it as a BatchTransfer calldata struct. + * @param fnIn Function pointer to HashLib.toBatchTransferMessageHashUsingIdsAndAmountsHash(BatchTransfer calldata, uint256) + * @return fnOut Modified function for HashLib.toBatchTransferMessageHashUsingIdsAndAmountsHash(SplitBatchTransfer calldata, uint256) */ - function usingSplitByIdComponent(function(TransferComponent[] calldata, uint256, function (TransferComponent[] calldata, uint256) internal pure returns (uint96)) internal returns (address) fnIn) + function usingSplitBatchTransfer(function(BatchTransfer calldata, uint256) internal view returns (bytes32) fnIn) internal pure - returns (function(SplitByIdComponent[] calldata, uint256, function (SplitByIdComponent[] calldata, uint256) internal pure returns (uint96)) internal returns (address) fnOut) + returns (function(SplitBatchTransfer calldata, uint256) internal view returns (bytes32) fnOut) { assembly ("memory-safe") { fnOut := fnIn diff --git a/src/lib/TransferLogic.sol b/src/lib/TransferLogic.sol index 533a0bb..174bc58 100644 --- a/src/lib/TransferLogic.sol +++ b/src/lib/TransferLogic.sol @@ -9,7 +9,7 @@ import { ClaimHashLib } from "./ClaimHashLib.sol"; import { ComponentLib } from "./ComponentLib.sol"; import { EfficiencyLib } from "./EfficiencyLib.sol"; import { EventLib } from "./EventLib.sol"; -import { FunctionCastLib } from "./FunctionCastLib.sol"; +import { TransferLogicFunctionCastLib } from "./TransferLogicFunctionCastLib.sol"; import { IdLib } from "./IdLib.sol"; import { SharedLogic } from "./SharedLogic.sol"; import { ValidityLib } from "./ValidityLib.sol"; @@ -36,8 +36,8 @@ contract TransferLogic is SharedLogic { using ValidityLib for uint96; using ValidityLib for uint256; using ValidityLib for bytes32; - using FunctionCastLib for function (bytes32, address, BasicTransfer calldata) internal; - using FunctionCastLib for function(TransferComponent[] calldata, uint256, function (TransferComponent[] calldata, uint256) internal pure returns (uint96)) internal returns (address); + using TransferLogicFunctionCastLib for function (bytes32, address, BasicTransfer calldata) internal; + using TransferLogicFunctionCastLib for function(TransferComponent[] calldata, uint256, function (TransferComponent[] calldata, uint256) internal pure returns (uint96)) internal returns (address); // bytes4(keccak256("attest(address,address,address,uint256,uint256)")). uint32 private constant _ATTEST_SELECTOR = 0x1a808f91; diff --git a/src/lib/TransferLogicFunctionCastLib.sol b/src/lib/TransferLogicFunctionCastLib.sol new file mode 100644 index 0000000..de53686 --- /dev/null +++ b/src/lib/TransferLogicFunctionCastLib.sol @@ -0,0 +1,74 @@ +// SPDX-License-Identifier: MIT +pragma solidity ^0.8.27; + +import { BatchTransfer, SplitBatchTransfer } from "../types/BatchClaims.sol"; +import { BasicTransfer, SplitTransfer } from "../types/Claims.sol"; +import { TransferComponent, SplitByIdComponent } from "../types/Components.sol"; + +/** + * @title TransferLogicFunctionCastLib + * @notice Libray contract implementing function casts used in TransferLogic. + * The input function operates on a function that takes some argument that differs + * from what is currently available. The output function modifies one or more argument + * types so that they match the arguments that are being used to call the function. + * Note that from the perspective of the function being modified, the original type is + * still in force; great care should be taken to preserve offsets and general structure + * between the two structs. + */ +library TransferLogicFunctionCastLib { + /** + * @notice Function cast to provide a SplitTransfer calldata struct while + * treating it as a BasicTransfer calldata struct. + * @param fnIn Function pointer to `_notExpiredAndSignedByAllocator`. + * @return fnOut Modified function used in `_processSplitTransfer`. + */ + function usingSplitTransfer(function (bytes32, address, BasicTransfer calldata) internal fnIn) internal pure returns (function (bytes32, address, SplitTransfer calldata) internal fnOut) { + assembly ("memory-safe") { + fnOut := fnIn + } + } + + /** + * @notice Function cast to provide a BatchTransfer calldata struct while + * treating it as a BasicTransfer calldata struct. + * @param fnIn Function pointer to `_notExpiredAndSignedByAllocator`. + * @return fnOut Modified function used in `_processBatchTransfer`. + */ + function usingBatchTransfer(function (bytes32, address, BasicTransfer calldata) internal fnIn) internal pure returns (function (bytes32, address, BatchTransfer calldata) internal fnOut) { + assembly ("memory-safe") { + fnOut := fnIn + } + } + + /** + * @notice Function cast to provide a SplitBatchTransfer calldata struct while + * treating it as a BasicTransfer calldata struct. + * @param fnIn Function pointer to `_notExpiredAndSignedByAllocator`. + * @return fnOut Modified function used in `_processSplitBatchTransfer`. + */ + function usingSplitBatchTransfer(function (bytes32, address, BasicTransfer calldata) internal fnIn) + internal + pure + returns (function (bytes32, address, SplitBatchTransfer calldata) internal fnOut) + { + assembly ("memory-safe") { + fnOut := fnIn + } + } + + /** + * @notice Function cast to provide a SplitByIdComponent array while treating it + * as a TransferComponent array. + * @param fnIn Function pointer to `_deriveConsistentAllocatorAndConsumeNonce`. + * @return fnOut Modified function used in `_processSplitBatchTransfer`. + */ + function usingSplitByIdComponent(function(TransferComponent[] calldata, uint256, function (TransferComponent[] calldata, uint256) internal pure returns (uint96)) internal returns (address) fnIn) + internal + pure + returns (function(SplitByIdComponent[] calldata, uint256, function (SplitByIdComponent[] calldata, uint256) internal pure returns (uint96)) internal returns (address) fnOut) + { + assembly ("memory-safe") { + fnOut := fnIn + } + } +}