@@ -43,6 +43,8 @@ contract ForeignGateway is IForeignGateway {
4343 address arbitrable
4444 );
4545
46+ event ArbitrationCostModified (uint96 indexed _courtID , uint256 _feeForJuror );
47+
4648 // ************************************* //
4749 // * Storage * //
4850 // ************************************* //
@@ -51,7 +53,7 @@ contract ForeignGateway is IForeignGateway {
5153 uint256 public immutable override senderChainID;
5254 address public immutable override senderGateway;
5355 uint256 internal localDisputeID = 1 ; // The disputeID must start from 1 as the KlerosV1 proxy governor depends on this implementation. We now also depend on localDisputeID not ever being zero.
54- uint256 [] internal feeForJuror; // feeForJuror[courtID]
56+ mapping ( uint96 => uint256 ) public feeForJuror; // feeForJuror[courtID], it mirrors the value on KlerosCore.
5557 address public governor;
5658 IFastBridgeReceiver public fastBridgeReceiver;
5759 IFastBridgeReceiver public depreciatedFastbridge;
@@ -79,13 +81,11 @@ contract ForeignGateway is IForeignGateway {
7981 constructor (
8082 address _governor ,
8183 IFastBridgeReceiver _fastBridgeReceiver ,
82- uint256 [] memory _feeForJuror ,
8384 address _senderGateway ,
8485 uint256 _senderChainID
8586 ) {
8687 governor = _governor;
8788 fastBridgeReceiver = _fastBridgeReceiver;
88- feeForJuror = _feeForJuror;
8989 senderGateway = _senderGateway;
9090 senderChainID = _senderChainID;
9191 }
@@ -111,16 +111,9 @@ contract ForeignGateway is IForeignGateway {
111111 * @param _courtID The ID of the court.
112112 * @param _feeForJuror The new value for the `feeForJuror` property value.
113113 */
114- function changeCourtJurorFee (uint96 _courtID , uint256 _feeForJuror ) external onlyByGovernor {
114+ function changeSubcourtJurorFee (uint96 _courtID , uint256 _feeForJuror ) external onlyByGovernor {
115115 feeForJuror[_courtID] = _feeForJuror;
116- }
117-
118- /**
119- * @dev Creates the `feeForJuror` property value for a new court.
120- * @param _feeForJuror The new value for the `feeForJuror` property value.
121- */
122- function createCourtJurorFee (uint256 _feeForJuror ) external onlyByGovernor {
123- feeForJuror.push (_feeForJuror);
116+ emit ArbitrationCostModified (_courtID, _feeForJuror);
124117 }
125118
126119 // ************************************* //
@@ -163,8 +156,7 @@ contract ForeignGateway is IForeignGateway {
163156 }
164157
165158 function arbitrationCost (bytes calldata _extraData ) public view override returns (uint256 cost ) {
166- (uint96 courtID , uint256 minJurors ) = extraDataToCourtIDMinJurors (_extraData);
167-
159+ (uint96 courtID , uint256 minJurors ) = extraDataToSubcourtIDMinJurors (_extraData);
168160 cost = feeForJuror[courtID] * minJurors;
169161 }
170162
@@ -212,7 +204,7 @@ contract ForeignGateway is IForeignGateway {
212204 // * Internal * //
213205 // ************************ //
214206
215- function extraDataToCourtIDMinJurors (
207+ function extraDataToSubcourtIDMinJurors (
216208 bytes memory _extraData
217209 ) internal view returns (uint96 courtID , uint256 minJurors ) {
218210 // Note that here we ignore DisputeKitID
@@ -222,7 +214,7 @@ contract ForeignGateway is IForeignGateway {
222214 courtID := mload (add (_extraData, 0x20 ))
223215 minJurors := mload (add (_extraData, 0x40 ))
224216 }
225- if (courtID >= feeForJuror. length ) courtID = 0 ;
217+ if (feeForJuror[ courtID] == 0 ) courtID = 0 ;
226218 if (minJurors == 0 ) minJurors = MIN_JURORS;
227219 } else {
228220 courtID = 0 ;
0 commit comments