HomeGateway

Git Source

Inherits: IHomeGateway

State Variables

NATIVE_CURRENCY

IERC20 public constant NATIVE_CURRENCY = IERC20(address(0));

governor

address public governor;

arbitrator

IArbitratorV2 public arbitrator;

veaInbox

IVeaInbox public veaInbox;

foreignChainID

uint256 public immutable override foreignChainID;

foreignGateway

address public override foreignGateway;

feeToken

IERC20 public feeToken;

disputeIDtoHash

mapping(uint256 => bytes32) public disputeIDtoHash;

disputeHashtoID

mapping(bytes32 => uint256) public disputeHashtoID;

disputeHashtoRelayedData

mapping(bytes32 => RelayedData) public disputeHashtoRelayedData;

Functions

constructor

constructor(
    address _governor,
    IArbitratorV2 _arbitrator,
    IVeaInbox _veaInbox,
    uint256 _foreignChainID,
    address _foreignGateway,
    IERC20 _feeToken
);

changeGovernor

Changes the governor.

function changeGovernor(address _governor) external;

Parameters

NameTypeDescription
_governoraddressThe address of the new governor.

changeArbitrator

Changes the arbitrator.

function changeArbitrator(IArbitratorV2 _arbitrator) external;

Parameters

NameTypeDescription
_arbitratorIArbitratorV2The address of the new arbitrator.

changeVea

Changes the vea inbox, useful to increase the claim deposit.

function changeVea(IVeaInbox _veaInbox) external;

Parameters

NameTypeDescription
_veaInboxIVeaInboxThe address of the new vea inbox.

changeForeignGateway

Changes the foreign gateway.

function changeForeignGateway(address _foreignGateway) external;

Parameters

NameTypeDescription
_foreignGatewayaddressThe address of the new foreign gateway.

changeFeeToken

Changes the fee token.

function changeFeeToken(IERC20 _feeToken) external;

Parameters

NameTypeDescription
_feeTokenIERC20The address of the new fee token.

relayCreateDispute

Relays a dispute creation from the ForeignGateway to the home arbitrator using the same parameters as the ones on the foreign chain. Providing incorrect parameters will create a different hash than on the foreignChain and will not affect the actual dispute/arbitrable's ruling. This function accepts the fees payment in the native currency of the home chain, typically ETH.

function relayCreateDispute(RelayCreateDisputeParams memory _params) external payable override;

Parameters

NameTypeDescription
_paramsRelayCreateDisputeParamsThe parameters of the dispute, see RelayCreateDisputeParams.

relayCreateDispute

Relays a dispute creation from the ForeignGateway to the home arbitrator using the same parameters as the ones on the foreign chain. Providing incorrect parameters will create a different hash than on the foreignChain and will not affect the actual dispute/arbitrable's ruling. This function accepts the fees payment in the native currency of the home chain, typically ETH.

function relayCreateDispute(RelayCreateDisputeParams memory _params, uint256 _feeAmount) external;

Parameters

NameTypeDescription
_paramsRelayCreateDisputeParamsThe parameters of the dispute, see RelayCreateDisputeParams.
_feeAmountuint256

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
_disputeIDuint256The identifier 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

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

Parameters

NameTypeDescription
_disputeHashbytes32dispute hash

Returns

NameTypeDescription
<none>uint256disputeID dispute identifier on the home chain

receiverGateway

function receiverGateway() external view override returns (address);

Structs

RelayedData

struct RelayedData {
    uint256 arbitrationCost;
    address relayer;
}