false
false
0

Contract Address Details

0x4b0EDfB738d162BDba008Ad604C3a41Dd80af352

Contract Name
DistributeOracle
Creator
0xdfbc1e–da66f4 at 0xf7bc30–437f66
Balance
0 SGB
Tokens
Fetching tokens...
Transactions
3,082 Transactions
Transfers
2,968 Transfers
Gas Used
218,649,841
Last Balance Update
58858620
Warning! Contract bytecode has been changed and doesn't match the verified one. Therefore, interaction with this smart contract may be risky.
Contract name:
DistributeOracle




Optimization enabled
true
Compiler version
v0.8.0+commit.c7dfd78e




Optimization runs
200
EVM Version
default




Verified at
2023-01-27T04:35:05.926512Z

Contract source code

// File: https://github.com/OpenZeppelin/openzeppelin-contracts/contracts/utils/Context.sol


// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)

pragma solidity ^0.8.0;

/**
 * @dev Provides information about the current execution context, including the
 * sender of the transaction and its data. While these are generally available
 * via msg.sender and msg.data, they should not be accessed in such a direct
 * manner, since when dealing with meta-transactions the account sending and
 * paying for execution may not be the actual sender (as far as an application
 * is concerned).
 *
 * This contract is only required for intermediate, library-like contracts.
 */
abstract contract Context {
    function _msgSender() internal view virtual returns (address) {
        return msg.sender;
    }

    function _msgData() internal view virtual returns (bytes calldata) {
        return msg.data;
    }
}

// File: https://github.com/OpenZeppelin/openzeppelin-contracts/contracts/access/Ownable.sol


// OpenZeppelin Contracts (last updated v4.7.0) (access/Ownable.sol)

pragma solidity ^0.8.0;


/**
 * @dev Contract module which provides a basic access control mechanism, where
 * there is an account (an owner) that can be granted exclusive access to
 * specific functions.
 *
 * By default, the owner account will be the one that deploys the contract. This
 * can later be changed with {transferOwnership}.
 *
 * This module is used through inheritance. It will make available the modifier
 * `onlyOwner`, which can be applied to your functions to restrict their use to
 * the owner.
 */
abstract contract Ownable is Context {
    address private _owner;

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

    /**
     * @dev Initializes the contract setting the deployer as the initial owner.
     */
    constructor() {
        _transferOwnership(_msgSender());
    }

    /**
     * @dev Throws if called by any account other than the owner.
     */
    modifier onlyOwner() {
        _checkOwner();
        _;
    }

    /**
     * @dev Returns the address of the current owner.
     */
    function owner() public view virtual returns (address) {
        return _owner;
    }

    /**
     * @dev Throws if the sender is not the owner.
     */
    function _checkOwner() internal view virtual {
        require(owner() == _msgSender(), "Ownable: caller is not the owner");
    }

    /**
     * @dev Leaves the contract without owner. It will not be possible to call
     * `onlyOwner` functions anymore. Can only be called by the current owner.
     *
     * NOTE: Renouncing ownership will leave the contract without an owner,
     * thereby removing any functionality that is only available to the owner.
     */
    function renounceOwnership() public virtual onlyOwner {
        _transferOwnership(address(0));
    }

    /**
     * @dev Transfers ownership of the contract to a new account (`newOwner`).
     * Can only be called by the current owner.
     */
    function transferOwnership(address newOwner) public virtual onlyOwner {
        require(newOwner != address(0), "Ownable: new owner is the zero address");
        _transferOwnership(newOwner);
    }

    /**
     * @dev Transfers ownership of the contract to a new account (`newOwner`).
     * Internal function without access restriction.
     */
    function _transferOwnership(address newOwner) internal virtual {
        address oldOwner = _owner;
        _owner = newOwner;
        emit OwnershipTransferred(oldOwner, newOwner);
    }
}

// File: https://github.com/OpenZeppelin/openzeppelin-contracts/contracts/token/ERC20/IERC20.sol


// OpenZeppelin Contracts (last updated v4.6.0) (token/ERC20/IERC20.sol)

pragma solidity ^0.8.0;

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

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

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

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

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

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

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

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

// File: oracleBonusDist.sol



pragma solidity ^0.8.0;



contract DistributeOracle is Ownable {
    address public oracleToken;
    address public multiStaking;
    uint256 public distAmount;
    uint256 public lastDistribution;
    uint256 public timeInterval;
    uint256 public nextDistribution;

    function setOracleToken(address _oracleToken) public onlyOwner {
        oracleToken = _oracleToken;
    }

    function setMultiStaking(address _multiStaking) public onlyOwner {
        multiStaking = _multiStaking;
    }

    function setDistAmount(uint256 _distAmount) public onlyOwner {
        distAmount = _distAmount;
    }

    function setTimeInterval(uint256 _timeInterval) public onlyOwner{
        timeInterval = _timeInterval;
    }

    function distribute() public {
        require(block.timestamp >= nextDistribution, "Distribution not available");
        IERC20 token = IERC20(oracleToken);
        token.transfer(multiStaking, distAmount);
        lastDistribution = block.timestamp;
        nextDistribution = lastDistribution + timeInterval;
    }

    function emergencyWithdraw() public onlyOwner {
        IERC20 token = IERC20(oracleToken);
        token.transfer(msg.sender, token.balanceOf(address(this)));
    }
}
        

Contract ABI

[{"type":"event","name":"OwnershipTransferred","inputs":[{"type":"address","name":"previousOwner","internalType":"address","indexed":true},{"type":"address","name":"newOwner","internalType":"address","indexed":true}],"anonymous":false},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"distAmount","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"distribute","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"emergencyWithdraw","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"lastDistribution","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"address"}],"name":"multiStaking","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"nextDistribution","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"address"}],"name":"oracleToken","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"address"}],"name":"owner","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"renounceOwnership","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"setDistAmount","inputs":[{"type":"uint256","name":"_distAmount","internalType":"uint256"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"setMultiStaking","inputs":[{"type":"address","name":"_multiStaking","internalType":"address"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"setOracleToken","inputs":[{"type":"address","name":"_oracleToken","internalType":"address"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"setTimeInterval","inputs":[{"type":"uint256","name":"_timeInterval","internalType":"uint256"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"timeInterval","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"transferOwnership","inputs":[{"type":"address","name":"newOwner","internalType":"address"}]}]
              

Contract Creation Code

0x608060405234801561001057600080fd5b5061002161001c610026565b61002a565b61007a565b3390565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6106fa806100896000396000f3fe608060405234801561001057600080fd5b50600436106100f55760003560e01c806383472fcf11610097578063db2e21bc11610066578063db2e21bc14610198578063e4fc6b6d146101a0578063ee02f825146101a8578063f2fde38b146101bb576100f5565b806383472fcf146101785780638da5cb5b146101805780638f51643814610188578063a717639c14610190576100f5565b80636669ce5b116100d35780636669ce5b146101355780636c7acae014610148578063715018a61461015b5780637ba7b40214610163576100f5565b806325423a1b146100fa57806338b0789d1461010f5780634c47b6cb1461012d575b600080fd5b61010d610108366004610588565b6101ce565b005b6101176101db565b6040516101249190610697565b60405180910390f35b6101176101e1565b61010d61014336600461053a565b6101e7565b61010d61015636600461053a565b610211565b61010d61023b565b61016b61024f565b60405161012491906105b8565b61016b61025e565b61016b61026d565b61011761027c565b610117610282565b61010d610288565b61010d61038f565b61010d6101b6366004610588565b610460565b61010d6101c936600461053a565b61046d565b6101d66104a7565b600555565b60065481565b60035481565b6101ef6104a7565b600280546001600160a01b0319166001600160a01b0392909216919091179055565b6102196104a7565b600180546001600160a01b0319166001600160a01b0392909216919091179055565b6102436104a7565b61024d60006104e6565b565b6002546001600160a01b031681565b6001546001600160a01b031681565b6000546001600160a01b031690565b60055481565b60045481565b6102906104a7565b6001546040516370a0823160e01b81526001600160a01b0390911690819063a9059cbb90339083906370a08231906102cc9030906004016105b8565b60206040518083038186803b1580156102e457600080fd5b505afa1580156102f8573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061031c91906105a0565b6040518363ffffffff1660e01b81526004016103399291906105cc565b602060405180830381600087803b15801561035357600080fd5b505af1158015610367573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061038b9190610568565b5050565b6006544210156103ba5760405162461bcd60e51b81526004016103b19061062b565b60405180910390fd5b60015460025460035460405163a9059cbb60e01b81526001600160a01b0393841693849363a9059cbb936103f59392909116916004016105cc565b602060405180830381600087803b15801561040f57600080fd5b505af1158015610423573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104479190610568565b5042600481905560055461045a916106a0565b60065550565b6104686104a7565b600355565b6104756104a7565b6001600160a01b03811661049b5760405162461bcd60e51b81526004016103b1906105e5565b6104a4816104e6565b50565b6104af610536565b6001600160a01b03166104c061026d565b6001600160a01b03161461024d5760405162461bcd60e51b81526004016103b190610662565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b3390565b60006020828403121561054b578081fd5b81356001600160a01b0381168114610561578182fd5b9392505050565b600060208284031215610579578081fd5b81518015158114610561578182fd5b600060208284031215610599578081fd5b5035919050565b6000602082840312156105b1578081fd5b5051919050565b6001600160a01b0391909116815260200190565b6001600160a01b03929092168252602082015260400190565b60208082526026908201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160408201526564647265737360d01b606082015260800190565b6020808252601a908201527f446973747269627574696f6e206e6f7420617661696c61626c65000000000000604082015260600190565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b90815260200190565b600082198211156106bf57634e487b7160e01b81526011600452602481fd5b50019056fea264697066735822122042eef83f7f96929313b2b39dd8e2c397c0727a134c89e438202ffd5393dbac2964736f6c63430008000033

Deployed ByteCode

0x608060405234801561001057600080fd5b50600436106100f55760003560e01c806383472fcf11610097578063db2e21bc11610066578063db2e21bc14610198578063e4fc6b6d146101a0578063ee02f825146101a8578063f2fde38b146101bb576100f5565b806383472fcf146101785780638da5cb5b146101805780638f51643814610188578063a717639c14610190576100f5565b80636669ce5b116100d35780636669ce5b146101355780636c7acae014610148578063715018a61461015b5780637ba7b40214610163576100f5565b806325423a1b146100fa57806338b0789d1461010f5780634c47b6cb1461012d575b600080fd5b61010d610108366004610588565b6101ce565b005b6101176101db565b6040516101249190610697565b60405180910390f35b6101176101e1565b61010d61014336600461053a565b6101e7565b61010d61015636600461053a565b610211565b61010d61023b565b61016b61024f565b60405161012491906105b8565b61016b61025e565b61016b61026d565b61011761027c565b610117610282565b61010d610288565b61010d61038f565b61010d6101b6366004610588565b610460565b61010d6101c936600461053a565b61046d565b6101d66104a7565b600555565b60065481565b60035481565b6101ef6104a7565b600280546001600160a01b0319166001600160a01b0392909216919091179055565b6102196104a7565b600180546001600160a01b0319166001600160a01b0392909216919091179055565b6102436104a7565b61024d60006104e6565b565b6002546001600160a01b031681565b6001546001600160a01b031681565b6000546001600160a01b031690565b60055481565b60045481565b6102906104a7565b6001546040516370a0823160e01b81526001600160a01b0390911690819063a9059cbb90339083906370a08231906102cc9030906004016105b8565b60206040518083038186803b1580156102e457600080fd5b505afa1580156102f8573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061031c91906105a0565b6040518363ffffffff1660e01b81526004016103399291906105cc565b602060405180830381600087803b15801561035357600080fd5b505af1158015610367573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061038b9190610568565b5050565b6006544210156103ba5760405162461bcd60e51b81526004016103b19061062b565b60405180910390fd5b60015460025460035460405163a9059cbb60e01b81526001600160a01b0393841693849363a9059cbb936103f59392909116916004016105cc565b602060405180830381600087803b15801561040f57600080fd5b505af1158015610423573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104479190610568565b5042600481905560055461045a916106a0565b60065550565b6104686104a7565b600355565b6104756104a7565b6001600160a01b03811661049b5760405162461bcd60e51b81526004016103b1906105e5565b6104a4816104e6565b50565b6104af610536565b6001600160a01b03166104c061026d565b6001600160a01b03161461024d5760405162461bcd60e51b81526004016103b190610662565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b3390565b60006020828403121561054b578081fd5b81356001600160a01b0381168114610561578182fd5b9392505050565b600060208284031215610579578081fd5b81518015158114610561578182fd5b600060208284031215610599578081fd5b5035919050565b6000602082840312156105b1578081fd5b5051919050565b6001600160a01b0391909116815260200190565b6001600160a01b03929092168252602082015260400190565b60208082526026908201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160408201526564647265737360d01b606082015260800190565b6020808252601a908201527f446973747269627574696f6e206e6f7420617661696c61626c65000000000000604082015260600190565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b90815260200190565b600082198211156106bf57634e487b7160e01b81526011600452602481fd5b50019056fea264697066735822122042eef83f7f96929313b2b39dd8e2c397c0727a134c89e438202ffd5393dbac2964736f6c63430008000033