Overview
S Balance
S Value
$0.00More Info
Private Name Tags
ContractCreator
Loading...
Loading
Contract Name:
MultiFeeDistribution
Compiler Version
v0.8.20+commit.a1b79de6
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: MIT pragma solidity ^0.8.16; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol"; import "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol"; import "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol"; import "@openzeppelin/contracts-upgradeable/security/PausableUpgradeable.sol"; contract MultiFeeDistribution is Initializable, OwnableUpgradeable, PausableUpgradeable { using SafeERC20 for IERC20; struct LockedBalance { uint256 amount; uint256 unlockTime; uint256 multiplier; } struct Reward { uint256 rewardPerSecond; uint256 balance; uint256 lastUpdateTime; uint256 periodFinish; } IERC20 public lpToken; address[] public rewardTokens; mapping(address => Reward) public rewardData; mapping(address => mapping(address => uint256)) public rewards; mapping(address => uint256) public userRewardPerTokenPaid; mapping(address => LockedBalance[]) public userLocks; mapping(address => bool) public autoRelockEnabled; mapping(address => uint256) public userPreferredLockPeriod; uint256[] public lockPeriods; uint256[] public multipliers; event RewardAdded(address indexed rewardToken, uint256 rewardAmount, uint256 duration); event Locked(address indexed user, uint256 amount, uint256 unlockTime, uint256 multiplier); event Withdrawn(address indexed user, uint256 amount, uint256 penalty, uint256 totalRewardClaimed); event RewardPaid(address indexed user, address indexed rewardToken, uint256 reward); event AutoRelockSet(address indexed user, bool enabled); event PreferredLockPeriodSet(address indexed user, uint256 lockPeriodIndex); event LpTokenSet(address indexed lpToken); function initialize() public initializer { __Ownable_init(); __Pausable_init(); lockPeriods = [90 days, 180 days, 365 days, 730 days]; multipliers = [150, 200, 300, 500]; } /** * @dev OnlyOwner function to set the LP token. * @param _lpToken The address of the LP token. */ function setLpToken(IERC20 _lpToken) external onlyOwner { require(address(lpToken) == address(0), "LP Token already set"); require(address(_lpToken) != address(0), "Invalid LP Token address"); lpToken = _lpToken; emit LpTokenSet(address(_lpToken)); } function setLockPeriods(uint256[] calldata _lockPeriods) external onlyOwner { require(_lockPeriods.length > 0, "Lock periods cannot be empty"); lockPeriods = _lockPeriods; } function setMultipliers(uint256[] calldata _multipliers) external onlyOwner { require(_multipliers.length > 0, "Multipliers cannot be empty"); require(_multipliers.length == lockPeriods.length, "Mismatch in lengths of lockPeriods and multipliers"); multipliers = _multipliers; } function addRewardSchedule(address rewardToken, uint256 rewardAmount, uint256 duration) external onlyOwner { require(rewardAmount > 0, "Invalid reward amount"); require(duration > 0, "Invalid duration"); IERC20(rewardToken).safeTransferFrom(msg.sender, address(this), rewardAmount); Reward storage r = rewardData[rewardToken]; uint256 remaining = r.periodFinish > block.timestamp ? r.periodFinish - block.timestamp : 0; r.rewardPerSecond = (rewardAmount + remaining * r.rewardPerSecond) / duration; r.balance += rewardAmount; r.periodFinish = block.timestamp + duration; r.lastUpdateTime = block.timestamp; if (r.rewardPerSecond == 0) { rewardTokens.push(rewardToken); } emit RewardAdded(rewardToken, rewardAmount, duration); } function lock(uint256 amount, uint256 lockPeriodIndex) external whenNotPaused { require(amount > 0, "Cannot lock zero"); require(lockPeriodIndex < lockPeriods.length, "Invalid lock period index"); uint256 lockDuration = lockPeriods[lockPeriodIndex]; uint256 multiplier = multipliers[lockPeriodIndex]; uint256 unlockTime = block.timestamp + lockDuration; userLocks[msg.sender].push(LockedBalance(amount, unlockTime, multiplier)); lpToken.safeTransferFrom(msg.sender, address(this), amount); emit Locked(msg.sender, amount, unlockTime, multiplier); } function withdraw(uint256 index) external { require(index < userLocks[msg.sender].length, "Invalid lock index"); LockedBalance memory lockInfo = userLocks[msg.sender][index]; require(lockInfo.amount > 0, "No balance to withdraw"); uint256 amount = lockInfo.amount; uint256 penalty = calculatePenalty(amount, lockInfo.unlockTime); uint256 amountAfterPenalty = amount - penalty; userLocks[msg.sender][index] = userLocks[msg.sender][userLocks[msg.sender].length - 1]; userLocks[msg.sender].pop(); if (penalty > 0) { redistributePenaltyToRewards(penalty); } uint256 totalRewardClaimed = _claimRewardsWithPenalty(msg.sender, lockInfo.unlockTime); lpToken.safeTransfer(msg.sender, amountAfterPenalty); emit Withdrawn(msg.sender, amountAfterPenalty, penalty, totalRewardClaimed); } function _claimRewardsWithPenalty(address user, uint256 unlockTime) internal returns (uint256 totalClaimed) { uint256 length = rewardTokens.length; for (uint256 i = 0; i < length; i++) { address token = rewardTokens[i]; uint256 claimable = _calculateClaimableReward(user, token); if (unlockTime > block.timestamp) { uint256 penalty = calculatePenalty(claimable, unlockTime); claimable -= penalty; } if (claimable > 0) { rewards[user][token] = 0; rewardData[token].balance -= claimable; IERC20(token).safeTransfer(user, claimable); totalClaimed += claimable; emit RewardPaid(user, token, claimable); } } } function calculatePenalty(uint256 amount, uint256 unlockTime) public view returns (uint256 penaltyAmount) { if (block.timestamp >= unlockTime) { return 0; } uint256 remainingTime = unlockTime - block.timestamp; uint256 totalLockTime = unlockTime - (unlockTime - lockPeriods[0]); uint256 penaltyRate = (remainingTime * 6500) / totalLockTime + 2500; penaltyAmount = (amount * penaltyRate) / 10000; } function redistributePenaltyToRewards(uint256 penaltyAmount) internal { uint256 length = rewardTokens.length; for (uint256 i = 0; i < length; i++) { address token = rewardTokens[i]; Reward storage r = rewardData[token]; r.balance += penaltyAmount; uint256 remainingTime = r.periodFinish > block.timestamp ? r.periodFinish - block.timestamp : 0; if (remainingTime > 0) { r.rewardPerSecond = r.balance / remainingTime; } } } function getClaimableRewards(address user) external view returns (address[] memory tokens, uint256[] memory amounts) { uint256 length = rewardTokens.length; tokens = new address[](length); amounts = new uint256[](length); for (uint256 i = 0; i < length; i++) { address token = rewardTokens[i]; tokens[i] = token; amounts[i] = _calculateClaimableReward(user, token); } } function _calculateClaimableReward(address user, address token) internal view returns (uint256 claimable) { Reward storage r = rewardData[token]; uint256 rewardRate = r.rewardPerSecond; uint256 totalReward = rewardRate * (block.timestamp - r.lastUpdateTime); uint256 userMultiplier = getUserMultiplier(user); uint256 totalMultiplier = getTotalMultiplier(); uint256 baseReward = (totalReward * userMultiplier) / totalMultiplier; claimable = rewards[user][token] + baseReward; } function getUserMultiplier(address user) internal view returns (uint256 multiplier) { LockedBalance[] memory locks = userLocks[user]; for (uint256 i = 0; i < locks.length; i++) { multiplier += locks[i].amount * locks[i].multiplier; } } function getTotalMultiplier() internal view returns (uint256 totalMultiplier) { for (uint256 i = 0; i < lockPeriods.length; i++) { totalMultiplier += multipliers[i]; } } function configureAutoRelock(bool enabled, uint256 lockPeriodIndex) external { if (enabled) { require(lockPeriodIndex < lockPeriods.length, "Invalid lock period"); userPreferredLockPeriod[msg.sender] = lockPeriodIndex; emit PreferredLockPeriodSet(msg.sender, lockPeriodIndex); } autoRelockEnabled[msg.sender] = enabled; emit AutoRelockSet(msg.sender, enabled); } function autoRelock(address user) external whenNotPaused { require(autoRelockEnabled[user], "AutoRelock not enabled"); LockedBalance[] memory locks = userLocks[user]; for (uint256 i = 0; i < locks.length; i++) { if (locks[i].unlockTime <= block.timestamp) { uint256 lockPeriodIndex = userPreferredLockPeriod[user]; uint256 lockDuration = lockPeriods[lockPeriodIndex]; uint256 multiplier = multipliers[lockPeriodIndex]; userLocks[user][i].unlockTime = block.timestamp + lockDuration; userLocks[user][i].multiplier = multiplier; } } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.9.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. 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); } /** * @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.9.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] * ```solidity * 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 Returns the highest version that has been initialized. See {reinitializer}. */ function _getInitializedVersion() internal view returns (uint8) { return _initialized; } /** * @dev Returns `true` if the contract is currently initializing. See {onlyInitializing}. */ function _isInitializing() internal view returns (bool) { return _initializing; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.7.0) (security/Pausable.sol) pragma solidity ^0.8.0; import "../utils/ContextUpgradeable.sol"; import "../proxy/utils/Initializable.sol"; /** * @dev Contract module which allows children to implement an emergency stop * mechanism that can be triggered by an authorized account. * * This module is used through inheritance. It will make available the * modifiers `whenNotPaused` and `whenPaused`, which can be applied to * the functions of your contract. Note that they will not be pausable by * simply including this module, only once the modifiers are put in place. */ abstract contract PausableUpgradeable is Initializable, ContextUpgradeable { /** * @dev Emitted when the pause is triggered by `account`. */ event Paused(address account); /** * @dev Emitted when the pause is lifted by `account`. */ event Unpaused(address account); bool private _paused; /** * @dev Initializes the contract in unpaused state. */ function __Pausable_init() internal onlyInitializing { __Pausable_init_unchained(); } function __Pausable_init_unchained() internal onlyInitializing { _paused = false; } /** * @dev Modifier to make a function callable only when the contract is not paused. * * Requirements: * * - The contract must not be paused. */ modifier whenNotPaused() { _requireNotPaused(); _; } /** * @dev Modifier to make a function callable only when the contract is paused. * * Requirements: * * - The contract must be paused. */ modifier whenPaused() { _requirePaused(); _; } /** * @dev Returns true if the contract is paused, and false otherwise. */ function paused() public view virtual returns (bool) { return _paused; } /** * @dev Throws if the contract is paused. */ function _requireNotPaused() internal view virtual { require(!paused(), "Pausable: paused"); } /** * @dev Throws if the contract is not paused. */ function _requirePaused() internal view virtual { require(paused(), "Pausable: not paused"); } /** * @dev Triggers stopped state. * * Requirements: * * - The contract must not be paused. */ function _pause() internal virtual whenNotPaused { _paused = true; emit Paused(_msgSender()); } /** * @dev Returns to normal state. * * Requirements: * * - The contract must be paused. */ function _unpause() internal virtual whenPaused { _paused = false; emit Unpaused(_msgSender()); } /** * @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.9.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 * * 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; 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 // 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.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.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); } } }
{ "evmVersion": "shanghai", "libraries": {}, "metadata": { "bytecodeHash": "ipfs", "useLiteralContent": true }, "optimizer": { "enabled": true, "runs": 200 }, "remappings": [], "outputSelection": { "*": { "*": [ "evm.bytecode", "evm.deployedBytecode", "devdoc", "userdoc", "metadata", "abi" ] } } }
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
[{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":false,"internalType":"bool","name":"enabled","type":"bool"}],"name":"AutoRelockSet","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":"user","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"unlockTime","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"multiplier","type":"uint256"}],"name":"Locked","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"lpToken","type":"address"}],"name":"LpTokenSet","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"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"account","type":"address"}],"name":"Paused","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":false,"internalType":"uint256","name":"lockPeriodIndex","type":"uint256"}],"name":"PreferredLockPeriodSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"rewardToken","type":"address"},{"indexed":false,"internalType":"uint256","name":"rewardAmount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"duration","type":"uint256"}],"name":"RewardAdded","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":true,"internalType":"address","name":"rewardToken","type":"address"},{"indexed":false,"internalType":"uint256","name":"reward","type":"uint256"}],"name":"RewardPaid","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"account","type":"address"}],"name":"Unpaused","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"penalty","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"totalRewardClaimed","type":"uint256"}],"name":"Withdrawn","type":"event"},{"inputs":[{"internalType":"address","name":"rewardToken","type":"address"},{"internalType":"uint256","name":"rewardAmount","type":"uint256"},{"internalType":"uint256","name":"duration","type":"uint256"}],"name":"addRewardSchedule","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"user","type":"address"}],"name":"autoRelock","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"autoRelockEnabled","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"uint256","name":"unlockTime","type":"uint256"}],"name":"calculatePenalty","outputs":[{"internalType":"uint256","name":"penaltyAmount","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bool","name":"enabled","type":"bool"},{"internalType":"uint256","name":"lockPeriodIndex","type":"uint256"}],"name":"configureAutoRelock","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"user","type":"address"}],"name":"getClaimableRewards","outputs":[{"internalType":"address[]","name":"tokens","type":"address[]"},{"internalType":"uint256[]","name":"amounts","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"initialize","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"uint256","name":"lockPeriodIndex","type":"uint256"}],"name":"lock","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"lockPeriods","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"lpToken","outputs":[{"internalType":"contract IERC20","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"multipliers","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"paused","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"rewardData","outputs":[{"internalType":"uint256","name":"rewardPerSecond","type":"uint256"},{"internalType":"uint256","name":"balance","type":"uint256"},{"internalType":"uint256","name":"lastUpdateTime","type":"uint256"},{"internalType":"uint256","name":"periodFinish","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"rewardTokens","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"address","name":"","type":"address"}],"name":"rewards","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256[]","name":"_lockPeriods","type":"uint256[]"}],"name":"setLockPeriods","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract IERC20","name":"_lpToken","type":"address"}],"name":"setLpToken","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256[]","name":"_multipliers","type":"uint256[]"}],"name":"setMultipliers","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"uint256","name":"","type":"uint256"}],"name":"userLocks","outputs":[{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"uint256","name":"unlockTime","type":"uint256"},{"internalType":"uint256","name":"multiplier","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"userPreferredLockPeriod","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"userRewardPerTokenPaid","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"index","type":"uint256"}],"name":"withdraw","outputs":[],"stateMutability":"nonpayable","type":"function"}]
Contract Creation Code
608060405234801561000f575f80fd5b506120f48061001d5f395ff3fe608060405234801561000f575f80fd5b506004361061016d575f3560e01c8063715018a6116100d95780639ee933b511610093578063cda9707a1161006e578063cda9707a146103a6578063e70b9e27146103c5578063f2fde38b146103ef578063f5d8771414610402575f80fd5b80639ee933b514610352578063aa33fedb14610365578063ac7fc26314610393575f80fd5b8063715018a6146102ec57806372282381146102f45780637bb7bed1146103075780638129fc1c1461031a5780638b876347146103225780638da5cb5b14610341575f80fd5b806348e5d9f81161012a57806348e5d9f81461020a5780634c8f2a781461025e57806359591a33146102715780635af29e2d146102845780635c975abb146102b65780635fcbd285146102c1575f80fd5b80630b4d2c85146101715780631338736f14610186578063180d019d146101995780632e1a7d4d146101ac578063308e401e146101bf5780633e793232146101e9575b5f80fd5b61018461017f366004611d0b565b610415565b005b610184610194366004611d7a565b610480565b6101846101a7366004611dae565b61061b565b6101846101ba366004611dd0565b610839565b6101d26101cd366004611dae565b610aaa565b6040516101e0929190611de7565b60405180910390f35b6101fc6101f7366004611d7a565b610beb565b6040519081526020016101e0565b61023e610218366004611dae565b60996020525f908152604090208054600182015460028301546003909301549192909184565b6040805194855260208501939093529183015260608201526080016101e0565b6101fc61026c366004611dd0565b610c84565b61018461027f366004611e69565b610ca3565b6102a6610292366004611dae565b609d6020525f908152604090205460ff1681565b60405190151581526020016101e0565b60655460ff166102a6565b6097546102d4906001600160a01b031681565b6040516001600160a01b0390911681526020016101e0565b610184610e70565b610184610302366004611d0b565b610e83565b6102d4610315366004611dd0565b610f50565b610184610f78565b6101fc610330366004611dae565b609b6020525f908152604090205481565b6033546001600160a01b03166102d4565b610184610360366004611dae565b6110ff565b610378610373366004611e9b565b6111f6565b604080519384526020840192909252908201526060016101e0565b6101fc6103a1366004611dd0565b611234565b6101fc6103b4366004611dae565b609e6020525f908152604090205481565b6101fc6103d3366004611ec5565b609a60209081525f928352604080842090915290825290205481565b6101846103fd366004611dae565b611243565b610184610410366004611f09565b6112b9565b61041d6113a7565b8061046f5760405162461bcd60e51b815260206004820152601c60248201527f4c6f636b20706572696f64732063616e6e6f7420626520656d7074790000000060448201526064015b60405180910390fd5b61047b609f8383611c32565b505050565b610488611401565b5f82116104ca5760405162461bcd60e51b815260206004820152601060248201526f43616e6e6f74206c6f636b207a65726f60801b6044820152606401610466565b609f54811061051b5760405162461bcd60e51b815260206004820152601960248201527f496e76616c6964206c6f636b20706572696f6420696e646578000000000000006044820152606401610466565b5f609f828154811061052f5761052f611f25565b905f5260205f20015490505f60a0838154811061054e5761054e611f25565b5f91825260208220015491506105648342611f4d565b335f818152609c6020908152604080832081516060810183528b815280840187815292810189815282546001818101855593875294909520905160039094020192835590519082015590516002909101556097549192506105d0916001600160a01b0316903088611447565b604080518681526020810183905290810183905233907f44cebfefa4561bee5b61d675ccfd8dc9969fff9cc15e7a4eccccd62af94f9c11906060015b60405180910390a25050505050565b610623611401565b6001600160a01b0381165f908152609d602052604090205460ff166106835760405162461bcd60e51b8152602060048201526016602482015275105d5d1bd4995b1bd8dac81b9bdd08195b98589b195960521b6044820152606401610466565b6001600160a01b0381165f908152609c6020908152604080832080548251818502810185019093528083529192909190849084015b82821015610705578382905f5260205f2090600302016040518060600160405290815f820154815260200160018201548152602001600282015481525050815260200190600101906106b8565b5050505090505f5b815181101561047b574282828151811061072957610729611f25565b60200260200101516020015111610827576001600160a01b0383165f908152609e6020526040812054609f80549192918390811061076957610769611f25565b905f5260205f20015490505f60a0838154811061078857610788611f25565b905f5260205f2001549050814261079f9190611f4d565b6001600160a01b0387165f908152609c602052604090208054869081106107c8576107c8611f25565b905f5260205f2090600302016001018190555080609c5f886001600160a01b03166001600160a01b031681526020019081526020015f20858154811061081057610810611f25565b905f5260205f209060030201600201819055505050505b8061083181611f60565b91505061070d565b335f908152609c6020526040902054811061088b5760405162461bcd60e51b8152602060048201526012602482015271092dcecc2d8d2c840d8dec6d640d2dcc8caf60731b6044820152606401610466565b335f908152609c602052604081208054839081106108ab576108ab611f25565b905f5260205f2090600302016040518060600160405290815f82015481526020016001820154815260200160028201548152505090505f815f01511161092c5760405162461bcd60e51b81526020600482015260166024820152754e6f2062616c616e636520746f20776974686472617760501b6044820152606401610466565b805160208201515f90610940908390610beb565b90505f61094d8284611f78565b335f908152609c6020526040902080549192509061096d90600190611f78565b8154811061097d5761097d611f25565b905f5260205f209060030201609c5f336001600160a01b03166001600160a01b031681526020019081526020015f2086815481106109bd576109bd611f25565b5f91825260208083208454600390930201918255600180850154908301556002938401549390910192909255338152609c90915260409020805480610a0457610a04611f8b565b5f8281526020812060035f1990930192830201818155600181018290556002015590558115610a3657610a36826114b8565b5f610a4533866020015161156d565b609754909150610a5f906001600160a01b031633846116ae565b604080518381526020810185905290810182905233907f75e161b3e824b114fc1a33274bd7091918dd4e639cede50b78b15a4eea956a219060600160405180910390a2505050505050565b60985460609081908067ffffffffffffffff811115610acb57610acb611f9f565b604051908082528060200260200182016040528015610af4578160200160208202803683370190505b5092508067ffffffffffffffff811115610b1057610b10611f9f565b604051908082528060200260200182016040528015610b39578160200160208202803683370190505b5091505f5b81811015610be4575f60988281548110610b5a57610b5a611f25565b905f5260205f20015f9054906101000a90046001600160a01b0316905080858381518110610b8a57610b8a611f25565b60200260200101906001600160a01b031690816001600160a01b031681525050610bb486826116de565b848381518110610bc657610bc6611f25565b60209081029190910101525080610bdc81611f60565b915050610b3e565b5050915091565b5f814210610bfa57505f610c7e565b5f610c054284611f78565b90505f609f5f81548110610c1b57610c1b611f25565b905f5260205f20015484610c2f9190611f78565b610c399085611f78565b90505f81610c4984611964611fb3565b610c539190611fca565b610c5f906109c4611f4d565b9050612710610c6e8288611fb3565b610c789190611fca565b93505050505b92915050565b609f8181548110610c93575f80fd5b5f91825260209091200154905081565b610cab6113a7565b5f8211610cf25760405162461bcd60e51b8152602060048201526015602482015274125b9d985b1a59081c995dd85c9908185b5bdd5b9d605a1b6044820152606401610466565b5f8111610d345760405162461bcd60e51b815260206004820152601060248201526f24b73b30b634b210323ab930ba34b7b760811b6044820152606401610466565b610d496001600160a01b038416333085611447565b6001600160a01b0383165f90815260996020526040812060038101549091904210610d74575f610d84565b428260030154610d849190611f78565b82549091508390610d959083611fb3565b610d9f9086611f4d565b610da99190611fca565b82556001820180548591905f90610dc1908490611f4d565b90915550610dd190508342611f4d565b600383015542600283015581545f03610e2f57609880546001810182555f919091527f2237a976fa961f5921fd19f2b03c925c725d77b20ce8f790c19709c03de4d8140180546001600160a01b0319166001600160a01b0387161790555b60408051858152602081018590526001600160a01b038716917f6a6f77044107a33658235d41bedbbaf2fe9ccdceb313143c947a5e76e1ec8474910161060c565b610e786113a7565b610e815f611781565b565b610e8b6113a7565b80610ed85760405162461bcd60e51b815260206004820152601b60248201527f4d756c7469706c696572732063616e6e6f7420626520656d70747900000000006044820152606401610466565b609f548114610f445760405162461bcd60e51b815260206004820152603260248201527f4d69736d6174636820696e206c656e67746873206f66206c6f636b506572696f604482015271647320616e64206d756c7469706c6965727360701b6064820152608401610466565b61047b60a08383611c32565b60988181548110610f5f575f80fd5b5f918252602090912001546001600160a01b0316905081565b5f54610100900460ff1615808015610f9657505f54600160ff909116105b80610faf5750303b158015610faf57505f5460ff166001145b6110125760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b6064820152608401610466565b5f805460ff191660011790558015611033575f805461ff0019166101001790555b61103b6117d2565b611043611800565b604080516080810182526276a700815262ed4e0060208201526301e13380918101919091526303c26700606082015261108090609f906004611c77565b50604080516080810182526096815260c8602082015261012c918101919091526101f460608201526110b69060a0906004611cb8565b5080156110fc575f805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b50565b6111076113a7565b6097546001600160a01b0316156111575760405162461bcd60e51b8152602060048201526014602482015273131408151bdad95b88185b1c9958591e481cd95d60621b6044820152606401610466565b6001600160a01b0381166111ad5760405162461bcd60e51b815260206004820152601860248201527f496e76616c6964204c5020546f6b656e206164647265737300000000000000006044820152606401610466565b609780546001600160a01b0319166001600160a01b0383169081179091556040517f1c1820b4910e7e24202fa882184fde52e795a3113b621ded50b099b270159acc905f90a250565b609c602052815f5260405f20818154811061120f575f80fd5b5f91825260209091206003909102018054600182015460029092015490935090915083565b60a08181548110610c93575f80fd5b61124b6113a7565b6001600160a01b0381166112b05760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610466565b6110fc81611781565b811561135257609f5481106113065760405162461bcd60e51b8152602060048201526013602482015272125b9d985b1a59081b1bd8dac81c195c9a5bd9606a1b6044820152606401610466565b335f818152609e602052604090819020839055517f069a01427230a7554b7b6798d4584c3acd1e5a8c3899bba47391e0fa3e82128e906113499084815260200190565b60405180910390a25b335f818152609d6020908152604091829020805460ff191686151590811790915591519182527f9cc217920419230cfc407b870a921074a0c3ccea5f613b1bbad28f56d8fb3d6f910160405180910390a25050565b6033546001600160a01b03163314610e815760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610466565b60655460ff1615610e815760405162461bcd60e51b815260206004820152601060248201526f14185d5cd8589b194e881c185d5cd95960821b6044820152606401610466565b6040516001600160a01b03808516602483015283166044820152606481018290526114b29085906323b872dd60e01b906084015b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b03199093169290921790915261182e565b50505050565b6098545f5b8181101561047b575f609882815481106114d9576114d9611f25565b5f9182526020808320909101546001600160a01b031680835260999091526040822060018101805492945090928792611513908490611f4d565b925050819055505f4282600301541161152c575f61153c565b42826003015461153c9190611f78565b90508015611557578082600101546115549190611fca565b82555b505050808061156590611f60565b9150506114bd565b6098545f90815b818110156116a6575f6098828154811061159057611590611f25565b5f9182526020822001546001600160a01b031691506115af87836116de565b9050428611156115d4575f6115c48288610beb565b90506115d08183611f78565b9150505b8015611691576001600160a01b038088165f908152609a60209081526040808320938616835292815282822082905560999052908120600101805483929061161d908490611f78565b9091555061163790506001600160a01b03831688836116ae565b6116418186611f4d565b9450816001600160a01b0316876001600160a01b03167f540798df468d7b23d11f156fdb954cb19ad414d150722a7b6d55ba369dea792e8360405161168891815260200190565b60405180910390a35b5050808061169e90611f60565b915050611574565b505092915050565b6040516001600160a01b03831660248201526044810182905261047b90849063a9059cbb60e01b9060640161147b565b6001600160a01b0381165f9081526099602052604081208054600282015483906117089042611f78565b6117129083611fb3565b90505f61171e87611901565b90505f6117296119fb565b90505f816117378486611fb3565b6117419190611fca565b6001600160a01b03808b165f908152609a60209081526040808320938d1683529290522054909150611774908290611f4d565b9998505050505050505050565b603380546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0905f90a35050565b5f54610100900460ff166117f85760405162461bcd60e51b815260040161046690611fe9565b610e81611a47565b5f54610100900460ff166118265760405162461bcd60e51b815260040161046690611fe9565b610e81611a76565b5f611882826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b0316611aa89092919063ffffffff16565b905080515f14806118a25750808060200190518101906118a29190612034565b61047b5760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b6064820152608401610466565b6001600160a01b0381165f908152609c6020908152604080832080548251818502810185019093528083528493849084015b82821015611980578382905f5260205f2090600302016040518060600160405290815f82015481526020016001820154815260200160028201548152505081526020019060010190611933565b5050505090505f5b81518110156119f4578181815181106119a3576119a3611f25565b6020026020010151604001518282815181106119c1576119c1611f25565b60200260200101515f01516119d69190611fb3565b6119e09084611f4d565b9250806119ec81611f60565b915050611988565b5050919050565b5f805b609f54811015611a435760a08181548110611a1b57611a1b611f25565b905f5260205f20015482611a2f9190611f4d565b915080611a3b81611f60565b9150506119fe565b5090565b5f54610100900460ff16611a6d5760405162461bcd60e51b815260040161046690611fe9565b610e8133611781565b5f54610100900460ff16611a9c5760405162461bcd60e51b815260040161046690611fe9565b6065805460ff19169055565b6060611ab684845f85611abe565b949350505050565b606082471015611b1f5760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f6044820152651c8818d85b1b60d21b6064820152608401610466565b5f80866001600160a01b03168587604051611b3a9190612071565b5f6040518083038185875af1925050503d805f8114611b74576040519150601f19603f3d011682016040523d82523d5f602084013e611b79565b606091505b5091509150611b8a87838387611b95565b979650505050505050565b60608315611c035782515f03611bfc576001600160a01b0385163b611bfc5760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401610466565b5081611ab6565b611ab68383815115611c185781518083602001fd5b8060405162461bcd60e51b8152600401610466919061208c565b828054828255905f5260205f20908101928215611c6b579160200282015b82811115611c6b578235825591602001919060010190611c50565b50611a43929150611cf7565b828054828255905f5260205f20908101928215611c6b579160200282015b82811115611c6b578251829063ffffffff16905591602001919060010190611c95565b828054828255905f5260205f20908101928215611c6b579160200282015b82811115611c6b578251829061ffff16905591602001919060010190611cd6565b5b80821115611a43575f8155600101611cf8565b5f8060208385031215611d1c575f80fd5b823567ffffffffffffffff80821115611d33575f80fd5b818501915085601f830112611d46575f80fd5b813581811115611d54575f80fd5b8660208260051b8501011115611d68575f80fd5b60209290920196919550909350505050565b5f8060408385031215611d8b575f80fd5b50508035926020909101359150565b6001600160a01b03811681146110fc575f80fd5b5f60208284031215611dbe575f80fd5b8135611dc981611d9a565b9392505050565b5f60208284031215611de0575f80fd5b5035919050565b604080825283519082018190525f906020906060840190828701845b82811015611e285781516001600160a01b031684529284019290840190600101611e03565b505050838103828501528451808252858301918301905f5b81811015611e5c57835183529284019291840191600101611e40565b5090979650505050505050565b5f805f60608486031215611e7b575f80fd5b8335611e8681611d9a565b95602085013595506040909401359392505050565b5f8060408385031215611eac575f80fd5b8235611eb781611d9a565b946020939093013593505050565b5f8060408385031215611ed6575f80fd5b8235611ee181611d9a565b91506020830135611ef181611d9a565b809150509250929050565b80151581146110fc575f80fd5b5f8060408385031215611f1a575f80fd5b8235611eb781611efc565b634e487b7160e01b5f52603260045260245ffd5b634e487b7160e01b5f52601160045260245ffd5b80820180821115610c7e57610c7e611f39565b5f60018201611f7157611f71611f39565b5060010190565b81810381811115610c7e57610c7e611f39565b634e487b7160e01b5f52603160045260245ffd5b634e487b7160e01b5f52604160045260245ffd5b8082028115828204841417610c7e57610c7e611f39565b5f82611fe457634e487b7160e01b5f52601260045260245ffd5b500490565b6020808252602b908201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960408201526a6e697469616c697a696e6760a81b606082015260800190565b5f60208284031215612044575f80fd5b8151611dc981611efc565b5f5b83811015612069578181015183820152602001612051565b50505f910152565b5f825161208281846020870161204f565b9190910192915050565b602081525f82518060208401526120aa81604085016020870161204f565b601f01601f1916919091016040019291505056fea2646970667358221220afd207f29ca9f27e49111f17f6fcae9cdcb2df2ecd7cf000dcd4884bb50d33b564736f6c63430008140033
Deployed Bytecode
0x608060405234801561000f575f80fd5b506004361061016d575f3560e01c8063715018a6116100d95780639ee933b511610093578063cda9707a1161006e578063cda9707a146103a6578063e70b9e27146103c5578063f2fde38b146103ef578063f5d8771414610402575f80fd5b80639ee933b514610352578063aa33fedb14610365578063ac7fc26314610393575f80fd5b8063715018a6146102ec57806372282381146102f45780637bb7bed1146103075780638129fc1c1461031a5780638b876347146103225780638da5cb5b14610341575f80fd5b806348e5d9f81161012a57806348e5d9f81461020a5780634c8f2a781461025e57806359591a33146102715780635af29e2d146102845780635c975abb146102b65780635fcbd285146102c1575f80fd5b80630b4d2c85146101715780631338736f14610186578063180d019d146101995780632e1a7d4d146101ac578063308e401e146101bf5780633e793232146101e9575b5f80fd5b61018461017f366004611d0b565b610415565b005b610184610194366004611d7a565b610480565b6101846101a7366004611dae565b61061b565b6101846101ba366004611dd0565b610839565b6101d26101cd366004611dae565b610aaa565b6040516101e0929190611de7565b60405180910390f35b6101fc6101f7366004611d7a565b610beb565b6040519081526020016101e0565b61023e610218366004611dae565b60996020525f908152604090208054600182015460028301546003909301549192909184565b6040805194855260208501939093529183015260608201526080016101e0565b6101fc61026c366004611dd0565b610c84565b61018461027f366004611e69565b610ca3565b6102a6610292366004611dae565b609d6020525f908152604090205460ff1681565b60405190151581526020016101e0565b60655460ff166102a6565b6097546102d4906001600160a01b031681565b6040516001600160a01b0390911681526020016101e0565b610184610e70565b610184610302366004611d0b565b610e83565b6102d4610315366004611dd0565b610f50565b610184610f78565b6101fc610330366004611dae565b609b6020525f908152604090205481565b6033546001600160a01b03166102d4565b610184610360366004611dae565b6110ff565b610378610373366004611e9b565b6111f6565b604080519384526020840192909252908201526060016101e0565b6101fc6103a1366004611dd0565b611234565b6101fc6103b4366004611dae565b609e6020525f908152604090205481565b6101fc6103d3366004611ec5565b609a60209081525f928352604080842090915290825290205481565b6101846103fd366004611dae565b611243565b610184610410366004611f09565b6112b9565b61041d6113a7565b8061046f5760405162461bcd60e51b815260206004820152601c60248201527f4c6f636b20706572696f64732063616e6e6f7420626520656d7074790000000060448201526064015b60405180910390fd5b61047b609f8383611c32565b505050565b610488611401565b5f82116104ca5760405162461bcd60e51b815260206004820152601060248201526f43616e6e6f74206c6f636b207a65726f60801b6044820152606401610466565b609f54811061051b5760405162461bcd60e51b815260206004820152601960248201527f496e76616c6964206c6f636b20706572696f6420696e646578000000000000006044820152606401610466565b5f609f828154811061052f5761052f611f25565b905f5260205f20015490505f60a0838154811061054e5761054e611f25565b5f91825260208220015491506105648342611f4d565b335f818152609c6020908152604080832081516060810183528b815280840187815292810189815282546001818101855593875294909520905160039094020192835590519082015590516002909101556097549192506105d0916001600160a01b0316903088611447565b604080518681526020810183905290810183905233907f44cebfefa4561bee5b61d675ccfd8dc9969fff9cc15e7a4eccccd62af94f9c11906060015b60405180910390a25050505050565b610623611401565b6001600160a01b0381165f908152609d602052604090205460ff166106835760405162461bcd60e51b8152602060048201526016602482015275105d5d1bd4995b1bd8dac81b9bdd08195b98589b195960521b6044820152606401610466565b6001600160a01b0381165f908152609c6020908152604080832080548251818502810185019093528083529192909190849084015b82821015610705578382905f5260205f2090600302016040518060600160405290815f820154815260200160018201548152602001600282015481525050815260200190600101906106b8565b5050505090505f5b815181101561047b574282828151811061072957610729611f25565b60200260200101516020015111610827576001600160a01b0383165f908152609e6020526040812054609f80549192918390811061076957610769611f25565b905f5260205f20015490505f60a0838154811061078857610788611f25565b905f5260205f2001549050814261079f9190611f4d565b6001600160a01b0387165f908152609c602052604090208054869081106107c8576107c8611f25565b905f5260205f2090600302016001018190555080609c5f886001600160a01b03166001600160a01b031681526020019081526020015f20858154811061081057610810611f25565b905f5260205f209060030201600201819055505050505b8061083181611f60565b91505061070d565b335f908152609c6020526040902054811061088b5760405162461bcd60e51b8152602060048201526012602482015271092dcecc2d8d2c840d8dec6d640d2dcc8caf60731b6044820152606401610466565b335f908152609c602052604081208054839081106108ab576108ab611f25565b905f5260205f2090600302016040518060600160405290815f82015481526020016001820154815260200160028201548152505090505f815f01511161092c5760405162461bcd60e51b81526020600482015260166024820152754e6f2062616c616e636520746f20776974686472617760501b6044820152606401610466565b805160208201515f90610940908390610beb565b90505f61094d8284611f78565b335f908152609c6020526040902080549192509061096d90600190611f78565b8154811061097d5761097d611f25565b905f5260205f209060030201609c5f336001600160a01b03166001600160a01b031681526020019081526020015f2086815481106109bd576109bd611f25565b5f91825260208083208454600390930201918255600180850154908301556002938401549390910192909255338152609c90915260409020805480610a0457610a04611f8b565b5f8281526020812060035f1990930192830201818155600181018290556002015590558115610a3657610a36826114b8565b5f610a4533866020015161156d565b609754909150610a5f906001600160a01b031633846116ae565b604080518381526020810185905290810182905233907f75e161b3e824b114fc1a33274bd7091918dd4e639cede50b78b15a4eea956a219060600160405180910390a2505050505050565b60985460609081908067ffffffffffffffff811115610acb57610acb611f9f565b604051908082528060200260200182016040528015610af4578160200160208202803683370190505b5092508067ffffffffffffffff811115610b1057610b10611f9f565b604051908082528060200260200182016040528015610b39578160200160208202803683370190505b5091505f5b81811015610be4575f60988281548110610b5a57610b5a611f25565b905f5260205f20015f9054906101000a90046001600160a01b0316905080858381518110610b8a57610b8a611f25565b60200260200101906001600160a01b031690816001600160a01b031681525050610bb486826116de565b848381518110610bc657610bc6611f25565b60209081029190910101525080610bdc81611f60565b915050610b3e565b5050915091565b5f814210610bfa57505f610c7e565b5f610c054284611f78565b90505f609f5f81548110610c1b57610c1b611f25565b905f5260205f20015484610c2f9190611f78565b610c399085611f78565b90505f81610c4984611964611fb3565b610c539190611fca565b610c5f906109c4611f4d565b9050612710610c6e8288611fb3565b610c789190611fca565b93505050505b92915050565b609f8181548110610c93575f80fd5b5f91825260209091200154905081565b610cab6113a7565b5f8211610cf25760405162461bcd60e51b8152602060048201526015602482015274125b9d985b1a59081c995dd85c9908185b5bdd5b9d605a1b6044820152606401610466565b5f8111610d345760405162461bcd60e51b815260206004820152601060248201526f24b73b30b634b210323ab930ba34b7b760811b6044820152606401610466565b610d496001600160a01b038416333085611447565b6001600160a01b0383165f90815260996020526040812060038101549091904210610d74575f610d84565b428260030154610d849190611f78565b82549091508390610d959083611fb3565b610d9f9086611f4d565b610da99190611fca565b82556001820180548591905f90610dc1908490611f4d565b90915550610dd190508342611f4d565b600383015542600283015581545f03610e2f57609880546001810182555f919091527f2237a976fa961f5921fd19f2b03c925c725d77b20ce8f790c19709c03de4d8140180546001600160a01b0319166001600160a01b0387161790555b60408051858152602081018590526001600160a01b038716917f6a6f77044107a33658235d41bedbbaf2fe9ccdceb313143c947a5e76e1ec8474910161060c565b610e786113a7565b610e815f611781565b565b610e8b6113a7565b80610ed85760405162461bcd60e51b815260206004820152601b60248201527f4d756c7469706c696572732063616e6e6f7420626520656d70747900000000006044820152606401610466565b609f548114610f445760405162461bcd60e51b815260206004820152603260248201527f4d69736d6174636820696e206c656e67746873206f66206c6f636b506572696f604482015271647320616e64206d756c7469706c6965727360701b6064820152608401610466565b61047b60a08383611c32565b60988181548110610f5f575f80fd5b5f918252602090912001546001600160a01b0316905081565b5f54610100900460ff1615808015610f9657505f54600160ff909116105b80610faf5750303b158015610faf57505f5460ff166001145b6110125760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b6064820152608401610466565b5f805460ff191660011790558015611033575f805461ff0019166101001790555b61103b6117d2565b611043611800565b604080516080810182526276a700815262ed4e0060208201526301e13380918101919091526303c26700606082015261108090609f906004611c77565b50604080516080810182526096815260c8602082015261012c918101919091526101f460608201526110b69060a0906004611cb8565b5080156110fc575f805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b50565b6111076113a7565b6097546001600160a01b0316156111575760405162461bcd60e51b8152602060048201526014602482015273131408151bdad95b88185b1c9958591e481cd95d60621b6044820152606401610466565b6001600160a01b0381166111ad5760405162461bcd60e51b815260206004820152601860248201527f496e76616c6964204c5020546f6b656e206164647265737300000000000000006044820152606401610466565b609780546001600160a01b0319166001600160a01b0383169081179091556040517f1c1820b4910e7e24202fa882184fde52e795a3113b621ded50b099b270159acc905f90a250565b609c602052815f5260405f20818154811061120f575f80fd5b5f91825260209091206003909102018054600182015460029092015490935090915083565b60a08181548110610c93575f80fd5b61124b6113a7565b6001600160a01b0381166112b05760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610466565b6110fc81611781565b811561135257609f5481106113065760405162461bcd60e51b8152602060048201526013602482015272125b9d985b1a59081b1bd8dac81c195c9a5bd9606a1b6044820152606401610466565b335f818152609e602052604090819020839055517f069a01427230a7554b7b6798d4584c3acd1e5a8c3899bba47391e0fa3e82128e906113499084815260200190565b60405180910390a25b335f818152609d6020908152604091829020805460ff191686151590811790915591519182527f9cc217920419230cfc407b870a921074a0c3ccea5f613b1bbad28f56d8fb3d6f910160405180910390a25050565b6033546001600160a01b03163314610e815760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610466565b60655460ff1615610e815760405162461bcd60e51b815260206004820152601060248201526f14185d5cd8589b194e881c185d5cd95960821b6044820152606401610466565b6040516001600160a01b03808516602483015283166044820152606481018290526114b29085906323b872dd60e01b906084015b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b03199093169290921790915261182e565b50505050565b6098545f5b8181101561047b575f609882815481106114d9576114d9611f25565b5f9182526020808320909101546001600160a01b031680835260999091526040822060018101805492945090928792611513908490611f4d565b925050819055505f4282600301541161152c575f61153c565b42826003015461153c9190611f78565b90508015611557578082600101546115549190611fca565b82555b505050808061156590611f60565b9150506114bd565b6098545f90815b818110156116a6575f6098828154811061159057611590611f25565b5f9182526020822001546001600160a01b031691506115af87836116de565b9050428611156115d4575f6115c48288610beb565b90506115d08183611f78565b9150505b8015611691576001600160a01b038088165f908152609a60209081526040808320938616835292815282822082905560999052908120600101805483929061161d908490611f78565b9091555061163790506001600160a01b03831688836116ae565b6116418186611f4d565b9450816001600160a01b0316876001600160a01b03167f540798df468d7b23d11f156fdb954cb19ad414d150722a7b6d55ba369dea792e8360405161168891815260200190565b60405180910390a35b5050808061169e90611f60565b915050611574565b505092915050565b6040516001600160a01b03831660248201526044810182905261047b90849063a9059cbb60e01b9060640161147b565b6001600160a01b0381165f9081526099602052604081208054600282015483906117089042611f78565b6117129083611fb3565b90505f61171e87611901565b90505f6117296119fb565b90505f816117378486611fb3565b6117419190611fca565b6001600160a01b03808b165f908152609a60209081526040808320938d1683529290522054909150611774908290611f4d565b9998505050505050505050565b603380546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0905f90a35050565b5f54610100900460ff166117f85760405162461bcd60e51b815260040161046690611fe9565b610e81611a47565b5f54610100900460ff166118265760405162461bcd60e51b815260040161046690611fe9565b610e81611a76565b5f611882826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b0316611aa89092919063ffffffff16565b905080515f14806118a25750808060200190518101906118a29190612034565b61047b5760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b6064820152608401610466565b6001600160a01b0381165f908152609c6020908152604080832080548251818502810185019093528083528493849084015b82821015611980578382905f5260205f2090600302016040518060600160405290815f82015481526020016001820154815260200160028201548152505081526020019060010190611933565b5050505090505f5b81518110156119f4578181815181106119a3576119a3611f25565b6020026020010151604001518282815181106119c1576119c1611f25565b60200260200101515f01516119d69190611fb3565b6119e09084611f4d565b9250806119ec81611f60565b915050611988565b5050919050565b5f805b609f54811015611a435760a08181548110611a1b57611a1b611f25565b905f5260205f20015482611a2f9190611f4d565b915080611a3b81611f60565b9150506119fe565b5090565b5f54610100900460ff16611a6d5760405162461bcd60e51b815260040161046690611fe9565b610e8133611781565b5f54610100900460ff16611a9c5760405162461bcd60e51b815260040161046690611fe9565b6065805460ff19169055565b6060611ab684845f85611abe565b949350505050565b606082471015611b1f5760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f6044820152651c8818d85b1b60d21b6064820152608401610466565b5f80866001600160a01b03168587604051611b3a9190612071565b5f6040518083038185875af1925050503d805f8114611b74576040519150601f19603f3d011682016040523d82523d5f602084013e611b79565b606091505b5091509150611b8a87838387611b95565b979650505050505050565b60608315611c035782515f03611bfc576001600160a01b0385163b611bfc5760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401610466565b5081611ab6565b611ab68383815115611c185781518083602001fd5b8060405162461bcd60e51b8152600401610466919061208c565b828054828255905f5260205f20908101928215611c6b579160200282015b82811115611c6b578235825591602001919060010190611c50565b50611a43929150611cf7565b828054828255905f5260205f20908101928215611c6b579160200282015b82811115611c6b578251829063ffffffff16905591602001919060010190611c95565b828054828255905f5260205f20908101928215611c6b579160200282015b82811115611c6b578251829061ffff16905591602001919060010190611cd6565b5b80821115611a43575f8155600101611cf8565b5f8060208385031215611d1c575f80fd5b823567ffffffffffffffff80821115611d33575f80fd5b818501915085601f830112611d46575f80fd5b813581811115611d54575f80fd5b8660208260051b8501011115611d68575f80fd5b60209290920196919550909350505050565b5f8060408385031215611d8b575f80fd5b50508035926020909101359150565b6001600160a01b03811681146110fc575f80fd5b5f60208284031215611dbe575f80fd5b8135611dc981611d9a565b9392505050565b5f60208284031215611de0575f80fd5b5035919050565b604080825283519082018190525f906020906060840190828701845b82811015611e285781516001600160a01b031684529284019290840190600101611e03565b505050838103828501528451808252858301918301905f5b81811015611e5c57835183529284019291840191600101611e40565b5090979650505050505050565b5f805f60608486031215611e7b575f80fd5b8335611e8681611d9a565b95602085013595506040909401359392505050565b5f8060408385031215611eac575f80fd5b8235611eb781611d9a565b946020939093013593505050565b5f8060408385031215611ed6575f80fd5b8235611ee181611d9a565b91506020830135611ef181611d9a565b809150509250929050565b80151581146110fc575f80fd5b5f8060408385031215611f1a575f80fd5b8235611eb781611efc565b634e487b7160e01b5f52603260045260245ffd5b634e487b7160e01b5f52601160045260245ffd5b80820180821115610c7e57610c7e611f39565b5f60018201611f7157611f71611f39565b5060010190565b81810381811115610c7e57610c7e611f39565b634e487b7160e01b5f52603160045260245ffd5b634e487b7160e01b5f52604160045260245ffd5b8082028115828204841417610c7e57610c7e611f39565b5f82611fe457634e487b7160e01b5f52601260045260245ffd5b500490565b6020808252602b908201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960408201526a6e697469616c697a696e6760a81b606082015260800190565b5f60208284031215612044575f80fd5b8151611dc981611efc565b5f5b83811015612069578181015183820152602001612051565b50505f910152565b5f825161208281846020870161204f565b9190910192915050565b602081525f82518060208401526120aa81604085016020870161204f565b601f01601f1916919091016040019291505056fea2646970667358221220afd207f29ca9f27e49111f17f6fcae9cdcb2df2ecd7cf000dcd4884bb50d33b564736f6c63430008140033
Loading...
Loading
Loading...
Loading
Multichain Portfolio | 31 Chains
Chain | Token | Portfolio % | Price | Amount | Value |
---|
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.