S Price: $0.465108 (-0.80%)

Contract

0x493EEa7Fb8cc6010055F937f8c85AA4D70ED5D94

Overview

S Balance

Sonic LogoSonic LogoSonic Logo0 S

S Value

$0.00

Multichain Info

No addresses found
Transaction Hash
Method
Block
From
To

There are no matching entries

1 Internal Transaction found.

Latest 1 internal transaction

Parent Transaction Hash Block From To
203742452025-04-15 12:39:283 days ago1744720768  Contract Creation0 S
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
PoolBoosterMetropolis

Compiler Version
v0.8.28+commit.7893614a

Optimization Enabled:
Yes with 200 runs

Other Settings:
paris EvmVersion
File 1 of 3 : PoolBoosterMetropolis.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

import { IPoolBooster } from "../interfaces/poolBooster/IPoolBooster.sol";
import { IERC20 } from "@openzeppelin/contracts/token/ERC20/IERC20.sol";

/**
 * @title Pool booster for Metropolis pools
 * @author Origin Protocol Inc
 */
contract PoolBoosterMetropolis is IPoolBooster {
    // @notice address of the OS token
    IERC20 public immutable osToken;
    // @notice address of the pool
    address public immutable pool;
    // @notice if balance under this amount the bribe action is skipped
    uint256 public constant MIN_BRIBE_AMOUNT = 1e10;

    IRewarderFactory public immutable rewardFactory;

    IVoter public immutable voter;

    constructor(
        address _osToken,
        address _rewardFactory,
        address _pool,
        address _voter
    ) {
        require(_pool != address(0), "Invalid pool address");
        pool = _pool;
        // Abstract factory already validates this is not a zero address
        osToken = IERC20(_osToken);

        rewardFactory = IRewarderFactory(_rewardFactory);

        voter = IVoter(_voter);
    }

    function bribe() external override {
        uint256 balance = osToken.balanceOf(address(this));
        // balance too small, do no bribes
        (, uint256 minBribeAmount) = rewardFactory.getWhitelistedTokenInfo(
            address(osToken)
        );
        if (balance < MIN_BRIBE_AMOUNT || balance < minBribeAmount) {
            return;
        }

        uint256 id = voter.getCurrentVotingPeriod() + 1;

        // Deploy a rewarder
        IRewarder rewarder = IRewarder(
            rewardFactory.createBribeRewarder(address(osToken), pool)
        );

        // Approve the rewarder to spend the balance
        osToken.approve(address(rewarder), balance);

        // Fund and bribe the rewarder
        rewarder.fundAndBribe(id, id, balance);

        emit BribeExecuted(balance);
    }
}

interface IRewarderFactory {
    function createBribeRewarder(address token, address pool)
        external
        returns (address rewarder);

    function getWhitelistedTokenInfo(address token)
        external
        view
        returns (bool isWhitelisted, uint256 minBribeAmount);
}

interface IRewarder {
    function fundAndBribe(
        uint256 startId,
        uint256 lastId,
        uint256 amountPerPeriod
    ) external payable;
}

interface IVoter {
    function getCurrentVotingPeriod() external view returns (uint256);
}

File 2 of 3 : IERC20.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (token/ERC20/IERC20.sol)

pragma solidity ^0.8.0;

/**
 * @dev Interface of the ERC20 standard as defined in the EIP.
 */
interface IERC20 {
    /**
     * @dev Returns the amount of tokens in existence.
     */
    function totalSupply() external view returns (uint256);

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

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

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

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

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

    /**
     * @dev Emitted when `value` tokens are moved from one account (`from`) to
     * another (`to`).
     *
     * Note that `value` may be zero.
     */
    event Transfer(address indexed from, address indexed to, uint256 value);

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

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

interface IPoolBooster {
    event BribeExecuted(uint256 amount);

    /// @notice Execute the bribe action
    function bribe() external;
}

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

Contract Security Audit

Contract ABI

API
[{"inputs":[{"internalType":"address","name":"_osToken","type":"address"},{"internalType":"address","name":"_rewardFactory","type":"address"},{"internalType":"address","name":"_pool","type":"address"},{"internalType":"address","name":"_voter","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"BribeExecuted","type":"event"},{"inputs":[],"name":"MIN_BRIBE_AMOUNT","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"bribe","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"osToken","outputs":[{"internalType":"contract IERC20","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pool","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"rewardFactory","outputs":[{"internalType":"contract IRewarderFactory","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"voter","outputs":[{"internalType":"contract IVoter","name":"","type":"address"}],"stateMutability":"view","type":"function"}]

61010060405234801561001157600080fd5b506040516107d23803806107d2833981016040819052610030916100c9565b6001600160a01b03821661008a5760405162461bcd60e51b815260206004820152601460248201527f496e76616c696420706f6f6c2061646472657373000000000000000000000000604482015260640160405180910390fd5b6001600160a01b0391821660a05292811660805290811660c0521660e05261011d565b80516001600160a01b03811681146100c457600080fd5b919050565b600080600080608085870312156100df57600080fd5b6100e8856100ad565b93506100f6602086016100ad565b9250610104604086016100ad565b9150610112606086016100ad565b905092959194509250565b60805160a05160c05160e05161064761018b6000396000818161012201526102a001526000818160d701528181610214015261039801526000818160b0015261036a015260008181606c0152818161015c015281816101e601528181610342015261042e01526106476000f3fe608060405234801561001057600080fd5b50600436106100625760003560e01c806312c587c51461006757806316f0115b146100ab578063245e4bf0146100d257806337d0208c146100f95780633978033f1461010357806346c96aac1461011d575b600080fd5b61008e7f000000000000000000000000000000000000000000000000000000000000000081565b6040516001600160a01b0390911681526020015b60405180910390f35b61008e7f000000000000000000000000000000000000000000000000000000000000000081565b61008e7f000000000000000000000000000000000000000000000000000000000000000081565b610101610144565b005b61010f6402540be40081565b6040519081526020016100a2565b61008e7f000000000000000000000000000000000000000000000000000000000000000081565b6040516370a0823160e01b81523060048201526000907f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906370a0823190602401602060405180830381865afa1580156101ab573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906101cf9190610545565b60405163050fa72960e51b81526001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000811660048301529192506000917f0000000000000000000000000000000000000000000000000000000000000000169063a1f4e520906024016040805180830381865afa15801561025a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061027e9190610573565b9150506402540be40082108061029357508082105b1561029c575050565b60007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663ae40bc796040518163ffffffff1660e01b8152600401602060405180830381865afa1580156102fc573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906103209190610545565b61032b90600161059f565b6040516354cb24bd60e11b81526001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000811660048301527f0000000000000000000000000000000000000000000000000000000000000000811660248301529192506000917f0000000000000000000000000000000000000000000000000000000000000000169063a996497a906044016020604051808303816000875af11580156103e1573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061040591906105c6565b60405163095ea7b360e01b81526001600160a01b038083166004830152602482018790529192507f00000000000000000000000000000000000000000000000000000000000000009091169063095ea7b3906044016020604051808303816000875af1158015610479573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061049d91906105f6565b5060405163de39030b60e01b81526004810183905260248101839052604481018590526001600160a01b0382169063de39030b90606401600060405180830381600087803b1580156104ee57600080fd5b505af1158015610502573d6000803e3d6000fd5b505050507f1424c3a24f9b1f30558ab0a7b48e07ce9f7d85b293a69a90356e1478504232eb8460405161053791815260200190565b60405180910390a150505050565b60006020828403121561055757600080fd5b5051919050565b8051801515811461056e57600080fd5b919050565b6000806040838503121561058657600080fd5b61058f8361055e565b6020939093015192949293505050565b808201808211156105c057634e487b7160e01b600052601160045260246000fd5b92915050565b6000602082840312156105d857600080fd5b81516001600160a01b03811681146105ef57600080fd5b9392505050565b60006020828403121561060857600080fd5b6105ef8261055e56fea26469706673582212203c154f1256d38ec0d400bb44c0b687f0c001b38f37c453f9be5d0482a5da9ff664736f6c634300081c0033000000000000000000000000b1e25689d55734fd3fffc939c4c3eb52dff8a794000000000000000000000000d9db92613867fe0d290ce64fe737e2f8b80cadc30000000000000000000000003987a13d675c66570bc28c955685a9bca2dcf26e00000000000000000000000003a9896a464c515d13f2679df337bf95bc891fda

Deployed Bytecode

0x608060405234801561001057600080fd5b50600436106100625760003560e01c806312c587c51461006757806316f0115b146100ab578063245e4bf0146100d257806337d0208c146100f95780633978033f1461010357806346c96aac1461011d575b600080fd5b61008e7f000000000000000000000000b1e25689d55734fd3fffc939c4c3eb52dff8a79481565b6040516001600160a01b0390911681526020015b60405180910390f35b61008e7f0000000000000000000000003987a13d675c66570bc28c955685a9bca2dcf26e81565b61008e7f000000000000000000000000d9db92613867fe0d290ce64fe737e2f8b80cadc381565b610101610144565b005b61010f6402540be40081565b6040519081526020016100a2565b61008e7f00000000000000000000000003a9896a464c515d13f2679df337bf95bc891fda81565b6040516370a0823160e01b81523060048201526000907f000000000000000000000000b1e25689d55734fd3fffc939c4c3eb52dff8a7946001600160a01b0316906370a0823190602401602060405180830381865afa1580156101ab573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906101cf9190610545565b60405163050fa72960e51b81526001600160a01b037f000000000000000000000000b1e25689d55734fd3fffc939c4c3eb52dff8a794811660048301529192506000917f000000000000000000000000d9db92613867fe0d290ce64fe737e2f8b80cadc3169063a1f4e520906024016040805180830381865afa15801561025a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061027e9190610573565b9150506402540be40082108061029357508082105b1561029c575050565b60007f00000000000000000000000003a9896a464c515d13f2679df337bf95bc891fda6001600160a01b031663ae40bc796040518163ffffffff1660e01b8152600401602060405180830381865afa1580156102fc573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906103209190610545565b61032b90600161059f565b6040516354cb24bd60e11b81526001600160a01b037f000000000000000000000000b1e25689d55734fd3fffc939c4c3eb52dff8a794811660048301527f0000000000000000000000003987a13d675c66570bc28c955685a9bca2dcf26e811660248301529192506000917f000000000000000000000000d9db92613867fe0d290ce64fe737e2f8b80cadc3169063a996497a906044016020604051808303816000875af11580156103e1573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061040591906105c6565b60405163095ea7b360e01b81526001600160a01b038083166004830152602482018790529192507f000000000000000000000000b1e25689d55734fd3fffc939c4c3eb52dff8a7949091169063095ea7b3906044016020604051808303816000875af1158015610479573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061049d91906105f6565b5060405163de39030b60e01b81526004810183905260248101839052604481018590526001600160a01b0382169063de39030b90606401600060405180830381600087803b1580156104ee57600080fd5b505af1158015610502573d6000803e3d6000fd5b505050507f1424c3a24f9b1f30558ab0a7b48e07ce9f7d85b293a69a90356e1478504232eb8460405161053791815260200190565b60405180910390a150505050565b60006020828403121561055757600080fd5b5051919050565b8051801515811461056e57600080fd5b919050565b6000806040838503121561058657600080fd5b61058f8361055e565b6020939093015192949293505050565b808201808211156105c057634e487b7160e01b600052601160045260246000fd5b92915050565b6000602082840312156105d857600080fd5b81516001600160a01b03811681146105ef57600080fd5b9392505050565b60006020828403121561060857600080fd5b6105ef8261055e56fea26469706673582212203c154f1256d38ec0d400bb44c0b687f0c001b38f37c453f9be5d0482a5da9ff664736f6c634300081c0033

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

000000000000000000000000b1e25689d55734fd3fffc939c4c3eb52dff8a794000000000000000000000000d9db92613867fe0d290ce64fe737e2f8b80cadc30000000000000000000000003987a13d675c66570bc28c955685a9bca2dcf26e00000000000000000000000003a9896a464c515d13f2679df337bf95bc891fda

-----Decoded View---------------
Arg [0] : _osToken (address): 0xb1e25689D55734FD3ffFc939c4C3Eb52DFf8A794
Arg [1] : _rewardFactory (address): 0xd9db92613867FE0d290CE64Fe737E2F8B80CADc3
Arg [2] : _pool (address): 0x3987a13D675c66570bC28c955685a9bcA2dCF26e
Arg [3] : _voter (address): 0x03A9896A464C515d13f2679df337bF95bc891fdA

-----Encoded View---------------
4 Constructor Arguments found :
Arg [0] : 000000000000000000000000b1e25689d55734fd3fffc939c4c3eb52dff8a794
Arg [1] : 000000000000000000000000d9db92613867fe0d290ce64fe737e2f8b80cadc3
Arg [2] : 0000000000000000000000003987a13d675c66570bc28c955685a9bca2dcf26e
Arg [3] : 00000000000000000000000003a9896a464c515d13f2679df337bf95bc891fda


Block Transaction 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
[ 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.