You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: contracts/contracts/ccip/offramp/types.tolk
+12-3Lines changed: 12 additions & 3 deletions
Original file line number
Diff line number
Diff line change
@@ -66,6 +66,15 @@ struct Any2TVMRampMessage {
66
66
// maybe mark these amounts as slice remaining then parse them by hand to avoid requiring this to be a map<> at send time?
67
67
}
68
68
69
+
// Helper to extract the single token transfer from the message, and assert that there is only one token transfer
70
+
fun SnakedCell<Any2TVMTokenTransfer>.getTokenTransfer(self, error: int): Any2TVMTokenTransfer {
71
+
var it = self.iter();
72
+
assert (!it.empty(), error);
73
+
val token = it.next();
74
+
assert (it.empty(), error);
75
+
return token
76
+
}
77
+
69
78
fun Any2TVMRampMessage.generateMessageId(self, metadataHash: uint256): uint256 {
70
79
// Loosely based on https://github.com/smartcontractkit/chainlink-ccip/blob/2d2ce6abb3f7626dbd3008e4232da4faa839feff/chains/evm/contracts/libraries/Internal.sol#L113-L134
71
80
return beginCell()
@@ -99,10 +108,10 @@ struct MerkleRoot {
99
108
100
109
struct Any2TVMTokenTransfer {
101
110
sourcePoolAddress: Cell<CrossChainAddress>;
102
-
destPoolAddress: address;
103
-
destGasAmount: uint32;
111
+
token: address;
112
+
destGasAmount: uint32; // TBD: This field was removed in CCIP 2.0 and it's purpose/utility in TON is unclear.
104
113
extraData: cell;
105
-
amount: uint256;
114
+
amount: coins; // TBD: Does this change break any message ID we set in the past? It would but we didn't support token transfers then
0 commit comments