ETH Price: $3,517.75 (-5.30%)
 
Transaction Hash
Method
Block
From
To
Emergency Withdr...214858112024-12-26 9:41:4712 days ago1735206107IN
0xb9e7008F...7D9d7fAD5
0 ETH0.000405526.65961753
Withdraw184560592023-10-29 13:12:59436 days ago1698585179IN
0xb9e7008F...7D9d7fAD5
0 ETH0.0019073917.70677
Withdraw178562342023-08-06 13:31:59520 days ago1691328719IN
0xb9e7008F...7D9d7fAD5
0 ETH0.0024447419.74611883
Withdraw178562212023-08-06 13:29:23520 days ago1691328563IN
0xb9e7008F...7D9d7fAD5
0 ETH0.0023448617.57245941
Withdraw178562202023-08-06 13:29:11520 days ago1691328551IN
0xb9e7008F...7D9d7fAD5
0 ETH0.0022036117.80195463
Withdraw178091072023-07-30 23:26:35526 days ago1690759595IN
0xb9e7008F...7D9d7fAD5
0 ETH0.0018729915.12953944
Withdraw177831052023-07-27 8:06:11530 days ago1690445171IN
0xb9e7008F...7D9d7fAD5
0 ETH0.0023990619.22193008
Withdraw177104182023-07-17 3:50:35540 days ago1689565835IN
0xb9e7008F...7D9d7fAD5
0 ETH0.0020834519.3433781
Batch Claim176675952023-07-11 3:06:59546 days ago1689044819IN
0xb9e7008F...7D9d7fAD5
0 ETH0.0013910418.11492509
Withdraw176408802023-07-07 8:56:35550 days ago1688720195IN
0xb9e7008F...7D9d7fAD5
0 ETH0.0027627922.31928684
Withdraw176280262023-07-05 13:37:47552 days ago1688564267IN
0xb9e7008F...7D9d7fAD5
0 ETH0.0055899356.7
Withdraw176038252023-07-02 4:02:47555 days ago1688270567IN
0xb9e7008F...7D9d7fAD5
0 ETH0.0016771313.54743833
Emergency Withdr...175903182023-06-30 6:28:59557 days ago1688106539IN
0xb9e7008F...7D9d7fAD5
0 ETH0.001530922.22633203
Emergency Withdr...175903142023-06-30 6:28:11557 days ago1688106491IN
0xb9e7008F...7D9d7fAD5
0 ETH0.0017509621.71444055
Claim175903062023-06-30 6:26:35557 days ago1688106395IN
0xb9e7008F...7D9d7fAD5
0 ETH0.0017892223.49229461
Claim175903042023-06-30 6:26:11557 days ago1688106371IN
0xb9e7008F...7D9d7fAD5
0 ETH0.0025097723.31552758
Withdraw175832492023-06-29 6:43:59558 days ago1688021039IN
0xb9e7008F...7D9d7fAD5
0 ETH0.0021766315.74804686
Withdraw175773712023-06-28 10:58:35559 days ago1687949915IN
0xb9e7008F...7D9d7fAD5
0 ETH0.0017444612.62129293
Batch Claim175724372023-06-27 18:22:35559 days ago1687890155IN
0xb9e7008F...7D9d7fAD5
0 ETH0.0015504412.96758837
Deposit175696552023-06-27 8:54:35560 days ago1687856075IN
0xb9e7008F...7D9d7fAD5
0 ETH0.0012703112.33708292
Withdraw175696452023-06-27 8:52:23560 days ago1687855943IN
0xb9e7008F...7D9d7fAD5
0 ETH0.001681312.16434881
Batch Claim175696422023-06-27 8:51:47560 days ago1687855907IN
0xb9e7008F...7D9d7fAD5
0 ETH0.0014014312.94290365
Batch Claim175572782023-06-25 15:06:11562 days ago1687705571IN
0xb9e7008F...7D9d7fAD5
0 ETH0.0012310416.03130134
Batch Claim175572572023-06-25 15:01:59562 days ago1687705319IN
0xb9e7008F...7D9d7fAD5
0 ETH0.0019509316.31718292
Claim175570802023-06-25 14:26:23562 days ago1687703183IN
0xb9e7008F...7D9d7fAD5
0 ETH0.0009422212.37232399
View all transactions

Latest 25 internal transactions (View All)

Advanced mode:
Parent Transaction Hash Block
From
To
178562342023-08-06 13:31:59520 days ago1691328719
0xb9e7008F...7D9d7fAD5
51.3802 ETH
178562202023-08-06 13:29:11520 days ago1691328551
0xb9e7008F...7D9d7fAD5
12 ETH
178091072023-07-30 23:26:35526 days ago1690759595
0xb9e7008F...7D9d7fAD5
0.6689 ETH
176408802023-07-07 8:56:35550 days ago1688720195
0xb9e7008F...7D9d7fAD5
0.5 ETH
176038252023-07-02 4:02:47555 days ago1688270567
0xb9e7008F...7D9d7fAD5
2.5158 ETH
175461832023-06-24 1:39:59563 days ago1687570799
0xb9e7008F...7D9d7fAD5
0.24 ETH
175428392023-06-23 14:23:35564 days ago1687530215
0xb9e7008F...7D9d7fAD5
11 ETH
175357362023-06-22 14:25:23565 days ago1687443923
0xb9e7008F...7D9d7fAD5
40 ETH
175282172023-06-21 13:05:11566 days ago1687352711
0xb9e7008F...7D9d7fAD5
1 ETH
174930032023-06-16 14:30:47571 days ago1686925847
0xb9e7008F...7D9d7fAD5
10 ETH
174918912023-06-16 10:45:11571 days ago1686912311
0xb9e7008F...7D9d7fAD5
0.0728 ETH
174723872023-06-13 16:54:11573 days ago1686675251
0xb9e7008F...7D9d7fAD5
26 ETH
174596402023-06-11 21:50:23575 days ago1686520223
0xb9e7008F...7D9d7fAD5
10 ETH
174584152023-06-11 17:42:11575 days ago1686505331
0xb9e7008F...7D9d7fAD5
4.5 ETH
174583942023-06-11 17:37:35575 days ago1686505055
0xb9e7008F...7D9d7fAD5
15 ETH
174475262023-06-10 4:52:59577 days ago1686372779
0xb9e7008F...7D9d7fAD5
12.7663 ETH
174406292023-06-09 5:32:35578 days ago1686288755
0xb9e7008F...7D9d7fAD5
20 ETH
174049052023-06-04 4:33:11583 days ago1685853191
0xb9e7008F...7D9d7fAD5
1.4 ETH
174049052023-06-04 4:33:11583 days ago1685853191
0xb9e7008F...7D9d7fAD5
1 ETH
173916012023-06-02 7:33:11585 days ago1685691191
0xb9e7008F...7D9d7fAD5
0.02 ETH
173864912023-06-01 14:15:59586 days ago1685628959
0xb9e7008F...7D9d7fAD5
2 ETH
173856712023-06-01 11:30:11586 days ago1685619011
0xb9e7008F...7D9d7fAD5
0.1 ETH
173663672023-05-29 18:16:47588 days ago1685384207
0xb9e7008F...7D9d7fAD5
20 ETH
173617852023-05-29 2:49:47589 days ago1685328587
0xb9e7008F...7D9d7fAD5
1 ETH
173508872023-05-27 14:08:35591 days ago1685196515
0xb9e7008F...7D9d7fAD5
0.0577 ETH
View All Internal Transactions
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
MasterChef

Compiler Version
v0.8.19+commit.7dd6d404

Optimization Enabled:
Yes with 20000 runs

Other Settings:
default evmVersion
File 1 of 6 : MasterChef.sol
// SPDX-License-Identifier: MIT

pragma solidity 0.8.19;

import {SafeTransferLib,ERC20} from "@solmate/utils/SafeTransferLib.sol"; 
import "@solmate/auth/Owned.sol";

import "./interfaces/IMint.sol"; 
import "./interfaces/IStake2.sol";

// MasterChef is the master of ERC20 token. He can make rewardToken and he is a fair guy.
//
// Note that it's ownable and the owner wields tremendous power. The ownership
// will be transferred to a governance smart contract once  rewardToken is sufficiently
// distributed and the community can show to govern itself.
//
// Have fun reading it. Hopefully it's bug-free. God bless.
contract MasterChef is Owned(msg.sender) {
    uint256 constant _PRECISION = 1e12;

    // Info of each user.
    struct UserInfo {
        uint256 amount; // How many LP tokens the user has provided.
        uint256 index; // index is the cumulative value of each share's reward.
            // See explanation below.
            //
            // We do some fancy math here. Basically, any point in time, the amount of Rewards
            // entitled to a user but is pending to be distributed is:
            //
            //   pending reward = user.amount * ( pool.accRewardPerShareIndex -  user.index)
            //
            // Whenever a user deposits or withdraws LP tokens to a pool. Here's what happens:
            //   1. The pool's `accRewardPerShareIndex` (and `lastRewardTime`) gets updated.
            //   2. User receives the pending reward sent to his/her address.
            //   3. User's `amount` gets updated.
            //   4. User's `index` gets updated.
    }

    // Info of each pool.
    struct PoolInfo {
        address lpToken; // Address of LP token contract.
        uint256 allocPoint; // How many allocation points assigned to this pool. Rewards to distribute per block.
        uint256 lastRewardTime; // Last block time that Rewards distribution occurs.
        uint256 accRewardPerShareIndex; // Accumulated Rewards per share, times 1e12. See below.
        IStake2 stake2; // Stake2 contract address, will be called when deposit/withdraw.
    }
    // The block number when Reward mining starts.

    uint256 public immutable startTime;
    // The Reward TOKEN!
    IMint public rewardToken;
    // Reward tokens created per second.
    uint256 public rewardPerSecond;

    // Info of each pool.
    PoolInfo[] public poolInfo;
    // Info of each user that stakes LP tokens.
    mapping(uint256 => mapping(address => UserInfo)) public userInfo;
    // Total allocation points. Must be the sum of all allocation points in all pools.
    uint256 public totalAllocPoint;

    constructor(uint256 rewardPerSecond_, uint256 start_) {
        rewardPerSecond = rewardPerSecond_;
        startTime = start_;
    }

    // Deposit LP tokens to MasterChef for Reward allocation.
    function deposit(uint256 pid, uint256 amount) public payable {
        if (amount == 0) revert DEPOSIT_AMOUNT_ZERO();

        _updateReward(pid, msg.sender);

        PoolInfo storage pool = poolInfo[pid];
        UserInfo storage user = userInfo[pid][msg.sender];

        _transferTokenIn(pool.lpToken, amount);
        user.amount += amount;

        // call stake2 contract when deposit
        if (address(pool.stake2) != address(0)) pool.stake2.onDeposited(msg.sender, amount);

        emit Deposit(msg.sender, pid, amount, user.index);
    }

    // Deposit LP tokens to MasterChef for Reward allocation.
    // Deposit with permit for approval.
    function depositWithPermit(uint256 pid, uint256 amount, uint256 deadline, uint8 v, bytes32 r, bytes32 s) external {
        ERC20(poolInfo[pid].lpToken).permit(msg.sender, address(this), amount, deadline, v, r, s);
        deposit(pid, amount);
    }

    // Withdraw LP tokens from MasterChef.
    function withdraw(uint256 pid, uint256 amount) external {
        if (amount == 0) revert WITHDRAW_AMOUNT_ZERO();

        _updateReward(pid, msg.sender);

        UserInfo storage user = userInfo[pid][msg.sender];
        if (user.amount < amount) revert WITHDRAW_AMOUNT_TOO_LARGE();

        PoolInfo storage pool = poolInfo[pid];
        unchecked {
            user.amount -= amount;
        }
        _transferTokenOut(pool.lpToken, amount);

        // call stake2 contract when withdraw
        if (address(pool.stake2) != address(0)) pool.stake2.onWithdrawn(msg.sender, amount);

        emit Withdraw(msg.sender, pid, amount, user.index);
    }

    function claim(uint256 pid) external {
        _updateReward(pid, msg.sender);
    }

    function claimFor(uint256 pid, address user) external {
        _updateReward(pid, user);
    }

    function batchClaim(uint256[] calldata pids) external {
        for (uint256 i = 0; i < pids.length; i++) {
            _updateReward(pids[i], msg.sender);
        }
    }

    // Withdraw without caring about rewards. EMERGENCY ONLY.
    function emergencyWithdraw(uint256 pid) public {
        PoolInfo storage pool = poolInfo[pid];
        UserInfo storage user = userInfo[pid][msg.sender];
        uint256 amount = user.amount;
        user.amount = 0;
        user.index = 0;
        _transferTokenOut(address(pool.lpToken), amount);
        emit EmergencyWithdraw(msg.sender, pid, amount);
    }

    // Update reward variables for all pools. Be careful of gas spending!
    function massUpdatePools() public {
        uint256 length = poolInfo.length;
        for (uint256 pid = 0; pid < length; ++pid) {
            updatePool(pid);
        }
    }

    // Update reward variables of the given pool to be up-to-date.
    function updatePool(uint256 pid) public {
        PoolInfo storage pool = poolInfo[pid];
        if (block.timestamp <= pool.lastRewardTime) {
            return;
        }
        pool.accRewardPerShareIndex = _currentRewardPerShare(pid);
        pool.lastRewardTime = block.timestamp;
    }

    function poolLength() external view returns (uint256) {
        return poolInfo.length;
    }

    // Return reward multiplier over the given _from to _to block.
    // View function to see pending Rewards on frontend.
    function pendingReward(uint256 pid, address _user) external view returns (uint256) {
        UserInfo storage user = userInfo[pid][_user];
        // ignore big amount
        unchecked {
            return user.amount * (_currentRewardPerShare(pid) - user.index) / _PRECISION;
        }
    }

    //********************************************************
    //****************** ADMIN FUNCTIONS *********************
    //********************************************************

    function setRewardPerSecond(uint256 rewardPerSecond_) external onlyOwner {
        massUpdatePools();
        rewardPerSecond = rewardPerSecond_;
        emit RewardPerSecondUpdated(rewardPerSecond);
    }

    // Add a new lpToken to the pool. Can only be called by the owner.
    // XXX DO NOT add the same lpToken token more than once. Rewards will be messed up if you do.
    function add(uint256 allocPoint, address lpToken, IStake2 stake2, bool withUpdate) external onlyOwner {
        if (withUpdate) {
            massUpdatePools();
        }
        uint256 lastRewardTime = block.timestamp > startTime ? block.timestamp : startTime;
        unchecked {
            totalAllocPoint += allocPoint;
        }
        poolInfo.push(
            PoolInfo({
                lpToken: lpToken,
                allocPoint: allocPoint,
                lastRewardTime: lastRewardTime,
                accRewardPerShareIndex: 0,
                stake2: stake2
            })
        );

        emit PoolUpdated(poolInfo.length - 1, allocPoint);
    }

    // Update the given pool's Reward allocation point. Can only be called by the owner.
    function set(uint256 pid, uint256 allocPoint, bool withUpdate) external onlyOwner {
        if (withUpdate) {
            massUpdatePools();
        }
        uint256 prevAllocPoint = poolInfo[pid].allocPoint;
        poolInfo[pid].allocPoint = allocPoint;

        unchecked {
            totalAllocPoint = totalAllocPoint - prevAllocPoint + allocPoint;
        }

        emit PoolUpdated(pid, allocPoint);
    }

    function setRewardToken(IMint newToken) external onlyOwner {
        rewardToken = newToken;
        emit RewardTokenUpdated(address(newToken));
    }

    //********************************************************
    //****************** INTERNAL FUNCTIONS ******************
    //********************************************************

    function _currentRewardPerShare(uint256 pid) internal view returns (uint256) {
        PoolInfo storage pool = poolInfo[pid];
        uint256 accRewardPerShareIndex = pool.accRewardPerShareIndex;
        uint256 lpSupply =
            pool.lpToken == address(0) ? address(this).balance : ERC20(pool.lpToken).balanceOf(address(this));
        if (block.timestamp > pool.lastRewardTime && lpSupply > 0) {
            // We can ignore the overflow issue, which will not happen during the continuous operation of the protocol.
            // (block.timestamp - pool.lastRewardTime)  will not cause an overflow.
            // (rewardPerSecond * pool.allocPoint) will not cause an overflow.

            uint256 index;
            unchecked {
                uint256 rewards =
                    (block.timestamp - pool.lastRewardTime) * rewardPerSecond * pool.allocPoint / totalAllocPoint;

                index = rewards * _PRECISION / lpSupply;
            }
            accRewardPerShareIndex += index;
        }
        return accRewardPerShareIndex;
    }

    function _updateReward(uint256 pid, address account) private {
        // Rewards should only be sent to a staker after the pool state has been updated.
        updatePool(pid);

        PoolInfo storage pool = poolInfo[pid];
        UserInfo storage user = userInfo[pid][account];

        if (user.amount > 0) {
            uint256 pending = user.amount * (pool.accRewardPerShareIndex - user.index) / _PRECISION;
            // update reward index before transfer for reentrancy.
            user.index = pool.accRewardPerShareIndex;
            if (pending > 0) rewardToken.mint(account, pending);
        } else {
            user.index = pool.accRewardPerShareIndex;
        }
    }

    function _transferTokenIn(address token, uint256 amount) private {
        if (token == address(0)) {
            if (amount != msg.value) revert AMOUNT_IS_NOT_ENOUGH();
        } else {
            SafeTransferLib.safeTransferFrom(ERC20(token), msg.sender, address(this), amount);
        }
    }

    function _transferTokenOut(address token, uint256 amount) private {
        if (amount == 0) return;
        if (token == address(0)) {
            SafeTransferLib.safeTransferETH(msg.sender, amount);
        } else {
            SafeTransferLib.safeTransfer(ERC20(token), msg.sender, amount);
        }
    }

    event Deposit(address indexed user, uint256 indexed pid, uint256 amount, uint256 index);
    event Withdraw(address indexed user, uint256 indexed pid, uint256 amount, uint256 index);
    event EmergencyWithdraw(address indexed user, uint256 indexed pid, uint256 amount);
    event RewardPerSecondUpdated(uint256 newRewards);
    event PoolUpdated(uint256 pid, uint256 allocPoint);
    event RewardTokenUpdated(address newToken);

    error AMOUNT_IS_NOT_ENOUGH();
    error DEPOSIT_AMOUNT_ZERO();
    error WITHDRAW_AMOUNT_TOO_LARGE();
    error WITHDRAW_AMOUNT_ZERO();
}

File 2 of 6 : SafeTransferLib.sol
// SPDX-License-Identifier: AGPL-3.0-only
pragma solidity >=0.8.0;

import {ERC20} from "../tokens/ERC20.sol";

/// @notice Safe ETH and ERC20 transfer library that gracefully handles missing return values.
/// @author Solmate (https://github.com/transmissions11/solmate/blob/main/src/utils/SafeTransferLib.sol)
/// @dev Use with caution! Some functions in this library knowingly create dirty bits at the destination of the free memory pointer.
/// @dev Note that none of the functions in this library check that a token has code at all! That responsibility is delegated to the caller.
library SafeTransferLib {
    /*//////////////////////////////////////////////////////////////
                             ETH OPERATIONS
    //////////////////////////////////////////////////////////////*/

    function safeTransferETH(address to, uint256 amount) internal {
        bool success;

        /// @solidity memory-safe-assembly
        assembly {
            // Transfer the ETH and store if it succeeded or not.
            success := call(gas(), to, amount, 0, 0, 0, 0)
        }

        require(success, "ETH_TRANSFER_FAILED");
    }

    /*//////////////////////////////////////////////////////////////
                            ERC20 OPERATIONS
    //////////////////////////////////////////////////////////////*/

    function safeTransferFrom(
        ERC20 token,
        address from,
        address to,
        uint256 amount
    ) internal {
        bool success;

        /// @solidity memory-safe-assembly
        assembly {
            // Get a pointer to some free memory.
            let freeMemoryPointer := mload(0x40)

            // Write the abi-encoded calldata into memory, beginning with the function selector.
            mstore(freeMemoryPointer, 0x23b872dd00000000000000000000000000000000000000000000000000000000)
            mstore(add(freeMemoryPointer, 4), from) // Append the "from" argument.
            mstore(add(freeMemoryPointer, 36), to) // Append the "to" argument.
            mstore(add(freeMemoryPointer, 68), amount) // Append the "amount" argument.

            success := and(
                // Set success to whether the call reverted, if not we check it either
                // returned exactly 1 (can't just be non-zero data), or had no return data.
                or(and(eq(mload(0), 1), gt(returndatasize(), 31)), iszero(returndatasize())),
                // We use 100 because the length of our calldata totals up like so: 4 + 32 * 3.
                // We use 0 and 32 to copy up to 32 bytes of return data into the scratch space.
                // Counterintuitively, this call must be positioned second to the or() call in the
                // surrounding and() call or else returndatasize() will be zero during the computation.
                call(gas(), token, 0, freeMemoryPointer, 100, 0, 32)
            )
        }

        require(success, "TRANSFER_FROM_FAILED");
    }

    function safeTransfer(
        ERC20 token,
        address to,
        uint256 amount
    ) internal {
        bool success;

        /// @solidity memory-safe-assembly
        assembly {
            // Get a pointer to some free memory.
            let freeMemoryPointer := mload(0x40)

            // Write the abi-encoded calldata into memory, beginning with the function selector.
            mstore(freeMemoryPointer, 0xa9059cbb00000000000000000000000000000000000000000000000000000000)
            mstore(add(freeMemoryPointer, 4), to) // Append the "to" argument.
            mstore(add(freeMemoryPointer, 36), amount) // Append the "amount" argument.

            success := and(
                // Set success to whether the call reverted, if not we check it either
                // returned exactly 1 (can't just be non-zero data), or had no return data.
                or(and(eq(mload(0), 1), gt(returndatasize(), 31)), iszero(returndatasize())),
                // We use 68 because the length of our calldata totals up like so: 4 + 32 * 2.
                // We use 0 and 32 to copy up to 32 bytes of return data into the scratch space.
                // Counterintuitively, this call must be positioned second to the or() call in the
                // surrounding and() call or else returndatasize() will be zero during the computation.
                call(gas(), token, 0, freeMemoryPointer, 68, 0, 32)
            )
        }

        require(success, "TRANSFER_FAILED");
    }

    function safeApprove(
        ERC20 token,
        address to,
        uint256 amount
    ) internal {
        bool success;

        /// @solidity memory-safe-assembly
        assembly {
            // Get a pointer to some free memory.
            let freeMemoryPointer := mload(0x40)

            // Write the abi-encoded calldata into memory, beginning with the function selector.
            mstore(freeMemoryPointer, 0x095ea7b300000000000000000000000000000000000000000000000000000000)
            mstore(add(freeMemoryPointer, 4), to) // Append the "to" argument.
            mstore(add(freeMemoryPointer, 36), amount) // Append the "amount" argument.

            success := and(
                // Set success to whether the call reverted, if not we check it either
                // returned exactly 1 (can't just be non-zero data), or had no return data.
                or(and(eq(mload(0), 1), gt(returndatasize(), 31)), iszero(returndatasize())),
                // We use 68 because the length of our calldata totals up like so: 4 + 32 * 2.
                // We use 0 and 32 to copy up to 32 bytes of return data into the scratch space.
                // Counterintuitively, this call must be positioned second to the or() call in the
                // surrounding and() call or else returndatasize() will be zero during the computation.
                call(gas(), token, 0, freeMemoryPointer, 68, 0, 32)
            )
        }

        require(success, "APPROVE_FAILED");
    }
}

File 3 of 6 : Owned.sol
// SPDX-License-Identifier: AGPL-3.0-only
pragma solidity >=0.8.0;

/// @notice Simple single owner authorization mixin.
/// @author Solmate (https://github.com/transmissions11/solmate/blob/main/src/auth/Owned.sol)
abstract contract Owned {
    /*//////////////////////////////////////////////////////////////
                                 EVENTS
    //////////////////////////////////////////////////////////////*/

    event OwnershipTransferred(address indexed user, address indexed newOwner);

    /*//////////////////////////////////////////////////////////////
                            OWNERSHIP STORAGE
    //////////////////////////////////////////////////////////////*/

    address public owner;

    modifier onlyOwner() virtual {
        require(msg.sender == owner, "UNAUTHORIZED");

        _;
    }

    /*//////////////////////////////////////////////////////////////
                               CONSTRUCTOR
    //////////////////////////////////////////////////////////////*/

    constructor(address _owner) {
        owner = _owner;

        emit OwnershipTransferred(address(0), _owner);
    }

    /*//////////////////////////////////////////////////////////////
                             OWNERSHIP LOGIC
    //////////////////////////////////////////////////////////////*/

    function transferOwnership(address newOwner) public virtual onlyOwner {
        owner = newOwner;

        emit OwnershipTransferred(msg.sender, newOwner);
    }
}

File 4 of 6 : IMint.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.8.19;
 
interface IMint {
    function mint(address to, uint256 amount) external;
}

File 5 of 6 : IStake2.sol
// SPDX-License-Identifier: MIT

pragma solidity 0.8.19;

interface IStake2 {
    function onDeposited(address user, uint256 amount) external;
    function onWithdrawn(address user, uint256 amount) external;
}

File 6 of 6 : ERC20.sol
// SPDX-License-Identifier: AGPL-3.0-only
pragma solidity >=0.8.0;

/// @notice Modern and gas efficient ERC20 + EIP-2612 implementation.
/// @author Solmate (https://github.com/transmissions11/solmate/blob/main/src/tokens/ERC20.sol)
/// @author Modified from Uniswap (https://github.com/Uniswap/uniswap-v2-core/blob/master/contracts/UniswapV2ERC20.sol)
/// @dev Do not manually set balances without updating totalSupply, as the sum of all user balances must not exceed it.
abstract contract ERC20 {
    /*//////////////////////////////////////////////////////////////
                                 EVENTS
    //////////////////////////////////////////////////////////////*/

    event Transfer(address indexed from, address indexed to, uint256 amount);

    event Approval(address indexed owner, address indexed spender, uint256 amount);

    /*//////////////////////////////////////////////////////////////
                            METADATA STORAGE
    //////////////////////////////////////////////////////////////*/

    string public name;

    string public symbol;

    uint8 public immutable decimals;

    /*//////////////////////////////////////////////////////////////
                              ERC20 STORAGE
    //////////////////////////////////////////////////////////////*/

    uint256 public totalSupply;

    mapping(address => uint256) public balanceOf;

    mapping(address => mapping(address => uint256)) public allowance;

    /*//////////////////////////////////////////////////////////////
                            EIP-2612 STORAGE
    //////////////////////////////////////////////////////////////*/

    uint256 internal immutable INITIAL_CHAIN_ID;

    bytes32 internal immutable INITIAL_DOMAIN_SEPARATOR;

    mapping(address => uint256) public nonces;

    /*//////////////////////////////////////////////////////////////
                               CONSTRUCTOR
    //////////////////////////////////////////////////////////////*/

    constructor(
        string memory _name,
        string memory _symbol,
        uint8 _decimals
    ) {
        name = _name;
        symbol = _symbol;
        decimals = _decimals;

        INITIAL_CHAIN_ID = block.chainid;
        INITIAL_DOMAIN_SEPARATOR = computeDomainSeparator();
    }

    /*//////////////////////////////////////////////////////////////
                               ERC20 LOGIC
    //////////////////////////////////////////////////////////////*/

    function approve(address spender, uint256 amount) public virtual returns (bool) {
        allowance[msg.sender][spender] = amount;

        emit Approval(msg.sender, spender, amount);

        return true;
    }

    function transfer(address to, uint256 amount) public virtual returns (bool) {
        balanceOf[msg.sender] -= amount;

        // Cannot overflow because the sum of all user
        // balances can't exceed the max uint256 value.
        unchecked {
            balanceOf[to] += amount;
        }

        emit Transfer(msg.sender, to, amount);

        return true;
    }

    function transferFrom(
        address from,
        address to,
        uint256 amount
    ) public virtual returns (bool) {
        uint256 allowed = allowance[from][msg.sender]; // Saves gas for limited approvals.

        if (allowed != type(uint256).max) allowance[from][msg.sender] = allowed - amount;

        balanceOf[from] -= amount;

        // Cannot overflow because the sum of all user
        // balances can't exceed the max uint256 value.
        unchecked {
            balanceOf[to] += amount;
        }

        emit Transfer(from, to, amount);

        return true;
    }

    /*//////////////////////////////////////////////////////////////
                             EIP-2612 LOGIC
    //////////////////////////////////////////////////////////////*/

    function permit(
        address owner,
        address spender,
        uint256 value,
        uint256 deadline,
        uint8 v,
        bytes32 r,
        bytes32 s
    ) public virtual {
        require(deadline >= block.timestamp, "PERMIT_DEADLINE_EXPIRED");

        // Unchecked because the only math done is incrementing
        // the owner's nonce which cannot realistically overflow.
        unchecked {
            address recoveredAddress = ecrecover(
                keccak256(
                    abi.encodePacked(
                        "\x19\x01",
                        DOMAIN_SEPARATOR(),
                        keccak256(
                            abi.encode(
                                keccak256(
                                    "Permit(address owner,address spender,uint256 value,uint256 nonce,uint256 deadline)"
                                ),
                                owner,
                                spender,
                                value,
                                nonces[owner]++,
                                deadline
                            )
                        )
                    )
                ),
                v,
                r,
                s
            );

            require(recoveredAddress != address(0) && recoveredAddress == owner, "INVALID_SIGNER");

            allowance[recoveredAddress][spender] = value;
        }

        emit Approval(owner, spender, value);
    }

    function DOMAIN_SEPARATOR() public view virtual returns (bytes32) {
        return block.chainid == INITIAL_CHAIN_ID ? INITIAL_DOMAIN_SEPARATOR : computeDomainSeparator();
    }

    function computeDomainSeparator() internal view virtual returns (bytes32) {
        return
            keccak256(
                abi.encode(
                    keccak256("EIP712Domain(string name,string version,uint256 chainId,address verifyingContract)"),
                    keccak256(bytes(name)),
                    keccak256("1"),
                    block.chainid,
                    address(this)
                )
            );
    }

    /*//////////////////////////////////////////////////////////////
                        INTERNAL MINT/BURN LOGIC
    //////////////////////////////////////////////////////////////*/

    function _mint(address to, uint256 amount) internal virtual {
        totalSupply += amount;

        // Cannot overflow because the sum of all user
        // balances can't exceed the max uint256 value.
        unchecked {
            balanceOf[to] += amount;
        }

        emit Transfer(address(0), to, amount);
    }

    function _burn(address from, uint256 amount) internal virtual {
        balanceOf[from] -= amount;

        // Cannot underflow because a user's balance
        // will never be larger than the total supply.
        unchecked {
            totalSupply -= amount;
        }

        emit Transfer(from, address(0), amount);
    }
}

Settings
{
  "remappings": [
    "@openzeppelin/=lib/openzeppelin-contracts/",
    "@solmate/=lib/solmate/src/",
    "ds-test/=lib/forge-std/lib/ds-test/src/",
    "forge-std/=lib/forge-std/src/",
    "openzeppelin-contracts/=lib/openzeppelin-contracts/",
    "solmate/=lib/solmate/src/"
  ],
  "optimizer": {
    "enabled": true,
    "runs": 20000
  },
  "metadata": {
    "bytecodeHash": "ipfs",
    "appendCBOR": true
  },
  "outputSelection": {
    "*": {
      "*": [
        "evm.bytecode",
        "evm.deployedBytecode",
        "devdoc",
        "userdoc",
        "metadata",
        "abi"
      ]
    }
  },
  "evmVersion": "london",
  "libraries": {}
}

Contract Security Audit

Contract ABI

[{"inputs":[{"internalType":"uint256","name":"rewardPerSecond_","type":"uint256"},{"internalType":"uint256","name":"start_","type":"uint256"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"AMOUNT_IS_NOT_ENOUGH","type":"error"},{"inputs":[],"name":"DEPOSIT_AMOUNT_ZERO","type":"error"},{"inputs":[],"name":"WITHDRAW_AMOUNT_TOO_LARGE","type":"error"},{"inputs":[],"name":"WITHDRAW_AMOUNT_ZERO","type":"error"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":true,"internalType":"uint256","name":"pid","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"index","type":"uint256"}],"name":"Deposit","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":true,"internalType":"uint256","name":"pid","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"EmergencyWithdraw","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"pid","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"allocPoint","type":"uint256"}],"name":"PoolUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"newRewards","type":"uint256"}],"name":"RewardPerSecondUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"newToken","type":"address"}],"name":"RewardTokenUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":true,"internalType":"uint256","name":"pid","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"index","type":"uint256"}],"name":"Withdraw","type":"event"},{"inputs":[{"internalType":"uint256","name":"allocPoint","type":"uint256"},{"internalType":"address","name":"lpToken","type":"address"},{"internalType":"contract IStake2","name":"stake2","type":"address"},{"internalType":"bool","name":"withUpdate","type":"bool"}],"name":"add","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256[]","name":"pids","type":"uint256[]"}],"name":"batchClaim","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"pid","type":"uint256"}],"name":"claim","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"pid","type":"uint256"},{"internalType":"address","name":"user","type":"address"}],"name":"claimFor","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"pid","type":"uint256"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"deposit","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"uint256","name":"pid","type":"uint256"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"uint256","name":"deadline","type":"uint256"},{"internalType":"uint8","name":"v","type":"uint8"},{"internalType":"bytes32","name":"r","type":"bytes32"},{"internalType":"bytes32","name":"s","type":"bytes32"}],"name":"depositWithPermit","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"pid","type":"uint256"}],"name":"emergencyWithdraw","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"massUpdatePools","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"pid","type":"uint256"},{"internalType":"address","name":"_user","type":"address"}],"name":"pendingReward","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"poolInfo","outputs":[{"internalType":"address","name":"lpToken","type":"address"},{"internalType":"uint256","name":"allocPoint","type":"uint256"},{"internalType":"uint256","name":"lastRewardTime","type":"uint256"},{"internalType":"uint256","name":"accRewardPerShareIndex","type":"uint256"},{"internalType":"contract IStake2","name":"stake2","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"poolLength","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"rewardPerSecond","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"rewardToken","outputs":[{"internalType":"contract IMint","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"pid","type":"uint256"},{"internalType":"uint256","name":"allocPoint","type":"uint256"},{"internalType":"bool","name":"withUpdate","type":"bool"}],"name":"set","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"rewardPerSecond_","type":"uint256"}],"name":"setRewardPerSecond","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract IMint","name":"newToken","type":"address"}],"name":"setRewardToken","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"startTime","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalAllocPoint","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"pid","type":"uint256"}],"name":"updatePool","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"address","name":"","type":"address"}],"name":"userInfo","outputs":[{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"uint256","name":"index","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"pid","type":"uint256"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"withdraw","outputs":[],"stateMutability":"nonpayable","type":"function"}]

60a060405234801561001057600080fd5b50604051611bb6380380611bb683398101604081905261002f9161007e565b600080546001600160a01b031916339081178255604051909182917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908290a3506002919091556080526100a2565b6000806040838503121561009157600080fd5b505080516020909101519092909150565b608051611aeb6100cb6000396000818161034901528181610d830152610daa0152611aeb6000f3fe6080604052600436106101805760003560e01c806366da5815116100d657806398969e821161007f578063e2bbb15811610059578063e2bbb158146104a7578063f2fde38b146104ba578063f7c618c1146104da57600080fd5b806398969e8214610447578063bc29278214610467578063c71b4b431461048757600080fd5b80638da5cb5b116100b05780638da5cb5b1461038b5780638f10369a146103dd57806393f1a40b146103f357600080fd5b806366da58151461031757806378e97925146103375780638aee81271461036b57600080fd5b8063441a3e70116101385780635312ea8e116101125780635312ea8e146102c2578063630b5ba1146102e257806364482f79146102f757600080fd5b8063441a3e7014610262578063515bc3231461028257806351eb05a6146102a257600080fd5b80631526fe27116101695780631526fe27146101cb57806317caf6f11461022c578063379607f51461024257600080fd5b8063081e3eda1461018557806310ee3f00146101a9575b600080fd5b34801561019157600080fd5b506003545b6040519081526020015b60405180910390f35b3480156101b557600080fd5b506101c96101c4366004611767565b610507565b005b3480156101d757600080fd5b506101eb6101e6366004611797565b610515565b6040805173ffffffffffffffffffffffffffffffffffffffff968716815260208101959095528401929092526060830152909116608082015260a0016101a0565b34801561023857600080fd5b5061019660055481565b34801561024e57600080fd5b506101c961025d366004611797565b610570565b34801561026e57600080fd5b506101c961027d3660046117b0565b61057d565b34801561028e57600080fd5b506101c961029d3660046117d2565b61075e565b3480156102ae57600080fd5b506101c96102bd366004611797565b61083f565b3480156102ce57600080fd5b506101c96102dd366004611797565b61088b565b3480156102ee57600080fd5b506101c961092e565b34801561030357600080fd5b506101c9610312366004611840565b610955565b34801561032357600080fd5b506101c9610332366004611797565b610a90565b34801561034357600080fd5b506101967f000000000000000000000000000000000000000000000000000000000000000081565b34801561037757600080fd5b506101c9610386366004611875565b610b55565b34801561039757600080fd5b506000546103b89073ffffffffffffffffffffffffffffffffffffffff1681565b60405173ffffffffffffffffffffffffffffffffffffffff90911681526020016101a0565b3480156103e957600080fd5b5061019660025481565b3480156103ff57600080fd5b5061043261040e366004611767565b60046020908152600092835260408084209091529082529020805460019091015482565b604080519283526020830191909152016101a0565b34801561045357600080fd5b50610196610462366004611767565b610c49565b34801561047357600080fd5b506101c9610482366004611899565b610cac565b34801561049357600080fd5b506101c96104a236600461190e565b610cf0565b6101c96104b53660046117b0565b610f77565b3480156104c657600080fd5b506101c96104d5366004611875565b611122565b3480156104e657600080fd5b506001546103b89073ffffffffffffffffffffffffffffffffffffffff1681565b6105118282611213565b5050565b6003818154811061052557600080fd5b60009182526020909120600590910201805460018201546002830154600384015460049094015473ffffffffffffffffffffffffffffffffffffffff93841695509193909290911685565b61057a8133611213565b50565b806000036105b7576040517f6d56aefd00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6105c18233611213565b600082815260046020908152604080832033845290915290208054821115610615576040517f66f5daab00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60006003848154811061062a5761062a61195f565b600091825260209091208354859003845560059091020180549091506106669073ffffffffffffffffffffffffffffffffffffffff168461135e565b600481015473ffffffffffffffffffffffffffffffffffffffff1615610714576004818101546040517f0dbf916d00000000000000000000000000000000000000000000000000000000815233928101929092526024820185905273ffffffffffffffffffffffffffffffffffffffff1690630dbf916d90604401600060405180830381600087803b1580156106fb57600080fd5b505af115801561070f573d6000803e3d6000fd5b505050505b6001820154604080518581526020810192909252859133917f02f25270a4d87bea75db541cdfe559334a275b4a233520ed6c0a2429667cca9491015b60405180910390a350505050565b600386815481106107715761077161195f565b60009182526020909120600590910201546040517fd505accf000000000000000000000000000000000000000000000000000000008152336004820152306024820152604481018790526064810186905260ff8516608482015260a4810184905260c4810183905273ffffffffffffffffffffffffffffffffffffffff9091169063d505accf9060e401600060405180830381600087803b15801561081557600080fd5b505af1158015610829573d6000803e3d6000fd5b505050506108378686610f77565b505050505050565b6000600382815481106108545761085461195f565b9060005260206000209060050201905080600201544211610873575050565b61087c8261139a565b60038201554260029091015550565b6000600382815481106108a0576108a061195f565b600091825260208083208584526004825260408085203386529092529083208054848255600182019490945560059092020180549093509091906108fa9073ffffffffffffffffffffffffffffffffffffffff168261135e565b604051818152849033907fbb757047c2b5f3974fe26b7c10f732e7bce710b0952a71082702781e62ae059590602001610750565b60035460005b81811015610511576109458161083f565b61094e816119bd565b9050610934565b60005473ffffffffffffffffffffffffffffffffffffffff1633146109db576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600c60248201527f554e415554484f52495a4544000000000000000000000000000000000000000060448201526064015b60405180910390fd5b80156109e9576109e961092e565b6000600384815481106109fe576109fe61195f565b90600052602060002090600502016001015490508260038581548110610a2657610a2661195f565b906000526020600020906005020160010181905550828160055403016005819055507f7fa9647ec1cc14e3822b46d05a2b9d4e019bde8875c0088c46b6503d71bf17228484604051610a82929190918252602082015260400190565b60405180910390a150505050565b60005473ffffffffffffffffffffffffffffffffffffffff163314610b11576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600c60248201527f554e415554484f52495a4544000000000000000000000000000000000000000060448201526064016109d2565b610b1961092e565b60028190556040518181527f951c6f64eb06ec6a6682072cda71420984dd55199006684bb820a80fd7e98793906020015b60405180910390a150565b60005473ffffffffffffffffffffffffffffffffffffffff163314610bd6576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600c60248201527f554e415554484f52495a4544000000000000000000000000000000000000000060448201526064016109d2565b600180547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff83169081179091556040519081527fa5289ba11778999f4dfb9415023783188d42bbb5db0612cbfbe55999069612a090602001610b4a565b600082815260046020908152604080832073ffffffffffffffffffffffffffffffffffffffff851684529091528120600181015464e8d4a5100090610c8d8661139a565b0382600001540281610ca157610ca16119f5565b049150505b92915050565b60005b81811015610ceb57610cd9838383818110610ccc57610ccc61195f565b9050602002013533611213565b80610ce3816119bd565b915050610caf565b505050565b60005473ffffffffffffffffffffffffffffffffffffffff163314610d71576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600c60248201527f554e415554484f52495a4544000000000000000000000000000000000000000060448201526064016109d2565b8015610d7f57610d7f61092e565b60007f00000000000000000000000000000000000000000000000000000000000000004211610dce577f0000000000000000000000000000000000000000000000000000000000000000610dd0565b425b60058054870181556040805160a08101825273ffffffffffffffffffffffffffffffffffffffff8089168252602082018a81529282018581526000606084018181528a8416608086019081526003805460018181018355948290529651969098027fc2575a0e9e593c00f959f8c92f12db2869c3395a3b0502d05e2516446f71f85b810180549787167fffffffffffffffffffffffff000000000000000000000000000000000000000098891617905596517fc2575a0e9e593c00f959f8c92f12db2869c3395a3b0502d05e2516446f71f85c88015592517fc2575a0e9e593c00f959f8c92f12db2869c3395a3b0502d05e2516446f71f85d870155517fc2575a0e9e593c00f959f8c92f12db2869c3395a3b0502d05e2516446f71f85e86015590517fc2575a0e9e593c00f959f8c92f12db2869c3395a3b0502d05e2516446f71f85f909401805494909216939092169290921790915590549192507f7fa9647ec1cc14e3822b46d05a2b9d4e019bde8875c0088c46b6503d71bf172291610f599190611a24565b60408051918252602082018890520160405180910390a15050505050565b80600003610fb1576040517f8dbdfcb000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b610fbb8233611213565b600060038381548110610fd057610fd061195f565b6000918252602080832086845260048252604080852033865290925292206005909102909101805490925061101b9073ffffffffffffffffffffffffffffffffffffffff16846114f1565b8281600001600082825461102f9190611a37565b9091555050600482015473ffffffffffffffffffffffffffffffffffffffff16156110e2576004828101546040517fa18bb48200000000000000000000000000000000000000000000000000000000815233928101929092526024820185905273ffffffffffffffffffffffffffffffffffffffff169063a18bb48290604401600060405180830381600087803b1580156110c957600080fd5b505af11580156110dd573d6000803e3d6000fd5b505050505b6001810154604080518581526020810192909252859133917f36af321ec8d3c75236829c5317affd40ddb308863a1236d2d277a4025cccee1e9101610750565b60005473ffffffffffffffffffffffffffffffffffffffff1633146111a3576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600c60248201527f554e415554484f52495a4544000000000000000000000000000000000000000060448201526064016109d2565b600080547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff83169081178255604051909133917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a350565b61121c8261083f565b6000600383815481106112315761123161195f565b6000918252602080832086845260048252604080852073ffffffffffffffffffffffffffffffffffffffff8816865290925292208054600590920290920192501561134d57600064e8d4a51000826001015484600301546112929190611a24565b835461129e9190611a4a565b6112a89190611a61565b6003840154600184015590508015611347576001546040517f40c10f1900000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff868116600483015260248201849052909116906340c10f1990604401600060405180830381600087803b15801561132e57600080fd5b505af1158015611342573d6000803e3d6000fd5b505050505b50611358565b600382015460018201555b50505050565b8060000361136a575050565b73ffffffffffffffffffffffffffffffffffffffff821661138f576105113382611551565b6105118233836115c6565b600080600383815481106113b0576113b061195f565b6000918252602082206003600590920201908101548154919350919073ffffffffffffffffffffffffffffffffffffffff161561147d5782546040517f70a0823100000000000000000000000000000000000000000000000000000000815230600482015273ffffffffffffffffffffffffffffffffffffffff909116906370a0823190602401602060405180830381865afa158015611454573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906114789190611a9c565b61147f565b475b90508260020154421180156114945750600081115b156114e9576000806005548560010154600254876002015442030202816114bd576114bd6119f5565b0490508264e8d4a510008202816114d6576114d66119f5565b0491506114e590508184611a37565b9250505b509392505050565b73ffffffffffffffffffffffffffffffffffffffff821661154557348114610511576040517ff3297aba00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6105118233308461167f565b600080600080600085875af1905080610ceb576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601360248201527f4554485f5452414e534645525f4641494c45440000000000000000000000000060448201526064016109d2565b60006040517fa9059cbb000000000000000000000000000000000000000000000000000000008152836004820152826024820152602060006044836000895af13d15601f3d1160016000511416171691505080611358576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600f60248201527f5452414e534645525f4641494c4544000000000000000000000000000000000060448201526064016109d2565b60006040517f23b872dd0000000000000000000000000000000000000000000000000000000081528460048201528360248201528260448201526020600060648360008a5af13d15601f3d116001600051141617169150508061173e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601460248201527f5452414e534645525f46524f4d5f4641494c454400000000000000000000000060448201526064016109d2565b5050505050565b73ffffffffffffffffffffffffffffffffffffffff8116811461057a57600080fd5b6000806040838503121561177a57600080fd5b82359150602083013561178c81611745565b809150509250929050565b6000602082840312156117a957600080fd5b5035919050565b600080604083850312156117c357600080fd5b50508035926020909101359150565b60008060008060008060c087890312156117eb57600080fd5b863595506020870135945060408701359350606087013560ff8116811461181157600080fd5b9598949750929560808101359460a0909101359350915050565b8035801515811461183b57600080fd5b919050565b60008060006060848603121561185557600080fd5b833592506020840135915061186c6040850161182b565b90509250925092565b60006020828403121561188757600080fd5b813561189281611745565b9392505050565b600080602083850312156118ac57600080fd5b823567ffffffffffffffff808211156118c457600080fd5b818501915085601f8301126118d857600080fd5b8135818111156118e757600080fd5b8660208260051b85010111156118fc57600080fd5b60209290920196919550909350505050565b6000806000806080858703121561192457600080fd5b84359350602085013561193681611745565b9250604085013561194681611745565b91506119546060860161182b565b905092959194509250565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b60007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82036119ee576119ee61198e565b5060010190565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b81810381811115610ca657610ca661198e565b80820180821115610ca657610ca661198e565b8082028115828204841417610ca657610ca661198e565b600082611a97577f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b500490565b600060208284031215611aae57600080fd5b505191905056fea264697066735822122084156546938fb81ff09a878851fa0f0ffee1bb3a8d17c7fe389d6daacaac204264736f6c634300081300330000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000006457b5e8

Deployed Bytecode

0x6080604052600436106101805760003560e01c806366da5815116100d657806398969e821161007f578063e2bbb15811610059578063e2bbb158146104a7578063f2fde38b146104ba578063f7c618c1146104da57600080fd5b806398969e8214610447578063bc29278214610467578063c71b4b431461048757600080fd5b80638da5cb5b116100b05780638da5cb5b1461038b5780638f10369a146103dd57806393f1a40b146103f357600080fd5b806366da58151461031757806378e97925146103375780638aee81271461036b57600080fd5b8063441a3e70116101385780635312ea8e116101125780635312ea8e146102c2578063630b5ba1146102e257806364482f79146102f757600080fd5b8063441a3e7014610262578063515bc3231461028257806351eb05a6146102a257600080fd5b80631526fe27116101695780631526fe27146101cb57806317caf6f11461022c578063379607f51461024257600080fd5b8063081e3eda1461018557806310ee3f00146101a9575b600080fd5b34801561019157600080fd5b506003545b6040519081526020015b60405180910390f35b3480156101b557600080fd5b506101c96101c4366004611767565b610507565b005b3480156101d757600080fd5b506101eb6101e6366004611797565b610515565b6040805173ffffffffffffffffffffffffffffffffffffffff968716815260208101959095528401929092526060830152909116608082015260a0016101a0565b34801561023857600080fd5b5061019660055481565b34801561024e57600080fd5b506101c961025d366004611797565b610570565b34801561026e57600080fd5b506101c961027d3660046117b0565b61057d565b34801561028e57600080fd5b506101c961029d3660046117d2565b61075e565b3480156102ae57600080fd5b506101c96102bd366004611797565b61083f565b3480156102ce57600080fd5b506101c96102dd366004611797565b61088b565b3480156102ee57600080fd5b506101c961092e565b34801561030357600080fd5b506101c9610312366004611840565b610955565b34801561032357600080fd5b506101c9610332366004611797565b610a90565b34801561034357600080fd5b506101967f000000000000000000000000000000000000000000000000000000006457b5e881565b34801561037757600080fd5b506101c9610386366004611875565b610b55565b34801561039757600080fd5b506000546103b89073ffffffffffffffffffffffffffffffffffffffff1681565b60405173ffffffffffffffffffffffffffffffffffffffff90911681526020016101a0565b3480156103e957600080fd5b5061019660025481565b3480156103ff57600080fd5b5061043261040e366004611767565b60046020908152600092835260408084209091529082529020805460019091015482565b604080519283526020830191909152016101a0565b34801561045357600080fd5b50610196610462366004611767565b610c49565b34801561047357600080fd5b506101c9610482366004611899565b610cac565b34801561049357600080fd5b506101c96104a236600461190e565b610cf0565b6101c96104b53660046117b0565b610f77565b3480156104c657600080fd5b506101c96104d5366004611875565b611122565b3480156104e657600080fd5b506001546103b89073ffffffffffffffffffffffffffffffffffffffff1681565b6105118282611213565b5050565b6003818154811061052557600080fd5b60009182526020909120600590910201805460018201546002830154600384015460049094015473ffffffffffffffffffffffffffffffffffffffff93841695509193909290911685565b61057a8133611213565b50565b806000036105b7576040517f6d56aefd00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6105c18233611213565b600082815260046020908152604080832033845290915290208054821115610615576040517f66f5daab00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60006003848154811061062a5761062a61195f565b600091825260209091208354859003845560059091020180549091506106669073ffffffffffffffffffffffffffffffffffffffff168461135e565b600481015473ffffffffffffffffffffffffffffffffffffffff1615610714576004818101546040517f0dbf916d00000000000000000000000000000000000000000000000000000000815233928101929092526024820185905273ffffffffffffffffffffffffffffffffffffffff1690630dbf916d90604401600060405180830381600087803b1580156106fb57600080fd5b505af115801561070f573d6000803e3d6000fd5b505050505b6001820154604080518581526020810192909252859133917f02f25270a4d87bea75db541cdfe559334a275b4a233520ed6c0a2429667cca9491015b60405180910390a350505050565b600386815481106107715761077161195f565b60009182526020909120600590910201546040517fd505accf000000000000000000000000000000000000000000000000000000008152336004820152306024820152604481018790526064810186905260ff8516608482015260a4810184905260c4810183905273ffffffffffffffffffffffffffffffffffffffff9091169063d505accf9060e401600060405180830381600087803b15801561081557600080fd5b505af1158015610829573d6000803e3d6000fd5b505050506108378686610f77565b505050505050565b6000600382815481106108545761085461195f565b9060005260206000209060050201905080600201544211610873575050565b61087c8261139a565b60038201554260029091015550565b6000600382815481106108a0576108a061195f565b600091825260208083208584526004825260408085203386529092529083208054848255600182019490945560059092020180549093509091906108fa9073ffffffffffffffffffffffffffffffffffffffff168261135e565b604051818152849033907fbb757047c2b5f3974fe26b7c10f732e7bce710b0952a71082702781e62ae059590602001610750565b60035460005b81811015610511576109458161083f565b61094e816119bd565b9050610934565b60005473ffffffffffffffffffffffffffffffffffffffff1633146109db576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600c60248201527f554e415554484f52495a4544000000000000000000000000000000000000000060448201526064015b60405180910390fd5b80156109e9576109e961092e565b6000600384815481106109fe576109fe61195f565b90600052602060002090600502016001015490508260038581548110610a2657610a2661195f565b906000526020600020906005020160010181905550828160055403016005819055507f7fa9647ec1cc14e3822b46d05a2b9d4e019bde8875c0088c46b6503d71bf17228484604051610a82929190918252602082015260400190565b60405180910390a150505050565b60005473ffffffffffffffffffffffffffffffffffffffff163314610b11576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600c60248201527f554e415554484f52495a4544000000000000000000000000000000000000000060448201526064016109d2565b610b1961092e565b60028190556040518181527f951c6f64eb06ec6a6682072cda71420984dd55199006684bb820a80fd7e98793906020015b60405180910390a150565b60005473ffffffffffffffffffffffffffffffffffffffff163314610bd6576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600c60248201527f554e415554484f52495a4544000000000000000000000000000000000000000060448201526064016109d2565b600180547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff83169081179091556040519081527fa5289ba11778999f4dfb9415023783188d42bbb5db0612cbfbe55999069612a090602001610b4a565b600082815260046020908152604080832073ffffffffffffffffffffffffffffffffffffffff851684529091528120600181015464e8d4a5100090610c8d8661139a565b0382600001540281610ca157610ca16119f5565b049150505b92915050565b60005b81811015610ceb57610cd9838383818110610ccc57610ccc61195f565b9050602002013533611213565b80610ce3816119bd565b915050610caf565b505050565b60005473ffffffffffffffffffffffffffffffffffffffff163314610d71576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600c60248201527f554e415554484f52495a4544000000000000000000000000000000000000000060448201526064016109d2565b8015610d7f57610d7f61092e565b60007f000000000000000000000000000000000000000000000000000000006457b5e84211610dce577f000000000000000000000000000000000000000000000000000000006457b5e8610dd0565b425b60058054870181556040805160a08101825273ffffffffffffffffffffffffffffffffffffffff8089168252602082018a81529282018581526000606084018181528a8416608086019081526003805460018181018355948290529651969098027fc2575a0e9e593c00f959f8c92f12db2869c3395a3b0502d05e2516446f71f85b810180549787167fffffffffffffffffffffffff000000000000000000000000000000000000000098891617905596517fc2575a0e9e593c00f959f8c92f12db2869c3395a3b0502d05e2516446f71f85c88015592517fc2575a0e9e593c00f959f8c92f12db2869c3395a3b0502d05e2516446f71f85d870155517fc2575a0e9e593c00f959f8c92f12db2869c3395a3b0502d05e2516446f71f85e86015590517fc2575a0e9e593c00f959f8c92f12db2869c3395a3b0502d05e2516446f71f85f909401805494909216939092169290921790915590549192507f7fa9647ec1cc14e3822b46d05a2b9d4e019bde8875c0088c46b6503d71bf172291610f599190611a24565b60408051918252602082018890520160405180910390a15050505050565b80600003610fb1576040517f8dbdfcb000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b610fbb8233611213565b600060038381548110610fd057610fd061195f565b6000918252602080832086845260048252604080852033865290925292206005909102909101805490925061101b9073ffffffffffffffffffffffffffffffffffffffff16846114f1565b8281600001600082825461102f9190611a37565b9091555050600482015473ffffffffffffffffffffffffffffffffffffffff16156110e2576004828101546040517fa18bb48200000000000000000000000000000000000000000000000000000000815233928101929092526024820185905273ffffffffffffffffffffffffffffffffffffffff169063a18bb48290604401600060405180830381600087803b1580156110c957600080fd5b505af11580156110dd573d6000803e3d6000fd5b505050505b6001810154604080518581526020810192909252859133917f36af321ec8d3c75236829c5317affd40ddb308863a1236d2d277a4025cccee1e9101610750565b60005473ffffffffffffffffffffffffffffffffffffffff1633146111a3576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600c60248201527f554e415554484f52495a4544000000000000000000000000000000000000000060448201526064016109d2565b600080547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff83169081178255604051909133917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a350565b61121c8261083f565b6000600383815481106112315761123161195f565b6000918252602080832086845260048252604080852073ffffffffffffffffffffffffffffffffffffffff8816865290925292208054600590920290920192501561134d57600064e8d4a51000826001015484600301546112929190611a24565b835461129e9190611a4a565b6112a89190611a61565b6003840154600184015590508015611347576001546040517f40c10f1900000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff868116600483015260248201849052909116906340c10f1990604401600060405180830381600087803b15801561132e57600080fd5b505af1158015611342573d6000803e3d6000fd5b505050505b50611358565b600382015460018201555b50505050565b8060000361136a575050565b73ffffffffffffffffffffffffffffffffffffffff821661138f576105113382611551565b6105118233836115c6565b600080600383815481106113b0576113b061195f565b6000918252602082206003600590920201908101548154919350919073ffffffffffffffffffffffffffffffffffffffff161561147d5782546040517f70a0823100000000000000000000000000000000000000000000000000000000815230600482015273ffffffffffffffffffffffffffffffffffffffff909116906370a0823190602401602060405180830381865afa158015611454573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906114789190611a9c565b61147f565b475b90508260020154421180156114945750600081115b156114e9576000806005548560010154600254876002015442030202816114bd576114bd6119f5565b0490508264e8d4a510008202816114d6576114d66119f5565b0491506114e590508184611a37565b9250505b509392505050565b73ffffffffffffffffffffffffffffffffffffffff821661154557348114610511576040517ff3297aba00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6105118233308461167f565b600080600080600085875af1905080610ceb576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601360248201527f4554485f5452414e534645525f4641494c45440000000000000000000000000060448201526064016109d2565b60006040517fa9059cbb000000000000000000000000000000000000000000000000000000008152836004820152826024820152602060006044836000895af13d15601f3d1160016000511416171691505080611358576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600f60248201527f5452414e534645525f4641494c4544000000000000000000000000000000000060448201526064016109d2565b60006040517f23b872dd0000000000000000000000000000000000000000000000000000000081528460048201528360248201528260448201526020600060648360008a5af13d15601f3d116001600051141617169150508061173e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601460248201527f5452414e534645525f46524f4d5f4641494c454400000000000000000000000060448201526064016109d2565b5050505050565b73ffffffffffffffffffffffffffffffffffffffff8116811461057a57600080fd5b6000806040838503121561177a57600080fd5b82359150602083013561178c81611745565b809150509250929050565b6000602082840312156117a957600080fd5b5035919050565b600080604083850312156117c357600080fd5b50508035926020909101359150565b60008060008060008060c087890312156117eb57600080fd5b863595506020870135945060408701359350606087013560ff8116811461181157600080fd5b9598949750929560808101359460a0909101359350915050565b8035801515811461183b57600080fd5b919050565b60008060006060848603121561185557600080fd5b833592506020840135915061186c6040850161182b565b90509250925092565b60006020828403121561188757600080fd5b813561189281611745565b9392505050565b600080602083850312156118ac57600080fd5b823567ffffffffffffffff808211156118c457600080fd5b818501915085601f8301126118d857600080fd5b8135818111156118e757600080fd5b8660208260051b85010111156118fc57600080fd5b60209290920196919550909350505050565b6000806000806080858703121561192457600080fd5b84359350602085013561193681611745565b9250604085013561194681611745565b91506119546060860161182b565b905092959194509250565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b60007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82036119ee576119ee61198e565b5060010190565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b81810381811115610ca657610ca661198e565b80820180821115610ca657610ca661198e565b8082028115828204841417610ca657610ca661198e565b600082611a97577f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b500490565b600060208284031215611aae57600080fd5b505191905056fea264697066735822122084156546938fb81ff09a878851fa0f0ffee1bb3a8d17c7fe389d6daacaac204264736f6c63430008130033

Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)

0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000006457b5e8

-----Decoded View---------------
Arg [0] : rewardPerSecond_ (uint256): 0
Arg [1] : start_ (uint256): 1683469800

-----Encoded View---------------
2 Constructor Arguments found :
Arg [0] : 0000000000000000000000000000000000000000000000000000000000000000
Arg [1] : 000000000000000000000000000000000000000000000000000000006457b5e8


Block Transaction Difficulty Gas Used Reward
View All Blocks Produced

Block Uncle Number Difficulty Gas Used Reward
View All Uncles
Loading...
Loading
Loading...
Loading

Validator Index Block Amount
View All Withdrawals

Transaction Hash Block Value Eth2 PubKey Valid
View All Deposits
Loading...
Loading
[ Download: CSV Export  ]
[ Download: CSV Export  ]

A contract address hosts a smart contract, which is a set of code stored on the blockchain that runs when predetermined conditions are met. Learn more about addresses in our Knowledge Base.