0

I encounter an error specifying contract "FlashLoanReceiver.sol" should be marked as abstract. Is that means I missed the constructor line?

Thank you for your kind help

pragma solidity ^0.6.0;

import "./IFlashLoanReceiver.sol";

contract FlashLoanReceiverBase is IFlashLoanReceiver {
    using SafeMath for uint256;

    address constant ETHADDRESS = 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE;

    ILendingPoolAddressesProvider public addressesProvider;

    constructor(address _provider) internal {
        addressesProvider = ILendingPoolAddressesProvider(_provider);
    }

    fallback() external payable {}

    function transferFundsBackToPoolInternal(address _reserve, uint256 _amount)
        internal
    {
        address payable core = addressesProvider.getLendingPoolCore();
        transferInternal(core, _reserve, _amount);
    }

    function transferInternal(
        address payable _destination,
        address _reserve,
        uint256 _amount
    ) internal {
        if (_reserve == ETHADDRESS) {
            //solium-disable-next-line
            _destination.call.value(_amount)("10000");
            return;
        }

        IERC20(_reserve).transfer(_destination, _amount);
    }

    function getBalanceInternal(address _target, address _reserve)
        internal
        view
        returns (uint256)
    {
        if (_reserve == ETHADDRESS) {
            return _target.balance;
        }

        return IERC20(_reserve).balanceOf(_target);
    }
}
3
  • You probably have interface methods that you forgot to implement. Jun 13 at 7:47
  • I see, The warning says "This contract has a payable fallback function, but no receive ether function. Consider adding a receive ether function." Is this consider interface methods that I forgot to implement? Thank you for helping. Jun 13 at 10:00
  • Possibly related stackoverflow.com/questions/59651032/… Jun 13 at 11:12

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.