HomeGateway

Git Source

Inherits: IHomeGateway

State Variables

governor

address public governor;

arbitrator

IArbitrator public arbitrator;

fastBridgeSender

IFastBridgeSender public fastBridgeSender;

receiverGateway

address public override receiverGateway;

receiverChainID

uint256 public immutable override receiverChainID;

disputeIDtoHash

mapping(uint256 => bytes32) public disputeIDtoHash;

disputeHashtoID

mapping(bytes32 => uint256) public disputeHashtoID;

disputeHashtoRelayedData

mapping(bytes32 => RelayedData) public disputeHashtoRelayedData;

Functions

constructor

constructor(
    address _governor,
    IArbitrator _arbitrator,
    IFastBridgeSender _fastBridgeSender,
    address _receiverGateway,
    uint256 _receiverChainID
);

changeGovernor

Changes the governor.

function changeGovernor(address _governor) external;

Parameters

NameTypeDescription
_governoraddressThe address of the new governor.

changeArbitrator

Changes the arbitrator.

function changeArbitrator(IArbitrator _arbitrator) external;

Parameters

NameTypeDescription
_arbitratorIArbitratorThe address of the new arbitrator.

changeFastbridge

Changes the fastBridge, useful to increase the claim deposit.

function changeFastbridge(IFastBridgeSender _fastBridgeSender) external;

Parameters

NameTypeDescription
_fastBridgeSenderIFastBridgeSenderThe address of the new fastBridge.

changeReceiverGateway

Changes the receiver gateway.

function changeReceiverGateway(address _receiverGateway) external;

Parameters

NameTypeDescription
_receiverGatewayaddressThe address of the new receiver gateway.

relayCreateDispute

Provide the same parameters as on the foreignChain while creating a dispute. Providing incorrect parameters will create a different hash than on the foreignChain and will not affect the actual dispute/arbitrable's ruling.

function relayCreateDispute(
    uint256 _foreignChainID,
    bytes32 _foreignBlockHash,
    uint256 _foreignDisputeID,
    uint256 _choices,
    bytes calldata _extraData,
    address _arbitrable
) external payable override;

Parameters

NameTypeDescription
_foreignChainIDuint256foreignChainId
_foreignBlockHashbytes32foreignBlockHash
_foreignDisputeIDuint256foreignDisputeID
_choicesuint256number of ruling choices
_extraDatabytesextraData
_arbitrableaddressarbitrable

rule

Give a ruling for a dispute. Must be called by the arbitrator. The purpose of this function is to ensure that the address calling it has the right to rule on the contract.

function rule(uint256 _disputeID, uint256 _ruling) external override;

Parameters

NameTypeDescription
_disputeIDuint256ID of the dispute in the Arbitrator contract.
_rulinguint256Ruling given by the arbitrator. Note that 0 is reserved for "Not able/wanting to make a decision".

disputeHashToHomeID

Looks up the local home disputeID for a disputeHash. For cross-chain Evidence standard.

function disputeHashToHomeID(bytes32 _disputeHash) external view override returns (uint256);

Parameters

NameTypeDescription
_disputeHashbytes32dispute hash

Structs

RelayedData

struct RelayedData {
    uint256 arbitrationCost;
    address relayer;
}