Overview
S Balance
S Value
$0.00More Info
Private Name Tags
ContractCreator
Loading...
Loading
Contract Name:
Minter
Compiler Version
v0.8.19+commit.7dd6d404
Optimization Enabled:
Yes with 200 runs
Other Settings:
default evmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: GPL-3.0-or-later pragma solidity 0.8.19; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/utils/math/Math.sol"; import "contracts/interfaces/ITOKEN.sol"; import "contracts/interfaces/IOTOKEN.sol"; import "contracts/interfaces/IVoter.sol"; /** * @title Minter * @author akita * * Mints OTOKEN and distributes them to the Voter (to diribute to gauges), the team * and the growth fund (VTOKEN stakers). * * Mints OTOKEN every week starting with {weekly} OTOKENs per week and decreases by 1% every week * until it reaches tail emissions, which is a constant emission rate of OTOKEN per week. * * Tail emissions are a constant value settable by governance. */ contract Minter is Ownable { using SafeERC20 for IERC20; /*===================================================================*/ /*=========================== SETTINGS ============================*/ uint internal constant WEEKLY_EMISSION_RATE = 400; // 400 OTOKEN per week uint internal constant MAX_WEEKLY_EMISSION_RATE = 400; // 400 OTOKEN per week uint internal constant TAIL_EMISSION_RATE = 30; // 100 OTOKEN per week uint internal constant MIN_TAIL_EMISSION_RATE = 25; // 100 OTOKEN per week uint internal constant GROWTH_RATE = 20; // 20% of emissions go to growth (stakers) uint internal constant TEAM_RATE = 10; // 10% of emissions go to the team /*=========================== END SETTINGS ========================*/ /*===================================================================*/ /*---------- CONSTANTS --------------------------------------------*/ uint internal constant WEEK = 86400 * 7; // allows minting once per week (reset every Thursday 00:00 UTC) uint internal constant EMISSION = 990; // 99% of minted tokens go to the pool uint internal constant PRECISION = 1000; // precision for math uint public constant MAX_TEAM_RATE = 100; // Max of 10% of emissions can go to the team uint public constant MAX_GROWTH_RATE = 300; // Max of 30% of emissions can go to growth (VTOKEN stakers) uint public constant MAX_WEEKLY_RATE = MAX_WEEKLY_EMISSION_RATE * 1e18; // Max of OTOKEN emissions per week uint public constant MIN_TAIL_RATE = MIN_TAIL_EMISSION_RATE * 1e18; // Min of OTOKEN emissions per week /*---------- STATE VARIABLES --------------------------------------*/ ITOKEN public immutable TOKEN; // the primary token IERC20 public immutable VTOKEN; // the voting token IERC20 public immutable OTOKEN; // the token distruted to gauges as rewards IVoter public voter; // the voting & gauge distribution system uint public active_period; // the current period (week) that is active address internal initializer; // the address that can initialize the contract (owner) address public team; // the address that receives team emissions uint public weekly = WEEKLY_EMISSION_RATE * 1e18; // represents a starting weekly emission of OTOKEN (OTOKEN has 18 decimals) uint public tail = TAIL_EMISSION_RATE * 1e18; // represents a constant weekly tail emission of OTOKEN (OTOKEN has 18 decimals) uint public teamRate = TEAM_RATE * 10; // the rate of emissions that go to the team (bps) uint public growthRate = GROWTH_RATE * 10; // the rate of emissions that go to growth (bps) /*---------- ERRORS ------------------------------------------------*/ error Minter__InvalidZeroAddress(); error Minter__UnathorizedInitializer(); error Minter__GrowthRateTooHigh(); error Minter__TeamRateTooHigh(); error Minter__WeeklyRateTooHigh(); error Minter__TailRateTooLow(); error Minter__NotAuthorizedGovernance(); /*---------- EVENTS ------------------------------------------------*/ event Minter__Mint(address indexed sender, uint weekly); event Minter__TeamSet(address indexed account); event Minter__VoterSet(address indexed account); event Minter__GrowthRateSet(uint256 rate); event Minter__TeamRateSet(uint256 rate); event Minter__WeeklyRateSet(uint256 rate); event Minter__TailRateSet(uint256 rate); /*---------- MODIFIERS --------------------------------------------*/ modifier nonZeroAddress(address _account) { if (_account == address(0)) revert Minter__InvalidZeroAddress(); _; } modifier onlyGov { if (msg.sender != owner() && msg.sender != team) revert Minter__NotAuthorizedGovernance(); _; } /*---------- FUNCTIONS --------------------------------------------*/ /** * @notice Constructs the Minter contract. * @param _voter voter contract address * @param _TOKEN token contract address * @param _VTOKEN VTOKEN contract address * @param _OTOKEN OTOKEN contract address */ constructor( address _voter, address _TOKEN, address _VTOKEN, address _OTOKEN ) { initializer = msg.sender; team = msg.sender; voter = IVoter(_voter); TOKEN = ITOKEN(_TOKEN); VTOKEN = IERC20(_VTOKEN); OTOKEN = IERC20(_OTOKEN); active_period = ((block.timestamp + (2 * WEEK)) / WEEK) * WEEK; } /** * @notice Updates the period and mints new tokens if necessary. Can only be called once per epoch (1 week). */ function update_period() external returns (uint) { uint _period = active_period; if (block.timestamp >= _period + WEEK && initializer == address(0)) { // only trigger if new week _period = (block.timestamp / WEEK) * WEEK; active_period = _period; weekly = weekly_emission(); uint _growth = calculate_growth(weekly); uint _teamEmissions = (teamRate * (_growth + weekly)) / PRECISION; uint _required = _growth + weekly + _teamEmissions; uint _balanceOf = OTOKEN.balanceOf(address(this)); if (_balanceOf < _required) { require(IOTOKEN(address(OTOKEN)).mint(address(this), _required - _balanceOf)); } OTOKEN.safeTransfer(team, _teamEmissions); OTOKEN.safeTransfer(TOKEN.FEES(), _growth); OTOKEN.approve(address(voter), weekly); voter.notifyRewardAmount(weekly); emit Minter__Mint(msg.sender, weekly); } return _period; } /*---------- RESTRICTED FUNCTIONS ---------------------------------*/ function initialize() external { if (msg.sender != initializer) revert Minter__UnathorizedInitializer(); initializer = address(0); active_period = ((block.timestamp) / WEEK) * WEEK; // allow minter.update_period() to mint new emissions THIS Thursday } function setTeam(address _team) external onlyGov nonZeroAddress(_team) { team = _team; emit Minter__TeamSet(_team); } function setVoter(address _voter) external onlyOwner nonZeroAddress(_voter) { voter = IVoter(_voter); emit Minter__VoterSet(_voter); } function setGrowthRate(uint256 _growthRate) external onlyOwner { if (_growthRate > MAX_GROWTH_RATE) revert Minter__GrowthRateTooHigh(); growthRate = _growthRate; emit Minter__GrowthRateSet(_growthRate); } function setTeamRate(uint _teamRate) external onlyOwner { if (_teamRate > MAX_TEAM_RATE) revert Minter__TeamRateTooHigh(); teamRate = _teamRate; emit Minter__TeamRateSet(_teamRate); } function setWeeklyRate(uint _weeklyRate) external onlyOwner { if (_weeklyRate > MAX_WEEKLY_RATE) revert Minter__WeeklyRateTooHigh(); weekly = _weeklyRate; emit Minter__WeeklyRateSet(_weeklyRate); } // should have a minimum function setTailRate(uint _tailRate) external onlyOwner { if (_tailRate > MAX_WEEKLY_RATE) revert Minter__WeeklyRateTooHigh(); if (_tailRate < MIN_TAIL_RATE) revert Minter__TailRateTooLow(); tail = _tailRate; emit Minter__TailRateSet(_tailRate); } /*---------- VIEW FUNCTIONS ---------------------------------------*/ // emission calculation is 1% of available supply to mint adjusted by circulating / total supply function calculate_emission() public view returns (uint) { return (weekly * EMISSION) / PRECISION; } // weekly emission takes the max of calculated (aka target) emission versus circulating tail end emission function weekly_emission() public view returns (uint) { return Math.max(calculate_emission(), tail); } // calculate inflation and adjust ve balances accordingly function calculate_growth(uint _minted) public view returns (uint) { return (_minted * growthRate) / PRECISION; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.9.0) (access/Ownable.sol) pragma solidity ^0.8.0; import "../utils/Context.sol"; /** * @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. Can only be called by the current owner. * * NOTE: Renouncing ownership will leave the contract without an owner, * thereby disabling 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); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.9.0) (token/ERC20/extensions/IERC20Permit.sol) pragma solidity ^0.8.0; /** * @dev Interface of the ERC20 Permit extension allowing approvals to be made via signatures, as defined in * https://eips.ethereum.org/EIPS/eip-2612[EIP-2612]. * * Adds the {permit} method, which can be used to change an account's ERC20 allowance (see {IERC20-allowance}) by * presenting a message signed by the account. By not relying on {IERC20-approve}, the token holder account doesn't * need to send a transaction, and thus is not required to hold Ether at all. */ interface IERC20Permit { /** * @dev Sets `value` as the allowance of `spender` over ``owner``'s tokens, * given ``owner``'s signed approval. * * IMPORTANT: The same issues {IERC20-approve} has related to transaction * ordering also apply here. * * Emits an {Approval} event. * * Requirements: * * - `spender` cannot be the zero address. * - `deadline` must be a timestamp in the future. * - `v`, `r` and `s` must be a valid `secp256k1` signature from `owner` * over the EIP712-formatted function arguments. * - the signature must use ``owner``'s current nonce (see {nonces}). * * For more information on the signature format, see the * https://eips.ethereum.org/EIPS/eip-2612#specification[relevant EIP * section]. */ function permit( address owner, address spender, uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s ) external; /** * @dev Returns the current nonce for `owner`. This value must be * included whenever a signature is generated for {permit}. * * Every successful call to {permit} increases ``owner``'s nonce by one. This * prevents a signature from being used multiple times. */ function nonces(address owner) external view returns (uint256); /** * @dev Returns the domain separator used in the encoding of the signature for {permit}, as defined by {EIP712}. */ // solhint-disable-next-line func-name-mixedcase function DOMAIN_SEPARATOR() external view returns (bytes32); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.9.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); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.9.3) (token/ERC20/utils/SafeERC20.sol) pragma solidity ^0.8.0; import "../IERC20.sol"; import "../extensions/IERC20Permit.sol"; import "../../../utils/Address.sol"; /** * @title SafeERC20 * @dev Wrappers around ERC20 operations that throw on failure (when the token * contract returns false). Tokens that return no value (and instead revert or * throw on failure) are also supported, non-reverting calls are assumed to be * successful. * To use this library you can add a `using SafeERC20 for IERC20;` statement to your contract, * which allows you to call the safe operations as `token.safeTransfer(...)`, etc. */ library SafeERC20 { using Address for address; /** * @dev Transfer `value` amount of `token` from the calling contract to `to`. If `token` returns no value, * non-reverting calls are assumed to be successful. */ function safeTransfer(IERC20 token, address to, uint256 value) internal { _callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value)); } /** * @dev Transfer `value` amount of `token` from `from` to `to`, spending the approval given by `from` to the * calling contract. If `token` returns no value, non-reverting calls are assumed to be successful. */ function safeTransferFrom(IERC20 token, address from, address to, uint256 value) internal { _callOptionalReturn(token, abi.encodeWithSelector(token.transferFrom.selector, from, to, value)); } /** * @dev Deprecated. This function has issues similar to the ones found in * {IERC20-approve}, and its usage is discouraged. * * Whenever possible, use {safeIncreaseAllowance} and * {safeDecreaseAllowance} instead. */ function safeApprove(IERC20 token, address spender, uint256 value) internal { // safeApprove should only be called when setting an initial allowance, // or when resetting it to zero. To increase and decrease it, use // 'safeIncreaseAllowance' and 'safeDecreaseAllowance' require( (value == 0) || (token.allowance(address(this), spender) == 0), "SafeERC20: approve from non-zero to non-zero allowance" ); _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, value)); } /** * @dev Increase the calling contract's allowance toward `spender` by `value`. If `token` returns no value, * non-reverting calls are assumed to be successful. */ function safeIncreaseAllowance(IERC20 token, address spender, uint256 value) internal { uint256 oldAllowance = token.allowance(address(this), spender); _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, oldAllowance + value)); } /** * @dev Decrease the calling contract's allowance toward `spender` by `value`. If `token` returns no value, * non-reverting calls are assumed to be successful. */ function safeDecreaseAllowance(IERC20 token, address spender, uint256 value) internal { unchecked { uint256 oldAllowance = token.allowance(address(this), spender); require(oldAllowance >= value, "SafeERC20: decreased allowance below zero"); _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, oldAllowance - value)); } } /** * @dev Set the calling contract's allowance toward `spender` to `value`. If `token` returns no value, * non-reverting calls are assumed to be successful. Meant to be used with tokens that require the approval * to be set to zero before setting it to a non-zero value, such as USDT. */ function forceApprove(IERC20 token, address spender, uint256 value) internal { bytes memory approvalCall = abi.encodeWithSelector(token.approve.selector, spender, value); if (!_callOptionalReturnBool(token, approvalCall)) { _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, 0)); _callOptionalReturn(token, approvalCall); } } /** * @dev Use a ERC-2612 signature to set the `owner` approval toward `spender` on `token`. * Revert on invalid signature. */ function safePermit( IERC20Permit token, address owner, address spender, uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s ) internal { uint256 nonceBefore = token.nonces(owner); token.permit(owner, spender, value, deadline, v, r, s); uint256 nonceAfter = token.nonces(owner); require(nonceAfter == nonceBefore + 1, "SafeERC20: permit did not succeed"); } /** * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement * on the return value: the return value is optional (but if data is returned, it must not be false). * @param token The token targeted by the call. * @param data The call data (encoded using abi.encode or one of its variants). */ function _callOptionalReturn(IERC20 token, bytes memory data) private { // We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since // we're implementing it ourselves. We use {Address-functionCall} to perform this call, which verifies that // the target address contains contract code and also asserts for success in the low-level call. bytes memory returndata = address(token).functionCall(data, "SafeERC20: low-level call failed"); require(returndata.length == 0 || abi.decode(returndata, (bool)), "SafeERC20: ERC20 operation did not succeed"); } /** * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement * on the return value: the return value is optional (but if data is returned, it must not be false). * @param token The token targeted by the call. * @param data The call data (encoded using abi.encode or one of its variants). * * This is a variant of {_callOptionalReturn} that silents catches all reverts and returns a bool instead. */ function _callOptionalReturnBool(IERC20 token, bytes memory data) private returns (bool) { // We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since // we're implementing it ourselves. We cannot use {Address-functionCall} here since this should return false // and not revert is the subcall reverts. (bool success, bytes memory returndata) = address(token).call(data); return success && (returndata.length == 0 || abi.decode(returndata, (bool))) && Address.isContract(address(token)); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.9.0) (utils/Address.sol) pragma solidity ^0.8.1; /** * @dev Collection of functions related to the address type */ library Address { /** * @dev Returns true if `account` is a contract. * * [IMPORTANT] * ==== * It is unsafe to assume that an address for which this function returns * false is an externally-owned account (EOA) and not a contract. * * Among others, `isContract` will return false for the following * types of addresses: * * - an externally-owned account * - a contract in construction * - an address where a contract will be created * - an address where a contract lived, but was destroyed * * Furthermore, `isContract` will also return true if the target contract within * the same transaction is already scheduled for destruction by `SELFDESTRUCT`, * which only has an effect at the end of a transaction. * ==== * * [IMPORTANT] * ==== * You shouldn't rely on `isContract` to protect against flash loan attacks! * * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract * constructor. * ==== */ function isContract(address account) internal view returns (bool) { // This method relies on extcodesize/address.code.length, which returns 0 // for contracts in construction, since the code is only stored at the end // of the constructor execution. return account.code.length > 0; } /** * @dev Replacement for Solidity's `transfer`: sends `amount` wei to * `recipient`, forwarding all available gas and reverting on errors. * * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost * of certain opcodes, possibly making contracts go over the 2300 gas limit * imposed by `transfer`, making them unable to receive funds via * `transfer`. {sendValue} removes this limitation. * * https://consensys.net/diligence/blog/2019/09/stop-using-soliditys-transfer-now/[Learn more]. * * IMPORTANT: because control is transferred to `recipient`, care must be * taken to not create reentrancy vulnerabilities. Consider using * {ReentrancyGuard} or the * https://solidity.readthedocs.io/en/v0.8.0/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern]. */ function sendValue(address payable recipient, uint256 amount) internal { require(address(this).balance >= amount, "Address: insufficient balance"); (bool success, ) = recipient.call{value: amount}(""); require(success, "Address: unable to send value, recipient may have reverted"); } /** * @dev Performs a Solidity function call using a low level `call`. A * plain `call` is an unsafe replacement for a function call: use this * function instead. * * If `target` reverts with a revert reason, it is bubbled up by this * function (like regular Solidity function calls). * * Returns the raw returned data. To convert to the expected return value, * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`]. * * Requirements: * * - `target` must be a contract. * - calling `target` with `data` must not revert. * * _Available since v3.1._ */ function functionCall(address target, bytes memory data) internal returns (bytes memory) { return functionCallWithValue(target, data, 0, "Address: low-level call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with * `errorMessage` as a fallback revert reason when `target` reverts. * * _Available since v3.1._ */ function functionCall( address target, bytes memory data, string memory errorMessage ) internal returns (bytes memory) { return functionCallWithValue(target, data, 0, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but also transferring `value` wei to `target`. * * Requirements: * * - the calling contract must have an ETH balance of at least `value`. * - the called Solidity function must be `payable`. * * _Available since v3.1._ */ function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) { return functionCallWithValue(target, data, value, "Address: low-level call with value failed"); } /** * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but * with `errorMessage` as a fallback revert reason when `target` reverts. * * _Available since v3.1._ */ function functionCallWithValue( address target, bytes memory data, uint256 value, string memory errorMessage ) internal returns (bytes memory) { require(address(this).balance >= value, "Address: insufficient balance for call"); (bool success, bytes memory returndata) = target.call{value: value}(data); return verifyCallResultFromTarget(target, success, returndata, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but performing a static call. * * _Available since v3.3._ */ function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) { return functionStaticCall(target, data, "Address: low-level static call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`], * but performing a static call. * * _Available since v3.3._ */ function functionStaticCall( address target, bytes memory data, string memory errorMessage ) internal view returns (bytes memory) { (bool success, bytes memory returndata) = target.staticcall(data); return verifyCallResultFromTarget(target, success, returndata, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but performing a delegate call. * * _Available since v3.4._ */ function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) { return functionDelegateCall(target, data, "Address: low-level delegate call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`], * but performing a delegate call. * * _Available since v3.4._ */ function functionDelegateCall( address target, bytes memory data, string memory errorMessage ) internal returns (bytes memory) { (bool success, bytes memory returndata) = target.delegatecall(data); return verifyCallResultFromTarget(target, success, returndata, errorMessage); } /** * @dev Tool to verify that a low level call to smart-contract was successful, and revert (either by bubbling * the revert reason or using the provided one) in case of unsuccessful call or if target was not a contract. * * _Available since v4.8._ */ function verifyCallResultFromTarget( address target, bool success, bytes memory returndata, string memory errorMessage ) internal view returns (bytes memory) { if (success) { if (returndata.length == 0) { // only check isContract if the call was successful and the return data is empty // otherwise we already know that it was a contract require(isContract(target), "Address: call to non-contract"); } return returndata; } else { _revert(returndata, errorMessage); } } /** * @dev Tool to verify that a low level call was successful, and revert if it wasn't, either by bubbling the * revert reason or using the provided one. * * _Available since v4.3._ */ function verifyCallResult( bool success, bytes memory returndata, string memory errorMessage ) internal pure returns (bytes memory) { if (success) { return returndata; } else { _revert(returndata, errorMessage); } } function _revert(bytes memory returndata, string memory errorMessage) private pure { // Look for revert reason and bubble it up if present if (returndata.length > 0) { // The easiest way to bubble the revert reason is using memory via assembly /// @solidity memory-safe-assembly assembly { let returndata_size := mload(returndata) revert(add(32, returndata), returndata_size) } } else { revert(errorMessage); } } }
// SPDX-License-Identifier: MIT // 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; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.9.0) (utils/math/Math.sol) pragma solidity ^0.8.0; /** * @dev Standard math utilities missing in the Solidity language. */ library Math { enum Rounding { Down, // Toward negative infinity Up, // Toward infinity Zero // Toward zero } /** * @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. return (a & b) + (a ^ b) / 2; } /** * @dev Returns the ceiling of the division of two numbers. * * This differs from standard division with `/` in that it rounds up instead * of rounding down. */ function ceilDiv(uint256 a, uint256 b) internal pure returns (uint256) { // (a + b - 1) / b can overflow on addition, so we distribute. return a == 0 ? 0 : (a - 1) / b + 1; } /** * @notice Calculates floor(x * y / denominator) with full precision. Throws if result overflows a uint256 or denominator == 0 * @dev Original credit to Remco Bloemen under MIT license (https://xn--2-umb.com/21/muldiv) * with further edits by Uniswap Labs also under MIT license. */ function mulDiv(uint256 x, uint256 y, uint256 denominator) internal pure returns (uint256 result) { unchecked { // 512-bit multiply [prod1 prod0] = x * y. Compute the product mod 2^256 and mod 2^256 - 1, then use // use the Chinese Remainder Theorem to reconstruct the 512 bit result. The result is stored in two 256 // variables such that product = prod1 * 2^256 + prod0. uint256 prod0; // Least significant 256 bits of the product uint256 prod1; // Most significant 256 bits of the product assembly { let mm := mulmod(x, y, not(0)) prod0 := mul(x, y) prod1 := sub(sub(mm, prod0), lt(mm, prod0)) } // Handle non-overflow cases, 256 by 256 division. if (prod1 == 0) { // Solidity will revert if denominator == 0, unlike the div opcode on its own. // The surrounding unchecked block does not change this fact. // See https://docs.soliditylang.org/en/latest/control-structures.html#checked-or-unchecked-arithmetic. return prod0 / denominator; } // Make sure the result is less than 2^256. Also prevents denominator == 0. require(denominator > prod1, "Math: mulDiv overflow"); /////////////////////////////////////////////// // 512 by 256 division. /////////////////////////////////////////////// // Make division exact by subtracting the remainder from [prod1 prod0]. uint256 remainder; assembly { // Compute remainder using mulmod. remainder := mulmod(x, y, denominator) // Subtract 256 bit number from 512 bit number. prod1 := sub(prod1, gt(remainder, prod0)) prod0 := sub(prod0, remainder) } // Factor powers of two out of denominator and compute largest power of two divisor of denominator. Always >= 1. // See https://cs.stackexchange.com/q/138556/92363. // Does not overflow because the denominator cannot be zero at this stage in the function. uint256 twos = denominator & (~denominator + 1); assembly { // Divide denominator by twos. denominator := div(denominator, twos) // Divide [prod1 prod0] by twos. prod0 := div(prod0, twos) // Flip twos such that it is 2^256 / twos. If twos is zero, then it becomes one. twos := add(div(sub(0, twos), twos), 1) } // Shift in bits from prod1 into prod0. prod0 |= prod1 * twos; // Invert denominator mod 2^256. Now that denominator is an odd number, it has an inverse modulo 2^256 such // that denominator * inv = 1 mod 2^256. Compute the inverse by starting with a seed that is correct for // four bits. That is, denominator * inv = 1 mod 2^4. uint256 inverse = (3 * denominator) ^ 2; // Use the Newton-Raphson iteration to improve the precision. Thanks to Hensel's lifting lemma, this also works // in modular arithmetic, doubling the correct bits in each step. inverse *= 2 - denominator * inverse; // inverse mod 2^8 inverse *= 2 - denominator * inverse; // inverse mod 2^16 inverse *= 2 - denominator * inverse; // inverse mod 2^32 inverse *= 2 - denominator * inverse; // inverse mod 2^64 inverse *= 2 - denominator * inverse; // inverse mod 2^128 inverse *= 2 - denominator * inverse; // inverse mod 2^256 // Because the division is now exact we can divide by multiplying with the modular inverse of denominator. // This will give us the correct result modulo 2^256. Since the preconditions guarantee that the outcome is // less than 2^256, this is the final result. We don't need to compute the high bits of the result and prod1 // is no longer required. result = prod0 * inverse; return result; } } /** * @notice Calculates x * y / denominator with full precision, following the selected rounding direction. */ function mulDiv(uint256 x, uint256 y, uint256 denominator, Rounding rounding) internal pure returns (uint256) { uint256 result = mulDiv(x, y, denominator); if (rounding == Rounding.Up && mulmod(x, y, denominator) > 0) { result += 1; } return result; } /** * @dev Returns the square root of a number. If the number is not a perfect square, the value is rounded down. * * Inspired by Henry S. Warren, Jr.'s "Hacker's Delight" (Chapter 11). */ function sqrt(uint256 a) internal pure returns (uint256) { if (a == 0) { return 0; } // For our first guess, we get the biggest power of 2 which is smaller than the square root of the target. // // We know that the "msb" (most significant bit) of our target number `a` is a power of 2 such that we have // `msb(a) <= a < 2*msb(a)`. This value can be written `msb(a)=2**k` with `k=log2(a)`. // // This can be rewritten `2**log2(a) <= a < 2**(log2(a) + 1)` // → `sqrt(2**k) <= sqrt(a) < sqrt(2**(k+1))` // → `2**(k/2) <= sqrt(a) < 2**((k+1)/2) <= 2**(k/2 + 1)` // // Consequently, `2**(log2(a) / 2)` is a good first approximation of `sqrt(a)` with at least 1 correct bit. uint256 result = 1 << (log2(a) >> 1); // At this point `result` is an estimation with one bit of precision. We know the true value is a uint128, // since it is the square root of a uint256. Newton's method converges quadratically (precision doubles at // every iteration). We thus need at most 7 iteration to turn our partial result with one bit of precision // into the expected uint128 result. unchecked { result = (result + a / result) >> 1; result = (result + a / result) >> 1; result = (result + a / result) >> 1; result = (result + a / result) >> 1; result = (result + a / result) >> 1; result = (result + a / result) >> 1; result = (result + a / result) >> 1; return min(result, a / result); } } /** * @notice Calculates sqrt(a), following the selected rounding direction. */ function sqrt(uint256 a, Rounding rounding) internal pure returns (uint256) { unchecked { uint256 result = sqrt(a); return result + (rounding == Rounding.Up && result * result < a ? 1 : 0); } } /** * @dev Return the log in base 2, rounded down, of a positive value. * Returns 0 if given 0. */ function log2(uint256 value) internal pure returns (uint256) { uint256 result = 0; unchecked { if (value >> 128 > 0) { value >>= 128; result += 128; } if (value >> 64 > 0) { value >>= 64; result += 64; } if (value >> 32 > 0) { value >>= 32; result += 32; } if (value >> 16 > 0) { value >>= 16; result += 16; } if (value >> 8 > 0) { value >>= 8; result += 8; } if (value >> 4 > 0) { value >>= 4; result += 4; } if (value >> 2 > 0) { value >>= 2; result += 2; } if (value >> 1 > 0) { result += 1; } } return result; } /** * @dev Return the log in base 2, following the selected rounding direction, of a positive value. * Returns 0 if given 0. */ function log2(uint256 value, Rounding rounding) internal pure returns (uint256) { unchecked { uint256 result = log2(value); return result + (rounding == Rounding.Up && 1 << result < value ? 1 : 0); } } /** * @dev Return the log in base 10, rounded down, of a positive value. * Returns 0 if given 0. */ function log10(uint256 value) internal pure returns (uint256) { uint256 result = 0; unchecked { if (value >= 10 ** 64) { value /= 10 ** 64; result += 64; } if (value >= 10 ** 32) { value /= 10 ** 32; result += 32; } if (value >= 10 ** 16) { value /= 10 ** 16; result += 16; } if (value >= 10 ** 8) { value /= 10 ** 8; result += 8; } if (value >= 10 ** 4) { value /= 10 ** 4; result += 4; } if (value >= 10 ** 2) { value /= 10 ** 2; result += 2; } if (value >= 10 ** 1) { result += 1; } } return result; } /** * @dev Return the log in base 10, following the selected rounding direction, of a positive value. * Returns 0 if given 0. */ function log10(uint256 value, Rounding rounding) internal pure returns (uint256) { unchecked { uint256 result = log10(value); return result + (rounding == Rounding.Up && 10 ** result < value ? 1 : 0); } } /** * @dev Return the log in base 256, rounded down, of a positive value. * Returns 0 if given 0. * * Adding one to the result gives the number of pairs of hex symbols needed to represent `value` as a hex string. */ function log256(uint256 value) internal pure returns (uint256) { uint256 result = 0; unchecked { if (value >> 128 > 0) { value >>= 128; result += 16; } if (value >> 64 > 0) { value >>= 64; result += 8; } if (value >> 32 > 0) { value >>= 32; result += 4; } if (value >> 16 > 0) { value >>= 16; result += 2; } if (value >> 8 > 0) { result += 1; } } return result; } /** * @dev Return the log in base 256, following the selected rounding direction, of a positive value. * Returns 0 if given 0. */ function log256(uint256 value, Rounding rounding) internal pure returns (uint256) { unchecked { uint256 result = log256(value); return result + (rounding == Rounding.Up && 1 << (result << 3) < value ? 1 : 0); } } }
// SPDX-License-Identifier: MIT pragma solidity 0.8.19; interface IOTOKEN { /*---------- FUNCTIONS --------------------------------------------*/ function burnFrom(address account, uint256 amount) external; /*---------- RESTRICTED FUNCTIONS ---------------------------------*/ function mint(address account, uint amount) external returns (bool); /*---------- VIEW FUNCTIONS ---------------------------------------*/ function minter() external view returns (address); }
// SPDX-License-Identifier: MIT pragma solidity 0.8.19; interface ITOKEN { /*---------- FUNCTIONS --------------------------------------------*/ /*---------- RESTRICTED FUNCTIONS ---------------------------------*/ /*---------- VIEW FUNCTIONS ---------------------------------------*/ function BASE() external view returns (address); function OTOKEN() external view returns (address); function VTOKEN() external view returns (address); function totalSupply() external view returns (uint256); function frBASE() external view returns (uint256); function mrvBASE() external view returns (uint256); function mrrBASE() external view returns (uint256); function mrrTOKEN() external view returns (uint256); function getFloorPrice() external view returns (uint256); function getMaxSell() external view returns (uint256); function getMarketPrice() external view returns (uint256); function getOTokenPrice() external view returns (uint256); function getTotalValueLocked() external view returns (uint256); function getAccountCredit(address account) external view returns (uint256) ; function debts(address account) external view returns (uint256); function FEES() external view returns (address); function PROTOCOL_FEE() external view returns (uint256); function DIVISOR() external view returns (uint256); function PRECISION() external view returns (uint256); }
// SPDX-License-Identifier: MIT pragma solidity 0.8.19; interface IVoter { /*---------- FUNCTIONS --------------------------------------------*/ function distribute(address _gauge) external; function emitDeposit(address account, uint amount) external; function emitWithdraw(address account, uint amount) external; function notifyRewardAmount(uint amount) external; /*---------- RESTRICTED FUNCTIONS ---------------------------------*/ /*---------- VIEW FUNCTIONS ---------------------------------------*/ function OTOKEN() external view returns (address); function plugins(uint256 index) external view returns (address); function getPlugins() external view returns (address[] memory); function gauges(address pool) external view returns (address); function bribes(address pool) external view returns (address); function isAlive(address gauge) external view returns (bool); function usedWeights(address account) external view returns (uint256); function weights(address pool) external view returns (uint256); function totalWeight() external view returns (uint256); function votes(address account, address pool) external view returns (uint256); function lastVoted(address account) external view returns (uint256); function minter() external view returns (address); }
{ "optimizer": { "enabled": true, "runs": 200, "details": {} }, "outputSelection": { "*": { "*": [ "evm.bytecode", "evm.deployedBytecode", "devdoc", "userdoc", "metadata", "abi" ] } }, "libraries": {} }
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
[{"inputs":[{"internalType":"address","name":"_voter","type":"address"},{"internalType":"address","name":"_TOKEN","type":"address"},{"internalType":"address","name":"_VTOKEN","type":"address"},{"internalType":"address","name":"_OTOKEN","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"Minter__GrowthRateTooHigh","type":"error"},{"inputs":[],"name":"Minter__InvalidZeroAddress","type":"error"},{"inputs":[],"name":"Minter__NotAuthorizedGovernance","type":"error"},{"inputs":[],"name":"Minter__TailRateTooLow","type":"error"},{"inputs":[],"name":"Minter__TeamRateTooHigh","type":"error"},{"inputs":[],"name":"Minter__UnathorizedInitializer","type":"error"},{"inputs":[],"name":"Minter__WeeklyRateTooHigh","type":"error"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"rate","type":"uint256"}],"name":"Minter__GrowthRateSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"sender","type":"address"},{"indexed":false,"internalType":"uint256","name":"weekly","type":"uint256"}],"name":"Minter__Mint","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"rate","type":"uint256"}],"name":"Minter__TailRateSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"rate","type":"uint256"}],"name":"Minter__TeamRateSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"account","type":"address"}],"name":"Minter__TeamSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"account","type":"address"}],"name":"Minter__VoterSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"rate","type":"uint256"}],"name":"Minter__WeeklyRateSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"inputs":[],"name":"MAX_GROWTH_RATE","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"MAX_TEAM_RATE","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"MAX_WEEKLY_RATE","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"MIN_TAIL_RATE","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"OTOKEN","outputs":[{"internalType":"contract IERC20","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"TOKEN","outputs":[{"internalType":"contract ITOKEN","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"VTOKEN","outputs":[{"internalType":"contract IERC20","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"active_period","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"calculate_emission","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_minted","type":"uint256"}],"name":"calculate_growth","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"growthRate","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"initialize","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_growthRate","type":"uint256"}],"name":"setGrowthRate","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_tailRate","type":"uint256"}],"name":"setTailRate","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_team","type":"address"}],"name":"setTeam","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_teamRate","type":"uint256"}],"name":"setTeamRate","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_voter","type":"address"}],"name":"setVoter","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_weeklyRate","type":"uint256"}],"name":"setWeeklyRate","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"tail","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"team","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"teamRate","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"update_period","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"voter","outputs":[{"internalType":"contract IVoter","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"weekly","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"weekly_emission","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"}]
Contract Creation Code
60e06040526200001a610190670de0b6b3a764000062000185565b60055562000032601e670de0b6b3a764000062000185565b60065562000042600a8062000185565b600755620000536014600a62000185565b6008553480156200006357600080fd5b506040516200144e3803806200144e8339810160408190526200008691620001c2565b62000091336200011f565b600380546001600160a01b031990811633908117909255600480548216909217909155600180546001600160a01b038781169190931617905583811660805282811660a052811660c05262093a8080620000ed81600262000185565b620000f990426200021f565b62000105919062000235565b62000111919062000185565b600255506200025892505050565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b634e487b7160e01b600052601160045260246000fd5b80820281158282048414176200019f576200019f6200016f565b92915050565b80516001600160a01b0381168114620001bd57600080fd5b919050565b60008060008060808587031215620001d957600080fd5b620001e485620001a5565b9350620001f460208601620001a5565b92506200020460408601620001a5565b91506200021460608601620001a5565b905092959194509250565b808201808211156200019f576200019f6200016f565b6000826200025357634e487b7160e01b600052601260045260246000fd5b500490565b60805160a05160c05161119c620002b2600039600081816103280152818161088201528181610901015281816109ba01528181610a720152610ac60152600061038e0152600081816102c101526109e8015261119c6000f3fe608060405234801561001057600080fd5b50600436106101c45760003560e01c80637e851e7c116100f9578063c544df0c11610097578063d139960811610071578063d139960814610365578063ed29fc111461036e578063f2fde38b14610376578063fb5484271461038957600080fd5b8063c544df0c14610323578063cbb597381461034a578063cfc6c8ff1461035d57600080fd5b806385f2aef2116100d357806385f2aef2146102e35780638da5cb5b146102f65780638e01fbfa14610307578063ad4ae8c31461031a57600080fd5b80637e851e7c146102a15780638129fc1c146102b457806382bfefc8146102bc57600080fd5b806337f1139b1161016657806357ca5b5f1161014057806357ca5b5f1461027f578063611e280914610287578063715018a61461029057806378ef7f021461029857600080fd5b806337f1139b1461022e57806346c96aac146102415780634bc2a6571461026c57600080fd5b806324d08054116101a257806324d080541461020257806326cfc17b1461020a5780632e8f7b1f1461021357806336d96faf1461022657600080fd5b806301c8e6fd146101c9578063095cf5c6146101e457806313d8c840146101f9575b600080fd5b6101d1606481565b6040519081526020015b60405180910390f35b6101f76101f2366004610ff0565b6103b0565b005b6101d160065481565b6101d1610467565b6101d160055481565b6101f761022136600461100d565b61047d565b6101d16104e3565b6101f761023c36600461100d565b610507565b600154610254906001600160a01b031681565b6040516001600160a01b0390911681526020016101db565b6101f761027a366004610ff0565b6105aa565b6101d1610625565b6101d161012c81565b6101f7610639565b6101d160075481565b6101f76102af36600461100d565b61064d565b6101f76106ad565b6102547f000000000000000000000000000000000000000000000000000000000000000081565b600454610254906001600160a01b031681565b6000546001600160a01b0316610254565b6101d161031536600461100d565b610705565b6101d160085481565b6102547f000000000000000000000000000000000000000000000000000000000000000081565b6101f761035836600461100d565b610728565b6101d1610799565b6101d160025481565b6101d16107ae565b6101f7610384366004610ff0565b610bdf565b6102547f000000000000000000000000000000000000000000000000000000000000000081565b6000546001600160a01b031633148015906103d657506004546001600160a01b03163314155b156103f45760405163ae0a3e8360e01b815260040160405180910390fd5b806001600160a01b03811661041c5760405163eaad396960e01b815260040160405180910390fd5b600480546001600160a01b0319166001600160a01b0384169081179091556040517f7f59f43473721d8349d1ca8106b599adecb7862e562937bd0cccf5dd48169e9190600090a25050565b61047a6019670de0b6b3a764000061103c565b81565b610485610c5d565b60648111156104a7576040516334ca2ab360e11b815260040160405180910390fd5b60078190556040518181527f44cbdfba94b564a69e3978cc6fe0e4b73694cb5653fc3060d331ae5a3db5ee79906020015b60405180910390a150565b60006103e86103de6005546104f8919061103c565b6105029190611053565b905090565b61050f610c5d565b610523610190670de0b6b3a764000061103c565b81111561054357604051631c1a87f160e21b815260040160405180910390fd5b6105566019670de0b6b3a764000061103c565b81101561057657604051630cfbd6ed60e41b815260040160405180910390fd5b60068190556040518181527ef463adf887d70de71254ff15fda812b064149b809b9d7b5f3d74186f051b23906020016104d8565b6105b2610c5d565b806001600160a01b0381166105da5760405163eaad396960e01b815260040160405180910390fd5b600180546001600160a01b0319166001600160a01b0384169081179091556040517fd59fa06f125dad08fdf5d7a73f336f356c4b3909f6c55338024f3f17ac29108c90600090a25050565b61047a610190670de0b6b3a764000061103c565b610641610c5d565b61064b6000610cb7565b565b610655610c5d565b61012c81111561067857604051630aaeed7360e41b815260040160405180910390fd5b60088190556040518181527f3f12358e6520bc6a48371046d4b531583621f9e4627b1331b455ceb071fc73f7906020016104d8565b6003546001600160a01b031633146106d85760405163281e2d6f60e11b815260040160405180910390fd5b600380546001600160a01b031916905562093a806106f68142611053565b610700919061103c565b600255565b60006103e860085483610718919061103c565b6107229190611053565b92915050565b610730610c5d565b610744610190670de0b6b3a764000061103c565b81111561076457604051631c1a87f160e21b815260040160405180910390fd5b60058190556040518181527f1cc663aeb31edc8aa4f6a5c8e2bfac88fb61613066ed6d6a579685038f64fdb1906020016104d8565b60006105026107a66104e3565b600654610d07565b6002546000906107c162093a8082611075565b42101580156107d957506003546001600160a01b0316155b15610bda5762093a806107ec8142611053565b6107f6919061103c565b60028190559050610805610799565b600581905560009061081690610705565b905060006103e86005548361082b9190611075565b600754610838919061103c565b6108429190611053565b9050600081600554846108559190611075565b61085f9190611075565b6040516370a0823160e01b81523060048201529091506000906001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016906370a0823190602401602060405180830381865afa1580156108c9573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108ed9190611088565b9050818110156109a9576001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000166340c10f193061093184866110a1565b6040516001600160e01b031960e085901b1681526001600160a01b03909216600483015260248201526044016020604051808303816000875af115801561097c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109a091906110b4565b6109a957600080fd5b6004546109e3906001600160a01b037f00000000000000000000000000000000000000000000000000000000000000008116911685610d1f565b610a997f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316638b7b23ee6040518163ffffffff1660e01b8152600401602060405180830381865afa158015610a44573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a6891906110d6565b6001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000169086610d1f565b60015460055460405163095ea7b360e01b81526001600160a01b03928316600482015260248101919091527f00000000000000000000000000000000000000000000000000000000000000009091169063095ea7b3906044016020604051808303816000875af1158015610b11573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b3591906110b4565b50600154600554604051633c6b16ab60e01b81526001600160a01b0390921691633c6b16ab91610b6b9160040190815260200190565b600060405180830381600087803b158015610b8557600080fd5b505af1158015610b99573d6000803e3d6000fd5b50506005546040519081523392507fb790869c1b5409b0c3b7255221dd63168b48b1fb10eeec84511278e9ac42f5bd915060200160405180910390a2505050505b919050565b610be7610c5d565b6001600160a01b038116610c515760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084015b60405180910390fd5b610c5a81610cb7565b50565b6000546001600160a01b0316331461064b5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610c48565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6000818311610d165781610d18565b825b9392505050565b604080516001600160a01b038416602482015260448082018490528251808303909101815260649091019091526020810180516001600160e01b031663a9059cbb60e01b179052610d71908490610d76565b505050565b6000610dcb826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b0316610e4b9092919063ffffffff16565b9050805160001480610dec575080806020019051810190610dec91906110b4565b610d715760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b6064820152608401610c48565b6060610e5a8484600085610e62565b949350505050565b606082471015610ec35760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f6044820152651c8818d85b1b60d21b6064820152608401610c48565b600080866001600160a01b03168587604051610edf9190611117565b60006040518083038185875af1925050503d8060008114610f1c576040519150601f19603f3d011682016040523d82523d6000602084013e610f21565b606091505b5091509150610f3287838387610f3d565b979650505050505050565b60608315610fac578251600003610fa5576001600160a01b0385163b610fa55760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401610c48565b5081610e5a565b610e5a8383815115610fc15781518083602001fd5b8060405162461bcd60e51b8152600401610c489190611133565b6001600160a01b0381168114610c5a57600080fd5b60006020828403121561100257600080fd5b8135610d1881610fdb565b60006020828403121561101f57600080fd5b5035919050565b634e487b7160e01b600052601160045260246000fd5b808202811582820484141761072257610722611026565b60008261107057634e487b7160e01b600052601260045260246000fd5b500490565b8082018082111561072257610722611026565b60006020828403121561109a57600080fd5b5051919050565b8181038181111561072257610722611026565b6000602082840312156110c657600080fd5b81518015158114610d1857600080fd5b6000602082840312156110e857600080fd5b8151610d1881610fdb565b60005b8381101561110e5781810151838201526020016110f6565b50506000910152565b600082516111298184602087016110f3565b9190910192915050565b60208152600082518060208401526111528160408501602087016110f3565b601f01601f1916919091016040019291505056fea2646970667358221220bf60da7e2fecb821cef9f56607c2a63f8eed52203ed5a64fcd20f6accd320c7064736f6c63430008130033000000000000000000000000b85213e2be9fd369eb502532d0ae9a8fc1d8883e00000000000000000000000041408e1510ac6f651fd6d8a142ec1b24bdaf1b5b000000000000000000000000d5dcbddd672b80ea9179a21b7691a34fb85615f2000000000000000000000000fd3e3c69698b722c8fc3c20b853dce35c149f4a0
Deployed Bytecode
0x608060405234801561001057600080fd5b50600436106101c45760003560e01c80637e851e7c116100f9578063c544df0c11610097578063d139960811610071578063d139960814610365578063ed29fc111461036e578063f2fde38b14610376578063fb5484271461038957600080fd5b8063c544df0c14610323578063cbb597381461034a578063cfc6c8ff1461035d57600080fd5b806385f2aef2116100d357806385f2aef2146102e35780638da5cb5b146102f65780638e01fbfa14610307578063ad4ae8c31461031a57600080fd5b80637e851e7c146102a15780638129fc1c146102b457806382bfefc8146102bc57600080fd5b806337f1139b1161016657806357ca5b5f1161014057806357ca5b5f1461027f578063611e280914610287578063715018a61461029057806378ef7f021461029857600080fd5b806337f1139b1461022e57806346c96aac146102415780634bc2a6571461026c57600080fd5b806324d08054116101a257806324d080541461020257806326cfc17b1461020a5780632e8f7b1f1461021357806336d96faf1461022657600080fd5b806301c8e6fd146101c9578063095cf5c6146101e457806313d8c840146101f9575b600080fd5b6101d1606481565b6040519081526020015b60405180910390f35b6101f76101f2366004610ff0565b6103b0565b005b6101d160065481565b6101d1610467565b6101d160055481565b6101f761022136600461100d565b61047d565b6101d16104e3565b6101f761023c36600461100d565b610507565b600154610254906001600160a01b031681565b6040516001600160a01b0390911681526020016101db565b6101f761027a366004610ff0565b6105aa565b6101d1610625565b6101d161012c81565b6101f7610639565b6101d160075481565b6101f76102af36600461100d565b61064d565b6101f76106ad565b6102547f00000000000000000000000041408e1510ac6f651fd6d8a142ec1b24bdaf1b5b81565b600454610254906001600160a01b031681565b6000546001600160a01b0316610254565b6101d161031536600461100d565b610705565b6101d160085481565b6102547f000000000000000000000000fd3e3c69698b722c8fc3c20b853dce35c149f4a081565b6101f761035836600461100d565b610728565b6101d1610799565b6101d160025481565b6101d16107ae565b6101f7610384366004610ff0565b610bdf565b6102547f000000000000000000000000d5dcbddd672b80ea9179a21b7691a34fb85615f281565b6000546001600160a01b031633148015906103d657506004546001600160a01b03163314155b156103f45760405163ae0a3e8360e01b815260040160405180910390fd5b806001600160a01b03811661041c5760405163eaad396960e01b815260040160405180910390fd5b600480546001600160a01b0319166001600160a01b0384169081179091556040517f7f59f43473721d8349d1ca8106b599adecb7862e562937bd0cccf5dd48169e9190600090a25050565b61047a6019670de0b6b3a764000061103c565b81565b610485610c5d565b60648111156104a7576040516334ca2ab360e11b815260040160405180910390fd5b60078190556040518181527f44cbdfba94b564a69e3978cc6fe0e4b73694cb5653fc3060d331ae5a3db5ee79906020015b60405180910390a150565b60006103e86103de6005546104f8919061103c565b6105029190611053565b905090565b61050f610c5d565b610523610190670de0b6b3a764000061103c565b81111561054357604051631c1a87f160e21b815260040160405180910390fd5b6105566019670de0b6b3a764000061103c565b81101561057657604051630cfbd6ed60e41b815260040160405180910390fd5b60068190556040518181527ef463adf887d70de71254ff15fda812b064149b809b9d7b5f3d74186f051b23906020016104d8565b6105b2610c5d565b806001600160a01b0381166105da5760405163eaad396960e01b815260040160405180910390fd5b600180546001600160a01b0319166001600160a01b0384169081179091556040517fd59fa06f125dad08fdf5d7a73f336f356c4b3909f6c55338024f3f17ac29108c90600090a25050565b61047a610190670de0b6b3a764000061103c565b610641610c5d565b61064b6000610cb7565b565b610655610c5d565b61012c81111561067857604051630aaeed7360e41b815260040160405180910390fd5b60088190556040518181527f3f12358e6520bc6a48371046d4b531583621f9e4627b1331b455ceb071fc73f7906020016104d8565b6003546001600160a01b031633146106d85760405163281e2d6f60e11b815260040160405180910390fd5b600380546001600160a01b031916905562093a806106f68142611053565b610700919061103c565b600255565b60006103e860085483610718919061103c565b6107229190611053565b92915050565b610730610c5d565b610744610190670de0b6b3a764000061103c565b81111561076457604051631c1a87f160e21b815260040160405180910390fd5b60058190556040518181527f1cc663aeb31edc8aa4f6a5c8e2bfac88fb61613066ed6d6a579685038f64fdb1906020016104d8565b60006105026107a66104e3565b600654610d07565b6002546000906107c162093a8082611075565b42101580156107d957506003546001600160a01b0316155b15610bda5762093a806107ec8142611053565b6107f6919061103c565b60028190559050610805610799565b600581905560009061081690610705565b905060006103e86005548361082b9190611075565b600754610838919061103c565b6108429190611053565b9050600081600554846108559190611075565b61085f9190611075565b6040516370a0823160e01b81523060048201529091506000906001600160a01b037f000000000000000000000000fd3e3c69698b722c8fc3c20b853dce35c149f4a016906370a0823190602401602060405180830381865afa1580156108c9573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108ed9190611088565b9050818110156109a9576001600160a01b037f000000000000000000000000fd3e3c69698b722c8fc3c20b853dce35c149f4a0166340c10f193061093184866110a1565b6040516001600160e01b031960e085901b1681526001600160a01b03909216600483015260248201526044016020604051808303816000875af115801561097c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109a091906110b4565b6109a957600080fd5b6004546109e3906001600160a01b037f000000000000000000000000fd3e3c69698b722c8fc3c20b853dce35c149f4a08116911685610d1f565b610a997f00000000000000000000000041408e1510ac6f651fd6d8a142ec1b24bdaf1b5b6001600160a01b0316638b7b23ee6040518163ffffffff1660e01b8152600401602060405180830381865afa158015610a44573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a6891906110d6565b6001600160a01b037f000000000000000000000000fd3e3c69698b722c8fc3c20b853dce35c149f4a0169086610d1f565b60015460055460405163095ea7b360e01b81526001600160a01b03928316600482015260248101919091527f000000000000000000000000fd3e3c69698b722c8fc3c20b853dce35c149f4a09091169063095ea7b3906044016020604051808303816000875af1158015610b11573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b3591906110b4565b50600154600554604051633c6b16ab60e01b81526001600160a01b0390921691633c6b16ab91610b6b9160040190815260200190565b600060405180830381600087803b158015610b8557600080fd5b505af1158015610b99573d6000803e3d6000fd5b50506005546040519081523392507fb790869c1b5409b0c3b7255221dd63168b48b1fb10eeec84511278e9ac42f5bd915060200160405180910390a2505050505b919050565b610be7610c5d565b6001600160a01b038116610c515760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084015b60405180910390fd5b610c5a81610cb7565b50565b6000546001600160a01b0316331461064b5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610c48565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6000818311610d165781610d18565b825b9392505050565b604080516001600160a01b038416602482015260448082018490528251808303909101815260649091019091526020810180516001600160e01b031663a9059cbb60e01b179052610d71908490610d76565b505050565b6000610dcb826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b0316610e4b9092919063ffffffff16565b9050805160001480610dec575080806020019051810190610dec91906110b4565b610d715760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b6064820152608401610c48565b6060610e5a8484600085610e62565b949350505050565b606082471015610ec35760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f6044820152651c8818d85b1b60d21b6064820152608401610c48565b600080866001600160a01b03168587604051610edf9190611117565b60006040518083038185875af1925050503d8060008114610f1c576040519150601f19603f3d011682016040523d82523d6000602084013e610f21565b606091505b5091509150610f3287838387610f3d565b979650505050505050565b60608315610fac578251600003610fa5576001600160a01b0385163b610fa55760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401610c48565b5081610e5a565b610e5a8383815115610fc15781518083602001fd5b8060405162461bcd60e51b8152600401610c489190611133565b6001600160a01b0381168114610c5a57600080fd5b60006020828403121561100257600080fd5b8135610d1881610fdb565b60006020828403121561101f57600080fd5b5035919050565b634e487b7160e01b600052601160045260246000fd5b808202811582820484141761072257610722611026565b60008261107057634e487b7160e01b600052601260045260246000fd5b500490565b8082018082111561072257610722611026565b60006020828403121561109a57600080fd5b5051919050565b8181038181111561072257610722611026565b6000602082840312156110c657600080fd5b81518015158114610d1857600080fd5b6000602082840312156110e857600080fd5b8151610d1881610fdb565b60005b8381101561110e5781810151838201526020016110f6565b50506000910152565b600082516111298184602087016110f3565b9190910192915050565b60208152600082518060208401526111528160408501602087016110f3565b601f01601f1916919091016040019291505056fea2646970667358221220bf60da7e2fecb821cef9f56607c2a63f8eed52203ed5a64fcd20f6accd320c7064736f6c63430008130033
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
000000000000000000000000b85213e2be9fd369eb502532d0ae9a8fc1d8883e00000000000000000000000041408e1510ac6f651fd6d8a142ec1b24bdaf1b5b000000000000000000000000d5dcbddd672b80ea9179a21b7691a34fb85615f2000000000000000000000000fd3e3c69698b722c8fc3c20b853dce35c149f4a0
-----Decoded View---------------
Arg [0] : _voter (address): 0xB85213e2be9fd369Eb502532d0Ae9a8Fc1D8883E
Arg [1] : _TOKEN (address): 0x41408E1510AC6f651FD6D8a142EC1B24bdAF1b5B
Arg [2] : _VTOKEN (address): 0xD5dCbDdd672b80EA9179A21B7691A34fb85615F2
Arg [3] : _OTOKEN (address): 0xfd3e3c69698b722c8FC3C20B853DCE35C149F4A0
-----Encoded View---------------
4 Constructor Arguments found :
Arg [0] : 000000000000000000000000b85213e2be9fd369eb502532d0ae9a8fc1d8883e
Arg [1] : 00000000000000000000000041408e1510ac6f651fd6d8a142ec1b24bdaf1b5b
Arg [2] : 000000000000000000000000d5dcbddd672b80ea9179a21b7691a34fb85615f2
Arg [3] : 000000000000000000000000fd3e3c69698b722c8fc3c20b853dce35c149f4a0
Loading...
Loading
Loading...
Loading
Multichain Portfolio | 31 Chains
Chain | Token | Portfolio % | Price | Amount | Value |
---|
[ 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.