Warning! Contract bytecode has been changed and doesn't match the verified one. Therefore, interaction with this smart contract may be risky.
- Contract name:
- BSKR_V2
- Optimization enabled
- true
- Compiler version
- v0.8.19+commit.7dd6d404
- Optimization runs
- 200
- Verified at
- 2023-04-25T16:02:53.804519Z
contracts/BSKR_V2.sol
/**
*
* @title BSKR - Brings Serenity, Knowledge and Richness
* @author Ra Murd <pulselorian@gmail.com>
* @notice website: https://pulselorian.com/
* @notice telegram: https://t.me/ThePulselorian
* @notice twitter: https://twitter.com/ThePulseLorian
*
* BSKR is our attempt to develop a better internet currency
* It's deflationary, burns some fees, reflects some fees and adds some fees to liquidity pool
* It may also pay quarterly bonus to net buyers
*
* - BSKR audit
* <TODO Audit report link to be added here>
*
*
* ( ( ( ( ( (( ( . ( ( (( ( ((
* )\ )\ )\ )\ )\ (\())\ . )\ )\ ))\)\ ))\
* ((_)((_)(_)(_) ((_))(_)(_) ((_)((_)(((_)_()((_)))
* | _ \ | | | | / __| __| | / _ \| _ \_ _| \ \| |
* | _/ |_| | |__\__ \ _|| |__| (_) | /| || - | . |
* |_| \___/|____|___/___|____|\___/|_|_\___|_|_|_|\_|
*
* Tokenomics:
*
* Reflection 2.0% 36.36%
* Burn 1.5% 27.27%
* Growth 1.0% 18.18%
* Liquidity 0.5% 9.09%
* Payday 0.5% 9.09%
*/
/*
* SPDX-License-Identifier: MIT
*/
pragma solidity ^0.8.19;
import "./imports/BaseBSKR_V2.sol";
contract BSKR_V2 is BaseBSKR_V2 {
enum Field {
tTransferAmount,
rAmount,
rTransferAmount,
tRfiFee,
tBurnFee,
tOtherFees, // Growth1, Growth2, Payday & LP fees are all 0.5%
rRfiFee,
rBurnFee,
rOtherFees
}
enum Fees {
RfiFee, // 200 or 2.0%
BurnFee, // 150 or 1.5%
OtherFees, // 50 * 4 or 0.5% * 4
GrossFees // 550 or 5.5%
}
address private _LBSKRAddr; // needs this address to provide discounts
address private _ammBSKRPair; // BSKR-ETH pair address
address private _paydayAddress;
address[] private _noRfi;
bool private _addLPEnabled;
bool private _addingLiquidity;
mapping(address => bool) private _getsNoRfi;
mapping(address => bool) private _isMyTokensPair;
mapping(address => uint256) private _rBalances;
uint256 private _rTotal; // 100 bits
uint256 private _max_tx_amount; // 40 billion - 4% of the total supply // 96 bits
uint256 private _num_tokens_for_lp; // 1 billion - 0.1% of the total supply // 90 bits
uint256 private totalReflection; // 100 bits
uint64[4] private _currFees; // 16x6 bits
// event MinTokensBeforeSwapUpdated(uint256 minTokensBeforeSwap);
event FeeTransfers(
uint256 Reflected,
uint256 Burnt,
uint256 Growth,
uint256 AutoLiquity,
uint256 Payday
);
event AddLPEnabledUpdated(bool enabled);
event SwapAndLiquify(
uint256 tokensSwapped,
uint256 ethReceived,
uint256 tokensIntoLiqudity
);
/**
* @notice Reinitializes BSKR contract with new implementation version
* @param version Implementation version
* @param nameA Token name
* @param symbolA Token symbol
* @param growth1AddressA Growth address 1
* @param growth2AddressA Growth address 2
* @param paydayAddressA Payday address
* @param lbskrAddrA LBSKR address
* @param sisterOAsA Sister OA addresses
*/
function __BSKR_V2_init(
uint8 version,
string calldata nameA,
string calldata symbolA,
address growth1AddressA,
address growth2AddressA,
address paydayAddressA,
address lbskrAddrA,
address[5] memory sisterOAsA
) external reinitializer(version) {
// __Ownable_init_unchained();
// __Pausable_init_unchained();
// __Manageable_init_unchained();
// __BaseBSKR_V2_init_unchained(
// nameA,
// symbolA,
// growth1AddressA,
// growth2AddressA,
// sisterOAsA
// );
// __BSKR_V2_init_unchained(paydayAddressA, lbskrAddrA);
}
function __BSKR_V2_init_unchained(
address, //paydayAddressA,
address // lbskrAddrA
) internal onlyInitializing {
// if (block.chainid == 941) {
// // PLS Testnet V2B
// _max_tx_amount = 40_000_000_000_000_000_000_000_000_000_000; // 40 billion
// _num_tokens_for_lp = 1_000_000_000_000_000_000_000_000_000_000; // 1 billion
// } else {
// _max_tx_amount = 40_000_000_000_000_000_000_000_000_000; // 40 million
// _num_tokens_for_lp = 1_000_000_000_000_000_000_000_000_000; // 1 million
// }
// _addLPEnabled = true;
// _rTotal = (type(uint256).max - (type(uint256).max % _totalSupply));
// _currFees = [200, 150, 50, 550];
// _paydayAddress = paydayAddressA;
// _LBSKRAddr = lbskrAddrA;
// _rBalances[_msgSender()] = _rTotal;
// _balances[_msgSender()] = _totalSupply;
// _ammBSKRPair = _dexFactoryV2.createPair(address(this), wethAddr);
// _approve(_ammBSKRPair, _ammBSKRPair, type(uint256).max);
// _isAMMPair[_ammBSKRPair] = true;
// _setNoRfi(_ammBSKRPair);
// address _ammLBSKRPair = _dexFactoryV2.createPair(
// address(this),
// _LBSKRAddr
// );
// _approve(_ammLBSKRPair, _ammLBSKRPair, type(uint256).max);
// _isAMMPair[_ammLBSKRPair] = true;
// _setNoRfi(_ammLBSKRPair);
// for (uint256 index = 0; index < _sisterOAs.length; ++index) {
// _paysNoFee[_sisterOAs[index]] = true;
// _setNoRfi(_sisterOAs[index]);
// }
// _setNoRfi(_msgSender());
// _setNoRfi(address(this));
// _setNoRfi(_paydayAddress);
// _setNoRfi(_ammBSKRPair);
// _setNoRfi(_ammLBSKRPair);
// _setNoRfi(address(0));
// emit Transfer(address(0), _msgSender(), _totalSupply);
}
function _airdropTokens(address to, uint256 amount) internal override {
_transferTokens(
owner(),
to,
amount,
false,
true, // owner does not get Rfi
_getsNoRfi[to]
);
}
// function _excludeFromRfi(address wallet) private {
// if (_rBalances[wallet] > 0) {
// require(
// _rBalances[wallet] <= _rTotal,
// "B: Wallet must be < total Rfi"
// );
// _balances[wallet] = _rBalances[wallet] / _getRate();
// }
// _getsNoRfi[wallet] = true;
// _noRfi.push(wallet);
// }
function _getRate() private view returns (uint256) {
uint256 rSupply = _rTotal;
uint256 tSupply = _totalSupply;
for (uint256 index = 0; index < _noRfi.length; ++index) {
if (
_rBalances[_noRfi[index]] > rSupply ||
_balances[_noRfi[index]] > tSupply
) return (_rTotal / _totalSupply);
rSupply -= _rBalances[_noRfi[index]];
tSupply -= _balances[_noRfi[index]];
}
if (rSupply < _rTotal / _totalSupply) return (_rTotal / _totalSupply);
return rSupply / tSupply;
}
function _getValues(
uint256 tAmount,
uint256 feeMultiplier
) private view returns (uint256[9] memory response) {
uint256 currentRate = _getRate();
response[uint256(Field.rAmount)] = (tAmount * currentRate);
if (feeMultiplier == 0) {
response[uint256(Field.tTransferAmount)] = tAmount;
response[uint256(Field.rTransferAmount)] = tAmount * currentRate;
} else {
response[uint256(Field.tRfiFee)] =
(((tAmount * _currFees[uint256(Fees.RfiFee)]) / _BIPS) *
feeMultiplier) /
10;
response[uint256(Field.tBurnFee)] =
(((tAmount * _currFees[uint256(Fees.BurnFee)]) / _BIPS) *
feeMultiplier) /
10;
response[uint256(Field.tOtherFees)] =
(((tAmount * _currFees[uint256(Fees.OtherFees)]) / _BIPS) *
feeMultiplier) /
10;
response[uint256(Field.tTransferAmount)] =
tAmount -
((((tAmount * _currFees[uint256(Fees.GrossFees)]) / _BIPS) *
feeMultiplier) / 10);
response[uint256(Field.rRfiFee)] = (response[
uint256(Field.tRfiFee)
] * currentRate);
response[uint256(Field.rBurnFee)] = (response[
uint256(Field.tBurnFee)
] * currentRate);
response[uint256(Field.rOtherFees)] = (response[
uint256(Field.tOtherFees)
] * currentRate);
response[uint256(Field.rTransferAmount)] = (response[
uint256(Field.tTransferAmount)
] * currentRate);
}
return (response);
}
// function _includeInRfi(address wallet) private {
// require(_getsNoRfi[wallet], "B: Already gets Rfi");
// for (uint256 index = 0; index < _noRfi.length; index++) {
// if (_noRfi[index] == wallet) {
// _noRfi[index] = _noRfi[_noRfi.length - 1];
// _balances[wallet] = 0;
// _getsNoRfi[wallet] = false;
// _noRfi.pop();
// break;
// }
// }
// }
function _isLBSKRPair(address target) internal returns (bool) {
if (_isAMMPair[target]) {
if (_isMyTokensPair[target]) {
return true;
}
address token0 = _getToken0(target);
if (token0 == _LBSKRAddr) {
_isMyTokensPair[target] = true;
return true;
}
address token1 = _getToken1(target);
if (token1 == _LBSKRAddr) {
_isMyTokensPair[target] = true;
return true;
}
}
return false;
}
function _setNoRfi(address wallet) private {
if (!_getsNoRfi[wallet]) {
_getsNoRfi[wallet] = true;
_noRfi.push(wallet);
}
}
function _takeFee(address target, uint256 tFee, uint256 rFee) private {
_rBalances[target] += rFee;
if (_getsNoRfi[target]) _balances[target] += tFee;
}
function _transfer(
address from,
address to,
uint256 amount
) internal override whenNotPaused {
require(from != address(0), "B: From 0 addr");
require(to != address(0), "B: To 0 addr");
require(amount != 0, "B: 0 amount");
if (from != owner() && to != owner()) {
require(amount <= _max_tx_amount, "B: Exceeds max tx");
}
if (!isV3Enabled) {
require(!v3PairInvolved(from, to), "B: UniV3 not supported!");
}
_checkIfAMMPair(from);
if (_isAMMPair[from]) {
_setNoRfi(from);
}
_checkIfAMMPair(to);
if (_isAMMPair[to]) {
_setNoRfi(to);
}
uint256 contractTokenBalance = balanceOf(address(this));
/* is the token balance of this contract address over the min number of
* tokens that we need to initiate a swap + liquidity lock?
* also, don't get caught in a circular liquidity event.
* also, don't swap & liquify if sender is uniswap pair (Buy transaction).
*/
if (
(contractTokenBalance >= _num_tokens_for_lp) &&
!_addingLiquidity &&
from != _ammBSKRPair &&
_addLPEnabled
) {
_addingLiquidity = true;
/* split the contract balance into halves */
uint256 amount2Eth = _num_tokens_for_lp >> 1; // divide by 2
uint256 tokenAmount = _num_tokens_for_lp - amount2Eth;
/* Check balance before swap */
uint256 initialBalance = address(this).balance;
/* swap tokens for ETH */
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = wethAddr;
_approve(address(this), address(this), amount2Eth); // allow address(this) to spend its tokens
_approve(address(this), address(_dexRouterV2), amount2Eth);
_dexRouterV2.swapExactTokensForETHSupportingFeeOnTransferTokens(
amount2Eth,
0, // accept any amount of ETH // TODO - tighten this
path,
address(this),
block.timestamp + 15
);
/* Determine ETH from the swap */
uint256 ethAmount = address(this).balance - initialBalance;
/* add liquidity to uniswap */
_approve(address(this), address(_dexRouterV2), tokenAmount);
_dexRouterV2.addLiquidityETH{value: ethAmount}(
address(this),
tokenAmount,
0, // slippage is unavoidable
0, // slippage is unavoidable
_getOriginAddress(),
block.timestamp + 15
);
// Prevent ETH dust from getting locked in the contract forever
(bool success, ) = owner().call{value: address(this).balance}("");
if (success) {
// do nothing - it's not a must that transfer succeeds
}
emit SwapAndLiquify(amount2Eth, ethAmount, tokenAmount);
_num_tokens_for_lp = _totalSupply - balanceOf(address(0));
_addingLiquidity = false;
}
//indicates if fee should be deducted from transfer
bool takeFee = true;
//if any wallet belongs to _paysNoFee wallet then remove the fee
if (_paysNoFee[from] || _paysNoFee[to]) {
takeFee = false;
}
if (!_isAMMPair[from] && !_isAMMPair[to]) {
// simple transfer not buy/sell, take no fees
takeFee = false;
}
//transfer amount, it will take tax, burn, liquidity fee
_transferTokens(
from,
to,
amount,
takeFee,
_getsNoRfi[from],
_getsNoRfi[to]
);
}
function _transferTokens(
address sender,
address recipient,
uint256 tAmount,
bool takeFee,
bool senderExcluded,
bool recipientExcluded
) private {
uint256 reducedFees = 10;
if (!takeFee) {
reducedFees = 0;
} else if (_isLBSKRPair(sender) || _isLBSKRPair(recipient)) {
reducedFees = 5;
}
uint256[9] memory response = _getValues(tAmount, reducedFees);
if (senderExcluded) {
_balances[sender] -= tAmount;
}
_rBalances[sender] -= response[uint256(Field.rAmount)];
if (recipientExcluded) {
_balances[recipient] += response[uint256(Field.tTransferAmount)];
}
_rBalances[recipient] += response[uint256(Field.rTransferAmount)];
uint256 _tRfiFee_ = response[uint256(Field.tRfiFee)];
if (_tRfiFee_ != 0) {
_rTotal -= _tRfiFee_;
totalReflection += _tRfiFee_;
// cannot emit transfer event
// }
uint256 _tBurnFee_ = response[uint256(Field.tBurnFee)];
// if (_tBurnFee_ != 0) {
_takeFee(address(0), _tBurnFee_, response[uint256(Field.rBurnFee)]);
// emit Transfer(sender, address(0), _tBurnFee_);
// }
uint256 _tOtherFees_ = response[uint256(Field.tOtherFees)];
// if (_tOtherFees_ != 0) {
uint256 _rOtherFees_ = response[uint256(Field.rOtherFees)];
_takeFee(_growth1Address, _tOtherFees_, _rOtherFees_); // Half Growth Fee
// emit Transfer(sender, _growth1Address, _tOtherFees_);
_takeFee(_growth2Address, _tOtherFees_, _rOtherFees_); // Half Growth Fee
// emit Transfer(sender, _growth2Address, _tOtherFees_);
_takeFee(_paydayAddress, _tOtherFees_, _rOtherFees_); // Payday Fee
// emit Transfer(sender, _paydayAddress, _tOtherFees_);
_takeFee(address(this), _tOtherFees_, _rOtherFees_); // LP Fee
// emit Transfer(sender, address(this), _tOtherFees_);
emit FeeTransfers(
_tRfiFee_,
_tBurnFee_,
(_rOtherFees_ + _rOtherFees_),
_rOtherFees_,
_rOtherFees_
);
}
emit Transfer(
sender,
recipient,
response[uint256(Field.tTransferAmount)]
);
}
/**
* Calculates the wallet balance taking into wallet Rfi received
* @param wallet user address
* @return uint256 user's token balance
*/
function balanceOf(address wallet) public view override returns (uint256) {
if (_getsNoRfi[wallet]) return _balances[wallet];
require(_rBalances[wallet] <= _rTotal, "B: Amount too large");
uint256 currentRate = _getRate();
return _rBalances[wallet] / currentRate;
}
/**
* @notice Gift reflection to the BSKR community
* @param tAmount amount to gift
*/
function giftReflection(uint256 tAmount) external whenNotPaused {
require(tAmount != 0, "B: Zero gift amount");
address sender = _msgSender();
require(!_getsNoRfi[sender], "B: Excluded wallet");
uint256[9] memory response = _getValues(tAmount, 10);
require(
_rBalances[sender] > response[uint256(Field.rAmount)],
"B: Gift too large"
);
_rBalances[sender] -= response[uint256(Field.rAmount)];
_rTotal -= response[uint256(Field.rAmount)];
totalReflection += tAmount;
}
/**
* @notice Enable or disable auto liquidity feature - for manager only in case of issues
* @param _enabled true/false to enable or disable swap and liquify
*/
function setSwapAndLiquifyEnabled(bool _enabled) external onlyManager {
_addLPEnabled = _enabled;
emit AddLPEnabledUpdated(_enabled);
}
/**
* @notice Transfer the unstaked token while unstaking.
* @param from Sender address
* @param to Receiver address
* @param amount Amount to transfer
* @return bool flag indicating that transfer completed
* Only LBSKR contract may call this function
*/
function stakeTransfer(
address from,
address to,
uint256 amount
) external returns (bool) {
require(msg.sender == _LBSKRAddr);
_transferTokens(
from,
to,
amount,
false,
_getsNoRfi[from],
_getsNoRfi[to]
);
return true;
}
/**
* @notice This empty reserved space is put in place to allow future versions to add new
* variables without shifting down storage in the inheritance chain.
* See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps
*/
uint256[50] private __gap;
}
contracts/imports/BaseBSKR_V2.sol
/*
* SPDX-License-Identifier: MIT
*/
pragma solidity ^0.8.19;
import "../lib/Utils.sol";
import "../oz_upgradable/access/OwnableUpgradeable.sol";
import "../oz_upgradable/proxy/utils/UUPSUpgradeable.sol";
import "../oz_upgradable/security/PausableUpgradeable.sol";
import "../oz_upgradable/token/ERC20/IERC20Upgradeable.sol";
import "../uniswap/v2-core/interfaces/IUniswapV2Factory.sol";
import "../uniswap/v2-core/interfaces/IUniswapV2Pair.sol";
import "../uniswap/v2-periphery/interfaces/IUniswapV2Router02.sol";
import "../uniswap/v3-core/interfaces/IUniswapV3Factory.sol";
import "../uniswap/v3-core/interfaces/IUniswapV3Pool.sol";
import "./Manageable.sol";
abstract contract BaseBSKR_V2 is
Utils,
OwnableUpgradeable,
UUPSUpgradeable,
PausableUpgradeable,
IERC20Upgradeable,
Manageable
{
struct Airdrop {
address user;
uint256 amount;
}
IUniswapV2Factory internal _dexFactoryV2;
IUniswapV2Router02 internal _dexRouterV2;
address internal _growth1Address;
address internal _growth2Address;
// address internal _nftStakingContract;
address internal wethAddr;
address[5] internal _sisterOAs;
bool internal isV3Enabled;
mapping(address => bool) internal _isAMMPair;
mapping(address => bool) internal _paysNoFee;
mapping(address => mapping(address => uint256)) private _allowances;
mapping(address => uint256) internal _balances;
string private _name;
string private _symbol;
uint256 internal _oaIndex; // 5 bits
uint256 internal _totalSupply; // 1 billion for Goerli and 1 trillion (0xC9F2C9CD04674EDEA40000000) for PulseChain - 40 bits
uint256 internal constant _BIPS = 10000; // bips or basis point divisor - 14 bits
uint256 private constant _DECIMALS = 18; // 5 bits
function __BaseBSKR_V2_init(
uint8 version,
string calldata, // nameA,
string calldata, // symbolA,
address, // growth1AddressA,
address, // growth2AddressA,
address[5] memory // sisterOAsA
) internal reinitializer(version) {
// __Ownable_init_unchained();
// __Pausable_init_unchained();
// __Manageable_init_unchained();
// __BaseBSKR_V2_init_unchained(
// nameA,
// symbolA,
// growth1AddressA,
// growth2AddressA,
// sisterOAsA
// );
}
function __BaseBSKR_V2_init_unchained(
string calldata nameA,
string calldata symbolA,
address growth1AddressA,
address growth2AddressA,
address[5] memory sisterOAsA
) internal onlyInitializing {
_name = nameA;
_symbol = symbolA;
_growth1Address = growth1AddressA;
_growth2Address = growth2AddressA;
_sisterOAs = sisterOAsA;
// if (block.chainid == 941 || block.chainid == 942) {
// PLS Testnet V2B
_totalSupply = 1_000_000_000_000_000_000_000_000_000_000;
_dexRouterV2 = IUniswapV2Router02(
0xb242aA8A863CfcE9fcBa2b9a6B00b4cd62343f27
);
// } else if (block.chainid == 11155111) {
// // Sepolia
// _totalSupply = 1_000_000_000_000_000_000_000_000_000;
// _dexRouterV2 = IUniswapV2Router02(
// 0x01a93b7153Ee160F3176af0B0F31121DF9f0FFA5
// );
// } else {
// // 1, 5, 31337
// _totalSupply = 1_000_000_000_000_000_000_000_000_000;
// _dexRouterV2 = IUniswapV2Router02(
// 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D
// );
// }
_dexFactoryV2 = IUniswapV2Factory(_dexRouterV2.factory());
// if (block.chainid == 941 || block.chainid == 942) {
wethAddr = _dexRouterV2.WPLS();
// } else {
// wethAddr = _dexRouterV2.WETH();
// }
_paysNoFee[_msgSender()] = true;
_paysNoFee[address(this)] = true;
_paysNoFee[address(_dexRouterV2)] = true; // may not be needed
}
//to recieve ETH from _dexRouterV2 when swaping
receive() external payable {}
fallback() external payable {}
function __v3PairInvolved(address target) internal view returns (bool) {
if (target == address(_dexRouterV2)) return false; // to avoid orange reverts
// if (target == address(_nftStakingContract)) return false; // to avoid orange reverts
if (target == wethAddr) return false; // to avoid orange reverts
if (_isAMMPair[target]) {
return false; // if V3 is disabled, only V2 pairs are registered
}
address token0 = _getToken0(target);
if (token0 == address(0)) {
return false;
}
address token1 = _getToken1(target);
if (token1 == address(0)) {
return false;
}
uint24 fee = _getFee(target);
if (fee != 0) {
return true;
}
return false;
}
function _airdropTokens(address to, uint256 amount) internal virtual;
/**
* @notice Sets `amount` as the allowance of `spender` over the `owner` s tokens.
*
* This internal function is equivalent to `approve`, and can be used to
* e.g. set automatic allowances for certain subsystems, etc.
*
* Emits an {Approval} event.
*
* Requirements:
*
* - `owner` cannot be the zero address.
* - `spender` cannot be the zero address.
*/
function _approve(address owner, address spender, uint256 amount) internal {
require(owner != address(0), "BB: From 0 addr");
require(spender != address(0), "BB: To 0 addr");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _authorizeUpgrade(address) internal override onlyOwner {}
function _checkIfAMMPair(address target) internal {
if (target.code.length == 0) return;
if (target == address(_dexRouterV2)) return; // to avoid orange reverts
// if (target == address(_nftStakingContract)) return; // to avoid orange reverts
if (target == wethAddr) return; // to avoid orange reverts
if (!_isAMMPair[target]) {
address token0 = _getToken0(target);
if (token0 == address(0)) {
return;
}
address token1 = _getToken1(target);
if (token1 == address(0)) {
return;
}
_approve(target, target, type(uint256).max);
_isAMMPair[target] = true;
}
}
function _getOriginAddress() internal returns (address) {
if (_oaIndex < (_sisterOAs.length - 1)) {
_oaIndex = _oaIndex + 1;
} else {
_oaIndex = 0;
}
return _sisterOAs[_oaIndex];
}
function _transfer(
address owner,
address to,
uint256 amount
) internal virtual;
/**
* Airdrop BSKR to sacrificers, deducted from owner's wallet
*/
function airdrop(Airdrop[] calldata receivers) external onlyOwner {
for (uint256 index; index < receivers.length; ++index) {
if (
receivers[index].user != address(0) &&
receivers[index].amount != 0
) {
_airdropTokens(receivers[index].user, receivers[index].amount);
}
}
}
/**
* @notice Get allowance for a spender to spend owner's tokens
* @param owner owner address
* @param spender spender address
* @return uint256 allowance value
*/
function allowance(
address owner,
address spender
) public view override returns (uint256) {
return _allowances[owner][spender];
}
/**
* @notice Sets allowance for spender to use msgsender's tokens
*
* NOTE: If `amount` is the maximum `uint256`, the allowance is not updated on
* `transferFrom`. This is semantically equivalent to an infinite approval.
*
* Requirements:
*
* - `spender` cannot be the zero address.
*/
function approve(
address spender,
uint256 amount
) external override returns (bool) {
address owner = _msgSender();
_approve(owner, spender, amount);
return true;
}
/**
* @notice Returns the number of decimals used to get its user representation.
* For example, if `decimals` equals `2`, a balance of `505` tokens should
* be displayed to a user as `5.05` (`505 / 10 ** 2`).
*/
function decimals() external pure returns (uint256) {
return _DECIMALS;
}
/**
* @notice Atomically decreases the allowance granted to `spender` by the caller.
*
* This is an alternative to {approve} that can be used as a mitigation for
* problems described in {IERC20-approve}.
*
* Emits an {Approval} event indicating the updated allowance.
*
* Requirements:
*
* - `spender` cannot be the zero address.
* - `spender` must have allowance for the caller of at least
* `subtractedValue`.
*/
function decreaseAllowance(
address spender,
uint256 subtractedValue
) external returns (bool) {
address owner = _msgSender();
uint256 currentAllowance = allowance(owner, spender);
require(currentAllowance >= subtractedValue, "BSKR: Decreases below 0");
unchecked {
_approve(owner, spender, currentAllowance - subtractedValue);
}
return true;
}
/**
* @notice Disables UniswapV3
*/
function disableUniswapV3() external onlyManager {
isV3Enabled = false;
}
/**
* @notice Enables UniswapV3
*/
function enableUniswapV3() external onlyManager {
isV3Enabled = true;
}
/**
* @notice Atomically increases the allowance granted to `spender` by the caller.
*
* This is an alternative to {approve} that can be used as a mitigation for
* problems described in {IERC20-approve}.
*
* Emits an {Approval} event indicating the updated allowance.
*
* Requirements:
*
* - `spender` cannot be the zero address.
*/
function increaseAllowance(
address spender,
uint256 addedValue
) external returns (bool) {
address owner = _msgSender();
_approve(owner, spender, allowance(owner, spender) + addedValue);
return true;
}
/**
* @notice Returns the name of the token.
*/
function name() external view returns (string memory) {
return _name;
}
/**
* @notice Pauses this contract features
*/
function pauseContract() external onlyManager {
_pause();
}
// /*
// * @notice Sets the BSKR contract address
// */
// function setNFTStakingContract(address newNFTStkCntrct) external onlyOwner {
// _nftStakingContract = newNFTStkCntrct;
// }
/**
* @notice Returns the symbol of the token
*/
function symbol() external view returns (string memory) {
return _symbol;
}
/**
* @notice Returns the amount of tokens in existence.
*/
function totalSupply() external view override returns (uint256) {
return _totalSupply;
}
/**
* @notice See {IERC20-transfer}. TODO add description
*
* Requirements:
*
* - `to` cannot be the zero address.
* - the caller must have a balance of at least `amount`.
*/
function transfer(
address to,
uint256 amount
) external override returns (bool) {
address owner = _msgSender();
_transfer(owner, to, amount);
return true;
}
/**
* @notice Transfers tokens 'from' to 'to' address provided there is enough allowance
*
* Emits an {Approval} event indicating the updated allowance. This is not
* required by the EIP. See the note at the beginning of {ERC20}.
*
* NOTE: Does not update the allowance if the current allowance
* is the maximum `uint256`.
*
* Requirements:
*
* - `from` and `to` cannot be the zero address.
* - `from` must have a balance of at least `amount`.
* - the caller must have allowance for ``from``'s tokens of at least
* `amount`.
*/
function transferFrom(
address from,
address to,
uint256 amount
) external override returns (bool) {
address spender = _msgSender();
uint256 currentAllowance = allowance(from, spender);
if (currentAllowance != type(uint256).max) {
require(currentAllowance >= amount, "BB: Insufficient allowance");
unchecked {
_approve(from, spender, currentAllowance - amount);
}
}
_transfer(from, to, amount);
return true;
}
/**
* @notice Unpauses the contract's features
*/
function unPauseContract() external onlyManager {
_unpause();
}
// to rename with _ prefix
function v3PairInvolved(
address from,
address to
) internal view returns (bool) {
return (__v3PairInvolved(from) || __v3PairInvolved(to));
}
/**
* @notice This empty reserved space is put in place to allow future versions to add new
* variables without shifting down storage in the inheritance chain.
* See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps
*/
uint256[50] private __gap;
}
contracts/imports/Manageable.sol
/*
* SPDX-License-Identifier: MIT
*/
pragma solidity ^0.8.19;
import "../oz_upgradable/utils/ContextUpgradeable.sol";
abstract contract Manageable is ContextUpgradeable {
address private _manager;
event ManagementTransferred(
address indexed previousManager,
address indexed newManager
);
function __Manageable_init() internal onlyInitializing {
__Manageable_init_unchained();
}
function __Manageable_init_unchained() internal onlyInitializing {
_manager = _msgSender();
emit ManagementTransferred(address(0), _msgSender());
}
function _checkManager() private view {
require(_manager == _msgSender(), "M: Caller not manager");
}
function manager() external view returns (address) {
return _manager;
}
modifier onlyManager() {
_checkManager();
_;
}
/**
* @notice Transfers the management of the contract to a new manager
*/
function transferManagement(address newManager) external onlyManager {
emit ManagementTransferred(_manager, newManager);
_manager = newManager;
}
}
contracts/lib/Utils.sol
/*
* SPDX-License-Identifier: MIT
*/
pragma solidity ^0.8.19;
contract Utils {
uint24 private constant _SECS_IN_FOUR_WEEKS = 2419200; // 3600 * 24 * 7 * 4
function _callAndParseAddressReturn(
address token,
bytes4 selector
) internal view returns (address) {
(bool success, bytes memory data) = token.staticcall(
abi.encodeWithSelector(selector)
);
// if not implemented, or returns empty data, return empty string
if (!success || data.length == 0) {
return address(0);
}
// if implemented, or returns data, return decoded int24 else return 0
if (data.length == 32) {
return abi.decode(data, (address));
}
return address(0);
}
function _callAndParseUint24Return(
address token,
bytes4 selector
) internal view returns (uint24) {
(bool success, bytes memory data) = token.staticcall(
abi.encodeWithSelector(selector)
);
// if not implemented, or returns empty data, return empty string
if (!success || data.length == 0) {
return 0;
}
// if implemented, or returns data, return decoded int24 else return 0
if (data.length == 32) {
return abi.decode(data, (uint24));
}
return 0;
}
function _getFee(address target) internal view returns (uint24 targetFee) {
targetFee = _callAndParseUint24Return(
target,
hex"ddca3f43" // fee()
);
return targetFee;
}
function _getToken0(
address target
) internal view returns (address targetToken0) {
targetToken0 = _callAndParseAddressReturn(
target,
hex"0dfe1681" // token0()
);
return targetToken0;
}
function _getToken1(
address target
) internal view returns (address targetToken1) {
targetToken1 = _callAndParseAddressReturn(
target,
hex"d21220a7" // token1()
);
return targetToken1;
}
/**
* @notice Calculates penalty basis points for given from and to timestamps in seconds since epoch
*/
function _penaltyFor(
uint256 fromTimestamp,
uint256 toTimestamp
) internal pure returns (uint256 penaltyBasis) {
// penaltyBasis = 0;
if (fromTimestamp + 52 weeks > toTimestamp) {
uint256 fourWeeksElapsed = (toTimestamp - fromTimestamp) /
_SECS_IN_FOUR_WEEKS;
if (fourWeeksElapsed < 13) {
penaltyBasis = ((13 - fourWeeksElapsed) * 100); // If one four weeks have elapsed - penalty is 12% or 1200/10000
}
}
return penaltyBasis;
}
}
contracts/oz_upgradable/access/OwnableUpgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.0) (access/Ownable.sol)
pragma solidity ^0.8.0;
import "../utils/ContextUpgradeable.sol";
import "../proxy/utils/Initializable.sol";
/**
* @dev Contract module which provides a basic access control mechanism, where
* there is an account (an owner) that can be granted exclusive access to
* specific functions.
*
* By default, the owner account will be the one that deploys the contract. This
* can later be changed with {transferOwnership}.
*
* This module is used through inheritance. It will make available the modifier
* `onlyOwner`, which can be applied to your functions to restrict their use to
* the owner.
*/
abstract contract OwnableUpgradeable is Initializable, ContextUpgradeable {
address private _owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev Initializes the contract setting the deployer as the initial owner.
*/
function __Ownable_init() internal onlyInitializing {
__Ownable_init_unchained();
}
function __Ownable_init_unchained() internal onlyInitializing {
_transferOwnership(_msgSender());
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
_checkOwner();
_;
}
/**
* @dev Returns the address of the current owner.
*/
function owner() public view virtual returns (address) {
return _owner;
}
/**
* @dev Throws if the sender is not the owner.
*/
function _checkOwner() internal view virtual {
require(owner() == _msgSender(), "Ownable: caller is not the owner");
}
/**
* @dev Leaves the contract without owner. It will not be possible to call
* `onlyOwner` functions anymore. Can only be called by the current owner.
*
* NOTE: Renouncing ownership will leave the contract without an owner,
* thereby removing any functionality that is only available to the owner.
*/
function renounceOwnership() public virtual onlyOwner {
_transferOwnership(address(0));
}
/**
* @dev Transfers ownership of the contract to a new account (`newOwner`).
* Can only be called by the current owner.
*/
function transferOwnership(address newOwner) public virtual onlyOwner {
require(newOwner != address(0), "Ownable: new owner is the zero address");
_transferOwnership(newOwner);
}
/**
* @dev Transfers ownership of the contract to a new account (`newOwner`).
* Internal function without access restriction.
*/
function _transferOwnership(address newOwner) internal virtual {
address oldOwner = _owner;
_owner = newOwner;
emit OwnershipTransferred(oldOwner, newOwner);
}
/**
* @dev This empty reserved space is put in place to allow future versions to add new
* variables without shifting down storage in the inheritance chain.
* See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps
*/
uint256[49] private __gap;
}
contracts/oz_upgradable/interfaces/IERC1967Upgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.8.3) (interfaces/IERC1967.sol)
pragma solidity ^0.8.0;
/**
* @dev ERC-1967: Proxy Storage Slots. This interface contains the events defined in the ERC.
*
* _Available since v4.9._
*/
interface IERC1967Upgradeable {
/**
* @dev Emitted when the implementation is upgraded.
*/
event Upgraded(address indexed implementation);
/**
* @dev Emitted when the admin account has changed.
*/
event AdminChanged(address previousAdmin, address newAdmin);
/**
* @dev Emitted when the beacon is changed.
*/
event BeaconUpgraded(address indexed beacon);
}
contracts/oz_upgradable/interfaces/draft-IERC1822Upgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.5.0) (interfaces/draft-IERC1822.sol)
pragma solidity ^0.8.0;
/**
* @dev ERC1822: Universal Upgradeable Proxy Standard (UUPS) documents a method for upgradeability through a simplified
* proxy whose upgrades are fully controlled by the current implementation.
*/
interface IERC1822ProxiableUpgradeable {
/**
* @dev Returns the storage slot that the proxiable contract assumes is being used to store the implementation
* address.
*
* IMPORTANT: A proxy pointing at a proxiable contract should not be considered proxiable itself, because this risks
* bricking a proxy that upgrades to it, by delegating to itself until out of gas. Thus it is critical that this
* function revert if invoked through a proxy.
*/
function proxiableUUID() external view returns (bytes32);
}
contracts/oz_upgradable/proxy/ERC1967/ERC1967UpgradeUpgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.8.3) (proxy/ERC1967/ERC1967Upgrade.sol)
pragma solidity ^0.8.2;
import "../beacon/IBeaconUpgradeable.sol";
import "../../interfaces/IERC1967Upgradeable.sol";
import "../../interfaces/draft-IERC1822Upgradeable.sol";
import "../../utils/AddressUpgradeable.sol";
import "../../utils/StorageSlotUpgradeable.sol";
import "../utils/Initializable.sol";
/**
* @dev This abstract contract provides getters and event emitting update functions for
* https://eips.ethereum.org/EIPS/eip-1967[EIP1967] slots.
*
* _Available since v4.1._
*
* @custom:oz-upgrades-unsafe-allow delegatecall
*/
abstract contract ERC1967UpgradeUpgradeable is Initializable, IERC1967Upgradeable {
function __ERC1967Upgrade_init() internal onlyInitializing {
}
function __ERC1967Upgrade_init_unchained() internal onlyInitializing {
}
// This is the keccak-256 hash of "eip1967.proxy.rollback" subtracted by 1
bytes32 private constant _ROLLBACK_SLOT = 0x4910fdfa16fed3260ed0e7147f7cc6da11a60208b5b9406d12a635614ffd9143;
/**
* @dev Storage slot with the address of the current implementation.
* This is the keccak-256 hash of "eip1967.proxy.implementation" subtracted by 1, and is
* validated in the constructor.
*/
bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;
/**
* @dev Returns the current implementation address.
*/
function _getImplementation() internal view returns (address) {
return StorageSlotUpgradeable.getAddressSlot(_IMPLEMENTATION_SLOT).value;
}
/**
* @dev Stores a new address in the EIP1967 implementation slot.
*/
function _setImplementation(address newImplementation) private {
require(AddressUpgradeable.isContract(newImplementation), "ERC1967: new implementation is not a contract");
StorageSlotUpgradeable.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;
}
/**
* @dev Perform implementation upgrade
*
* Emits an {Upgraded} event.
*/
function _upgradeTo(address newImplementation) internal {
_setImplementation(newImplementation);
emit Upgraded(newImplementation);
}
/**
* @dev Perform implementation upgrade with additional setup call.
*
* Emits an {Upgraded} event.
*/
function _upgradeToAndCall(
address newImplementation,
bytes memory data,
bool forceCall
) internal {
_upgradeTo(newImplementation);
if (data.length > 0 || forceCall) {
_functionDelegateCall(newImplementation, data);
}
}
/**
* @dev Perform implementation upgrade with security checks for UUPS proxies, and additional setup call.
*
* Emits an {Upgraded} event.
*/
function _upgradeToAndCallUUPS(
address newImplementation,
bytes memory data,
bool forceCall
) internal {
// Upgrades from old implementations will perform a rollback test. This test requires the new
// implementation to upgrade back to the old, non-ERC1822 compliant, implementation. Removing
// this special case will break upgrade paths from old UUPS implementation to new ones.
if (StorageSlotUpgradeable.getBooleanSlot(_ROLLBACK_SLOT).value) {
_setImplementation(newImplementation);
} else {
try IERC1822ProxiableUpgradeable(newImplementation).proxiableUUID() returns (bytes32 slot) {
require(slot == _IMPLEMENTATION_SLOT, "ERC1967Upgrade: unsupported proxiableUUID");
} catch {
revert("ERC1967Upgrade: new implementation is not UUPS");
}
_upgradeToAndCall(newImplementation, data, forceCall);
}
}
/**
* @dev Storage slot with the admin of the contract.
* This is the keccak-256 hash of "eip1967.proxy.admin" subtracted by 1, and is
* validated in the constructor.
*/
bytes32 internal constant _ADMIN_SLOT = 0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103;
/**
* @dev Returns the current admin.
*/
function _getAdmin() internal view returns (address) {
return StorageSlotUpgradeable.getAddressSlot(_ADMIN_SLOT).value;
}
/**
* @dev Stores a new address in the EIP1967 admin slot.
*/
function _setAdmin(address newAdmin) private {
require(newAdmin != address(0), "ERC1967: new admin is the zero address");
StorageSlotUpgradeable.getAddressSlot(_ADMIN_SLOT).value = newAdmin;
}
/**
* @dev Changes the admin of the proxy.
*
* Emits an {AdminChanged} event.
*/
function _changeAdmin(address newAdmin) internal {
emit AdminChanged(_getAdmin(), newAdmin);
_setAdmin(newAdmin);
}
/**
* @dev The storage slot of the UpgradeableBeacon contract which defines the implementation for this proxy.
* This is bytes32(uint256(keccak256('eip1967.proxy.beacon')) - 1)) and is validated in the constructor.
*/
bytes32 internal constant _BEACON_SLOT = 0xa3f0ad74e5423aebfd80d3ef4346578335a9a72aeaee59ff6cb3582b35133d50;
/**
* @dev Returns the current beacon.
*/
function _getBeacon() internal view returns (address) {
return StorageSlotUpgradeable.getAddressSlot(_BEACON_SLOT).value;
}
/**
* @dev Stores a new beacon in the EIP1967 beacon slot.
*/
function _setBeacon(address newBeacon) private {
require(AddressUpgradeable.isContract(newBeacon), "ERC1967: new beacon is not a contract");
require(
AddressUpgradeable.isContract(IBeaconUpgradeable(newBeacon).implementation()),
"ERC1967: beacon implementation is not a contract"
);
StorageSlotUpgradeable.getAddressSlot(_BEACON_SLOT).value = newBeacon;
}
/**
* @dev Perform beacon upgrade with additional setup call. Note: This upgrades the address of the beacon, it does
* not upgrade the implementation contained in the beacon (see {UpgradeableBeacon-_setImplementation} for that).
*
* Emits a {BeaconUpgraded} event.
*/
function _upgradeBeaconToAndCall(
address newBeacon,
bytes memory data,
bool forceCall
) internal {
_setBeacon(newBeacon);
emit BeaconUpgraded(newBeacon);
if (data.length > 0 || forceCall) {
_functionDelegateCall(IBeaconUpgradeable(newBeacon).implementation(), data);
}
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
* but performing a delegate call.
*
* _Available since v3.4._
*/
function _functionDelegateCall(address target, bytes memory data) private returns (bytes memory) {
require(AddressUpgradeable.isContract(target), "Address: delegate call to non-contract");
// solhint-disable-next-line avoid-low-level-calls
(bool success, bytes memory returndata) = target.delegatecall(data);
return AddressUpgradeable.verifyCallResult(success, returndata, "Address: low-level delegate call failed");
}
/**
* @dev This empty reserved space is put in place to allow future versions to add new
* variables without shifting down storage in the inheritance chain.
* See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps
*/
uint256[50] private __gap;
}
contracts/oz_upgradable/proxy/beacon/IBeaconUpgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (proxy/beacon/IBeacon.sol)
pragma solidity ^0.8.0;
/**
* @dev This is the interface that {BeaconProxy} expects of its beacon.
*/
interface IBeaconUpgradeable {
/**
* @dev Must return an address that can be used as a delegate call target.
*
* {BeaconProxy} will check that this address is a contract.
*/
function implementation() external view returns (address);
}
contracts/oz_upgradable/proxy/utils/Initializable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.8.1) (proxy/utils/Initializable.sol)
pragma solidity ^0.8.2;
import "../../utils/AddressUpgradeable.sol";
/**
* @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed
* behind a proxy. Since proxied contracts do not make use of a constructor, it's common to move constructor logic to an
* external initializer function, usually called `initialize`. It then becomes necessary to protect this initializer
* function so it can only be called once. The {initializer} modifier provided by this contract will have this effect.
*
* The initialization functions use a version number. Once a version number is used, it is consumed and cannot be
* reused. This mechanism prevents re-execution of each "step" but allows the creation of new initialization steps in
* case an upgrade adds a module that needs to be initialized.
*
* For example:
*
* [.hljs-theme-light.nopadding]
* ```
* contract MyToken is ERC20Upgradeable {
* function initialize() initializer public {
* __ERC20_init("MyToken", "MTK");
* }
* }
* contract MyTokenV2 is MyToken, ERC20PermitUpgradeable {
* function initializeV2() reinitializer(2) public {
* __ERC20Permit_init("MyToken");
* }
* }
* ```
*
* TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as
* possible by providing the encoded function call as the `_data` argument to {ERC1967Proxy-constructor}.
*
* CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure
* that all initializers are idempotent. This is not verified automatically as constructors are by Solidity.
*
* [CAUTION]
* ====
* Avoid leaving a contract uninitialized.
*
* An uninitialized contract can be taken over by an attacker. This applies to both a proxy and its implementation
* contract, which may impact the proxy. To prevent the implementation contract from being used, you should invoke
* the {_disableInitializers} function in the constructor to automatically lock it when it is deployed:
*
* [.hljs-theme-light.nopadding]
* ```
* /// @custom:oz-upgrades-unsafe-allow constructor
* constructor() {
* _disableInitializers();
* }
* ```
* ====
*/
abstract contract Initializable {
/**
* @dev Indicates that the contract has been initialized.
* @custom:oz-retyped-from bool
*/
uint8 private _initialized;
/**
* @dev Indicates that the contract is in the process of being initialized.
*/
bool private _initializing;
/**
* @dev Triggered when the contract has been initialized or reinitialized.
*/
event Initialized(uint8 version);
/**
* @dev A modifier that defines a protected initializer function that can be invoked at most once. In its scope,
* `onlyInitializing` functions can be used to initialize parent contracts.
*
* Similar to `reinitializer(1)`, except that functions marked with `initializer` can be nested in the context of a
* constructor.
*
* Emits an {Initialized} event.
*/
modifier initializer() {
bool isTopLevelCall = !_initializing;
require(
(isTopLevelCall && _initialized < 1) || (!AddressUpgradeable.isContract(address(this)) && _initialized == 1),
"Initializable: contract is already initialized"
);
_initialized = 1;
if (isTopLevelCall) {
_initializing = true;
}
_;
if (isTopLevelCall) {
_initializing = false;
emit Initialized(1);
}
}
/**
* @dev A modifier that defines a protected reinitializer function that can be invoked at most once, and only if the
* contract hasn't been initialized to a greater version before. In its scope, `onlyInitializing` functions can be
* used to initialize parent contracts.
*
* A reinitializer may be used after the original initialization step. This is essential to configure modules that
* are added through upgrades and that require initialization.
*
* When `version` is 1, this modifier is similar to `initializer`, except that functions marked with `reinitializer`
* cannot be nested. If one is invoked in the context of another, execution will revert.
*
* Note that versions can jump in increments greater than 1; this implies that if multiple reinitializers coexist in
* a contract, executing them in the right order is up to the developer or operator.
*
* WARNING: setting the version to 255 will prevent any future reinitialization.
*
* Emits an {Initialized} event.
*/
modifier reinitializer(uint8 version) {
require(!_initializing && _initialized < version, "Initializable: contract is already initialized");
_initialized = version;
_initializing = true;
_;
_initializing = false;
emit Initialized(version);
}
/**
* @dev Modifier to protect an initialization function so that it can only be invoked by functions with the
* {initializer} and {reinitializer} modifiers, directly or indirectly.
*/
modifier onlyInitializing() {
require(_initializing, "Initializable: contract is not initializing");
_;
}
/**
* @dev Locks the contract, preventing any future reinitialization. This cannot be part of an initializer call.
* Calling this in the constructor of a contract will prevent that contract from being initialized or reinitialized
* to any version. It is recommended to use this to lock implementation contracts that are designed to be called
* through proxies.
*
* Emits an {Initialized} event the first time it is successfully executed.
*/
function _disableInitializers() internal virtual {
require(!_initializing, "Initializable: contract is initializing");
if (_initialized < type(uint8).max) {
_initialized = type(uint8).max;
emit Initialized(type(uint8).max);
}
}
/**
* @dev Returns the highest version that has been initialized. See {reinitializer}.
*/
function _getInitializedVersion() internal view returns (uint8) {
return _initialized;
}
/**
* @dev Returns `true` if the contract is currently initializing. See {onlyInitializing}.
*/
function _isInitializing() internal view returns (bool) {
return _initializing;
}
}
contracts/oz_upgradable/proxy/utils/UUPSUpgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.8.0) (proxy/utils/UUPSUpgradeable.sol)
pragma solidity ^0.8.0;
import "../../interfaces/draft-IERC1822Upgradeable.sol";
import "../ERC1967/ERC1967UpgradeUpgradeable.sol";
import "./Initializable.sol";
/**
* @dev An upgradeability mechanism designed for UUPS proxies. The functions included here can perform an upgrade of an
* {ERC1967Proxy}, when this contract is set as the implementation behind such a proxy.
*
* A security mechanism ensures that an upgrade does not turn off upgradeability accidentally, although this risk is
* reinstated if the upgrade retains upgradeability but removes the security mechanism, e.g. by replacing
* `UUPSUpgradeable` with a custom implementation of upgrades.
*
* The {_authorizeUpgrade} function must be overridden to include access restriction to the upgrade mechanism.
*
* _Available since v4.1._
*/
abstract contract UUPSUpgradeable is Initializable, IERC1822ProxiableUpgradeable, ERC1967UpgradeUpgradeable {
function __UUPSUpgradeable_init() internal onlyInitializing {
}
function __UUPSUpgradeable_init_unchained() internal onlyInitializing {
}
/// @custom:oz-upgrades-unsafe-allow state-variable-immutable state-variable-assignment
address private immutable __self = address(this);
/**
* @dev Check that the execution is being performed through a delegatecall call and that the execution context is
* a proxy contract with an implementation (as defined in ERC1967) pointing to self. This should only be the case
* for UUPS and transparent proxies that are using the current contract as their implementation. Execution of a
* function through ERC1167 minimal proxies (clones) would not normally pass this test, but is not guaranteed to
* fail.
*/
modifier onlyProxy() {
require(address(this) != __self, "Function must be called through delegatecall");
require(_getImplementation() == __self, "Function must be called through active proxy");
_;
}
/**
* @dev Check that the execution is not being performed through a delegate call. This allows a function to be
* callable on the implementing contract but not through proxies.
*/
modifier notDelegated() {
require(address(this) == __self, "UUPSUpgradeable: must not be called through delegatecall");
_;
}
/**
* @dev Implementation of the ERC1822 {proxiableUUID} function. This returns the storage slot used by the
* implementation. It is used to validate the implementation's compatibility when performing an upgrade.
*
* IMPORTANT: A proxy pointing at a proxiable contract should not be considered proxiable itself, because this risks
* bricking a proxy that upgrades to it, by delegating to itself until out of gas. Thus it is critical that this
* function revert if invoked through a proxy. This is guaranteed by the `notDelegated` modifier.
*/
function proxiableUUID() external view virtual override notDelegated returns (bytes32) {
return _IMPLEMENTATION_SLOT;
}
/**
* @dev Upgrade the implementation of the proxy to `newImplementation`.
*
* Calls {_authorizeUpgrade}.
*
* Emits an {Upgraded} event.
*/
function upgradeTo(address newImplementation) external virtual onlyProxy {
_authorizeUpgrade(newImplementation);
_upgradeToAndCallUUPS(newImplementation, new bytes(0), false);
}
/**
* @dev Upgrade the implementation of the proxy to `newImplementation`, and subsequently execute the function call
* encoded in `data`.
*
* Calls {_authorizeUpgrade}.
*
* Emits an {Upgraded} event.
*/
function upgradeToAndCall(address newImplementation, bytes memory data) external payable virtual onlyProxy {
_authorizeUpgrade(newImplementation);
_upgradeToAndCallUUPS(newImplementation, data, true);
}
/**
* @dev Function that should revert when `msg.sender` is not authorized to upgrade the contract. Called by
* {upgradeTo} and {upgradeToAndCall}.
*
* Normally, this function will use an xref:access.adoc[access control] modifier such as {Ownable-onlyOwner}.
*
* ```solidity
* function _authorizeUpgrade(address) internal override onlyOwner {}
* ```
*/
function _authorizeUpgrade(address newImplementation) internal virtual;
/**
* @dev This empty reserved space is put in place to allow future versions to add new
* variables without shifting down storage in the inheritance chain.
* See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps
*/
uint256[50] private __gap;
}
contracts/uniswap/v2-periphery/interfaces/IUniswapV2Router01.sol
/*
* SPDX-License-Identifier: MIT
*/
pragma solidity ^0.8.19;
interface IUniswapV2Router01 {
function factory() external pure returns (address);
// function WETH() external pure returns (address);
function WPLS() external pure returns (address);
function addLiquidity(
address tokenA,
address tokenB,
uint amountADesired,
uint amountBDesired,
uint amountAMin,
uint amountBMin,
address to,
uint deadline
) external returns (uint amountA, uint amountB, uint liquidity);
function addLiquidityETH(
address token,
uint amountTokenDesired,
uint amountTokenMin,
uint amountETHMin,
address to,
uint deadline
)
external
payable
returns (uint amountToken, uint amountETH, uint liquidity);
function removeLiquidity(
address tokenA,
address tokenB,
uint liquidity,
uint amountAMin,
uint amountBMin,
address to,
uint deadline
) external returns (uint amountA, uint amountB);
function removeLiquidityETH(
address token,
uint liquidity,
uint amountTokenMin,
uint amountETHMin,
address to,
uint deadline
) external returns (uint amountToken, uint amountETH);
function removeLiquidityWithPermit(
address tokenA,
address tokenB,
uint liquidity,
uint amountAMin,
uint amountBMin,
address to,
uint deadline,
bool approveMax,
uint8 v,
bytes32 r,
bytes32 s
) external returns (uint amountA, uint amountB);
function removeLiquidityETHWithPermit(
address token,
uint liquidity,
uint amountTokenMin,
uint amountETHMin,
address to,
uint deadline,
bool approveMax,
uint8 v,
bytes32 r,
bytes32 s
) external returns (uint amountToken, uint amountETH);
function swapExactTokensForTokens(
uint amountIn,
uint amountOutMin,
address[] calldata path,
address to,
uint deadline
) external returns (uint[] memory amounts);
function swapTokensForExactTokens(
uint amountOut,
uint amountInMax,
address[] calldata path,
address to,
uint deadline
) external returns (uint[] memory amounts);
function swapExactETHForTokens(
uint amountOutMin,
address[] calldata path,
address to,
uint deadline
) external payable returns (uint[] memory amounts);
function swapTokensForExactETH(
uint amountOut,
uint amountInMax,
address[] calldata path,
address to,
uint deadline
) external returns (uint[] memory amounts);
function swapExactTokensForETH(
uint amountIn,
uint amountOutMin,
address[] calldata path,
address to,
uint deadline
) external returns (uint[] memory amounts);
function swapETHForExactTokens(
uint amountOut,
address[] calldata path,
address to,
uint deadline
) external payable returns (uint[] memory amounts);
function quote(
uint amountA,
uint reserveA,
uint reserveB
) external pure returns (uint amountB);
function getAmountOut(
uint amountIn,
uint reserveIn,
uint reserveOut
) external pure returns (uint amountOut);
function getAmountIn(
uint amountOut,
uint reserveIn,
uint reserveOut
) external pure returns (uint amountIn);
function getAmountsOut(
uint amountIn,
address[] calldata path
) external view returns (uint[] memory amounts);
function getAmountsIn(
uint amountOut,
address[] calldata path
) external view returns (uint[] memory amounts);
}
contracts/oz_upgradable/security/PausableUpgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.0) (security/Pausable.sol)
pragma solidity ^0.8.0;
import "../utils/ContextUpgradeable.sol";
import "../proxy/utils/Initializable.sol";
/**
* @dev Contract module which allows children to implement an emergency stop
* mechanism that can be triggered by an authorized account.
*
* This module is used through inheritance. It will make available the
* modifiers `whenNotPaused` and `whenPaused`, which can be applied to
* the functions of your contract. Note that they will not be pausable by
* simply including this module, only once the modifiers are put in place.
*/
abstract contract PausableUpgradeable is Initializable, ContextUpgradeable {
/**
* @dev Emitted when the pause is triggered by `account`.
*/
event Paused(address account);
/**
* @dev Emitted when the pause is lifted by `account`.
*/
event Unpaused(address account);
bool private _paused;
/**
* @dev Initializes the contract in unpaused state.
*/
function __Pausable_init() internal onlyInitializing {
__Pausable_init_unchained();
}
function __Pausable_init_unchained() internal onlyInitializing {
_paused = false;
}
/**
* @dev Modifier to make a function callable only when the contract is not paused.
*
* Requirements:
*
* - The contract must not be paused.
*/
modifier whenNotPaused() {
_requireNotPaused();
_;
}
/**
* @dev Modifier to make a function callable only when the contract is paused.
*
* Requirements:
*
* - The contract must be paused.
*/
modifier whenPaused() {
_requirePaused();
_;
}
/**
* @dev Returns true if the contract is paused, and false otherwise.
*/
function paused() public view virtual returns (bool) {
return _paused;
}
/**
* @dev Throws if the contract is paused.
*/
function _requireNotPaused() internal view virtual {
require(!paused(), "Pausable: paused");
}
/**
* @dev Throws if the contract is not paused.
*/
function _requirePaused() internal view virtual {
require(paused(), "Pausable: not paused");
}
/**
* @dev Triggers stopped state.
*
* Requirements:
*
* - The contract must not be paused.
*/
function _pause() internal virtual whenNotPaused {
_paused = true;
emit Paused(_msgSender());
}
/**
* @dev Returns to normal state.
*
* Requirements:
*
* - The contract must be paused.
*/
function _unpause() internal virtual whenPaused {
_paused = false;
emit Unpaused(_msgSender());
}
/**
* @dev This empty reserved space is put in place to allow future versions to add new
* variables without shifting down storage in the inheritance chain.
* See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps
*/
uint256[49] private __gap;
}
contracts/oz_upgradable/token/ERC20/IERC20Upgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.6.0) (token/ERC20/IERC20.sol)
pragma solidity ^0.8.0;
/**
* @dev Interface of the ERC20 standard as defined in the EIP.
*/
interface IERC20Upgradeable {
/**
* @dev Emitted when `value` tokens are moved from one account (`from`) to
* another (`to`).
*
* Note that `value` may be zero.
*/
event Transfer(address indexed from, address indexed to, uint256 value);
/**
* @dev Emitted when the allowance of a `spender` for an `owner` is set by
* a call to {approve}. `value` is the new allowance.
*/
event Approval(address indexed owner, address indexed spender, uint256 value);
/**
* @dev Returns the amount of tokens in existence.
*/
function totalSupply() external view returns (uint256);
/**
* @dev Returns the amount of tokens owned by `account`.
*/
function balanceOf(address account) external view returns (uint256);
/**
* @dev Moves `amount` tokens from the caller's account to `to`.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transfer(address to, uint256 amount) external returns (bool);
/**
* @dev Returns the remaining number of tokens that `spender` will be
* allowed to spend on behalf of `owner` through {transferFrom}. This is
* zero by default.
*
* This value changes when {approve} or {transferFrom} are called.
*/
function allowance(address owner, address spender) external view returns (uint256);
/**
* @dev Sets `amount` as the allowance of `spender` over the caller's tokens.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* IMPORTANT: Beware that changing an allowance with this method brings the risk
* that someone may use both the old and the new allowance by unfortunate
* transaction ordering. One possible solution to mitigate this race
* condition is to first reduce the spender's allowance to 0 and set the
* desired value afterwards:
* https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
*
* Emits an {Approval} event.
*/
function approve(address spender, uint256 amount) external returns (bool);
/**
* @dev Moves `amount` tokens from `from` to `to` using the
* allowance mechanism. `amount` is then deducted from the caller's
* allowance.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transferFrom(
address from,
address to,
uint256 amount
) external returns (bool);
}
contracts/oz_upgradable/utils/AddressUpgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.8.0) (utils/Address.sol)
pragma solidity ^0.8.1;
/**
* @dev Collection of functions related to the address type
*/
library AddressUpgradeable {
/**
* @dev Returns true if `account` is a contract.
*
* [IMPORTANT]
* ====
* It is unsafe to assume that an address for which this function returns
* false is an externally-owned account (EOA) and not a contract.
*
* Among others, `isContract` will return false for the following
* types of addresses:
*
* - an externally-owned account
* - a contract in construction
* - an address where a contract will be created
* - an address where a contract lived, but was destroyed
* ====
*
* [IMPORTANT]
* ====
* You shouldn't rely on `isContract` to protect against flash loan attacks!
*
* Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets
* like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract
* constructor.
* ====
*/
function isContract(address account) internal view returns (bool) {
// This method relies on extcodesize/address.code.length, which returns 0
// for contracts in construction, since the code is only stored at the end
// of the constructor execution.
return account.code.length > 0;
}
/**
* @dev Replacement for Solidity's `transfer`: sends `amount` wei to
* `recipient`, forwarding all available gas and reverting on errors.
*
* https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost
* of certain opcodes, possibly making contracts go over the 2300 gas limit
* imposed by `transfer`, making them unable to receive funds via
* `transfer`. {sendValue} removes this limitation.
*
* https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].
*
* IMPORTANT: because control is transferred to `recipient`, care must be
* taken to not create reentrancy vulnerabilities. Consider using
* {ReentrancyGuard} or the
* https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].
*/
function sendValue(address payable recipient, uint256 amount) internal {
require(address(this).balance >= amount, "Address: insufficient balance");
(bool success, ) = recipient.call{value: amount}("");
require(success, "Address: unable to send value, recipient may have reverted");
}
/**
* @dev Performs a Solidity function call using a low level `call`. A
* plain `call` is an unsafe replacement for a function call: use this
* function instead.
*
* If `target` reverts with a revert reason, it is bubbled up by this
* function (like regular Solidity function calls).
*
* Returns the raw returned data. To convert to the expected return value,
* use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].
*
* Requirements:
*
* - `target` must be a contract.
* - calling `target` with `data` must not revert.
*
* _Available since v3.1._
*/
function functionCall(address target, bytes memory data) internal returns (bytes memory) {
return functionCallWithValue(target, data, 0, "Address: low-level call failed");
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with
* `errorMessage` as a fallback revert reason when `target` reverts.
*
* _Available since v3.1._
*/
function functionCall(
address target,
bytes memory data,
string memory errorMessage
) internal returns (bytes memory) {
return functionCallWithValue(target, data, 0, errorMessage);
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
* but also transferring `value` wei to `target`.
*
* Requirements:
*
* - the calling contract must have an ETH balance of at least `value`.
* - the called Solidity function must be `payable`.
*
* _Available since v3.1._
*/
function functionCallWithValue(
address target,
bytes memory data,
uint256 value
) internal returns (bytes memory) {
return functionCallWithValue(target, data, value, "Address: low-level call with value failed");
}
/**
* @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but
* with `errorMessage` as a fallback revert reason when `target` reverts.
*
* _Available since v3.1._
*/
function functionCallWithValue(
address target,
bytes memory data,
uint256 value,
string memory errorMessage
) internal returns (bytes memory) {
require(address(this).balance >= value, "Address: insufficient balance for call");
(bool success, bytes memory returndata) = target.call{value: value}(data);
return verifyCallResultFromTarget(target, success, returndata, errorMessage);
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
* but performing a static call.
*
* _Available since v3.3._
*/
function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {
return functionStaticCall(target, data, "Address: low-level static call failed");
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
* but performing a static call.
*
* _Available since v3.3._
*/
function functionStaticCall(
address target,
bytes memory data,
string memory errorMessage
) internal view returns (bytes memory) {
(bool success, bytes memory returndata) = target.staticcall(data);
return verifyCallResultFromTarget(target, success, returndata, errorMessage);
}
/**
* @dev Tool to verify that a low level call to smart-contract was successful, and revert (either by bubbling
* the revert reason or using the provided one) in case of unsuccessful call or if target was not a contract.
*
* _Available since v4.8._
*/
function verifyCallResultFromTarget(
address target,
bool success,
bytes memory returndata,
string memory errorMessage
) internal view returns (bytes memory) {
if (success) {
if (returndata.length == 0) {
// only check isContract if the call was successful and the return data is empty
// otherwise we already know that it was a contract
require(isContract(target), "Address: call to non-contract");
}
return returndata;
} else {
_revert(returndata, errorMessage);
}
}
/**
* @dev Tool to verify that a low level call was successful, and revert if it wasn't, either by bubbling the
* revert reason or using the provided one.
*
* _Available since v4.3._
*/
function verifyCallResult(
bool success,
bytes memory returndata,
string memory errorMessage
) internal pure returns (bytes memory) {
if (success) {
return returndata;
} else {
_revert(returndata, errorMessage);
}
}
function _revert(bytes memory returndata, string memory errorMessage) private pure {
// Look for revert reason and bubble it up if present
if (returndata.length > 0) {
// The easiest way to bubble the revert reason is using memory via assembly
/// @solidity memory-safe-assembly
assembly {
let returndata_size := mload(returndata)
revert(add(32, returndata), returndata_size)
}
} else {
revert(errorMessage);
}
}
}
contracts/oz_upgradable/utils/ContextUpgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)
pragma solidity ^0.8.0;
import "../proxy/utils/Initializable.sol";
/**
* @dev Provides information about the current execution context, including the
* sender of the transaction and its data. While these are generally available
* via msg.sender and msg.data, they should not be accessed in such a direct
* manner, since when dealing with meta-transactions the account sending and
* paying for execution may not be the actual sender (as far as an application
* is concerned).
*
* This contract is only required for intermediate, library-like contracts.
*/
abstract contract ContextUpgradeable is Initializable {
function __Context_init() internal onlyInitializing {
}
function __Context_init_unchained() internal onlyInitializing {
}
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
function _msgData() internal view virtual returns (bytes calldata) {
return msg.data;
}
/**
* @dev This empty reserved space is put in place to allow future versions to add new
* variables without shifting down storage in the inheritance chain.
* See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps
*/
uint256[50] private __gap;
}
contracts/oz_upgradable/utils/StorageSlotUpgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.0) (utils/StorageSlot.sol)
pragma solidity ^0.8.0;
/**
* @dev Library for reading and writing primitive types to specific storage slots.
*
* Storage slots are often used to avoid storage conflict when dealing with upgradeable contracts.
* This library helps with reading and writing to such slots without the need for inline assembly.
*
* The functions in this library return Slot structs that contain a `value` member that can be used to read or write.
*
* Example usage to set ERC1967 implementation slot:
* ```
* contract ERC1967 {
* bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;
*
* function _getImplementation() internal view returns (address) {
* return StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value;
* }
*
* function _setImplementation(address newImplementation) internal {
* require(Address.isContract(newImplementation), "ERC1967: new implementation is not a contract");
* StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;
* }
* }
* ```
*
* _Available since v4.1 for `address`, `bool`, `bytes32`, and `uint256`._
*/
library StorageSlotUpgradeable {
struct AddressSlot {
address value;
}
struct BooleanSlot {
bool value;
}
struct Bytes32Slot {
bytes32 value;
}
struct Uint256Slot {
uint256 value;
}
/**
* @dev Returns an `AddressSlot` with member `value` located at `slot`.
*/
function getAddressSlot(bytes32 slot) internal pure returns (AddressSlot storage r) {
/// @solidity memory-safe-assembly
assembly {
r.slot := slot
}
}
/**
* @dev Returns an `BooleanSlot` with member `value` located at `slot`.
*/
function getBooleanSlot(bytes32 slot) internal pure returns (BooleanSlot storage r) {
/// @solidity memory-safe-assembly
assembly {
r.slot := slot
}
}
/**
* @dev Returns an `Bytes32Slot` with member `value` located at `slot`.
*/
function getBytes32Slot(bytes32 slot) internal pure returns (Bytes32Slot storage r) {
/// @solidity memory-safe-assembly
assembly {
r.slot := slot
}
}
/**
* @dev Returns an `Uint256Slot` with member `value` located at `slot`.
*/
function getUint256Slot(bytes32 slot) internal pure returns (Uint256Slot storage r) {
/// @solidity memory-safe-assembly
assembly {
r.slot := slot
}
}
}
contracts/uniswap/v2-core/interfaces/IUniswapV2Factory.sol
/*
* SPDX-License-Identifier: MIT
*/
pragma solidity ^0.8.19;
interface IUniswapV2Factory {
event PairCreated(
address indexed token0,
address indexed token1,
address pair,
uint
);
function feeTo() external view returns (address);
function feeToSetter() external view returns (address);
function getPair(
address tokenA,
address tokenB
) external view returns (address pair);
function allPairs(uint) external view returns (address pair);
function allPairsLength() external view returns (uint);
function createPair(
address tokenA,
address tokenB
) external returns (address pair);
function setFeeTo(address) external;
function setFeeToSetter(address) external;
}
contracts/uniswap/v2-core/interfaces/IUniswapV2Pair.sol
/*
* SPDX-License-Identifier: MIT
*/
pragma solidity ^0.8.19;
interface IUniswapV2Pair {
event Approval(address indexed owner, address indexed spender, uint value);
event Transfer(address indexed from, address indexed to, uint value);
function name() external pure returns (string memory);
function symbol() external pure returns (string memory);
function decimals() external pure returns (uint8);
function totalSupply() external view returns (uint);
function balanceOf(address owner) external view returns (uint);
function allowance(
address owner,
address spender
) external view returns (uint);
function approve(address spender, uint value) external returns (bool);
function transfer(address to, uint value) external returns (bool);
function transferFrom(
address from,
address to,
uint value
) external returns (bool);
function DOMAIN_SEPARATOR() external view returns (bytes32);
function PERMIT_TYPEHASH() external pure returns (bytes32);
function nonces(address owner) external view returns (uint);
function permit(
address owner,
address spender,
uint value,
uint deadline,
uint8 v,
bytes32 r,
bytes32 s
) external;
event Mint(address indexed sender, uint amount0, uint amount1);
event Burn(
address indexed sender,
uint amount0,
uint amount1,
address indexed to
);
event Swap(
address indexed sender,
uint amount0In,
uint amount1In,
uint amount0Out,
uint amount1Out,
address indexed to
);
event Sync(uint112 reserve0, uint112 reserve1);
function MINIMUM_LIQUIDITY() external pure returns (uint);
function factory() external view returns (address);
function token0() external view returns (address);
function token1() external view returns (address);
function getReserves()
external
view
returns (uint112 reserve0, uint112 reserve1, uint32 blockTimestampLast);
function price0CumulativeLast() external view returns (uint);
function price1CumulativeLast() external view returns (uint);
function kLast() external view returns (uint);
function mint(address to) external returns (uint liquidity);
function burn(address to) external returns (uint amount0, uint amount1);
function swap(
uint amount0Out,
uint amount1Out,
address to,
bytes calldata data
) external;
function skim(address to) external;
function sync() external;
function initialize(address, address) external;
}
contracts/uniswap/v2-periphery/interfaces/IUniswapV2Router02.sol
/*
* SPDX-License-Identifier: MIT
*/
pragma solidity ^0.8.19;
import "./IUniswapV2Router01.sol";
interface IUniswapV2Router02 is IUniswapV2Router01 {
function removeLiquidityETHSupportingFeeOnTransferTokens(
address token,
uint liquidity,
uint amountTokenMin,
uint amountETHMin,
address to,
uint deadline
) external returns (uint amountETH);
function removeLiquidityETHWithPermitSupportingFeeOnTransferTokens(
address token,
uint liquidity,
uint amountTokenMin,
uint amountETHMin,
address to,
uint deadline,
bool approveMax, uint8 v, bytes32 r, bytes32 s
) external returns (uint amountETH);
function swapExactTokensForTokensSupportingFeeOnTransferTokens(
uint amountIn,
uint amountOutMin,
address[] calldata path,
address to,
uint deadline
) external;
function swapExactETHForTokensSupportingFeeOnTransferTokens(
uint amountOutMin,
address[] calldata path,
address to,
uint deadline
) external payable;
function swapExactTokensForETHSupportingFeeOnTransferTokens(
uint amountIn,
uint amountOutMin,
address[] calldata path,
address to,
uint deadline
) external;
}
contracts/uniswap/v3-core/interfaces/IUniswapV3Factory.sol
// SPDX-License-Identifier: GPL-2.0-or-later
pragma solidity ^0.8.19;
/// @title The interface for the Uniswap V3 Factory
/// @notice The Uniswap V3 Factory facilitates creation of Uniswap V3 pools and control over the protocol fees
interface IUniswapV3Factory {
/// @notice Returns the pool address for a given pair of tokens and a fee, or address 0 if it does not exist
/// @dev tokenA and tokenB may be passed in either token0/token1 or token1/token0 order
/// @param tokenA The contract address of either token0 or token1
/// @param tokenB The contract address of the other token
/// @param fee The fee collected upon every swap in the pool, denominated in hundredths of a bip
/// @return pool The pool address
function getPool(
address tokenA,
address tokenB,
uint24 fee
) external view returns (address pool);
}
contracts/uniswap/v3-core/interfaces/IUniswapV3Pool.sol
// SPDX-License-Identifier: GPL-2.0-or-later
pragma solidity ^0.8.19;
import "./pool/IUniswapV3PoolImmutables.sol";
/// @title The interface for a Uniswap V3 Pool
/// @notice A Uniswap pool facilitates swapping and automated market making between any two assets that strictly conform
/// to the ERC20 specification
/// @dev The pool interface is broken up into many smaller pieces
interface IUniswapV3Pool is IUniswapV3PoolImmutables {
}
contracts/uniswap/v3-core/interfaces/pool/IUniswapV3PoolImmutables.sol
// SPDX-License-Identifier: GPL-2.0-or-later
pragma solidity ^0.8.19;
/// @title Pool state that never changes
/// @notice These parameters are fixed for a pool forever, i.e., the methods will always return the same values
interface IUniswapV3PoolImmutables {
/// @notice The first of the two tokens of the pool, sorted by address
/// @return The token contract address
function token0() external view returns (address);
/// @notice The second of the two tokens of the pool, sorted by address
/// @return The token contract address
function token1() external view returns (address);
/// @notice The pool's fee in hundredths of a bip, i.e. 1e-6
/// @return The fee
function fee() external view returns (uint24);
}
Compiler Settings
{"outputSelection":{"*":{"*":["abi","evm.bytecode","evm.deployedBytecode","evm.methodIdentifiers","metadata","storageLayout"],"":["ast"]}},"optimizer":{"runs":200,"enabled":true},"libraries":{}}
Contract ABI
[{"type":"event","name":"AddLPEnabledUpdated","inputs":[{"type":"bool","name":"enabled","internalType":"bool","indexed":false}],"anonymous":false},{"type":"event","name":"AdminChanged","inputs":[{"type":"address","name":"previousAdmin","internalType":"address","indexed":false},{"type":"address","name":"newAdmin","internalType":"address","indexed":false}],"anonymous":false},{"type":"event","name":"Approval","inputs":[{"type":"address","name":"owner","internalType":"address","indexed":true},{"type":"address","name":"spender","internalType":"address","indexed":true},{"type":"uint256","name":"value","internalType":"uint256","indexed":false}],"anonymous":false},{"type":"event","name":"BeaconUpgraded","inputs":[{"type":"address","name":"beacon","internalType":"address","indexed":true}],"anonymous":false},{"type":"event","name":"FeeTransfers","inputs":[{"type":"uint256","name":"Reflected","internalType":"uint256","indexed":false},{"type":"uint256","name":"Burnt","internalType":"uint256","indexed":false},{"type":"uint256","name":"Growth","internalType":"uint256","indexed":false},{"type":"uint256","name":"AutoLiquity","internalType":"uint256","indexed":false},{"type":"uint256","name":"Payday","internalType":"uint256","indexed":false}],"anonymous":false},{"type":"event","name":"Initialized","inputs":[{"type":"uint8","name":"version","internalType":"uint8","indexed":false}],"anonymous":false},{"type":"event","name":"ManagementTransferred","inputs":[{"type":"address","name":"previousManager","internalType":"address","indexed":true},{"type":"address","name":"newManager","internalType":"address","indexed":true}],"anonymous":false},{"type":"event","name":"OwnershipTransferred","inputs":[{"type":"address","name":"previousOwner","internalType":"address","indexed":true},{"type":"address","name":"newOwner","internalType":"address","indexed":true}],"anonymous":false},{"type":"event","name":"Paused","inputs":[{"type":"address","name":"account","internalType":"address","indexed":false}],"anonymous":false},{"type":"event","name":"SwapAndLiquify","inputs":[{"type":"uint256","name":"tokensSwapped","internalType":"uint256","indexed":false},{"type":"uint256","name":"ethReceived","internalType":"uint256","indexed":false},{"type":"uint256","name":"tokensIntoLiqudity","internalType":"uint256","indexed":false}],"anonymous":false},{"type":"event","name":"Transfer","inputs":[{"type":"address","name":"from","internalType":"address","indexed":true},{"type":"address","name":"to","internalType":"address","indexed":true},{"type":"uint256","name":"value","internalType":"uint256","indexed":false}],"anonymous":false},{"type":"event","name":"Unpaused","inputs":[{"type":"address","name":"account","internalType":"address","indexed":false}],"anonymous":false},{"type":"event","name":"Upgraded","inputs":[{"type":"address","name":"implementation","internalType":"address","indexed":true}],"anonymous":false},{"type":"fallback","stateMutability":"payable"},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"__BSKR_V2_init","inputs":[{"type":"uint8","name":"version","internalType":"uint8"},{"type":"string","name":"nameA","internalType":"string"},{"type":"string","name":"symbolA","internalType":"string"},{"type":"address","name":"growth1AddressA","internalType":"address"},{"type":"address","name":"growth2AddressA","internalType":"address"},{"type":"address","name":"paydayAddressA","internalType":"address"},{"type":"address","name":"lbskrAddrA","internalType":"address"},{"type":"address[5]","name":"sisterOAsA","internalType":"address[5]"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"airdrop","inputs":[{"type":"tuple[]","name":"receivers","internalType":"struct BaseBSKR_V2.Airdrop[]","components":[{"type":"address","name":"user","internalType":"address"},{"type":"uint256","name":"amount","internalType":"uint256"}]}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"allowance","inputs":[{"type":"address","name":"owner","internalType":"address"},{"type":"address","name":"spender","internalType":"address"}]},{"type":"function","stateMutability":"nonpayable","outputs":[{"type":"bool","name":"","internalType":"bool"}],"name":"approve","inputs":[{"type":"address","name":"spender","internalType":"address"},{"type":"uint256","name":"amount","internalType":"uint256"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"balanceOf","inputs":[{"type":"address","name":"wallet","internalType":"address"}]},{"type":"function","stateMutability":"pure","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"decimals","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[{"type":"bool","name":"","internalType":"bool"}],"name":"decreaseAllowance","inputs":[{"type":"address","name":"spender","internalType":"address"},{"type":"uint256","name":"subtractedValue","internalType":"uint256"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"disableUniswapV3","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"enableUniswapV3","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"giftReflection","inputs":[{"type":"uint256","name":"tAmount","internalType":"uint256"}]},{"type":"function","stateMutability":"nonpayable","outputs":[{"type":"bool","name":"","internalType":"bool"}],"name":"increaseAllowance","inputs":[{"type":"address","name":"spender","internalType":"address"},{"type":"uint256","name":"addedValue","internalType":"uint256"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"address"}],"name":"manager","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"string","name":"","internalType":"string"}],"name":"name","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"address"}],"name":"owner","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"pauseContract","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"bool","name":"","internalType":"bool"}],"name":"paused","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"bytes32","name":"","internalType":"bytes32"}],"name":"proxiableUUID","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"renounceOwnership","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"setSwapAndLiquifyEnabled","inputs":[{"type":"bool","name":"_enabled","internalType":"bool"}]},{"type":"function","stateMutability":"nonpayable","outputs":[{"type":"bool","name":"","internalType":"bool"}],"name":"stakeTransfer","inputs":[{"type":"address","name":"from","internalType":"address"},{"type":"address","name":"to","internalType":"address"},{"type":"uint256","name":"amount","internalType":"uint256"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"string","name":"","internalType":"string"}],"name":"symbol","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"totalSupply","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[{"type":"bool","name":"","internalType":"bool"}],"name":"transfer","inputs":[{"type":"address","name":"to","internalType":"address"},{"type":"uint256","name":"amount","internalType":"uint256"}]},{"type":"function","stateMutability":"nonpayable","outputs":[{"type":"bool","name":"","internalType":"bool"}],"name":"transferFrom","inputs":[{"type":"address","name":"from","internalType":"address"},{"type":"address","name":"to","internalType":"address"},{"type":"uint256","name":"amount","internalType":"uint256"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"transferManagement","inputs":[{"type":"address","name":"newManager","internalType":"address"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"transferOwnership","inputs":[{"type":"address","name":"newOwner","internalType":"address"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"unPauseContract","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"upgradeTo","inputs":[{"type":"address","name":"newImplementation","internalType":"address"}]},{"type":"function","stateMutability":"payable","outputs":[],"name":"upgradeToAndCall","inputs":[{"type":"address","name":"newImplementation","internalType":"address"},{"type":"bytes","name":"data","internalType":"bytes"}]},{"type":"receive","stateMutability":"payable"}]
Contract Creation Code
0x60a06040523060805234801561001457600080fd5b5060805161306a61004c6000396000818161065f0152818161069f01528181610772015281816107b20152610845015261306a6000f3fe6080604052600436106101ae5760003560e01c806370a08231116100eb578063c49b9a801161008f578063e4edf85211610061578063e4edf85214610494578063e683d7b9146104b4578063f2fde38b146104d4578063f66897f8146104f457005b8063c49b9a801461041f578063d5f954241461043f578063dd62ed3e14610454578063e0c9ffc61461047457005b806395d89b41116100c857806395d89b41146103b5578063a457c2d7146103ca578063a9059cbb146103ea578063bac152031461040a57005b806370a0823114610362578063715018a6146103825780638da5cb5b1461039757005b8063439766ce1161015257806352d1902d1161012f57806352d1902d146103005780635c975abb14610315578063664f73311461032d5780636c74dd511461034257005b8063439766ce146102a6578063481c6a75146102bb5780634f1ef286146102ed57005b806323b872dd1161018b57806323b872dd14610232578063313ce567146102525780633659cfe614610266578063395093511461028657005b806306fdde03146101b7578063095ea7b3146101e257806318160ddd1461021257005b366101b557005b005b3480156101c357600080fd5b506101cc610514565b6040516101d9919061290a565b60405180910390f35b3480156101ee57600080fd5b506102026101fd366004612962565b6105a7565b60405190151581526020016101d9565b34801561021e57600080fd5b5061010e545b6040519081526020016101d9565b34801561023e57600080fd5b5061020261024d36600461298e565b6105c1565b34801561025e57600080fd5b506012610224565b34801561027257600080fd5b506101b56102813660046129cf565b610655565b34801561029257600080fd5b506102026102a1366004612962565b610734565b3480156102b257600080fd5b506101b5610756565b3480156102c757600080fd5b5060fb546001600160a01b03165b6040516001600160a01b0390911681526020016101d9565b6101b56102fb366004612a33565b610768565b34801561030c57600080fd5b50610224610838565b34801561032157600080fd5b5060c95460ff16610202565b34801561033957600080fd5b506101b56108eb565b34801561034e57600080fd5b5061020261035d36600461298e565b610903565b34801561036e57600080fd5b5061022461037d3660046129cf565b610962565b34801561038e57600080fd5b506101b5610a35565b3480156103a357600080fd5b506033546001600160a01b03166102d5565b3480156103c157600080fd5b506101cc610a47565b3480156103d657600080fd5b506102026103e5366004612962565b610a57565b3480156103f657600080fd5b50610202610405366004612962565b610acf565b34801561041657600080fd5b506101b5610add565b34801561042b57600080fd5b506101b561043a366004612adb565b610aed565b34801561044b57600080fd5b506101b5610b3d565b34801561046057600080fd5b5061022461046f366004612afd565b610b52565b34801561048057600080fd5b506101b561048f366004612b36565b610b7e565b3480156104a057600080fd5b506101b56104af3660046129cf565b610c54565b3480156104c057600080fd5b506101b56104cf366004612c6b565b610cb8565b3480156104e057600080fd5b506101b56104ef3660046129cf565b610d98565b34801561050057600080fd5b506101b561050f366004612d48565b610e0e565b606061010b805461052490612d61565b80601f016020809104026020016040519081016040528092919081815260200182805461055090612d61565b801561059d5780601f106105725761010080835404028352916020019161059d565b820191906000526020600020905b81548152906001019060200180831161058057829003601f168201915b5050505050905090565b6000336105b5818585610f95565b60019150505b92915050565b600033816105cf8683610b52565b9050600019811461063c578381101561062f5760405162461bcd60e51b815260206004820152601a60248201527f42423a20496e73756666696369656e7420616c6c6f77616e636500000000000060448201526064015b60405180910390fd5b61063c8683868403610f95565b610647868686611085565b6001925050505b9392505050565b6001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016300361069d5760405162461bcd60e51b815260040161062690612d9b565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03166106e6600080516020612fee833981519152546001600160a01b031690565b6001600160a01b03161461070c5760405162461bcd60e51b815260040161062690612de7565b610715816116d8565b60408051600080825260208201909252610731918391906116e0565b50565b6000336105b58185856107478383610b52565b6107519190612e49565b610f95565b61075e61184b565b61076661189d565b565b6001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001630036107b05760405162461bcd60e51b815260040161062690612d9b565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03166107f9600080516020612fee833981519152546001600160a01b031690565b6001600160a01b03161461081f5760405162461bcd60e51b815260040161062690612de7565b610828826116d8565b610834828260016116e0565b5050565b6000306001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016146108d85760405162461bcd60e51b815260206004820152603860248201527f555550535570677261646561626c653a206d757374206e6f742062652063616c60448201527f6c6564207468726f7567682064656c656761746563616c6c00000000000000006064820152608401610626565b50600080516020612fee83398151915290565b6108f361184b565b610106805460ff19166001179055565b610141546000906001600160a01b0316331461091e57600080fd5b6001600160a01b03808516600090815261014660205260408082205492861682528120546109589287928792879260ff90811691166118f7565b5060019392505050565b6001600160a01b0381166000908152610146602052604081205460ff16156109a157506001600160a01b0316600090815261010a602052604090205490565b610149546001600160a01b038316600090815261014860205260409020541115610a035760405162461bcd60e51b8152602060048201526013602482015272423a20416d6f756e7420746f6f206c6172676560681b6044820152606401610626565b6000610a0d611b68565b6001600160a01b0384166000908152610148602052604090205490915061064e908290612e5c565b610a3d611d08565b6107666000611d62565b606061010c805461052490612d61565b60003381610a658286610b52565b905083811015610ab75760405162461bcd60e51b815260206004820152601760248201527f42534b523a204465637265617365732062656c6f7720300000000000000000006044820152606401610626565b610ac48286868403610f95565b506001949350505050565b6000336105b5818585611085565b610ae561184b565b610766611db4565b610af561184b565b610145805460ff19168215159081179091556040519081527f91c8e5d8409e58da1d940ede98e9b35e17b453932366ea0a790416ab922ca4129060200160405180910390a150565b610b4561184b565b610106805460ff19169055565b6001600160a01b0391821660009081526101096020908152604080832093909416825291909152205490565b610b86611d08565b60005b81811015610c4f576000838383818110610ba557610ba5612e7e565b610bbb92602060409092020190810191506129cf565b6001600160a01b031614158015610bee5750828282818110610bdf57610bdf612e7e565b90506040020160200135600014155b15610c3f57610c3f838383818110610c0857610c08612e7e565b610c1e92602060409092020190810191506129cf565b848484818110610c3057610c30612e7e565b90506040020160200135611ded565b610c4881612e94565b9050610b89565b505050565b610c5c61184b565b60fb546040516001600160a01b038084169216907f80f15e9dbc60884fdb59fb8ed4fc48a9a689e028f055e893ed45ca5be67c5c8590600090a360fb80546001600160a01b0319166001600160a01b0392909216919091179055565b6000548a90610100900460ff16158015610cd9575060005460ff8083169116105b610d3c5760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b6064820152608401610626565b6000805461ffff191660ff83169081176101001761ff0019169091556040519081527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15050505050505050505050565b610da0611d08565b6001600160a01b038116610e055760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610626565b61073181611d62565b610e16611e2b565b80600003610e5c5760405162461bcd60e51b8152602060048201526013602482015272108e8816995c9bc819da599d08185b5bdd5b9d606a1b6044820152606401610626565b336000818152610146602052604090205460ff1615610eb25760405162461bcd60e51b8152602060048201526012602482015271108e88115e18db1d591959081dd85b1b195d60721b6044820152606401610626565b6000610ebf83600a611e71565b6020808201516001600160a01b038516600090815261014890925260409091205491925010610f245760405162461bcd60e51b8152602060048201526011602482015270423a204769667420746f6f206c6172676560781b6044820152606401610626565b6020808201516001600160a01b038416600090815261014890925260408220805491929091610f54908490612ead565b909155505060208101516101498054600090610f71908490612ead565b925050819055508261014c6000828254610f8b9190612e49565b9091555050505050565b6001600160a01b038316610fdd5760405162461bcd60e51b815260206004820152600f60248201526e21211d10233937b690181030b2323960891b6044820152606401610626565b6001600160a01b0382166110235760405162461bcd60e51b815260206004820152600d60248201526c21211d102a3790181030b2323960991b6044820152606401610626565b6001600160a01b038381166000818152610109602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b61108d611e2b565b6001600160a01b0383166110d45760405162461bcd60e51b815260206004820152600e60248201526d211d10233937b690181030b2323960911b6044820152606401610626565b6001600160a01b0382166111195760405162461bcd60e51b815260206004820152600c60248201526b211d102a3790181030b2323960a11b6044820152606401610626565b806000036111575760405162461bcd60e51b815260206004820152600b60248201526a108e880c08185b5bdd5b9d60aa1b6044820152606401610626565b6033546001600160a01b0384811691161480159061118357506033546001600160a01b03838116911614155b156111cf5761014a548111156111cf5760405162461bcd60e51b815260206004820152601160248201527008474408af0c6cacac8e640dac2f040e8f607b1b6044820152606401610626565b6101065460ff16611231576111e4838361203f565b156112315760405162461bcd60e51b815260206004820152601760248201527f423a20556e695633206e6f7420737570706f72746564210000000000000000006044820152606401610626565b61123a83612059565b6001600160a01b0383166000908152610107602052604090205460ff16156112655761126583612137565b61126e82612059565b6001600160a01b0382166000908152610107602052604090205460ff16156112995761129982612137565b60006112a430610962565b905061014b5481101580156112c2575061014554610100900460ff16155b80156112dd5750610142546001600160a01b03858116911614155b80156112ec57506101455460ff165b156115fb57610145805461ff00191661010017905561014b54600181901c90600090611319908390612ead565b6040805160028082526060820183529293504792600092602083019080368337019050509050308160008151811061135357611353612e7e565b6001600160a01b0392831660209182029290920101526101005482519116908290600190811061138557611385612e7e565b60200260200101906001600160a01b031690816001600160a01b0316815250506113b0303086610f95565b60fd546113c89030906001600160a01b031686610f95565b60fd546001600160a01b031663791ac94785600084306113e942600f612e49565b6040518663ffffffff1660e01b8152600401611409959493929190612ec0565b600060405180830381600087803b15801561142357600080fd5b505af1158015611437573d6000803e3d6000fd5b50505050600082476114499190612ead565b60fd549091506114649030906001600160a01b031686610f95565b60fd546001600160a01b031663f305d7198230876000806114836121c0565b61148e42600f612e49565b60405160e089901b6001600160e01b03191681526001600160a01b039687166004820152602481019590955260448501939093526064840191909152909216608482015260a481019190915260c40160606040518083038185885af11580156114fb573d6000803e3d6000fd5b50505050506040513d601f19601f820116820180604052508101906115209190612f31565b50505060006115376033546001600160a01b031690565b6001600160a01b03164760405160006040518083038185875af1925050503d8060008114611581576040519150601f19603f3d011682016040523d82523d6000602084013e611586565b606091505b505060408051888152602081018590529081018790529091507f17bbfb9a6069321b6ded73bd96327c9e6b7212a5cd51ff219cd61370acafb5619060600160405180910390a16115d66000610962565b61010e546115e49190612ead565b61014b555050610145805461ff0019169055505050505b6001600160a01b0384166000908152610108602052604090205460019060ff168061163f57506001600160a01b0384166000908152610108602052604090205460ff165b15611648575060005b6001600160a01b0385166000908152610107602052604090205460ff1615801561168c57506001600160a01b0384166000908152610107602052604090205460ff16155b15611695575060005b6001600160a01b03808616600090815261014660205260408082205492871682529020546116d191879187918791869160ff90811691166118f7565b5050505050565b610731611d08565b7f4910fdfa16fed3260ed0e7147f7cc6da11a60208b5b9406d12a635614ffd91435460ff161561171357610c4f8361221e565b826001600160a01b03166352d1902d6040518163ffffffff1660e01b8152600401602060405180830381865afa92505050801561176d575060408051601f3d908101601f1916820190925261176a91810190612f5f565b60015b6117d05760405162461bcd60e51b815260206004820152602e60248201527f45524331393637557067726164653a206e657720696d706c656d656e7461746960448201526d6f6e206973206e6f74205555505360901b6064820152608401610626565b600080516020612fee833981519152811461183f5760405162461bcd60e51b815260206004820152602960248201527f45524331393637557067726164653a20756e737570706f727465642070726f786044820152681a58589b195555525160ba1b6064820152608401610626565b50610c4f8383836122ba565b60fb546001600160a01b031633146107665760405162461bcd60e51b8152602060048201526015602482015274269d1021b0b63632b9103737ba1036b0b730b3b2b960591b6044820152606401610626565b6118a5611e2b565b60c9805460ff191660011790557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a2586118da3390565b6040516001600160a01b03909116815260200160405180910390a1565b600a8361190657506000611927565b61190f876122e5565b8061191e575061191e866122e5565b15611927575060055b60006119338683611e71565b9050831561196a576001600160a01b038816600090815261010a602052604081208054889290611964908490612ead565b90915550505b6020808201516001600160a01b038a1660009081526101489092526040822080549192909161199a908490612ead565b909155505082156119d65780516001600160a01b038816600090815261010a6020526040812080549091906119d0908490612e49565b90915550505b6040808201516001600160a01b0389166000908152610148602052918220805491929091611a05908490612e49565b909155505060608101518015611b1857806101496000828254611a289190612ead565b925050819055508061014c6000828254611a429190612e49565b9091555050608082015160e0830151611a5f9060009083906123dd565b60a083015161010084015160fe54611a81906001600160a01b031683836123dd565b60ff54611a98906001600160a01b031683836123dd565b61014354611ab0906001600160a01b031683836123dd565b611abb3083836123dd565b7f3211a46f177ad9fa6c08ccb99f0f58f3d27b33e542b80d53c11bf8e1337bf4ec8484611ae88480612e49565b60408051938452602084019290925290820152606081018390526080810183905260a00160405180910390a15050505b81516040519081526001600160a01b0389811691908b16907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9060200160405180910390a3505050505050505050565b6101495461010e5460009190825b61014454811015611ccb578261014860006101448481548110611b9b57611b9b612e7e565b60009182526020808320909101546001600160a01b031683528201929092526040019020541180611c0857508161010a60006101448481548110611be157611be1612e7e565b60009182526020808320909101546001600160a01b03168352820192909252604001902054115b15611c275761010e5461014954611c1f9190612e5c565b935050505090565b61014860006101448381548110611c4057611c40612e7e565b60009182526020808320909101546001600160a01b03168352820192909252604001902054611c6f9084612ead565b925061010a60006101448381548110611c8a57611c8a612e7e565b60009182526020808320909101546001600160a01b03168352820192909252604001902054611cb99083612ead565b9150611cc481612e94565b9050611b76565b5061010e5461014954611cde9190612e5c565b821015611cfe5761010e5461014954611cf79190612e5c565b9250505090565b611cf78183612e5c565b6033546001600160a01b031633146107665760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610626565b603380546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b611dbc612456565b60c9805460ff191690557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa336118da565b610834611e026033546001600160a01b031690565b6001600160a01b038416600090815261014660205260408120548591859160019060ff166118f7565b60c95460ff16156107665760405162461bcd60e51b815260206004820152601060248201526f14185d5cd8589b194e881c185d5cd95960821b6044820152606401610626565b611e796128c7565b6000611e83611b68565b9050611e8f8185612f78565b60208301526000839003611eb457838252611eaa8185612f78565b6040830152612038565b61014d54600a90849061271090611ed59067ffffffffffffffff1688612f78565b611edf9190612e5c565b611ee99190612f78565b611ef39190612e5c565b606083015261014d54600a90849061271090611f259068010000000000000000900467ffffffffffffffff1688612f78565b611f2f9190612e5c565b611f399190612f78565b611f439190612e5c565b608083015261014d54600a90849061271090611f7090600160801b900467ffffffffffffffff1688612f78565b611f7a9190612e5c565b611f849190612f78565b611f8e9190612e5c565b60a083015261014d54600a90849061271090611fbb90600160c01b900467ffffffffffffffff1688612f78565b611fc59190612e5c565b611fcf9190612f78565b611fd99190612e5c565b611fe39085612ead565b82526060820151611ff5908290612f78565b60c0830152608082015161200a908290612f78565b60e083015260a082015161201f908290612f78565b6101008301528151612032908290612f78565b60408301525b5092915050565b600061204a8361249f565b8061064e575061064e8261249f565b806001600160a01b03163b60000361206e5750565b60fd546001600160a01b03908116908216036120875750565b610100546001600160a01b03908116908216036120a15750565b6001600160a01b0381166000908152610107602052604090205460ff166107315760006120cd82612580565b90506001600160a01b0381166120e1575050565b60006120ec83612593565b90506001600160a01b03811661210157505050565b61210e8384600019610f95565b50506001600160a01b038116600090815261010760205260409020805460ff1916600117905550565b6001600160a01b0381166000908152610146602052604090205460ff16610731576001600160a01b0316600081815261014660205260408120805460ff19166001908117909155610144805491820181559091527fc4c2ef8194275e8aa8ec1118b6dc4bc43d1e218201f213c08c87ae45e7ea63d60180546001600160a01b0319169091179055565b60006121ce60016005612ead565b61010d5410156121f05761010d546121e7906001612e49565b61010d556121f7565b600061010d555b61010161010d546005811061220e5761220e612e7e565b01546001600160a01b0316919050565b6001600160a01b0381163b61228b5760405162461bcd60e51b815260206004820152602d60248201527f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60448201526c1bdd08184818dbdb9d1c9858dd609a1b6064820152608401610626565b600080516020612fee83398151915280546001600160a01b0319166001600160a01b0392909216919091179055565b6122c3836125a6565b6000825111806122d05750805b15610c4f576122df83836125e6565b50505050565b6001600160a01b0381166000908152610107602052604081205460ff16156123d5576001600160a01b0382166000908152610147602052604090205460ff161561233157506001919050565b600061233c83612580565b610141549091506001600160a01b03908116908216036123815750506001600160a01b0316600090815261014760205260409020805460ff1916600190811790915590565b600061238c84612593565b610141549091506001600160a01b03908116908216036123d2575050506001600160a01b0316600090815261014760205260409020805460ff1916600190811790915590565b50505b506000919050565b6001600160a01b0383166000908152610148602052604081208054839290612406908490612e49565b90915550506001600160a01b0383166000908152610146602052604090205460ff1615610c4f576001600160a01b038316600090815261010a602052604081208054849290610f8b908490612e49565b60c95460ff166107665760405162461bcd60e51b815260206004820152601460248201527314185d5cd8589b194e881b9bdd081c185d5cd95960621b6044820152606401610626565b60fd546000906001600160a01b03908116908316036124c057506000919050565b610100546001600160a01b03908116908316036124df57506000919050565b6001600160a01b0382166000908152610107602052604090205460ff161561250957506000919050565b600061251483612580565b90506001600160a01b03811661252d5750600092915050565b600061253884612593565b90506001600160a01b038116612552575060009392505050565b600061255d856126da565b905062ffffff81161561257557506001949350505050565b506000949350505050565b60006105bb82630dfe168160e01b6126ed565b60006105bb8263d21220a760e01b6126ed565b6125af8161221e565b6040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b60606001600160a01b0383163b61264e5760405162461bcd60e51b815260206004820152602660248201527f416464726573733a2064656c65676174652063616c6c20746f206e6f6e2d636f6044820152651b9d1c9858dd60d21b6064820152608401610626565b600080846001600160a01b0316846040516126699190612f8f565b600060405180830381855af49150503d80600081146126a4576040519150601f19603f3d011682016040523d82523d6000602084013e6126a9565b606091505b50915091506126d1828260405180606001604052806027815260200161300e602791396127bd565b95945050505050565b60006105bb8263ddca3f4360e01b6127d6565b60408051600481526024810182526020810180516001600160e01b03166001600160e01b031985161790529051600091829182916001600160a01b038716916127369190612f8f565b600060405180830381855afa9150503d8060008114612771576040519150601f19603f3d011682016040523d82523d6000602084013e612776565b606091505b509150915081158061278757508051155b15612797576000925050506105bb565b805160200361257557808060200190518101906127b49190612fab565b925050506105bb565b606083156127cc57508161064e565b61064e838361289d565b60408051600481526024810182526020810180516001600160e01b03166001600160e01b031985161790529051600091829182916001600160a01b0387169161281f9190612f8f565b600060405180830381855afa9150503d806000811461285a576040519150601f19603f3d011682016040523d82523d6000602084013e61285f565b606091505b509150915081158061287057508051155b15612880576000925050506105bb565b805160200361257557808060200190518101906127b49190612fc8565b8151156128ad5781518083602001fd5b8060405162461bcd60e51b8152600401610626919061290a565b6040518061012001604052806009906020820280368337509192915050565b60005b838110156129015781810151838201526020016128e9565b50506000910152565b60208152600082518060208401526129298160408501602087016128e6565b601f01601f19169190910160400192915050565b6001600160a01b038116811461073157600080fd5b803561295d8161293d565b919050565b6000806040838503121561297557600080fd5b82356129808161293d565b946020939093013593505050565b6000806000606084860312156129a357600080fd5b83356129ae8161293d565b925060208401356129be8161293d565b929592945050506040919091013590565b6000602082840312156129e157600080fd5b813561064e8161293d565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f1916810167ffffffffffffffff81118282101715612a2b57612a2b6129ec565b604052919050565b60008060408385031215612a4657600080fd5b8235612a518161293d565b915060208381013567ffffffffffffffff80821115612a6f57600080fd5b818601915086601f830112612a8357600080fd5b813581811115612a9557612a956129ec565b612aa7601f8201601f19168501612a02565b91508082528784828501011115612abd57600080fd5b80848401858401376000848284010152508093505050509250929050565b600060208284031215612aed57600080fd5b8135801515811461064e57600080fd5b60008060408385031215612b1057600080fd5b8235612b1b8161293d565b91506020830135612b2b8161293d565b809150509250929050565b60008060208385031215612b4957600080fd5b823567ffffffffffffffff80821115612b6157600080fd5b818501915085601f830112612b7557600080fd5b813581811115612b8457600080fd5b8660208260061b8501011115612b9957600080fd5b60209290920196919550909350505050565b60008083601f840112612bbd57600080fd5b50813567ffffffffffffffff811115612bd557600080fd5b602083019150836020828501011115612bed57600080fd5b9250929050565b600082601f830112612c0557600080fd5b60405160a0810181811067ffffffffffffffff82111715612c2857612c286129ec565b6040528060a0840185811115612c3d57600080fd5b845b81811015612c60578035612c528161293d565b835260209283019201612c3f565b509195945050505050565b6000806000806000806000806000806101808b8d031215612c8b57600080fd5b8a3560ff81168114612c9c57600080fd5b995060208b013567ffffffffffffffff80821115612cb957600080fd5b612cc58e838f01612bab565b909b50995060408d0135915080821115612cde57600080fd5b50612ceb8d828e01612bab565b9098509650612cfe905060608c01612952565b9450612d0c60808c01612952565b9350612d1a60a08c01612952565b9250612d2860c08c01612952565b9150612d378c60e08d01612bf4565b90509295989b9194979a5092959850565b600060208284031215612d5a57600080fd5b5035919050565b600181811c90821680612d7557607f821691505b602082108103612d9557634e487b7160e01b600052602260045260246000fd5b50919050565b6020808252602c908201527f46756e6374696f6e206d7573742062652063616c6c6564207468726f7567682060408201526b19195b1959d85d1958d85b1b60a21b606082015260800190565b6020808252602c908201527f46756e6374696f6e206d7573742062652063616c6c6564207468726f7567682060408201526b6163746976652070726f787960a01b606082015260800190565b634e487b7160e01b600052601160045260246000fd5b808201808211156105bb576105bb612e33565b600082612e7957634e487b7160e01b600052601260045260246000fd5b500490565b634e487b7160e01b600052603260045260246000fd5b600060018201612ea657612ea6612e33565b5060010190565b818103818111156105bb576105bb612e33565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015612f105784516001600160a01b031683529383019391830191600101612eeb565b50506001600160a01b03969096166060850152505050608001529392505050565b600080600060608486031215612f4657600080fd5b8351925060208401519150604084015190509250925092565b600060208284031215612f7157600080fd5b5051919050565b80820281158282048414176105bb576105bb612e33565b60008251612fa18184602087016128e6565b9190910192915050565b600060208284031215612fbd57600080fd5b815161064e8161293d565b600060208284031215612fda57600080fd5b815162ffffff8116811461064e57600080fdfe360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564a264697066735822122098d938522424926d4f48f75c3c893dad62284c13234ad3eb35a1a37a21c464ba64736f6c63430008130033
Deployed ByteCode
0x6080604052600436106101ae5760003560e01c806370a08231116100eb578063c49b9a801161008f578063e4edf85211610061578063e4edf85214610494578063e683d7b9146104b4578063f2fde38b146104d4578063f66897f8146104f457005b8063c49b9a801461041f578063d5f954241461043f578063dd62ed3e14610454578063e0c9ffc61461047457005b806395d89b41116100c857806395d89b41146103b5578063a457c2d7146103ca578063a9059cbb146103ea578063bac152031461040a57005b806370a0823114610362578063715018a6146103825780638da5cb5b1461039757005b8063439766ce1161015257806352d1902d1161012f57806352d1902d146103005780635c975abb14610315578063664f73311461032d5780636c74dd511461034257005b8063439766ce146102a6578063481c6a75146102bb5780634f1ef286146102ed57005b806323b872dd1161018b57806323b872dd14610232578063313ce567146102525780633659cfe614610266578063395093511461028657005b806306fdde03146101b7578063095ea7b3146101e257806318160ddd1461021257005b366101b557005b005b3480156101c357600080fd5b506101cc610514565b6040516101d9919061290a565b60405180910390f35b3480156101ee57600080fd5b506102026101fd366004612962565b6105a7565b60405190151581526020016101d9565b34801561021e57600080fd5b5061010e545b6040519081526020016101d9565b34801561023e57600080fd5b5061020261024d36600461298e565b6105c1565b34801561025e57600080fd5b506012610224565b34801561027257600080fd5b506101b56102813660046129cf565b610655565b34801561029257600080fd5b506102026102a1366004612962565b610734565b3480156102b257600080fd5b506101b5610756565b3480156102c757600080fd5b5060fb546001600160a01b03165b6040516001600160a01b0390911681526020016101d9565b6101b56102fb366004612a33565b610768565b34801561030c57600080fd5b50610224610838565b34801561032157600080fd5b5060c95460ff16610202565b34801561033957600080fd5b506101b56108eb565b34801561034e57600080fd5b5061020261035d36600461298e565b610903565b34801561036e57600080fd5b5061022461037d3660046129cf565b610962565b34801561038e57600080fd5b506101b5610a35565b3480156103a357600080fd5b506033546001600160a01b03166102d5565b3480156103c157600080fd5b506101cc610a47565b3480156103d657600080fd5b506102026103e5366004612962565b610a57565b3480156103f657600080fd5b50610202610405366004612962565b610acf565b34801561041657600080fd5b506101b5610add565b34801561042b57600080fd5b506101b561043a366004612adb565b610aed565b34801561044b57600080fd5b506101b5610b3d565b34801561046057600080fd5b5061022461046f366004612afd565b610b52565b34801561048057600080fd5b506101b561048f366004612b36565b610b7e565b3480156104a057600080fd5b506101b56104af3660046129cf565b610c54565b3480156104c057600080fd5b506101b56104cf366004612c6b565b610cb8565b3480156104e057600080fd5b506101b56104ef3660046129cf565b610d98565b34801561050057600080fd5b506101b561050f366004612d48565b610e0e565b606061010b805461052490612d61565b80601f016020809104026020016040519081016040528092919081815260200182805461055090612d61565b801561059d5780601f106105725761010080835404028352916020019161059d565b820191906000526020600020905b81548152906001019060200180831161058057829003601f168201915b5050505050905090565b6000336105b5818585610f95565b60019150505b92915050565b600033816105cf8683610b52565b9050600019811461063c578381101561062f5760405162461bcd60e51b815260206004820152601a60248201527f42423a20496e73756666696369656e7420616c6c6f77616e636500000000000060448201526064015b60405180910390fd5b61063c8683868403610f95565b610647868686611085565b6001925050505b9392505050565b6001600160a01b037f0000000000000000000000002d8a97a33f7f5ba204e0070f8bad44003fe2e44b16300361069d5760405162461bcd60e51b815260040161062690612d9b565b7f0000000000000000000000002d8a97a33f7f5ba204e0070f8bad44003fe2e44b6001600160a01b03166106e6600080516020612fee833981519152546001600160a01b031690565b6001600160a01b03161461070c5760405162461bcd60e51b815260040161062690612de7565b610715816116d8565b60408051600080825260208201909252610731918391906116e0565b50565b6000336105b58185856107478383610b52565b6107519190612e49565b610f95565b61075e61184b565b61076661189d565b565b6001600160a01b037f0000000000000000000000002d8a97a33f7f5ba204e0070f8bad44003fe2e44b1630036107b05760405162461bcd60e51b815260040161062690612d9b565b7f0000000000000000000000002d8a97a33f7f5ba204e0070f8bad44003fe2e44b6001600160a01b03166107f9600080516020612fee833981519152546001600160a01b031690565b6001600160a01b03161461081f5760405162461bcd60e51b815260040161062690612de7565b610828826116d8565b610834828260016116e0565b5050565b6000306001600160a01b037f0000000000000000000000002d8a97a33f7f5ba204e0070f8bad44003fe2e44b16146108d85760405162461bcd60e51b815260206004820152603860248201527f555550535570677261646561626c653a206d757374206e6f742062652063616c60448201527f6c6564207468726f7567682064656c656761746563616c6c00000000000000006064820152608401610626565b50600080516020612fee83398151915290565b6108f361184b565b610106805460ff19166001179055565b610141546000906001600160a01b0316331461091e57600080fd5b6001600160a01b03808516600090815261014660205260408082205492861682528120546109589287928792879260ff90811691166118f7565b5060019392505050565b6001600160a01b0381166000908152610146602052604081205460ff16156109a157506001600160a01b0316600090815261010a602052604090205490565b610149546001600160a01b038316600090815261014860205260409020541115610a035760405162461bcd60e51b8152602060048201526013602482015272423a20416d6f756e7420746f6f206c6172676560681b6044820152606401610626565b6000610a0d611b68565b6001600160a01b0384166000908152610148602052604090205490915061064e908290612e5c565b610a3d611d08565b6107666000611d62565b606061010c805461052490612d61565b60003381610a658286610b52565b905083811015610ab75760405162461bcd60e51b815260206004820152601760248201527f42534b523a204465637265617365732062656c6f7720300000000000000000006044820152606401610626565b610ac48286868403610f95565b506001949350505050565b6000336105b5818585611085565b610ae561184b565b610766611db4565b610af561184b565b610145805460ff19168215159081179091556040519081527f91c8e5d8409e58da1d940ede98e9b35e17b453932366ea0a790416ab922ca4129060200160405180910390a150565b610b4561184b565b610106805460ff19169055565b6001600160a01b0391821660009081526101096020908152604080832093909416825291909152205490565b610b86611d08565b60005b81811015610c4f576000838383818110610ba557610ba5612e7e565b610bbb92602060409092020190810191506129cf565b6001600160a01b031614158015610bee5750828282818110610bdf57610bdf612e7e565b90506040020160200135600014155b15610c3f57610c3f838383818110610c0857610c08612e7e565b610c1e92602060409092020190810191506129cf565b848484818110610c3057610c30612e7e565b90506040020160200135611ded565b610c4881612e94565b9050610b89565b505050565b610c5c61184b565b60fb546040516001600160a01b038084169216907f80f15e9dbc60884fdb59fb8ed4fc48a9a689e028f055e893ed45ca5be67c5c8590600090a360fb80546001600160a01b0319166001600160a01b0392909216919091179055565b6000548a90610100900460ff16158015610cd9575060005460ff8083169116105b610d3c5760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b6064820152608401610626565b6000805461ffff191660ff83169081176101001761ff0019169091556040519081527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15050505050505050505050565b610da0611d08565b6001600160a01b038116610e055760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610626565b61073181611d62565b610e16611e2b565b80600003610e5c5760405162461bcd60e51b8152602060048201526013602482015272108e8816995c9bc819da599d08185b5bdd5b9d606a1b6044820152606401610626565b336000818152610146602052604090205460ff1615610eb25760405162461bcd60e51b8152602060048201526012602482015271108e88115e18db1d591959081dd85b1b195d60721b6044820152606401610626565b6000610ebf83600a611e71565b6020808201516001600160a01b038516600090815261014890925260409091205491925010610f245760405162461bcd60e51b8152602060048201526011602482015270423a204769667420746f6f206c6172676560781b6044820152606401610626565b6020808201516001600160a01b038416600090815261014890925260408220805491929091610f54908490612ead565b909155505060208101516101498054600090610f71908490612ead565b925050819055508261014c6000828254610f8b9190612e49565b9091555050505050565b6001600160a01b038316610fdd5760405162461bcd60e51b815260206004820152600f60248201526e21211d10233937b690181030b2323960891b6044820152606401610626565b6001600160a01b0382166110235760405162461bcd60e51b815260206004820152600d60248201526c21211d102a3790181030b2323960991b6044820152606401610626565b6001600160a01b038381166000818152610109602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b61108d611e2b565b6001600160a01b0383166110d45760405162461bcd60e51b815260206004820152600e60248201526d211d10233937b690181030b2323960911b6044820152606401610626565b6001600160a01b0382166111195760405162461bcd60e51b815260206004820152600c60248201526b211d102a3790181030b2323960a11b6044820152606401610626565b806000036111575760405162461bcd60e51b815260206004820152600b60248201526a108e880c08185b5bdd5b9d60aa1b6044820152606401610626565b6033546001600160a01b0384811691161480159061118357506033546001600160a01b03838116911614155b156111cf5761014a548111156111cf5760405162461bcd60e51b815260206004820152601160248201527008474408af0c6cacac8e640dac2f040e8f607b1b6044820152606401610626565b6101065460ff16611231576111e4838361203f565b156112315760405162461bcd60e51b815260206004820152601760248201527f423a20556e695633206e6f7420737570706f72746564210000000000000000006044820152606401610626565b61123a83612059565b6001600160a01b0383166000908152610107602052604090205460ff16156112655761126583612137565b61126e82612059565b6001600160a01b0382166000908152610107602052604090205460ff16156112995761129982612137565b60006112a430610962565b905061014b5481101580156112c2575061014554610100900460ff16155b80156112dd5750610142546001600160a01b03858116911614155b80156112ec57506101455460ff165b156115fb57610145805461ff00191661010017905561014b54600181901c90600090611319908390612ead565b6040805160028082526060820183529293504792600092602083019080368337019050509050308160008151811061135357611353612e7e565b6001600160a01b0392831660209182029290920101526101005482519116908290600190811061138557611385612e7e565b60200260200101906001600160a01b031690816001600160a01b0316815250506113b0303086610f95565b60fd546113c89030906001600160a01b031686610f95565b60fd546001600160a01b031663791ac94785600084306113e942600f612e49565b6040518663ffffffff1660e01b8152600401611409959493929190612ec0565b600060405180830381600087803b15801561142357600080fd5b505af1158015611437573d6000803e3d6000fd5b50505050600082476114499190612ead565b60fd549091506114649030906001600160a01b031686610f95565b60fd546001600160a01b031663f305d7198230876000806114836121c0565b61148e42600f612e49565b60405160e089901b6001600160e01b03191681526001600160a01b039687166004820152602481019590955260448501939093526064840191909152909216608482015260a481019190915260c40160606040518083038185885af11580156114fb573d6000803e3d6000fd5b50505050506040513d601f19601f820116820180604052508101906115209190612f31565b50505060006115376033546001600160a01b031690565b6001600160a01b03164760405160006040518083038185875af1925050503d8060008114611581576040519150601f19603f3d011682016040523d82523d6000602084013e611586565b606091505b505060408051888152602081018590529081018790529091507f17bbfb9a6069321b6ded73bd96327c9e6b7212a5cd51ff219cd61370acafb5619060600160405180910390a16115d66000610962565b61010e546115e49190612ead565b61014b555050610145805461ff0019169055505050505b6001600160a01b0384166000908152610108602052604090205460019060ff168061163f57506001600160a01b0384166000908152610108602052604090205460ff165b15611648575060005b6001600160a01b0385166000908152610107602052604090205460ff1615801561168c57506001600160a01b0384166000908152610107602052604090205460ff16155b15611695575060005b6001600160a01b03808616600090815261014660205260408082205492871682529020546116d191879187918791869160ff90811691166118f7565b5050505050565b610731611d08565b7f4910fdfa16fed3260ed0e7147f7cc6da11a60208b5b9406d12a635614ffd91435460ff161561171357610c4f8361221e565b826001600160a01b03166352d1902d6040518163ffffffff1660e01b8152600401602060405180830381865afa92505050801561176d575060408051601f3d908101601f1916820190925261176a91810190612f5f565b60015b6117d05760405162461bcd60e51b815260206004820152602e60248201527f45524331393637557067726164653a206e657720696d706c656d656e7461746960448201526d6f6e206973206e6f74205555505360901b6064820152608401610626565b600080516020612fee833981519152811461183f5760405162461bcd60e51b815260206004820152602960248201527f45524331393637557067726164653a20756e737570706f727465642070726f786044820152681a58589b195555525160ba1b6064820152608401610626565b50610c4f8383836122ba565b60fb546001600160a01b031633146107665760405162461bcd60e51b8152602060048201526015602482015274269d1021b0b63632b9103737ba1036b0b730b3b2b960591b6044820152606401610626565b6118a5611e2b565b60c9805460ff191660011790557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a2586118da3390565b6040516001600160a01b03909116815260200160405180910390a1565b600a8361190657506000611927565b61190f876122e5565b8061191e575061191e866122e5565b15611927575060055b60006119338683611e71565b9050831561196a576001600160a01b038816600090815261010a602052604081208054889290611964908490612ead565b90915550505b6020808201516001600160a01b038a1660009081526101489092526040822080549192909161199a908490612ead565b909155505082156119d65780516001600160a01b038816600090815261010a6020526040812080549091906119d0908490612e49565b90915550505b6040808201516001600160a01b0389166000908152610148602052918220805491929091611a05908490612e49565b909155505060608101518015611b1857806101496000828254611a289190612ead565b925050819055508061014c6000828254611a429190612e49565b9091555050608082015160e0830151611a5f9060009083906123dd565b60a083015161010084015160fe54611a81906001600160a01b031683836123dd565b60ff54611a98906001600160a01b031683836123dd565b61014354611ab0906001600160a01b031683836123dd565b611abb3083836123dd565b7f3211a46f177ad9fa6c08ccb99f0f58f3d27b33e542b80d53c11bf8e1337bf4ec8484611ae88480612e49565b60408051938452602084019290925290820152606081018390526080810183905260a00160405180910390a15050505b81516040519081526001600160a01b0389811691908b16907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9060200160405180910390a3505050505050505050565b6101495461010e5460009190825b61014454811015611ccb578261014860006101448481548110611b9b57611b9b612e7e565b60009182526020808320909101546001600160a01b031683528201929092526040019020541180611c0857508161010a60006101448481548110611be157611be1612e7e565b60009182526020808320909101546001600160a01b03168352820192909252604001902054115b15611c275761010e5461014954611c1f9190612e5c565b935050505090565b61014860006101448381548110611c4057611c40612e7e565b60009182526020808320909101546001600160a01b03168352820192909252604001902054611c6f9084612ead565b925061010a60006101448381548110611c8a57611c8a612e7e565b60009182526020808320909101546001600160a01b03168352820192909252604001902054611cb99083612ead565b9150611cc481612e94565b9050611b76565b5061010e5461014954611cde9190612e5c565b821015611cfe5761010e5461014954611cf79190612e5c565b9250505090565b611cf78183612e5c565b6033546001600160a01b031633146107665760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610626565b603380546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b611dbc612456565b60c9805460ff191690557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa336118da565b610834611e026033546001600160a01b031690565b6001600160a01b038416600090815261014660205260408120548591859160019060ff166118f7565b60c95460ff16156107665760405162461bcd60e51b815260206004820152601060248201526f14185d5cd8589b194e881c185d5cd95960821b6044820152606401610626565b611e796128c7565b6000611e83611b68565b9050611e8f8185612f78565b60208301526000839003611eb457838252611eaa8185612f78565b6040830152612038565b61014d54600a90849061271090611ed59067ffffffffffffffff1688612f78565b611edf9190612e5c565b611ee99190612f78565b611ef39190612e5c565b606083015261014d54600a90849061271090611f259068010000000000000000900467ffffffffffffffff1688612f78565b611f2f9190612e5c565b611f399190612f78565b611f439190612e5c565b608083015261014d54600a90849061271090611f7090600160801b900467ffffffffffffffff1688612f78565b611f7a9190612e5c565b611f849190612f78565b611f8e9190612e5c565b60a083015261014d54600a90849061271090611fbb90600160c01b900467ffffffffffffffff1688612f78565b611fc59190612e5c565b611fcf9190612f78565b611fd99190612e5c565b611fe39085612ead565b82526060820151611ff5908290612f78565b60c0830152608082015161200a908290612f78565b60e083015260a082015161201f908290612f78565b6101008301528151612032908290612f78565b60408301525b5092915050565b600061204a8361249f565b8061064e575061064e8261249f565b806001600160a01b03163b60000361206e5750565b60fd546001600160a01b03908116908216036120875750565b610100546001600160a01b03908116908216036120a15750565b6001600160a01b0381166000908152610107602052604090205460ff166107315760006120cd82612580565b90506001600160a01b0381166120e1575050565b60006120ec83612593565b90506001600160a01b03811661210157505050565b61210e8384600019610f95565b50506001600160a01b038116600090815261010760205260409020805460ff1916600117905550565b6001600160a01b0381166000908152610146602052604090205460ff16610731576001600160a01b0316600081815261014660205260408120805460ff19166001908117909155610144805491820181559091527fc4c2ef8194275e8aa8ec1118b6dc4bc43d1e218201f213c08c87ae45e7ea63d60180546001600160a01b0319169091179055565b60006121ce60016005612ead565b61010d5410156121f05761010d546121e7906001612e49565b61010d556121f7565b600061010d555b61010161010d546005811061220e5761220e612e7e565b01546001600160a01b0316919050565b6001600160a01b0381163b61228b5760405162461bcd60e51b815260206004820152602d60248201527f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60448201526c1bdd08184818dbdb9d1c9858dd609a1b6064820152608401610626565b600080516020612fee83398151915280546001600160a01b0319166001600160a01b0392909216919091179055565b6122c3836125a6565b6000825111806122d05750805b15610c4f576122df83836125e6565b50505050565b6001600160a01b0381166000908152610107602052604081205460ff16156123d5576001600160a01b0382166000908152610147602052604090205460ff161561233157506001919050565b600061233c83612580565b610141549091506001600160a01b03908116908216036123815750506001600160a01b0316600090815261014760205260409020805460ff1916600190811790915590565b600061238c84612593565b610141549091506001600160a01b03908116908216036123d2575050506001600160a01b0316600090815261014760205260409020805460ff1916600190811790915590565b50505b506000919050565b6001600160a01b0383166000908152610148602052604081208054839290612406908490612e49565b90915550506001600160a01b0383166000908152610146602052604090205460ff1615610c4f576001600160a01b038316600090815261010a602052604081208054849290610f8b908490612e49565b60c95460ff166107665760405162461bcd60e51b815260206004820152601460248201527314185d5cd8589b194e881b9bdd081c185d5cd95960621b6044820152606401610626565b60fd546000906001600160a01b03908116908316036124c057506000919050565b610100546001600160a01b03908116908316036124df57506000919050565b6001600160a01b0382166000908152610107602052604090205460ff161561250957506000919050565b600061251483612580565b90506001600160a01b03811661252d5750600092915050565b600061253884612593565b90506001600160a01b038116612552575060009392505050565b600061255d856126da565b905062ffffff81161561257557506001949350505050565b506000949350505050565b60006105bb82630dfe168160e01b6126ed565b60006105bb8263d21220a760e01b6126ed565b6125af8161221e565b6040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b60606001600160a01b0383163b61264e5760405162461bcd60e51b815260206004820152602660248201527f416464726573733a2064656c65676174652063616c6c20746f206e6f6e2d636f6044820152651b9d1c9858dd60d21b6064820152608401610626565b600080846001600160a01b0316846040516126699190612f8f565b600060405180830381855af49150503d80600081146126a4576040519150601f19603f3d011682016040523d82523d6000602084013e6126a9565b606091505b50915091506126d1828260405180606001604052806027815260200161300e602791396127bd565b95945050505050565b60006105bb8263ddca3f4360e01b6127d6565b60408051600481526024810182526020810180516001600160e01b03166001600160e01b031985161790529051600091829182916001600160a01b038716916127369190612f8f565b600060405180830381855afa9150503d8060008114612771576040519150601f19603f3d011682016040523d82523d6000602084013e612776565b606091505b509150915081158061278757508051155b15612797576000925050506105bb565b805160200361257557808060200190518101906127b49190612fab565b925050506105bb565b606083156127cc57508161064e565b61064e838361289d565b60408051600481526024810182526020810180516001600160e01b03166001600160e01b031985161790529051600091829182916001600160a01b0387169161281f9190612f8f565b600060405180830381855afa9150503d806000811461285a576040519150601f19603f3d011682016040523d82523d6000602084013e61285f565b606091505b509150915081158061287057508051155b15612880576000925050506105bb565b805160200361257557808060200190518101906127b49190612fc8565b8151156128ad5781518083602001fd5b8060405162461bcd60e51b8152600401610626919061290a565b6040518061012001604052806009906020820280368337509192915050565b60005b838110156129015781810151838201526020016128e9565b50506000910152565b60208152600082518060208401526129298160408501602087016128e6565b601f01601f19169190910160400192915050565b6001600160a01b038116811461073157600080fd5b803561295d8161293d565b919050565b6000806040838503121561297557600080fd5b82356129808161293d565b946020939093013593505050565b6000806000606084860312156129a357600080fd5b83356129ae8161293d565b925060208401356129be8161293d565b929592945050506040919091013590565b6000602082840312156129e157600080fd5b813561064e8161293d565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f1916810167ffffffffffffffff81118282101715612a2b57612a2b6129ec565b604052919050565b60008060408385031215612a4657600080fd5b8235612a518161293d565b915060208381013567ffffffffffffffff80821115612a6f57600080fd5b818601915086601f830112612a8357600080fd5b813581811115612a9557612a956129ec565b612aa7601f8201601f19168501612a02565b91508082528784828501011115612abd57600080fd5b80848401858401376000848284010152508093505050509250929050565b600060208284031215612aed57600080fd5b8135801515811461064e57600080fd5b60008060408385031215612b1057600080fd5b8235612b1b8161293d565b91506020830135612b2b8161293d565b809150509250929050565b60008060208385031215612b4957600080fd5b823567ffffffffffffffff80821115612b6157600080fd5b818501915085601f830112612b7557600080fd5b813581811115612b8457600080fd5b8660208260061b8501011115612b9957600080fd5b60209290920196919550909350505050565b60008083601f840112612bbd57600080fd5b50813567ffffffffffffffff811115612bd557600080fd5b602083019150836020828501011115612bed57600080fd5b9250929050565b600082601f830112612c0557600080fd5b60405160a0810181811067ffffffffffffffff82111715612c2857612c286129ec565b6040528060a0840185811115612c3d57600080fd5b845b81811015612c60578035612c528161293d565b835260209283019201612c3f565b509195945050505050565b6000806000806000806000806000806101808b8d031215612c8b57600080fd5b8a3560ff81168114612c9c57600080fd5b995060208b013567ffffffffffffffff80821115612cb957600080fd5b612cc58e838f01612bab565b909b50995060408d0135915080821115612cde57600080fd5b50612ceb8d828e01612bab565b9098509650612cfe905060608c01612952565b9450612d0c60808c01612952565b9350612d1a60a08c01612952565b9250612d2860c08c01612952565b9150612d378c60e08d01612bf4565b90509295989b9194979a5092959850565b600060208284031215612d5a57600080fd5b5035919050565b600181811c90821680612d7557607f821691505b602082108103612d9557634e487b7160e01b600052602260045260246000fd5b50919050565b6020808252602c908201527f46756e6374696f6e206d7573742062652063616c6c6564207468726f7567682060408201526b19195b1959d85d1958d85b1b60a21b606082015260800190565b6020808252602c908201527f46756e6374696f6e206d7573742062652063616c6c6564207468726f7567682060408201526b6163746976652070726f787960a01b606082015260800190565b634e487b7160e01b600052601160045260246000fd5b808201808211156105bb576105bb612e33565b600082612e7957634e487b7160e01b600052601260045260246000fd5b500490565b634e487b7160e01b600052603260045260246000fd5b600060018201612ea657612ea6612e33565b5060010190565b818103818111156105bb576105bb612e33565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015612f105784516001600160a01b031683529383019391830191600101612eeb565b50506001600160a01b03969096166060850152505050608001529392505050565b600080600060608486031215612f4657600080fd5b8351925060208401519150604084015190509250925092565b600060208284031215612f7157600080fd5b5051919050565b80820281158282048414176105bb576105bb612e33565b60008251612fa18184602087016128e6565b9190910192915050565b600060208284031215612fbd57600080fd5b815161064e8161293d565b600060208284031215612fda57600080fd5b815162ffffff8116811461064e57600080fdfe360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564a264697066735822122098d938522424926d4f48f75c3c893dad62284c13234ad3eb35a1a37a21c464ba64736f6c63430008130033