diff --git a/src/interfaces/IFeedOracle.sol b/src/interfaces/IFeedOracle.sol deleted file mode 100644 index 5fa5851..0000000 --- a/src/interfaces/IFeedOracle.sol +++ /dev/null @@ -1,22 +0,0 @@ -// This file is part of Darwinia. -// Copyright (C) 2018-2023 Darwinia Network -// SPDX-License-Identifier: GPL-3.0 -// -// Darwinia is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// Darwinia is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with Darwinia. If not, see . - -pragma solidity 0.8.17; - -interface IFeedOracle { - function messageRootOf(uint256 chainid) external view returns (bytes32); -} diff --git a/src/interfaces/IORMP.sol b/src/interfaces/IORMP.sol index e3a65ba..f2b12de 100644 --- a/src/interfaces/IORMP.sol +++ b/src/interfaces/IORMP.sol @@ -53,9 +53,7 @@ interface IORMP { /// @param message Verified receive message info. /// @param proof Message proof of this message. /// @return dispatchResult Result of the message dispatch. - function recv(Message calldata message, bytes calldata proof) external returns (bool dispatchResult); - - function prove() external view returns (bytes32[32] memory); + function recv(Message calldata message, bytes calldata proof) external payable returns (bool dispatchResult); /// @dev Fetch user application config. /// @notice If user application has not configured, then the default config is used. diff --git a/src/security/ExcessivelySafeCall.sol b/src/security/ExcessivelySafeCall.sol index a1d6518..6b953a3 100644 --- a/src/security/ExcessivelySafeCall.sol +++ b/src/security/ExcessivelySafeCall.sol @@ -4,8 +4,6 @@ pragma solidity 0.8.17; // Inspired: https://github.com/LayerZero-Labs/solidity-examples/blob/main/contracts/util/ExcessivelySafeCall.sol library ExcessivelySafeCall { - uint256 private constant LOW_28_MASK = 0x00000000ffffffffffffffffffffffffffffffffffffffffffffffffffffffff; - /// @notice Use when you _really_ really _really_ don't trust the called /// contract. This prevents the called contract from causing reversion of /// the caller in as many ways as we can. @@ -104,25 +102,4 @@ library ExcessivelySafeCall { } return (_success, _returnData); } - - /// @notice Swaps function selectors in encoded contract calls - /// @dev Allows reuse of encoded calldata for functions with identical - /// argument types but different names. It simply swaps out the first 4 bytes - /// for the new selector. This function modifies memory in place, and should - /// only be used with caution. - /// @param _newSelector The new 4-byte selector - /// @param _buf The encoded contract args - function swapSelector(bytes4 _newSelector, bytes memory _buf) internal pure { - require(_buf.length >= 4); - uint256 _mask = LOW_28_MASK; - assembly ("memory-safe") { - // load the first word of - let _word := mload(add(_buf, 0x20)) - // mask out the top 4 bytes - // /x - _word := and(_word, _mask) - _word := or(_newSelector, _word) - mstore(add(_buf, 0x20), _word) - } - } }