Contract Address Details

0x16ca736c8B181772009e598F37f137e9cD36AFAE

Contract Name
ElectroSwapLockerV2
Creator
0xd6cf49–0769d0 at 0xc74114–9aeb06
Balance
0 ETN ( )
Tokens
Fetching tokens...
Transactions
36 Transactions
Transfers
33 Transfers
Gas Used
35,867,353
Last Balance Update
4808735
Contract name:
ElectroSwapLockerV2




Optimization enabled
true
Compiler version
v0.8.25+commit.b61c2a91




Optimization runs
500
Verified at
2024-04-19T15:30:11.212097Z

Constructor Arguments

000000000000000000000000203d550ed6fa9dab8a4190720cf9f65138abd15b000000000000000000000000043faa1b5c5fc9a7dc35171f290c29ecde0ccff1

Arg [0] (address) : 0x203d550ed6fa9dab8a4190720cf9f65138abd15b
Arg [1] (address) : 0x043faa1b5c5fc9a7dc35171f290c29ecde0ccff1

              

contracts/ElectroSwapLockerV2.sol

// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

import "./TransferHelper.sol";
import "./EnumerableSet.sol";
import "./ReentrancyGuard.sol";

interface IElectroSwapPair {
    function token0() external view returns (address);
    function token1() external view returns (address);
}

interface IElectroSwapFactory {
    function getPair(address tokenA, address tokenB) external view returns (address);
}

interface IMigrator {
    function migrate(address pairAddress, address owner, uint256 amountToMigrate, uint256 lockCreated, uint256 lockDuration) external returns (bool);
}

contract ElectroSwapLockerV2 is ReentrancyGuard {

    using EnumerableSet for EnumerableSet.AddressSet;

    event LiquidityLocked(address indexed owner, address indexed pair, uint amount, uint duration, uint indexed lockID);
    event LiquidityWithdrawn(address indexed owner, address indexed pair, uint amount, uint lockID);
    event LockTransferred(uint indexed lockID, address indexed previousOwner, address indexed newOwner);
    event LockSplit(uint indexed originalLockID, uint indexed newLockID);
    event LockIncreased(uint indexed lockID, uint existingAmount, uint existingDuration, uint newAmount, uint newDuration);
    event LockMigrated(uint indexed lockID);

    struct LockInfo {
        uint lockID; // Unique ID for this lock
        address pair; // Address of the liquidity pair that is locked
        address owner; // Address that is permitted to withdraw liquidity
        uint initial; // Initial number of tokens locked
        uint amount; // Current number of tokens locked
        uint created; // Timestamp in seconds when the lock was created
        uint duration; // Duration of lock in seconds from time of creation
    }

    struct Fees {
        uint etnFlatFee; // Amount of ETN paid as lock creation fee to stop spam
        uint boltFlatFee; // Amount of BOLT to be burned when paying lock creation fee in BOLT
        uint lpPercentFee; // Platform fee as a percentage of locked ElectroSwap LP tokens
    }

    modifier onlyTeam() {
        require(msg.sender == teamWallet, "Only contract owner can call this function");
        _;
    }

    address payable teamWallet;
    address public boltAddress;
    address private deadAddress = address(0x000000000000000000000000000000000000dEaD);
    
    uint public lockCount; // Global lock counter, used to derive lockID

    mapping(uint => LockInfo) private locksById; // Permanent mapping of lockID to locked liquidity info
    mapping(address => uint[]) private lockIDsByPairAddress; // Mapping of pair address to lockIDs, modified by withdrawals
    mapping(address => uint[]) private lockIDsByOwner; // Mapping of owner address to lockIDs, modified by withdrawals
    
    IElectroSwapFactory private electroSwapFactory;
    IMigrator private migrator;

    EnumerableSet.AddressSet private noFeeList; // List of addresses that do not pay any fees
    Fees private fees; // Stores the current fee structure

    constructor(IElectroSwapFactory _electroSwapFactory, address _boltAddress) {
        teamWallet = payable(msg.sender);
        electroSwapFactory = _electroSwapFactory;
        boltAddress = _boltAddress;

        fees.etnFlatFee = 1000; // 1000 ETN
        fees.boltFlatFee = 500; // 500 BOLT
        fees.lpPercentFee = 1; // 1%
    }

    function _setFees(uint _etnFlatFee, uint _boltFlatFee, uint _lpPercentFee) external onlyTeam {
        require(_etnFlatFee <= 2000, "Flat fee cannot be greater than 2000 ETN");
        require(_boltFlatFee <= 1000, "Flat fee cannot be greater than 1000 BOLT");
        require(_lpPercentFee <= 2, "LP percentage cannot be greater than 2%");

        fees.etnFlatFee = _etnFlatFee;
        fees.boltFlatFee = _boltFlatFee;
        fees.lpPercentFee = _lpPercentFee;
    }

    function _setTeamWallet(address payable _teamWallet) external onlyTeam {
        require(_teamWallet != address(0), "Team wallet cannot be zero address");
        teamWallet = _teamWallet;
    }

    function _updateFeeWhitelist(address _address, bool _addToWhitelist) external onlyTeam {
        if (_addToWhitelist) {
            noFeeList.add(_address);
        } else {
            noFeeList.remove(_address);
        }
    }

    function _setMigrator(IMigrator _migrator) external onlyTeam {
        migrator = _migrator;
    }

    // Creates a lock for _amountToLock LP tokens of the address provided for _duration (measured in seconds)
    // A flat rate fee is charged to mitigate spam. Pass true for _feeInETN if paying in ETN, or false if paying in BOLT
    // A 1% percent fee (at time of deployment) of deposited liquidity is distributed to the team wallet
    function lock(address _pairAddress, uint _duration, uint _amountToLock, bool _feeInETN) external payable nonReentrant returns (uint){
        require(_duration > 0, "Lock duration must be greater than zero");
        require(_amountToLock > 0, "Amount to lock must be greater than zero");

        // ensure this pair is a univ2 pair by querying the factory
        IElectroSwapPair pair = IElectroSwapPair(address(_pairAddress));
        address factoryPairAddress = electroSwapFactory.getPair(pair.token0(), pair.token1());
        require(factoryPairAddress == _pairAddress, 'Only ElectroSwap LP tokens can be locked');
        
        // requires prior allowance on the LP token contract for this locker contract to transfer LP tokens
        TransferHelper.safeTransferFrom(_pairAddress, address(msg.sender), address(this), _amountToLock); 

        uint256 liquidityFee = 0;

        if (!noFeeList.contains(msg.sender)) {
            if (_feeInETN) { // Flat rate fee to be paid in ETN
                require(msg.value == (fees.etnFlatFee * 1e18), "Flat rate ETN fee not met");
                (bool etnTransferSuccess, ) = teamWallet.call{value: msg.value}("");
                require(etnTransferSuccess, "Failed to transfer ETN");
            } else { // Flat rate fee to be paid in BOLT Token, and then burned
                TransferHelper.safeTransferFrom(address(boltAddress), address(msg.sender), deadAddress, (fees.boltFlatFee * 1e18));
            }
            // percentage of liquidity fee
            liquidityFee = ((_amountToLock * 100) * fees.lpPercentFee) / 10000;
            // round fee up to 1 if truncated
            liquidityFee = liquidityFee == 0 ? 1 : liquidityFee;
            TransferHelper.safeTransfer(_pairAddress, teamWallet, liquidityFee);

        } else if (msg.value > 0){
            // refund ETN if whitelisted
            (bool etnRefundSuccess, ) = payable(msg.sender).call{value: msg.value}("");
            require(etnRefundSuccess, "Failed to refund ETN");
        }

        // If a liquidity fee was charged, remove the fee from the number of tokens that are considered locked.
        uint numTokensLocked = _amountToLock - liquidityFee;

        // Create lock, and increment lock count
        uint lockID = lockCount;
        locksById[lockID] = LockInfo(lockID, _pairAddress, msg.sender, numTokensLocked, numTokensLocked, block.timestamp, _duration);
        lockCount++;

        // Add the lockID to the array associated with the pair and the owner addresses
        lockIDsByPairAddress[_pairAddress].push(lockID);
        lockIDsByOwner[msg.sender].push(lockID);

        emit LiquidityLocked(msg.sender, _pairAddress, numTokensLocked, _duration, lockID);

        return lockID;
    }

    // Withdraws liquidity from a lock to the owner
    // If a the amount to withdraw is less than the amount in the lock, a new lock will be created
    // for the remaining amount using the passed in _remainderDuration (starting at withdrawal time)
    function withdraw(uint _lockID, uint _amountToWithdraw, uint _remainderDuration) external nonReentrant {
        LockInfo storage lockInfo = locksById[_lockID];
        
        require(lockInfo.owner == msg.sender, "Caller is not the owner of the lock");
        require(lockInfo.amount > 0, "No tokens to withdraw");
        require(_amountToWithdraw > 0, "Amount to withdraw must be a positive number");
        require(lockInfo.amount >= _amountToWithdraw, "Cannot withdraw more than is locked");

        // Check if the lock duration has elapsed
        uint elapsedTime = block.timestamp - lockInfo.created;
        require(elapsedTime >= lockInfo.duration, "Lock duration not elapsed");
       
        // Partial withdrawal, create a new lock with the remaining amount for the same duration       
        if (_amountToWithdraw < lockInfo.amount) {
            _splitLockInternal(_lockID, lockInfo.amount - _amountToWithdraw, _remainderDuration);
        } 

        // Remove the lockID from being tracked in lockIDsByPairAddress and lockIDsByOwner mappings. 
        _removeLockReferenceFromPair(lockInfo);
        _removeLockReferenceFromOwner(lockInfo);

        // Remove the amount being withdrawn from the lock
        lockInfo.amount -= _amountToWithdraw;

        // Transfer the requested tokens back to the user
        TransferHelper.safeTransfer(lockInfo.pair, msg.sender, _amountToWithdraw);
        emit LiquidityWithdrawn(msg.sender, lockInfo.pair, _amountToWithdraw, _lockID);
    }

    // Reentrancy protection wrapper that splits locks
    function splitLock(uint _lockID, uint _newLockAmount, uint _newLockDuration) public nonReentrant {
        _splitLockInternal(_lockID, _newLockAmount, _newLockDuration);
    }

    // Transfer ownership to a new owner. Only the owner of the lock can call this function.
    function transferLock(uint _lockID, address _newOwner) external nonReentrant {

        require(_newOwner != address(0), "New owner cannot be zero address");
        
        LockInfo storage lockInfo = locksById[_lockID];
        require(lockInfo.owner == msg.sender, "Caller is not the current owner of the lock");
        
        // Remove lock reference from current owner
        _removeLockReferenceFromOwner(lockInfo);

        // Set new owner and add lock reference for new owner
        lockInfo.owner = _newOwner;
        lockIDsByOwner[_newOwner].push(_lockID);
        
        emit LockTransferred(_lockID, msg.sender, _newOwner);
    }

    // Increases the amount of LP tokens locked, and/or extends the duration beyond the existing duration
    // NOTE: The create timestamp is not modified, so ensure that the desired end time is based on create time and the current duration
    function increaseLock(uint _lockID, uint _additionalTokens, uint _additionalTime) external nonReentrant {
        LockInfo storage lockInfo = locksById[_lockID];
        require(lockInfo.owner == msg.sender, "Caller is not the owner of the lock");
        require(_additionalTokens > 0 || _additionalTime > 0, "Must add LP tokens, or time (or both)");
        
        // Increase the duration of the lock
        uint existingDuration = lockInfo.duration;
        if (_additionalTime > 0) {
            require(lockInfo.created + lockInfo.duration + _additionalTime > block.timestamp, "Lock maturation would be in the past");
            lockInfo.duration += _additionalTime;
        }

        // Transfer the additional tokens, and increase amount of the lock
        uint existingAmount = lockInfo.amount;
        if (_additionalTokens > 0) {
            
            // requires prior allowance on the LP token contract for this locker contract to transfer LP tokens
            TransferHelper.safeTransferFrom(lockInfo.pair, address(msg.sender), address(this), _additionalTokens); 
            
            uint256 liquidityFee = 0;
            if (!noFeeList.contains(msg.sender)) {
                // percentage of liquidity fee transferred to the team wallet
                liquidityFee = ((_additionalTokens * 100) * fees.lpPercentFee) / 10000;
                // round fee up to 1 if truncated
                liquidityFee = liquidityFee == 0 ? 1 : liquidityFee;
                TransferHelper.safeTransfer(lockInfo.pair, teamWallet, liquidityFee);
            }

            // If a liquidity fee was charged, remove the fee from the number of tokens that are considered locked.
            uint additionalAmountToLock = _additionalTokens - liquidityFee;

            lockInfo.amount += additionalAmountToLock;
        }

        emit LockIncreased(_lockID, existingAmount, existingDuration, lockInfo.amount, lockInfo.duration);
    }

    // To be used in future if Uniswap V3 type liquidity support is added
    function migrateLock(uint _lockID) external nonReentrant {
        require(address(migrator) != address(0), "Migrator not set");

        LockInfo storage lockInfo = locksById[_lockID];
        require(lockInfo.owner == msg.sender, "Caller is not the owner of the lock");
        require(lockInfo.amount > 0, "No tokens to migrate");

        // Mark the lock as empty before external call
        uint256 amountToMigrate = lockInfo.amount;
        lockInfo.amount = 0;

        // Transfer the LP tokens to the migrator contract
        TransferHelper.safeTransfer(lockInfo.pair, address(migrator), amountToMigrate);

        // Attempt to migrate the tokens
        require(migrator.migrate(lockInfo.pair, lockInfo.owner, amountToMigrate, lockInfo.created, lockInfo.duration), "Migration failed");

        emit LockMigrated(_lockID);
    }

    function getLockById(uint _lockID) external view returns (LockInfo memory){
        return locksById[_lockID];
    }

    function getLockIDsByPairAddress(address _pairAddress) external view returns (uint[] memory){
        return lockIDsByPairAddress[_pairAddress];
    }

    function getLockIDsByOwner(address _owner) external view returns (uint[] memory){
        return lockIDsByOwner[_owner];
    }

    function getBlockTime() external view returns (uint){
        return block.timestamp;
    }

    // This returns fees with decimals considered to be easily human readable. 
    // The flat rate fee values get multiplied by 1e18 for the actual fee amount
    function getFees(bool _noop) external view returns (Fees memory){
        return _noop ? fees : fees;
    }
    
    // Used to split locks, called from external facing functions
    function _splitLockInternal(uint _lockID, uint _newLockAmount, uint _newLockDuration) internal {
        LockInfo storage originalLock = locksById[_lockID];
        
        require(originalLock.owner == msg.sender, "Caller is not the owner of the lock");
        require(_newLockAmount > 0, "New lock amount must be > 0");
        require(_newLockDuration > 0, "New lock duration must be > 0");
        require(originalLock.amount >= _newLockAmount, "New amount must be less than to the original amount");

        // Calculate original lock's maturation time
        uint originalLockMaturation = originalLock.created + originalLock.duration;
        // Ensure the new lock's maturation time is after the original lock's maturation time
        require(block.timestamp + _newLockDuration > originalLockMaturation, "New lock's maturation must be after the original lock's maturation");

        // Reduce the amount of the original lock
        originalLock.amount -= _newLockAmount;

        // Create a new lock with the new amount and duration
        uint newLockID = lockCount;
        locksById[newLockID] = LockInfo(newLockID, originalLock.pair, originalLock.owner, _newLockAmount, _newLockAmount, block.timestamp, _newLockDuration);

        // Increment the global lock counter
        lockCount++;

        // Add the new lockID to the arrays associated with the pair address and owner address
        lockIDsByPairAddress[originalLock.pair].push(newLockID);
        lockIDsByOwner[originalLock.owner].push(newLockID);

        emit LockSplit(originalLock.lockID, newLockID);
        emit LiquidityLocked(originalLock.owner, originalLock.pair, _newLockAmount, _newLockDuration, newLockID);
    }

    // Remove the lockID from lockIDsByPairAddress mapping
    function _removeLockReferenceFromPair(LockInfo memory _lockInfo) internal {
        uint[] storage pairLockIDs = lockIDsByPairAddress[_lockInfo.pair];
        for (uint i = 0; i < pairLockIDs.length; i++) {
            if (pairLockIDs[i] == _lockInfo.lockID) {
                pairLockIDs[i] = pairLockIDs[pairLockIDs.length - 1];
                pairLockIDs.pop();
                break;
            }
        }
    }

    // Remove the lockID from lockIDsByOwner mapping
    function _removeLockReferenceFromOwner(LockInfo memory _lockInfo) internal {
        uint[] storage ownerLockIDs = lockIDsByOwner[_lockInfo.owner];
        for (uint i = 0; i < ownerLockIDs.length; i++) {
            if (ownerLockIDs[i] == _lockInfo.lockID) {
                ownerLockIDs[i] = ownerLockIDs[ownerLockIDs.length - 1];
                ownerLockIDs.pop();
                break;
            }
        }
    }
}
        

contracts/EnumerableSet.sol

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (utils/structs/EnumerableSet.sol)
// This file was procedurally generated from scripts/generate/templates/EnumerableSet.js.

pragma solidity ^0.8.20;

/**
 * @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 is the index of the value in the `values` array plus 1.
        // Position 0 is used to mean a value is not in the set.
        mapping(bytes32 value => uint256) _positions;
    }

    /**
     * @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._positions[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 cache the value's position to prevent multiple reads from the same storage slot
        uint256 position = set._positions[value];

        if (position != 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 valueIndex = position - 1;
            uint256 lastIndex = set._values.length - 1;

            if (valueIndex != lastIndex) {
                bytes32 lastValue = set._values[lastIndex];

                // Move the lastValue to the index where the value to delete is
                set._values[valueIndex] = lastValue;
                // Update the tracked position of the lastValue (that was just moved)
                set._positions[lastValue] = position;
            }

            // Delete the slot where the moved value was stored
            set._values.pop();

            // Delete the tracked position for the deleted slot
            delete set._positions[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._positions[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;
    }
}
          

contracts/ReentrancyGuard.sol

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (utils/ReentrancyGuard.sol)

pragma solidity ^0.8.20;

/**
 * @dev Contract module that helps prevent reentrant calls to a function.
 *
 * Inheriting from `ReentrancyGuard` will make the {nonReentrant} modifier
 * available, which can be applied to functions to make sure there are no nested
 * (reentrant) calls to them.
 *
 * Note that because there is a single `nonReentrant` guard, functions marked as
 * `nonReentrant` may not call one another. This can be worked around by making
 * those functions `private`, and then adding `external` `nonReentrant` entry
 * points to them.
 *
 * TIP: If you would like to learn more about reentrancy and alternative ways
 * to protect against it, check out our blog post
 * https://blog.openzeppelin.com/reentrancy-after-istanbul/[Reentrancy After Istanbul].
 */
abstract contract ReentrancyGuard {
    // Booleans are more expensive than uint256 or any type that takes up a full
    // word because each write operation emits an extra SLOAD to first read the
    // slot's contents, replace the bits taken up by the boolean, and then write
    // back. This is the compiler's defense against contract upgrades and
    // pointer aliasing, and it cannot be disabled.

    // The values being non-zero value makes deployment a bit more expensive,
    // but in exchange the refund on every call to nonReentrant will be lower in
    // amount. Since refunds are capped to a percentage of the total
    // transaction's gas, it is best to keep them low in cases like this one, to
    // increase the likelihood of the full refund coming into effect.
    uint256 private constant NOT_ENTERED = 1;
    uint256 private constant ENTERED = 2;

    uint256 private _status;

    /**
     * @dev Unauthorized reentrant call.
     */
    error ReentrancyGuardReentrantCall();

    constructor() {
        _status = NOT_ENTERED;
    }

    /**
     * @dev Prevents a contract from calling itself, directly or indirectly.
     * Calling a `nonReentrant` function from another `nonReentrant`
     * function is not supported. It is possible to prevent this from happening
     * by making the `nonReentrant` function external, and making it call a
     * `private` function that does the actual work.
     */
    modifier nonReentrant() {
        _nonReentrantBefore();
        _;
        _nonReentrantAfter();
    }

    function _nonReentrantBefore() private {
        // On the first call to nonReentrant, _status will be NOT_ENTERED
        if (_status == ENTERED) {
            revert ReentrancyGuardReentrantCall();
        }

        // Any calls to nonReentrant after this point will fail
        _status = ENTERED;
    }

    function _nonReentrantAfter() private {
        // By storing the original value once again, a refund is triggered (see
        // https://eips.ethereum.org/EIPS/eip-2200)
        _status = NOT_ENTERED;
    }

    /**
     * @dev Returns true if the reentrancy guard is currently set to "entered", which indicates there is a
     * `nonReentrant` function in the call stack.
     */
    function _reentrancyGuardEntered() internal view returns (bool) {
        return _status == ENTERED;
    }
}
          

contracts/TransferHelper.sol

// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

// helper methods for interacting with ERC20 tokens that do not consistently return true/false
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');
    }

}
          

Contract ABI

[{"type":"constructor","stateMutability":"nonpayable","inputs":[{"type":"address","name":"_electroSwapFactory","internalType":"contract IElectroSwapFactory"},{"type":"address","name":"_boltAddress","internalType":"address"}]},{"type":"error","name":"ReentrancyGuardReentrantCall","inputs":[]},{"type":"event","name":"LiquidityLocked","inputs":[{"type":"address","name":"owner","internalType":"address","indexed":true},{"type":"address","name":"pair","internalType":"address","indexed":true},{"type":"uint256","name":"amount","internalType":"uint256","indexed":false},{"type":"uint256","name":"duration","internalType":"uint256","indexed":false},{"type":"uint256","name":"lockID","internalType":"uint256","indexed":true}],"anonymous":false},{"type":"event","name":"LiquidityWithdrawn","inputs":[{"type":"address","name":"owner","internalType":"address","indexed":true},{"type":"address","name":"pair","internalType":"address","indexed":true},{"type":"uint256","name":"amount","internalType":"uint256","indexed":false},{"type":"uint256","name":"lockID","internalType":"uint256","indexed":false}],"anonymous":false},{"type":"event","name":"LockIncreased","inputs":[{"type":"uint256","name":"lockID","internalType":"uint256","indexed":true},{"type":"uint256","name":"existingAmount","internalType":"uint256","indexed":false},{"type":"uint256","name":"existingDuration","internalType":"uint256","indexed":false},{"type":"uint256","name":"newAmount","internalType":"uint256","indexed":false},{"type":"uint256","name":"newDuration","internalType":"uint256","indexed":false}],"anonymous":false},{"type":"event","name":"LockMigrated","inputs":[{"type":"uint256","name":"lockID","internalType":"uint256","indexed":true}],"anonymous":false},{"type":"event","name":"LockSplit","inputs":[{"type":"uint256","name":"originalLockID","internalType":"uint256","indexed":true},{"type":"uint256","name":"newLockID","internalType":"uint256","indexed":true}],"anonymous":false},{"type":"event","name":"LockTransferred","inputs":[{"type":"uint256","name":"lockID","internalType":"uint256","indexed":true},{"type":"address","name":"previousOwner","internalType":"address","indexed":true},{"type":"address","name":"newOwner","internalType":"address","indexed":true}],"anonymous":false},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"_setFees","inputs":[{"type":"uint256","name":"_etnFlatFee","internalType":"uint256"},{"type":"uint256","name":"_boltFlatFee","internalType":"uint256"},{"type":"uint256","name":"_lpPercentFee","internalType":"uint256"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"_setMigrator","inputs":[{"type":"address","name":"_migrator","internalType":"contract IMigrator"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"_setTeamWallet","inputs":[{"type":"address","name":"_teamWallet","internalType":"address payable"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"_updateFeeWhitelist","inputs":[{"type":"address","name":"_address","internalType":"address"},{"type":"bool","name":"_addToWhitelist","internalType":"bool"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"address"}],"name":"boltAddress","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"getBlockTime","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"tuple","name":"","internalType":"struct ElectroSwapLockerV2.Fees","components":[{"type":"uint256","name":"etnFlatFee","internalType":"uint256"},{"type":"uint256","name":"boltFlatFee","internalType":"uint256"},{"type":"uint256","name":"lpPercentFee","internalType":"uint256"}]}],"name":"getFees","inputs":[{"type":"bool","name":"_noop","internalType":"bool"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"tuple","name":"","internalType":"struct ElectroSwapLockerV2.LockInfo","components":[{"type":"uint256","name":"lockID","internalType":"uint256"},{"type":"address","name":"pair","internalType":"address"},{"type":"address","name":"owner","internalType":"address"},{"type":"uint256","name":"initial","internalType":"uint256"},{"type":"uint256","name":"amount","internalType":"uint256"},{"type":"uint256","name":"created","internalType":"uint256"},{"type":"uint256","name":"duration","internalType":"uint256"}]}],"name":"getLockById","inputs":[{"type":"uint256","name":"_lockID","internalType":"uint256"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256[]","name":"","internalType":"uint256[]"}],"name":"getLockIDsByOwner","inputs":[{"type":"address","name":"_owner","internalType":"address"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256[]","name":"","internalType":"uint256[]"}],"name":"getLockIDsByPairAddress","inputs":[{"type":"address","name":"_pairAddress","internalType":"address"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"increaseLock","inputs":[{"type":"uint256","name":"_lockID","internalType":"uint256"},{"type":"uint256","name":"_additionalTokens","internalType":"uint256"},{"type":"uint256","name":"_additionalTime","internalType":"uint256"}]},{"type":"function","stateMutability":"payable","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"lock","inputs":[{"type":"address","name":"_pairAddress","internalType":"address"},{"type":"uint256","name":"_duration","internalType":"uint256"},{"type":"uint256","name":"_amountToLock","internalType":"uint256"},{"type":"bool","name":"_feeInETN","internalType":"bool"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"lockCount","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"migrateLock","inputs":[{"type":"uint256","name":"_lockID","internalType":"uint256"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"splitLock","inputs":[{"type":"uint256","name":"_lockID","internalType":"uint256"},{"type":"uint256","name":"_newLockAmount","internalType":"uint256"},{"type":"uint256","name":"_newLockDuration","internalType":"uint256"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"transferLock","inputs":[{"type":"uint256","name":"_lockID","internalType":"uint256"},{"type":"address","name":"_newOwner","internalType":"address"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"withdraw","inputs":[{"type":"uint256","name":"_lockID","internalType":"uint256"},{"type":"uint256","name":"_amountToWithdraw","internalType":"uint256"},{"type":"uint256","name":"_remainderDuration","internalType":"uint256"}]}]
            

Deployed ByteCode

0x6080604052600436106100fe5760003560e01c80639b10b6f511610095578063a4375fcd11610064578063a4375fcd14610320578063b48dd3be14610340578063b80ec98d14610360578063b8aa7e8c14610380578063c6c16924146103a057600080fd5b80639b10b6f51461029f5780639bf92698146102b5578063a060a9f0146102c8578063a41fe49f1461030057600080fd5b8063619e8449116100d1578063619e844914610215578063646c31731461024257806387ceff09146102625780638cb1f9f71461027f57600080fd5b806308f124701461010357806314ca639e1461019157806347dfe70d146101d357806351d2a82d146101f5575b600080fd5b34801561010f57600080fd5b5061012361011e366004612409565b6103c0565b6040516101889190600060e0820190508251825260208301516001600160a01b0380821660208501528060408601511660408501525050606083015160608301526080830151608083015260a083015160a083015260c083015160c083015292915050565b60405180910390f35b34801561019d57600080fd5b506101b16101ac366004612430565b610482565b6040805182518152602080840151908201529181015190820152606001610188565b3480156101df57600080fd5b506101f36101ee366004612469565b6104dd565b005b34801561020157600080fd5b506101f3610210366004612486565b610571565b34801561022157600080fd5b50610235610230366004612469565b610814565b60405161018891906124b2565b34801561024e57600080fd5b506101f361025d366004612486565b610880565b34801561026e57600080fd5b50425b604051908152602001610188565b34801561028b57600080fd5b5061023561029a366004612469565b610a23565b3480156102ab57600080fd5b5061027160045481565b6102716102c33660046124f6565b610a8d565b3480156102d457600080fd5b506002546102e8906001600160a01b031681565b6040516001600160a01b039091168152602001610188565b34801561030c57600080fd5b506101f361031b366004612486565b61113b565b34801561032c57600080fd5b506101f361033b366004612409565b6114ac565b34801561034c57600080fd5b506101f361035b366004612540565b611725565b34801561036c57600080fd5b506101f361037b366004612469565b6118df565b34801561038c57600080fd5b506101f361039b366004612486565b6119cf565b3480156103ac57600080fd5b506101f36103bb366004612570565b6119ec565b6104126040518060e001604052806000815260200160006001600160a01b0316815260200160006001600160a01b03168152602001600081526020016000815260200160008152602001600081525090565b50600090815260056020818152604092839020835160e0810185528154815260018201546001600160a01b039081169382019390935260028201549092169382019390935260038301546060820152600483015460808201529082015460a082015260069091015460c082015290565b6104a660405180606001604052806000815260200160008152602001600081525090565b816104b257600c6104b5565b600c5b6040805160608101825282548152600183015460208201526002909201549082015292915050565b6001546001600160a01b0316331461054f5760405162461bcd60e51b815260206004820152602a60248201527f4f6e6c7920636f6e7472616374206f776e65722063616e2063616c6c207468696044820152693990333ab731ba34b7b760b11b60648201526084015b60405180910390fd5b600980546001600160a01b0319166001600160a01b0392909216919091179055565b610579611a75565b600083815260056020526040902060028101546001600160a01b031633146105ef5760405162461bcd60e51b815260206004820152602360248201527f43616c6c6572206973206e6f7420746865206f776e6572206f6620746865206c6044820152626f636b60e81b6064820152608401610546565b60008311806105fe5750600082115b6106585760405162461bcd60e51b815260206004820152602560248201527f4d75737420616464204c5020746f6b656e732c206f722074696d6520286f7220604482015264626f74682960d81b6064820152608401610546565b600681015482156106f65742838360060154846005015461067991906125b4565b61068391906125b4565b116106dc5760405162461bcd60e51b8152602060048201526024808201527f4c6f636b206d617475726174696f6e20776f756c6420626520696e20746865206044820152631c185cdd60e21b6064820152608401610546565b828260060160008282546106f091906125b4565b90915550505b600482015484156107af57600183015461071b906001600160a01b0316333088611a9f565b6000610728600a33611bcf565b61078557600e546127109061073e8860646125c7565b61074891906125c7565b61075291906125de565b905080156107605780610763565b60015b6001808601549054919250610785916001600160a01b03918216911683611bf6565b60006107918288612600565b9050808560040160008282546107a791906125b4565b909155505050505b60048301546006840154604080518481526020810186905290810192909252606082015286907f6b26190974ccb49e1077e69f86bee056c6fa802cc973804af058b9226b96bab09060800160405180910390a250505061080f6001600055565b505050565b6001600160a01b03811660009081526007602090815260409182902080548351818402810184019094528084526060939283018282801561087457602002820191906000526020600020905b815481526020019060010190808311610860575b50505050509050919050565b6001546001600160a01b031633146108ed5760405162461bcd60e51b815260206004820152602a60248201527f4f6e6c7920636f6e7472616374206f776e65722063616e2063616c6c207468696044820152693990333ab731ba34b7b760b11b6064820152608401610546565b6107d08311156109505760405162461bcd60e51b815260206004820152602860248201527f466c6174206665652063616e6e6f742062652067726561746572207468616e20604482015267191818181022aa2760c11b6064820152608401610546565b6103e88211156109b45760405162461bcd60e51b815260206004820152602960248201527f466c6174206665652063616e6e6f742062652067726561746572207468616e206044820152680c4c0c0c081093d31560ba1b6064820152608401610546565b6002811115610a155760405162461bcd60e51b815260206004820152602760248201527f4c502070657263656e746167652063616e6e6f742062652067726561746572206044820152667468616e20322560c81b6064820152608401610546565b600c92909255600d55600e55565b6001600160a01b03811660009081526006602090815260409182902080548351818402810184019094528084526060939283018282801561087457602002820191906000526020600020908154815260200190600101908083116108605750505050509050919050565b6000610a97611a75565b60008411610af75760405162461bcd60e51b815260206004820152602760248201527f4c6f636b206475726174696f6e206d7573742062652067726561746572207468604482015266616e207a65726f60c81b6064820152608401610546565b60008311610b585760405162461bcd60e51b815260206004820152602860248201527f416d6f756e7420746f206c6f636b206d7573742062652067726561746572207460448201526768616e207a65726f60c01b6064820152608401610546565b60085460408051630dfe168160e01b8152905187926000926001600160a01b039182169263e6a4390592861691630dfe16819160048083019260209291908290030181865afa158015610baf573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610bd39190612613565b846001600160a01b031663d21220a76040518163ffffffff1660e01b8152600401602060405180830381865afa158015610c11573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c359190612613565b6040517fffffffff0000000000000000000000000000000000000000000000000000000060e085901b1681526001600160a01b03928316600482015291166024820152604401602060405180830381865afa158015610c98573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610cbc9190612613565b9050866001600160a01b0316816001600160a01b031614610d305760405162461bcd60e51b815260206004820152602860248201527f4f6e6c7920456c656374726f53776170204c5020746f6b656e732063616e206260448201526719481b1bd8dad95960c21b6064820152608401610546565b610d3c87333088611a9f565b6000610d49600a33611bcf565b610eeb578415610e5f57600c54610d6890670de0b6b3a76400006125c7565b3414610db65760405162461bcd60e51b815260206004820152601960248201527f466c617420726174652045544e20666565206e6f74206d6574000000000000006044820152606401610546565b6001546040516000916001600160a01b03169034908381818185875af1925050503d8060008114610e03576040519150601f19603f3d011682016040523d82523d6000602084013e610e08565b606091505b5050905080610e595760405162461bcd60e51b815260206004820152601660248201527f4661696c656420746f207472616e736665722045544e000000000000000000006044820152606401610546565b50610e94565b600254600354600d54610e94926001600160a01b03908116923392911690610e8f90670de0b6b3a76400006125c7565b611a9f565b600e5461271090610ea68860646125c7565b610eb091906125c7565b610eba91906125de565b90508015610ec85780610ecb565b60015b600154909150610ee69089906001600160a01b031683611bf6565b610f8b565b3415610f8b57604051600090339034908381818185875af1925050503d8060008114610f33576040519150601f19603f3d011682016040523d82523d6000602084013e610f38565b606091505b5050905080610f895760405162461bcd60e51b815260206004820152601460248201527f4661696c656420746f20726566756e642045544e0000000000000000000000006044820152606401610546565b505b6000610f978288612600565b9050600060045490506040518060e001604052808281526020018b6001600160a01b03168152602001336001600160a01b031681526020018381526020018381526020014281526020018a815250600560008381526020019081526020016000206000820151816000015560208201518160010160006101000a8154816001600160a01b0302191690836001600160a01b0316021790555060408201518160020160006101000a8154816001600160a01b0302191690836001600160a01b03160217905550606082015181600301556080820151816004015560a0820151816005015560c082015181600601559050506004600081548092919061109a90612630565b90915550506001600160a01b038a166000818152600660209081526040808320805460018082018355918552838520018690553380855260078452828520805492830181558552938390200185905580518681529182018d9052849392917ff4b9a080e56a4477654f2a26c905a99a6e0b157b67536012e7423a41860401dd910160405180910390a49450505050506111336001600055565b949350505050565b611143611a75565b600083815260056020526040902060028101546001600160a01b031633146111b95760405162461bcd60e51b815260206004820152602360248201527f43616c6c6572206973206e6f7420746865206f776e6572206f6620746865206c6044820152626f636b60e81b6064820152608401610546565b600081600401541161120d5760405162461bcd60e51b815260206004820152601560248201527f4e6f20746f6b656e7320746f20776974686472617700000000000000000000006044820152606401610546565b600083116112725760405162461bcd60e51b815260206004820152602c60248201527f416d6f756e7420746f207769746864726177206d757374206265206120706f7360448201526b34ba34bb3290373ab6b132b960a11b6064820152608401610546565b82816004015410156112d25760405162461bcd60e51b815260206004820152602360248201527f43616e6e6f74207769746864726177206d6f7265207468616e206973206c6f636044820152621ad95960ea1b6064820152608401610546565b60008160050154426112e49190612600565b9050816006015481101561133a5760405162461bcd60e51b815260206004820152601960248201527f4c6f636b206475726174696f6e206e6f7420656c6170736564000000000000006044820152606401610546565b8160040154841015611360576113608585846004015461135a9190612600565b85611d11565b6040805160e0810182528354815260018401546001600160a01b039081166020830152600285015416918101919091526003830154606082015260048301546080820152600583015460a0820152600683015460c08201526113c19061216a565b6040805160e0810182528354815260018401546001600160a01b039081166020830152600285015416918101919091526003830154606082015260048301546080820152600583015460a0820152600683015460c082015261142290612237565b838260040160008282546114369190612600565b90915550506001820154611454906001600160a01b03163386611bf6565b600182015460408051868152602081018890526001600160a01b039092169133917fba0b893b2f314a229997e335266881b5ac6b290bd350d2c23cc57160b77882b8910160405180910390a3505061080f6001600055565b6114b4611a75565b6009546001600160a01b031661150c5760405162461bcd60e51b815260206004820152601060248201527f4d69677261746f72206e6f7420736574000000000000000000000000000000006044820152606401610546565b600081815260056020526040902060028101546001600160a01b031633146115825760405162461bcd60e51b815260206004820152602360248201527f43616c6c6572206973206e6f7420746865206f776e6572206f6620746865206c6044820152626f636b60e81b6064820152608401610546565b60008160040154116115d65760405162461bcd60e51b815260206004820152601460248201527f4e6f20746f6b656e7320746f206d6967726174650000000000000000000000006044820152606401610546565b60048101805460009091556001820154600954611600916001600160a01b03908116911683611bf6565b6009546001830154600284015460058501546006860154604051633bdf278d60e21b81526001600160a01b0394851660048201529284166024840152604483018690526064830191909152608482015291169063ef7c9e349060a4016020604051808303816000875af115801561167b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061169f9190612649565b6116eb5760405162461bcd60e51b815260206004820152601060248201527f4d6967726174696f6e206661696c6564000000000000000000000000000000006044820152606401610546565b60405183907f4bc52e28577cc27a82d053cd49f2d3dfdd860210c8fa28a208d168a55177bb8390600090a250506117226001600055565b50565b61172d611a75565b6001600160a01b0381166117835760405162461bcd60e51b815260206004820181905260248201527f4e6577206f776e65722063616e6e6f74206265207a65726f20616464726573736044820152606401610546565b600082815260056020526040902060028101546001600160a01b031633146118015760405162461bcd60e51b815260206004820152602b60248201527f43616c6c6572206973206e6f74207468652063757272656e74206f776e65722060448201526a6f6620746865206c6f636b60a81b6064820152608401610546565b6040805160e0810182528254815260018301546001600160a01b039081166020830152600284015416918101919091526003820154606082015260048201546080820152600582015460a0820152600682015460c082015261186290612237565b6002810180546001600160a01b0319166001600160a01b0384169081179091556000818152600760209081526040808320805460018101825590845291832090910186905551339186917f902e03d40a887f58f46d747f437ac0a7b3028d6218bc4af171aef594fcd7e3e79190a4506118db6001600055565b5050565b6001546001600160a01b0316331461194c5760405162461bcd60e51b815260206004820152602a60248201527f4f6e6c7920636f6e7472616374206f776e65722063616e2063616c6c207468696044820152693990333ab731ba34b7b760b11b6064820152608401610546565b6001600160a01b0381166119ad5760405162461bcd60e51b815260206004820152602260248201527f5465616d2077616c6c65742063616e6e6f74206265207a65726f206164647265604482015261737360f01b6064820152608401610546565b600180546001600160a01b0319166001600160a01b0392909216919091179055565b6119d7611a75565b6119e2838383611d11565b61080f6001600055565b6001546001600160a01b03163314611a595760405162461bcd60e51b815260206004820152602a60248201527f4f6e6c7920636f6e7472616374206f776e65722063616e2063616c6c207468696044820152693990333ab731ba34b7b760b11b6064820152608401610546565b8015611a6a5761080f600a8361229d565b61080f600a836122b2565b600260005403611a9857604051633ee5aeb560e01b815260040160405180910390fd5b6002600055565b604080516001600160a01b0385811660248301528481166044830152606480830185905283518084039091018152608490920183526020820180516001600160e01b03166323b872dd60e01b1790529151600092839290881691611b039190612666565b6000604051808303816000865af19150503d8060008114611b40576040519150601f19603f3d011682016040523d82523d6000602084013e611b45565b606091505b5091509150818015611b6f575080511580611b6f575080806020019051810190611b6f9190612649565b611bc75760405162461bcd60e51b8152602060048201526024808201527f5472616e7366657248656c7065723a205452414e534645525f46524f4d5f46416044820152631253115160e21b6064820152608401610546565b505050505050565b6001600160a01b038116600090815260018301602052604081205415155b90505b92915050565b604080516001600160a01b038481166024830152604480830185905283518084039091018152606490920183526020820180516001600160e01b031663a9059cbb60e01b1790529151600092839290871691611c529190612666565b6000604051808303816000865af19150503d8060008114611c8f576040519150601f19603f3d011682016040523d82523d6000602084013e611c94565b606091505b5091509150818015611cbe575080511580611cbe575080806020019051810190611cbe9190612649565b611d0a5760405162461bcd60e51b815260206004820152601f60248201527f5472616e7366657248656c7065723a205452414e534645525f4641494c4544006044820152606401610546565b5050505050565b600083815260056020526040902060028101546001600160a01b03163314611d875760405162461bcd60e51b815260206004820152602360248201527f43616c6c6572206973206e6f7420746865206f776e6572206f6620746865206c6044820152626f636b60e81b6064820152608401610546565b60008311611dd75760405162461bcd60e51b815260206004820152601b60248201527f4e6577206c6f636b20616d6f756e74206d757374206265203e203000000000006044820152606401610546565b60008211611e275760405162461bcd60e51b815260206004820152601d60248201527f4e6577206c6f636b206475726174696f6e206d757374206265203e20300000006044820152606401610546565b8281600401541015611ea15760405162461bcd60e51b815260206004820152603360248201527f4e657720616d6f756e74206d757374206265206c657373207468616e20746f2060448201527f746865206f726967696e616c20616d6f756e74000000000000000000000000006064820152608401610546565b600081600601548260050154611eb791906125b4565b905080611ec484426125b4565b11611f425760405162461bcd60e51b815260206004820152604260248201527f4e6577206c6f636b2773206d617475726174696f6e206d75737420626520616660448201527f74657220746865206f726967696e616c206c6f636b2773206d6174757261746960648201526137b760f11b608482015260a401610546565b83826004016000828254611f569190612600565b92505081905550600060045490506040518060e001604052808281526020018460010160009054906101000a90046001600160a01b03166001600160a01b031681526020018460020160009054906101000a90046001600160a01b03166001600160a01b0316815260200186815260200186815260200142815260200185815250600560008381526020019081526020016000206000820151816000015560208201518160010160006101000a8154816001600160a01b0302191690836001600160a01b0316021790555060408201518160020160006101000a8154816001600160a01b0302191690836001600160a01b03160217905550606082015181600301556080820151816004015560a0820151816005015560c082015181600601559050506004600081548092919061208c90612630565b90915550506001808401546001600160a01b0390811660009081526006602090815260408083208054808701825590845282842001869055600288015490931682526007815282822080549485018155825281209092018390558454905183927f76d77d51ae38b2d64ce912b2fb2f249d4ee27348eb71ef5560e5929597c45da391a360018301546002840154604080518881526020810188905284936001600160a01b039081169316917ff4b9a080e56a4477654f2a26c905a99a6e0b157b67536012e7423a41860401dd910160405180910390a4505050505050565b6020808201516001600160a01b03166000908152600690915260408120905b815481101561080f5782600001518282815481106121a9576121a9612695565b90600052602060002001540361222f57815482906121c990600190612600565b815481106121d9576121d9612695565b90600052602060002001548282815481106121f6576121f6612695565b906000526020600020018190555081805480612214576122146126ab565b60019003818190600052602060002001600090559055505050565b600101612189565b6040808201516001600160a01b031660009081526007602052908120905b815481101561080f57826000015182828154811061227557612275612695565b90600052602060002001540361229557815482906121c990600190612600565b600101612255565b6000611bed836001600160a01b0384166122c7565b6000611bed836001600160a01b038416612316565b600081815260018301602052604081205461230e57508154600181810184556000848152602080822090930184905584548482528286019093526040902091909155611bf0565b506000611bf0565b600081815260018301602052604081205480156123ff57600061233a600183612600565b855490915060009061234e90600190612600565b90508082146123b357600086600001828154811061236e5761236e612695565b906000526020600020015490508087600001848154811061239157612391612695565b6000918252602080832090910192909255918252600188019052604090208390555b85548690806123c4576123c46126ab565b600190038181906000526020600020016000905590558560010160008681526020019081526020016000206000905560019350505050611bf0565b6000915050611bf0565b60006020828403121561241b57600080fd5b5035919050565b801515811461172257600080fd5b60006020828403121561244257600080fd5b813561244d81612422565b9392505050565b6001600160a01b038116811461172257600080fd5b60006020828403121561247b57600080fd5b813561244d81612454565b60008060006060848603121561249b57600080fd5b505081359360208301359350604090920135919050565b6020808252825182820181905260009190848201906040850190845b818110156124ea578351835292840192918401916001016124ce565b50909695505050505050565b6000806000806080858703121561250c57600080fd5b843561251781612454565b93506020850135925060408501359150606085013561253581612422565b939692955090935050565b6000806040838503121561255357600080fd5b82359150602083013561256581612454565b809150509250929050565b6000806040838503121561258357600080fd5b823561258e81612454565b9150602083013561256581612422565b634e487b7160e01b600052601160045260246000fd5b80820180821115611bf057611bf061259e565b8082028115828204841417611bf057611bf061259e565b6000826125fb57634e487b7160e01b600052601260045260246000fd5b500490565b81810381811115611bf057611bf061259e565b60006020828403121561262557600080fd5b815161244d81612454565b6000600182016126425761264261259e565b5060010190565b60006020828403121561265b57600080fd5b815161244d81612422565b6000825160005b81811015612687576020818601810151858301520161266d565b506000920191825250919050565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052603160045260246000fdfea264697066735822122079ee58d0ebcd10934868a5474cea72c1dfd78ff67d710e344b566f2910bdde2664736f6c63430008190033