Overview
S Balance
0 S
S Value
-More Info
Private Name Tags
ContractCreator
Loading...
Loading
Contract Name:
V21Lock
Compiler Version
v0.8.20+commit.a1b79de6
Optimization Enabled:
Yes with 200 runs
Other Settings:
paris EvmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: UNLICENSED pragma solidity ^0.8.4; import "./TransferHelper.sol"; import "@openzeppelin/contracts/utils/structs/EnumerableSet.sol"; import "@openzeppelin/contracts/utils/math/SafeMath.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/interfaces/IERC20.sol"; import "../utils/ContractGuard.sol"; import "../interfaces/IV2Lock.sol"; interface IUniFactory { function getPair(address tokenA, address tokenB) external view returns (address); } contract V21Lock is IV2Lock, Ownable, ReentrancyGuard { using SafeMath for uint256; using EnumerableSet for EnumerableSet.AddressSet; struct UserInfo { EnumerableSet.AddressSet lockedTokens; // records all tokens the user has locked mapping(address => uint256[]) locksForToken; // map erc20 address to lock id for that token } struct TokenLock { uint256 lockDate; uint256 amount; uint256 unlockDate; uint256 lockID; address owner; } mapping(address => UserInfo) private users; EnumerableSet.AddressSet private lockedTokens; mapping(address => TokenLock[]) public tokenLocks; //map univ2 pair to all its locks uint public feeTeamPercent; //Percent which goes to team uint public feeDevPercent; // Percent which goes to devs address public teamPool; //Team pool address public devPool; //Dev pool event onDeposit(address lpToken, address user, uint256 amount, uint256 lockDate, uint256 unlockDate); event onWithdraw(address lpToken, uint256 amount); event feePercentSet(uint _feeTeam, uint _feeDevs); event lockIncreased(address lpToken,uint256 newUnlockDate); constructor() public { } function setupTeamDevPool(address _teamPool,address _devPool) external onlyOwner { require(_teamPool != address(0)); require(_devPool != address(0)); teamPool = _teamPool; devPool = _devPool; } function setupFeePercent(uint _feeTeamPercent, uint _feeDevPercent) external onlyOwner { require(_feeDevPercent + _feeTeamPercent <= 300); feeTeamPercent = _feeTeamPercent; feeDevPercent = _feeDevPercent; emit feePercentSet(feeTeamPercent,feeDevPercent); } function increaseLock(address _lpToken, uint256 _index, uint256 _lockID,uint256 _increasePeriod) external { uint256 lockID = users[msg.sender].locksForToken[_lpToken][_index]; TokenLock storage userLock = tokenLocks[_lpToken][lockID]; require(lockID == _lockID && userLock.owner == msg.sender, 'LOCK MISMATCH'); tokenLocks[_lpToken][lockID].unlockDate = tokenLocks[_lpToken][lockID].unlockDate + _increasePeriod; emit lockIncreased(_lpToken,tokenLocks[_lpToken][lockID].unlockDate); } function createLock (address _lpToken, uint256 _amount, uint256 _unlockDate, address _withdrawer) external nonReentrant { require(_amount > 0, 'INSUFFICIENT'); require(_unlockDate > block.timestamp + 15 days); uint256 feeTeam = 0; uint256 feeDev = 0; uint256 balbefore = 0; if(feeDevPercent > 0) { feeDev = (_amount / 10000) * feeDevPercent; balbefore = IERC20(_lpToken).balanceOf( devPool); TransferHelper.safeTransferFrom(_lpToken, msg.sender, devPool, feeDev); require(balbefore + feeDev == IERC20(_lpToken).balanceOf(devPool), "Invalid transfer, may be token fee" ); } if(feeTeamPercent > 0) { feeTeam = (_amount / 10000) * feeTeamPercent; balbefore = IERC20(_lpToken).balanceOf( teamPool); TransferHelper.safeTransferFrom(_lpToken, msg.sender, teamPool, feeTeam); require(balbefore + feeTeam == IERC20(_lpToken).balanceOf(teamPool), "Invalid transfer, may be token fee" ); } _amount = _amount - (feeDev + feeTeam); TransferHelper.safeTransferFrom(_lpToken, address(msg.sender), address(this), _amount); TokenLock memory token_lock; token_lock.lockDate = block.timestamp; token_lock.amount = _amount; token_lock.unlockDate = _unlockDate; token_lock.lockID = tokenLocks[_lpToken].length; token_lock.owner = _withdrawer; // record the lock for the univ2pair tokenLocks[_lpToken].push(token_lock); lockedTokens.add(_lpToken); // record the lock for the user UserInfo storage user = users[_withdrawer]; user.lockedTokens.add(_lpToken); uint256[] storage user_locks = user.locksForToken[_lpToken]; user_locks.push(token_lock.lockID); emit onDeposit(_lpToken, msg.sender, token_lock.amount, token_lock.lockDate, token_lock.unlockDate); } function withdraw (address _lpToken, uint256 _index, uint256 _lockID) external nonReentrant { uint256 lockID = users[msg.sender].locksForToken[_lpToken][_index]; TokenLock storage userLock = tokenLocks[_lpToken][lockID]; require(lockID == _lockID && userLock.owner == msg.sender, 'LOCK MISMATCH'); // ensures correct lock is affected require(userLock.unlockDate < block.timestamp, 'NOT YET'); // clean user storage uint256[] storage userLocks = users[msg.sender].locksForToken[_lpToken]; userLocks[_index] = userLocks[userLocks.length-1]; userLocks.pop(); if (userLocks.length == 0) { users[msg.sender].lockedTokens.remove(_lpToken); } TransferHelper.safeTransfer(_lpToken, msg.sender, userLock.amount); emit onWithdraw(_lpToken, userLock.amount); } function getNumLocksForToken (address _lpToken) external view returns (uint256) { return tokenLocks[_lpToken].length; } function getNumLockedTokens () external view returns (uint256) { return lockedTokens.length(); } function getLockedTokenAtIndex (uint256 _index) external view returns (address) { return lockedTokens.at(_index); } function getUserNumLockedTokens (address _user) external view returns (uint256) { UserInfo storage user = users[_user]; return user.lockedTokens.length(); } function getUserLockedTokenAtIndex (address _user, uint256 _index) external view returns (address) { UserInfo storage user = users[_user]; return user.lockedTokens.at(_index); } function getUserNumLocksForToken (address _user, address _lpToken) external view returns (uint256) { UserInfo storage user = users[_user]; return user.locksForToken[_lpToken].length; } function getUserLockForTokenAtIndex (address _user, address _lpToken, uint256 _index) external view returns (uint256, uint256, uint256, uint256, address) { uint256 lockID = users[_user].locksForToken[_lpToken][_index]; TokenLock storage tokenLock = tokenLocks[_lpToken][lockID]; return (tokenLock.lockDate, tokenLock.amount, tokenLock.unlockDate, tokenLock.lockID, tokenLock.owner); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.9.0) (access/Ownable.sol) pragma solidity ^0.8.0; import "../utils/Context.sol"; /** * @dev Contract module which provides a basic access control mechanism, where * there is an account (an owner) that can be granted exclusive access to * specific functions. * * By default, the owner account will be the one that deploys the contract. This * can later be changed with {transferOwnership}. * * This module is used through inheritance. It will make available the modifier * `onlyOwner`, which can be applied to your functions to restrict their use to * the owner. */ abstract contract Ownable is Context { address private _owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev Initializes the contract setting the deployer as the initial owner. */ constructor() { _transferOwnership(_msgSender()); } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { _checkOwner(); _; } /** * @dev Returns the address of the current owner. */ function owner() public view virtual returns (address) { return _owner; } /** * @dev Throws if the sender is not the owner. */ function _checkOwner() internal view virtual { require(owner() == _msgSender(), "Ownable: caller is not the owner"); } /** * @dev Leaves the contract without owner. It will not be possible to call * `onlyOwner` functions. Can only be called by the current owner. * * NOTE: Renouncing ownership will leave the contract without an owner, * thereby disabling any functionality that is only available to the owner. */ function renounceOwnership() public virtual onlyOwner { _transferOwnership(address(0)); } /** * @dev Transfers ownership of the contract to a new account (`newOwner`). * Can only be called by the current owner. */ function transferOwnership(address newOwner) public virtual onlyOwner { require(newOwner != address(0), "Ownable: new owner is the zero address"); _transferOwnership(newOwner); } /** * @dev Transfers ownership of the contract to a new account (`newOwner`). * Internal function without access restriction. */ function _transferOwnership(address newOwner) internal virtual { address oldOwner = _owner; _owner = newOwner; emit OwnershipTransferred(oldOwner, newOwner); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (interfaces/IERC20.sol) pragma solidity ^0.8.0; import "../token/ERC20/IERC20.sol";
// 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.4) (utils/Context.sol) pragma solidity ^0.8.0; /** * @dev Provides information about the current execution context, including the * sender of the transaction and its data. While these are generally available * via msg.sender and msg.data, they should not be accessed in such a direct * manner, since when dealing with meta-transactions the account sending and * paying for execution may not be the actual sender (as far as an application * is concerned). * * This contract is only required for intermediate, library-like contracts. */ abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } function _msgData() internal view virtual returns (bytes calldata) { return msg.data; } function _contextSuffixLength() internal view virtual returns (uint256) { return 0; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.9.0) (utils/math/SafeMath.sol) pragma solidity ^0.8.0; // CAUTION // This version of SafeMath should only be used with Solidity 0.8 or later, // because it relies on the compiler's built in overflow checks. /** * @dev Wrappers over Solidity's arithmetic operations. * * NOTE: `SafeMath` is generally not needed starting with Solidity 0.8, since the compiler * now has built in overflow checking. */ library SafeMath { /** * @dev Returns the addition of two unsigned integers, with an overflow flag. * * _Available since v3.4._ */ function tryAdd(uint256 a, uint256 b) internal pure returns (bool, uint256) { unchecked { uint256 c = a + b; if (c < a) return (false, 0); return (true, c); } } /** * @dev Returns the subtraction of two unsigned integers, with an overflow flag. * * _Available since v3.4._ */ function trySub(uint256 a, uint256 b) internal pure returns (bool, uint256) { unchecked { if (b > a) return (false, 0); return (true, a - b); } } /** * @dev Returns the multiplication of two unsigned integers, with an overflow flag. * * _Available since v3.4._ */ function tryMul(uint256 a, uint256 b) internal pure returns (bool, uint256) { unchecked { // Gas optimization: this is cheaper than requiring 'a' not being zero, but the // benefit is lost if 'b' is also tested. // See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522 if (a == 0) return (true, 0); uint256 c = a * b; if (c / a != b) return (false, 0); return (true, c); } } /** * @dev Returns the division of two unsigned integers, with a division by zero flag. * * _Available since v3.4._ */ function tryDiv(uint256 a, uint256 b) internal pure returns (bool, uint256) { unchecked { if (b == 0) return (false, 0); return (true, a / b); } } /** * @dev Returns the remainder of dividing two unsigned integers, with a division by zero flag. * * _Available since v3.4._ */ function tryMod(uint256 a, uint256 b) internal pure returns (bool, uint256) { unchecked { if (b == 0) return (false, 0); return (true, a % b); } } /** * @dev Returns the addition of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `+` operator. * * Requirements: * * - Addition cannot overflow. */ function add(uint256 a, uint256 b) internal pure returns (uint256) { return a + b; } /** * @dev Returns the subtraction of two unsigned integers, reverting on * overflow (when the result is negative). * * Counterpart to Solidity's `-` operator. * * Requirements: * * - Subtraction cannot overflow. */ function sub(uint256 a, uint256 b) internal pure returns (uint256) { return a - b; } /** * @dev Returns the multiplication of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `*` operator. * * Requirements: * * - Multiplication cannot overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256) { return a * b; } /** * @dev Returns the integer division of two unsigned integers, reverting on * division by zero. The result is rounded towards zero. * * Counterpart to Solidity's `/` operator. * * Requirements: * * - The divisor cannot be zero. */ function div(uint256 a, uint256 b) internal pure returns (uint256) { return a / b; } /** * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo), * reverting when dividing by zero. * * Counterpart to Solidity's `%` operator. This function uses a `revert` * opcode (which leaves remaining gas untouched) while Solidity uses an * invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function mod(uint256 a, uint256 b) internal pure returns (uint256) { return a % b; } /** * @dev Returns the subtraction of two unsigned integers, reverting with custom message on * overflow (when the result is negative). * * CAUTION: This function is deprecated because it requires allocating memory for the error * message unnecessarily. For custom revert reasons use {trySub}. * * Counterpart to Solidity's `-` operator. * * Requirements: * * - Subtraction cannot overflow. */ function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { unchecked { require(b <= a, errorMessage); return a - b; } } /** * @dev Returns the integer division of two unsigned integers, reverting with custom message on * division by zero. The result is rounded towards zero. * * Counterpart to Solidity's `/` operator. Note: this function uses a * `revert` opcode (which leaves remaining gas untouched) while Solidity * uses an invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { unchecked { require(b > 0, errorMessage); return a / b; } } /** * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo), * reverting with custom message when dividing by zero. * * CAUTION: This function is deprecated because it requires allocating memory for the error * message unnecessarily. For custom revert reasons use {tryMod}. * * Counterpart to Solidity's `%` operator. This function uses a `revert` * opcode (which leaves remaining gas untouched) while Solidity uses an * invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { unchecked { require(b > 0, errorMessage); return a % b; } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.9.0) (utils/structs/EnumerableSet.sol) // This file was procedurally generated from scripts/generate/templates/EnumerableSet.js. pragma solidity ^0.8.0; /** * @dev Library for managing * https://en.wikipedia.org/wiki/Set_(abstract_data_type)[sets] of primitive * types. * * Sets have the following properties: * * - Elements are added, removed, and checked for existence in constant time * (O(1)). * - Elements are enumerated in O(n). No guarantees are made on the ordering. * * ```solidity * contract Example { * // Add the library methods * using EnumerableSet for EnumerableSet.AddressSet; * * // Declare a set state variable * EnumerableSet.AddressSet private mySet; * } * ``` * * As of v3.3.0, sets of type `bytes32` (`Bytes32Set`), `address` (`AddressSet`) * and `uint256` (`UintSet`) are supported. * * [WARNING] * ==== * Trying to delete such a structure from storage will likely result in data corruption, rendering the structure * unusable. * See https://github.com/ethereum/solidity/pull/11843[ethereum/solidity#11843] for more info. * * In order to clean an EnumerableSet, you can either remove all elements one by one or create a fresh instance using an * array of EnumerableSet. * ==== */ library EnumerableSet { // To implement this library for multiple types with as little code // repetition as possible, we write it in terms of a generic Set type with // bytes32 values. // The Set implementation uses private functions, and user-facing // implementations (such as AddressSet) are just wrappers around the // underlying Set. // This means that we can only create new EnumerableSets for types that fit // in bytes32. struct Set { // Storage of set values bytes32[] _values; // Position of the value in the `values` array, plus 1 because index 0 // means a value is not in the set. mapping(bytes32 => uint256) _indexes; } /** * @dev Add a value to a set. O(1). * * Returns true if the value was added to the set, that is if it was not * already present. */ function _add(Set storage set, bytes32 value) private returns (bool) { if (!_contains(set, value)) { set._values.push(value); // The value is stored at length-1, but we add 1 to all indexes // and use 0 as a sentinel value set._indexes[value] = set._values.length; return true; } else { return false; } } /** * @dev Removes a value from a set. O(1). * * Returns true if the value was removed from the set, that is if it was * present. */ function _remove(Set storage set, bytes32 value) private returns (bool) { // We read and store the value's index to prevent multiple reads from the same storage slot uint256 valueIndex = set._indexes[value]; if (valueIndex != 0) { // Equivalent to contains(set, value) // To delete an element from the _values array in O(1), we swap the element to delete with the last one in // the array, and then remove the last element (sometimes called as 'swap and pop'). // This modifies the order of the array, as noted in {at}. uint256 toDeleteIndex = valueIndex - 1; uint256 lastIndex = set._values.length - 1; if (lastIndex != toDeleteIndex) { bytes32 lastValue = set._values[lastIndex]; // Move the last value to the index where the value to delete is set._values[toDeleteIndex] = lastValue; // Update the index for the moved value set._indexes[lastValue] = valueIndex; // Replace lastValue's index to valueIndex } // Delete the slot where the moved value was stored set._values.pop(); // Delete the index for the deleted slot delete set._indexes[value]; return true; } else { return false; } } /** * @dev Returns true if the value is in the set. O(1). */ function _contains(Set storage set, bytes32 value) private view returns (bool) { return set._indexes[value] != 0; } /** * @dev Returns the number of values on the set. O(1). */ function _length(Set storage set) private view returns (uint256) { return set._values.length; } /** * @dev Returns the value stored at position `index` in the set. O(1). * * Note that there are no guarantees on the ordering of values inside the * array, and it may change when more values are added or removed. * * Requirements: * * - `index` must be strictly less than {length}. */ function _at(Set storage set, uint256 index) private view returns (bytes32) { return set._values[index]; } /** * @dev Return the entire set in an array * * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that * this function has an unbounded cost, and using it as part of a state-changing function may render the function * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block. */ function _values(Set storage set) private view returns (bytes32[] memory) { return set._values; } // Bytes32Set struct Bytes32Set { Set _inner; } /** * @dev Add a value to a set. O(1). * * Returns true if the value was added to the set, that is if it was not * already present. */ function add(Bytes32Set storage set, bytes32 value) internal returns (bool) { return _add(set._inner, value); } /** * @dev Removes a value from a set. O(1). * * Returns true if the value was removed from the set, that is if it was * present. */ function remove(Bytes32Set storage set, bytes32 value) internal returns (bool) { return _remove(set._inner, value); } /** * @dev Returns true if the value is in the set. O(1). */ function contains(Bytes32Set storage set, bytes32 value) internal view returns (bool) { return _contains(set._inner, value); } /** * @dev Returns the number of values in the set. O(1). */ function length(Bytes32Set storage set) internal view returns (uint256) { return _length(set._inner); } /** * @dev Returns the value stored at position `index` in the set. O(1). * * Note that there are no guarantees on the ordering of values inside the * array, and it may change when more values are added or removed. * * Requirements: * * - `index` must be strictly less than {length}. */ function at(Bytes32Set storage set, uint256 index) internal view returns (bytes32) { return _at(set._inner, index); } /** * @dev Return the entire set in an array * * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that * this function has an unbounded cost, and using it as part of a state-changing function may render the function * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block. */ function values(Bytes32Set storage set) internal view returns (bytes32[] memory) { bytes32[] memory store = _values(set._inner); bytes32[] memory result; /// @solidity memory-safe-assembly assembly { result := store } return result; } // AddressSet struct AddressSet { Set _inner; } /** * @dev Add a value to a set. O(1). * * Returns true if the value was added to the set, that is if it was not * already present. */ function add(AddressSet storage set, address value) internal returns (bool) { return _add(set._inner, bytes32(uint256(uint160(value)))); } /** * @dev Removes a value from a set. O(1). * * Returns true if the value was removed from the set, that is if it was * present. */ function remove(AddressSet storage set, address value) internal returns (bool) { return _remove(set._inner, bytes32(uint256(uint160(value)))); } /** * @dev Returns true if the value is in the set. O(1). */ function contains(AddressSet storage set, address value) internal view returns (bool) { return _contains(set._inner, bytes32(uint256(uint160(value)))); } /** * @dev Returns the number of values in the set. O(1). */ function length(AddressSet storage set) internal view returns (uint256) { return _length(set._inner); } /** * @dev Returns the value stored at position `index` in the set. O(1). * * Note that there are no guarantees on the ordering of values inside the * array, and it may change when more values are added or removed. * * Requirements: * * - `index` must be strictly less than {length}. */ function at(AddressSet storage set, uint256 index) internal view returns (address) { return address(uint160(uint256(_at(set._inner, index)))); } /** * @dev Return the entire set in an array * * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that * this function has an unbounded cost, and using it as part of a state-changing function may render the function * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block. */ function values(AddressSet storage set) internal view returns (address[] memory) { bytes32[] memory store = _values(set._inner); address[] memory result; /// @solidity memory-safe-assembly assembly { result := store } return result; } // UintSet struct UintSet { Set _inner; } /** * @dev Add a value to a set. O(1). * * Returns true if the value was added to the set, that is if it was not * already present. */ function add(UintSet storage set, uint256 value) internal returns (bool) { return _add(set._inner, bytes32(value)); } /** * @dev Removes a value from a set. O(1). * * Returns true if the value was removed from the set, that is if it was * present. */ function remove(UintSet storage set, uint256 value) internal returns (bool) { return _remove(set._inner, bytes32(value)); } /** * @dev Returns true if the value is in the set. O(1). */ function contains(UintSet storage set, uint256 value) internal view returns (bool) { return _contains(set._inner, bytes32(value)); } /** * @dev Returns the number of values in the set. O(1). */ function length(UintSet storage set) internal view returns (uint256) { return _length(set._inner); } /** * @dev Returns the value stored at position `index` in the set. O(1). * * Note that there are no guarantees on the ordering of values inside the * array, and it may change when more values are added or removed. * * Requirements: * * - `index` must be strictly less than {length}. */ function at(UintSet storage set, uint256 index) internal view returns (uint256) { return uint256(_at(set._inner, index)); } /** * @dev Return the entire set in an array * * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that * this function has an unbounded cost, and using it as part of a state-changing function may render the function * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block. */ function values(UintSet storage set) internal view returns (uint256[] memory) { bytes32[] memory store = _values(set._inner); uint256[] memory result; /// @solidity memory-safe-assembly assembly { result := store } return result; } }
// SPDX-License-Identifier: UNLICENSED pragma solidity ^0.8.0; interface IV2Lock { function createLock (address _lpToken, uint256 _amount, uint256 _unlockDate, address _withdrawer) external ; function withdraw (address _lpToken, uint256 _index, uint256 _lockID) external; }
pragma solidity ^0.8.4; /** helper methods for interacting with ERC20 tokens that do not consistently return true/false with the addition of a transfer function to send eth or an erc20 token */ library TransferHelper { function safeApprove(address token, address to, uint value) internal { (bool success, bytes memory data) = token.call(abi.encodeWithSelector(0x095ea7b3, to, value)); require(success && (data.length == 0 || abi.decode(data, (bool))), 'TransferHelper: APPROVE_FAILED'); } function safeTransfer(address token, address to, uint value) internal { (bool success, bytes memory data) = token.call(abi.encodeWithSelector(0xa9059cbb, to, value)); require(success && (data.length == 0 || abi.decode(data, (bool))), 'TransferHelper: TRANSFER_FAILED'); } function safeTransferFrom(address token, address from, address to, uint value) internal { (bool success, bytes memory data) = token.call(abi.encodeWithSelector(0x23b872dd, from, to, value)); require(success && (data.length == 0 || abi.decode(data, (bool))), 'TransferHelper: TRANSFER_FROM_FAILED'); } // sends ETH or an erc20 token function safeTransferBaseToken(address token, address payable to, uint value, bool isERC20) internal { if (!isERC20) { to.transfer(value); } else { (bool success, bytes memory data) = token.call(abi.encodeWithSelector(0xa9059cbb, to, value)); require(success && (data.length == 0 || abi.decode(data, (bool))), 'TransferHelper: TRANSFER_FAILED'); } } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; abstract contract ReentrancyGuard { uint256 private constant _NOT_ENTERED = 1; uint256 private constant _ENTERED = 2; uint256 private _status; constructor () { _status = _NOT_ENTERED; } modifier nonReentrant() { require(_status != _ENTERED, "ReentrancyGuard: reentrant call"); _status = _ENTERED; _; _status = _NOT_ENTERED; } } contract ContractGuard { mapping(uint256 => mapping(address => bool)) private _status; function checkSameOriginReentranted() internal view returns (bool) { return _status[block.number][tx.origin]; } function checkSameSenderReentranted() internal view returns (bool) { return _status[block.number][msg.sender]; } modifier onlyOneBlock() { require(!checkSameOriginReentranted(), "ContractGuard: one block, one function"); require(!checkSameSenderReentranted(), "ContractGuard: one block, one function"); _; _status[block.number][tx.origin] = true; _status[block.number][msg.sender] = true; } }
{ "optimizer": { "enabled": true, "runs": 200 }, "evmVersion": "paris", "outputSelection": { "*": { "*": [ "evm.bytecode", "evm.deployedBytecode", "devdoc", "userdoc", "metadata", "abi" ] } }, "libraries": {} }
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
[{"inputs":[],"stateMutability":"nonpayable","type":"constructor"},{"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":"uint256","name":"_feeTeam","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"_feeDevs","type":"uint256"}],"name":"feePercentSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"lpToken","type":"address"},{"indexed":false,"internalType":"uint256","name":"newUnlockDate","type":"uint256"}],"name":"lockIncreased","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"lpToken","type":"address"},{"indexed":false,"internalType":"address","name":"user","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"lockDate","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"unlockDate","type":"uint256"}],"name":"onDeposit","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"lpToken","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"onWithdraw","type":"event"},{"inputs":[{"internalType":"address","name":"_lpToken","type":"address"},{"internalType":"uint256","name":"_amount","type":"uint256"},{"internalType":"uint256","name":"_unlockDate","type":"uint256"},{"internalType":"address","name":"_withdrawer","type":"address"}],"name":"createLock","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"devPool","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"feeDevPercent","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"feeTeamPercent","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_index","type":"uint256"}],"name":"getLockedTokenAtIndex","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getNumLockedTokens","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_lpToken","type":"address"}],"name":"getNumLocksForToken","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_user","type":"address"},{"internalType":"address","name":"_lpToken","type":"address"},{"internalType":"uint256","name":"_index","type":"uint256"}],"name":"getUserLockForTokenAtIndex","outputs":[{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_user","type":"address"},{"internalType":"uint256","name":"_index","type":"uint256"}],"name":"getUserLockedTokenAtIndex","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_user","type":"address"}],"name":"getUserNumLockedTokens","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_user","type":"address"},{"internalType":"address","name":"_lpToken","type":"address"}],"name":"getUserNumLocksForToken","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_lpToken","type":"address"},{"internalType":"uint256","name":"_index","type":"uint256"},{"internalType":"uint256","name":"_lockID","type":"uint256"},{"internalType":"uint256","name":"_increasePeriod","type":"uint256"}],"name":"increaseLock","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_feeTeamPercent","type":"uint256"},{"internalType":"uint256","name":"_feeDevPercent","type":"uint256"}],"name":"setupFeePercent","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_teamPool","type":"address"},{"internalType":"address","name":"_devPool","type":"address"}],"name":"setupTeamDevPool","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"teamPool","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"uint256","name":"","type":"uint256"}],"name":"tokenLocks","outputs":[{"internalType":"uint256","name":"lockDate","type":"uint256"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"uint256","name":"unlockDate","type":"uint256"},{"internalType":"uint256","name":"lockID","type":"uint256"},{"internalType":"address","name":"owner","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_lpToken","type":"address"},{"internalType":"uint256","name":"_index","type":"uint256"},{"internalType":"uint256","name":"_lockID","type":"uint256"}],"name":"withdraw","outputs":[],"stateMutability":"nonpayable","type":"function"}]
Contract Creation Code
608060405234801561001057600080fd5b5061001a33610023565b60018055610073565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b611792806100826000396000f3fe608060405234801561001057600080fd5b506004361061012c5760003560e01c80638df7e31d116100ad578063b5c5f67211610071578063b5c5f6721461028c578063ccebfa3f1461029f578063d4ff493f146102e3578063f1e47d3d146102f6578063f2fde38b1461030957600080fd5b80638df7e31d14610210578063903df80614610219578063a39698151461022c578063a69d9c4f1461023f578063b5838a271461027957600080fd5b806354012786116100f457806354012786146101c95780636a3f8762146101dc578063715018a6146101ef578063783451e8146101f75780638da5cb5b146101ff57600080fd5b806302d51fc61461013157806308b4f5161461014657806314dd79a3146101625780631f2a1d2f1461018d57806339636504146101b6575b600080fd5b61014461013f36600461146e565b61031c565b005b61014f60075481565b6040519081526020015b60405180910390f35b6101756101703660046114a1565b610378565b6040516001600160a01b039091168152602001610159565b61014f61019b3660046114ba565b6001600160a01b031660009081526005602052604090205490565b600854610175906001600160a01b031681565b6101446101d73660046114d5565b61038b565b6101446101ea36600461151b565b61087e565b6101446108e5565b61014f6108f9565b6000546001600160a01b0316610175565b61014f60065481565b61017561022736600461153d565b61090a565b61014f61023a3660046114ba565b610934565b61014f61024d36600461146e565b6001600160a01b0391821660009081526002602081815260408084209490951683529201909152205490565b600954610175906001600160a01b031681565b61014461029a366004611567565b61095c565b6102b26102ad36600461153d565b610bf4565b6040805195865260208601949094529284019190915260608301526001600160a01b0316608082015260a001610159565b6102b26102f136600461159a565b610c4b565b6101446103043660046115d6565b610d3a565b6101446103173660046114ba565b610f38565b610324610fb1565b6001600160a01b03821661033757600080fd5b6001600160a01b03811661034a57600080fd5b600880546001600160a01b039384166001600160a01b03199182161790915560098054929093169116179055565b600061038560038361100b565b92915050565b6002600154036103e25760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c0060448201526064015b60405180910390fd5b6002600155826104235760405162461bcd60e51b815260206004820152600c60248201526b125394d551919250d251539560a21b60448201526064016103d9565b610430426213c680611625565b821161043b57600080fd5b60008060008060075411156105855760075461045961271088611638565b610463919061165a565b6009546040516370a0823160e01b81526001600160a01b0391821660048201529193508816906370a0823190602401602060405180830381865afa1580156104af573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104d39190611671565b6009549091506104f090889033906001600160a01b031685611017565b6009546040516370a0823160e01b81526001600160a01b039182166004820152908816906370a0823190602401602060405180830381865afa15801561053a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061055e9190611671565b6105688383611625565b146105855760405162461bcd60e51b81526004016103d99061168a565b600654156106c85760065461059c61271088611638565b6105a6919061165a565b6008546040516370a0823160e01b81526001600160a01b0391821660048201529194508816906370a0823190602401602060405180830381865afa1580156105f2573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106169190611671565b60085490915061063390889033906001600160a01b031686611017565b6008546040516370a0823160e01b81526001600160a01b039182166004820152908816906370a0823190602401602060405180830381865afa15801561067d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106a19190611671565b6106ab8483611625565b146106c85760405162461bcd60e51b81526004016103d99061168a565b6106d28383611625565b6106dc90876116cc565b95506106ea87333089611017565b6107256040518060a001604052806000815260200160008152602001600081526020016000815260200160006001600160a01b031681525090565b428152602080820188815260408084018981526001600160a01b038c8116600090815260058087529381208054606089018181528d851660808b01908152878a5260018084018555938552989093208951919096029095019485559451948401949094559051600283015591516003808301919091559251600490910180546001600160a01b031916919092161790556107bf9089611147565b506001600160a01b03851660009081526002602052604090206107e2818a611147565b506001600160a01b0389166000818152600283016020908152604080832060608781015182546001810184558387529585902090950194909455868301518751888401518451978852339588019590955292860152928401526080830152907f830357565da6ecfc26d8d9f69df488ed6f70361af9a07e570544aeb5c5e765e59060a00160405180910390a15050600180555050505050505050565b610886610fb1565b61012c6108938383611625565b111561089e57600080fd5b6006829055600781905560408051838152602081018390527f8e097cdd98d5d587f41df2f4d2d93cc97c9d3a137a48f6d5fc27b13080024395910160405180910390a15050565b6108ed610fb1565b6108f7600061115c565b565b600061090560036111ac565b905090565b6001600160a01b038216600090815260026020526040812061092c818461100b565b949350505050565b6001600160a01b0381166000908152600260205260408120610955816111ac565b9392505050565b6002600154036109ae5760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c0060448201526064016103d9565b60026001819055336000908152602082815260408083206001600160a01b038816845290930190529081208054849081106109eb576109eb6116df565b90600052602060002001549050600060056000866001600160a01b03166001600160a01b031681526020019081526020016000208281548110610a3057610a306116df565b906000526020600020906005020190508282148015610a5b575060048101546001600160a01b031633145b610a975760405162461bcd60e51b815260206004820152600d60248201526c0989e8696409a92a69a82a8869609b1b60448201526064016103d9565b42816002015410610ad45760405162461bcd60e51b81526020600482015260076024820152661393d50816515560ca1b60448201526064016103d9565b3360009081526002602081815260408084206001600160a01b038a1685529092019052902080548190610b09906001906116cc565b81548110610b1957610b196116df565b9060005260206000200154818681548110610b3657610b366116df565b906000526020600020018190555080805480610b5457610b546116f5565b600190038181906000526020600020016000905590558080549050600003610b9157336000908152600260205260409020610b8f90876111b6565b505b610ba0863384600101546111cb565b6001820154604080516001600160a01b038916815260208101929092527fccad973dcd043c7d680389db4378bd6b9775db7124092e9e0422c9e46d7985dc910160405180910390a150506001805550505050565b60056020528160005260406000208181548110610c1057600080fd5b60009182526020909120600590910201805460018201546002830154600384015460049094015492955090935091906001600160a01b031685565b600080600080600080600260008a6001600160a01b03166001600160a01b031681526020019081526020016000206002016000896001600160a01b03166001600160a01b031681526020019081526020016000208781548110610cb057610cb06116df565b906000526020600020015490506000600560008a6001600160a01b03166001600160a01b031681526020019081526020016000208281548110610cf557610cf56116df565b600091825260209091206005909102018054600182015460028301546003840154600490940154929e919d509b509199506001600160a01b0316975095505050505050565b3360009081526002602081815260408084206001600160a01b038916855290920190528120805485908110610d7157610d716116df565b90600052602060002001549050600060056000876001600160a01b03166001600160a01b031681526020019081526020016000208281548110610db657610db66116df565b906000526020600020906005020190508382148015610de1575060048101546001600160a01b031633145b610e1d5760405162461bcd60e51b815260206004820152600d60248201526c0989e8696409a92a69a82a8869609b1b60448201526064016103d9565b6001600160a01b0386166000908152600560205260409020805484919084908110610e4a57610e4a6116df565b906000526020600020906005020160020154610e669190611625565b6001600160a01b0387166000908152600560205260409020805484908110610e9057610e906116df565b9060005260206000209060050201600201819055507f71c14ef086b874eb67dfb59e568e663b10d224180cbda557478d775f62d121028660056000896001600160a01b03166001600160a01b031681526020019081526020016000208481548110610efd57610efd6116df565b600091825260209182902060026005909202010154604080516001600160a01b039094168452918301520160405180910390a1505050505050565b610f40610fb1565b6001600160a01b038116610fa55760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016103d9565b610fae8161115c565b50565b6000546001600160a01b031633146108f75760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016103d9565b600061095583836112e6565b604080516001600160a01b0385811660248301528481166044830152606480830185905283518084039091018152608490920183526020820180516001600160e01b03166323b872dd60e01b179052915160009283929088169161107b919061170b565b6000604051808303816000865af19150503d80600081146110b8576040519150601f19603f3d011682016040523d82523d6000602084013e6110bd565b606091505b50915091508180156110e75750805115806110e75750808060200190518101906110e7919061173a565b61113f5760405162461bcd60e51b8152602060048201526024808201527f5472616e7366657248656c7065723a205452414e534645525f46524f4d5f46416044820152631253115160e21b60648201526084016103d9565b505050505050565b6000610955836001600160a01b038416611310565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6000610385825490565b6000610955836001600160a01b03841661135f565b604080516001600160a01b038481166024830152604480830185905283518084039091018152606490920183526020820180516001600160e01b031663a9059cbb60e01b1790529151600092839290871691611227919061170b565b6000604051808303816000865af19150503d8060008114611264576040519150601f19603f3d011682016040523d82523d6000602084013e611269565b606091505b5091509150818015611293575080511580611293575080806020019051810190611293919061173a565b6112df5760405162461bcd60e51b815260206004820152601f60248201527f5472616e7366657248656c7065723a205452414e534645525f4641494c45440060448201526064016103d9565b5050505050565b60008260000182815481106112fd576112fd6116df565b9060005260206000200154905092915050565b600081815260018301602052604081205461135757508154600181810184556000848152602080822090930184905584548482528286019093526040902091909155610385565b506000610385565b600081815260018301602052604081205480156114485760006113836001836116cc565b8554909150600090611397906001906116cc565b90508181146113fc5760008660000182815481106113b7576113b76116df565b90600052602060002001549050808760000184815481106113da576113da6116df565b6000918252602080832090910192909255918252600188019052604090208390555b855486908061140d5761140d6116f5565b600190038181906000526020600020016000905590558560010160008681526020019081526020016000206000905560019350505050610385565b6000915050610385565b80356001600160a01b038116811461146957600080fd5b919050565b6000806040838503121561148157600080fd5b61148a83611452565b915061149860208401611452565b90509250929050565b6000602082840312156114b357600080fd5b5035919050565b6000602082840312156114cc57600080fd5b61095582611452565b600080600080608085870312156114eb57600080fd5b6114f485611452565b9350602085013592506040850135915061151060608601611452565b905092959194509250565b6000806040838503121561152e57600080fd5b50508035926020909101359150565b6000806040838503121561155057600080fd5b61155983611452565b946020939093013593505050565b60008060006060848603121561157c57600080fd5b61158584611452565b95602085013595506040909401359392505050565b6000806000606084860312156115af57600080fd5b6115b884611452565b92506115c660208501611452565b9150604084013590509250925092565b600080600080608085870312156115ec57600080fd5b6115f585611452565b966020860135965060408601359560600135945092505050565b634e487b7160e01b600052601160045260246000fd5b808201808211156103855761038561160f565b60008261165557634e487b7160e01b600052601260045260246000fd5b500490565b80820281158282048414176103855761038561160f565b60006020828403121561168357600080fd5b5051919050565b60208082526022908201527f496e76616c6964207472616e736665722c206d617920626520746f6b656e2066604082015261656560f01b606082015260800190565b818103818111156103855761038561160f565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052603160045260246000fd5b6000825160005b8181101561172c5760208186018101518583015201611712565b506000920191825250919050565b60006020828403121561174c57600080fd5b8151801515811461095557600080fdfea2646970667358221220a39b63e3a16ee3bbd93809843ca1dd7903d69613669accf6d86a9b0d9b3344d264736f6c63430008140033
Deployed Bytecode
0x608060405234801561001057600080fd5b506004361061012c5760003560e01c80638df7e31d116100ad578063b5c5f67211610071578063b5c5f6721461028c578063ccebfa3f1461029f578063d4ff493f146102e3578063f1e47d3d146102f6578063f2fde38b1461030957600080fd5b80638df7e31d14610210578063903df80614610219578063a39698151461022c578063a69d9c4f1461023f578063b5838a271461027957600080fd5b806354012786116100f457806354012786146101c95780636a3f8762146101dc578063715018a6146101ef578063783451e8146101f75780638da5cb5b146101ff57600080fd5b806302d51fc61461013157806308b4f5161461014657806314dd79a3146101625780631f2a1d2f1461018d57806339636504146101b6575b600080fd5b61014461013f36600461146e565b61031c565b005b61014f60075481565b6040519081526020015b60405180910390f35b6101756101703660046114a1565b610378565b6040516001600160a01b039091168152602001610159565b61014f61019b3660046114ba565b6001600160a01b031660009081526005602052604090205490565b600854610175906001600160a01b031681565b6101446101d73660046114d5565b61038b565b6101446101ea36600461151b565b61087e565b6101446108e5565b61014f6108f9565b6000546001600160a01b0316610175565b61014f60065481565b61017561022736600461153d565b61090a565b61014f61023a3660046114ba565b610934565b61014f61024d36600461146e565b6001600160a01b0391821660009081526002602081815260408084209490951683529201909152205490565b600954610175906001600160a01b031681565b61014461029a366004611567565b61095c565b6102b26102ad36600461153d565b610bf4565b6040805195865260208601949094529284019190915260608301526001600160a01b0316608082015260a001610159565b6102b26102f136600461159a565b610c4b565b6101446103043660046115d6565b610d3a565b6101446103173660046114ba565b610f38565b610324610fb1565b6001600160a01b03821661033757600080fd5b6001600160a01b03811661034a57600080fd5b600880546001600160a01b039384166001600160a01b03199182161790915560098054929093169116179055565b600061038560038361100b565b92915050565b6002600154036103e25760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c0060448201526064015b60405180910390fd5b6002600155826104235760405162461bcd60e51b815260206004820152600c60248201526b125394d551919250d251539560a21b60448201526064016103d9565b610430426213c680611625565b821161043b57600080fd5b60008060008060075411156105855760075461045961271088611638565b610463919061165a565b6009546040516370a0823160e01b81526001600160a01b0391821660048201529193508816906370a0823190602401602060405180830381865afa1580156104af573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104d39190611671565b6009549091506104f090889033906001600160a01b031685611017565b6009546040516370a0823160e01b81526001600160a01b039182166004820152908816906370a0823190602401602060405180830381865afa15801561053a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061055e9190611671565b6105688383611625565b146105855760405162461bcd60e51b81526004016103d99061168a565b600654156106c85760065461059c61271088611638565b6105a6919061165a565b6008546040516370a0823160e01b81526001600160a01b0391821660048201529194508816906370a0823190602401602060405180830381865afa1580156105f2573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106169190611671565b60085490915061063390889033906001600160a01b031686611017565b6008546040516370a0823160e01b81526001600160a01b039182166004820152908816906370a0823190602401602060405180830381865afa15801561067d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106a19190611671565b6106ab8483611625565b146106c85760405162461bcd60e51b81526004016103d99061168a565b6106d28383611625565b6106dc90876116cc565b95506106ea87333089611017565b6107256040518060a001604052806000815260200160008152602001600081526020016000815260200160006001600160a01b031681525090565b428152602080820188815260408084018981526001600160a01b038c8116600090815260058087529381208054606089018181528d851660808b01908152878a5260018084018555938552989093208951919096029095019485559451948401949094559051600283015591516003808301919091559251600490910180546001600160a01b031916919092161790556107bf9089611147565b506001600160a01b03851660009081526002602052604090206107e2818a611147565b506001600160a01b0389166000818152600283016020908152604080832060608781015182546001810184558387529585902090950194909455868301518751888401518451978852339588019590955292860152928401526080830152907f830357565da6ecfc26d8d9f69df488ed6f70361af9a07e570544aeb5c5e765e59060a00160405180910390a15050600180555050505050505050565b610886610fb1565b61012c6108938383611625565b111561089e57600080fd5b6006829055600781905560408051838152602081018390527f8e097cdd98d5d587f41df2f4d2d93cc97c9d3a137a48f6d5fc27b13080024395910160405180910390a15050565b6108ed610fb1565b6108f7600061115c565b565b600061090560036111ac565b905090565b6001600160a01b038216600090815260026020526040812061092c818461100b565b949350505050565b6001600160a01b0381166000908152600260205260408120610955816111ac565b9392505050565b6002600154036109ae5760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c0060448201526064016103d9565b60026001819055336000908152602082815260408083206001600160a01b038816845290930190529081208054849081106109eb576109eb6116df565b90600052602060002001549050600060056000866001600160a01b03166001600160a01b031681526020019081526020016000208281548110610a3057610a306116df565b906000526020600020906005020190508282148015610a5b575060048101546001600160a01b031633145b610a975760405162461bcd60e51b815260206004820152600d60248201526c0989e8696409a92a69a82a8869609b1b60448201526064016103d9565b42816002015410610ad45760405162461bcd60e51b81526020600482015260076024820152661393d50816515560ca1b60448201526064016103d9565b3360009081526002602081815260408084206001600160a01b038a1685529092019052902080548190610b09906001906116cc565b81548110610b1957610b196116df565b9060005260206000200154818681548110610b3657610b366116df565b906000526020600020018190555080805480610b5457610b546116f5565b600190038181906000526020600020016000905590558080549050600003610b9157336000908152600260205260409020610b8f90876111b6565b505b610ba0863384600101546111cb565b6001820154604080516001600160a01b038916815260208101929092527fccad973dcd043c7d680389db4378bd6b9775db7124092e9e0422c9e46d7985dc910160405180910390a150506001805550505050565b60056020528160005260406000208181548110610c1057600080fd5b60009182526020909120600590910201805460018201546002830154600384015460049094015492955090935091906001600160a01b031685565b600080600080600080600260008a6001600160a01b03166001600160a01b031681526020019081526020016000206002016000896001600160a01b03166001600160a01b031681526020019081526020016000208781548110610cb057610cb06116df565b906000526020600020015490506000600560008a6001600160a01b03166001600160a01b031681526020019081526020016000208281548110610cf557610cf56116df565b600091825260209091206005909102018054600182015460028301546003840154600490940154929e919d509b509199506001600160a01b0316975095505050505050565b3360009081526002602081815260408084206001600160a01b038916855290920190528120805485908110610d7157610d716116df565b90600052602060002001549050600060056000876001600160a01b03166001600160a01b031681526020019081526020016000208281548110610db657610db66116df565b906000526020600020906005020190508382148015610de1575060048101546001600160a01b031633145b610e1d5760405162461bcd60e51b815260206004820152600d60248201526c0989e8696409a92a69a82a8869609b1b60448201526064016103d9565b6001600160a01b0386166000908152600560205260409020805484919084908110610e4a57610e4a6116df565b906000526020600020906005020160020154610e669190611625565b6001600160a01b0387166000908152600560205260409020805484908110610e9057610e906116df565b9060005260206000209060050201600201819055507f71c14ef086b874eb67dfb59e568e663b10d224180cbda557478d775f62d121028660056000896001600160a01b03166001600160a01b031681526020019081526020016000208481548110610efd57610efd6116df565b600091825260209182902060026005909202010154604080516001600160a01b039094168452918301520160405180910390a1505050505050565b610f40610fb1565b6001600160a01b038116610fa55760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016103d9565b610fae8161115c565b50565b6000546001600160a01b031633146108f75760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016103d9565b600061095583836112e6565b604080516001600160a01b0385811660248301528481166044830152606480830185905283518084039091018152608490920183526020820180516001600160e01b03166323b872dd60e01b179052915160009283929088169161107b919061170b565b6000604051808303816000865af19150503d80600081146110b8576040519150601f19603f3d011682016040523d82523d6000602084013e6110bd565b606091505b50915091508180156110e75750805115806110e75750808060200190518101906110e7919061173a565b61113f5760405162461bcd60e51b8152602060048201526024808201527f5472616e7366657248656c7065723a205452414e534645525f46524f4d5f46416044820152631253115160e21b60648201526084016103d9565b505050505050565b6000610955836001600160a01b038416611310565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6000610385825490565b6000610955836001600160a01b03841661135f565b604080516001600160a01b038481166024830152604480830185905283518084039091018152606490920183526020820180516001600160e01b031663a9059cbb60e01b1790529151600092839290871691611227919061170b565b6000604051808303816000865af19150503d8060008114611264576040519150601f19603f3d011682016040523d82523d6000602084013e611269565b606091505b5091509150818015611293575080511580611293575080806020019051810190611293919061173a565b6112df5760405162461bcd60e51b815260206004820152601f60248201527f5472616e7366657248656c7065723a205452414e534645525f4641494c45440060448201526064016103d9565b5050505050565b60008260000182815481106112fd576112fd6116df565b9060005260206000200154905092915050565b600081815260018301602052604081205461135757508154600181810184556000848152602080822090930184905584548482528286019093526040902091909155610385565b506000610385565b600081815260018301602052604081205480156114485760006113836001836116cc565b8554909150600090611397906001906116cc565b90508181146113fc5760008660000182815481106113b7576113b76116df565b90600052602060002001549050808760000184815481106113da576113da6116df565b6000918252602080832090910192909255918252600188019052604090208390555b855486908061140d5761140d6116f5565b600190038181906000526020600020016000905590558560010160008681526020019081526020016000206000905560019350505050610385565b6000915050610385565b80356001600160a01b038116811461146957600080fd5b919050565b6000806040838503121561148157600080fd5b61148a83611452565b915061149860208401611452565b90509250929050565b6000602082840312156114b357600080fd5b5035919050565b6000602082840312156114cc57600080fd5b61095582611452565b600080600080608085870312156114eb57600080fd5b6114f485611452565b9350602085013592506040850135915061151060608601611452565b905092959194509250565b6000806040838503121561152e57600080fd5b50508035926020909101359150565b6000806040838503121561155057600080fd5b61155983611452565b946020939093013593505050565b60008060006060848603121561157c57600080fd5b61158584611452565b95602085013595506040909401359392505050565b6000806000606084860312156115af57600080fd5b6115b884611452565b92506115c660208501611452565b9150604084013590509250925092565b600080600080608085870312156115ec57600080fd5b6115f585611452565b966020860135965060408601359560600135945092505050565b634e487b7160e01b600052601160045260246000fd5b808201808211156103855761038561160f565b60008261165557634e487b7160e01b600052601260045260246000fd5b500490565b80820281158282048414176103855761038561160f565b60006020828403121561168357600080fd5b5051919050565b60208082526022908201527f496e76616c6964207472616e736665722c206d617920626520746f6b656e2066604082015261656560f01b606082015260800190565b818103818111156103855761038561160f565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052603160045260246000fd5b6000825160005b8181101561172c5760208186018101518583015201611712565b506000920191825250919050565b60006020828403121561174c57600080fd5b8151801515811461095557600080fdfea2646970667358221220a39b63e3a16ee3bbd93809843ca1dd7903d69613669accf6d86a9b0d9b3344d264736f6c63430008140033
Loading...
Loading
Loading...
Loading
Multichain Portfolio | 30 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.