all files / contracts/mocks/ MockFaultyReceiver.sol

66.67% Statements 2/3
100% Branches 2/2
50% Functions 1/2
75% Lines 3/4
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36                                                            15× 15×      
// SPDX-License-Identifier: GPL-3.0-or-later
pragma solidity 0.8.6;
 
/**
 * @title Mock Faulty Receiver
 * @author solace.fi
 * @notice A contract that throws if sent ETH.
 */
contract MockFaultyReceiver {
 
    /**
     * @notice Fallback function to allow contract to receive **ETH**.
     */
    receive () external payable {
        revert("get stickbugged");
    }
 
    /**
     * @notice Fallback function to allow contract to receive **ETH**.
     */
    fallback () external payable {
        revert("get stickbugged");
    }
 
    /**
     * @notice Forwards a call to another contract.
     * Do not use in production.
     * @param to Contract to call.
     * @param data Data to send.
     */
    function forwardCall(address payable to, bytes calldata data) external payable {
        (bool success, ) = to.call{value: msg.value}(data);
        require(success, "could not forward call");
    }
}