-
Notifications
You must be signed in to change notification settings - Fork 17
/
Copy pathICircleIntegration.sol
97 lines (69 loc) · 2.78 KB
/
ICircleIntegration.sol
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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
// SPDX-License-Identifier: Apache 2
pragma solidity ^0.8.19;
import {IWormhole} from "wormhole-solidity-sdk/interfaces/IWormhole.sol";
import {ICircleBridge} from "src/interfaces/external/ICircleBridge.sol";
import {IMessageTransmitter} from "src/interfaces/external/IMessageTransmitter.sol";
import {ITokenMinter} from "src/interfaces/external/ITokenMinter.sol";
interface ICircleIntegration {
struct TransferParameters {
address token;
uint256 amount;
uint16 targetChain;
bytes32 mintRecipient;
}
struct RedeemParameters {
bytes encodedWormholeMessage;
bytes circleBridgeMessage;
bytes circleAttestation;
}
struct DepositWithPayload {
bytes32 token;
uint256 amount;
uint32 sourceDomain;
uint32 targetDomain;
uint64 nonce;
bytes32 fromAddress;
bytes32 mintRecipient;
bytes payload;
}
function transferTokensWithPayload(
TransferParameters memory transferParams,
uint32 batchId,
bytes memory payload
) external payable returns (uint64 messageSequence);
function redeemTokensWithPayload(
RedeemParameters memory params
) external returns (DepositWithPayload memory depositWithPayload);
function fetchLocalTokenAddress(
uint32 sourceDomain,
bytes32 sourceToken
) external view returns (bytes32);
function encodeDepositWithPayload(
DepositWithPayload memory message
) external pure returns (bytes memory);
function decodeDepositWithPayload(
bytes memory encoded
) external pure returns (DepositWithPayload memory message);
function isInitialized(address impl) external view returns (bool);
function wormhole() external view returns (IWormhole);
function chainId() external view returns (uint16);
function wormholeFinality() external view returns (uint8);
function circleBridge() external view returns (ICircleBridge);
function circleTransmitter() external view returns (IMessageTransmitter);
function circleTokenMinter() external view returns (ITokenMinter);
function getRegisteredEmitter(uint16 emitterChainId) external view returns (bytes32);
function isAcceptedToken(address token) external view returns (bool);
function getDomainFromChainId(uint16 chainId_) external view returns (uint32);
function getChainIdFromDomain(uint32 domain) external view returns (uint16);
function isMessageConsumed(bytes32 hash) external view returns (bool);
function localDomain() external view returns (uint32);
function verifyGovernanceMessage(
bytes memory encodedMessage,
uint8 action
) external view returns (bytes32 messageHash, bytes memory payload);
function evmChain() external view returns (uint256);
// guardian governance only
function updateWormholeFinality(bytes memory encodedMessage) external;
function registerEmitterAndDomain(bytes memory encodedMessage) external;
function upgradeContract(bytes memory encodedMessage) external;
}