Transactions
Token Transfers
Tokens
Internal Transactions
Coin Balance History
Logs
Code
Read Contract
Write Contract
- Contract name:
- ElectroSwapLockerV2
- Optimization enabled
- true
- Compiler version
- v0.8.25+commit.b61c2a91
- Optimization runs
- 50000
- Verified at
- 2024-03-29T02:22:27.568665Z
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 = 100000; // 100K BOLT fees.lpPercentFee = 1; // 1% } function _setFees(uint _etnFlatFee, uint _boltFlatFee, uint _lpPercentFee) external onlyTeam { fees.etnFlatFee = _etnFlatFee; fees.boltFlatFee = _boltFlatFee; fees.lpPercentFee = _lpPercentFee; } function _setTeamWallet(address payable _teamWallet) external onlyTeam { 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 { 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"); teamWallet.transfer(msg.value); } 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; TransferHelper.safeTransfer(_pairAddress, teamWallet, liquidityFee); } else if (msg.value > 0){ // refund ETN if whitelisted payable(msg.sender).transfer(msg.value); } // 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); } // 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 { 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; 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 { 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"); // Transfer the LP tokens to the migrator contract TransferHelper.safeTransfer(lockInfo.pair, address(migrator), lockInfo.amount); // Attempt to migrate the tokens require(migrator.migrate(lockInfo.pair, lockInfo.owner, lockInfo.amount, lockInfo.created, lockInfo.duration), "Migration failed"); // Mark the lock as empty lockInfo.amount = 0; 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":[],"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
0x60806040526004361061010e5760003560e01c80639b10b6f5116100a5578063a4375fcd11610074578063b80ec98d11610059578063b80ec98d14610397578063b8aa7e8c146103b7578063c6c16924146103d757600080fd5b8063a4375fcd14610357578063b48dd3be1461037757600080fd5b80639b10b6f5146102bc5780639bf92698146102d2578063a060a9f0146102e5578063a41fe49f1461033757600080fd5b8063619e8449116100e1578063619e844914610232578063646c31731461025f57806387ceff091461027f5780638cb1f9f71461029c57600080fd5b806308f124701461011357806314ca639e146101ae57806347dfe70d146101f057806351d2a82d14610212575b600080fd5b34801561011f57600080fd5b5061013361012e366004612948565b6103f7565b6040516101a59190600060e08201905082518252602083015173ffffffffffffffffffffffffffffffffffffffff80821660208501528060408601511660408501525050606083015160608301526080830151608083015260a083015160a083015260c083015160c083015292915050565b60405180910390f35b3480156101ba57600080fd5b506101ce6101c9366004612972565b6104e0565b60408051825181526020808401519082015291810151908201526060016101a5565b3480156101fc57600080fd5b5061021061020b3660046129b8565b61053b565b005b34801561021e57600080fd5b5061021061022d3660046129d5565b61062e565b34801561023e57600080fd5b5061025261024d3660046129b8565b610980565b6040516101a59190612a01565b34801561026b57600080fd5b5061021061027a3660046129d5565b6109f9565b34801561028b57600080fd5b50425b6040519081526020016101a5565b3480156102a857600080fd5b506102526102b73660046129b8565b610aae565b3480156102c857600080fd5b5061028e60045481565b6102106102e0366004612a45565b610b25565b3480156102f157600080fd5b506002546103129073ffffffffffffffffffffffffffffffffffffffff1681565b60405173ffffffffffffffffffffffffffffffffffffffff90911681526020016101a5565b34801561034357600080fd5b506102106103523660046129d5565b61126b565b34801561036357600080fd5b50610210610372366004612948565b6116e4565b34801561038357600080fd5b50610210610392366004612a8f565b6119b4565b3480156103a357600080fd5b506102106103b23660046129b8565b611b83565b3480156103c357600080fd5b506102106103d23660046129d5565b611c71565b3480156103e357600080fd5b506102106103f2366004612abf565b611c8e565b6104636040518060e0016040528060008152602001600073ffffffffffffffffffffffffffffffffffffffff168152602001600073ffffffffffffffffffffffffffffffffffffffff168152602001600081526020016000815260200160008152602001600081525090565b50600090815260056020818152604092839020835160e08101855281548152600182015473ffffffffffffffffffffffffffffffffffffffff9081169382019390935260028201549092169382019390935260038301546060820152600483015460808201529082015460a082015260069091015460c082015290565b61050460405180606001604052806000815260200160008152602001600081525090565b8161051057600c610513565b600c5b6040805160608101825282548152600183015460208201526002909201549082015292915050565b60015473ffffffffffffffffffffffffffffffffffffffff1633146105e7576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602a60248201527f4f6e6c7920636f6e7472616374206f776e65722063616e2063616c6c2074686960448201527f732066756e6374696f6e0000000000000000000000000000000000000000000060648201526084015b60405180910390fd5b600980547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff92909216919091179055565b610636611d51565b6000838152600560205260409020600281015473ffffffffffffffffffffffffffffffffffffffff1633146106ed576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602360248201527f43616c6c6572206973206e6f7420746865206f776e6572206f6620746865206c60448201527f6f636b000000000000000000000000000000000000000000000000000000000060648201526084016105de565b60008311806106fc5750600082115b610788576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602560248201527f4d75737420616464204c5020746f6b656e732c206f722074696d6520286f722060448201527f626f74682900000000000000000000000000000000000000000000000000000060648201526084016105de565b60068101548215610859574283836006015484600501546107a99190612b1c565b6107b39190612b1c565b1161083f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152602060048201526024808201527f4c6f636b206d617475726174696f6e20776f756c6420626520696e207468652060448201527f706173740000000000000000000000000000000000000000000000000000000060648201526084016105de565b828260060160008282546108539190612b1c565b90915550505b6004820154841561091b57600183015461088b9073ffffffffffffffffffffffffffffffffffffffff16333088611d94565b6000610898600a33611f32565b6108f157600e54612710906108ae886064612b2f565b6108b89190612b2f565b6108c29190612b46565b60018086015490549192506108f19173ffffffffffffffffffffffffffffffffffffffff918216911683611f66565b60006108fd8288612b81565b9050808560040160008282546109139190612b1c565b909155505050505b60048301546006840154604080518481526020810186905290810192909252606082015286907f6b26190974ccb49e1077e69f86bee056c6fa802cc973804af058b9226b96bab09060800160405180910390a250505061097b6001600055565b505050565b73ffffffffffffffffffffffffffffffffffffffff81166000908152600760209081526040918290208054835181840281018401909452808452606093928301828280156109ed57602002820191906000526020600020905b8154815260200190600101908083116109d9575b50505050509050919050565b60015473ffffffffffffffffffffffffffffffffffffffff163314610aa0576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602a60248201527f4f6e6c7920636f6e7472616374206f776e65722063616e2063616c6c2074686960448201527f732066756e6374696f6e0000000000000000000000000000000000000000000060648201526084016105de565b600c92909255600d55600e55565b73ffffffffffffffffffffffffffffffffffffffff81166000908152600660209081526040918290208054835181840281018401909452808452606093928301828280156109ed57602002820191906000526020600020908154815260200190600101908083116109d95750505050509050919050565b610b2d611d51565b60008311610bbd576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602760248201527f4c6f636b206475726174696f6e206d757374206265206772656174657220746860448201527f616e207a65726f0000000000000000000000000000000000000000000000000060648201526084016105de565b60008211610c4d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602860248201527f416d6f756e7420746f206c6f636b206d7573742062652067726561746572207460448201527f68616e207a65726f00000000000000000000000000000000000000000000000060648201526084016105de565b600854604080517f0dfe16810000000000000000000000000000000000000000000000000000000081529051869260009273ffffffffffffffffffffffffffffffffffffffff9182169263e6a4390592861691630dfe16819160048083019260209291908290030181865afa158015610cca573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610cee9190612b94565b8473ffffffffffffffffffffffffffffffffffffffff1663d21220a76040518163ffffffff1660e01b8152600401602060405180830381865afa158015610d39573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d5d9190612b94565b6040517fffffffff0000000000000000000000000000000000000000000000000000000060e085901b16815273ffffffffffffffffffffffffffffffffffffffff928316600482015291166024820152604401602060405180830381865afa158015610dcd573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610df19190612b94565b90508573ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614610eae576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602860248201527f4f6e6c7920456c656374726f53776170204c5020746f6b656e732063616e206260448201527f65206c6f636b656400000000000000000000000000000000000000000000000060648201526084016105de565b610eba86333087611d94565b6000610ec7600a33611f32565b61102f578315610f9a57600c54610ee690670de0b6b3a7640000612b2f565b3414610f4e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601960248201527f466c617420726174652045544e20666565206e6f74206d65740000000000000060448201526064016105de565b60015460405173ffffffffffffffffffffffffffffffffffffffff909116903480156108fc02916000818181858888f19350505050158015610f94573d6000803e3d6000fd5b50610fdc565b600254600354600d54610fdc9273ffffffffffffffffffffffffffffffffffffffff908116923392911690610fd790670de0b6b3a7640000612b2f565b611d94565b600e5461271090610fee876064612b2f565b610ff89190612b2f565b6110029190612b46565b60015490915061102a90889073ffffffffffffffffffffffffffffffffffffffff1683611f66565b611063565b34156110635760405133903480156108fc02916000818181858888f19350505050158015611061573d6000803e3d6000fd5b505b600061106f8287612b81565b9050600060045490506040518060e001604052808281526020018a73ffffffffffffffffffffffffffffffffffffffff1681526020013373ffffffffffffffffffffffffffffffffffffffff16815260200183815260200183815260200142815260200189815250600560008381526020019081526020016000206000820151816000015560208201518160010160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555060408201518160020160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550606082015181600301556080820151816004015560a0820151816005015560c08201518160060155905050600460008154809291906111c090612bb1565b909155505073ffffffffffffffffffffffffffffffffffffffff89166000818152600660209081526040808320805460018082018355918552838520018690553380855260078452828520805492830181558552938390200185905580518681529182018c9052849392917ff4b9a080e56a4477654f2a26c905a99a6e0b157b67536012e7423a41860401dd910160405180910390a450505050506112656001600055565b50505050565b611273611d51565b6000838152600560205260409020600281015473ffffffffffffffffffffffffffffffffffffffff16331461132a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602360248201527f43616c6c6572206973206e6f7420746865206f776e6572206f6620746865206c60448201527f6f636b000000000000000000000000000000000000000000000000000000000060648201526084016105de565b6000816004015411611398576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601560248201527f4e6f20746f6b656e7320746f207769746864726177000000000000000000000060448201526064016105de565b60008311611428576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602c60248201527f416d6f756e7420746f207769746864726177206d757374206265206120706f7360448201527f6974697665206e756d626572000000000000000000000000000000000000000060648201526084016105de565b82816004015410156114bc576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602360248201527f43616e6e6f74207769746864726177206d6f7265207468616e206973206c6f6360448201527f6b6564000000000000000000000000000000000000000000000000000000000060648201526084016105de565b60008160050154426114ce9190612b81565b9050816006015481101561153e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601960248201527f4c6f636b206475726174696f6e206e6f7420656c61707365640000000000000060448201526064016105de565b8160040154841015611564576115648585846004015461155e9190612b81565b856120d6565b6040805160e08101825283548152600184015473ffffffffffffffffffffffffffffffffffffffff9081166020830152600285015416918101919091526003830154606082015260048301546080820152600583015460a0820152600683015460c08201526115d290612675565b6040805160e08101825283548152600184015473ffffffffffffffffffffffffffffffffffffffff9081166020830152600285015416918101919091526003830154606082015260048301546080820152600583015460a0820152600683015460c08201526116409061274f565b838260040160008282546116549190612b81565b9091555050600182015461167f9073ffffffffffffffffffffffffffffffffffffffff163386611f66565b6001820154604080518681526020810188905273ffffffffffffffffffffffffffffffffffffffff9092169133917fba0b893b2f314a229997e335266881b5ac6b290bd350d2c23cc57160b77882b8910160405180910390a3505061097b6001600055565b60095473ffffffffffffffffffffffffffffffffffffffff16611763576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601060248201527f4d69677261746f72206e6f74207365740000000000000000000000000000000060448201526064016105de565b6000818152600560205260409020600281015473ffffffffffffffffffffffffffffffffffffffff16331461181a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602360248201527f43616c6c6572206973206e6f7420746865206f776e6572206f6620746865206c60448201527f6f636b000000000000000000000000000000000000000000000000000000000060648201526084016105de565b6001810154600954600483015461184b9273ffffffffffffffffffffffffffffffffffffffff908116921690611f66565b60095460018201546002830154600480850154600586015460068701546040517fef7c9e3400000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff96871694810194909452938516602484015260448301919091526064820152608481019190915291169063ef7c9e349060a4016020604051808303816000875af11580156118f5573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906119199190612be9565b61197f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601060248201527f4d6967726174696f6e206661696c65640000000000000000000000000000000060448201526064016105de565b60006004820181905560405183917f4bc52e28577cc27a82d053cd49f2d3dfdd860210c8fa28a208d168a55177bb8391a25050565b6119bc611d51565b6000828152600560205260409020600281015473ffffffffffffffffffffffffffffffffffffffff163314611a73576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602b60248201527f43616c6c6572206973206e6f74207468652063757272656e74206f776e65722060448201527f6f6620746865206c6f636b00000000000000000000000000000000000000000060648201526084016105de565b6040805160e08101825282548152600183015473ffffffffffffffffffffffffffffffffffffffff9081166020830152600284015416918101919091526003820154606082015260048201546080820152600582015460a0820152600682015460c0820152611ae19061274f565b6002810180547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff84169081179091556000818152600760209081526040808320805460018101825590845291832090910186905551339186917f902e03d40a887f58f46d747f437ac0a7b3028d6218bc4af171aef594fcd7e3e79190a450611b7f6001600055565b5050565b60015473ffffffffffffffffffffffffffffffffffffffff163314611c2a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602a60248201527f4f6e6c7920636f6e7472616374206f776e65722063616e2063616c6c2074686960448201527f732066756e6374696f6e0000000000000000000000000000000000000000000060648201526084016105de565b600180547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff92909216919091179055565b611c79611d51565b611c848383836120d6565b61097b6001600055565b60015473ffffffffffffffffffffffffffffffffffffffff163314611d35576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602a60248201527f4f6e6c7920636f6e7472616374206f776e65722063616e2063616c6c2074686960448201527f732066756e6374696f6e0000000000000000000000000000000000000000000060648201526084016105de565b8015611d465761097b600a836127c2565b61097b600a836127e4565b600260005403611d8d576040517f3ee5aeb500000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6002600055565b6040805173ffffffffffffffffffffffffffffffffffffffff85811660248301528481166044830152606480830185905283518084039091018152608490920183526020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167f23b872dd000000000000000000000000000000000000000000000000000000001790529151600092839290881691611e339190612c06565b6000604051808303816000865af19150503d8060008114611e70576040519150601f19603f3d011682016040523d82523d6000602084013e611e75565b606091505b5091509150818015611e9f575080511580611e9f575080806020019051810190611e9f9190612be9565b611f2a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152602060048201526024808201527f5472616e7366657248656c7065723a205452414e534645525f46524f4d5f464160448201527f494c45440000000000000000000000000000000000000000000000000000000060648201526084016105de565b505050505050565b73ffffffffffffffffffffffffffffffffffffffff8116600090815260018301602052604081205415155b90505b92915050565b6040805173ffffffffffffffffffffffffffffffffffffffff8481166024830152604480830185905283518084039091018152606490920183526020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fa9059cbb000000000000000000000000000000000000000000000000000000001790529151600092839290871691611ffd9190612c06565b6000604051808303816000865af19150503d806000811461203a576040519150601f19603f3d011682016040523d82523d6000602084013e61203f565b606091505b50915091508180156120695750805115806120695750808060200190518101906120699190612be9565b6120cf576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601f60248201527f5472616e7366657248656c7065723a205452414e534645525f4641494c45440060448201526064016105de565b5050505050565b6000838152600560205260409020600281015473ffffffffffffffffffffffffffffffffffffffff16331461218d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602360248201527f43616c6c6572206973206e6f7420746865206f776e6572206f6620746865206c60448201527f6f636b000000000000000000000000000000000000000000000000000000000060648201526084016105de565b600083116121f7576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601b60248201527f4e6577206c6f636b20616d6f756e74206d757374206265203e2030000000000060448201526064016105de565b60008211612261576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601d60248201527f4e6577206c6f636b206475726174696f6e206d757374206265203e203000000060448201526064016105de565b82816004015410156122f5576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603360248201527f4e657720616d6f756e74206d757374206265206c657373207468616e20746f2060448201527f746865206f726967696e616c20616d6f756e740000000000000000000000000060648201526084016105de565b60008160060154826005015461230b9190612b1c565b9050806123188442612b1c565b116123cb576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152604260248201527f4e6577206c6f636b2773206d617475726174696f6e206d75737420626520616660448201527f74657220746865206f726967696e616c206c6f636b2773206d6174757261746960648201527f6f6e000000000000000000000000000000000000000000000000000000000000608482015260a4016105de565b838260040160008282546123df9190612b81565b92505081905550600060045490506040518060e001604052808281526020018460010160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018460020160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200186815260200186815260200142815260200185815250600560008381526020019081526020016000206000820151816000015560208201518160010160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555060408201518160020160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550606082015181600301556080820151816004015560a0820151816005015560c082015181600601559050506004600081548092919061257d90612bb1565b909155505060018084015473ffffffffffffffffffffffffffffffffffffffff90811660009081526006602090815260408083208054808701825590845282842001869055600288015490931682526007815282822080549485018155825281209092018390558454905183927f76d77d51ae38b2d64ce912b2fb2f249d4ee27348eb71ef5560e5929597c45da391a3600183015460028401546040805188815260208101889052849373ffffffffffffffffffffffffffffffffffffffff9081169316917ff4b9a080e56a4477654f2a26c905a99a6e0b157b67536012e7423a41860401dd910160405180910390a4505050505050565b60208082015173ffffffffffffffffffffffffffffffffffffffff166000908152600690915260408120905b815481101561097b5782600001518282815481106126c1576126c1612c35565b90600052602060002001540361274757815482906126e190600190612b81565b815481106126f1576126f1612c35565b906000526020600020015482828154811061270e5761270e612c35565b90600052602060002001819055508180548061272c5761272c612c64565b60019003818190600052602060002001600090559055505050565b6001016126a1565b60408082015173ffffffffffffffffffffffffffffffffffffffff1660009081526007602052908120905b815481101561097b57826000015182828154811061279a5761279a612c35565b9060005260206000200154036127ba57815482906126e190600190612b81565b60010161277a565b6000611f5d8373ffffffffffffffffffffffffffffffffffffffff8416612806565b6000611f5d8373ffffffffffffffffffffffffffffffffffffffff8416612855565b600081815260018301602052604081205461284d57508154600181810184556000848152602080822090930184905584548482528286019093526040902091909155611f60565b506000611f60565b6000818152600183016020526040812054801561293e576000612879600183612b81565b855490915060009061288d90600190612b81565b90508082146128f25760008660000182815481106128ad576128ad612c35565b90600052602060002001549050808760000184815481106128d0576128d0612c35565b6000918252602080832090910192909255918252600188019052604090208390555b855486908061290357612903612c64565b600190038181906000526020600020016000905590558560010160008681526020019081526020016000206000905560019350505050611f60565b6000915050611f60565b60006020828403121561295a57600080fd5b5035919050565b801515811461296f57600080fd5b50565b60006020828403121561298457600080fd5b813561298f81612961565b9392505050565b73ffffffffffffffffffffffffffffffffffffffff8116811461296f57600080fd5b6000602082840312156129ca57600080fd5b813561298f81612996565b6000806000606084860312156129ea57600080fd5b505081359360208301359350604090920135919050565b6020808252825182820181905260009190848201906040850190845b81811015612a3957835183529284019291840191600101612a1d565b50909695505050505050565b60008060008060808587031215612a5b57600080fd5b8435612a6681612996565b935060208501359250604085013591506060850135612a8481612961565b939692955090935050565b60008060408385031215612aa257600080fd5b823591506020830135612ab481612996565b809150509250929050565b60008060408385031215612ad257600080fd5b8235612add81612996565b91506020830135612ab481612961565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b80820180821115611f6057611f60612aed565b8082028115828204841417611f6057611f60612aed565b600082612b7c577f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b500490565b81810381811115611f6057611f60612aed565b600060208284031215612ba657600080fd5b815161298f81612996565b60007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8203612be257612be2612aed565b5060010190565b600060208284031215612bfb57600080fd5b815161298f81612961565b6000825160005b81811015612c275760208186018101518583015201612c0d565b506000920191825250919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603160045260246000fdfea26469706673582212206bf3993dc9f6495ef9a221bed88752fbca2333e33145ae8b7cf8fc7d5d42154564736f6c63430008190033