Source Code
Overview
S Balance
0 S
More Info
ContractCreator
Transaction Hash |
Method
|
Block
|
From
|
To
|
|||||
---|---|---|---|---|---|---|---|---|---|
Latest 25 internal transactions (View All)
Parent Transaction Hash | Block | From | To | |||
---|---|---|---|---|---|---|
9304567 | 5 hrs ago | 0 S | ||||
9302202 | 5 hrs ago | 0 S | ||||
9302202 | 5 hrs ago | 0 S | ||||
9302202 | 5 hrs ago | 0 S | ||||
9302202 | 5 hrs ago | 0 S | ||||
9171902 | 16 hrs ago | 0 S | ||||
9171902 | 16 hrs ago | 0 S | ||||
9171902 | 16 hrs ago | 0 S | ||||
9171902 | 16 hrs ago | 0 S | ||||
9171902 | 16 hrs ago | 0 S | ||||
9159164 | 17 hrs ago | 0 S | ||||
9158955 | 17 hrs ago | 0 S | ||||
9158955 | 17 hrs ago | 0 S | ||||
9158955 | 17 hrs ago | 0 S | ||||
9158955 | 17 hrs ago | 0 S | ||||
9017352 | 29 hrs ago | 0 S | ||||
9016567 | 29 hrs ago | 0 S | ||||
9016567 | 29 hrs ago | 0 S | ||||
9016567 | 29 hrs ago | 0 S | ||||
9016567 | 29 hrs ago | 0 S | ||||
8877255 | 41 hrs ago | 0 S | ||||
8876215 | 41 hrs ago | 0 S | ||||
8876215 | 41 hrs ago | 0 S | ||||
8876215 | 41 hrs ago | 0 S | ||||
8876215 | 41 hrs ago | 0 S |
Loading...
Loading
Contract Name:
MinterUpgradeable
Compiler Version
v0.8.13+commit.abaa5c0e
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.13; import "./libraries/Math.sol"; import "./libraries/Constants.sol"; import "./interfaces/IMinter.sol"; import "./interfaces/IRewardsDistributor.sol"; import "./interfaces/ISWPx.sol"; import "./interfaces/IVoter.sol"; import "./interfaces/IVotingEscrow.sol"; import "./interfaces/IMasterchef.sol"; import "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol"; // codifies the minting rules as per ve(3,3), abstracted from the token to support any token that allows minting contract MinterUpgradeable is IMinter, OwnableUpgradeable { bool public isFirstMint; uint public EMISSION; uint public TAIL_EMISSION; uint public REBASE_MAX; uint public REBASE_MIN; uint public REBASE_STEP; uint public currentRebaseRate; uint public constant PRECISION = 1000; uint public teamRate; uint public referralRate; uint public surplusTokens; uint public constant MAX_TEAM_RATE = 50; // 5% uint public constant MAX_REFERRAL_RATE = 100; // 10% uint public weekly; // represents a starting weekly emission of 2.0M SWPx (SWPx has 18 decimals) uint public active_period; bool public isEpochsStarted; uint public weekNumber; uint public constant LOCK = 86400 * 7 * 52 * 2; address public team; address public pendingTeam; address public referralAddress; ISWPx public _swpx; IVoter public _voter; IVotingEscrow public _ve; IRewardsDistributor public _rewards_distributor; IMasterchef public masterchef; event Mint(address indexed sender, uint weekly, uint circulating_supply, uint circulating_emission); event EpochChanged(uint256 epochStartTime); constructor() {} function initialize( address __voter, // the voting & distribution system address __ve, // the ve(3,3) system that will be locked into address __rewards_distributor, // the distribution system that ensures users aren't diluted address _masterchef, address _initialMintRecipient ) initializer public { __Ownable_init(); team = msg.sender; teamRate = 30; // 300 bps = 3% referralRate = 50; EMISSION = 990; TAIL_EMISSION = 2; REBASE_MAX = 300; REBASE_MIN = 100; REBASE_STEP = 10; _swpx = ISWPx(IVotingEscrow(__ve).token()); _voter = IVoter(__voter); _ve = IVotingEscrow(__ve); _rewards_distributor = IRewardsDistributor(__rewards_distributor); masterchef = IMasterchef(_masterchef); _swpx.initialMint(_initialMintRecipient); weekly = 2_000_000 * 1e18; // represents a starting weekly emission of 2M SWPx (SWPx has 18 decimals) isFirstMint = true; } function startEpoch() external onlyOwner { require(!isEpochsStarted, "Already started"); active_period = (block.timestamp / Constants.EPOCH_LENGTH) * Constants.EPOCH_LENGTH; isEpochsStarted = true; emit EpochChanged(active_period); } function setTeam(address _team) external { require(msg.sender == team, "not team"); pendingTeam = _team; } function acceptTeam() external { require(msg.sender == pendingTeam, "not pending team"); team = pendingTeam; } function setVoter(address __voter) external { require(__voter != address(0)); require(msg.sender == team, "not team"); _voter = IVoter(__voter); } function setTeamRate(uint _teamRate) external { require(msg.sender == team, "not team"); require(_teamRate <= MAX_TEAM_RATE, "rate too high"); teamRate = _teamRate; } function setEmission(uint _emission) external { require(msg.sender == team, "not team"); require(_emission <= PRECISION * 150 / 100, "rate too high"); EMISSION = _emission; } function setReferralRate(uint _referralRate) external { require(msg.sender == team, "not team"); require(_referralRate <= MAX_REFERRAL_RATE, "rate too high"); referralRate = _referralRate; } function setReferralAddress(address _referralAddress) external { require(_referralAddress != address(0)); require(msg.sender == team, "not team"); referralAddress = _referralAddress; } // calculate circulating supply as total token supply - locked supply function circulating_supply() public view returns (uint) { return _swpx.totalSupply() - _swpx.balanceOf(address(_ve)); } // 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; } function circulating_emission() public view returns (uint) { return (circulating_supply() * TAIL_EMISSION) / PRECISION; } // calculate inflation and adjust ve balances accordingly function calculate_rebase(uint _weeklyMint) public view returns (uint, uint) { if (weekNumber == 0) { return (0, 0); } uint256 _currentRebaseRate = currentRebaseRate; if (_currentRebaseRate == 0) { _currentRebaseRate = REBASE_MIN; } else if (_currentRebaseRate < REBASE_MAX) { _currentRebaseRate += REBASE_STEP; } uint256 rebaseAmount = _weeklyMint * _currentRebaseRate / PRECISION; return (_currentRebaseRate, rebaseAmount); } // update period can only be called once per cycle (1 week) function update_period() external returns (uint) { uint _period = active_period; if (block.timestamp >= _period + Constants.EPOCH_LENGTH && isEpochsStarted) { // only trigger if new week _period = (block.timestamp / Constants.EPOCH_LENGTH) * Constants.EPOCH_LENGTH; active_period = _period; if(!isFirstMint){ weekly = calculate_emission(); } else { isFirstMint = false; } uint _rebase; (currentRebaseRate, _rebase) = calculate_rebase(weekly); uint _teamEmissions = weekly * teamRate / PRECISION; uint _referralEmissions = weekly * referralRate / PRECISION; uint _required = weekly + surplusTokens; uint _gauge = weekly + surplusTokens - _rebase - _teamEmissions - _referralEmissions; delete surplusTokens; uint _balanceOf = _swpx.balanceOf(address(this)); if (_balanceOf < _required) { _swpx.mint(address(this), _required - _balanceOf); } if (weekNumber < 12) { masterchef.setDistributionRateExtra(_teamEmissions); require(_swpx.transfer(address(masterchef), _teamEmissions)); } else { require(_swpx.transfer(team, _teamEmissions)); } if(referralAddress != address(0)) require(_swpx.transfer(referralAddress, _referralEmissions)); require(_swpx.transfer(address(_rewards_distributor), _rebase)); _rewards_distributor.checkpoint_token(); // checkpoint token balance that was just minted in rewards distributor _rewards_distributor.checkpoint_total_supply(); // checkpoint supply require(_swpx.approve(address(_voter), _gauge)); _voter.notifyRewardAmount(_gauge); emit EpochChanged(_period); emit Mint(msg.sender, weekly, circulating_supply(), circulating_emission()); ++weekNumber; } return _period; } function returnSurplusTokens(uint256 amount) external { require(msg.sender == referralAddress, "!referralAddress"); surplusTokens += amount; require(_swpx.transferFrom(msg.sender, address(this), amount)); } function check() external view returns(bool){ uint _period = active_period; return (block.timestamp >= _period + Constants.EPOCH_LENGTH && isEpochsStarted); } function period() external view returns(uint){ return(block.timestamp / Constants.EPOCH_LENGTH) * Constants.EPOCH_LENGTH; } function setRewardDistributor(address _rewardDistro) external { require(msg.sender == team); _rewards_distributor = IRewardsDistributor(_rewardDistro); } function setMint(address minter) external { _swpx.setMinter(minter); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.7.0) (access/Ownable.sol) pragma solidity ^0.8.0; import "../utils/ContextUpgradeable.sol"; import "../proxy/utils/Initializable.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 OwnableUpgradeable is Initializable, ContextUpgradeable { address private _owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev Initializes the contract setting the deployer as the initial owner. */ function __Ownable_init() internal onlyInitializing { __Ownable_init_unchained(); } function __Ownable_init_unchained() internal onlyInitializing { _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); } /** * @dev This empty reserved space is put in place to allow future versions to add new * variables without shifting down storage in the inheritance chain. * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps */ uint256[49] private __gap; }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.8.0) (proxy/utils/Initializable.sol) pragma solidity ^0.8.2; import "../../utils/AddressUpgradeable.sol"; /** * @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed * behind a proxy. Since proxied contracts do not make use of a constructor, it's common to move constructor logic to an * external initializer function, usually called `initialize`. It then becomes necessary to protect this initializer * function so it can only be called once. The {initializer} modifier provided by this contract will have this effect. * * The initialization functions use a version number. Once a version number is used, it is consumed and cannot be * reused. This mechanism prevents re-execution of each "step" but allows the creation of new initialization steps in * case an upgrade adds a module that needs to be initialized. * * For example: * * [.hljs-theme-light.nopadding] * ``` * contract MyToken is ERC20Upgradeable { * function initialize() initializer public { * __ERC20_init("MyToken", "MTK"); * } * } * contract MyTokenV2 is MyToken, ERC20PermitUpgradeable { * function initializeV2() reinitializer(2) public { * __ERC20Permit_init("MyToken"); * } * } * ``` * * TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as * possible by providing the encoded function call as the `_data` argument to {ERC1967Proxy-constructor}. * * CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure * that all initializers are idempotent. This is not verified automatically as constructors are by Solidity. * * [CAUTION] * ==== * Avoid leaving a contract uninitialized. * * An uninitialized contract can be taken over by an attacker. This applies to both a proxy and its implementation * contract, which may impact the proxy. To prevent the implementation contract from being used, you should invoke * the {_disableInitializers} function in the constructor to automatically lock it when it is deployed: * * [.hljs-theme-light.nopadding] * ``` * /// @custom:oz-upgrades-unsafe-allow constructor * constructor() { * _disableInitializers(); * } * ``` * ==== */ abstract contract Initializable { /** * @dev Indicates that the contract has been initialized. * @custom:oz-retyped-from bool */ uint8 private _initialized; /** * @dev Indicates that the contract is in the process of being initialized. */ bool private _initializing; /** * @dev Triggered when the contract has been initialized or reinitialized. */ event Initialized(uint8 version); /** * @dev A modifier that defines a protected initializer function that can be invoked at most once. In its scope, * `onlyInitializing` functions can be used to initialize parent contracts. * * Similar to `reinitializer(1)`, except that functions marked with `initializer` can be nested in the context of a * constructor. * * Emits an {Initialized} event. */ modifier initializer() { bool isTopLevelCall = !_initializing; require( (isTopLevelCall && _initialized < 1) || (!AddressUpgradeable.isContract(address(this)) && _initialized == 1), "Initializable: contract is already initialized" ); _initialized = 1; if (isTopLevelCall) { _initializing = true; } _; if (isTopLevelCall) { _initializing = false; emit Initialized(1); } } /** * @dev A modifier that defines a protected reinitializer function that can be invoked at most once, and only if the * contract hasn't been initialized to a greater version before. In its scope, `onlyInitializing` functions can be * used to initialize parent contracts. * * A reinitializer may be used after the original initialization step. This is essential to configure modules that * are added through upgrades and that require initialization. * * When `version` is 1, this modifier is similar to `initializer`, except that functions marked with `reinitializer` * cannot be nested. If one is invoked in the context of another, execution will revert. * * Note that versions can jump in increments greater than 1; this implies that if multiple reinitializers coexist in * a contract, executing them in the right order is up to the developer or operator. * * WARNING: setting the version to 255 will prevent any future reinitialization. * * Emits an {Initialized} event. */ modifier reinitializer(uint8 version) { require(!_initializing && _initialized < version, "Initializable: contract is already initialized"); _initialized = version; _initializing = true; _; _initializing = false; emit Initialized(version); } /** * @dev Modifier to protect an initialization function so that it can only be invoked by functions with the * {initializer} and {reinitializer} modifiers, directly or indirectly. */ modifier onlyInitializing() { require(_initializing, "Initializable: contract is not initializing"); _; } /** * @dev Locks the contract, preventing any future reinitialization. This cannot be part of an initializer call. * Calling this in the constructor of a contract will prevent that contract from being initialized or reinitialized * to any version. It is recommended to use this to lock implementation contracts that are designed to be called * through proxies. * * Emits an {Initialized} event the first time it is successfully executed. */ function _disableInitializers() internal virtual { require(!_initializing, "Initializable: contract is initializing"); if (_initialized < type(uint8).max) { _initialized = type(uint8).max; emit Initialized(type(uint8).max); } } /** * @dev Internal function that returns the initialized version. Returns `_initialized` */ function _getInitializedVersion() internal view returns (uint8) { return _initialized; } /** * @dev Internal function that returns the initialized version. Returns `_initializing` */ function _isInitializing() internal view returns (bool) { return _initializing; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.8.0) (utils/Address.sol) pragma solidity ^0.8.1; /** * @dev Collection of functions related to the address type */ library AddressUpgradeable { /** * @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 * ==== * * [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://diligence.consensys.net/posts/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.5.11/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 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; import "../proxy/utils/Initializable.sol"; /** * @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 ContextUpgradeable is Initializable { function __Context_init() internal onlyInitializing { } function __Context_init_unchained() internal onlyInitializing { } function _msgSender() internal view virtual returns (address) { return msg.sender; } function _msgData() internal view virtual returns (bytes calldata) { return msg.data; } /** * @dev This empty reserved space is put in place to allow future versions to add new * variables without shifting down storage in the inheritance chain. * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps */ uint256[50] private __gap; }
// SPDX-License-Identifier: MIT pragma solidity 0.8.13; interface IMasterchef { struct PoolInfo { uint256 accRewardPerShare; uint256 accRewardPerShareExtra; uint256 lastRewardTime; } function setDistributionRate(uint256 amount) external; function setDistributionRateExtra(uint256 amount) external; function updatePool() external returns (PoolInfo memory pool); }
// SPDX-License-Identifier: MIT pragma solidity 0.8.13; interface IMinter { function update_period() external returns (uint); function check() external view returns(bool); function period() external view returns(uint); function active_period() external view returns(uint); }
// SPDX-License-Identifier: MIT pragma solidity 0.8.13; interface IRewardsDistributor { function checkpoint_token() external; function voting_escrow() external view returns(address); function checkpoint_total_supply() external; function claimable(uint _tokenId) external view returns (uint); }
// SPDX-License-Identifier: MIT pragma solidity 0.8.13; interface ISWPx { function initialMint(address _recipient) external; function totalSupply() external view returns (uint); function balanceOf(address) external view returns (uint); function approve(address spender, uint value) external returns (bool); function transfer(address, uint) external returns (bool); function transferFrom(address,address,uint) external returns (bool); function mint(address, uint) external returns (bool); function minter() external returns (address); function setMinter(address) external; }
// SPDX-License-Identifier: MIT pragma solidity 0.8.13; interface IVoter { function _ve() external view returns (address); function gauges(address _pair) external view returns (address); function isGauge(address _gauge) external view returns (bool); function poolForGauge(address _gauge) external view returns (address); function factory() external view returns (address); function minter() external view returns(address); function isWhitelisted(address token) external view returns (bool); function notifyRewardAmount(uint amount) external; function distributeAll() external; function distributeFees(address[] memory _gauges) external; function internal_bribes(address _gauge) external view returns (address); function external_bribes(address _gauge) external view returns (address); function usedWeights(uint id) external view returns(uint); function lastVoted(uint id) external view returns(uint); function poolVote(uint id, uint _index) external view returns(address _pair); function votes(uint id, address _pool) external view returns(uint votes); function poolVoteLength(uint tokenId) external view returns(uint); }
// SPDX-License-Identifier: MIT pragma solidity 0.8.13; interface IVotingEscrow { struct Point { int128 bias; int128 slope; // # -dweight / dt uint256 ts; uint256 blk; // block } struct LockedBalance { int128 amount; uint start; uint end; } function create_lock_for(uint _value, uint _lock_duration, address _to) external returns (uint); function locked(uint id) external view returns(LockedBalance memory); function tokenOfOwnerByIndex(address _owner, uint _tokenIndex) external view returns (uint); function token() external view returns (address); function team() external returns (address); function epoch() external view returns (uint); function point_history(uint loc) external view returns (Point memory); function user_point_history(uint tokenId, uint loc) external view returns (Point memory); function user_point_epoch(uint tokenId) external view returns (uint); function ownerOf(uint) external view returns (address); function isApprovedOrOwner(address, uint) external view returns (bool); function transferFrom(address, address, uint) external; function voted(uint) external view returns (bool); function attachments(uint) external view returns (uint); function voting(uint tokenId) external; function abstain(uint tokenId) external; function attach(uint tokenId) external; function detach(uint tokenId) external; function checkpoint() external; function deposit_for(uint tokenId, uint value) external; function balanceOfAtNFT(uint _tokenId, uint _block) external view returns (uint); function balanceOfNFT(uint _id) external view returns (uint); function balanceOf(address _owner) external view returns (uint); function totalSupply() external view returns (uint); function supply() external view returns (uint); function decimals() external view returns(uint8); }
// SPDX-License-Identifier: MIT pragma solidity 0.8.13; library Constants { uint256 internal constant EPOCH_LENGTH = 12 hours;//7 days; }
// SPDX-License-Identifier: MIT pragma solidity 0.8.13; library Math { function max(uint a, uint b) internal pure returns (uint) { return a >= b ? a : b; } function min(uint a, uint b) internal pure returns (uint) { return a < b ? a : b; } function sqrt(uint y) internal pure returns (uint z) { if (y > 3) { z = y; uint x = y / 2 + 1; while (x < z) { z = x; x = (y / x + x) / 2; } } else if (y != 0) { z = 1; } } function cbrt(uint256 n) internal pure returns (uint256) { unchecked { uint256 x = 0; for (uint256 y = 1 << 255; y > 0; y >>= 3) { x <<= 1; uint256 z = 3 * x * (x + 1) + 1; if (n / y >= z) { n -= y * z; x += 1; } } return x; }} }
{ "optimizer": { "enabled": true, "runs": 200 }, "outputSelection": { "*": { "*": [ "evm.bytecode", "evm.deployedBytecode", "devdoc", "userdoc", "metadata", "abi" ] } }, "libraries": {} }
[{"inputs":[],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"epochStartTime","type":"uint256"}],"name":"EpochChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint8","name":"version","type":"uint8"}],"name":"Initialized","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"sender","type":"address"},{"indexed":false,"internalType":"uint256","name":"weekly","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"circulating_supply","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"circulating_emission","type":"uint256"}],"name":"Mint","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":"EMISSION","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"LOCK","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"MAX_REFERRAL_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":"PRECISION","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"REBASE_MAX","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"REBASE_MIN","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"REBASE_STEP","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"TAIL_EMISSION","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"_rewards_distributor","outputs":[{"internalType":"contract IRewardsDistributor","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"_swpx","outputs":[{"internalType":"contract ISWPx","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"_ve","outputs":[{"internalType":"contract IVotingEscrow","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"_voter","outputs":[{"internalType":"contract IVoter","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"acceptTeam","outputs":[],"stateMutability":"nonpayable","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":"_weeklyMint","type":"uint256"}],"name":"calculate_rebase","outputs":[{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"check","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"circulating_emission","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"circulating_supply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"currentRebaseRate","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"__voter","type":"address"},{"internalType":"address","name":"__ve","type":"address"},{"internalType":"address","name":"__rewards_distributor","type":"address"},{"internalType":"address","name":"_masterchef","type":"address"},{"internalType":"address","name":"_initialMintRecipient","type":"address"}],"name":"initialize","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"isEpochsStarted","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"isFirstMint","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"masterchef","outputs":[{"internalType":"contract IMasterchef","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pendingTeam","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"period","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"referralAddress","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"referralRate","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"returnSurplusTokens","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_emission","type":"uint256"}],"name":"setEmission","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"minter","type":"address"}],"name":"setMint","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_referralAddress","type":"address"}],"name":"setReferralAddress","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_referralRate","type":"uint256"}],"name":"setReferralRate","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_rewardDistro","type":"address"}],"name":"setRewardDistributor","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":[],"name":"startEpoch","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"surplusTokens","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":"weekNumber","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"weekly","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"}]
Contract Creation Code
608060405234801561001057600080fd5b506119af806100206000396000f3fe608060405234801561001057600080fd5b50600436106102a05760003560e01c80638dd598fb11610167578063b3caba5a116100ce578063e038c75a11610087578063e038c75a14610530578063ed29fc1114610538578063ef78d4fd14610540578063f2fde38b14610548578063fb1db2781461055b578063fff09d381461056e57600080fd5b8063b3caba5a146104dd578063b5cc143a146104f0578063b9edd5ff146104f8578063ca4863fd14610501578063d139960814610514578063ddce102f1461051d57600080fd5b8063a18cb95611610120578063a18cb956146104a2578063a2c8b177146104ab578063a2e23a51146104b3578063a4f0d7d0146104bc578063a9abf7ec146104c7578063aaf5eb68146104d457600080fd5b80638dd598fb14610430578063919840ad146104435780639c809ff71461044b578063a053ce1f1461045e578063a129cfbf14610467578063a1809b951461048f57600080fd5b80634bc2a6571161020b5780635f8a325d116101c45780635f8a325d146103df5780636acd4f55146103e8578063715018a6146103fb57806378ef7f021461040357806385f2aef21461040c5780638da5cb5b1461041f57600080fd5b80634bc2a6571461038b5780634e5242061461039e57806350b9e2c6146103a7578063548dd3fe146103b057806359d46ffc146103c35780635ef5cc4a146103d657600080fd5b8063260edaaa1161025d578063260edaaa1461033857806326cfc17b146103415780632e8f7b1f1461034a57806336d96faf1461035d5780633db9b42a146103655780634b1cd5da1461037857600080fd5b806301c8e6fd146102a5578063095cf5c6146102c05780631459457a146102d557806315a88d22146102e85780631e6ff7b1146103135780631eebae8014610330575b600080fd5b6102ad603281565b6040519081526020015b60405180910390f35b6102d36102ce366004611740565b610576565b005b6102d36102e3366004611764565b6105cb565b6075546102fb906001600160a01b031681565b6040516001600160a01b0390911681526020016102b7565b6071546103209060ff1681565b60405190151581526020016102b7565b6102ad610840565b6102ad606e5481565b6102ad606f5481565b6102d36103583660046117d5565b610869565b6102ad6108b9565b6077546102fb906001600160a01b031681565b6079546102fb906001600160a01b031681565b6102d3610399366004611740565b6108ce565b6102ad606b5481565b6102ad60695481565b6076546102fb906001600160a01b031681565b6074546102fb906001600160a01b031681565b6102ad60725481565b6102ad606a5481565b6102d36103f6366004611740565b61092d565b6102d361098f565b6102ad606c5481565b6073546102fb906001600160a01b031681565b6033546001600160a01b03166102fb565b6078546102fb906001600160a01b031681565b6103206109a3565b6102d36104593660046117d5565b6109cc565b6102ad606d5481565b61047a6104753660046117d5565b610ab7565b604080519283526020830191909152016102b7565b6102d361049d366004611740565b610b23565b6102ad60665481565b6102d3610b5c565b6102ad60675481565b6102ad6303bfc40081565b6065546103209060ff1681565b6102ad6103e881565b6102d36104eb366004611740565b610c0e565b6102d3610c6d565b6102ad60685481565b6102d361050f3660046117d5565b610cde565b6102ad60705481565b6102d361052b3660046117d5565b610d2e565b6102ad610d95565b6102ad610e8b565b6102ad611591565b6102d3610556366004611740565b6115aa565b607a546102fb906001600160a01b031681565b6102ad606481565b6073546001600160a01b031633146105a95760405162461bcd60e51b81526004016105a0906117ee565b60405180910390fd5b607480546001600160a01b0319166001600160a01b0392909216919091179055565b600054610100900460ff16158080156105eb5750600054600160ff909116105b806106055750303b158015610605575060005460ff166001145b6106685760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b60648201526084016105a0565b6000805460ff19166001179055801561068b576000805461ff0019166101001790555b610693611620565b607380546001600160a01b03191633179055601e606c556032606d556103de606655600260675561012c6068556064606955600a606a5560408051637e062a3560e11b815290516001600160a01b0387169163fc0c546a9160048281019260209291908290030181865afa15801561070f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107339190611810565b607680546001600160a01b03199081166001600160a01b039384169081179092556077805482168a8516179055607880548216898516179055607980548216888516179055607a80549091168684161790556040516361347cdd60e11b815291841660048301529063c268f9ba90602401600060405180830381600087803b1580156107be57600080fd5b505af11580156107d2573d6000803e3d6000fd5b50506a01a784379d99db42000000606f5550506065805460ff191660011790558015610838576000805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b505050505050565b60006103e8606754610850610d95565b61085a9190611843565b6108649190611862565b905090565b6073546001600160a01b031633146108935760405162461bcd60e51b81526004016105a0906117ee565b60328111156108b45760405162461bcd60e51b81526004016105a090611884565b606c55565b60006103e8606654606f5461085a9190611843565b6001600160a01b0381166108e157600080fd5b6073546001600160a01b0316331461090b5760405162461bcd60e51b81526004016105a0906117ee565b607780546001600160a01b0319166001600160a01b0392909216919091179055565b607654604051637e51dad560e11b81526001600160a01b0383811660048301529091169063fca3b5aa90602401600060405180830381600087803b15801561097457600080fd5b505af1158015610988573d6000803e3d6000fd5b5050505050565b61099761164f565b6109a160006116a9565b565b6070546000906109b561a8c0826118ab565b42101580156109c6575060715460ff165b91505090565b6075546001600160a01b03163314610a195760405162461bcd60e51b815260206004820152601060248201526f21726566657272616c4164647265737360801b60448201526064016105a0565b80606e6000828254610a2b91906118ab565b90915550506076546040516323b872dd60e01b8152336004820152306024820152604481018390526001600160a01b03909116906323b872dd906064016020604051808303816000875af1158015610a87573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610aab91906118c3565b610ab457600080fd5b50565b600080607254600003610acf57506000928392509050565b606b546000819003610ae45750606954610afe565b606854811015610afe57606a54610afb90826118ab565b90505b60006103e8610b0d8387611843565b610b179190611862565b91959194509092505050565b6073546001600160a01b03163314610b3a57600080fd5b607980546001600160a01b0319166001600160a01b0392909216919091179055565b610b6461164f565b60715460ff1615610ba95760405162461bcd60e51b815260206004820152600f60248201526e105b1c9958591e481cdd185c9d1959608a1b60448201526064016105a0565b61a8c0610bb68142611862565b610bc09190611843565b60708190556071805460ff191660011790556040517ff9f27cb0d471614697655d6ae068b7d5bf89e1532a5c259d7f9c5387d6dcf9e891610c049190815260200190565b60405180910390a1565b6001600160a01b038116610c2157600080fd5b6073546001600160a01b03163314610c4b5760405162461bcd60e51b81526004016105a0906117ee565b607580546001600160a01b0319166001600160a01b0392909216919091179055565b6074546001600160a01b03163314610cba5760405162461bcd60e51b815260206004820152601060248201526f6e6f742070656e64696e67207465616d60801b60448201526064016105a0565b607454607380546001600160a01b0319166001600160a01b03909216919091179055565b6073546001600160a01b03163314610d085760405162461bcd60e51b81526004016105a0906117ee565b6064811115610d295760405162461bcd60e51b81526004016105a090611884565b606d55565b6073546001600160a01b03163314610d585760405162461bcd60e51b81526004016105a0906117ee565b6064610d676103e86096611843565b610d719190611862565b811115610d905760405162461bcd60e51b81526004016105a090611884565b606655565b6076546078546040516370a0823160e01b81526001600160a01b03918216600482015260009291909116906370a0823190602401602060405180830381865afa158015610de6573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e0a91906118e5565b607660009054906101000a90046001600160a01b03166001600160a01b03166318160ddd6040518163ffffffff1660e01b8152600401602060405180830381865afa158015610e5d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e8191906118e5565b61086491906118fe565b607054600090610e9d61a8c0826118ab565b4210158015610eae575060715460ff165b1561158c5761a8c0610ec08142611862565b610eca9190611843565b607081905560655490915060ff16610eec57610ee46108b9565b606f55610ef7565b6065805460ff191690555b6000610f04606f54610ab7565b606b91909155606c54606f549192506000916103e891610f2391611843565b610f2d9190611862565b905060006103e8606d54606f54610f449190611843565b610f4e9190611862565b90506000606e54606f54610f6291906118ab565b90506000828486606e54606f54610f7991906118ab565b610f8391906118fe565b610f8d91906118fe565b610f9791906118fe565b6000606e8190556076546040516370a0823160e01b815230600482015292935090916001600160a01b03909116906370a0823190602401602060405180830381865afa158015610feb573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061100f91906118e5565b9050828110156110a6576076546001600160a01b03166340c10f193061103584876118fe565b6040516001600160e01b031960e085901b1681526001600160a01b03909216600483015260248201526044016020604051808303816000875af1158015611080573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110a491906118c3565b505b600c607254101561119657607a5460405163d34395fb60e01b8152600481018790526001600160a01b039091169063d34395fb90602401600060405180830381600087803b1580156110f757600080fd5b505af115801561110b573d6000803e3d6000fd5b5050607654607a5460405163a9059cbb60e01b81526001600160a01b039182166004820152602481018a90529116925063a9059cbb91506044016020604051808303816000875af1158015611164573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061118891906118c3565b61119157600080fd5b611218565b60765460735460405163a9059cbb60e01b81526001600160a01b0391821660048201526024810188905291169063a9059cbb906044016020604051808303816000875af11580156111eb573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061120f91906118c3565b61121857600080fd5b6075546001600160a01b0316156112ab5760765460755460405163a9059cbb60e01b81526001600160a01b0391821660048201526024810187905291169063a9059cbb906044016020604051808303816000875af115801561127e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906112a291906118c3565b6112ab57600080fd5b60765460795460405163a9059cbb60e01b81526001600160a01b0391821660048201526024810189905291169063a9059cbb906044016020604051808303816000875af1158015611300573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061132491906118c3565b61132d57600080fd5b607960009054906101000a90046001600160a01b03166001600160a01b031663811a40fe6040518163ffffffff1660e01b8152600401600060405180830381600087803b15801561137d57600080fd5b505af1158015611391573d6000803e3d6000fd5b50505050607960009054906101000a90046001600160a01b03166001600160a01b031663b21ed5026040518163ffffffff1660e01b8152600401600060405180830381600087803b1580156113e557600080fd5b505af11580156113f9573d6000803e3d6000fd5b505060765460775460405163095ea7b360e01b81526001600160a01b039182166004820152602481018790529116925063095ea7b391506044016020604051808303816000875af1158015611452573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061147691906118c3565b61147f57600080fd5b607754604051633c6b16ab60e01b8152600481018490526001600160a01b0390911690633c6b16ab90602401600060405180830381600087803b1580156114c557600080fd5b505af11580156114d9573d6000803e3d6000fd5b505050507ff9f27cb0d471614697655d6ae068b7d5bf89e1532a5c259d7f9c5387d6dcf9e88760405161150e91815260200190565b60405180910390a1336001600160a01b03167fb4c03061fb5b7fed76389d5af8f2e0ddb09f8c70d1333abbb62582835e10accb606f5461154c610d95565b611554610840565b6040805193845260208401929092529082015260600160405180910390a260726000815461158190611915565b909155505050505050505b919050565b600061a8c06115a08142611862565b6108649190611843565b6115b261164f565b6001600160a01b0381166116175760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016105a0565b610ab4816116a9565b600054610100900460ff166116475760405162461bcd60e51b81526004016105a09061192e565b6109a16116fb565b6033546001600160a01b031633146109a15760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016105a0565b603380546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b600054610100900460ff166117225760405162461bcd60e51b81526004016105a09061192e565b6109a1336116a9565b6001600160a01b0381168114610ab457600080fd5b60006020828403121561175257600080fd5b813561175d8161172b565b9392505050565b600080600080600060a0868803121561177c57600080fd5b85356117878161172b565b945060208601356117978161172b565b935060408601356117a78161172b565b925060608601356117b78161172b565b915060808601356117c78161172b565b809150509295509295909350565b6000602082840312156117e757600080fd5b5035919050565b6020808252600890820152676e6f74207465616d60c01b604082015260600190565b60006020828403121561182257600080fd5b815161175d8161172b565b634e487b7160e01b600052601160045260246000fd5b600081600019048311821515161561185d5761185d61182d565b500290565b60008261187f57634e487b7160e01b600052601260045260246000fd5b500490565b6020808252600d908201526c0e4c2e8ca40e8dede40d0d2ced609b1b604082015260600190565b600082198211156118be576118be61182d565b500190565b6000602082840312156118d557600080fd5b8151801515811461175d57600080fd5b6000602082840312156118f757600080fd5b5051919050565b6000828210156119105761191061182d565b500390565b6000600182016119275761192761182d565b5060010190565b6020808252602b908201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960408201526a6e697469616c697a696e6760a81b60608201526080019056fea26469706673582212207334176f755df44c0ea429ac7514bc15048180588f1adb2858bbb3f3db95b57564736f6c634300080d0033
Deployed Bytecode
0x608060405234801561001057600080fd5b50600436106102a05760003560e01c80638dd598fb11610167578063b3caba5a116100ce578063e038c75a11610087578063e038c75a14610530578063ed29fc1114610538578063ef78d4fd14610540578063f2fde38b14610548578063fb1db2781461055b578063fff09d381461056e57600080fd5b8063b3caba5a146104dd578063b5cc143a146104f0578063b9edd5ff146104f8578063ca4863fd14610501578063d139960814610514578063ddce102f1461051d57600080fd5b8063a18cb95611610120578063a18cb956146104a2578063a2c8b177146104ab578063a2e23a51146104b3578063a4f0d7d0146104bc578063a9abf7ec146104c7578063aaf5eb68146104d457600080fd5b80638dd598fb14610430578063919840ad146104435780639c809ff71461044b578063a053ce1f1461045e578063a129cfbf14610467578063a1809b951461048f57600080fd5b80634bc2a6571161020b5780635f8a325d116101c45780635f8a325d146103df5780636acd4f55146103e8578063715018a6146103fb57806378ef7f021461040357806385f2aef21461040c5780638da5cb5b1461041f57600080fd5b80634bc2a6571461038b5780634e5242061461039e57806350b9e2c6146103a7578063548dd3fe146103b057806359d46ffc146103c35780635ef5cc4a146103d657600080fd5b8063260edaaa1161025d578063260edaaa1461033857806326cfc17b146103415780632e8f7b1f1461034a57806336d96faf1461035d5780633db9b42a146103655780634b1cd5da1461037857600080fd5b806301c8e6fd146102a5578063095cf5c6146102c05780631459457a146102d557806315a88d22146102e85780631e6ff7b1146103135780631eebae8014610330575b600080fd5b6102ad603281565b6040519081526020015b60405180910390f35b6102d36102ce366004611740565b610576565b005b6102d36102e3366004611764565b6105cb565b6075546102fb906001600160a01b031681565b6040516001600160a01b0390911681526020016102b7565b6071546103209060ff1681565b60405190151581526020016102b7565b6102ad610840565b6102ad606e5481565b6102ad606f5481565b6102d36103583660046117d5565b610869565b6102ad6108b9565b6077546102fb906001600160a01b031681565b6079546102fb906001600160a01b031681565b6102d3610399366004611740565b6108ce565b6102ad606b5481565b6102ad60695481565b6076546102fb906001600160a01b031681565b6074546102fb906001600160a01b031681565b6102ad60725481565b6102ad606a5481565b6102d36103f6366004611740565b61092d565b6102d361098f565b6102ad606c5481565b6073546102fb906001600160a01b031681565b6033546001600160a01b03166102fb565b6078546102fb906001600160a01b031681565b6103206109a3565b6102d36104593660046117d5565b6109cc565b6102ad606d5481565b61047a6104753660046117d5565b610ab7565b604080519283526020830191909152016102b7565b6102d361049d366004611740565b610b23565b6102ad60665481565b6102d3610b5c565b6102ad60675481565b6102ad6303bfc40081565b6065546103209060ff1681565b6102ad6103e881565b6102d36104eb366004611740565b610c0e565b6102d3610c6d565b6102ad60685481565b6102d361050f3660046117d5565b610cde565b6102ad60705481565b6102d361052b3660046117d5565b610d2e565b6102ad610d95565b6102ad610e8b565b6102ad611591565b6102d3610556366004611740565b6115aa565b607a546102fb906001600160a01b031681565b6102ad606481565b6073546001600160a01b031633146105a95760405162461bcd60e51b81526004016105a0906117ee565b60405180910390fd5b607480546001600160a01b0319166001600160a01b0392909216919091179055565b600054610100900460ff16158080156105eb5750600054600160ff909116105b806106055750303b158015610605575060005460ff166001145b6106685760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b60648201526084016105a0565b6000805460ff19166001179055801561068b576000805461ff0019166101001790555b610693611620565b607380546001600160a01b03191633179055601e606c556032606d556103de606655600260675561012c6068556064606955600a606a5560408051637e062a3560e11b815290516001600160a01b0387169163fc0c546a9160048281019260209291908290030181865afa15801561070f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107339190611810565b607680546001600160a01b03199081166001600160a01b039384169081179092556077805482168a8516179055607880548216898516179055607980548216888516179055607a80549091168684161790556040516361347cdd60e11b815291841660048301529063c268f9ba90602401600060405180830381600087803b1580156107be57600080fd5b505af11580156107d2573d6000803e3d6000fd5b50506a01a784379d99db42000000606f5550506065805460ff191660011790558015610838576000805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b505050505050565b60006103e8606754610850610d95565b61085a9190611843565b6108649190611862565b905090565b6073546001600160a01b031633146108935760405162461bcd60e51b81526004016105a0906117ee565b60328111156108b45760405162461bcd60e51b81526004016105a090611884565b606c55565b60006103e8606654606f5461085a9190611843565b6001600160a01b0381166108e157600080fd5b6073546001600160a01b0316331461090b5760405162461bcd60e51b81526004016105a0906117ee565b607780546001600160a01b0319166001600160a01b0392909216919091179055565b607654604051637e51dad560e11b81526001600160a01b0383811660048301529091169063fca3b5aa90602401600060405180830381600087803b15801561097457600080fd5b505af1158015610988573d6000803e3d6000fd5b5050505050565b61099761164f565b6109a160006116a9565b565b6070546000906109b561a8c0826118ab565b42101580156109c6575060715460ff165b91505090565b6075546001600160a01b03163314610a195760405162461bcd60e51b815260206004820152601060248201526f21726566657272616c4164647265737360801b60448201526064016105a0565b80606e6000828254610a2b91906118ab565b90915550506076546040516323b872dd60e01b8152336004820152306024820152604481018390526001600160a01b03909116906323b872dd906064016020604051808303816000875af1158015610a87573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610aab91906118c3565b610ab457600080fd5b50565b600080607254600003610acf57506000928392509050565b606b546000819003610ae45750606954610afe565b606854811015610afe57606a54610afb90826118ab565b90505b60006103e8610b0d8387611843565b610b179190611862565b91959194509092505050565b6073546001600160a01b03163314610b3a57600080fd5b607980546001600160a01b0319166001600160a01b0392909216919091179055565b610b6461164f565b60715460ff1615610ba95760405162461bcd60e51b815260206004820152600f60248201526e105b1c9958591e481cdd185c9d1959608a1b60448201526064016105a0565b61a8c0610bb68142611862565b610bc09190611843565b60708190556071805460ff191660011790556040517ff9f27cb0d471614697655d6ae068b7d5bf89e1532a5c259d7f9c5387d6dcf9e891610c049190815260200190565b60405180910390a1565b6001600160a01b038116610c2157600080fd5b6073546001600160a01b03163314610c4b5760405162461bcd60e51b81526004016105a0906117ee565b607580546001600160a01b0319166001600160a01b0392909216919091179055565b6074546001600160a01b03163314610cba5760405162461bcd60e51b815260206004820152601060248201526f6e6f742070656e64696e67207465616d60801b60448201526064016105a0565b607454607380546001600160a01b0319166001600160a01b03909216919091179055565b6073546001600160a01b03163314610d085760405162461bcd60e51b81526004016105a0906117ee565b6064811115610d295760405162461bcd60e51b81526004016105a090611884565b606d55565b6073546001600160a01b03163314610d585760405162461bcd60e51b81526004016105a0906117ee565b6064610d676103e86096611843565b610d719190611862565b811115610d905760405162461bcd60e51b81526004016105a090611884565b606655565b6076546078546040516370a0823160e01b81526001600160a01b03918216600482015260009291909116906370a0823190602401602060405180830381865afa158015610de6573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e0a91906118e5565b607660009054906101000a90046001600160a01b03166001600160a01b03166318160ddd6040518163ffffffff1660e01b8152600401602060405180830381865afa158015610e5d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e8191906118e5565b61086491906118fe565b607054600090610e9d61a8c0826118ab565b4210158015610eae575060715460ff165b1561158c5761a8c0610ec08142611862565b610eca9190611843565b607081905560655490915060ff16610eec57610ee46108b9565b606f55610ef7565b6065805460ff191690555b6000610f04606f54610ab7565b606b91909155606c54606f549192506000916103e891610f2391611843565b610f2d9190611862565b905060006103e8606d54606f54610f449190611843565b610f4e9190611862565b90506000606e54606f54610f6291906118ab565b90506000828486606e54606f54610f7991906118ab565b610f8391906118fe565b610f8d91906118fe565b610f9791906118fe565b6000606e8190556076546040516370a0823160e01b815230600482015292935090916001600160a01b03909116906370a0823190602401602060405180830381865afa158015610feb573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061100f91906118e5565b9050828110156110a6576076546001600160a01b03166340c10f193061103584876118fe565b6040516001600160e01b031960e085901b1681526001600160a01b03909216600483015260248201526044016020604051808303816000875af1158015611080573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110a491906118c3565b505b600c607254101561119657607a5460405163d34395fb60e01b8152600481018790526001600160a01b039091169063d34395fb90602401600060405180830381600087803b1580156110f757600080fd5b505af115801561110b573d6000803e3d6000fd5b5050607654607a5460405163a9059cbb60e01b81526001600160a01b039182166004820152602481018a90529116925063a9059cbb91506044016020604051808303816000875af1158015611164573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061118891906118c3565b61119157600080fd5b611218565b60765460735460405163a9059cbb60e01b81526001600160a01b0391821660048201526024810188905291169063a9059cbb906044016020604051808303816000875af11580156111eb573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061120f91906118c3565b61121857600080fd5b6075546001600160a01b0316156112ab5760765460755460405163a9059cbb60e01b81526001600160a01b0391821660048201526024810187905291169063a9059cbb906044016020604051808303816000875af115801561127e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906112a291906118c3565b6112ab57600080fd5b60765460795460405163a9059cbb60e01b81526001600160a01b0391821660048201526024810189905291169063a9059cbb906044016020604051808303816000875af1158015611300573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061132491906118c3565b61132d57600080fd5b607960009054906101000a90046001600160a01b03166001600160a01b031663811a40fe6040518163ffffffff1660e01b8152600401600060405180830381600087803b15801561137d57600080fd5b505af1158015611391573d6000803e3d6000fd5b50505050607960009054906101000a90046001600160a01b03166001600160a01b031663b21ed5026040518163ffffffff1660e01b8152600401600060405180830381600087803b1580156113e557600080fd5b505af11580156113f9573d6000803e3d6000fd5b505060765460775460405163095ea7b360e01b81526001600160a01b039182166004820152602481018790529116925063095ea7b391506044016020604051808303816000875af1158015611452573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061147691906118c3565b61147f57600080fd5b607754604051633c6b16ab60e01b8152600481018490526001600160a01b0390911690633c6b16ab90602401600060405180830381600087803b1580156114c557600080fd5b505af11580156114d9573d6000803e3d6000fd5b505050507ff9f27cb0d471614697655d6ae068b7d5bf89e1532a5c259d7f9c5387d6dcf9e88760405161150e91815260200190565b60405180910390a1336001600160a01b03167fb4c03061fb5b7fed76389d5af8f2e0ddb09f8c70d1333abbb62582835e10accb606f5461154c610d95565b611554610840565b6040805193845260208401929092529082015260600160405180910390a260726000815461158190611915565b909155505050505050505b919050565b600061a8c06115a08142611862565b6108649190611843565b6115b261164f565b6001600160a01b0381166116175760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016105a0565b610ab4816116a9565b600054610100900460ff166116475760405162461bcd60e51b81526004016105a09061192e565b6109a16116fb565b6033546001600160a01b031633146109a15760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016105a0565b603380546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b600054610100900460ff166117225760405162461bcd60e51b81526004016105a09061192e565b6109a1336116a9565b6001600160a01b0381168114610ab457600080fd5b60006020828403121561175257600080fd5b813561175d8161172b565b9392505050565b600080600080600060a0868803121561177c57600080fd5b85356117878161172b565b945060208601356117978161172b565b935060408601356117a78161172b565b925060608601356117b78161172b565b915060808601356117c78161172b565b809150509295509295909350565b6000602082840312156117e757600080fd5b5035919050565b6020808252600890820152676e6f74207465616d60c01b604082015260600190565b60006020828403121561182257600080fd5b815161175d8161172b565b634e487b7160e01b600052601160045260246000fd5b600081600019048311821515161561185d5761185d61182d565b500290565b60008261187f57634e487b7160e01b600052601260045260246000fd5b500490565b6020808252600d908201526c0e4c2e8ca40e8dede40d0d2ced609b1b604082015260600190565b600082198211156118be576118be61182d565b500190565b6000602082840312156118d557600080fd5b8151801515811461175d57600080fd5b6000602082840312156118f757600080fd5b5051919050565b6000828210156119105761191061182d565b500390565b6000600182016119275761192761182d565b5060010190565b6020808252602b908201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960408201526a6e697469616c697a696e6760a81b60608201526080019056fea26469706673582212207334176f755df44c0ea429ac7514bc15048180588f1adb2858bbb3f3db95b57564736f6c634300080d0033
Loading...
Loading
Loading...
Loading
Multichain Portfolio | 30 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.