@@ -4,26 +4,59 @@ pragma solidity >=0.8.8 <0.9.0;
4
4
import "../libraries/EndpointStructs.sol " ;
5
5
6
6
interface IEndpoint {
7
+ /// @notice Error code for when the caller is not the manager.
8
+ /// @dev Selector 0x3b2495f1.
9
+ /// @param caller The caller's address.
7
10
error CallerNotManager (address caller );
8
- error CannotRenounceEndpointOwnership (address currentOwner );
11
+
12
+ /// @notice Error code when ownership of the endpoint cannot be transferred.
13
+ /// @dev Selector 0x7ab04e14.
14
+ /// @param currentOwner The current owner of the endpoint and the maaager.
15
+ /// @param newOwner The updated owner of the endpoint and the manager.
9
16
error CannotTransferEndpointOwnership (address currentOwner , address newOwner );
17
+
18
+ /// @notice Error code emitted when the recipient manager address for the transfer
19
+ /// does not match the manager address encoded in the paylood sent over the wire.
20
+ /// @dev Selector 0x3a680c9a.
21
+ /// @param recipientManagerAddress The provided recipientManagerAddress
22
+ /// at the time of delivery.
23
+ /// @param expectedRecipientManagerAddress The recipient manager address encoded
24
+ /// in the payload sent over the wire.
10
25
error UnexpectedRecipientManagerAddress (
11
26
bytes32 recipientManagerAddress , bytes32 expectedRecipientManagerAddress
12
27
);
13
28
29
+ /// @notice Method to provide a quote for the delivery price.
30
+ /// @dev This method is called by the manager to get a quote for the delivery price.
31
+ /// @param recipientChain The chain id of the recipient.
32
+ /// @param instruction An additional Instruction provided by the Endpoint.
33
+ /// @return The price of the delivery.
14
34
function quoteDeliveryPrice (
15
35
uint16 recipientChain ,
16
36
EndpointStructs.EndpointInstruction memory instruction
17
37
) external view returns (uint256 );
18
38
39
+ /// @notice Send a message to the recipient chain.
40
+ /// @dev This method is called by the manager to send a message to the recipient chain.
41
+ /// @param recipientChain The chain id of the recipient.
42
+ /// @param instruction An additional Instruction provided by the Endpoint.
43
+ /// @param managerMessage A message to be sent to the manager on the recipient chain.
44
+ /// @param recipientManagerAddress The address of the recipient manager.
19
45
function sendMessage (
20
46
uint16 recipientChain ,
21
47
EndpointStructs.EndpointInstruction memory instruction ,
22
48
bytes memory managerMessage ,
23
49
bytes32 recipientManagerAddress
24
50
) external payable ;
25
51
52
+ /// @notice upgrade the endpoint to a new implementation.
53
+ /// @dev This is upgraded via a proxy.
54
+ /// @param newImplementation The address of the new implementation.
26
55
function upgrade (address newImplementation ) external ;
27
56
57
+ /// @notice transfer the ownership of the endpoint to a new address
58
+ /// @dev The manager should be able to update endpoint ownership.
59
+ /// The owner of the manager should be the same as the owner of the endpoint.
60
+ /// @param newOwner The address of the new owner.
28
61
function transferEndpointOwnership (address newOwner ) external ;
29
62
}
0 commit comments