-
Notifications
You must be signed in to change notification settings - Fork 36
Expand file tree
/
Copy pathMultichainClaims.sol
More file actions
58 lines (53 loc) · 2.7 KB
/
MultichainClaims.sol
File metadata and controls
58 lines (53 loc) · 2.7 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
55
56
57
58
// SPDX-License-Identifier: MIT
pragma solidity 0.8.30;
import { Component } from "./Components.sol";
struct MultichainClaim {
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.
uint256 id; // The token ID of the ERC6909 token to allocate.
uint256 allocatedAmount; // The original allocated amount of ERC6909 tokens.
Component[] claimants; // The claim recipients and amounts; specified by the arbiter.
bytes32[] additionalChains; // The element hashes from additional chains.
}
struct ExogenousMultichainClaim {
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.
uint256 id; // The token ID of the ERC6909 token to allocate.
uint256 allocatedAmount; // The original allocated amount of ERC6909 tokens.
Component[] claimants; // The claim recipients and amounts; specified by the arbiter.
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 MultichainClaimsLib {
/**
* @notice Returns the raw calldata pointer to the multichain claim.
* @param claim The multichain claim to get the raw pointer of.
* @return rawClaimPtr The raw pointer to the multichain claim.
*/
function asRawPtr(MultichainClaim calldata claim) internal pure returns (uint256 rawClaimPtr) {
assembly {
rawClaimPtr := claim
}
}
/**
* @notice Returns the raw calldata pointer to the exogenous multichain claim.
* @param claim The exogenous multichain claim to get the raw pointer of.
* @return rawClaimPtr The raw pointer to the exogenous multichain claim.
*/
function asRawPtr(ExogenousMultichainClaim calldata claim) internal pure returns (uint256 rawClaimPtr) {
assembly {
rawClaimPtr := claim
}
}
}