Contract 0xf6481024a9e8b02dcb0dab05f7167aed86e4ce20

 
Txn Hash Method
Block
From
To
Value [Txn Fee]
0xce117fcc4eff9f4e4561b41bec59f5b628fc6be42ebf37644b2bbc0af9856890Get Reward517353462022-12-01 21:05:102 hrs 33 mins ago0x8eb9da111684294f6d57c8c400c71d33e1221800 IN  0xf6481024a9e8b02dcb0dab05f7167aed86e4ce200 FTM0.012444480971
0x337f8bf97dfb3b30eec831a64fbb726db2599f114567703618f104e1a35cf83fGet Reward516847632022-11-30 23:16:061 day 22 mins ago0x05a67eafa71ae3d6148e09622ba3c2bc9e0f4403 IN  0xf6481024a9e8b02dcb0dab05f7167aed86e4ce200 FTM0.063728912722
0xd31261fa11a6d88df5cc6a6f809118f542e1a0de36056f2a485bf610bdb350afGet Reward515832042022-11-29 4:31:592 days 19 hrs ago0x5ff92581fa55e9f03a53d33fae494385293515e6 IN  0xf6481024a9e8b02dcb0dab05f7167aed86e4ce200 FTM0.011825876165
0x65708bc09a90197e397f25b5f04321e23d96aa8f249697670c7963b4bd28e811Withdraw All512721852022-11-22 2:59:399 days 20 hrs ago0x5ff92581fa55e9f03a53d33fae494385293515e6 IN  0xf6481024a9e8b02dcb0dab05f7167aed86e4ce200 FTM0.031719505673
0xe50182893ec64d4080d941cfa1698bde3592bfc9f91871ba97c485463d267b0eGet Reward512718432022-11-22 2:48:279 days 20 hrs ago0x5ff92581fa55e9f03a53d33fae494385293515e6 IN  0xf6481024a9e8b02dcb0dab05f7167aed86e4ce200 FTM0.005914712441
0xf2b167396c91d9d4cb58c311f1e5df638ef424a9ca2d3b0a8d8b342718450f7aGet Reward508922052022-11-15 0:04:3516 days 23 hrs ago0x5ff92581fa55e9f03a53d33fae494385293515e6 IN  0xf6481024a9e8b02dcb0dab05f7167aed86e4ce200 FTM0.009380402251
0x16679b60e681766b5ab2061090ebf2d00bfab7cfeb79b28d57875c610618a538Get Reward507566562022-11-11 4:42:4420 days 18 hrs ago0x8eb9da111684294f6d57c8c400c71d33e1221800 IN  0xf6481024a9e8b02dcb0dab05f7167aed86e4ce200 FTM0.03030809996
0x396bba48e92be6b582e18525bcbd16930051ad95d5a0c93e35d5274404570617Get Reward505115402022-11-05 23:03:5226 days 34 mins ago0x05a67eafa71ae3d6148e09622ba3c2bc9e0f4403 IN  0xf6481024a9e8b02dcb0dab05f7167aed86e4ce200 FTM0.052582546573
0x583ae1ba6312668986c958658a39e42922001dc59e4ea0c82f1b896c9cd4c2d2Get Reward504030892022-11-02 20:57:0229 days 2 hrs ago0xa281c46bef794568c60494bc3c4e9f2d677381b3 IN  0xf6481024a9e8b02dcb0dab05f7167aed86e4ce200 FTM0.585280175672
0x1a67f3b74ba08378b0184c7b730180364793c2bd1653875b262db056db3fcf4cGet Reward502050602022-10-29 4:40:4033 days 18 hrs ago0x825b132e230c021644a636dc093f74a26891b9c2 IN  0xf6481024a9e8b02dcb0dab05f7167aed86e4ce200 FTM0.0002764075
0x8a363081af098d038823c23737c7127418ce76b80d47434a1990a98a40e2411aGet Reward501506912022-10-28 6:08:0134 days 17 hrs ago0x8eb9da111684294f6d57c8c400c71d33e1221800 IN  0xf6481024a9e8b02dcb0dab05f7167aed86e4ce200 FTM0.006599364559
0x8c8109ce5f25072d8e95c0dece3b6b55d3db61dd44bb947a00766e41057e6b0eGet Reward500595902022-10-26 21:54:0536 days 1 hr ago0x5ff92581fa55e9f03a53d33fae494385293515e6 IN  0xf6481024a9e8b02dcb0dab05f7167aed86e4ce200 FTM0.0002996575
0xfe4fc2f26915eef75e4d6ee24b2d04c5ecd60f52468e218dcf76c19703f7bebfWithdraw All500266342022-10-26 10:12:0936 days 13 hrs ago0x825b132e230c021644a636dc093f74a26891b9c2 IN  0xf6481024a9e8b02dcb0dab05f7167aed86e4ce200 FTM0.000452500849
0xacc9e9bb23470d773548c68d5592f9f41651ed07fa54e60b704ba1de17fa4ff8Deposit All498817972022-10-24 5:39:5638 days 17 hrs ago0x825b132e230c021644a636dc093f74a26891b9c2 IN  0xf6481024a9e8b02dcb0dab05f7167aed86e4ce200 FTM0.0004644625
0x1beb022f34c5a7a6f93bc2d9faeeb59aa8ec3db4c72212a37f1fcb8789a7d356Get Reward495151102022-10-19 7:08:5643 days 16 hrs ago0x8eb9da111684294f6d57c8c400c71d33e1221800 IN  0xf6481024a9e8b02dcb0dab05f7167aed86e4ce200 FTM0.0002953825
0x9024e9142db3b8a457d7cf903436083a9cc8decd985ad7cd7604b332e0e78cf0Get Reward493554132022-10-17 4:35:5645 days 19 hrs ago0x5ff92581fa55e9f03a53d33fae494385293515e6 IN  0xf6481024a9e8b02dcb0dab05f7167aed86e4ce200 FTM0.0002953825
0xa3bafc1c7d384e4fea3940e66d907c5839f45a3ed8c231c02908388e37bcb52aWithdraw All488653512022-10-10 14:02:3352 days 9 hrs ago0x83f3df36610f3a07304d246d197c5036ec11239b IN  0xf6481024a9e8b02dcb0dab05f7167aed86e4ce200 FTM0.057698115424
0xc44e7db0b9bfd4b8c3ad8283898fcb9146f440fb13517ce296717536d6f0e786Get Reward488653422022-10-10 14:02:0352 days 9 hrs ago0x83f3df36610f3a07304d246d197c5036ec11239b IN  0xf6481024a9e8b02dcb0dab05f7167aed86e4ce200 FTM0.083143304299
0xacb752106d299dd50db572e5872ef305ab385743b4032f372c01d35119aec947Get Reward488240082022-10-10 0:58:0152 days 22 hrs ago0x5ff92581fa55e9f03a53d33fae494385293515e6 IN  0xf6481024a9e8b02dcb0dab05f7167aed86e4ce200 FTM0.00030202793
0xfebd33201312c71ed43eeead36410196accccc5a4c58931006f7aa994ad89dfdGet Reward486647742022-10-07 23:50:5454 days 23 hrs ago0x74f2434554066a3ce9e5e400223d74d9cb4524df IN  0xf6481024a9e8b02dcb0dab05f7167aed86e4ce200 FTM0.001093142321
0xca4a1f4ac9b3d2f688a5761f7fde988e046195fd54e81109f3593b5f0cd290d0Withdraw All486222492022-10-07 10:25:5455 days 13 hrs ago0xb1bcc616c0251b2d9d3e7ded111e6b8a3e753a19 IN  0xf6481024a9e8b02dcb0dab05f7167aed86e4ce200 FTM0.0004005575
0x27bffee79923d4f49394df66f0a205b063fdcdf4ccef17c2e60b0a128c6ded3dGet Reward486221642022-10-07 10:24:1055 days 13 hrs ago0xb1bcc616c0251b2d9d3e7ded111e6b8a3e753a19 IN  0xf6481024a9e8b02dcb0dab05f7167aed86e4ce200 FTM0.0002534825
0xb45e44529b44df5aae1788680aacb82af0f4e540df8a265ee95ad2aa2ee3bedfDeposit All485020072022-10-05 21:20:4857 days 2 hrs ago0x83f3df36610f3a07304d246d197c5036ec11239b IN  0xf6481024a9e8b02dcb0dab05f7167aed86e4ce200 FTM0.000397078218
0xb49d9c6d5366f40ed0551c907100b9dda7ba63283b62eac66bc75674a7785486Get Reward484468252022-10-05 4:22:2057 days 19 hrs ago0x5ff92581fa55e9f03a53d33fae494385293515e6 IN  0xf6481024a9e8b02dcb0dab05f7167aed86e4ce200 FTM0.0002953825
0xfc4acf948d66367fb8c5bcf97f1efff071acd3ed27ee9c3e9c3c938a3c7f036eDeposit All482595612022-10-02 17:47:3360 days 5 hrs ago0xb1bcc616c0251b2d9d3e7ded111e6b8a3e753a19 IN  0xf6481024a9e8b02dcb0dab05f7167aed86e4ce200 FTM0.000385415
[ Download CSV Export 
Latest 1 internal transaction
Parent Txn Hash Block From To Value
0x6183a1a51e1523e1055776e1eaf6e04bc2481907db6d60be004568e47a54042a444333752022-08-07 20:57:51116 days 2 hrs ago SpiritSwap V2: Variable Gauge Proxy  Contract Creation0 FTM
[ Download CSV Export 
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
Gauge

Compiler Version
v0.8.11+commit.d7f03943

Optimization Enabled:
Yes with 200 runs

Other Settings:
default evmVersion

Contract Source Code (Solidity Standard Json-Input format)

File 1 of 1 : StableGaugeProxy.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.11;

library Address {
    function isContract(address account) internal view returns (bool) {
        bytes32 codehash;
        bytes32 accountHash = 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470;
        // solhint-disable-next-line no-inline-assembly
        assembly {
            codehash := extcodehash(account)
        }
        return (codehash != 0x0 && codehash != accountHash);
    }

    function toPayable(address account)
        internal
        pure
        returns (address payable)
    {
        return payable(address(uint160(account)));
    }

    function sendValue(address payable recipient, uint256 amount) internal {
        require(
            address(this).balance >= amount,
            "Address: insufficient balance"
        );

        // solhint-disable-next-line avoid-call-value
        (bool success, ) = recipient.call{value: amount}("");
        require(
            success,
            "Address: unable to send value, recipient may have reverted"
        );
    }
}

interface IERC20 {
    function totalSupply() external view returns (uint256);

    function balanceOf(address account) external view returns (uint256);

    function transfer(address recipient, uint256 amount)
        external
        returns (bool);

    function allowance(address owner, address spender)
        external
        view
        returns (uint256);

    function approve(address spender, uint256 amount) external returns (bool);

    function transferFrom(
        address sender,
        address recipient,
        uint256 amount
    ) external returns (bool);
}

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)
        );
    }

    function safeApprove(
        IERC20 token,
        address spender,
        uint256 value
    ) internal {
        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 {
        uint256 newAllowance = token.allowance(address(this), spender) - value;
        callOptionalReturn(
            token,
            abi.encodeWithSelector(
                token.approve.selector,
                spender,
                newAllowance
            )
        );
    }

    function callOptionalReturn(IERC20 token, bytes memory data) private {
        require(address(token).isContract(), "SafeERC20: call to non-contract");

        // solhint-disable-next-line avoid-low-level-calls
        (bool success, bytes memory returndata) = address(token).call(data);
        require(success, "SafeERC20: low-level call failed");

        if (returndata.length > 0) {
            // Return data is optional
            // solhint-disable-next-line max-line-length
            require(
                abi.decode(returndata, (bool)),
                "SafeERC20: ERC20 operation did not succeed"
            );
        }
    }
}

library Math {
    /**
     * @dev Returns the largest of two numbers.
     */
    function max(uint256 a, uint256 b) internal pure returns (uint256) {
        return a >= b ? a : b;
    }

    /**
     * @dev Returns the smallest of two numbers.
     */
    function min(uint256 a, uint256 b) internal pure returns (uint256) {
        return a < b ? a : b;
    }

    /**
     * @dev Returns the average of two numbers. The result is rounded towards
     * zero.
     */
    function average(uint256 a, uint256 b) internal pure returns (uint256) {
        // (a + b) / 2 can overflow, so we distribute
        return (a / 2) + (b / 2) + (((a % 2) + (b % 2)) / 2);
    }
}

/**
 * @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 make 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;
    }
}

interface IBaseV1Pair {
    function claimFees() external returns (uint, uint);
    function tokens() external returns (address, address);
    function stable() external returns (bool);
}

interface IBaseV1Factory {
    function isPair(address _tokenLP) external returns (bool);
}

interface IBribe {
    function _deposit(uint256 _amount, address _user) external;
    function _withdraw(uint256 _amount, address _user) external;
    function left(address rewardToken) external view returns (uint256);
    function addReward(address _rewardsToken) external;
    function getRewardForOwner(address _user) external;
    function notifyRewardAmount(address _rewardsToken, uint256 reward) external;
}

interface IGaugeProxy {
    function bribes(address gauge) external returns (address);
}

contract Gauge is ReentrancyGuard {
    using SafeERC20 for IERC20;

    IERC20 public SPIRIT;
    IERC20 public inSPIRIT;

    IERC20 public immutable TOKEN;
    address public immutable DISTRIBUTION;
    uint256 public constant DURATION = 7 days;

    uint256 public periodFinish = 0;
    uint256 public rewardRate = 0;
    uint256 public lastUpdateTime;
    uint256 public rewardPerTokenStored;

    uint256 public fees0;
    uint256 public fees1;

    address public gaugeProxy;

    modifier onlyDistribution() {
        require(
            msg.sender == DISTRIBUTION,
            "Caller is not RewardsDistribution contract"
        );
        _;
    }

    mapping(address => uint256) public userRewardPerTokenPaid;
    mapping(address => uint256) public rewards;

    uint256 private _totalSupply;
    uint256 public derivedSupply;
    mapping(address => uint256) private _balances;
    mapping(address => uint256) public derivedBalances;
    mapping(address => uint256) private _base;

    constructor(
        address _spirit,
        address _inSpirit,
        address _token, 
        address _gaugeProxy
    ) public {
        SPIRIT = IERC20(_spirit);
        inSPIRIT = IERC20(_inSpirit);
        TOKEN = IERC20(_token);
        gaugeProxy = _gaugeProxy;
        DISTRIBUTION = msg.sender;
    }

    function claimVotingFees() external nonReentrant returns (uint claimed0, uint claimed1) {
        // require address(TOKEN) is BaseV1Pair
        return _claimVotingFees();
    }

    function _claimVotingFees() internal returns (uint claimed0, uint claimed1) {
        (claimed0, claimed1) = IBaseV1Pair(address(TOKEN)).claimFees();
        address bribe = IGaugeProxy(gaugeProxy).bribes(address(this));
        if (claimed0 > 0 || claimed1 > 0) {
            uint _fees0 = fees0 + claimed0;
            uint _fees1 = fees1 + claimed1;
            (address _token0, address _token1) = IBaseV1Pair(address(TOKEN)).tokens();
            if (_fees0 > IBribe(bribe).left(_token0) && _fees0 / DURATION > 0) {
                fees0 = 0;
                IERC20(_token0).safeApprove(bribe, _fees0);
                IBribe(bribe).notifyRewardAmount(_token0, _fees0);
            } else {
                fees0 = _fees0;
            }
            if (_fees1 > IBribe(bribe).left(_token1) && _fees1 / DURATION > 0) {
                fees1 = 0;
                IERC20(_token1).safeApprove(bribe, _fees1);
                IBribe(bribe).notifyRewardAmount(_token1, _fees1);
            } else {
                fees1 = _fees1;
            }

            emit ClaimVotingFees(msg.sender, claimed0, claimed1);
        }
    }

    function totalSupply() external view returns (uint256) {
        return _totalSupply;
    }

    function balanceOf(address account) external view returns (uint256) {
        return _balances[account];
    }

    function lastTimeRewardApplicable() public view returns (uint256) {
        return Math.min(block.timestamp, periodFinish);
    }

    function rewardPerToken() public view returns (uint256) {
        if (derivedSupply == 0) {
            return 0;
        }

        if (_totalSupply == 0) {
            return rewardPerTokenStored;
        }
        return rewardPerTokenStored + ((lastTimeRewardApplicable() - lastUpdateTime) * rewardRate * 1e18 / derivedSupply);
    }

    function derivedBalance(address account) public view returns (uint256) {
        if (inSPIRIT.totalSupply() == 0) return 0;
        uint256 _balance = _balances[account];
        uint256 _derived = _balance * 40 / 100;
        uint256 _adjusted = (_totalSupply * inSPIRIT.balanceOf(account) / inSPIRIT.totalSupply()) * 60 / 100;
        return Math.min(_derived + _adjusted, _balance);
    }

    function kick(address account) public {
        uint256 _derivedBalance = derivedBalances[account];
        derivedSupply = derivedSupply - _derivedBalance;
        _derivedBalance = derivedBalance(account);
        derivedBalances[account] = _derivedBalance;
        derivedSupply = derivedSupply + _derivedBalance;
    }

    function earned(address account) public view returns (uint256) {
        return (derivedBalances[account] * (rewardPerToken() - userRewardPerTokenPaid[account]) / 1e18) + rewards[account];
    }

    function getRewardForDuration() external view returns (uint256) {
        return rewardRate * DURATION;
    }

    function depositAll() external {
        _deposit(TOKEN.balanceOf(msg.sender), msg.sender);
    }

    function deposit(uint256 amount) external {
        _deposit(amount, msg.sender);
    }

    function depositFor(uint256 amount, address account) external {
        _deposit(amount, account);
    }

    function _deposit(uint256 amount, address account)
        internal
        nonReentrant
        updateReward(account)
    {
        require(amount > 0, "deposit(Gauge): cannot stake 0");

        uint256 userAmount = amount;

        _balances[account] = _balances[account] + userAmount;
        _totalSupply = _totalSupply + userAmount;

        TOKEN.safeTransferFrom(account, address(this), amount);

        emit Staked(account, userAmount);
    }

    function withdrawAll() external {
        _withdraw(_balances[msg.sender]);
    }

    function withdraw(uint256 amount) external {
        _withdraw(amount);
    }

    function _withdraw(uint256 amount)
        internal
        nonReentrant
        updateReward(msg.sender)
    {
        require(amount > 0, "Cannot withdraw 0");
        _totalSupply = _totalSupply - amount;
        _balances[msg.sender] = _balances[msg.sender] - amount;
        TOKEN.safeTransfer(msg.sender, amount);
        emit Withdrawn(msg.sender, amount);
    }

    function getReward() public nonReentrant updateReward(msg.sender) {
        uint256 reward = rewards[msg.sender];
        if (reward > 0) {
            rewards[msg.sender] = 0;
            SPIRIT.safeTransfer(msg.sender, reward);
            emit RewardPaid(msg.sender, reward);
        }
    }

    function notifyRewardAmount(uint256 reward)
        external
        onlyDistribution
        updateReward(address(0))
    {
        SPIRIT.safeTransferFrom(DISTRIBUTION, address(this), reward);
        if (block.timestamp >= periodFinish) {
            rewardRate = reward / DURATION;
        } else {
            uint256 remaining = periodFinish - block.timestamp;
            uint256 leftover = remaining * rewardRate;
            rewardRate = (reward + leftover) / DURATION;
        }

        // Ensure the provided reward amount is not more than the balance in the contract.
        // This keeps the reward rate in the right range, preventing overflows due to
        // very high values of rewardRate in the earned and rewardsPerToken functions;
        // Reward + leftover must be less than 2^256 / 10^18 to avoid overflow.
        uint256 balance = SPIRIT.balanceOf(address(this));
        require(
            rewardRate <= balance / DURATION,
            "Provided reward too high"
        );

        lastUpdateTime = block.timestamp;
        periodFinish = block.timestamp + DURATION;
        emit RewardAdded(reward);
    }

    modifier updateReward(address account) {
        rewardPerTokenStored = rewardPerToken();
        lastUpdateTime = lastTimeRewardApplicable();
        if (account != address(0)) {
            rewards[account] = earned(account);
            userRewardPerTokenPaid[account] = rewardPerTokenStored;
        }
        _;
        if (account != address(0)) {
            kick(account);
        }
    }

    event RewardAdded(uint256 reward);
    event Staked(address indexed user, uint256 amount);
    event Withdrawn(address indexed user, uint256 amount);
    event RewardPaid(address indexed user, uint256 reward);
    event ClaimVotingFees(address indexed from, uint256 claimed0, uint256 claimed1);
}

interface MasterChef {
    function deposit(uint256, uint256) external;

    function withdraw(uint256, uint256) external;

    function userInfo(uint256, address)
        external
        view
        returns (uint256, uint256);
}

interface IBaseV1BribeFactory {
    function createBribe(
        address owner,
        address _token0,
        address _token1
    ) external returns (address);
}

contract ProtocolGovernance {
    /// @notice governance address for the governance contract
    address public governance;
    address public pendingGovernance;

    /**
     * @notice Allows governance to change governance (for future upgradability)
     * @param _governance new governance address to set
     */
    function setGovernance(address _governance) external {
        require(msg.sender == governance, "setGovernance: !gov");
        pendingGovernance = _governance;
    }

    /**
     * @notice Allows pendingGovernance to accept their role as governance (protection pattern)
     */
    function acceptGovernance() external {
        require(
            msg.sender == pendingGovernance,
            "acceptGovernance: !pendingGov"
        );
        governance = pendingGovernance;
    }
}

contract MasterDill {

    /// @notice EIP-20 token name for this token
    string public constant name = "Master inSPIRIT";

    /// @notice EIP-20 token symbol for this token
    string public constant symbol = "minSPIRIT";

    /// @notice EIP-20 token decimals for this token
    uint8 public constant decimals = 18;

    /// @notice Total number of tokens in circulation
    uint256 public totalSupply = 1e18;

    mapping(address => mapping(address => uint256)) internal allowances;
    mapping(address => uint256) internal balances;

    /// @notice The standard EIP-20 transfer event
    event Transfer(address indexed from, address indexed to, uint256 amount);

    /// @notice The standard EIP-20 approval event
    event Approval(
        address indexed owner,
        address indexed spender,
        uint256 amount
    );

    constructor() public {
        balances[msg.sender] = 1e18;
        emit Transfer(address(0x0), msg.sender, 1e18);
    }

    /**
     * @notice Get the number of tokens `spender` is approved to spend on behalf of `account`
     * @param account The address of the account holding the funds
     * @param spender The address of the account spending the funds
     * @return The number of tokens approved
     */
    function allowance(address account, address spender)
        external
        view
        returns (uint256)
    {
        return allowances[account][spender];
    }

    /**
     * @notice Approve `spender` to transfer up to `amount` from `src`
     * @dev This will overwrite the approval amount for `spender`
     *  and is subject to issues noted [here](https://eips.ethereum.org/EIPS/eip-20#approve)
     * @param spender The address of the account which may transfer tokens
     * @param amount The number of tokens that are approved (2^256-1 means infinite)
     * @return Whether or not the approval succeeded
     */
    function approve(address spender, uint256 amount) external returns (bool) {
        allowances[msg.sender][spender] = amount;

        emit Approval(msg.sender, spender, amount);
        return true;
    }

    /**
     * @notice Get the number of tokens held by the `account`
     * @param account The address of the account to get the balance of
     * @return The number of tokens held
     */
    function balanceOf(address account) external view returns (uint256) {
        return balances[account];
    }

    /**
     * @notice Transfer `amount` tokens from `msg.sender` to `dst`
     * @param dst The address of the destination account
     * @param amount The number of tokens to transfer
     * @return Whether or not the transfer succeeded
     */
    function transfer(address dst, uint256 amount) external returns (bool) {
        _transferTokens(msg.sender, dst, amount);
        return true;
    }

    /**
     * @notice Transfer `amount` tokens from `src` to `dst`
     * @param src The address of the source account
     * @param dst The address of the destination account
     * @param amount The number of tokens to transfer
     * @return Whether or not the transfer succeeded
     */
    function transferFrom(
        address src,
        address dst,
        uint256 amount
    ) external returns (bool) {
        address spender = msg.sender;
        uint256 spenderAllowance = allowances[src][spender];

        if (spender != src && spenderAllowance != type(uint256).max) {
            uint256 newAllowance = spenderAllowance - amount;
            allowances[src][spender] = newAllowance;

            emit Approval(src, spender, newAllowance);
        }

        _transferTokens(src, dst, amount);
        return true;
    }

    function _transferTokens(
        address src,
        address dst,
        uint256 amount
    ) internal {
        require(src != address(0), "_transferTokens: zero address");
        require(dst != address(0), "_transferTokens: zero address");

        balances[src] = balances[src] - amount;
        balances[dst] = balances[dst] + amount;
        emit Transfer(src, dst, amount);
    }
}

contract StableGaugeProxy is ProtocolGovernance, ReentrancyGuard {
    using SafeERC20 for IERC20;

    MasterChef public MASTER;
    IERC20 public inSPIRIT;
    IERC20 public SPIRIT;
    IERC20 public immutable TOKEN; // mInSpirit

    address public admin; //Admin address to manage gauges like add/deprecate/resurrect
    uint256 public minFee = 100 ether;

    // Address for bribeFactory
    address public bribeFactory;
    uint256 public immutable MIN_INSPIRIT_FOR_VERIFY = 1e23; // 100k inSPIRIT

    uint256 public pid = type(uint256).max; // -1 means 0xFFF....F and hasn't been set yet
    uint256 public totalWeight;

    // Time delays
    uint256 public voteDelay = 604800;
    uint256 public distributeDelay = 604800;
    uint256 public lastDistribute;
    mapping(address => uint256) public lastVote; // msg.sender => time of users last vote

    // V2 added variables for pre-distribute
    uint256 public lockedTotalWeight;
    uint256 public lockedBalance;
    uint256 public locktime;
    mapping(address => uint256) public lockedWeights; // token => weight
    mapping(address => bool) public hasDistributed; // LPtoken => bool

    // Variables verified tokens
    mapping(address => bool) public verifiedTokens; // verified tokens
    mapping(address => bool) public baseTokens; // Base tokens 
    address public pairFactory;

    // VE bool
    bool public ve = false;

    address[] internal _tokens;
    address public feeDistAddr; // fee distributor address
    mapping(address => address) public gauges; // token => gauge
    mapping(address => bool) public gaugeStatus; // token => bool : false = deprecated

    // Add Guage to Bribe Mapping
    mapping(address => address) public bribes; // gauge => bribes
    mapping(address => uint256) public weights; // token => weight
    mapping(address => mapping(address => uint256)) public votes; // msg.sender => votes
    mapping(address => address[]) public tokenVote; // msg.sender => token
    mapping(address => uint256) public usedWeights; // msg.sender => total voting weight of user

    // Modifiers
    modifier hasVoted(address voter) {
        uint256 time = block.timestamp - lastVote[voter];
        require(time > voteDelay, "You voted in the last 7 days");
        _;
    }

    modifier hasDistribute() {
        uint256 time = block.timestamp - lastDistribute;
        require(
            time > distributeDelay,
            "this has been distributed in the last 7 days"
        );
        _;
    }

    constructor(
        address _masterChef,
        address _spirit,
        address _inSpirit,
        address _feeDist,
        address _bribeFactory, 
        address _pairFactory
    ) public {
        MASTER = MasterChef(_masterChef);
        SPIRIT = IERC20(_spirit);
        inSPIRIT = IERC20(_inSpirit);
        TOKEN = IERC20(address(new MasterDill()));
        governance = msg.sender;
        admin = msg.sender;
        feeDistAddr = _feeDist;
        bribeFactory = _bribeFactory;
        pairFactory = _pairFactory;
    }

    function tokens() external view returns (address[] memory) {
        return _tokens;
    }

    function getGauge(address _token) external view returns (address) {
        return gauges[_token];
    }

    function getBribes(address _gauge) external view returns (address) {
        return bribes[_gauge];
    }

    function setBaseToken(address _tokenLP, bool _flag) external {
        require(
            (msg.sender == governance || msg.sender == admin),
            "!gov or !admin"
        );
        baseTokens[_tokenLP] = _flag;
    }

    function setVerifiedToken(address _tokenLP, bool _flag) external {
        require(
            (msg.sender == governance || msg.sender == admin),
            "!gov or !admin"
        );
        verifiedTokens[_tokenLP] = _flag;
    }

    // Reset votes to 0
    function reset() external {
        _reset(msg.sender);
    }

    // Reset votes to 0
    function _reset(address _owner) internal {
        address[] storage _tokenVote = tokenVote[_owner];
        uint256 _tokenVoteCnt = _tokenVote.length;

        for (uint256 i = 0; i < _tokenVoteCnt; i++) {
            address _token = _tokenVote[i];
            uint256 _votes = votes[_owner][_token];

            if (_votes > 0) {
                totalWeight = totalWeight - _votes;
                weights[_token] = weights[_token] - _votes;
                // Bribe vote withdrawal
                IBribe(bribes[gauges[_token]])._withdraw(
                    uint256(_votes),
                    _owner
                );
                votes[_owner][_token] = 0;
            }
        }

        delete tokenVote[_owner];
    }

    // Adjusts _owner's votes according to latest _owner's inSPIRIT balance
    function poke(address _owner) public {
        address[] memory _tokenVote = tokenVote[_owner];
        uint256 _tokenCnt = _tokenVote.length;
        uint256[] memory _weights = new uint256[](_tokenCnt);
        uint256 _prevUsedWeight = usedWeights[_owner];
        uint256 _weight = inSPIRIT.balanceOf(_owner);

        for (uint256 i = 0; i < _tokenCnt; i++) {
            // Need to make this reflect the value deposited into bribes, anyone should be able to call this on
            // other addresses to stop them from gaming the system with outdated votes that dont lose voting power
            uint256 _prevWeight = votes[_owner][_tokenVote[i]];
            _weights[i] = _prevWeight * _weight / _prevUsedWeight;
        }

        _vote(_owner, _tokenVote, _weights);
    }

    function _vote(
        address _owner,
        address[] memory _tokenVote,
        uint256[] memory _weights
    ) internal {
        // _weights[i] = percentage * 100
        _reset(_owner);
        uint256 _tokenCnt = _tokenVote.length;
        uint256 _weight = inSPIRIT.balanceOf(_owner);
        uint256 _totalVoteWeight = 0;
        uint256 _usedWeight = 0;

        for (uint256 i = 0; i < _tokenCnt; i++) {
            _totalVoteWeight = _totalVoteWeight + _weights[i];
        }

        for (uint256 i = 0; i < _tokenCnt; i++) {
            address _token = _tokenVote[i];
            address _gauge = gauges[_token];
            uint256 _tokenWeight = _weights[i] * _weight / _totalVoteWeight;

            if (_gauge != address(0x0) && gaugeStatus[_token]) {
                _usedWeight = _usedWeight + _tokenWeight;
                totalWeight = totalWeight + _tokenWeight;
                weights[_token] = weights[_token] + _tokenWeight;
                tokenVote[_owner].push(_token);
                votes[_owner][_token] = _tokenWeight;
                // Bribe vote deposit
                IBribe(bribes[_gauge])._deposit(uint256(_tokenWeight), _owner);
            }
        }

        usedWeights[_owner] = _usedWeight;
    }

    // Vote with inSPIRIT on a gauge
    function vote(address[] calldata _tokenVote, uint256[] calldata _weights)
        external
        hasVoted(msg.sender)
    {
        require(_tokenVote.length == _weights.length);
        lastVote[msg.sender] = block.timestamp;
        _vote(msg.sender, _tokenVote, _weights);
    }

    function setAdmin(address _admin) external {
        require(msg.sender == governance, "!gov");
        admin = _admin;
    }

    // Add new token gauge
    function addGaugeForOwner(address _tokenLP, address _token0, address _token1)
        external
        returns (address)
    {
        require(
            (msg.sender == governance || msg.sender == admin),
            "!gov or !admin"
        );
        require(gauges[_tokenLP] == address(0x0), "exists");

        // Deploy Gauge 
        gauges[_tokenLP] = address(
            new Gauge(address(SPIRIT), address(inSPIRIT), _tokenLP, address(this))
        );
        _tokens.push(_tokenLP);
        gaugeStatus[_tokenLP] = true;

        // Deploy Bribe
        address _bribe = IBaseV1BribeFactory(bribeFactory).createBribe(
            governance,
            _token0,
            _token1
        );
        bribes[gauges[_tokenLP]] = _bribe;
        emit GaugeAddedByOwner(_tokenLP, _token0, _token1);
        return gauges[_tokenLP];
    }

    // Add new token gauge
    function addGauge(address _tokenLP)
        external
        returns (address)
    {
        require(gauges[_tokenLP] == address(0x0), "exists");
        require(IBaseV1Factory(pairFactory).isPair(_tokenLP), "!_tokenLP");
        require(IBaseV1Pair(_tokenLP).stable());
        (address _token0, address _token1) = IBaseV1Pair(_tokenLP).tokens();
        require(baseTokens[_token0] && verifiedTokens[_token1] || 
                baseTokens[_token1] && verifiedTokens[_token0], "!verified");
        require(inSPIRIT.balanceOf(msg.sender) > inSPIRIT.totalSupply() / 100 ||
                msg.sender == governance || msg.sender == admin, "!supply");
        // Deploy Gauge 
        gauges[_tokenLP] = address(
            new Gauge(address(SPIRIT), address(inSPIRIT), _tokenLP, address(this))
        );
        _tokens.push(_tokenLP);
        gaugeStatus[_tokenLP] = true;

        // Deploy Bribe
        address _bribe = IBaseV1BribeFactory(bribeFactory).createBribe(
            governance,
            _token0,
            _token1
        );
        bribes[gauges[_tokenLP]] = _bribe;
        emit GaugeAdded(_tokenLP);
        return gauges[_tokenLP];
    }

    // Deprecate existing gauge
    function deprecateGauge(address _token) external {
        require(
            (msg.sender == governance || msg.sender == admin),
            "!gov or !admin"
        );
        require(gauges[_token] != address(0x0), "does not exist");
        require(gaugeStatus[_token], "gauge is not active");
        gaugeStatus[_token] = false;
        emit GaugeDeprecated(_token);
    }

    // Bring Deprecated gauge back into use
    function resurrectGauge(address _token) external {
        require(
            (msg.sender == governance || msg.sender == admin),
            "!gov or !admin"
        );
        require(gauges[_token] != address(0x0), "does not exist");
        require(!gaugeStatus[_token], "gauge is active");
        gaugeStatus[_token] = true;
        emit GaugeResurrected(_token);
    }

    // Sets MasterChef PID
    function setPID(uint256 _pid) external {
        require(msg.sender == governance, "!gov");
        pid = _pid;
    }

    // Deposits minSPIRIT into MasterChef
    function deposit() public {
        require(pid != type(uint256).max, "pid not initialized");
        IERC20 _token = TOKEN;
        uint256 _balance = _token.balanceOf(address(this));
        _token.safeApprove(address(MASTER), 0);
        _token.safeApprove(address(MASTER), _balance);
        MASTER.deposit(pid, _balance);
    }

    // Fetches Spirit
    // Change from public to internal, ONLY preDistribute should be able to call
    function collect() internal {
        (uint256 _locked, ) = MASTER.userInfo(pid, address(this));
        MASTER.withdraw(pid, _locked);
        deposit();
    }

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

    function preDistribute() external nonReentrant hasDistribute {
        lockedTotalWeight = totalWeight;
        for (uint256 i = 0; i < _tokens.length; i++) {
            lockedWeights[_tokens[i]] = weights[_tokens[i]];
            hasDistributed[_tokens[i]] = false;
        }
        collect();
        lastDistribute = block.timestamp;
        uint256 _balance = SPIRIT.balanceOf(address(this));
        lockedBalance = _balance;
        uint256 _inSpiritRewards = 0;
        if (ve) {
            uint256 _lockedSpirit = SPIRIT.balanceOf(address(inSPIRIT));
            uint256 _spiritSupply = SPIRIT.totalSupply();
            _inSpiritRewards = _balance * _lockedSpirit / _spiritSupply;

            if (_inSpiritRewards > 0) {
                SPIRIT.safeTransfer(feeDistAddr, _inSpiritRewards);
                lockedBalance = SPIRIT.balanceOf(address(this));
            }
        }
        locktime = block.timestamp;
        emit PreDistributed(_inSpiritRewards);
    }

    function distribute(uint256 _start, uint256 _end) external nonReentrant {
        require(_start < _end, "bad _start");
        require(_end <= _tokens.length, "bad _end");

        if (lockedBalance > 0 && lockedTotalWeight > 0) {
            for (uint256 i = _start; i < _end; i++) {
                address _token = _tokens[i];
                if (!hasDistributed[_token] && gaugeStatus[_token]) {
                    address _gauge = gauges[_token];
                    uint256 _reward = lockedBalance * lockedWeights[_token] / lockedTotalWeight;
                    if (_reward > 0) {
                        SPIRIT.safeApprove(_gauge, 0);
                        SPIRIT.safeApprove(_gauge, _reward);
                        Gauge(_gauge).notifyRewardAmount(_reward);
                    }
                    hasDistributed[_token] = true;
                }
            }
        }
    }

    // Add claim function for bribes
    function claimBribes(address[] memory _bribes, address _user) external {
        for (uint256 i = 0; i < _bribes.length; i++) {
            IBribe(_bribes[i]).getRewardForOwner(_user);
        }
    }

    // Update fee distributor address
    function updateFeeDistributor(address _feeDistAddr) external {
        require(
            (msg.sender == governance || msg.sender == admin),
            "updateFeeDestributor: permission is denied!"
        );
        feeDistAddr = _feeDistAddr;
    }

    function toggleVE() external {
        require(
            (msg.sender == governance || msg.sender == admin),
            "turnVeOn: permission is denied!"
        );
        ve = !ve;
    }

    event GaugeAdded(address tokenLP);
    event GaugeAddedByOwner(address tokenLP, address token0, address token1);
    event GaugeDeprecated(address tokenLP);
    event GaugeResurrected(address tokenLP);
    event PreDistributed(uint256 spiritRewards);
}

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

Contract Security Audit

Contract ABI

[{"inputs":[{"internalType":"address","name":"_spirit","type":"address"},{"internalType":"address","name":"_inSpirit","type":"address"},{"internalType":"address","name":"_token","type":"address"},{"internalType":"address","name":"_gaugeProxy","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":false,"internalType":"uint256","name":"claimed0","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"claimed1","type":"uint256"}],"name":"ClaimVotingFees","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"reward","type":"uint256"}],"name":"RewardAdded","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":false,"internalType":"uint256","name":"reward","type":"uint256"}],"name":"RewardPaid","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"Staked","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"Withdrawn","type":"event"},{"inputs":[],"name":"DISTRIBUTION","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"DURATION","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"SPIRIT","outputs":[{"internalType":"contract IERC20","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"TOKEN","outputs":[{"internalType":"contract IERC20","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"claimVotingFees","outputs":[{"internalType":"uint256","name":"claimed0","type":"uint256"},{"internalType":"uint256","name":"claimed1","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"deposit","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"depositAll","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"address","name":"account","type":"address"}],"name":"depositFor","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"derivedBalance","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"derivedBalances","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"derivedSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"earned","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"fees0","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"fees1","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"gaugeProxy","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getReward","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"getRewardForDuration","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"inSPIRIT","outputs":[{"internalType":"contract IERC20","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"kick","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"lastTimeRewardApplicable","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"lastUpdateTime","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"reward","type":"uint256"}],"name":"notifyRewardAmount","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"periodFinish","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"rewardPerToken","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"rewardPerTokenStored","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"rewardRate","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"rewards","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"userRewardPerTokenPaid","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"withdraw","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"withdrawAll","outputs":[],"stateMutability":"nonpayable","type":"function"}]

60c0604052600060035560006004553480156200001b57600080fd5b5060405162001b4b38038062001b4b8339810160408190526200003e91620000ad565b6001600081905580546001600160a01b039586166001600160a01b0319918216179091556002805494861694821694909417909355908316608052600980549190931691161790553360a0526200010a565b80516001600160a01b0381168114620000a857600080fd5b919050565b60008060008060808587031215620000c457600080fd5b620000cf8562000090565b9350620000df6020860162000090565b9250620000ef6040860162000090565b9150620000ff6060860162000090565b905092959194509250565b60805160a0516119ea62000161600039600081816102f70152818161050e015261060101526000818161033e01528181610c1101528181610d9601528181610f4b0152818161109c01526111d301526119ea6000f3fe608060405234801561001057600080fd5b50600436106101ef5760003560e01c8063853828b61161010f578063ca1c9b75116100a2578063de5f626811610071578063de5f626814610427578063df136d651461042f578063ebe2b12b14610438578063f05cc5b61461044157600080fd5b8063ca1c9b75146103f0578063cd3daf9d14610403578063d35e25441461040b578063d7da4bb01461041e57600080fd5b806396c55175116100de57806396c55175146103ae578063a7fa806b146103c1578063b6b55f25146103d4578063c8f33c91146103e757600080fd5b8063853828b6146103605780638b0e888e146103685780638b8763471461038557806393f1c442146103a557600080fd5b80633d18b912116101875780637b0a47ee116101565780637b0a47ee146102e95780637c91e4eb146102f257806380faa57d1461033157806382bfefc81461033957600080fd5b80633d18b9121461028f5780634c02a21c1461029757806363fb415b146102a057806370a08231146102c057600080fd5b80631c1f78eb116101c35780631c1f78eb1461024c5780632e1a7d4d1461025457806336efd16f146102695780633c6b16ab1461027c57600080fd5b80628cc262146101f45780630700037d1461021a57806318160ddd1461023a5780631be0528914610242575b600080fd5b6102076102023660046117ab565b610454565b6040519081526020015b60405180910390f35b6102076102283660046117ab565b600b6020526000908152604090205481565b600c54610207565b61020762093a8081565b6102076104d1565b6102676102623660046117c8565b6104e9565b005b6102676102773660046117e1565b6104f5565b61026761028a3660046117c8565b610503565b6102676107b7565b61020760085481565b6102076102ae3660046117ab565b600f6020526000908152604090205481565b6102076102ce3660046117ab565b6001600160a01b03166000908152600e602052604090205490565b61020760045481565b6103197f000000000000000000000000000000000000000000000000000000000000000081565b6040516001600160a01b039091168152602001610211565b6102076108d0565b6103197f000000000000000000000000000000000000000000000000000000000000000081565b6102676108de565b6103706108f9565b60408051928352602083019190915201610211565b6102076103933660046117ab565b600a6020526000908152604090205481565b61020760075481565b6102676103bc3660046117ab565b610939565b600154610319906001600160a01b031681565b6102676103e23660046117c8565b61099f565b61020760055481565b600954610319906001600160a01b031681565b6102076109a9565b6102076104193660046117ab565b610a18565b610207600d5481565b610267610bf8565b61020760065481565b61020760035481565b600254610319906001600160a01b031681565b6001600160a01b0381166000908152600b6020908152604080832054600a909252822054670de0b6b3a76400009061048a6109a9565b6104949190611827565b6001600160a01b0385166000908152600f60205260409020546104b7919061183e565b6104c1919061185d565b6104cb919061187f565b92915050565b600062093a806004546104e4919061183e565b905090565b6104f281610c8a565b50565b6104ff8282610e1b565b5050565b336001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016146105935760405162461bcd60e51b815260206004820152602a60248201527f43616c6c6572206973206e6f742052657761726473446973747269627574696f6044820152691b8818dbdb9d1c9858dd60b21b60648201526084015b60405180910390fd5b600061059d6109a9565b6006556105a86108d0565b6005556001600160a01b038116156105ef576105c381610454565b6001600160a01b0382166000908152600b6020908152604080832093909355600654600a909152919020555b600154610627906001600160a01b03167f00000000000000000000000000000000000000000000000000000000000000003085610fd9565b60035442106106455761063d62093a808361185d565b600455610687565b6000426003546106559190611827565b9050600060045482610667919061183e565b905062093a80610677828661187f565b610681919061185d565b60045550505b6001546040516370a0823160e01b81523060048201526000916001600160a01b0316906370a0823190602401602060405180830381865afa1580156106d0573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106f49190611897565b905061070362093a808261185d565b60045411156107545760405162461bcd60e51b815260206004820152601860248201527f50726f76696465642072657761726420746f6f20686967680000000000000000604482015260640161058a565b4260058190556107689062093a809061187f565b6003556040518381527fde88a922e0d3b88b24e9623efeb464919c6bf9f66857a65e2bfcf2ce87a9433d9060200160405180910390a1506001600160a01b038116156104ff576104ff81610939565b600260005414156107da5760405162461bcd60e51b815260040161058a906118b0565b6002600055336107e86109a9565b6006556107f36108d0565b6005556001600160a01b0381161561083a5761080e81610454565b6001600160a01b0382166000908152600b6020908152604080832093909355600654600a909152919020555b336000908152600b602052604090205480156108af57336000818152600b6020526040812055600154610879916001600160a01b03909116908361104a565b60405181815233907fe2403640ba68fed3a2f88b7557551d1993f84b99bb10ff833f0cf8db0c5e04869060200160405180910390a25b506001600160a01b038116156108c8576108c881610939565b506001600055565b60006104e44260035461107f565b336000908152600e60205260409020546108f790610c8a565b565b6000806002600054141561091f5760405162461bcd60e51b815260040161058a906118b0565b600260005561092c611097565b9150915060016000559091565b6001600160a01b0381166000908152600f6020526040902054600d54610960908290611827565b600d5561096c82610a18565b6001600160a01b0383166000908152600f60205260409020819055600d5490915061099890829061187f565b600d555050565b6104f28133610e1b565b6000600d54600014156109bc5750600090565b600c546109ca575060065490565b600d546004546005546109db6108d0565b6109e59190611827565b6109ef919061183e565b610a0190670de0b6b3a764000061183e565b610a0b919061185d565b6006546104e4919061187f565b600254604080516318160ddd60e01b815290516000926001600160a01b0316916318160ddd9160048083019260209291908290030181865afa158015610a62573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a869190611897565b610a9257506000919050565b6001600160a01b0382166000908152600e6020526040812054906064610ab983602861183e565b610ac3919061185d565b905060006064600260009054906101000a90046001600160a01b03166001600160a01b03166318160ddd6040518163ffffffff1660e01b8152600401602060405180830381865afa158015610b1c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b409190611897565b6002546040516370a0823160e01b81526001600160a01b038981166004830152909116906370a0823190602401602060405180830381865afa158015610b8a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610bae9190611897565b600c54610bbb919061183e565b610bc5919061185d565b610bd090603c61183e565b610bda919061185d565b9050610bef610be9828461187f565b8461107f565b95945050505050565b6040516370a0823160e01b81523360048201526108f7907f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906370a0823190602401602060405180830381865afa158015610c60573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c849190611897565b33610e1b565b60026000541415610cad5760405162461bcd60e51b815260040161058a906118b0565b600260005533610cbb6109a9565b600655610cc66108d0565b6005556001600160a01b03811615610d0d57610ce181610454565b6001600160a01b0382166000908152600b6020908152604080832093909355600654600a909152919020555b60008211610d515760405162461bcd60e51b8152602060048201526011602482015270043616e6e6f74207769746864726177203607c1b604482015260640161058a565b81600c54610d5f9190611827565b600c55336000908152600e6020526040902054610d7d908390611827565b336000818152600e6020526040902091909155610dc5907f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316908461104a565b60405182815233907f7084f5476618d8e60b11ef0d7d3f06914655adb8793e28ff7f018d4c76d505d59060200160405180910390a26001600160a01b03811615610e1257610e1281610939565b50506001600055565b60026000541415610e3e5760405162461bcd60e51b815260040161058a906118b0565b600260005580610e4c6109a9565b600655610e576108d0565b6005556001600160a01b03811615610e9e57610e7281610454565b6001600160a01b0382166000908152600b6020908152604080832093909355600654600a909152919020555b60008311610eee5760405162461bcd60e51b815260206004820152601e60248201527f6465706f736974284761756765293a2063616e6e6f74207374616b6520300000604482015260640161058a565b6001600160a01b0382166000908152600e60205260409020548390610f1490829061187f565b6001600160a01b0384166000908152600e6020526040902055600c54610f3b90829061187f565b600c55610f736001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016843087610fd9565b826001600160a01b03167f9e71bc8eea02a63969f509818f2dafb9254532904319f9dbda79b67bd34a5f3d82604051610fae91815260200190565b60405180910390a2506001600160a01b03811615610fcf57610fcf81610939565b5050600160005550565b6040516001600160a01b03808516602483015283166044820152606481018290526110449085906323b872dd60e01b906084015b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b0319909316929092179091526114be565b50505050565b6040516001600160a01b03831660248201526044810182905261107a90849063a9059cbb60e01b9060640161100d565b505050565b600081831061108e5781611090565b825b9392505050565b6000807f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663d294f0936040518163ffffffff1660e01b815260040160408051808303816000875af11580156110f9573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061111d91906118e7565b600954604051635462ecad60e11b81523060048201529294509092506000916001600160a01b039091169063a8c5d95a906024016020604051808303816000875af1158015611170573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611194919061190b565b905060008311806111a55750600082115b156114b9576000836007546111ba919061187f565b90506000836008546111cc919061187f565b90506000807f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316639d63848a6040518163ffffffff1660e01b815260040160408051808303816000875af1158015611230573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906112549190611928565b604051634cde602960e11b81526001600160a01b038084166004830152929450909250908616906399bcc05290602401602060405180830381865afa1580156112a1573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906112c59190611897565b841180156112df575060006112dd62093a808661185d565b115b156113645760006007556112fd6001600160a01b0383168686611645565b60405163b66503cf60e01b81526001600160a01b0383811660048301526024820186905286169063b66503cf90604401600060405180830381600087803b15801561134757600080fd5b505af115801561135b573d6000803e3d6000fd5b5050505061136a565b60078490555b604051634cde602960e11b81526001600160a01b0382811660048301528616906399bcc05290602401602060405180830381865afa1580156113b0573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113d49190611897565b831180156113ee575060006113ec62093a808561185d565b115b1561147357600060085561140c6001600160a01b0382168685611645565b60405163b66503cf60e01b81526001600160a01b0382811660048301526024820185905286169063b66503cf90604401600060405180830381600087803b15801561145657600080fd5b505af115801561146a573d6000803e3d6000fd5b50505050611479565b60088390555b604080518881526020810188905233917fd9b982883d6f1d237dbf653d6baf27ba3264fa2a489737131b3cb7aef4fe40de910160405180910390a2505050505b509091565b6114d0826001600160a01b031661175a565b61151c5760405162461bcd60e51b815260206004820152601f60248201527f5361666545524332303a2063616c6c20746f206e6f6e2d636f6e747261637400604482015260640161058a565b600080836001600160a01b0316836040516115379190611957565b6000604051808303816000865af19150503d8060008114611574576040519150601f19603f3d011682016040523d82523d6000602084013e611579565b606091505b5091509150816115cb5760405162461bcd60e51b815260206004820181905260248201527f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564604482015260640161058a565b80511561104457808060200190518101906115e69190611992565b6110445760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b606482015260840161058a565b8015806116bf5750604051636eb1769f60e11b81523060048201526001600160a01b03838116602483015284169063dd62ed3e90604401602060405180830381865afa158015611699573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906116bd9190611897565b155b61172a5760405162461bcd60e51b815260206004820152603660248201527f5361666545524332303a20617070726f76652066726f6d206e6f6e2d7a65726f60448201527520746f206e6f6e2d7a65726f20616c6c6f77616e636560501b606482015260840161058a565b6040516001600160a01b03831660248201526044810182905261107a90849063095ea7b360e01b9060640161100d565b6000813f7fc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470811580159061178e5750808214155b949350505050565b6001600160a01b03811681146104f257600080fd5b6000602082840312156117bd57600080fd5b813561109081611796565b6000602082840312156117da57600080fd5b5035919050565b600080604083850312156117f457600080fd5b82359150602083013561180681611796565b809150509250929050565b634e487b7160e01b600052601160045260246000fd5b60008282101561183957611839611811565b500390565b600081600019048311821515161561185857611858611811565b500290565b60008261187a57634e487b7160e01b600052601260045260246000fd5b500490565b6000821982111561189257611892611811565b500190565b6000602082840312156118a957600080fd5b5051919050565b6020808252601f908201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604082015260600190565b600080604083850312156118fa57600080fd5b505080516020909101519092909150565b60006020828403121561191d57600080fd5b815161109081611796565b6000806040838503121561193b57600080fd5b825161194681611796565b602084015190925061180681611796565b6000825160005b81811015611978576020818601810151858301520161195e565b81811115611987576000828501525b509190910192915050565b6000602082840312156119a457600080fd5b8151801515811461109057600080fdfea264697066735822122066f72515bb4daa008959d4753b0595f4ad9982ef4282ca713cfb73fd619c573064736f6c634300080b00330000000000000000000000005cc61a78f164885776aa610fb0fe1257df78e59b0000000000000000000000002fbff41a9efaeae77538bd63f1ea489494acdc0800000000000000000000000015bd6dd84153c5ca140b36afa96ebbb53b4c0bdb000000000000000000000000fe1c8a68351b52e391e10106bd3bf2d0759aff4e

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

0000000000000000000000005cc61a78f164885776aa610fb0fe1257df78e59b0000000000000000000000002fbff41a9efaeae77538bd63f1ea489494acdc0800000000000000000000000015bd6dd84153c5ca140b36afa96ebbb53b4c0bdb000000000000000000000000fe1c8a68351b52e391e10106bd3bf2d0759aff4e

-----Decoded View---------------
Arg [0] : _spirit (address): 0x5cc61a78f164885776aa610fb0fe1257df78e59b
Arg [1] : _inSpirit (address): 0x2fbff41a9efaeae77538bd63f1ea489494acdc08
Arg [2] : _token (address): 0x15bd6dd84153c5ca140b36afa96ebbb53b4c0bdb
Arg [3] : _gaugeProxy (address): 0xfe1c8a68351b52e391e10106bd3bf2d0759aff4e

-----Encoded View---------------
4 Constructor Arguments found :
Arg [0] : 0000000000000000000000005cc61a78f164885776aa610fb0fe1257df78e59b
Arg [1] : 0000000000000000000000002fbff41a9efaeae77538bd63f1ea489494acdc08
Arg [2] : 00000000000000000000000015bd6dd84153c5ca140b36afa96ebbb53b4c0bdb
Arg [3] : 000000000000000000000000fe1c8a68351b52e391e10106bd3bf2d0759aff4e


Block Transaction Gas Used Reward
Age Block Fee Address BC Fee Address Voting Power Jailed Incoming
Validator ID :
0 FTM

Amount Staked
0

Amount Delegated
0

Staking Total
0

Staking Start Epoch
0

Staking Start Time
0

Proof of Importance
0

Origination Score
0

Validation Score
0

Active
0

Online
0

Downtime
0 s
Address Amount claimed Rewards Created On Epoch Created On
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.