forked from icon-project/devportal
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathIBMV.sol
59 lines (53 loc) · 1.97 KB
/
IBMV.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
// SPDX-License-Identifier: MIT
pragma solidity >=0.5.0 <0.8.0;
pragma experimental ABIEncoderV2;
interface IBMV {
/**
@return base64EncodedMTA Base64 encode of Merkle Tree
*/
function getMTA() external view returns (string memory);
/**
@return addr connected BMC address
*/
function getConnectedBMC() external view returns (address);
/**
@return net network address of the blockchain
*/
function getNetAddress() external view returns (string memory);
/**
@return serializedHash hash of RLP encode from given list of validators
@return addresses list of validators' addresses
*/
function getValidators() external view returns (bytes32, address[] memory);
/**
@notice Used by the relay to resolve next BTP Message to send.
Called by BMC.
@return height height of MerkleTreeAccumulator
@return offset offset of MerkleTreeAccumulator
@return lastHeight block height of last relayed BTP Message
*/
function getStatus()
external
view
returns (
uint256 height,
uint256 offset,
uint256 lastHeight
);
/**
@notice Decodes Relay Messages and process BTP Messages.
If there is an error, then it sends a BTP Message containing the Error Message.
BTP Messages with old sequence numbers are ignored. A BTP Message contains future sequence number will fail.
@param _bmc BTP Address of the BMC handling the message
@param _prev BTP Address of the previous BMC
@param _seq next sequence number to get a message
@param _msg serialized bytes of Relay Message
@return serializedMessages List of serialized bytes of a BTP Message
*/
function handleRelayMessage(
string memory _bmc,
string memory _prev,
uint256 _seq,
string calldata _msg
) external returns (bytes[] memory);
}