Warning! Contract bytecode has been changed and doesn't match the verified one. Therefore, interaction with this smart contract may be risky.
- Contract name:
- LBSKR
- Optimization enabled
- true
- Compiler version
- v0.8.19+commit.7dd6d404
- Optimization runs
- 200
- Verified at
- 2023-04-22T12:58:07.262532Z
contracts/LBSKR.sol
/**
* @title LBSKR - (Lite BSKR) Brings of 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
*
* LBSKR is our attempt to develop a better internet currency with negligible fees
* It's deflationary, burns fees and provides reduced fee to acquire BSKR
* It has a staking feature to earn bonus while you hold (manual stake)
*
* - LBSKR audit
* <TODO Audit report link to be added here>
*
*
* ( ( ( ( ( (( ( . ( ( (( ( ((
* )\ )\ )\ )\ )\ (\())\ . )\ )\ ))\)\ ))\
* ((_)((_)(_)(_) ((_))(_)(_) ((_)((_)(((_)_()((_)))
* | _ \ | | | | / __| __| | / _ \| _ \_ _| \ \| |
* | _/ |_| | |__\__ \ _|| |__| (_) | /| || - | . |
* |_| \___/|____|___/___|____|\___/|_|_\___|_|_|_|\_|
*
* Tokenomics:
*
* Burn 0.1% 50%
* Growth 0.1% 50%
*/
/*
* SPDX-License-Identifier: MIT
*/
pragma solidity ^0.8.19;
import "./imports/BaseBSKR.sol";
import "./imports/IBSKR.sol";
import "./imports/Stakable.sol";
import "./lib/DSMath.sol";
import "./oz_upgradable/security/ReentrancyGuardUpgradeable.sol";
contract LBSKR is BaseBSKR, DSMath, Stakable, ReentrancyGuardUpgradeable {
enum Field {
tTransferAmount,
tBurnFee,
tGrowthFee
}
IBSKR private _BSKR;
address private _inflationAddress;
bool private _initialRatioFlag;
uint256 private _burnFee; // 0.1% burn fee 4 bits
uint256 private _growthFee; // 0.05% * 2 growth fee 4 bits
uint256 private _lastDistTS; // 34 bits
uint256 private constant _INF_RATE_HRLY =
999_992_000_000_000_000_000_000_000; // ray (10E27 precision) value for 0.999992 (1 - 0.0008%) 90 bits
uint256 private constant _SECS_IN_AN_HOUR = 3600; // 12 bits
event FeeTransfers(uint256 Burnt, uint256 Growth);
/**
* @notice Initializes LBSKR contract with first implementation version
* @param nameA Token name
* @param symbolA Token symbol
* @param growth1AddressA Growth address 1
* @param growth2AddressA Growth address 2
* @param inflationAddressA Inflation vault address
* @param sisterOAsA Sister OA addresses
*/
function __LBSKR_init(
string calldata nameA,
string calldata symbolA,
address growth1AddressA,
address growth2AddressA,
address inflationAddressA,
address[5] memory sisterOAsA
) external initializer {
__Ownable_init_unchained();
__Pausable_init_unchained();
__Manageable_init_unchained();
__BaseBSKR_init_unchained(
nameA,
symbolA,
growth1AddressA,
growth2AddressA,
sisterOAsA
);
__Stakable_init_unchained();
__ReentrancyGuard_init_unchained();
__LBSKR_init_unchained(inflationAddressA);
}
function __LBSKR_init_unchained(
address inflationAddressA
) internal onlyInitializing {
_burnFee = 10; // 0.1% burn fee
_growthFee = 5; // 0.05% * 2 growth fee
_inflationAddress = inflationAddressA;
uint256 halfSupply = _totalSupply >> 1; // divide by 2
_balances[_msgSender()] = halfSupply;
_balances[_inflationAddress] = halfSupply;
address _ammLBSKRPair = _dexFactoryV2.createPair(
address(this),
wethAddr
);
_approve(_ammLBSKRPair, _ammLBSKRPair, type(uint256).max);
_isAMMPair[_ammLBSKRPair] = true;
for (uint256 index = 0; index < _sisterOAs.length; ++index) {
_paysNoFee[_sisterOAs[index]] = true;
}
emit Transfer(address(0), _msgSender(), halfSupply);
emit Transfer(address(0), _inflationAddress, halfSupply);
}
function _airdropTokens(address to, uint256 amount) internal override {
_transferTokens(owner(), to, amount, false);
}
function _calcInflation(
uint256 nowTS
) private view returns (uint256 inflation) {
require(_lastDistTS != 0, "L: Inflation not started!");
// Always count seconds at beginning of the hour
uint256 hoursElapsed = uint256(
(nowTS - _lastDistTS) / _SECS_IN_AN_HOUR
);
uint256 currBal = _balances[_inflationAddress];
// inflation = 0;
if (hoursElapsed != 0) {
uint256 infFracRay = rpow(_INF_RATE_HRLY, hoursElapsed);
inflation = currBal - (currBal * infFracRay) / RAY;
}
return inflation;
}
function _creditInflation() private {
// Always count seconds at beginning of the hour
uint256 nowTS = block.timestamp - (block.timestamp % _SECS_IN_AN_HOUR);
if (nowTS > _lastDistTS) {
uint256 inflation = _calcInflation(nowTS);
if (inflation != 0) {
_lastDistTS = nowTS;
_balances[_inflationAddress] -= inflation;
_balances[address(this)] += inflation;
}
}
}
function _swapTokensForTokens(
address owner,
uint256 tokenAmount
) private returns (uint256 bskrAmount) {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = address(_BSKR);
// _approve(owner, owner, tokenAmount); // allow owner to spend his/her tokens TODO - can we do away with this statement
_approve(owner, address(_dexRouterV2), tokenAmount); // allow router to spend owner's tokens
uint256 balInfAddrBefore = _BSKR.balanceOf(_inflationAddress);
// uint256[] memory amounts = _dexRouterV2.getAmountsOut(tokenAmount, path);
// make the swap
_dexRouterV2.swapExactTokensForTokensSupportingFeeOnTransferTokens(
tokenAmount,
0, // accept any amount of ETH // TODO - tighten this
path,
_inflationAddress,
block.timestamp + 15
);
// There is no good way to discount the Rfi received as part of this swap
// It will be small fraction and proportional to amount staked, so can be ignored
return _BSKR.balanceOf(_inflationAddress) - balInfAddrBefore;
}
function _transfer(
address from,
address to,
uint256 amount
) internal override {
require(from != address(0), "L: From 0 addr");
require(to != address(0), "L: To 0 addr");
require(amount != 0, "L: 0 amount");
if (!isV3Enabled) {
require(!v3PairInvolved(from, to), "L: UniswapV3 not supported!");
}
_checkIfAMMPair(from);
_checkIfAMMPair(to);
//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 fee
_transferTokens(from, to, amount, takeFee);
}
function _transferTokens(
address sender,
address recipient,
uint256 tAmount,
bool takeFee
) private whenNotPaused {
uint256[3] memory response;
if (!takeFee) {
response[uint256(Field.tTransferAmount)] = tAmount;
} else {
response[uint256(Field.tBurnFee)] = (tAmount * _burnFee) / _BIPS;
response[uint256(Field.tGrowthFee)] =
(tAmount * _growthFee) /
_BIPS;
response[uint256(Field.tTransferAmount)] =
tAmount -
response[uint256(Field.tBurnFee)] -
(2 * response[uint256(Field.tGrowthFee)]);
}
_balances[sender] -= tAmount;
_balances[recipient] += response[uint256(Field.tTransferAmount)];
if (response[uint256(Field.tBurnFee)] != 0) {
_balances[address(0)] += response[uint256(Field.tBurnFee)];
// emit Transfer(
// sender,
// address(0),
// response[uint256(Field.tBurnFee)]
// );
// }
// if (response[uint256(Field.tGrowthFee)] != 0) {
_balances[_growth1Address] += response[uint256(Field.tGrowthFee)];
// emit Transfer(
// sender,
// _growth1Address,
// response[uint256(Field.tGrowthFee)]
// );
_balances[_growth2Address] += response[uint256(Field.tGrowthFee)];
// emit Transfer(
// sender,
// _growth2Address,
// response[uint256(Field.tGrowthFee)]
// );
emit FeeTransfers(
response[uint256(Field.tBurnFee)],
response[uint256(Field.tBurnFee)]
);
}
emit Transfer(
sender,
recipient,
response[uint256(Field.tTransferAmount)]
);
}
function _unstakeInternal(
uint256 unstakeAmount,
uint256 bskrAmount2Deduct,
uint256 lbskrShares2Deduct,
uint256 bskrShares2Deduct,
uint256 stakeSince
) internal {
uint256 eligibleBasis = _BIPS -
_penaltyFor(stakeSince, block.timestamp);
uint256 lbskrToSend;
if (balanceOf(address(this)) != 0) {
// stakeAmount never existed - it's notional
uint256 lbskrBal = (((balanceOf(address(this)) + totalLBSKRStakes) *
lbskrShares2Deduct) / totalLBSKRShares);
if (lbskrBal > unstakeAmount) {
lbskrToSend =
((lbskrBal - unstakeAmount) * eligibleBasis) /
_BIPS;
if (lbskrToSend != 0) {
_balances[address(this)] -= lbskrToSend;
_balances[_msgSender()] += lbskrToSend;
emit Transfer(address(this), _msgSender(), lbskrToSend);
}
if (eligibleBasis < _BIPS) {
uint256 lbskrToBurn = ((lbskrBal - unstakeAmount) *
(_BIPS - eligibleBasis)) / _BIPS;
if (lbskrToBurn != 0) {
_balances[address(this)] -= lbskrToBurn;
_balances[address(0)] += lbskrToBurn;
emit Transfer(address(this), address(0), lbskrToBurn);
}
}
}
}
uint256 bskrToSend = 0;
if (_BSKR.balanceOf(_inflationAddress) != 0) {
bskrToSend = (bskrAmount2Deduct * eligibleBasis) / _BIPS;
if (bskrToSend != 0) {
require(
_BSKR.stakeTransfer(
_inflationAddress,
_msgSender(),
bskrToSend
),
"L: BSKR transfer failed"
);
}
if (eligibleBasis < _BIPS) {
uint256 bskrToBurn = (bskrAmount2Deduct *
(_BIPS - eligibleBasis)) / _BIPS;
if (bskrToBurn != 0) {
require(
_BSKR.stakeTransfer(
_inflationAddress,
address(0),
bskrToBurn
),
"L: BSKR burn failed"
);
}
}
}
totalLBSKRStakes -= unstakeAmount;
totalBSKRStakes -= bskrAmount2Deduct;
totalLBSKRShares -= lbskrShares2Deduct;
totalBSKRShares -= bskrShares2Deduct;
emit Unstaked(
_msgSender(),
unstakeAmount,
bskrAmount2Deduct,
lbskrShares2Deduct,
bskrShares2Deduct,
stakeSince,
block.timestamp
);
}
/**
* @notice Get the token balance
* @param wallet user address
* @return uint256 user's token balance
*/
function balanceOf(address wallet) public view override returns (uint256) {
return _balances[wallet];
}
/**
* @notice Returns the registered BSKR contract address
* @return address Registered BSKR address
*/
function getBSKRAddress() external view returns (address) {
return address(_BSKR);
}
/**
* @notice Calculates penalty amount for given stake if unstaked now
* @param wallet User address
* @param stakeIndex Index of stake array
* @return penaltyBasis Basis point of applicable penalty
*/
function penaltyIfUnstakedNow(
address wallet,
uint256 stakeIndex
) external view returns (uint256 penaltyBasis) {
uint256 stakerIndex = _stakeIndexMap[wallet];
Stake memory currStake = _getCurrStake(stakerIndex, stakeIndex);
return _penaltyFor(currStake.since, block.timestamp);
}
/**
* @notice Calculates rewards for a stakeholder
* @param stakeholder User address
* @param stakeIndex Index of stake array
* @return lbskrRewards LBSKR rewards
* @return bskrRewards BSKR rewards
* @return eligibleBasis Basis points after penalty
*/
function rewardsOf(
address stakeholder,
uint256 stakeIndex
)
external
view
returns (
uint256 lbskrRewards,
uint256 bskrRewards,
uint256 eligibleBasis
)
{
uint256 inflation;
if (_lastDistTS != 0) {
inflation = _calcInflation(block.timestamp);
}
uint256 stakerIndex = _stakeIndexMap[stakeholder];
Stake memory currStake = _getCurrStake(stakerIndex, stakeIndex);
eligibleBasis = _BIPS - _penaltyFor(currStake.since, block.timestamp);
if ((balanceOf(address(this)) + inflation) != 0) {
uint256 lbskrBal = (((balanceOf(address(this)) +
inflation +
totalLBSKRStakes) * currStake.sharesLBSKR) / totalLBSKRShares); // LBSKR notional balance
if (lbskrBal > currStake.amountLBSKR) {
lbskrRewards =
((lbskrBal - currStake.amountLBSKR) * eligibleBasis) /
_BIPS;
}
}
if (_BSKR.balanceOf(_inflationAddress) != 0) {
uint256 bskrBal = ((_BSKR.balanceOf(_inflationAddress) *
currStake.sharesBSKR) / totalBSKRShares);
if (bskrBal > currStake.amountBSKR) {
bskrRewards =
((bskrBal - currStake.amountBSKR) * eligibleBasis) /
_BIPS;
}
}
return (lbskrRewards, bskrRewards, eligibleBasis);
}
// /**
// * @notice Set's the initial shares to stakes ratio and initializes
// * wallet (owner) needs LBSKR allowance for itself (spender)
// * Also, sets the BSKR contract address
// * @param newBSKRAddr BSKR contract address
// */
// // 541080 (comments show gas without the statement in the comments)
// function setInitialRatioNew(address newBSKRAddr) external onlyOwner {
// require(!_initialRatioFlag, "L: Initial ratio set"); // (541080 - 540937)
// require(
// totalLBSKRShares == 0 && balanceOf(address(this)) == 0,
// "L: Non-zero balance"
// ); // (541080 - 540719)
// _BSKR = IBSKR(newBSKRAddr); // (57527 - 35360)
// address _ammBSKRPair = _dexFactoryV2.getPair(
// address(this),
// newBSKRAddr
// ); // (65151 - 57527)
// if (_ammBSKRPair == address(0)) {
// _ammBSKRPair = _dexFactoryV2.createPair(address(this), newBSKRAddr);
// } // (65189 - 65151)
// if (_ammBSKRPair != address(0)) {
// _approve(_ammBSKRPair, _ammBSKRPair, type(uint256).max);
// _isAMMPair[_ammBSKRPair] = true;
// } // (71834 - 65189)
// uint256 amountLBSKR = 1000000000000000000; // (71834 - 71834)
// _balances[_msgSender()] -= amountLBSKR; // (77014 - 71834)
// _balances[address(this)] += amountLBSKR; // (97285 - 77014)
// _BSKR.stakeTransfer(_msgSender(), _inflationAddress, amountLBSKR); // (242871 - 97285)
// // _stake(amountLBSKR, amountLBSKR, amountLBSKR, amountLBSKR); // (515913 - 242871) For the first stake, the number of shares is the same as the amount
// // Simple check so that user does not stake 0
// require(amountLBSKR != 0, "S: Cannot stake nothing"); // (541141 - 541118)
// // Mappings in solidity creates all values, but empty, so we can just check the address
// uint256 stakerIndex = _stakeIndexMap[_msgSender()];
// uint256 since = block.timestamp;
// // See if the staker already has a staked index or if its the first time
// if (stakerIndex == 0) {
// // This stakeholder stakes for the first time
// // We need to add him to the stakeholders and also map it into the Index of the stakes
// // The index returned will be the index of the stakeholder in the stakeholders array
// stakerIndex = _addStakeholder(_msgSender()); // (541141 - 495510)
// }
// // Use the index to push a new Stake
// // push a newly created Stake with the current block timestamp.
// stakeholders[stakerIndex].userStakes.push(
// Stake(amountLBSKR, amountLBSKR, amountLBSKR, amountLBSKR, since)
// );
// totalLBSKRStakes += amountLBSKR;
// totalBSKRStakes += amountLBSKR;
// totalLBSKRShares += amountLBSKR;
// totalBSKRShares += amountLBSKR;
// // Emit an event that the stake has occured
// emit Staked(
// _msgSender(),
// amountLBSKR,
// amountLBSKR,
// amountLBSKR,
// amountLBSKR,
// stakeholders[stakerIndex].userStakes.length - 1,
// since
// );
// _initialRatioFlag = true; // (518949 - 515913)
// _lastDistTS = block.timestamp - (block.timestamp % _SECS_IN_AN_HOUR); // ( 541080 - 518949)
// }
/**
* @notice Set's the initial shares to stakes ratio and initializes
* wallet (owner) needs LBSKR allowance for itself (spender)
* Also, sets the BSKR contract address
* @param newBSKRAddr BSKR contract address
*/
function setInitialRatio(address newBSKRAddr) external onlyOwner {
require(!_initialRatioFlag, "L: Initial ratio set");
require(
totalLBSKRShares == 0 && balanceOf(address(this)) == 0,
"L: Non-zero balance"
);
_BSKR = IBSKR(newBSKRAddr);
address _ammBSKRPair = _dexFactoryV2.getPair(
address(this),
newBSKRAddr
);
if (_ammBSKRPair == address(0)) {
_ammBSKRPair = _dexFactoryV2.createPair(address(this), newBSKRAddr);
}
if (_ammBSKRPair != address(0)) {
_approve(_ammBSKRPair, _ammBSKRPair, type(uint256).max);
_isAMMPair[_ammBSKRPair] = true;
}
uint256 amountLBSKR = 1000000000000000000;
_balances[_msgSender()] -= amountLBSKR;
_balances[address(this)] += amountLBSKR;
_BSKR.stakeTransfer(_msgSender(), _inflationAddress, amountLBSKR);
_stake(amountLBSKR, amountLBSKR, amountLBSKR, amountLBSKR); // For the first stake, the number of shares is the same as the amount
_initialRatioFlag = true;
_lastDistTS = block.timestamp - (block.timestamp % _SECS_IN_AN_HOUR);
}
// /**
// * @notice Create a new stake
// * wallet (owner) needs LBSKR allowance for itself (spender)
// * also maybe LBSKR (spender) needs LSBKR allowance for wallet (owner)
// * @param amountLBSKR Amount of LBSKR to stake
// */
// function stakeNew(uint256 amountLBSKR) external whenNotPaused nonReentrant {
// require(amountLBSKR != 0, "L: Cannot stake nothing");
// require(_balances[_msgSender()] >= amountLBSKR, "L: Too much staking");
// // _creditInflation();
// // // NAV value -> (totalLBSKRStakes + balanceOf(address(this))) / totalLBSKRShares
// // // Divide the amountLBSKR by NAV
// // uint256 sharesLBSKR = (amountLBSKR * totalLBSKRShares) /
// // (totalLBSKRStakes + balanceOf(address(this)));
// // _balances[_msgSender()] -= amountLBSKR;
// // _balances[address(this)] += amountLBSKR;
// // uint256 bskrBalBeforeSwap = _BSKR.balanceOf(_inflationAddress);
// // uint256 amountBSKR = _swapTokensForTokens(address(this), amountLBSKR);
// // uint256 sharesBSKR = (amountBSKR * totalBSKRShares) / bskrBalBeforeSwap;
// // _stake(amountLBSKR, amountBSKR, sharesLBSKR, sharesBSKR);
// }
/**
* @notice Create a new stake
* wallet (owner) needs LBSKR allowance for itself (spender)
* also maybe LBSKR (spender) needs LSBKR allowance for wallet (owner)
* @param amountLBSKR Amount of LBSKR to stake
*/
function stake(uint256 amountLBSKR) external whenNotPaused nonReentrant {
require(amountLBSKR != 0, "L: Cannot stake nothing");
require(_balances[_msgSender()] >= amountLBSKR, "L: Too much staking");
_creditInflation();
// NAV value -> (totalLBSKRStakes + balanceOf(address(this))) / totalLBSKRShares
// Divide the amountLBSKR by NAV
uint256 sharesLBSKR = (amountLBSKR * totalLBSKRShares) /
(totalLBSKRStakes + balanceOf(address(this)));
_balances[_msgSender()] -= amountLBSKR;
_balances[address(this)] += amountLBSKR;
uint256 bskrBalBeforeSwap = _BSKR.balanceOf(_inflationAddress);
uint256 amountBSKR = _swapTokensForTokens(address(this), amountLBSKR);
uint256 sharesBSKR = (amountBSKR * totalBSKRShares) / bskrBalBeforeSwap;
_stake(amountLBSKR, amountBSKR, sharesLBSKR, sharesBSKR);
}
/**
* @notice Removes an existing stake (unstake)
* @param unstakeAmount Amount to unstake
* @param stakeIndex Index of stake array
*/
function unstake(
uint256 unstakeAmount,
uint256 stakeIndex
) external nonReentrant whenNotPaused {
_creditInflation();
(
Stake memory currStake,
uint256 lbskrShares2Deduct,
uint256 bskrShares2Deduct,
uint256 bskrAmount2Deduct
) = _withdrawStake(stakeIndex, unstakeAmount);
_unstakeInternal(
unstakeAmount,
bskrAmount2Deduct,
lbskrShares2Deduct,
bskrShares2Deduct,
currStake.since
);
}
/**
* @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.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";
// PLS
// Wrapped PLS: 0x8a810ea8B121d08342E9e7696f4a9915cBE494B7
// PulseXRouter03: 0xb4A7633D8932de086c9264D5eb39a8399d7C0E3A
// PulseXFactory02: 0xb242aA8A863CfcE9fcBa2b9a6B00b4cd62343f27
// MasterChef: 0xB635be96898552bBe80043239c57ea864223fdC1
abstract contract BaseBSKR 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_init(
string calldata nameA,
string calldata symbolA,
address growth1AddressA,
address growth2AddressA,
address[5] memory sisterOAsA
) internal onlyInitializing {
__Ownable_init_unchained();
__Pausable_init_unchained();
__Manageable_init_unchained();
__BaseBSKR_init_unchained(
nameA,
symbolA,
growth1AddressA,
growth2AddressA,
sisterOAsA
);
}
function __BaseBSKR_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) {
// PLS Testnet V2B
_totalSupply = 1_000_000_000_000_000_000_000_000_000_000;
_dexRouterV2 = IUniswapV2Router02(
0xb4A7633D8932de086c9264D5eb39a8399d7C0E3A
);
} else if (block.chainid == 942) {
// PLS Testnet V2B
_totalSupply = 1_000_000_000_000_000_000_000_000_000_000;
_dexRouterV2 = IUniswapV2Router02(
0xDaE9dd3d1A52CfCe9d5F2fAC7fDe164D500E50f7
);
} 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 * 1_00_000_000_000_000_000);
}
}
}
/**
* @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/IBSKR.sol
/*
* SPDX-License-Identifier: MIT
*/
pragma solidity ^0.8.19;
/**
* @notice Interface of BSKR.
*/
interface IBSKR {
function balanceOf(address wallet) external view returns (uint256);
function stakeTransfer(
address from,
address to,
uint256 amount
) external returns (bool);
function transfer(address to, uint256 amount) external returns (bool);
}
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/imports/Stakable.sol
/*
* SPDX-License-Identifier: MIT
*/
pragma solidity ^0.8.19;
import "../oz_upgradable/utils/ContextUpgradeable.sol";
import "../oz_upgradable/proxy/utils/Initializable.sol";
contract Stakable is Initializable, ContextUpgradeable {
struct Stake {
uint256 amountLBSKR;
uint256 amountBSKR;
uint256 sharesLBSKR;
uint256 sharesBSKR;
uint256 since;
}
struct Stakeholder {
address user;
Stake[] userStakes;
}
Stakeholder[] public stakeholders;
mapping(address => uint256) internal _stakeIndexMap;
uint256 public totalBSKRShares;
uint256 public totalBSKRStakes;
uint256 public totalLBSKRShares;
uint256 public totalLBSKRStakes;
/**
* @notice Staked event is triggered whenever a user stakes tokens, address is indexed to make it filterable
*/
event Staked(
address indexed user,
uint256 amountLBSKR,
uint256 amountBSKR,
uint256 sharesLBSKR,
uint256 sharesBSKR,
uint256 stakeIndex,
uint256 since
);
/**
* @notice Unstaked event is triggered whenever a user unstakes tokens, address is indexed to make it filterable
*/
event Unstaked(
address indexed user,
uint256 amountLBSKR,
uint256 amountBSKR,
uint256 sharesLBSKR,
uint256 sharesBSKR,
uint256 since,
uint256 till
);
function __Stakable_init() internal onlyInitializing {
__Stakable_init_unchained();
}
function __Stakable_init_unchained() internal onlyInitializing {
// This push is needed so we avoid index 0 causing bug of index-1
if (stakeholders.length == 0) {
stakeholders.push();
}
}
/**
* @notice _addStakeholder takes care of adding a stakeholder to the stakeholders array
*/
function _addStakeholder(address staker) internal returns (uint256) {
// Push a empty item to the Array to make space for our new stakeholder
stakeholders.push();
// Calculate the index of the last item in the array by Len-1
uint256 stakerIndex = stakeholders.length - 1;
// Assign the address to the new index
stakeholders[stakerIndex].user = staker;
// Add index to the stakeholders
_stakeIndexMap[staker] = stakerIndex;
return stakerIndex;
}
function _getCurrStake(
uint256 stakerIndex,
uint256 stakeIndex
) internal view returns (Stake memory currStake) {
require(
stakeIndex < stakeholders[stakerIndex].userStakes.length,
"S: Stake index incorrect!"
);
currStake = stakeholders[stakerIndex].userStakes[stakeIndex];
return currStake;
}
function _stake(
uint256 amountLBSKR,
uint256 amountBSKR,
uint256 sharesLBSKR,
uint256 sharesBSKR
) internal {
// Simple check so that user does not stake 0
require(amountLBSKR != 0, "S: Cannot stake nothing");
// Mappings in solidity creates all values, but empty, so we can just check the address
uint256 stakerIndex = _stakeIndexMap[_msgSender()];
uint256 since = block.timestamp;
// See if the staker already has a staked index or if its the first time
if (stakerIndex == 0) {
// This stakeholder stakes for the first time
// We need to add him to the stakeholders and also map it into the Index of the stakes
// The index returned will be the index of the stakeholder in the stakeholders array
stakerIndex = _addStakeholder(_msgSender());
}
// Use the index to push a new Stake
// push a newly created Stake with the current block timestamp.
stakeholders[stakerIndex].userStakes.push(
Stake(amountLBSKR, amountBSKR, sharesLBSKR, sharesBSKR, since)
);
totalLBSKRStakes += amountLBSKR;
totalBSKRStakes += amountBSKR;
totalLBSKRShares += sharesLBSKR;
totalBSKRShares += sharesBSKR;
// Emit an event that the stake has occured
emit Staked(
_msgSender(),
amountLBSKR,
amountBSKR,
sharesLBSKR,
sharesBSKR,
stakeholders[stakerIndex].userStakes.length - 1,
since
);
}
function _withdrawStake(
uint256 stakeIndex,
uint256 unstakeAmount
)
internal
returns (
Stake memory currStake,
uint256 lbskrShares2Deduct,
uint256 bskrShares2Deduct,
uint256 bskrAmount2Deduct
)
{
uint256 stakerIndex = _stakeIndexMap[_msgSender()];
currStake = _getCurrStake(stakerIndex, stakeIndex);
require(
stakerIndex != 1 || stakeIndex != 0,
"S: Cannot remove the first stake"
);
require(
currStake.amountLBSKR >= unstakeAmount,
"S: Cannot withdraw more than you have staked"
);
// Remove by subtracting the money unstaked
// Same fraction of shares to be deducted from both BSKR and LBSKR
lbskrShares2Deduct =
(unstakeAmount * currStake.sharesLBSKR) /
currStake.amountLBSKR;
bskrAmount2Deduct =
(unstakeAmount * currStake.amountBSKR) /
currStake.amountLBSKR;
bskrShares2Deduct =
(unstakeAmount * currStake.sharesBSKR) /
currStake.amountLBSKR;
if (currStake.amountLBSKR == unstakeAmount) {
if (stakeIndex < stakeholders[stakerIndex].userStakes.length - 1) {
stakeholders[stakerIndex].userStakes[stakeIndex] = stakeholders[
stakerIndex
].userStakes[stakeholders[stakerIndex].userStakes.length - 1];
}
stakeholders[stakerIndex].userStakes.pop();
if (stakeholders[stakerIndex].userStakes.length == 0) {
stakeholders[stakerIndex] = stakeholders[
stakeholders.length - 1
];
stakeholders.pop();
_stakeIndexMap[_msgSender()] = 0;
_stakeIndexMap[stakeholders[stakerIndex].user] = stakerIndex;
}
} else {
Stake storage updatedStake = stakeholders[stakerIndex].userStakes[
stakeIndex
];
updatedStake.amountLBSKR -= unstakeAmount;
updatedStake.amountBSKR -= bskrAmount2Deduct;
updatedStake.sharesLBSKR -= lbskrShares2Deduct;
updatedStake.sharesBSKR -= bskrShares2Deduct;
}
return (
currStake,
lbskrShares2Deduct,
bskrShares2Deduct,
bskrAmount2Deduct
);
}
/**
* @notice Returns the total number of stake holders
*/
function getTotalStakeholders() external view returns (uint256) {
return stakeholders.length - 1;
}
/**
* @notice A method to the aggregated stakes from all stakeholders.
* @return __totalStakes The aggregated stakes from all stakeholders.
*/
function getTotalStakes() external view returns (uint256 __totalStakes) {
// uint256 __totalStakes;
for (
uint256 stakerIndex;
stakerIndex < stakeholders.length;
++stakerIndex
) {
__totalStakes =
__totalStakes +
stakeholders[stakerIndex].userStakes.length;
}
return __totalStakes;
}
/**
* @notice Returns the stakes of a stakeholder
*/
function stakesOf(
address stakeholder
) external view returns (Stake[] memory userStakes) {
uint256 stakerIndex = _stakeIndexMap[stakeholder];
if (stakerIndex > 0) {
return stakeholders[stakerIndex].userStakes;
}
return userStakes;
}
/**
* @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/lib/DSMath.sol
/*
* SPDX-License-Identifier: MIT
*/
/// math.sol -- mixin for inline numerical wizardry
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
pragma solidity ^0.8.19;
contract DSMath {
function add(uint256 x, uint256 y) internal pure returns (uint256 z) {
require((z = x + y) >= x, "ds-math-add-overflow");
}
function mul(uint256 x, uint256 y) internal pure returns (uint256 z) {
require(y == 0 || (z = x * y) / y == x, "ds-math-mul-overflow");
}
uint256 constant RAY = 10 ** 27;
//rounds to zero if x*y < WAD / 2
function rmul(uint256 x, uint256 y) internal pure returns (uint256 z) {
z = add(mul(x, y), RAY >> 1) / RAY; // 'RAY >> 1' divides by 2
}
function rpow(uint256 x, uint256 n) internal pure returns (uint256 z) {
z = n % 2 != 0 ? x : RAY;
for (n /= 2; n != 0; n /= 2) {
x = rmul(x, x);
if (n % 2 != 0) {
z = rmul(z, x);
}
}
}
}
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/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/security/ReentrancyGuardUpgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.8.0) (security/ReentrancyGuard.sol)
pragma solidity ^0.8.0;
import "../proxy/utils/Initializable.sol";
/**
* @dev Contract module that helps prevent reentrant calls to a function.
*
* Inheriting from `ReentrancyGuard` will make the {nonReentrant} modifier
* available, which can be applied to functions to make sure there are no nested
* (reentrant) calls to them.
*
* Note that because there is a single `nonReentrant` guard, functions marked as
* `nonReentrant` may not call one another. This can be worked around by making
* those functions `private`, and then adding `external` `nonReentrant` entry
* points to them.
*
* TIP: If you would like to learn more about reentrancy and alternative ways
* to protect against it, check out our blog post
* https://blog.openzeppelin.com/reentrancy-after-istanbul/[Reentrancy After Istanbul].
*/
abstract contract ReentrancyGuardUpgradeable is Initializable {
// Booleans are more expensive than uint256 or any type that takes up a full
// word because each write operation emits an extra SLOAD to first read the
// slot's contents, replace the bits taken up by the boolean, and then write
// back. This is the compiler's defense against contract upgrades and
// pointer aliasing, and it cannot be disabled.
// The values being non-zero value makes deployment a bit more expensive,
// but in exchange the refund on every call to nonReentrant will be lower in
// amount. Since refunds are capped to a percentage of the total
// transaction's gas, it is best to keep them low in cases like this one, to
// increase the likelihood of the full refund coming into effect.
uint256 private constant _NOT_ENTERED = 1;
uint256 private constant _ENTERED = 2;
uint256 private _status;
function __ReentrancyGuard_init() internal onlyInitializing {
__ReentrancyGuard_init_unchained();
}
function __ReentrancyGuard_init_unchained() internal onlyInitializing {
_status = _NOT_ENTERED;
}
/**
* @dev Prevents a contract from calling itself, directly or indirectly.
* Calling a `nonReentrant` function from another `nonReentrant`
* function is not supported. It is possible to prevent this from happening
* by making the `nonReentrant` function external, and making it call a
* `private` function that does the actual work.
*/
modifier nonReentrant() {
_nonReentrantBefore();
_;
_nonReentrantAfter();
}
function _nonReentrantBefore() private {
// On the first call to nonReentrant, _status will be _NOT_ENTERED
require(_status != _ENTERED, "ReentrancyGuard: reentrant call");
// Any calls to nonReentrant after this point will fail
_status = _ENTERED;
}
function _nonReentrantAfter() private {
// By storing the original value once again, a refund is triggered (see
// https://eips.ethereum.org/EIPS/eip-2200)
_status = _NOT_ENTERED;
}
/**
* @dev 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/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/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":"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":"Burnt","internalType":"uint256","indexed":false},{"type":"uint256","name":"Growth","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":"Staked","inputs":[{"type":"address","name":"user","internalType":"address","indexed":true},{"type":"uint256","name":"amountLBSKR","internalType":"uint256","indexed":false},{"type":"uint256","name":"amountBSKR","internalType":"uint256","indexed":false},{"type":"uint256","name":"sharesLBSKR","internalType":"uint256","indexed":false},{"type":"uint256","name":"sharesBSKR","internalType":"uint256","indexed":false},{"type":"uint256","name":"stakeIndex","internalType":"uint256","indexed":false},{"type":"uint256","name":"since","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":"Unstaked","inputs":[{"type":"address","name":"user","internalType":"address","indexed":true},{"type":"uint256","name":"amountLBSKR","internalType":"uint256","indexed":false},{"type":"uint256","name":"amountBSKR","internalType":"uint256","indexed":false},{"type":"uint256","name":"sharesLBSKR","internalType":"uint256","indexed":false},{"type":"uint256","name":"sharesBSKR","internalType":"uint256","indexed":false},{"type":"uint256","name":"since","internalType":"uint256","indexed":false},{"type":"uint256","name":"till","internalType":"uint256","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":"__LBSKR_init","inputs":[{"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":"inflationAddressA","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.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":"view","outputs":[{"type":"address","name":"","internalType":"address"}],"name":"getBSKRAddress","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"getTotalStakeholders","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"__totalStakes","internalType":"uint256"}],"name":"getTotalStakes","inputs":[]},{"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":"uint256","name":"penaltyBasis","internalType":"uint256"}],"name":"penaltyIfUnstakedNow","inputs":[{"type":"address","name":"wallet","internalType":"address"},{"type":"uint256","name":"stakeIndex","internalType":"uint256"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"bytes32","name":"","internalType":"bytes32"}],"name":"proxiableUUID","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"renounceOwnership","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"lbskrRewards","internalType":"uint256"},{"type":"uint256","name":"bskrRewards","internalType":"uint256"},{"type":"uint256","name":"eligibleBasis","internalType":"uint256"}],"name":"rewardsOf","inputs":[{"type":"address","name":"stakeholder","internalType":"address"},{"type":"uint256","name":"stakeIndex","internalType":"uint256"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"setInitialRatio","inputs":[{"type":"address","name":"newBSKRAddr","internalType":"address"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"stake","inputs":[{"type":"uint256","name":"amountLBSKR","internalType":"uint256"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"user","internalType":"address"}],"name":"stakeholders","inputs":[{"type":"uint256","name":"","internalType":"uint256"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"tuple[]","name":"userStakes","internalType":"struct Stakable.Stake[]","components":[{"type":"uint256","name":"amountLBSKR","internalType":"uint256"},{"type":"uint256","name":"amountBSKR","internalType":"uint256"},{"type":"uint256","name":"sharesLBSKR","internalType":"uint256"},{"type":"uint256","name":"sharesBSKR","internalType":"uint256"},{"type":"uint256","name":"since","internalType":"uint256"}]}],"name":"stakesOf","inputs":[{"type":"address","name":"stakeholder","internalType":"address"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"string","name":"","internalType":"string"}],"name":"symbol","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"totalBSKRShares","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"totalBSKRStakes","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"totalLBSKRShares","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"totalLBSKRStakes","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":"unstake","inputs":[{"type":"uint256","name":"unstakeAmount","internalType":"uint256"},{"type":"uint256","name":"stakeIndex","internalType":"uint256"}]},{"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
0x60a06040523060805234801561001457600080fd5b50608051614c2061004c60003960008181610eab01528181610eeb01528181610fbe01528181610ffe01526110910152614c206000f3fe6080604052600436106102275760003560e01c806370a0823111610122578063a457c2d7116100a5578063d5f954241161006c578063d5f954241461064d578063dd62ed3e14610662578063e0c9ffc614610682578063e4edf852146106a2578063f2fde38b146106c257005b8063a457c2d7146105b8578063a694fc3a146105d8578063a9059cbb146105f8578063bac1520314610618578063c1acbaf21461062d57005b80638da5cb5b116100e95780638da5cb5b1461052657806395d89b41146105445780639e2c8a5b146105595780639e99f537146105795780639f6ed3e81461059857005b806370a08231146104ac578063715018a6146104cc5780637c72e7c6146104e157806387978fd1146104f85780638b71d6091461050f57005b80633659cfe6116101aa57806352d1902d1161017157806352d1902d146104405780635c975abb14610455578063664f73311461046d57806368c33627146104825780636fc436631461049757005b80633659cfe6146103ba57806339509351146103da578063439766ce146103fa578063481c6a751461040f5780634f1ef2861461042d57005b806323b872dd116101ee57806323b872dd146102fe5780632b3323411461031e578063313ce5671461033e57806333b69c4c1461035257806335941b1c1461037f57005b806306fdde0314610230578063095ea7b31461025b5780630f9f534c1461028b57806318160ddd146102b05780631d6b8b72146102c657005b3661022e57005b005b34801561023c57600080fd5b506102456106e2565b60405161025291906142f1565b60405180910390f35b34801561026757600080fd5b5061027b610276366004614339565b610775565b6040519015158152602001610252565b34801561029757600080fd5b506102a26101445481565b604051908152602001610252565b3480156102bc57600080fd5b5061010e546102a2565b3480156102d257600080fd5b506102e66102e1366004614365565b61078f565b6040516001600160a01b039091168152602001610252565b34801561030a57600080fd5b5061027b61031936600461437e565b6107bf565b34801561032a57600080fd5b5061022e6103393660046143bf565b610853565b34801561034a57600080fd5b5060126102a2565b34801561035e57600080fd5b5061037261036d3660046143bf565b610b80565b60405161025291906143dc565b34801561038b57600080fd5b5061039f61039a366004614339565b610c5e565b60408051938452602084019290925290820152606001610252565b3480156103c657600080fd5b5061022e6103d53660046143bf565b610ea1565b3480156103e657600080fd5b5061027b6103f5366004614339565b610f80565b34801561040657600080fd5b5061022e610fa2565b34801561041b57600080fd5b5060fb546001600160a01b03166102e6565b61022e61043b3660046144ba565b610fb4565b34801561044c57600080fd5b506102a2611084565b34801561046157600080fd5b5060c95460ff1661027b565b34801561047957600080fd5b5061022e611137565b34801561048e57600080fd5b506102a261114f565b3480156104a357600080fd5b506102a26111a6565b3480156104b857600080fd5b506102a26104c73660046143bf565b6111be565b3480156104d857600080fd5b5061022e6111da565b3480156104ed57600080fd5b506102a26101455481565b34801561050457600080fd5b506102a26101465481565b34801561051b57600080fd5b506102a26101435481565b34801561053257600080fd5b506033546001600160a01b03166102e6565b34801561055057600080fd5b506102456111ec565b34801561056557600080fd5b5061022e610574366004614562565b6111fc565b34801561058557600080fd5b506101ab546001600160a01b03166102e6565b3480156105a457600080fd5b5061022e6105b33660046145cd565b61124c565b3480156105c457600080fd5b5061027b6105d3366004614339565b61139d565b3480156105e457600080fd5b5061022e6105f3366004614365565b611415565b34801561060457600080fd5b5061027b610613366004614339565b611613565b34801561062457600080fd5b5061022e611621565b34801561063957600080fd5b506102a2610648366004614339565b611631565b34801561065957600080fd5b5061022e61166f565b34801561066e57600080fd5b506102a261067d3660046146cf565b611684565b34801561068e57600080fd5b5061022e61069d366004614708565b6116b0565b3480156106ae57600080fd5b5061022e6106bd3660046143bf565b611799565b3480156106ce57600080fd5b5061022e6106dd3660046143bf565b6117fd565b606061010b80546106f29061477d565b80601f016020809104026020016040519081016040528092919081815260200182805461071e9061477d565b801561076b5780601f106107405761010080835404028352916020019161076b565b820191906000526020600020905b81548152906001019060200180831161074e57829003601f168201915b5050505050905090565b600033610783818585611873565b60019150505b92915050565b61014181815481106107a057600080fd5b60009182526020909120600290910201546001600160a01b0316905081565b600033816107cd8683611684565b9050600019811461083a578381101561082d5760405162461bcd60e51b815260206004820152601a60248201527f42423a20496e73756666696369656e7420616c6c6f77616e636500000000000060448201526064015b60405180910390fd5b61083a8683868403611873565b610845868686611964565b6001925050505b9392505050565b61085b611b4e565b6101ac54600160a01b900460ff16156108ad5760405162461bcd60e51b8152602060048201526014602482015273130e88125b9a5d1a585b081c985d1a5bc81cd95d60621b6044820152606401610824565b610145541580156108c457506108c2306111be565b155b6109065760405162461bcd60e51b81526020600482015260136024820152724c3a204e6f6e2d7a65726f2062616c616e636560681b6044820152606401610824565b6101ab80546001600160a01b0319166001600160a01b0383811691821790925560fc5460405163e6a4390560e01b81523060048201526024810192909252600092169063e6a4390590604401602060405180830381865afa15801561096f573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061099391906147b1565b90506001600160a01b038116610a1c5760fc546040516364e329cb60e11b81523060048201526001600160a01b0384811660248301529091169063c9c65396906044016020604051808303816000875af11580156109f5573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a1991906147b1565b90505b6001600160a01b03811615610a5d57610a388182600019611873565b6001600160a01b038116600090815261010760205260409020805460ff191660011790555b33600090815261010a602052604081208054670de0b6b3a764000092839291610a879084906147e4565b909155505030600090815261010a602052604081208054839290610aac9084906147f7565b90915550506101ab546001600160a01b0316636c74dd51336101ac5460405160e084901b6001600160e01b03191681526001600160a01b03928316600482015291166024820152604481018490526064016020604051808303816000875af1158015610b1c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b40919061480a565b50610b4d81828384611ba8565b6101ac805460ff60a01b1916600160a01b179055610b6d610e1042614842565b610b7790426147e4565b6101af55505050565b6001600160a01b038116600090815261014260205260409020546060908015610c58576101418181548110610bb757610bb7614856565b9060005260206000209060020201600101805480602002602001604051908101604052809291908181526020016000905b82821015610c4c57838290600052602060002090600502016040518060a00160405290816000820154815260200160018201548152602001600282015481526020016003820154815260200160048201548152505081526020019060010190610be8565b50505050915050919050565b50919050565b6000806000806101af54600014610c7b57610c7842611db0565b90505b6001600160a01b0386166000908152610142602052604081205490610ca08288611e99565b9050610cb0816080015142611fcb565b610cbc906127106147e4565b935082610cc8306111be565b610cd291906147f7565b15610d4f5760006101455482604001516101465486610cf0306111be565b610cfa91906147f7565b610d0491906147f7565b610d0e919061486c565b610d189190614883565b8251909150811115610d4d578151612710908690610d3690846147e4565b610d40919061486c565b610d4a9190614883565b96505b505b6101ab546101ac546040516370a0823160e01b81526001600160a01b0391821660048201529116906370a0823190602401602060405180830381865afa158015610d9d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610dc19190614897565b15610e97576101435460608201516101ab546101ac546040516370a0823160e01b81526001600160a01b039182166004820152600094939291909116906370a0823190602401602060405180830381865afa158015610e24573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e489190614897565b610e52919061486c565b610e5c9190614883565b90508160200151811115610e955761271085836020015183610e7e91906147e4565b610e88919061486c565b610e929190614883565b95505b505b5050509250925092565b6001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000163003610ee95760405162461bcd60e51b8152600401610824906148b0565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316610f32600080516020614b84833981519152546001600160a01b031690565b6001600160a01b031614610f585760405162461bcd60e51b8152600401610824906148fc565b610f6181612027565b60408051600080825260208201909252610f7d9183919061202f565b50565b600033610783818585610f938383611684565b610f9d91906147f7565b611873565b610faa61219a565b610fb26121ec565b565b6001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000163003610ffc5760405162461bcd60e51b8152600401610824906148b0565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316611045600080516020614b84833981519152546001600160a01b031690565b6001600160a01b03161461106b5760405162461bcd60e51b8152600401610824906148fc565b61107482612027565b6110808282600161202f565b5050565b6000306001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016146111245760405162461bcd60e51b815260206004820152603860248201527f555550535570677261646561626c653a206d757374206e6f742062652063616c60448201527f6c6564207468726f7567682064656c656761746563616c6c00000000000000006064820152608401610824565b50600080516020614b8483398151915290565b61113f61219a565b610106805460ff19166001179055565b6000805b610141548110156111a257610141818154811061117257611172614856565b600091825260209091206001600290920201015461119090836147f7565b915061119b81614948565b9050611153565b5090565b610141546000906111b9906001906147e4565b905090565b6001600160a01b0316600090815261010a602052604090205490565b6111e2611b4e565b610fb26000612246565b606061010c80546106f29061477d565b611204612298565b61120c6122f3565b611214612339565b60008060008061122485876123d1565b935093509350935061123d8682858588608001516128fb565b50505050611080600161017955565b600054610100900460ff161580801561126c5750600054600160ff909116105b806112865750303b158015611286575060005460ff166001145b6112e95760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b6064820152608401610824565b6000805460ff19166001179055801561130c576000805461ff0019166101001790555b611314612e10565b61131c612e40565b611324612e73565b61133389898989898988612edc565b61133b6132a0565b6113436132e1565b61134c83613308565b8015611392576000805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b505050505050505050565b600033816113ab8286611684565b9050838110156113fd5760405162461bcd60e51b815260206004820152601760248201527f42534b523a204465637265617365732062656c6f7720300000000000000000006044820152606401610824565b61140a8286868403611873565b506001949350505050565b61141d6122f3565b611425612298565b806000036114755760405162461bcd60e51b815260206004820152601760248201527f4c3a2043616e6e6f74207374616b65206e6f7468696e670000000000000000006044820152606401610824565b33600090815261010a60205260409020548111156114cb5760405162461bcd60e51b81526020600482015260136024820152724c3a20546f6f206d756368207374616b696e6760681b6044820152606401610824565b6114d3612339565b60006114de306111be565b610146546114ec91906147f7565b610145546114fa908461486c565b6115049190614883565b33600090815261010a60205260408120805492935084929091906115299084906147e4565b909155505030600090815261010a60205260408120805484929061154e9084906147f7565b90915550506101ab546101ac546040516370a0823160e01b81526001600160a01b03918216600482015260009291909116906370a0823190602401602060405180830381865afa1580156115a6573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906115ca9190614897565b905060006115d830856134f8565b905060008261014354836115ec919061486c565b6115f69190614883565b905061160485838684611ba8565b50505050610f7d600161017955565b600033610783818585611964565b61162961219a565b610fb26136ff565b6001600160a01b03821660009081526101426020526040812054816116568285611e99565b9050611666816080015142611fcb565b95945050505050565b61167761219a565b610106805460ff19169055565b6001600160a01b0391821660009081526101096020908152604080832093909416825291909152205490565b6116b8611b4e565b60005b818110156117945760008383838181106116d7576116d7614856565b6116ed92602060409092020190810191506143bf565b6001600160a01b031614158015611720575082828281811061171157611711614856565b90506040020160200135600014155b156117845761178483838381811061173a5761173a614856565b61175092602060409092020190810191506143bf565b84848481811061176257611762614856565b9050604002016020013567016345785d8a000061177f919061486c565b613738565b61178d81614948565b90506116bb565b505050565b6117a161219a565b60fb546040516001600160a01b038084169216907f80f15e9dbc60884fdb59fb8ed4fc48a9a689e028f055e893ed45ca5be67c5c8590600090a360fb80546001600160a01b0319166001600160a01b0392909216919091179055565b611805611b4e565b6001600160a01b03811661186a5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610824565b610f7d81612246565b6001600160a01b0383166118bb5760405162461bcd60e51b815260206004820152600f60248201526e21211d10233937b690181030b2323960891b6044820152606401610824565b6001600160a01b0382166119015760405162461bcd60e51b815260206004820152600d60248201526c21211d102a3790181030b2323960991b6044820152606401610824565b6001600160a01b038381166000818152610109602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92591015b60405180910390a3505050565b6001600160a01b0383166119ab5760405162461bcd60e51b815260206004820152600e60248201526d261d10233937b690181030b2323960911b6044820152606401610824565b6001600160a01b0382166119f05760405162461bcd60e51b815260206004820152600c60248201526b261d102a3790181030b2323960a11b6044820152606401610824565b80600003611a2e5760405162461bcd60e51b815260206004820152600b60248201526a130e880c08185b5bdd5b9d60aa1b6044820152606401610824565b6101065460ff16611a9057611a438383613756565b15611a905760405162461bcd60e51b815260206004820152601b60248201527f4c3a20556e69737761705633206e6f7420737570706f727465642100000000006044820152606401610824565b611a9983613770565b611aa282613770565b6001600160a01b0383166000908152610108602052604090205460019060ff1680611ae657506001600160a01b0383166000908152610108602052604090205460ff165b15611aef575060005b6001600160a01b0384166000908152610107602052604090205460ff16158015611b3357506001600160a01b0383166000908152610107602052604090205460ff16155b15611b3c575060005b611b488484848461384e565b50505050565b6033546001600160a01b03163314610fb25760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610824565b83600003611bf85760405162461bcd60e51b815260206004820152601760248201527f533a2043616e6e6f74207374616b65206e6f7468696e670000000000000000006044820152606401610824565b3360009081526101426020526040812054904290829003611c1f57611c1c33613a6c565b91505b6101418281548110611c3357611c33614856565b600091825260208083206040805160a0810182528b81528084018b81529181018a8152606082018a81526080830189815260016002988902909601860180548088018255908a52968920935160059097029093019586559251938501939093559151938301939093559151600382015590516004909101556101468054889290611cbe9084906147f7565b92505081905550846101446000828254611cd891906147f7565b92505081905550836101456000828254611cf291906147f7565b92505081905550826101436000828254611d0c91906147f7565b909155503390506001600160a01b03167fc16be9a586414a157dd46b4d023aa9997a025dd1cbbaa67ac0c1b8273a5eaf558787878760016101418981548110611d5757611d57614856565b906000526020600020906002020160010180549050611d7691906147e4565b604080519586526020860194909452928401919091526060830152608082015260a0810184905260c00160405180910390a2505050505050565b60006101af54600003611e055760405162461bcd60e51b815260206004820152601960248201527f4c3a20496e666c6174696f6e206e6f74207374617274656421000000000000006044820152606401610824565b6000610e106101af5484611e1991906147e4565b611e239190614883565b6101ac546001600160a01b0316600090815261010a60205260409020549091508115611e92576000611e616b033b2c8af183120df300000084613ae5565b90506b033b2e3c9fd0803ce8000000611e7a828461486c565b611e849190614883565b611e8e90836147e4565b9350505b5050919050565b611ecb6040518060a0016040528060008152602001600081526020016000815260200160008152602001600081525090565b6101418381548110611edf57611edf614856565b9060005260206000209060020201600101805490508210611f425760405162461bcd60e51b815260206004820152601960248201527f533a205374616b6520696e64657820696e636f727265637421000000000000006044820152606401610824565b6101418381548110611f5657611f56614856565b90600052602060002090600202016001018281548110611f7857611f78614856565b90600052602060002090600502016040518060a001604052908160008201548152602001600182015481526020016002820154815260200160038201548152602001600482015481525050905092915050565b600081611fdc846301dfe2006147f7565b11156107895760006224ea00611ff285856147e4565b611ffc9190614883565b9050600d8110156120205761201281600d6147e4565b61201d90606461486c565b91505b5092915050565b610f7d611b4e565b7f4910fdfa16fed3260ed0e7147f7cc6da11a60208b5b9406d12a635614ffd91435460ff16156120625761179483613b5e565b826001600160a01b03166352d1902d6040518163ffffffff1660e01b8152600401602060405180830381865afa9250505080156120bc575060408051601f3d908101601f191682019092526120b991810190614897565b60015b61211f5760405162461bcd60e51b815260206004820152602e60248201527f45524331393637557067726164653a206e657720696d706c656d656e7461746960448201526d6f6e206973206e6f74205555505360901b6064820152608401610824565b600080516020614b84833981519152811461218e5760405162461bcd60e51b815260206004820152602960248201527f45524331393637557067726164653a20756e737570706f727465642070726f786044820152681a58589b195555525160ba1b6064820152608401610824565b50611794838383613bfa565b60fb546001600160a01b03163314610fb25760405162461bcd60e51b8152602060048201526015602482015274269d1021b0b63632b9103737ba1036b0b730b3b2b960591b6044820152606401610824565b6121f46122f3565b60c9805460ff191660011790557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a2586122293390565b6040516001600160a01b03909116815260200160405180910390a1565b603380546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b600261017954036122eb5760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606401610824565b600261017955565b60c95460ff1615610fb25760405162461bcd60e51b815260206004820152601060248201526f14185d5cd8589b194e881c185d5cd95960821b6044820152606401610824565b6000612347610e1042614842565b61235190426147e4565b90506101af54811115610f7d57600061236982611db0565b90508015611080576101af8290556101ac546001600160a01b0316600090815261010a6020526040812080548392906123a39084906147e4565b909155505030600090815261010a6020526040812080548392906123c89084906147f7565b90915550505050565b6124036040518060a0016040528060008152602001600081526020016000815260200160008152602001600081525090565b3360009081526101426020526040812054819081906124228188611e99565b945080600114158061243357508615155b61247f5760405162461bcd60e51b815260206004820181905260248201527f533a2043616e6e6f742072656d6f766520746865206669727374207374616b656044820152606401610824565b84518611156124e55760405162461bcd60e51b815260206004820152602c60248201527f533a2043616e6e6f74207769746864726177206d6f7265207468616e20796f7560448201526b081a185d99481cdd185ad95960a21b6064820152608401610824565b845160408601516124f6908861486c565b6125009190614883565b8551602087015191955090612515908861486c565b61251f9190614883565b8551606087015191935090612534908861486c565b61253e9190614883565b92508585600001510361283d576001610141828154811061256157612561614856565b90600052602060002090600202016001018054905061258091906147e4565b87101561267957610141818154811061259b5761259b614856565b9060005260206000209060020201600101600161014183815481106125c2576125c2614856565b9060005260206000209060020201600101805490506125e191906147e4565b815481106125f1576125f1614856565b9060005260206000209060050201610141828154811061261357612613614856565b9060005260206000209060020201600101888154811061263557612635614856565b906000526020600020906005020160008201548160000155600182015481600101556002820154816002015560038201548160030155600482015481600401559050505b610141818154811061268d5761268d614856565b90600052602060002090600202016001018054806126ad576126ad614961565b6000828152602081206005600019909301928302018181556001810182905560028101829055600381018290556004015590556101418054829081106126f5576126f5614856565b60009182526020822060016002909202010154900361283857610141805461271f906001906147e4565b8154811061272f5761272f614856565b9060005260206000209060020201610141828154811061275157612751614856565b60009182526020909120825460029092020180546001600160a01b0319166001600160a01b0390921691909117815560018083018054612794928401919061417b565b509050506101418054806127aa576127aa614961565b60008281526020812060026000199093019283020180546001600160a01b0319168155906127db60018301826141f5565b505090553360009081526101426020819052604082208290556101418054849391908490811061280d5761280d614856565b600091825260208083206002909202909101546001600160a01b031683528201929092526040019020555b6128f1565b6000610141828154811061285357612853614856565b9060005260206000209060020201600101888154811061287557612875614856565b906000526020600020906005020190508681600001600082825461289991906147e4565b92505081905550828160010160008282546128b491906147e4565b92505081905550848160020160008282546128cf91906147e4565b92505081905550838160030160008282546128ea91906147e4565b9091555050505b5092959194509250565b60006129078242611fcb565b612913906127106147e4565b90506000612920306111be565b15612acb576000610145548661014654612939306111be565b61294391906147f7565b61294d919061486c565b6129579190614883565b905087811115612ac9576127108361296f8a846147e4565b612979919061486c565b6129839190614883565b915081156129fb5730600090815261010a6020526040812080548492906129ab9084906147e4565b909155505033600090815261010a6020526040812080548492906129d09084906147f7565b909155505060405182815233903090600080516020614bcb8339815191529060200160405180910390a35b612710831015612ac9576000612710612a1485826147e4565b612a1e8b856147e4565b612a28919061486c565b612a329190614883565b90508015612ac75730600090815261010a602052604081208054839290612a5a9084906147e4565b9091555050600080805261010a6020527f8684156705e0cb91ffe15d87ba1902d313d1419968887339e417608630e963348054839290612a9b9084906147f7565b90915550506040518181526000903090600080516020614bcb8339815191529060200160405180910390a35b505b505b6101ab546101ac546040516370a0823160e01b81526001600160a01b03918216600482015260009291909116906370a0823190602401602060405180830381865afa158015612b1e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612b429190614897565b15612d4157612710612b54848961486c565b612b5e9190614883565b90508015612c46576101ab546101ac546001600160a01b0391821691636c74dd519116336040516001600160e01b031960e085901b1681526001600160a01b03928316600482015291166024820152604481018490526064016020604051808303816000875af1158015612bd6573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612bfa919061480a565b612c465760405162461bcd60e51b815260206004820152601760248201527f4c3a2042534b52207472616e73666572206661696c65640000000000000000006044820152606401610824565b612710831015612d41576000612710612c5f85826147e4565b612c69908a61486c565b612c739190614883565b90508015612d3f576101ab546101ac54604051636c74dd5160e01b81526001600160a01b0391821660048201526000602482015260448101849052911690636c74dd51906064016020604051808303816000875af1158015612cd9573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612cfd919061480a565b612d3f5760405162461bcd60e51b8152602060048201526013602482015272130e881094d2d488189d5c9b8819985a5b1959606a1b6044820152606401610824565b505b876101466000828254612d5491906147e4565b92505081905550866101446000828254612d6e91906147e4565b92505081905550856101456000828254612d8891906147e4565b92505081905550846101436000828254612da291906147e4565b9091555050604080518981526020810189905280820188905260608101879052608081018690524260a0820152905133917f99e303fc09f735c25e5c4484adf9e39fe63be9940fe6bab97a10697bd6a34a73919081900360c00190a25050505050505050565b600161017955565b600054610100900460ff16612e375760405162461bcd60e51b815260040161082490614977565b610fb233612246565b600054610100900460ff16612e675760405162461bcd60e51b815260040161082490614977565b60c9805460ff19169055565b600054610100900460ff16612e9a5760405162461bcd60e51b815260040161082490614977565b60fb80546001600160a01b031916339081179091556040516000907f80f15e9dbc60884fdb59fb8ed4fc48a9a689e028f055e893ed45ca5be67c5c85908290a3565b600054610100900460ff16612f035760405162461bcd60e51b815260040161082490614977565b61010b612f11878983614a10565b5061010c612f20858783614a10565b5060fe80546001600160a01b038086166001600160a01b03199283161790925560ff805492851692909116919091179055612f5f610101826005614216565b50466103ad03612fa6576c0c9f2c9cd04674edea4000000061010e5560fd80546001600160a01b03191673b4a7633d8932de086c9264d5eb39a8399d7c0e3a17905561306a565b466103ae03612fec576c0c9f2c9cd04674edea4000000061010e5560fd80546001600160a01b03191673dae9dd3d1a52cfce9d5f2fac7fde164d500e50f717905561306a565b4662aa36a703613032576b033b2e3c9fd0803ce800000061010e5560fd80546001600160a01b0319167301a93b7153ee160f3176af0b0f31121df9f0ffa517905561306a565b6b033b2e3c9fd0803ce800000061010e5560fd80546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d1790555b60fd60009054906101000a90046001600160a01b03166001600160a01b031663c45a01556040518163ffffffff1660e01b8152600401602060405180830381865afa1580156130bd573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906130e191906147b1565b60fc80546001600160a01b0319166001600160a01b0392909216919091179055466103ad14806131125750466103ae145b156131b45760fd60009054906101000a90046001600160a01b03166001600160a01b031663ef8ef56f6040518163ffffffff1660e01b8152600401602060405180830381865afa15801561316a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061318e91906147b1565b61010080546001600160a01b0319166001600160a01b039290921691909117905561324d565b60fd60009054906101000a90046001600160a01b03166001600160a01b031663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa158015613207573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061322b91906147b1565b61010080546001600160a01b0319166001600160a01b03929092169190911790555b505033600090815261010860205260408082208054600160ff199182168117909255308452828420805482168317905560fd546001600160a01b0316845291909220805490911690911790555050505050565b600054610100900460ff166132c75760405162461bcd60e51b815260040161082490614977565b61014154600003610fb25761014180546001018155600052565b600054610100900460ff16612e085760405162461bcd60e51b815260040161082490614977565b600054610100900460ff1661332f5760405162461bcd60e51b815260040161082490614977565b600a6101ad5560056101ae556101ac80546001600160a01b0319166001600160a01b03831617905561010e5460011c8061010a6000336001600160a01b03908116825260208083019390935260409182016000908120949094556101ac548116845261010a90925280832084905560fc546101005491516364e329cb60e11b815230600482015291831660248301529091169063c9c65396906044016020604051808303816000875af11580156133ea573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061340e91906147b1565b905061341d8182600019611873565b6001600160a01b038116600090815261010760205260408120805460ff191660011790555b60058110156134a05760016101086000610101846005811061346657613466614856565b01546001600160a01b031681526020810191909152604001600020805460ff191691151591909117905561349981614948565b9050613442565b506040518281523390600090600080516020614bcb8339815191529060200160405180910390a36101ac546040518381526001600160a01b0390911690600090600080516020614bcb83398151915290602001611957565b60408051600280825260608201835260009283929190602083019080368337019050509050308160008151811061353157613531614856565b6001600160a01b0392831660209182029290920101526101ab5482519116908290600190811061356357613563614856565b6001600160a01b03928316602091820292909201015260fd546135899186911685611873565b6101ab546101ac546040516370a0823160e01b81526001600160a01b03918216600482015260009291909116906370a0823190602401602060405180830381865afa1580156135dc573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906136009190614897565b60fd546101ac549192506001600160a01b0390811691635c11d79591879160009187911661362f42600f6147f7565b6040518663ffffffff1660e01b815260040161364f959493929190614ad1565b600060405180830381600087803b15801561366957600080fd5b505af115801561367d573d6000803e3d6000fd5b50506101ab546101ac546040516370a0823160e01b81526001600160a01b039182166004820152859450911691506370a0823190602401602060405180830381865afa1580156136d1573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906136f59190614897565b61166691906147e4565b613707613c1f565b60c9805460ff191690557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa33612229565b61108061374d6033546001600160a01b031690565b8383600061384e565b600061376183613c68565b8061084c575061084c82613c68565b806001600160a01b03163b6000036137855750565b60fd546001600160a01b039081169082160361379e5750565b610100546001600160a01b03908116908216036137b85750565b6001600160a01b0381166000908152610107602052604090205460ff16610f7d5760006137e482613d49565b90506001600160a01b0381166137f8575050565b600061380383613d5c565b90506001600160a01b03811661381857505050565b6138258384600019611873565b50506001600160a01b038116600090815261010760205260409020805460ff1916600117905550565b6138566122f3565b61385e61426a565b8161386b578281526138d6565b6127106101ad548461387d919061486c565b6138879190614883565b60208201526101ae546127109061389e908561486c565b6138a89190614883565b604082018190526138ba90600261486c565b60208201516138c990856147e4565b6138d391906147e4565b81525b6001600160a01b038516600090815261010a6020526040812080548592906138ff9084906147e4565b909155505080516001600160a01b038516600090815261010a60205260408120805490919061392f9084906147f7565b9091555050602081015115613a3257602080820151600080805261010a9092527f8684156705e0cb91ffe15d87ba1902d313d1419968887339e417608630e963348054919290916139819084906147f7565b909155505060408082015160fe546001600160a01b0316600090815261010a6020529182208054919290916139b79084906147f7565b909155505060408082015160ff546001600160a01b0316600090815261010a6020529182208054919290916139ed9084906147f7565b909155505060208082015160408051828152928301919091527f0e992691453a607a3e534af8638548f72f22fc0eb79c112bdf5c20a3729117aa910160405180910390a15b80516040519081526001600160a01b038581169190871690600080516020614bcb8339815191529060200160405180910390a35050505050565b6101418054600190810180835560009283528291613a89916147e4565b9050826101418281548110613aa057613aa0614856565b6000918252602080832060029290920290910180546001600160a01b0319166001600160a01b0394851617905594909116815261014290935260409092208290555090565b6000613af2600283614842565b600003613b0b576b033b2e3c9fd0803ce8000000613b0d565b825b9050613b1a600283614883565b91505b811561078957613b2d8384613d6f565b9250613b3a600283614842565b15613b4c57613b498184613d6f565b90505b613b57600283614883565b9150613b1d565b6001600160a01b0381163b613bcb5760405162461bcd60e51b815260206004820152602d60248201527f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60448201526c1bdd08184818dbdb9d1c9858dd609a1b6064820152608401610824565b600080516020614b8483398151915280546001600160a01b0319166001600160a01b0392909216919091179055565b613c0383613da7565b600082511180613c105750805b1561179457611b488383613de7565b60c95460ff16610fb25760405162461bcd60e51b815260206004820152601460248201527314185d5cd8589b194e881b9bdd081c185d5cd95960621b6044820152606401610824565b60fd546000906001600160a01b0390811690831603613c8957506000919050565b610100546001600160a01b0390811690831603613ca857506000919050565b6001600160a01b0382166000908152610107602052604090205460ff1615613cd257506000919050565b6000613cdd83613d49565b90506001600160a01b038116613cf65750600092915050565b6000613d0184613d5c565b90506001600160a01b038116613d1b575060009392505050565b6000613d2685613ed2565b905062ffffff811615613d3e57506001949350505050565b506000949350505050565b600061078982630dfe168160e01b613ee5565b60006107898263d21220a760e01b613ee5565b60006b033b2e3c9fd0803ce8000000613d9d613d8b8585613fb5565b6b019d971e4fe8401e7400000061401c565b61084c9190614883565b613db081613b5e565b6040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b60606001600160a01b0383163b613e4f5760405162461bcd60e51b815260206004820152602660248201527f416464726573733a2064656c65676174652063616c6c20746f206e6f6e2d636f6044820152651b9d1c9858dd60d21b6064820152608401610824565b600080846001600160a01b031684604051613e6a9190614b42565b600060405180830381855af49150503d8060008114613ea5576040519150601f19603f3d011682016040523d82523d6000602084013e613eaa565b606091505b50915091506116668282604051806060016040528060278152602001614ba460279139614071565b60006107898263ddca3f4360e01b61408a565b60408051600481526024810182526020810180516001600160e01b03166001600160e01b031985161790529051600091829182916001600160a01b03871691613f2e9190614b42565b600060405180830381855afa9150503d8060008114613f69576040519150601f19603f3d011682016040523d82523d6000602084013e613f6e565b606091505b5091509150811580613f7f57508051155b15613f8f57600092505050610789565b8051602003613d3e5780806020019051810190613fac91906147b1565b92505050610789565b6000811580613fd957508282613fcb818361486c565b9250613fd79083614883565b145b6107895760405162461bcd60e51b815260206004820152601460248201527364732d6d6174682d6d756c2d6f766572666c6f7760601b6044820152606401610824565b60008261402983826147f7565b91508110156107895760405162461bcd60e51b815260206004820152601460248201527364732d6d6174682d6164642d6f766572666c6f7760601b6044820152606401610824565b6060831561408057508161084c565b61084c8383614151565b60408051600481526024810182526020810180516001600160e01b03166001600160e01b031985161790529051600091829182916001600160a01b038716916140d39190614b42565b600060405180830381855afa9150503d806000811461410e576040519150601f19603f3d011682016040523d82523d6000602084013e614113565b606091505b509150915081158061412457508051155b1561413457600092505050610789565b8051602003613d3e5780806020019051810190613fac9190614b5e565b8151156141615781518083602001fd5b8060405162461bcd60e51b815260040161082491906142f1565b8280548282559060005260206000209060050281019282156141e95760005260206000209160050282015b828111156141e9578254825560018084015490830155600280840154908301556003808401549083015560048084015490830155600592830192909101906141a6565b506111a2929150614288565b5080546000825560050290600052602060002090810190610f7d9190614288565b826005810192821561425e579160200282015b8281111561425e57825182546001600160a01b0319166001600160a01b03909116178255602090920191600190910190614229565b506111a29291506142b8565b60405180606001604052806003906020820280368337509192915050565b5b808211156111a25760008082556001820181905560028201819055600382018190556004820155600501614289565b5b808211156111a257600081556001016142b9565b60005b838110156142e85781810151838201526020016142d0565b50506000910152565b60208152600082518060208401526143108160408501602087016142cd565b601f01601f19169190910160400192915050565b6001600160a01b0381168114610f7d57600080fd5b6000806040838503121561434c57600080fd5b823561435781614324565b946020939093013593505050565b60006020828403121561437757600080fd5b5035919050565b60008060006060848603121561439357600080fd5b833561439e81614324565b925060208401356143ae81614324565b929592945050506040919091013590565b6000602082840312156143d157600080fd5b813561084c81614324565b602080825282518282018190526000919060409081850190868401855b8281101561443d5781518051855286810151878601528581015186860152606080820151908601526080908101519085015260a090930192908501906001016143f9565b5091979650505050505050565b634e487b7160e01b600052604160045260246000fd5b60405160a0810167ffffffffffffffff811182821017156144835761448361444a565b60405290565b604051601f8201601f1916810167ffffffffffffffff811182821017156144b2576144b261444a565b604052919050565b600080604083850312156144cd57600080fd5b82356144d881614324565b915060208381013567ffffffffffffffff808211156144f657600080fd5b818601915086601f83011261450a57600080fd5b81358181111561451c5761451c61444a565b61452e601f8201601f19168501614489565b9150808252878482850101111561454457600080fd5b80848401858401376000848284010152508093505050509250929050565b6000806040838503121561457557600080fd5b50508035926020909101359150565b60008083601f84011261459657600080fd5b50813567ffffffffffffffff8111156145ae57600080fd5b6020830191508360208285010111156145c657600080fd5b9250929050565b600080600080600080600080610140808a8c0312156145eb57600080fd5b893567ffffffffffffffff8082111561460357600080fd5b61460f8d838e01614584565b909b509950602091508b8201358181111561462957600080fd5b6146358e828f01614584565b909a509850505060408b013561464a81614324565b955060608b013561465a81614324565b945060808b013561466a81614324565b935060bf8b018c1361467b57600080fd5b614683614460565b918b0191808d84111561469557600080fd5b60a08d015b848110156146ba5780356146ad81614324565b835291830191830161469a565b50809450505050509295985092959890939650565b600080604083850312156146e257600080fd5b82356146ed81614324565b915060208301356146fd81614324565b809150509250929050565b6000806020838503121561471b57600080fd5b823567ffffffffffffffff8082111561473357600080fd5b818501915085601f83011261474757600080fd5b81358181111561475657600080fd5b8660208260061b850101111561476b57600080fd5b60209290920196919550909350505050565b600181811c9082168061479157607f821691505b602082108103610c5857634e487b7160e01b600052602260045260246000fd5b6000602082840312156147c357600080fd5b815161084c81614324565b634e487b7160e01b600052601160045260246000fd5b81810381811115610789576107896147ce565b80820180821115610789576107896147ce565b60006020828403121561481c57600080fd5b8151801515811461084c57600080fd5b634e487b7160e01b600052601260045260246000fd5b6000826148515761485161482c565b500690565b634e487b7160e01b600052603260045260246000fd5b8082028115828204841417610789576107896147ce565b6000826148925761489261482c565b500490565b6000602082840312156148a957600080fd5b5051919050565b6020808252602c908201527f46756e6374696f6e206d7573742062652063616c6c6564207468726f7567682060408201526b19195b1959d85d1958d85b1b60a21b606082015260800190565b6020808252602c908201527f46756e6374696f6e206d7573742062652063616c6c6564207468726f7567682060408201526b6163746976652070726f787960a01b606082015260800190565b60006001820161495a5761495a6147ce565b5060010190565b634e487b7160e01b600052603160045260246000fd5b6020808252602b908201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960408201526a6e697469616c697a696e6760a81b606082015260800190565b601f82111561179457600081815260208120601f850160051c810160208610156149e95750805b601f850160051c820191505b81811015614a08578281556001016149f5565b505050505050565b67ffffffffffffffff831115614a2857614a2861444a565b614a3c83614a36835461477d565b836149c2565b6000601f841160018114614a705760008515614a585750838201355b600019600387901b1c1916600186901b178355614aca565b600083815260209020601f19861690835b82811015614aa15786850135825560209485019460019092019101614a81565b5086821015614abe5760001960f88860031b161c19848701351681555b505060018560011b0183555b5050505050565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015614b215784516001600160a01b031683529383019391830191600101614afc565b50506001600160a01b03969096166060850152505050608001529392505050565b60008251614b548184602087016142cd565b9190910192915050565b600060208284031215614b7057600080fd5b815162ffffff8116811461084c57600080fdfe360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564ddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3efa2646970667358221220c83cc6ee218159a0e26b2e0611aae7a52a0c10debece902b54430303ae7769df64736f6c63430008130033
Deployed ByteCode
0x6080604052600436106102275760003560e01c806370a0823111610122578063a457c2d7116100a5578063d5f954241161006c578063d5f954241461064d578063dd62ed3e14610662578063e0c9ffc614610682578063e4edf852146106a2578063f2fde38b146106c257005b8063a457c2d7146105b8578063a694fc3a146105d8578063a9059cbb146105f8578063bac1520314610618578063c1acbaf21461062d57005b80638da5cb5b116100e95780638da5cb5b1461052657806395d89b41146105445780639e2c8a5b146105595780639e99f537146105795780639f6ed3e81461059857005b806370a08231146104ac578063715018a6146104cc5780637c72e7c6146104e157806387978fd1146104f85780638b71d6091461050f57005b80633659cfe6116101aa57806352d1902d1161017157806352d1902d146104405780635c975abb14610455578063664f73311461046d57806368c33627146104825780636fc436631461049757005b80633659cfe6146103ba57806339509351146103da578063439766ce146103fa578063481c6a751461040f5780634f1ef2861461042d57005b806323b872dd116101ee57806323b872dd146102fe5780632b3323411461031e578063313ce5671461033e57806333b69c4c1461035257806335941b1c1461037f57005b806306fdde0314610230578063095ea7b31461025b5780630f9f534c1461028b57806318160ddd146102b05780631d6b8b72146102c657005b3661022e57005b005b34801561023c57600080fd5b506102456106e2565b60405161025291906142f1565b60405180910390f35b34801561026757600080fd5b5061027b610276366004614339565b610775565b6040519015158152602001610252565b34801561029757600080fd5b506102a26101445481565b604051908152602001610252565b3480156102bc57600080fd5b5061010e546102a2565b3480156102d257600080fd5b506102e66102e1366004614365565b61078f565b6040516001600160a01b039091168152602001610252565b34801561030a57600080fd5b5061027b61031936600461437e565b6107bf565b34801561032a57600080fd5b5061022e6103393660046143bf565b610853565b34801561034a57600080fd5b5060126102a2565b34801561035e57600080fd5b5061037261036d3660046143bf565b610b80565b60405161025291906143dc565b34801561038b57600080fd5b5061039f61039a366004614339565b610c5e565b60408051938452602084019290925290820152606001610252565b3480156103c657600080fd5b5061022e6103d53660046143bf565b610ea1565b3480156103e657600080fd5b5061027b6103f5366004614339565b610f80565b34801561040657600080fd5b5061022e610fa2565b34801561041b57600080fd5b5060fb546001600160a01b03166102e6565b61022e61043b3660046144ba565b610fb4565b34801561044c57600080fd5b506102a2611084565b34801561046157600080fd5b5060c95460ff1661027b565b34801561047957600080fd5b5061022e611137565b34801561048e57600080fd5b506102a261114f565b3480156104a357600080fd5b506102a26111a6565b3480156104b857600080fd5b506102a26104c73660046143bf565b6111be565b3480156104d857600080fd5b5061022e6111da565b3480156104ed57600080fd5b506102a26101455481565b34801561050457600080fd5b506102a26101465481565b34801561051b57600080fd5b506102a26101435481565b34801561053257600080fd5b506033546001600160a01b03166102e6565b34801561055057600080fd5b506102456111ec565b34801561056557600080fd5b5061022e610574366004614562565b6111fc565b34801561058557600080fd5b506101ab546001600160a01b03166102e6565b3480156105a457600080fd5b5061022e6105b33660046145cd565b61124c565b3480156105c457600080fd5b5061027b6105d3366004614339565b61139d565b3480156105e457600080fd5b5061022e6105f3366004614365565b611415565b34801561060457600080fd5b5061027b610613366004614339565b611613565b34801561062457600080fd5b5061022e611621565b34801561063957600080fd5b506102a2610648366004614339565b611631565b34801561065957600080fd5b5061022e61166f565b34801561066e57600080fd5b506102a261067d3660046146cf565b611684565b34801561068e57600080fd5b5061022e61069d366004614708565b6116b0565b3480156106ae57600080fd5b5061022e6106bd3660046143bf565b611799565b3480156106ce57600080fd5b5061022e6106dd3660046143bf565b6117fd565b606061010b80546106f29061477d565b80601f016020809104026020016040519081016040528092919081815260200182805461071e9061477d565b801561076b5780601f106107405761010080835404028352916020019161076b565b820191906000526020600020905b81548152906001019060200180831161074e57829003601f168201915b5050505050905090565b600033610783818585611873565b60019150505b92915050565b61014181815481106107a057600080fd5b60009182526020909120600290910201546001600160a01b0316905081565b600033816107cd8683611684565b9050600019811461083a578381101561082d5760405162461bcd60e51b815260206004820152601a60248201527f42423a20496e73756666696369656e7420616c6c6f77616e636500000000000060448201526064015b60405180910390fd5b61083a8683868403611873565b610845868686611964565b6001925050505b9392505050565b61085b611b4e565b6101ac54600160a01b900460ff16156108ad5760405162461bcd60e51b8152602060048201526014602482015273130e88125b9a5d1a585b081c985d1a5bc81cd95d60621b6044820152606401610824565b610145541580156108c457506108c2306111be565b155b6109065760405162461bcd60e51b81526020600482015260136024820152724c3a204e6f6e2d7a65726f2062616c616e636560681b6044820152606401610824565b6101ab80546001600160a01b0319166001600160a01b0383811691821790925560fc5460405163e6a4390560e01b81523060048201526024810192909252600092169063e6a4390590604401602060405180830381865afa15801561096f573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061099391906147b1565b90506001600160a01b038116610a1c5760fc546040516364e329cb60e11b81523060048201526001600160a01b0384811660248301529091169063c9c65396906044016020604051808303816000875af11580156109f5573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a1991906147b1565b90505b6001600160a01b03811615610a5d57610a388182600019611873565b6001600160a01b038116600090815261010760205260409020805460ff191660011790555b33600090815261010a602052604081208054670de0b6b3a764000092839291610a879084906147e4565b909155505030600090815261010a602052604081208054839290610aac9084906147f7565b90915550506101ab546001600160a01b0316636c74dd51336101ac5460405160e084901b6001600160e01b03191681526001600160a01b03928316600482015291166024820152604481018490526064016020604051808303816000875af1158015610b1c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b40919061480a565b50610b4d81828384611ba8565b6101ac805460ff60a01b1916600160a01b179055610b6d610e1042614842565b610b7790426147e4565b6101af55505050565b6001600160a01b038116600090815261014260205260409020546060908015610c58576101418181548110610bb757610bb7614856565b9060005260206000209060020201600101805480602002602001604051908101604052809291908181526020016000905b82821015610c4c57838290600052602060002090600502016040518060a00160405290816000820154815260200160018201548152602001600282015481526020016003820154815260200160048201548152505081526020019060010190610be8565b50505050915050919050565b50919050565b6000806000806101af54600014610c7b57610c7842611db0565b90505b6001600160a01b0386166000908152610142602052604081205490610ca08288611e99565b9050610cb0816080015142611fcb565b610cbc906127106147e4565b935082610cc8306111be565b610cd291906147f7565b15610d4f5760006101455482604001516101465486610cf0306111be565b610cfa91906147f7565b610d0491906147f7565b610d0e919061486c565b610d189190614883565b8251909150811115610d4d578151612710908690610d3690846147e4565b610d40919061486c565b610d4a9190614883565b96505b505b6101ab546101ac546040516370a0823160e01b81526001600160a01b0391821660048201529116906370a0823190602401602060405180830381865afa158015610d9d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610dc19190614897565b15610e97576101435460608201516101ab546101ac546040516370a0823160e01b81526001600160a01b039182166004820152600094939291909116906370a0823190602401602060405180830381865afa158015610e24573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e489190614897565b610e52919061486c565b610e5c9190614883565b90508160200151811115610e955761271085836020015183610e7e91906147e4565b610e88919061486c565b610e929190614883565b95505b505b5050509250925092565b6001600160a01b037f000000000000000000000000d3a7944d1549160191e20ae9b676dbf1d3423bf7163003610ee95760405162461bcd60e51b8152600401610824906148b0565b7f000000000000000000000000d3a7944d1549160191e20ae9b676dbf1d3423bf76001600160a01b0316610f32600080516020614b84833981519152546001600160a01b031690565b6001600160a01b031614610f585760405162461bcd60e51b8152600401610824906148fc565b610f6181612027565b60408051600080825260208201909252610f7d9183919061202f565b50565b600033610783818585610f938383611684565b610f9d91906147f7565b611873565b610faa61219a565b610fb26121ec565b565b6001600160a01b037f000000000000000000000000d3a7944d1549160191e20ae9b676dbf1d3423bf7163003610ffc5760405162461bcd60e51b8152600401610824906148b0565b7f000000000000000000000000d3a7944d1549160191e20ae9b676dbf1d3423bf76001600160a01b0316611045600080516020614b84833981519152546001600160a01b031690565b6001600160a01b03161461106b5760405162461bcd60e51b8152600401610824906148fc565b61107482612027565b6110808282600161202f565b5050565b6000306001600160a01b037f000000000000000000000000d3a7944d1549160191e20ae9b676dbf1d3423bf716146111245760405162461bcd60e51b815260206004820152603860248201527f555550535570677261646561626c653a206d757374206e6f742062652063616c60448201527f6c6564207468726f7567682064656c656761746563616c6c00000000000000006064820152608401610824565b50600080516020614b8483398151915290565b61113f61219a565b610106805460ff19166001179055565b6000805b610141548110156111a257610141818154811061117257611172614856565b600091825260209091206001600290920201015461119090836147f7565b915061119b81614948565b9050611153565b5090565b610141546000906111b9906001906147e4565b905090565b6001600160a01b0316600090815261010a602052604090205490565b6111e2611b4e565b610fb26000612246565b606061010c80546106f29061477d565b611204612298565b61120c6122f3565b611214612339565b60008060008061122485876123d1565b935093509350935061123d8682858588608001516128fb565b50505050611080600161017955565b600054610100900460ff161580801561126c5750600054600160ff909116105b806112865750303b158015611286575060005460ff166001145b6112e95760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b6064820152608401610824565b6000805460ff19166001179055801561130c576000805461ff0019166101001790555b611314612e10565b61131c612e40565b611324612e73565b61133389898989898988612edc565b61133b6132a0565b6113436132e1565b61134c83613308565b8015611392576000805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b505050505050505050565b600033816113ab8286611684565b9050838110156113fd5760405162461bcd60e51b815260206004820152601760248201527f42534b523a204465637265617365732062656c6f7720300000000000000000006044820152606401610824565b61140a8286868403611873565b506001949350505050565b61141d6122f3565b611425612298565b806000036114755760405162461bcd60e51b815260206004820152601760248201527f4c3a2043616e6e6f74207374616b65206e6f7468696e670000000000000000006044820152606401610824565b33600090815261010a60205260409020548111156114cb5760405162461bcd60e51b81526020600482015260136024820152724c3a20546f6f206d756368207374616b696e6760681b6044820152606401610824565b6114d3612339565b60006114de306111be565b610146546114ec91906147f7565b610145546114fa908461486c565b6115049190614883565b33600090815261010a60205260408120805492935084929091906115299084906147e4565b909155505030600090815261010a60205260408120805484929061154e9084906147f7565b90915550506101ab546101ac546040516370a0823160e01b81526001600160a01b03918216600482015260009291909116906370a0823190602401602060405180830381865afa1580156115a6573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906115ca9190614897565b905060006115d830856134f8565b905060008261014354836115ec919061486c565b6115f69190614883565b905061160485838684611ba8565b50505050610f7d600161017955565b600033610783818585611964565b61162961219a565b610fb26136ff565b6001600160a01b03821660009081526101426020526040812054816116568285611e99565b9050611666816080015142611fcb565b95945050505050565b61167761219a565b610106805460ff19169055565b6001600160a01b0391821660009081526101096020908152604080832093909416825291909152205490565b6116b8611b4e565b60005b818110156117945760008383838181106116d7576116d7614856565b6116ed92602060409092020190810191506143bf565b6001600160a01b031614158015611720575082828281811061171157611711614856565b90506040020160200135600014155b156117845761178483838381811061173a5761173a614856565b61175092602060409092020190810191506143bf565b84848481811061176257611762614856565b9050604002016020013567016345785d8a000061177f919061486c565b613738565b61178d81614948565b90506116bb565b505050565b6117a161219a565b60fb546040516001600160a01b038084169216907f80f15e9dbc60884fdb59fb8ed4fc48a9a689e028f055e893ed45ca5be67c5c8590600090a360fb80546001600160a01b0319166001600160a01b0392909216919091179055565b611805611b4e565b6001600160a01b03811661186a5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610824565b610f7d81612246565b6001600160a01b0383166118bb5760405162461bcd60e51b815260206004820152600f60248201526e21211d10233937b690181030b2323960891b6044820152606401610824565b6001600160a01b0382166119015760405162461bcd60e51b815260206004820152600d60248201526c21211d102a3790181030b2323960991b6044820152606401610824565b6001600160a01b038381166000818152610109602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92591015b60405180910390a3505050565b6001600160a01b0383166119ab5760405162461bcd60e51b815260206004820152600e60248201526d261d10233937b690181030b2323960911b6044820152606401610824565b6001600160a01b0382166119f05760405162461bcd60e51b815260206004820152600c60248201526b261d102a3790181030b2323960a11b6044820152606401610824565b80600003611a2e5760405162461bcd60e51b815260206004820152600b60248201526a130e880c08185b5bdd5b9d60aa1b6044820152606401610824565b6101065460ff16611a9057611a438383613756565b15611a905760405162461bcd60e51b815260206004820152601b60248201527f4c3a20556e69737761705633206e6f7420737570706f727465642100000000006044820152606401610824565b611a9983613770565b611aa282613770565b6001600160a01b0383166000908152610108602052604090205460019060ff1680611ae657506001600160a01b0383166000908152610108602052604090205460ff165b15611aef575060005b6001600160a01b0384166000908152610107602052604090205460ff16158015611b3357506001600160a01b0383166000908152610107602052604090205460ff16155b15611b3c575060005b611b488484848461384e565b50505050565b6033546001600160a01b03163314610fb25760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610824565b83600003611bf85760405162461bcd60e51b815260206004820152601760248201527f533a2043616e6e6f74207374616b65206e6f7468696e670000000000000000006044820152606401610824565b3360009081526101426020526040812054904290829003611c1f57611c1c33613a6c565b91505b6101418281548110611c3357611c33614856565b600091825260208083206040805160a0810182528b81528084018b81529181018a8152606082018a81526080830189815260016002988902909601860180548088018255908a52968920935160059097029093019586559251938501939093559151938301939093559151600382015590516004909101556101468054889290611cbe9084906147f7565b92505081905550846101446000828254611cd891906147f7565b92505081905550836101456000828254611cf291906147f7565b92505081905550826101436000828254611d0c91906147f7565b909155503390506001600160a01b03167fc16be9a586414a157dd46b4d023aa9997a025dd1cbbaa67ac0c1b8273a5eaf558787878760016101418981548110611d5757611d57614856565b906000526020600020906002020160010180549050611d7691906147e4565b604080519586526020860194909452928401919091526060830152608082015260a0810184905260c00160405180910390a2505050505050565b60006101af54600003611e055760405162461bcd60e51b815260206004820152601960248201527f4c3a20496e666c6174696f6e206e6f74207374617274656421000000000000006044820152606401610824565b6000610e106101af5484611e1991906147e4565b611e239190614883565b6101ac546001600160a01b0316600090815261010a60205260409020549091508115611e92576000611e616b033b2c8af183120df300000084613ae5565b90506b033b2e3c9fd0803ce8000000611e7a828461486c565b611e849190614883565b611e8e90836147e4565b9350505b5050919050565b611ecb6040518060a0016040528060008152602001600081526020016000815260200160008152602001600081525090565b6101418381548110611edf57611edf614856565b9060005260206000209060020201600101805490508210611f425760405162461bcd60e51b815260206004820152601960248201527f533a205374616b6520696e64657820696e636f727265637421000000000000006044820152606401610824565b6101418381548110611f5657611f56614856565b90600052602060002090600202016001018281548110611f7857611f78614856565b90600052602060002090600502016040518060a001604052908160008201548152602001600182015481526020016002820154815260200160038201548152602001600482015481525050905092915050565b600081611fdc846301dfe2006147f7565b11156107895760006224ea00611ff285856147e4565b611ffc9190614883565b9050600d8110156120205761201281600d6147e4565b61201d90606461486c565b91505b5092915050565b610f7d611b4e565b7f4910fdfa16fed3260ed0e7147f7cc6da11a60208b5b9406d12a635614ffd91435460ff16156120625761179483613b5e565b826001600160a01b03166352d1902d6040518163ffffffff1660e01b8152600401602060405180830381865afa9250505080156120bc575060408051601f3d908101601f191682019092526120b991810190614897565b60015b61211f5760405162461bcd60e51b815260206004820152602e60248201527f45524331393637557067726164653a206e657720696d706c656d656e7461746960448201526d6f6e206973206e6f74205555505360901b6064820152608401610824565b600080516020614b84833981519152811461218e5760405162461bcd60e51b815260206004820152602960248201527f45524331393637557067726164653a20756e737570706f727465642070726f786044820152681a58589b195555525160ba1b6064820152608401610824565b50611794838383613bfa565b60fb546001600160a01b03163314610fb25760405162461bcd60e51b8152602060048201526015602482015274269d1021b0b63632b9103737ba1036b0b730b3b2b960591b6044820152606401610824565b6121f46122f3565b60c9805460ff191660011790557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a2586122293390565b6040516001600160a01b03909116815260200160405180910390a1565b603380546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b600261017954036122eb5760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606401610824565b600261017955565b60c95460ff1615610fb25760405162461bcd60e51b815260206004820152601060248201526f14185d5cd8589b194e881c185d5cd95960821b6044820152606401610824565b6000612347610e1042614842565b61235190426147e4565b90506101af54811115610f7d57600061236982611db0565b90508015611080576101af8290556101ac546001600160a01b0316600090815261010a6020526040812080548392906123a39084906147e4565b909155505030600090815261010a6020526040812080548392906123c89084906147f7565b90915550505050565b6124036040518060a0016040528060008152602001600081526020016000815260200160008152602001600081525090565b3360009081526101426020526040812054819081906124228188611e99565b945080600114158061243357508615155b61247f5760405162461bcd60e51b815260206004820181905260248201527f533a2043616e6e6f742072656d6f766520746865206669727374207374616b656044820152606401610824565b84518611156124e55760405162461bcd60e51b815260206004820152602c60248201527f533a2043616e6e6f74207769746864726177206d6f7265207468616e20796f7560448201526b081a185d99481cdd185ad95960a21b6064820152608401610824565b845160408601516124f6908861486c565b6125009190614883565b8551602087015191955090612515908861486c565b61251f9190614883565b8551606087015191935090612534908861486c565b61253e9190614883565b92508585600001510361283d576001610141828154811061256157612561614856565b90600052602060002090600202016001018054905061258091906147e4565b87101561267957610141818154811061259b5761259b614856565b9060005260206000209060020201600101600161014183815481106125c2576125c2614856565b9060005260206000209060020201600101805490506125e191906147e4565b815481106125f1576125f1614856565b9060005260206000209060050201610141828154811061261357612613614856565b9060005260206000209060020201600101888154811061263557612635614856565b906000526020600020906005020160008201548160000155600182015481600101556002820154816002015560038201548160030155600482015481600401559050505b610141818154811061268d5761268d614856565b90600052602060002090600202016001018054806126ad576126ad614961565b6000828152602081206005600019909301928302018181556001810182905560028101829055600381018290556004015590556101418054829081106126f5576126f5614856565b60009182526020822060016002909202010154900361283857610141805461271f906001906147e4565b8154811061272f5761272f614856565b9060005260206000209060020201610141828154811061275157612751614856565b60009182526020909120825460029092020180546001600160a01b0319166001600160a01b0390921691909117815560018083018054612794928401919061417b565b509050506101418054806127aa576127aa614961565b60008281526020812060026000199093019283020180546001600160a01b0319168155906127db60018301826141f5565b505090553360009081526101426020819052604082208290556101418054849391908490811061280d5761280d614856565b600091825260208083206002909202909101546001600160a01b031683528201929092526040019020555b6128f1565b6000610141828154811061285357612853614856565b9060005260206000209060020201600101888154811061287557612875614856565b906000526020600020906005020190508681600001600082825461289991906147e4565b92505081905550828160010160008282546128b491906147e4565b92505081905550848160020160008282546128cf91906147e4565b92505081905550838160030160008282546128ea91906147e4565b9091555050505b5092959194509250565b60006129078242611fcb565b612913906127106147e4565b90506000612920306111be565b15612acb576000610145548661014654612939306111be565b61294391906147f7565b61294d919061486c565b6129579190614883565b905087811115612ac9576127108361296f8a846147e4565b612979919061486c565b6129839190614883565b915081156129fb5730600090815261010a6020526040812080548492906129ab9084906147e4565b909155505033600090815261010a6020526040812080548492906129d09084906147f7565b909155505060405182815233903090600080516020614bcb8339815191529060200160405180910390a35b612710831015612ac9576000612710612a1485826147e4565b612a1e8b856147e4565b612a28919061486c565b612a329190614883565b90508015612ac75730600090815261010a602052604081208054839290612a5a9084906147e4565b9091555050600080805261010a6020527f8684156705e0cb91ffe15d87ba1902d313d1419968887339e417608630e963348054839290612a9b9084906147f7565b90915550506040518181526000903090600080516020614bcb8339815191529060200160405180910390a35b505b505b6101ab546101ac546040516370a0823160e01b81526001600160a01b03918216600482015260009291909116906370a0823190602401602060405180830381865afa158015612b1e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612b429190614897565b15612d4157612710612b54848961486c565b612b5e9190614883565b90508015612c46576101ab546101ac546001600160a01b0391821691636c74dd519116336040516001600160e01b031960e085901b1681526001600160a01b03928316600482015291166024820152604481018490526064016020604051808303816000875af1158015612bd6573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612bfa919061480a565b612c465760405162461bcd60e51b815260206004820152601760248201527f4c3a2042534b52207472616e73666572206661696c65640000000000000000006044820152606401610824565b612710831015612d41576000612710612c5f85826147e4565b612c69908a61486c565b612c739190614883565b90508015612d3f576101ab546101ac54604051636c74dd5160e01b81526001600160a01b0391821660048201526000602482015260448101849052911690636c74dd51906064016020604051808303816000875af1158015612cd9573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612cfd919061480a565b612d3f5760405162461bcd60e51b8152602060048201526013602482015272130e881094d2d488189d5c9b8819985a5b1959606a1b6044820152606401610824565b505b876101466000828254612d5491906147e4565b92505081905550866101446000828254612d6e91906147e4565b92505081905550856101456000828254612d8891906147e4565b92505081905550846101436000828254612da291906147e4565b9091555050604080518981526020810189905280820188905260608101879052608081018690524260a0820152905133917f99e303fc09f735c25e5c4484adf9e39fe63be9940fe6bab97a10697bd6a34a73919081900360c00190a25050505050505050565b600161017955565b600054610100900460ff16612e375760405162461bcd60e51b815260040161082490614977565b610fb233612246565b600054610100900460ff16612e675760405162461bcd60e51b815260040161082490614977565b60c9805460ff19169055565b600054610100900460ff16612e9a5760405162461bcd60e51b815260040161082490614977565b60fb80546001600160a01b031916339081179091556040516000907f80f15e9dbc60884fdb59fb8ed4fc48a9a689e028f055e893ed45ca5be67c5c85908290a3565b600054610100900460ff16612f035760405162461bcd60e51b815260040161082490614977565b61010b612f11878983614a10565b5061010c612f20858783614a10565b5060fe80546001600160a01b038086166001600160a01b03199283161790925560ff805492851692909116919091179055612f5f610101826005614216565b50466103ad03612fa6576c0c9f2c9cd04674edea4000000061010e5560fd80546001600160a01b03191673b4a7633d8932de086c9264d5eb39a8399d7c0e3a17905561306a565b466103ae03612fec576c0c9f2c9cd04674edea4000000061010e5560fd80546001600160a01b03191673dae9dd3d1a52cfce9d5f2fac7fde164d500e50f717905561306a565b4662aa36a703613032576b033b2e3c9fd0803ce800000061010e5560fd80546001600160a01b0319167301a93b7153ee160f3176af0b0f31121df9f0ffa517905561306a565b6b033b2e3c9fd0803ce800000061010e5560fd80546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d1790555b60fd60009054906101000a90046001600160a01b03166001600160a01b031663c45a01556040518163ffffffff1660e01b8152600401602060405180830381865afa1580156130bd573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906130e191906147b1565b60fc80546001600160a01b0319166001600160a01b0392909216919091179055466103ad14806131125750466103ae145b156131b45760fd60009054906101000a90046001600160a01b03166001600160a01b031663ef8ef56f6040518163ffffffff1660e01b8152600401602060405180830381865afa15801561316a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061318e91906147b1565b61010080546001600160a01b0319166001600160a01b039290921691909117905561324d565b60fd60009054906101000a90046001600160a01b03166001600160a01b031663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa158015613207573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061322b91906147b1565b61010080546001600160a01b0319166001600160a01b03929092169190911790555b505033600090815261010860205260408082208054600160ff199182168117909255308452828420805482168317905560fd546001600160a01b0316845291909220805490911690911790555050505050565b600054610100900460ff166132c75760405162461bcd60e51b815260040161082490614977565b61014154600003610fb25761014180546001018155600052565b600054610100900460ff16612e085760405162461bcd60e51b815260040161082490614977565b600054610100900460ff1661332f5760405162461bcd60e51b815260040161082490614977565b600a6101ad5560056101ae556101ac80546001600160a01b0319166001600160a01b03831617905561010e5460011c8061010a6000336001600160a01b03908116825260208083019390935260409182016000908120949094556101ac548116845261010a90925280832084905560fc546101005491516364e329cb60e11b815230600482015291831660248301529091169063c9c65396906044016020604051808303816000875af11580156133ea573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061340e91906147b1565b905061341d8182600019611873565b6001600160a01b038116600090815261010760205260408120805460ff191660011790555b60058110156134a05760016101086000610101846005811061346657613466614856565b01546001600160a01b031681526020810191909152604001600020805460ff191691151591909117905561349981614948565b9050613442565b506040518281523390600090600080516020614bcb8339815191529060200160405180910390a36101ac546040518381526001600160a01b0390911690600090600080516020614bcb83398151915290602001611957565b60408051600280825260608201835260009283929190602083019080368337019050509050308160008151811061353157613531614856565b6001600160a01b0392831660209182029290920101526101ab5482519116908290600190811061356357613563614856565b6001600160a01b03928316602091820292909201015260fd546135899186911685611873565b6101ab546101ac546040516370a0823160e01b81526001600160a01b03918216600482015260009291909116906370a0823190602401602060405180830381865afa1580156135dc573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906136009190614897565b60fd546101ac549192506001600160a01b0390811691635c11d79591879160009187911661362f42600f6147f7565b6040518663ffffffff1660e01b815260040161364f959493929190614ad1565b600060405180830381600087803b15801561366957600080fd5b505af115801561367d573d6000803e3d6000fd5b50506101ab546101ac546040516370a0823160e01b81526001600160a01b039182166004820152859450911691506370a0823190602401602060405180830381865afa1580156136d1573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906136f59190614897565b61166691906147e4565b613707613c1f565b60c9805460ff191690557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa33612229565b61108061374d6033546001600160a01b031690565b8383600061384e565b600061376183613c68565b8061084c575061084c82613c68565b806001600160a01b03163b6000036137855750565b60fd546001600160a01b039081169082160361379e5750565b610100546001600160a01b03908116908216036137b85750565b6001600160a01b0381166000908152610107602052604090205460ff16610f7d5760006137e482613d49565b90506001600160a01b0381166137f8575050565b600061380383613d5c565b90506001600160a01b03811661381857505050565b6138258384600019611873565b50506001600160a01b038116600090815261010760205260409020805460ff1916600117905550565b6138566122f3565b61385e61426a565b8161386b578281526138d6565b6127106101ad548461387d919061486c565b6138879190614883565b60208201526101ae546127109061389e908561486c565b6138a89190614883565b604082018190526138ba90600261486c565b60208201516138c990856147e4565b6138d391906147e4565b81525b6001600160a01b038516600090815261010a6020526040812080548592906138ff9084906147e4565b909155505080516001600160a01b038516600090815261010a60205260408120805490919061392f9084906147f7565b9091555050602081015115613a3257602080820151600080805261010a9092527f8684156705e0cb91ffe15d87ba1902d313d1419968887339e417608630e963348054919290916139819084906147f7565b909155505060408082015160fe546001600160a01b0316600090815261010a6020529182208054919290916139b79084906147f7565b909155505060408082015160ff546001600160a01b0316600090815261010a6020529182208054919290916139ed9084906147f7565b909155505060208082015160408051828152928301919091527f0e992691453a607a3e534af8638548f72f22fc0eb79c112bdf5c20a3729117aa910160405180910390a15b80516040519081526001600160a01b038581169190871690600080516020614bcb8339815191529060200160405180910390a35050505050565b6101418054600190810180835560009283528291613a89916147e4565b9050826101418281548110613aa057613aa0614856565b6000918252602080832060029290920290910180546001600160a01b0319166001600160a01b0394851617905594909116815261014290935260409092208290555090565b6000613af2600283614842565b600003613b0b576b033b2e3c9fd0803ce8000000613b0d565b825b9050613b1a600283614883565b91505b811561078957613b2d8384613d6f565b9250613b3a600283614842565b15613b4c57613b498184613d6f565b90505b613b57600283614883565b9150613b1d565b6001600160a01b0381163b613bcb5760405162461bcd60e51b815260206004820152602d60248201527f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60448201526c1bdd08184818dbdb9d1c9858dd609a1b6064820152608401610824565b600080516020614b8483398151915280546001600160a01b0319166001600160a01b0392909216919091179055565b613c0383613da7565b600082511180613c105750805b1561179457611b488383613de7565b60c95460ff16610fb25760405162461bcd60e51b815260206004820152601460248201527314185d5cd8589b194e881b9bdd081c185d5cd95960621b6044820152606401610824565b60fd546000906001600160a01b0390811690831603613c8957506000919050565b610100546001600160a01b0390811690831603613ca857506000919050565b6001600160a01b0382166000908152610107602052604090205460ff1615613cd257506000919050565b6000613cdd83613d49565b90506001600160a01b038116613cf65750600092915050565b6000613d0184613d5c565b90506001600160a01b038116613d1b575060009392505050565b6000613d2685613ed2565b905062ffffff811615613d3e57506001949350505050565b506000949350505050565b600061078982630dfe168160e01b613ee5565b60006107898263d21220a760e01b613ee5565b60006b033b2e3c9fd0803ce8000000613d9d613d8b8585613fb5565b6b019d971e4fe8401e7400000061401c565b61084c9190614883565b613db081613b5e565b6040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b60606001600160a01b0383163b613e4f5760405162461bcd60e51b815260206004820152602660248201527f416464726573733a2064656c65676174652063616c6c20746f206e6f6e2d636f6044820152651b9d1c9858dd60d21b6064820152608401610824565b600080846001600160a01b031684604051613e6a9190614b42565b600060405180830381855af49150503d8060008114613ea5576040519150601f19603f3d011682016040523d82523d6000602084013e613eaa565b606091505b50915091506116668282604051806060016040528060278152602001614ba460279139614071565b60006107898263ddca3f4360e01b61408a565b60408051600481526024810182526020810180516001600160e01b03166001600160e01b031985161790529051600091829182916001600160a01b03871691613f2e9190614b42565b600060405180830381855afa9150503d8060008114613f69576040519150601f19603f3d011682016040523d82523d6000602084013e613f6e565b606091505b5091509150811580613f7f57508051155b15613f8f57600092505050610789565b8051602003613d3e5780806020019051810190613fac91906147b1565b92505050610789565b6000811580613fd957508282613fcb818361486c565b9250613fd79083614883565b145b6107895760405162461bcd60e51b815260206004820152601460248201527364732d6d6174682d6d756c2d6f766572666c6f7760601b6044820152606401610824565b60008261402983826147f7565b91508110156107895760405162461bcd60e51b815260206004820152601460248201527364732d6d6174682d6164642d6f766572666c6f7760601b6044820152606401610824565b6060831561408057508161084c565b61084c8383614151565b60408051600481526024810182526020810180516001600160e01b03166001600160e01b031985161790529051600091829182916001600160a01b038716916140d39190614b42565b600060405180830381855afa9150503d806000811461410e576040519150601f19603f3d011682016040523d82523d6000602084013e614113565b606091505b509150915081158061412457508051155b1561413457600092505050610789565b8051602003613d3e5780806020019051810190613fac9190614b5e565b8151156141615781518083602001fd5b8060405162461bcd60e51b815260040161082491906142f1565b8280548282559060005260206000209060050281019282156141e95760005260206000209160050282015b828111156141e9578254825560018084015490830155600280840154908301556003808401549083015560048084015490830155600592830192909101906141a6565b506111a2929150614288565b5080546000825560050290600052602060002090810190610f7d9190614288565b826005810192821561425e579160200282015b8281111561425e57825182546001600160a01b0319166001600160a01b03909116178255602090920191600190910190614229565b506111a29291506142b8565b60405180606001604052806003906020820280368337509192915050565b5b808211156111a25760008082556001820181905560028201819055600382018190556004820155600501614289565b5b808211156111a257600081556001016142b9565b60005b838110156142e85781810151838201526020016142d0565b50506000910152565b60208152600082518060208401526143108160408501602087016142cd565b601f01601f19169190910160400192915050565b6001600160a01b0381168114610f7d57600080fd5b6000806040838503121561434c57600080fd5b823561435781614324565b946020939093013593505050565b60006020828403121561437757600080fd5b5035919050565b60008060006060848603121561439357600080fd5b833561439e81614324565b925060208401356143ae81614324565b929592945050506040919091013590565b6000602082840312156143d157600080fd5b813561084c81614324565b602080825282518282018190526000919060409081850190868401855b8281101561443d5781518051855286810151878601528581015186860152606080820151908601526080908101519085015260a090930192908501906001016143f9565b5091979650505050505050565b634e487b7160e01b600052604160045260246000fd5b60405160a0810167ffffffffffffffff811182821017156144835761448361444a565b60405290565b604051601f8201601f1916810167ffffffffffffffff811182821017156144b2576144b261444a565b604052919050565b600080604083850312156144cd57600080fd5b82356144d881614324565b915060208381013567ffffffffffffffff808211156144f657600080fd5b818601915086601f83011261450a57600080fd5b81358181111561451c5761451c61444a565b61452e601f8201601f19168501614489565b9150808252878482850101111561454457600080fd5b80848401858401376000848284010152508093505050509250929050565b6000806040838503121561457557600080fd5b50508035926020909101359150565b60008083601f84011261459657600080fd5b50813567ffffffffffffffff8111156145ae57600080fd5b6020830191508360208285010111156145c657600080fd5b9250929050565b600080600080600080600080610140808a8c0312156145eb57600080fd5b893567ffffffffffffffff8082111561460357600080fd5b61460f8d838e01614584565b909b509950602091508b8201358181111561462957600080fd5b6146358e828f01614584565b909a509850505060408b013561464a81614324565b955060608b013561465a81614324565b945060808b013561466a81614324565b935060bf8b018c1361467b57600080fd5b614683614460565b918b0191808d84111561469557600080fd5b60a08d015b848110156146ba5780356146ad81614324565b835291830191830161469a565b50809450505050509295985092959890939650565b600080604083850312156146e257600080fd5b82356146ed81614324565b915060208301356146fd81614324565b809150509250929050565b6000806020838503121561471b57600080fd5b823567ffffffffffffffff8082111561473357600080fd5b818501915085601f83011261474757600080fd5b81358181111561475657600080fd5b8660208260061b850101111561476b57600080fd5b60209290920196919550909350505050565b600181811c9082168061479157607f821691505b602082108103610c5857634e487b7160e01b600052602260045260246000fd5b6000602082840312156147c357600080fd5b815161084c81614324565b634e487b7160e01b600052601160045260246000fd5b81810381811115610789576107896147ce565b80820180821115610789576107896147ce565b60006020828403121561481c57600080fd5b8151801515811461084c57600080fd5b634e487b7160e01b600052601260045260246000fd5b6000826148515761485161482c565b500690565b634e487b7160e01b600052603260045260246000fd5b8082028115828204841417610789576107896147ce565b6000826148925761489261482c565b500490565b6000602082840312156148a957600080fd5b5051919050565b6020808252602c908201527f46756e6374696f6e206d7573742062652063616c6c6564207468726f7567682060408201526b19195b1959d85d1958d85b1b60a21b606082015260800190565b6020808252602c908201527f46756e6374696f6e206d7573742062652063616c6c6564207468726f7567682060408201526b6163746976652070726f787960a01b606082015260800190565b60006001820161495a5761495a6147ce565b5060010190565b634e487b7160e01b600052603160045260246000fd5b6020808252602b908201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960408201526a6e697469616c697a696e6760a81b606082015260800190565b601f82111561179457600081815260208120601f850160051c810160208610156149e95750805b601f850160051c820191505b81811015614a08578281556001016149f5565b505050505050565b67ffffffffffffffff831115614a2857614a2861444a565b614a3c83614a36835461477d565b836149c2565b6000601f841160018114614a705760008515614a585750838201355b600019600387901b1c1916600186901b178355614aca565b600083815260209020601f19861690835b82811015614aa15786850135825560209485019460019092019101614a81565b5086821015614abe5760001960f88860031b161c19848701351681555b505060018560011b0183555b5050505050565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015614b215784516001600160a01b031683529383019391830191600101614afc565b50506001600160a01b03969096166060850152505050608001529392505050565b60008251614b548184602087016142cd565b9190910192915050565b600060208284031215614b7057600080fd5b815162ffffff8116811461084c57600080fdfe360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564ddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3efa2646970667358221220c83cc6ee218159a0e26b2e0611aae7a52a0c10debece902b54430303ae7769df64736f6c63430008130033