ForeignGateway
Inherits: IForeignGateway
State Variables
DEFAULT_NB_OF_JURORS
uint256 public constant DEFAULT_NB_OF_JURORS = 3;
localDisputeID
uint256 internal localDisputeID = 1;
feeForJuror
mapping(uint96 => uint256) public feeForJuror;
governor
address public governor;
veaOutbox
address public veaOutbox;
homeChainID
uint256 public immutable override homeChainID;
homeGateway
address public override homeGateway;
deprecatedVeaOutbox
address public deprecatedVeaOutbox;
deprecatedVeaOutboxExpiration
uint256 public deprecatedVeaOutboxExpiration;
disputeHashtoDisputeData
mapping(bytes32 => DisputeData) public disputeHashtoDisputeData;
Functions
onlyFromVea
modifier onlyFromVea(address _messageSender);
onlyByGovernor
modifier onlyByGovernor();
constructor
constructor(address _governor, address _veaOutbox, uint256 _homeChainID, address _homeGateway);
changeGovernor
Changes the governor.
function changeGovernor(address _governor) external;
Parameters
Name | Type | Description |
---|---|---|
_governor | address | The address of the new governor. |
changeVea
Changes the outbox.
function changeVea(address _veaOutbox, uint256 _gracePeriod) external onlyByGovernor;
Parameters
Name | Type | Description |
---|---|---|
_veaOutbox | address | The address of the new outbox. |
_gracePeriod | uint256 | The duration to accept messages from the deprecated bridge (if at all). |
changeHomeGateway
Changes the home gateway.
function changeHomeGateway(address _homeGateway) external;
Parameters
Name | Type | Description |
---|---|---|
_homeGateway | address | The address of the new home gateway. |
changeCourtJurorFee
Changes the feeForJuror
property value of a specified court.
function changeCourtJurorFee(uint96 _courtID, uint256 _feeForJuror) external onlyByGovernor;
Parameters
Name | Type | Description |
---|---|---|
_courtID | uint96 | The ID of the court on the v2 arbitrator. Not to be confused with the courtID on KlerosLiquid. |
_feeForJuror | uint256 | The new value for the feeForJuror property value. |
createDispute
Create a dispute and pay for the fees in the native currency, typically ETH. Must be called by the arbitrable contract. Must pay at least arbitrationCost(_extraData).
function createDispute(uint256 _choices, bytes calldata _extraData)
external
payable
override
returns (uint256 disputeID);
Parameters
Name | Type | Description |
---|---|---|
_choices | uint256 | |
_extraData | bytes | Additional info about the dispute. We use it to pass the ID of the dispute's court (first 32 bytes), the minimum number of jurors required (next 32 bytes) and the ID of the specific dispute kit (last 32 bytes). |
Returns
Name | Type | Description |
---|---|---|
disputeID | uint256 | The identifier of the dispute created. |
createDispute
Create a dispute and pay for the fees in the native currency, typically ETH. Must be called by the arbitrable contract. Must pay at least arbitrationCost(_extraData).
function createDispute(uint256, bytes calldata, IERC20, uint256) external pure override returns (uint256);
Parameters
Name | Type | Description |
---|---|---|
<none> | uint256 | |
<none> | bytes | |
<none> | IERC20 | |
<none> | uint256 |
Returns
Name | Type | Description |
---|---|---|
<none> | uint256 | disputeID The identifier of the dispute created. |
arbitrationCost
Compute the cost of arbitration denominated in the native currency, typically ETH. It is recommended not to increase it often, as it can be highly time and gas consuming for the arbitrated contracts to cope with fee augmentation.
function arbitrationCost(bytes calldata _extraData) public view override returns (uint256 cost);
Parameters
Name | Type | Description |
---|---|---|
_extraData | bytes | Additional info about the dispute. We use it to pass the ID of the dispute's court (first 32 bytes), the minimum number of jurors required (next 32 bytes) and the ID of the specific dispute kit (last 32 bytes). |
Returns
Name | Type | Description |
---|---|---|
cost | uint256 | The arbitration cost in ETH. |
arbitrationCost
Compute the cost of arbitration denominated in the native currency, typically ETH. It is recommended not to increase it often, as it can be highly time and gas consuming for the arbitrated contracts to cope with fee augmentation.
function arbitrationCost(bytes calldata, IERC20) public pure override returns (uint256);
Parameters
Name | Type | Description |
---|---|---|
<none> | bytes | |
<none> | IERC20 |
Returns
Name | Type | Description |
---|---|---|
<none> | uint256 | cost The arbitration cost in ETH. |
relayRule
Relay the rule call from the home gateway to the arbitrable.
function relayRule(address _messageSender, bytes32 _disputeHash, uint256 _ruling, address _relayer)
external
override
onlyFromVea(_messageSender);
withdrawFees
Reimburses the dispute fees to the relayer who paid for these fees on the home chain.
function withdrawFees(bytes32 _disputeHash) external override;
Parameters
Name | Type | Description |
---|---|---|
_disputeHash | bytes32 | The dispute hash for which to withdraw the fees. |
disputeHashToForeignID
Looks up the local foreign disputeID for a disputeHash
function disputeHashToForeignID(bytes32 _disputeHash) external view override returns (uint256);
Parameters
Name | Type | Description |
---|---|---|
_disputeHash | bytes32 | dispute hash |
senderGateway
function senderGateway() external view override returns (address);
currentRuling
function currentRuling(uint256) public pure returns (uint256, bool, bool);
extraDataToCourtIDMinJurors
function extraDataToCourtIDMinJurors(bytes memory _extraData)
internal
view
returns (uint96 courtID, uint256 minJurors);
Events
ArbitrationCostModified
event ArbitrationCostModified(uint96 indexed _courtID, uint256 _feeForJuror);
Structs
DisputeData
struct DisputeData {
uint248 id;
bool ruled;
address arbitrable;
uint256 paid;
address relayer;
}