-
Notifications
You must be signed in to change notification settings - Fork 36
Expand file tree
/
Copy pathBatchMultichainClaims.sol
More file actions
54 lines (49 loc) · 2.46 KB
/
BatchMultichainClaims.sol
File metadata and controls
54 lines (49 loc) · 2.46 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
// SPDX-License-Identifier: MIT
pragma solidity 0.8.30;
import { BatchClaimComponent } from "./Components.sol";
struct BatchMultichainClaim {
bytes allocatorData; // Authorization from the allocator.
bytes sponsorSignature; // Authorization from the sponsor.
address sponsor; // The account to source the tokens from.
uint256 nonce; // A parameter to enforce replay protection, scoped to allocator.
uint256 expires; // The time at which the claim expires.
bytes32 witness; // Hash of the witness data.
string witnessTypestring; // Witness typestring appended to existing typestring.
BatchClaimComponent[] claims; // The claim token IDs, recipients and amounts.
bytes32[] additionalChains; // The element hashes from additional chains.
}
struct ExogenousBatchMultichainClaim {
bytes allocatorData; // Authorization from the allocator.
bytes sponsorSignature; // Authorization from the sponsor.
address sponsor; // The account to source the tokens from.
uint256 nonce; // A parameter to enforce replay protection, scoped to allocator.
uint256 expires; // The time at which the claim expires.
bytes32 witness; // Hash of the witness data.
string witnessTypestring; // Witness typestring appended to existing typestring.
BatchClaimComponent[] claims; // The claim token IDs, recipients and amounts.
bytes32[] additionalChains; // The element hashes from additional chains.
uint256 chainIndex; // The index after which to insert the current element hash.
uint256 notarizedChainId; // The chain id used to sign the multichain claim.
}
library BatchMultichainClaimsLib {
/**
* @notice Returns the raw calldata pointer to the batch multichain claim.
* @param claim The batch multichain claim to get the raw pointer of.
* @return rawClaimPtr The raw pointer to the batch multichain claim.
*/
function asRawPtr(BatchMultichainClaim calldata claim) internal pure returns (uint256 rawClaimPtr) {
assembly {
rawClaimPtr := claim
}
}
/**
* @notice Returns the raw calldata pointer to the exogenous batch multichain claim.
* @param claim The exogenous batch multichain claim to get the raw pointer of.
* @return rawClaimPtr The raw pointer to the exogenous batch multichain claim.
*/
function asRawPtr(ExogenousBatchMultichainClaim calldata claim) internal pure returns (uint256 rawClaimPtr) {
assembly {
rawClaimPtr := claim
}
}
}