Skip to content

Commit

Permalink
use Address lib
Browse files Browse the repository at this point in the history
  • Loading branch information
zkbenny committed Mar 29, 2024
1 parent 2e8927d commit a82bb8b
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 17 deletions.
10 changes: 3 additions & 7 deletions contracts/Arbitrator.sol
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import {OwnableUpgradeable} from "@openzeppelin/contracts-upgradeable/access/Own
import {UUPSUpgradeable} from "@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol";
import {ReentrancyGuardUpgradeable} from "@openzeppelin/contracts-upgradeable/security/ReentrancyGuardUpgradeable.sol";
import {DoubleEndedQueueUpgradeable} from "@openzeppelin/contracts-upgradeable/utils/structs/DoubleEndedQueueUpgradeable.sol";
import {Address} from "@openzeppelin/contracts/utils/Address.sol";
import {IArbitrator} from "./interfaces/IArbitrator.sol";
import {IL1Gateway} from "./interfaces/IL1Gateway.sol";
import {IAdmin} from "./zksync/l1-contracts/zksync/interfaces/IAdmin.sol";
Expand Down Expand Up @@ -200,12 +201,7 @@ contract Arbitrator is IArbitrator, OwnableUpgradeable, UUPSUpgradeable, Reentra
}
// Call the claim interface of source chain message service
// And it will inner call the `claimCallback` interface of source chain L1Gateway
(bool success, bytes memory returnData) = _sourceChainCanonicalMessageService.call(_sourceChainClaimCallData);
if (!success) {
// Propagate an error if the call fails.
assembly {
revert(add(returnData, 0x20), mload(returnData))
}
}
// No use of return value
Address.functionCall(_sourceChainCanonicalMessageService, _sourceChainClaimCallData);
}
}
6 changes: 1 addition & 5 deletions contracts/dev-contracts/DummyArbitrator.sol
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,7 @@ contract DummyArbitrator is IArbitrator, OwnableUpgradeable, UUPSUpgradeable, Re
_gateway.sendMessage{value: msg.value + _value}(_value, _callData, _adapterParams);
}

function claimMessage(
address,
bytes calldata,
bytes memory
) external payable {
function claimMessage(address, bytes calldata, bytes memory) external payable {
// do nothing
}
}
10 changes: 5 additions & 5 deletions hardhat.base.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,18 +16,18 @@ const hardhatUserConfig = {
},
],
overrides: {
"contracts/Arbitrator.sol": {
version: "0.8.25",
'contracts/Arbitrator.sol': {
version: '0.8.25',
settings: {
viaIR: true,
optimizer: {
enabled: true,
runs: 200,
},
evmVersion: "cancun",
evmVersion: 'cancun',
},
}
}
},
},
},
networks: {
hardhat: {
Expand Down

0 comments on commit a82bb8b

Please sign in to comment.