Contract 0xe64b4a92dbe49fdea6290a7b8c4fa7ca71062040

Txn Hash Method
Block
From
To
Value [Txn Fee]
0xcc35f2fb8eec16ee04c3ebaba1507628fb68c261e307309fdcc209e10098b472Withdraw65818082023-01-20 17:12:24433 days 18 hrs ago0x9c9fff2a2b261b7eb61e0294195bc93720963854 IN  0xe64b4a92dbe49fdea6290a7b8c4fa7ca710620400 CRO1.620768149410
0x8f2da7c53ad6cb9799078fe7403ee6779045fd23d51415036de14b0e2d8cca3dDeposit65806802023-01-20 15:26:02433 days 20 hrs ago0x9c9fff2a2b261b7eb61e0294195bc93720963854 IN  0xe64b4a92dbe49fdea6290a7b8c4fa7ca710620400 CRO1.8422760655310
0x882b40f734f784777363edd8900535459b14c8a96bf0c9c416358d88768bbb92Deposit65800192023-01-20 14:23:41433 days 21 hrs ago0x9c9fff2a2b261b7eb61e0294195bc93720963854 IN  0xe64b4a92dbe49fdea6290a7b8c4fa7ca710620400 CRO1.8422873507740
0x58ad57c923f88fc292fd472ac9e763ff4e22b8440f3c62fbb5913af3f1b04097Deposit65715422023-01-20 1:05:28434 days 10 hrs ago0x9c9fff2a2b261b7eb61e0294195bc93720963854 IN  0xe64b4a92dbe49fdea6290a7b8c4fa7ca710620400 CRO1.8424362382430
0x851d43afa790261beac63f440bf01b9fc0a1ebf543bdbad482bdf1b9f99dde69Deposit65506412023-01-18 16:15:05435 days 19 hrs ago0x9c9fff2a2b261b7eb61e0294195bc93720963854 IN  0xe64b4a92dbe49fdea6290a7b8c4fa7ca710620400 CRO1.8427997438290
0x2b5463aa67be778ad336769fe0a61865bc82fcd649890e4ef56112ce2d2cfaf9Deposit65397152023-01-17 22:32:40436 days 13 hrs ago0x9c9fff2a2b261b7eb61e0294195bc93720963854 IN  0xe64b4a92dbe49fdea6290a7b8c4fa7ca710620400 CRO2.735299921060
0x6af17d73bae2959035168ffb231ba484f76fda54e50ca76caf30d17127cac5f6Deposit65344922023-01-17 14:21:09436 days 21 hrs ago0x9c9fff2a2b261b7eb61e0294195bc93720963854 IN  0xe64b4a92dbe49fdea6290a7b8c4fa7ca710620400 CRO2.6629629201990
0xe3fe8c66bb79cd6d254975b2bf8dc6776a5341b5bdc8d9adf86ce4f4103eede0Deposit65261672023-01-17 1:16:57437 days 10 hrs ago0x9c9fff2a2b261b7eb61e0294195bc93720963854 IN  0xe64b4a92dbe49fdea6290a7b8c4fa7ca710620400 CRO2.663169480350
0x93dc324682927481e709a762fbe84e531bf240301eb8632d62f01dbe525d4e64Deposit65171192023-01-16 11:03:00438 days 36 mins ago0x9c9fff2a2b261b7eb61e0294195bc93720963854 IN  0xe64b4a92dbe49fdea6290a7b8c4fa7ca710620400 CRO2.7358736735950
0xb868515a11e20ca8f4f4f2b20322f318eb5869f5ba56fc61c59d2ca2d3944570Deposit65043522023-01-15 15:00:21438 days 20 hrs ago0x9c9fff2a2b261b7eb61e0294195bc93720963854 IN  0xe64b4a92dbe49fdea6290a7b8c4fa7ca710620400 CRO2.7361997936530
0x279ce94c173567000d70fecb7e985848bb71f2ace313f245736d05694a7fe45dDeposit64861582023-01-14 10:27:16440 days 1 hr ago0x9c9fff2a2b261b7eb61e0294195bc93720963854 IN  0xe64b4a92dbe49fdea6290a7b8c4fa7ca710620400 CRO2.6641657909690
0x159d41386fbb777e8d2022528ec090f83a0029af7ef876e514b2768d1497c4ccDeposit64759772023-01-13 18:26:40440 days 17 hrs ago0x9c9fff2a2b261b7eb61e0294195bc93720963854 IN  0xe64b4a92dbe49fdea6290a7b8c4fa7ca710620400 CRO2.8433306596230
0x5f34e765119ccfd0309e076c39b5893d86357ae71c91bd3a740962862867c885Deposit64758902023-01-13 18:18:29440 days 17 hrs ago0x9c9fff2a2b261b7eb61e0294195bc93720963854 IN  0xe64b4a92dbe49fdea6290a7b8c4fa7ca710620400 CRO2.6122127112610
0xfb4aaf40179dfe615293264286556d4773b175db692f2ca399cd93c52854ce93Deposit64609972023-01-12 18:57:22441 days 16 hrs ago0x9c9fff2a2b261b7eb61e0294195bc93720963854 IN  0xe64b4a92dbe49fdea6290a7b8c4fa7ca710620400 CRO2.6647966695430
0x83142090406cd74f46d51f01f9f1c1fbf5afe0d9560809d99f52adc552b36f86Deposit64509222023-01-12 3:06:01442 days 8 hrs ago0x9c9fff2a2b261b7eb61e0294195bc93720963854 IN  0xe64b4a92dbe49fdea6290a7b8c4fa7ca710620400 CRO2.8440660520180
0x444d935f117e2a7cdf70866789c1fe44049683b7a366e840ac3773437a6a7a22Deposit64479292023-01-11 22:21:34442 days 13 hrs ago0x9c9fff2a2b261b7eb61e0294195bc93720963854 IN  0xe64b4a92dbe49fdea6290a7b8c4fa7ca710620400 CRO2.7376576318010
0xf223afe3e7455cae6262741c4f0895be516f49595d6cddb2fd9b468dafb91000Deposit64334652023-01-10 23:29:41443 days 12 hrs ago0x9c9fff2a2b261b7eb61e0294195bc93720963854 IN  0xe64b4a92dbe49fdea6290a7b8c4fa7ca710620400 CRO2.6654947388540
0x29b4f48f0f597c8d3cf86e60ca26a29f18b5f449d2eee6ae2046094ee39cca73Deposit64237172023-01-10 8:10:36444 days 3 hrs ago0x9c9fff2a2b261b7eb61e0294195bc93720963854 IN  0xe64b4a92dbe49fdea6290a7b8c4fa7ca710620400 CRO2.7722557734060
0x3b83483602d4f32ca844dd7a13a040224b2e3078296108502132f24c7b7be1d5Deposit64236822023-01-10 8:07:19444 days 3 hrs ago0x9c9fff2a2b261b7eb61e0294195bc93720963854 IN  0xe64b4a92dbe49fdea6290a7b8c4fa7ca710620400 CRO2.6657437967650
0x8606ff289c6d33d1a9ec8f3637c4ef926ec713d3df866fccc0d220f3431f8575Deposit63848582023-01-07 19:10:41446 days 16 hrs ago0x9c9fff2a2b261b7eb61e0294195bc93720963854 IN  0xe64b4a92dbe49fdea6290a7b8c4fa7ca710620400 CRO2.7393035657770
0x817a99815fd05940ef6ac41a15f183f44405718db78a080b4901e7f54520ef36Deposit63824772023-01-07 15:26:13446 days 20 hrs ago0x9c9fff2a2b261b7eb61e0294195bc93720963854 IN  0xe64b4a92dbe49fdea6290a7b8c4fa7ca710620400 CRO2.7733444783560
0x449ee9cd5b7c8ce1fa21c5817ec8530304466e21718c967058af07b695a806deDeposit63824512023-01-07 15:23:45446 days 20 hrs ago0x9c9fff2a2b261b7eb61e0294195bc93720963854 IN  0xe64b4a92dbe49fdea6290a7b8c4fa7ca710620400 CRO2.7393655363470
0xd59731cfc1e01290596c2806b8ae74a7a581fdbf1c554d5511d580b595ce07f8Deposit63591542023-01-06 2:49:58448 days 8 hrs ago0x9c9fff2a2b261b7eb61e0294195bc93720963854 IN  0xe64b4a92dbe49fdea6290a7b8c4fa7ca710620400 CRO2.7399750394090
0xe47f93317db0c74bc92e56906e016c4d851248adf4d19d6408ca5c43f0470998Deposit63365952023-01-04 15:21:08449 days 20 hrs ago0x9c9fff2a2b261b7eb61e0294195bc93720963854 IN  0xe64b4a92dbe49fdea6290a7b8c4fa7ca710620400 CRO2.6679483359040
0x566b8fb39ea4c3ccf471b5722d4a4e4861adfc6dc6b749f4fe839ee3dc0a6b26Deposit63338212023-01-04 10:59:13450 days 40 mins ago0x9c9fff2a2b261b7eb61e0294195bc93720963854 IN  0xe64b4a92dbe49fdea6290a7b8c4fa7ca710620400 CRO2.7745643652550
[ Download CSV Export 
Latest 1 internal transaction
Parent Txn Hash Block From To Value
0x7becc8b1066ce15e8ecdc5eee75618e0a74d9b4db8ff8c7ab27bde3b42d501cf53646022022-11-01 20:28:01513 days 15 hrs ago 0x6cfabd1ff774453bf125a29aa9258d1b18b38ebf  Contract Creation0 CRO
[ Download CSV Export 
Index Block
Loading

Similar Match Source Code
This contract matches the deployed Bytecode of the Source Code for Contract 0xe7e294C1d219775b04C037309f22306Ee13165d2
The constructor portion of the code might be different and could alter the actual behaviour of the contract

Contract Name:
FarmBoosterProxy

Compiler Version
v0.8.4+commit.c7e474f2

Optimization Enabled:
Yes with 200 runs

Other Settings:
default evmVersion
File 1 of 8 : FarmBoosterProxy.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";
import "@openzeppelin/contracts/security/ReentrancyGuard.sol";
import "../interfaces/IMasterChef.sol";
import "../interfaces/IFarmBooster.sol";

contract FarmBoosterProxy is ReentrancyGuard {
    using SafeERC20 for IERC20;

    // The address of the farm booster proxy factory
    address public immutable FARM_BOOSTER_PROXY_FACTORY;
    IMasterChef public masterchef;
    IERC20 public candyToken;
    IFarmBooster public farmBooster;

    address public admin;
    // Whether it is initialized
    bool public isInitialized;
    // Record whether lp was approved
    mapping(address => bool) public lpApproved;

    event DepositByProxy(
        address indexed user,
        address indexed proxy,
        uint256 indexed pid,
        uint256 amount
    );
    event WithdrawByProxy(
        address indexed user,
        address indexed proxy,
        uint256 indexed pid,
        uint256 amount
    );
    event EmergencyWithdrawByProxy(
        address indexed user,
        address indexed proxy,
        uint256 indexed pid
    );

    /**
     * @notice Constructor
     */
    constructor() {
        FARM_BOOSTER_PROXY_FACTORY = msg.sender;
    }

    /**
     * @notice Checks if the msg.sender is the admin address.
     */
    modifier onlyAdmin() {
        require(msg.sender == admin, "admin: wut?");
        _;
    }

    /**
     * @notice It initializes the contract
     * @dev It can only be called once.
     * @param _admin: the admin address
     * @param _farmBooster: the farm booster address
     * @param _masterchef: the address of the Masterchef V2
     * @param _candyToken: the address of the candy token
     */
    function initialize(
        address _admin,
        address _farmBooster,
        address _masterchef,
        address _candyToken
    ) external {
        require(!isInitialized, "Operations: Already initialized");
        require(
            msg.sender == FARM_BOOSTER_PROXY_FACTORY,
            "Operations: Not factory"
        );

        // Make this contract initialized
        isInitialized = true;
        admin = _admin;
        farmBooster = IFarmBooster(_farmBooster);
        masterchef = IMasterChef(_masterchef);
        candyToken = IERC20(_candyToken);
    }

    /**
     * @notice Deposit LP tokens to pool.
     * @dev It can only be called by admin.
     * @param _pid The id of the pool.
     * @param _amount Amount of LP tokens to deposit.
     * @param _referrer Referrer.
     */
    function deposit(
        uint256 _pid,
        uint256 _amount,
        address _referrer
    ) external nonReentrant onlyAdmin {
        uint256 poolLength = masterchef.poolLength();
        require(_pid < poolLength, "Pool is not exist");
        address lpAddress = masterchef.lpToken(_pid);
        IERC20(lpAddress).safeTransferFrom(msg.sender, address(this), _amount);
        if (!lpApproved[lpAddress]) {
            IERC20(lpAddress).approve(address(masterchef), type(uint256).max);
            lpApproved[lpAddress] = true;
        }
        masterchef.deposit(_pid, _amount, _referrer);
        harvestCandy();
        farmBooster.updatePoolBoostMultiplier(msg.sender, _pid);
        emit DepositByProxy(msg.sender, address(this), _pid, _amount);
    }

    /**
     * @notice Withdraw LP tokens from pool.
     * @dev It can only be called by admin.
     * @param _pid The id of the pool.
     * @param _amount Amount of LP tokens to withdraw.
     */
    function withdraw(uint256 _pid, uint256 _amount)
        external
        nonReentrant
        onlyAdmin
    {
        uint256 poolLength = masterchef.poolLength();
        require(_pid < poolLength, "Pool is not exist");
        masterchef.withdraw(_pid, _amount);
        address lpAddress = masterchef.lpToken(_pid);
        IERC20(lpAddress).safeTransfer(msg.sender, _amount);
        harvestCandy();
        farmBooster.updatePoolBoostMultiplier(msg.sender, _pid);
        emit WithdrawByProxy(msg.sender, address(this), _pid, _amount);
    }

    /**
     * @notice Withdraw without caring about the rewards. EMERGENCY ONLY.
     * @dev It can only be called by admin.
     * @param _pid The id of the pool.
     */
    function emergencyWithdraw(uint256 _pid) external nonReentrant onlyAdmin {
        uint256 poolLength = masterchef.poolLength();
        require(_pid < poolLength, "Pool is not exist");
        masterchef.emergencyWithdraw(_pid);
        address lpAddress = masterchef.lpToken(_pid);
        IERC20(lpAddress).safeTransfer(
            msg.sender,
            IERC20(lpAddress).balanceOf(address(this))
        );
        harvestCandy();
        farmBooster.updatePoolBoostMultiplier(msg.sender, _pid);
        emit EmergencyWithdrawByProxy(msg.sender, address(this), _pid);
    }

    function harvestCandy() internal {
        uint256 candyBalance = candyToken.balanceOf(address(this));
        if (candyBalance > 0) {
            candyToken.safeTransfer(msg.sender, candyBalance);
        }
    }
}

File 2 of 8 : IFarmBooster.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

interface IFarmBooster {
    function onCandyPoolUpdate(
        address _user,
        uint256 _lockedAmount,
        uint256 _lockedDuration,
        uint256 _totalLockedAmount,
        uint256 _maxLockDuration
    ) external;

    function updatePoolBoostMultiplier(address _user, uint256 _pid) external;

    function setProxy(address _user, address _proxy) external;

    function isBoosterPool(address _user, uint256 _pid)
        external
        view
        returns (bool);
}

File 3 of 8 : IMasterChef.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

interface IMasterChef {
    function deposit(
        uint256 _pid,
        uint256 _amount,
        address _referrer
    ) external;

    function withdraw(uint256 _pid, uint256 _amount) external;

    function pendingCandy(uint256 _pid, address _user)
        external
        view
        returns (uint256);

    function userInfo(uint256 _pid, address _user)
        external
        view
        returns (
            uint256,
            uint256,
            uint256
        );

    function emergencyWithdraw(uint256 _pid) external;

    function lpToken(uint256 _pid) external view returns (address);

    function poolLength() external view returns (uint256 pools);

    function getBoostMultiplier(address _user, uint256 _pid)
        external
        view
        returns (uint256);

    function updateBoostMultiplier(
        address _user,
        uint256 _pid,
        uint256 _newMultiplier
    ) external;
}

File 4 of 8 : ReentrancyGuard.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (security/ReentrancyGuard.sol)

pragma solidity ^0.8.0;

/**
 * @dev Contract module that helps prevent reentrant calls to a function.
 *
 * Inheriting from `ReentrancyGuard` will make the {nonReentrant} modifier
 * available, which can be applied to functions to make sure there are no nested
 * (reentrant) calls to them.
 *
 * Note that because there is a single `nonReentrant` guard, functions marked as
 * `nonReentrant` may not call one another. This can be worked around by making
 * those functions `private`, and then adding `external` `nonReentrant` entry
 * points to them.
 *
 * TIP: If you would like to learn more about reentrancy and alternative ways
 * to protect against it, check out our blog post
 * https://blog.openzeppelin.com/reentrancy-after-istanbul/[Reentrancy After Istanbul].
 */
abstract contract ReentrancyGuard {
    // Booleans are more expensive than uint256 or any type that takes up a full
    // word because each write operation emits an extra SLOAD to first read the
    // slot's contents, replace the bits taken up by the boolean, and then write
    // back. This is the compiler's defense against contract upgrades and
    // pointer aliasing, and it cannot be disabled.

    // The values being non-zero value makes deployment a bit more expensive,
    // but in exchange the refund on every call to nonReentrant will be lower in
    // amount. Since refunds are capped to a percentage of the total
    // transaction's gas, it is best to keep them low in cases like this one, to
    // increase the likelihood of the full refund coming into effect.
    uint256 private constant _NOT_ENTERED = 1;
    uint256 private constant _ENTERED = 2;

    uint256 private _status;

    constructor() {
        _status = _NOT_ENTERED;
    }

    /**
     * @dev Prevents a contract from calling itself, directly or indirectly.
     * Calling a `nonReentrant` function from another `nonReentrant`
     * function is not supported. It is possible to prevent this from happening
     * by making the `nonReentrant` function external, and making it call a
     * `private` function that does the actual work.
     */
    modifier nonReentrant() {
        // On the first call to nonReentrant, _notEntered will be true
        require(_status != _ENTERED, "ReentrancyGuard: reentrant call");

        // Any calls to nonReentrant after this point will fail
        _status = _ENTERED;

        _;

        // By storing the original value once again, a refund is triggered (see
        // https://eips.ethereum.org/EIPS/eip-2200)
        _status = _NOT_ENTERED;
    }
}

File 5 of 8 : SafeERC20.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.0) (token/ERC20/utils/SafeERC20.sol)

pragma solidity ^0.8.0;

import "../IERC20.sol";
import "../extensions/draft-IERC20Permit.sol";
import "../../../utils/Address.sol";

/**
 * @title SafeERC20
 * @dev Wrappers around ERC20 operations that throw on failure (when the token
 * contract returns false). Tokens that return no value (and instead revert or
 * throw on failure) are also supported, non-reverting calls are assumed to be
 * successful.
 * To use this library you can add a `using SafeERC20 for IERC20;` statement to your contract,
 * which allows you to call the safe operations as `token.safeTransfer(...)`, etc.
 */
library SafeERC20 {
    using Address for address;

    function safeTransfer(
        IERC20 token,
        address to,
        uint256 value
    ) internal {
        _callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value));
    }

    function safeTransferFrom(
        IERC20 token,
        address from,
        address to,
        uint256 value
    ) internal {
        _callOptionalReturn(token, abi.encodeWithSelector(token.transferFrom.selector, from, to, value));
    }

    /**
     * @dev Deprecated. This function has issues similar to the ones found in
     * {IERC20-approve}, and its usage is discouraged.
     *
     * Whenever possible, use {safeIncreaseAllowance} and
     * {safeDecreaseAllowance} instead.
     */
    function safeApprove(
        IERC20 token,
        address spender,
        uint256 value
    ) internal {
        // safeApprove should only be called when setting an initial allowance,
        // or when resetting it to zero. To increase and decrease it, use
        // 'safeIncreaseAllowance' and 'safeDecreaseAllowance'
        require(
            (value == 0) || (token.allowance(address(this), spender) == 0),
            "SafeERC20: approve from non-zero to non-zero allowance"
        );
        _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, value));
    }

    function safeIncreaseAllowance(
        IERC20 token,
        address spender,
        uint256 value
    ) internal {
        uint256 newAllowance = token.allowance(address(this), spender) + value;
        _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));
    }

    function safeDecreaseAllowance(
        IERC20 token,
        address spender,
        uint256 value
    ) internal {
        unchecked {
            uint256 oldAllowance = token.allowance(address(this), spender);
            require(oldAllowance >= value, "SafeERC20: decreased allowance below zero");
            uint256 newAllowance = oldAllowance - value;
            _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));
        }
    }

    function safePermit(
        IERC20Permit token,
        address owner,
        address spender,
        uint256 value,
        uint256 deadline,
        uint8 v,
        bytes32 r,
        bytes32 s
    ) internal {
        uint256 nonceBefore = token.nonces(owner);
        token.permit(owner, spender, value, deadline, v, r, s);
        uint256 nonceAfter = token.nonces(owner);
        require(nonceAfter == nonceBefore + 1, "SafeERC20: permit did not succeed");
    }

    /**
     * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement
     * on the return value: the return value is optional (but if data is returned, it must not be false).
     * @param token The token targeted by the call.
     * @param data The call data (encoded using abi.encode or one of its variants).
     */
    function _callOptionalReturn(IERC20 token, bytes memory data) private {
        // We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since
        // we're implementing it ourselves. We use {Address.functionCall} to perform this call, which verifies that
        // the target address contains contract code and also asserts for success in the low-level call.

        bytes memory returndata = address(token).functionCall(data, "SafeERC20: low-level call failed");
        if (returndata.length > 0) {
            // Return data is optional
            require(abi.decode(returndata, (bool)), "SafeERC20: ERC20 operation did not succeed");
        }
    }
}

File 6 of 8 : IERC20.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.6.0) (token/ERC20/IERC20.sol)

pragma solidity ^0.8.0;

/**
 * @dev Interface of the ERC20 standard as defined in the EIP.
 */
interface IERC20 {
    /**
     * @dev Emitted when `value` tokens are moved from one account (`from`) to
     * another (`to`).
     *
     * Note that `value` may be zero.
     */
    event Transfer(address indexed from, address indexed to, uint256 value);

    /**
     * @dev Emitted when the allowance of a `spender` for an `owner` is set by
     * a call to {approve}. `value` is the new allowance.
     */
    event Approval(address indexed owner, address indexed spender, uint256 value);

    /**
     * @dev Returns the amount of tokens in existence.
     */
    function totalSupply() external view returns (uint256);

    /**
     * @dev Returns the amount of tokens owned by `account`.
     */
    function balanceOf(address account) external view returns (uint256);

    /**
     * @dev Moves `amount` tokens from the caller's account to `to`.
     *
     * Returns a boolean value indicating whether the operation succeeded.
     *
     * Emits a {Transfer} event.
     */
    function transfer(address to, uint256 amount) external returns (bool);

    /**
     * @dev Returns the remaining number of tokens that `spender` will be
     * allowed to spend on behalf of `owner` through {transferFrom}. This is
     * zero by default.
     *
     * This value changes when {approve} or {transferFrom} are called.
     */
    function allowance(address owner, address spender) external view returns (uint256);

    /**
     * @dev Sets `amount` as the allowance of `spender` over the caller's tokens.
     *
     * Returns a boolean value indicating whether the operation succeeded.
     *
     * IMPORTANT: Beware that changing an allowance with this method brings the risk
     * that someone may use both the old and the new allowance by unfortunate
     * transaction ordering. One possible solution to mitigate this race
     * condition is to first reduce the spender's allowance to 0 and set the
     * desired value afterwards:
     * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
     *
     * Emits an {Approval} event.
     */
    function approve(address spender, uint256 amount) external returns (bool);

    /**
     * @dev Moves `amount` tokens from `from` to `to` using the
     * allowance mechanism. `amount` is then deducted from the caller's
     * allowance.
     *
     * Returns a boolean value indicating whether the operation succeeded.
     *
     * Emits a {Transfer} event.
     */
    function transferFrom(
        address from,
        address to,
        uint256 amount
    ) external returns (bool);
}

File 7 of 8 : Address.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.0) (utils/Address.sol)

pragma solidity ^0.8.1;

/**
 * @dev Collection of functions related to the address type
 */
library Address {
    /**
     * @dev Returns true if `account` is a contract.
     *
     * [IMPORTANT]
     * ====
     * It is unsafe to assume that an address for which this function returns
     * false is an externally-owned account (EOA) and not a contract.
     *
     * Among others, `isContract` will return false for the following
     * types of addresses:
     *
     *  - an externally-owned account
     *  - a contract in construction
     *  - an address where a contract will be created
     *  - an address where a contract lived, but was destroyed
     * ====
     *
     * [IMPORTANT]
     * ====
     * You shouldn't rely on `isContract` to protect against flash loan attacks!
     *
     * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets
     * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract
     * constructor.
     * ====
     */
    function isContract(address account) internal view returns (bool) {
        // This method relies on extcodesize/address.code.length, which returns 0
        // for contracts in construction, since the code is only stored at the end
        // of the constructor execution.

        return account.code.length > 0;
    }

    /**
     * @dev Replacement for Solidity's `transfer`: sends `amount` wei to
     * `recipient`, forwarding all available gas and reverting on errors.
     *
     * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost
     * of certain opcodes, possibly making contracts go over the 2300 gas limit
     * imposed by `transfer`, making them unable to receive funds via
     * `transfer`. {sendValue} removes this limitation.
     *
     * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].
     *
     * IMPORTANT: because control is transferred to `recipient`, care must be
     * taken to not create reentrancy vulnerabilities. Consider using
     * {ReentrancyGuard} or the
     * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].
     */
    function sendValue(address payable recipient, uint256 amount) internal {
        require(address(this).balance >= amount, "Address: insufficient balance");

        (bool success, ) = recipient.call{value: amount}("");
        require(success, "Address: unable to send value, recipient may have reverted");
    }

    /**
     * @dev Performs a Solidity function call using a low level `call`. A
     * plain `call` is an unsafe replacement for a function call: use this
     * function instead.
     *
     * If `target` reverts with a revert reason, it is bubbled up by this
     * function (like regular Solidity function calls).
     *
     * Returns the raw returned data. To convert to the expected return value,
     * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].
     *
     * Requirements:
     *
     * - `target` must be a contract.
     * - calling `target` with `data` must not revert.
     *
     * _Available since v3.1._
     */
    function functionCall(address target, bytes memory data) internal returns (bytes memory) {
        return functionCall(target, data, "Address: low-level call failed");
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with
     * `errorMessage` as a fallback revert reason when `target` reverts.
     *
     * _Available since v3.1._
     */
    function functionCall(
        address target,
        bytes memory data,
        string memory errorMessage
    ) internal returns (bytes memory) {
        return functionCallWithValue(target, data, 0, errorMessage);
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
     * but also transferring `value` wei to `target`.
     *
     * Requirements:
     *
     * - the calling contract must have an ETH balance of at least `value`.
     * - the called Solidity function must be `payable`.
     *
     * _Available since v3.1._
     */
    function functionCallWithValue(
        address target,
        bytes memory data,
        uint256 value
    ) internal returns (bytes memory) {
        return functionCallWithValue(target, data, value, "Address: low-level call with value failed");
    }

    /**
     * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but
     * with `errorMessage` as a fallback revert reason when `target` reverts.
     *
     * _Available since v3.1._
     */
    function functionCallWithValue(
        address target,
        bytes memory data,
        uint256 value,
        string memory errorMessage
    ) internal returns (bytes memory) {
        require(address(this).balance >= value, "Address: insufficient balance for call");
        require(isContract(target), "Address: call to non-contract");

        (bool success, bytes memory returndata) = target.call{value: value}(data);
        return verifyCallResult(success, returndata, errorMessage);
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
     * but performing a static call.
     *
     * _Available since v3.3._
     */
    function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {
        return functionStaticCall(target, data, "Address: low-level static call failed");
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
     * but performing a static call.
     *
     * _Available since v3.3._
     */
    function functionStaticCall(
        address target,
        bytes memory data,
        string memory errorMessage
    ) internal view returns (bytes memory) {
        require(isContract(target), "Address: static call to non-contract");

        (bool success, bytes memory returndata) = target.staticcall(data);
        return verifyCallResult(success, returndata, errorMessage);
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
     * but performing a delegate call.
     *
     * _Available since v3.4._
     */
    function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {
        return functionDelegateCall(target, data, "Address: low-level delegate call failed");
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
     * but performing a delegate call.
     *
     * _Available since v3.4._
     */
    function functionDelegateCall(
        address target,
        bytes memory data,
        string memory errorMessage
    ) internal returns (bytes memory) {
        require(isContract(target), "Address: delegate call to non-contract");

        (bool success, bytes memory returndata) = target.delegatecall(data);
        return verifyCallResult(success, returndata, errorMessage);
    }

    /**
     * @dev Tool to verifies that a low level call was successful, and revert if it wasn't, either by bubbling the
     * revert reason using the provided one.
     *
     * _Available since v4.3._
     */
    function verifyCallResult(
        bool success,
        bytes memory returndata,
        string memory errorMessage
    ) internal pure returns (bytes memory) {
        if (success) {
            return returndata;
        } else {
            // Look for revert reason and bubble it up if present
            if (returndata.length > 0) {
                // The easiest way to bubble the revert reason is using memory via assembly
                /// @solidity memory-safe-assembly
                assembly {
                    let returndata_size := mload(returndata)
                    revert(add(32, returndata), returndata_size)
                }
            } else {
                revert(errorMessage);
            }
        }
    }
}

File 8 of 8 : draft-IERC20Permit.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (token/ERC20/extensions/draft-IERC20Permit.sol)

pragma solidity ^0.8.0;

/**
 * @dev Interface of the ERC20 Permit extension allowing approvals to be made via signatures, as defined in
 * https://eips.ethereum.org/EIPS/eip-2612[EIP-2612].
 *
 * Adds the {permit} method, which can be used to change an account's ERC20 allowance (see {IERC20-allowance}) by
 * presenting a message signed by the account. By not relying on {IERC20-approve}, the token holder account doesn't
 * need to send a transaction, and thus is not required to hold Ether at all.
 */
interface IERC20Permit {
    /**
     * @dev Sets `value` as the allowance of `spender` over ``owner``'s tokens,
     * given ``owner``'s signed approval.
     *
     * IMPORTANT: The same issues {IERC20-approve} has related to transaction
     * ordering also apply here.
     *
     * Emits an {Approval} event.
     *
     * Requirements:
     *
     * - `spender` cannot be the zero address.
     * - `deadline` must be a timestamp in the future.
     * - `v`, `r` and `s` must be a valid `secp256k1` signature from `owner`
     * over the EIP712-formatted function arguments.
     * - the signature must use ``owner``'s current nonce (see {nonces}).
     *
     * For more information on the signature format, see the
     * https://eips.ethereum.org/EIPS/eip-2612#specification[relevant EIP
     * section].
     */
    function permit(
        address owner,
        address spender,
        uint256 value,
        uint256 deadline,
        uint8 v,
        bytes32 r,
        bytes32 s
    ) external;

    /**
     * @dev Returns the current nonce for `owner`. This value must be
     * included whenever a signature is generated for {permit}.
     *
     * Every successful call to {permit} increases ``owner``'s nonce by one. This
     * prevents a signature from being used multiple times.
     */
    function nonces(address owner) external view returns (uint256);

    /**
     * @dev Returns the domain separator used in the encoding of the signature for {permit}, as defined by {EIP712}.
     */
    // solhint-disable-next-line func-name-mixedcase
    function DOMAIN_SEPARATOR() external view returns (bytes32);
}

Settings
{
  "optimizer": {
    "enabled": true,
    "runs": 200
  },
  "outputSelection": {
    "*": {
      "*": [
        "evm.bytecode",
        "evm.deployedBytecode",
        "devdoc",
        "userdoc",
        "metadata",
        "abi"
      ]
    }
  },
  "libraries": {}
}

Contract ABI

[{"inputs":[],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":true,"internalType":"address","name":"proxy","type":"address"},{"indexed":true,"internalType":"uint256","name":"pid","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"DepositByProxy","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":true,"internalType":"address","name":"proxy","type":"address"},{"indexed":true,"internalType":"uint256","name":"pid","type":"uint256"}],"name":"EmergencyWithdrawByProxy","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":true,"internalType":"address","name":"proxy","type":"address"},{"indexed":true,"internalType":"uint256","name":"pid","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"WithdrawByProxy","type":"event"},{"inputs":[],"name":"FARM_BOOSTER_PROXY_FACTORY","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"admin","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"candyToken","outputs":[{"internalType":"contract IERC20","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_pid","type":"uint256"},{"internalType":"uint256","name":"_amount","type":"uint256"},{"internalType":"address","name":"_referrer","type":"address"}],"name":"deposit","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_pid","type":"uint256"}],"name":"emergencyWithdraw","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"farmBooster","outputs":[{"internalType":"contract IFarmBooster","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_admin","type":"address"},{"internalType":"address","name":"_farmBooster","type":"address"},{"internalType":"address","name":"_masterchef","type":"address"},{"internalType":"address","name":"_candyToken","type":"address"}],"name":"initialize","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"isInitialized","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"lpApproved","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"masterchef","outputs":[{"internalType":"contract IMasterChef","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_pid","type":"uint256"},{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"withdraw","outputs":[],"stateMutability":"nonpayable","type":"function"}]

Deployed Bytecode

0x608060405234801561001057600080fd5b50600436106100a95760003560e01c80638dbdbe6d116100715780638dbdbe6d14610151578063a63f5e2a14610164578063f851a44014610177578063f8c8765e1461018a578063fb1db2781461019d578063fbcdbd0e146101b057600080fd5b80630643aae1146100ae578063392e53cd146100de578063441a3e701461010257806351035703146101175780635312ea8e1461013e575b600080fd5b6003546100c1906001600160a01b031681565b6040516001600160a01b0390911681526020015b60405180910390f35b6004546100f290600160a01b900460ff1681565b60405190151581526020016100d5565b61011561011036600461108f565b6101d3565b005b6100c17f0000000000000000000000006cfabd1ff774453bf125a29aa9258d1b18b38ebf81565b61011561014c36600461105f565b610476565b61011561015f3660046110b0565b610779565b6002546100c1906001600160a01b031681565b6004546100c1906001600160a01b031681565b610115610198366004610fe4565b610ae7565b6001546100c1906001600160a01b031681565b6100f26101be366004610fac565b60056020526000908152604090205460ff1681565b600260005414156101ff5760405162461bcd60e51b81526004016101f690611187565b60405180910390fd5b60026000556004546001600160a01b0316331461022e5760405162461bcd60e51b81526004016101f690611137565b6001546040805163040f1f6d60e11b815290516000926001600160a01b03169163081e3eda916004808301926020929190829003018186803b15801561027357600080fd5b505afa158015610287573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906102ab9190611077565b90508083106102cc5760405162461bcd60e51b81526004016101f69061115c565b600154604051630441a3e760e41b815260048101859052602481018490526001600160a01b039091169063441a3e7090604401600060405180830381600087803b15801561031957600080fd5b505af115801561032d573d6000803e3d6000fd5b50506001546040516378ed5d1f60e01b815260048101879052600093506001600160a01b0390911691506378ed5d1f9060240160206040518083038186803b15801561037857600080fd5b505afa15801561038c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906103b09190610fc8565b90506103c66001600160a01b0382163385610c13565b6103ce610c7b565b600354604051630bd6db7760e11b8152336004820152602481018690526001600160a01b03909116906317adb6ee90604401600060405180830381600087803b15801561041a57600080fd5b505af115801561042e573d6000803e3d6000fd5b505060405185815286925030915033907fa8c1f92a8228d8f30d30e0539f7256c2847eaf35775bdc0a5a9c0a5a066f31d39060200160405180910390a4505060016000555050565b600260005414156104995760405162461bcd60e51b81526004016101f690611187565b60026000556004546001600160a01b031633146104c85760405162461bcd60e51b81526004016101f690611137565b6001546040805163040f1f6d60e11b815290516000926001600160a01b03169163081e3eda916004808301926020929190829003018186803b15801561050d57600080fd5b505afa158015610521573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105459190611077565b90508082106105665760405162461bcd60e51b81526004016101f69061115c565b600154604051632989754760e11b8152600481018490526001600160a01b0390911690635312ea8e90602401600060405180830381600087803b1580156105ac57600080fd5b505af11580156105c0573d6000803e3d6000fd5b50506001546040516378ed5d1f60e01b815260048101869052600093506001600160a01b0390911691506378ed5d1f9060240160206040518083038186803b15801561060b57600080fd5b505afa15801561061f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106439190610fc8565b6040516370a0823160e01b81523060048201529091506106d49033906001600160a01b038416906370a082319060240160206040518083038186803b15801561068b57600080fd5b505afa15801561069f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106c39190611077565b6001600160a01b0384169190610c13565b6106dc610c7b565b600354604051630bd6db7760e11b8152336004820152602481018590526001600160a01b03909116906317adb6ee90604401600060405180830381600087803b15801561072857600080fd5b505af115801561073c573d6000803e3d6000fd5b505060405185925030915033907f238154946c0c149f8f44d71bfa79cf891af27a2567d540447b44c7c532529e3290600090a45050600160005550565b6002600054141561079c5760405162461bcd60e51b81526004016101f690611187565b60026000556004546001600160a01b031633146107cb5760405162461bcd60e51b81526004016101f690611137565b6001546040805163040f1f6d60e11b815290516000926001600160a01b03169163081e3eda916004808301926020929190829003018186803b15801561081057600080fd5b505afa158015610824573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108489190611077565b90508084106108695760405162461bcd60e51b81526004016101f69061115c565b6001546040516378ed5d1f60e01b8152600481018690526000916001600160a01b0316906378ed5d1f9060240160206040518083038186803b1580156108ae57600080fd5b505afa1580156108c2573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108e69190610fc8565b90506108fd6001600160a01b038216333087610d19565b6001600160a01b03811660009081526005602052604090205460ff166109c95760015460405163095ea7b360e01b81526001600160a01b03918216600482015260001960248201529082169063095ea7b390604401602060405180830381600087803b15801561096c57600080fd5b505af1158015610980573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109a4919061103f565b506001600160a01b0381166000908152600560205260409020805460ff191660011790555b600154604051638dbdbe6d60e01b815260048101879052602481018690526001600160a01b03858116604483015290911690638dbdbe6d90606401600060405180830381600087803b158015610a1e57600080fd5b505af1158015610a32573d6000803e3d6000fd5b50505050610a3e610c7b565b600354604051630bd6db7760e11b8152336004820152602481018790526001600160a01b03909116906317adb6ee90604401600060405180830381600087803b158015610a8a57600080fd5b505af1158015610a9e573d6000803e3d6000fd5b505060405186815287925030915033907f138d30356a982952b65b72a90f5ee823874132ec8dd8b2fa5c42499228670fa69060200160405180910390a450506001600055505050565b600454600160a01b900460ff1615610b415760405162461bcd60e51b815260206004820152601f60248201527f4f7065726174696f6e733a20416c726561647920696e697469616c697a65640060448201526064016101f6565b336001600160a01b037f0000000000000000000000006cfabd1ff774453bf125a29aa9258d1b18b38ebf1614610bb95760405162461bcd60e51b815260206004820152601760248201527f4f7065726174696f6e733a204e6f7420666163746f727900000000000000000060448201526064016101f6565b600480546001600160a01b039586166001600160a81b031990911617600160a01b179055600380549385166001600160a01b0319948516179055600180549285169284169290921790915560028054919093169116179055565b6040516001600160a01b038316602482015260448101829052610c7690849063a9059cbb60e01b906064015b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b031990931692909217909152610d57565b505050565b6002546040516370a0823160e01b81523060048201526000916001600160a01b0316906370a082319060240160206040518083038186803b158015610cbf57600080fd5b505afa158015610cd3573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610cf79190611077565b90508015610d1657600254610d16906001600160a01b03163383610c13565b50565b6040516001600160a01b0380851660248301528316604482015260648101829052610d519085906323b872dd60e01b90608401610c3f565b50505050565b6000610dac826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b0316610e299092919063ffffffff16565b805190915015610c765780806020019051810190610dca919061103f565b610c765760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b60648201526084016101f6565b6060610e388484600085610e42565b90505b9392505050565b606082471015610ea35760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f6044820152651c8818d85b1b60d21b60648201526084016101f6565b6001600160a01b0385163b610efa5760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e747261637400000060448201526064016101f6565b600080866001600160a01b03168587604051610f1691906110e8565b60006040518083038185875af1925050503d8060008114610f53576040519150601f19603f3d011682016040523d82523d6000602084013e610f58565b606091505b5091509150610f68828286610f73565b979650505050505050565b60608315610f82575081610e3b565b825115610f925782518084602001fd5b8160405162461bcd60e51b81526004016101f69190611104565b600060208284031215610fbd578081fd5b8135610e3b816111ea565b600060208284031215610fd9578081fd5b8151610e3b816111ea565b60008060008060808587031215610ff9578283fd5b8435611004816111ea565b93506020850135611014816111ea565b92506040850135611024816111ea565b91506060850135611034816111ea565b939692955090935050565b600060208284031215611050578081fd5b81518015158114610e3b578182fd5b600060208284031215611070578081fd5b5035919050565b600060208284031215611088578081fd5b5051919050565b600080604083850312156110a1578182fd5b50508035926020909101359150565b6000806000606084860312156110c4578283fd5b833592506020840135915060408401356110dd816111ea565b809150509250925092565b600082516110fa8184602087016111be565b9190910192915050565b60208152600082518060208401526111238160408501602087016111be565b601f01601f19169190910160400192915050565b6020808252600b908201526a61646d696e3a207775743f60a81b604082015260600190565b602080825260119082015270141bdbdb081a5cc81b9bdd08195e1a5cdd607a1b604082015260600190565b6020808252601f908201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604082015260600190565b60005b838110156111d95781810151838201526020016111c1565b83811115610d515750506000910152565b6001600160a01b0381168114610d1657600080fdfea2646970667358221220c85f4802e4eefd7a405fb15ff56d3f5fa3e51899a4b6462cd34daaf442fb741864736f6c63430008040033

Block Transaction Gas Used Reward
Age Block Fee Address BC Fee Address Voting Power Jailed Incoming
Block Uncle Number Difficulty Gas Used Reward
Loading
Loading
Make sure to use the "Vote Down" button for any spammy posts, and the "Vote Up" for interesting conversations.