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_V2
- Optimization enabled
- true
- Compiler version
- v0.8.19+commit.7dd6d404
- Optimization runs
- 200
- Verified at
- 2023-04-25T16:00:23.942508Z
contracts/LBSKR_V2.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_V2.sol";
import "./imports/IBSKR.sol";
import "./imports/Stakable.sol";
import "./lib/DSMath.sol";
import "./oz_upgradable/security/ReentrancyGuardUpgradeable.sol";
contract LBSKR_V2 is BaseBSKR_V2, 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 Reinitializes LBSKR contract with new implementation version
* @param version Implementation version
* @param nameA Token name
* @param symbolA Token symbol
* @param growth1AddressA Growth address 1
* @param growth2AddressA Growth address 2
* @param inflationAddressA Inflation vault address
* @param sisterOAsA Sister OA addresses
*/
function __LBSKR_V2_init(
uint8 version,
string calldata nameA,
string calldata symbolA,
address growth1AddressA,
address growth2AddressA,
address inflationAddressA,
address[5] memory sisterOAsA
) external reinitializer(version) {
// __Ownable_init_unchained();
// __Pausable_init_unchained();
// __Manageable_init_unchained();
// __BaseBSKR_V2_init_unchained(
// nameA,
// symbolA,
// growth1AddressA,
// growth2AddressA,
// sisterOAsA
// );
// __Stakable_init_unchained();
// __ReentrancyGuard_init_unchained();
// __LBSKR_V2_init_unchained(inflationAddressA);
}
function __LBSKR_V2_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
*/
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 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_V2.sol
/*
* SPDX-License-Identifier: MIT
*/
pragma solidity ^0.8.19;
import "../lib/Utils.sol";
import "../oz_upgradable/access/OwnableUpgradeable.sol";
import "../oz_upgradable/proxy/utils/UUPSUpgradeable.sol";
import "../oz_upgradable/security/PausableUpgradeable.sol";
import "../oz_upgradable/token/ERC20/IERC20Upgradeable.sol";
import "../uniswap/v2-core/interfaces/IUniswapV2Factory.sol";
import "../uniswap/v2-core/interfaces/IUniswapV2Pair.sol";
import "../uniswap/v2-periphery/interfaces/IUniswapV2Router02.sol";
import "../uniswap/v3-core/interfaces/IUniswapV3Factory.sol";
import "../uniswap/v3-core/interfaces/IUniswapV3Pool.sol";
import "./Manageable.sol";
abstract contract BaseBSKR_V2 is
Utils,
OwnableUpgradeable,
UUPSUpgradeable,
PausableUpgradeable,
IERC20Upgradeable,
Manageable
{
struct Airdrop {
address user;
uint256 amount;
}
IUniswapV2Factory internal _dexFactoryV2;
IUniswapV2Router02 internal _dexRouterV2;
address internal _growth1Address;
address internal _growth2Address;
// address internal _nftStakingContract;
address internal wethAddr;
address[5] internal _sisterOAs;
bool internal isV3Enabled;
mapping(address => bool) internal _isAMMPair;
mapping(address => bool) internal _paysNoFee;
mapping(address => mapping(address => uint256)) private _allowances;
mapping(address => uint256) internal _balances;
string private _name;
string private _symbol;
uint256 internal _oaIndex; // 5 bits
uint256 internal _totalSupply; // 1 billion for Goerli and 1 trillion (0xC9F2C9CD04674EDEA40000000) for PulseChain - 40 bits
uint256 internal constant _BIPS = 10000; // bips or basis point divisor - 14 bits
uint256 private constant _DECIMALS = 18; // 5 bits
function __BaseBSKR_V2_init(
uint8 version,
string calldata, // nameA,
string calldata, // symbolA,
address, // growth1AddressA,
address, // growth2AddressA,
address[5] memory // sisterOAsA
) internal reinitializer(version) {
// __Ownable_init_unchained();
// __Pausable_init_unchained();
// __Manageable_init_unchained();
// __BaseBSKR_V2_init_unchained(
// nameA,
// symbolA,
// growth1AddressA,
// growth2AddressA,
// sisterOAsA
// );
}
function __BaseBSKR_V2_init_unchained(
string calldata nameA,
string calldata symbolA,
address growth1AddressA,
address growth2AddressA,
address[5] memory sisterOAsA
) internal onlyInitializing {
_name = nameA;
_symbol = symbolA;
_growth1Address = growth1AddressA;
_growth2Address = growth2AddressA;
_sisterOAs = sisterOAsA;
// if (block.chainid == 941 || block.chainid == 942) {
// PLS Testnet V2B
_totalSupply = 1_000_000_000_000_000_000_000_000_000_000;
_dexRouterV2 = IUniswapV2Router02(
0xb242aA8A863CfcE9fcBa2b9a6B00b4cd62343f27
);
// } else if (block.chainid == 11155111) {
// // Sepolia
// _totalSupply = 1_000_000_000_000_000_000_000_000_000;
// _dexRouterV2 = IUniswapV2Router02(
// 0x01a93b7153Ee160F3176af0B0F31121DF9f0FFA5
// );
// } else {
// // 1, 5, 31337
// _totalSupply = 1_000_000_000_000_000_000_000_000_000;
// _dexRouterV2 = IUniswapV2Router02(
// 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D
// );
// }
_dexFactoryV2 = IUniswapV2Factory(_dexRouterV2.factory());
// if (block.chainid == 941 || block.chainid == 942) {
wethAddr = _dexRouterV2.WPLS();
// } else {
// wethAddr = _dexRouterV2.WETH();
// }
_paysNoFee[_msgSender()] = true;
_paysNoFee[address(this)] = true;
_paysNoFee[address(_dexRouterV2)] = true; // may not be needed
}
//to recieve ETH from _dexRouterV2 when swaping
receive() external payable {}
fallback() external payable {}
function __v3PairInvolved(address target) internal view returns (bool) {
if (target == address(_dexRouterV2)) return false; // to avoid orange reverts
// if (target == address(_nftStakingContract)) return false; // to avoid orange reverts
if (target == wethAddr) return false; // to avoid orange reverts
if (_isAMMPair[target]) {
return false; // if V3 is disabled, only V2 pairs are registered
}
address token0 = _getToken0(target);
if (token0 == address(0)) {
return false;
}
address token1 = _getToken1(target);
if (token1 == address(0)) {
return false;
}
uint24 fee = _getFee(target);
if (fee != 0) {
return true;
}
return false;
}
function _airdropTokens(address to, uint256 amount) internal virtual;
/**
* @notice Sets `amount` as the allowance of `spender` over the `owner` s tokens.
*
* This internal function is equivalent to `approve`, and can be used to
* e.g. set automatic allowances for certain subsystems, etc.
*
* Emits an {Approval} event.
*
* Requirements:
*
* - `owner` cannot be the zero address.
* - `spender` cannot be the zero address.
*/
function _approve(address owner, address spender, uint256 amount) internal {
require(owner != address(0), "BB: From 0 addr");
require(spender != address(0), "BB: To 0 addr");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _authorizeUpgrade(address) internal override onlyOwner {}
function _checkIfAMMPair(address target) internal {
if (target.code.length == 0) return;
if (target == address(_dexRouterV2)) return; // to avoid orange reverts
// if (target == address(_nftStakingContract)) return; // to avoid orange reverts
if (target == wethAddr) return; // to avoid orange reverts
if (!_isAMMPair[target]) {
address token0 = _getToken0(target);
if (token0 == address(0)) {
return;
}
address token1 = _getToken1(target);
if (token1 == address(0)) {
return;
}
_approve(target, target, type(uint256).max);
_isAMMPair[target] = true;
}
}
function _getOriginAddress() internal returns (address) {
if (_oaIndex < (_sisterOAs.length - 1)) {
_oaIndex = _oaIndex + 1;
} else {
_oaIndex = 0;
}
return _sisterOAs[_oaIndex];
}
function _transfer(
address owner,
address to,
uint256 amount
) internal virtual;
/**
* Airdrop BSKR to sacrificers, deducted from owner's wallet
*/
function airdrop(Airdrop[] calldata receivers) external onlyOwner {
for (uint256 index; index < receivers.length; ++index) {
if (
receivers[index].user != address(0) &&
receivers[index].amount != 0
) {
_airdropTokens(receivers[index].user, receivers[index].amount);
}
}
}
/**
* @notice Get allowance for a spender to spend owner's tokens
* @param owner owner address
* @param spender spender address
* @return uint256 allowance value
*/
function allowance(
address owner,
address spender
) public view override returns (uint256) {
return _allowances[owner][spender];
}
/**
* @notice Sets allowance for spender to use msgsender's tokens
*
* NOTE: If `amount` is the maximum `uint256`, the allowance is not updated on
* `transferFrom`. This is semantically equivalent to an infinite approval.
*
* Requirements:
*
* - `spender` cannot be the zero address.
*/
function approve(
address spender,
uint256 amount
) external override returns (bool) {
address owner = _msgSender();
_approve(owner, spender, amount);
return true;
}
/**
* @notice Returns the number of decimals used to get its user representation.
* For example, if `decimals` equals `2`, a balance of `505` tokens should
* be displayed to a user as `5.05` (`505 / 10 ** 2`).
*/
function decimals() external pure returns (uint256) {
return _DECIMALS;
}
/**
* @notice Atomically decreases the allowance granted to `spender` by the caller.
*
* This is an alternative to {approve} that can be used as a mitigation for
* problems described in {IERC20-approve}.
*
* Emits an {Approval} event indicating the updated allowance.
*
* Requirements:
*
* - `spender` cannot be the zero address.
* - `spender` must have allowance for the caller of at least
* `subtractedValue`.
*/
function decreaseAllowance(
address spender,
uint256 subtractedValue
) external returns (bool) {
address owner = _msgSender();
uint256 currentAllowance = allowance(owner, spender);
require(currentAllowance >= subtractedValue, "BSKR: Decreases below 0");
unchecked {
_approve(owner, spender, currentAllowance - subtractedValue);
}
return true;
}
/**
* @notice Disables UniswapV3
*/
function disableUniswapV3() external onlyManager {
isV3Enabled = false;
}
/**
* @notice Enables UniswapV3
*/
function enableUniswapV3() external onlyManager {
isV3Enabled = true;
}
/**
* @notice Atomically increases the allowance granted to `spender` by the caller.
*
* This is an alternative to {approve} that can be used as a mitigation for
* problems described in {IERC20-approve}.
*
* Emits an {Approval} event indicating the updated allowance.
*
* Requirements:
*
* - `spender` cannot be the zero address.
*/
function increaseAllowance(
address spender,
uint256 addedValue
) external returns (bool) {
address owner = _msgSender();
_approve(owner, spender, allowance(owner, spender) + addedValue);
return true;
}
/**
* @notice Returns the name of the token.
*/
function name() external view returns (string memory) {
return _name;
}
/**
* @notice Pauses this contract features
*/
function pauseContract() external onlyManager {
_pause();
}
// /*
// * @notice Sets the BSKR contract address
// */
// function setNFTStakingContract(address newNFTStkCntrct) external onlyOwner {
// _nftStakingContract = newNFTStkCntrct;
// }
/**
* @notice Returns the symbol of the token
*/
function symbol() external view returns (string memory) {
return _symbol;
}
/**
* @notice Returns the amount of tokens in existence.
*/
function totalSupply() external view override returns (uint256) {
return _totalSupply;
}
/**
* @notice See {IERC20-transfer}. TODO add description
*
* Requirements:
*
* - `to` cannot be the zero address.
* - the caller must have a balance of at least `amount`.
*/
function transfer(
address to,
uint256 amount
) external override returns (bool) {
address owner = _msgSender();
_transfer(owner, to, amount);
return true;
}
/**
* @notice Transfers tokens 'from' to 'to' address provided there is enough allowance
*
* Emits an {Approval} event indicating the updated allowance. This is not
* required by the EIP. See the note at the beginning of {ERC20}.
*
* NOTE: Does not update the allowance if the current allowance
* is the maximum `uint256`.
*
* Requirements:
*
* - `from` and `to` cannot be the zero address.
* - `from` must have a balance of at least `amount`.
* - the caller must have allowance for ``from``'s tokens of at least
* `amount`.
*/
function transferFrom(
address from,
address to,
uint256 amount
) external override returns (bool) {
address spender = _msgSender();
uint256 currentAllowance = allowance(from, spender);
if (currentAllowance != type(uint256).max) {
require(currentAllowance >= amount, "BB: Insufficient allowance");
unchecked {
_approve(from, spender, currentAllowance - amount);
}
}
_transfer(from, to, amount);
return true;
}
/**
* @notice Unpauses the contract's features
*/
function unPauseContract() external onlyManager {
_unpause();
}
// to rename with _ prefix
function v3PairInvolved(
address from,
address to
) internal view returns (bool) {
return (__v3PairInvolved(from) || __v3PairInvolved(to));
}
/**
* @notice This empty reserved space is put in place to allow future versions to add new
* variables without shifting down storage in the inheritance chain.
* See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps
*/
uint256[50] private __gap;
}
contracts/imports/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_V2_init","inputs":[{"type":"uint8","name":"version","internalType":"uint8"},{"type":"string","name":"nameA","internalType":"string"},{"type":"string","name":"symbolA","internalType":"string"},{"type":"address","name":"growth1AddressA","internalType":"address"},{"type":"address","name":"growth2AddressA","internalType":"address"},{"type":"address","name":"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_V2.Airdrop[]","components":[{"type":"address","name":"user","internalType":"address"},{"type":"uint256","name":"amount","internalType":"uint256"}]}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"allowance","inputs":[{"type":"address","name":"owner","internalType":"address"},{"type":"address","name":"spender","internalType":"address"}]},{"type":"function","stateMutability":"nonpayable","outputs":[{"type":"bool","name":"","internalType":"bool"}],"name":"approve","inputs":[{"type":"address","name":"spender","internalType":"address"},{"type":"uint256","name":"amount","internalType":"uint256"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"balanceOf","inputs":[{"type":"address","name":"wallet","internalType":"address"}]},{"type":"function","stateMutability":"pure","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"decimals","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[{"type":"bool","name":"","internalType":"bool"}],"name":"decreaseAllowance","inputs":[{"type":"address","name":"spender","internalType":"address"},{"type":"uint256","name":"subtractedValue","internalType":"uint256"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"disableUniswapV3","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"enableUniswapV3","inputs":[]},{"type":"function","stateMutability":"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
0x60a06040523060805234801561001457600080fd5b5060805161432661004c60003960008181610eab01528181610eeb01528181610fbe01528181610ffe015261109101526143266000f3fe6080604052600436106102275760003560e01c806370a0823111610122578063a694fc3a116100a5578063d5f954241161006c578063d5f954241461064d578063dd62ed3e14610662578063e0c9ffc614610682578063e4edf852146106a2578063f2fde38b146106c257005b8063a694fc3a146105b8578063a9059cbb146105d8578063bac15203146105f8578063c1acbaf21461060d578063c93808e41461062d57005b80638da5cb5b116100e95780638da5cb5b1461052657806395d89b41146105445780639e2c8a5b146105595780639e99f53714610579578063a457c2d71461059857005b806370a08231146104ac578063715018a6146104cc5780637c72e7c6146104e157806387978fd1146104f85780638b71d6091461050f57005b80633659cfe6116101aa57806352d1902d1161017157806352d1902d146104405780635c975abb14610455578063664f73311461046d57806368c33627146104825780636fc436631461049757005b80633659cfe6146103ba57806339509351146103da578063439766ce146103fa578063481c6a751461040f5780634f1ef2861461042d57005b806323b872dd116101ee57806323b872dd146102fe5780632b3323411461031e578063313ce5671461033e57806333b69c4c1461035257806335941b1c1461037f57005b806306fdde0314610230578063095ea7b31461025b5780630f9f534c1461028b57806318160ddd146102b05780631d6b8b72146102c657005b3661022e57005b005b34801561023c57600080fd5b506102456106e2565b6040516102529190613b48565b60405180910390f35b34801561026757600080fd5b5061027b610276366004613ba0565b610775565b6040519015158152602001610252565b34801561029757600080fd5b506102a26101445481565b604051908152602001610252565b3480156102bc57600080fd5b5061010e546102a2565b3480156102d257600080fd5b506102e66102e1366004613bcc565b61078f565b6040516001600160a01b039091168152602001610252565b34801561030a57600080fd5b5061027b610319366004613be5565b6107bf565b34801561032a57600080fd5b5061022e610339366004613c26565b610853565b34801561034a57600080fd5b5060126102a2565b34801561035e57600080fd5b5061037261036d366004613c26565b610b80565b6040516102529190613c43565b34801561038b57600080fd5b5061039f61039a366004613ba0565b610c5e565b60408051938452602084019290925290820152606001610252565b3480156103c657600080fd5b5061022e6103d5366004613c26565b610ea1565b3480156103e657600080fd5b5061027b6103f5366004613ba0565b610f80565b34801561040657600080fd5b5061022e610fa2565b34801561041b57600080fd5b5060fb546001600160a01b03166102e6565b61022e61043b366004613cf8565b610fb4565b34801561044c57600080fd5b506102a2611084565b34801561046157600080fd5b5060c95460ff1661027b565b34801561047957600080fd5b5061022e611137565b34801561048e57600080fd5b506102a261114f565b3480156104a357600080fd5b506102a26111a6565b3480156104b857600080fd5b506102a26104c7366004613c26565b6111be565b3480156104d857600080fd5b5061022e6111da565b3480156104ed57600080fd5b506102a26101455481565b34801561050457600080fd5b506102a26101465481565b34801561051b57600080fd5b506102a26101435481565b34801561053257600080fd5b506033546001600160a01b03166102e6565b34801561055057600080fd5b506102456111ec565b34801561056557600080fd5b5061022e610574366004613da0565b6111fc565b34801561058557600080fd5b506101ab546001600160a01b03166102e6565b3480156105a457600080fd5b5061027b6105b3366004613ba0565b61124c565b3480156105c457600080fd5b5061022e6105d3366004613bcc565b6112c4565b3480156105e457600080fd5b5061027b6105f3366004613ba0565b6114c2565b34801561060457600080fd5b5061022e6114d0565b34801561061957600080fd5b506102a2610628366004613ba0565b6114e0565b34801561063957600080fd5b5061022e610648366004613e82565b61151e565b34801561065957600080fd5b5061022e6115fd565b34801561066e57600080fd5b506102a261067d366004613f4f565b611612565b34801561068e57600080fd5b5061022e61069d366004613f88565b61163e565b3480156106ae57600080fd5b5061022e6106bd366004613c26565b611714565b3480156106ce57600080fd5b5061022e6106dd366004613c26565b611778565b606061010b80546106f290613ffd565b80601f016020809104026020016040519081016040528092919081815260200182805461071e90613ffd565b801561076b5780601f106107405761010080835404028352916020019161076b565b820191906000526020600020905b81548152906001019060200180831161074e57829003601f168201915b5050505050905090565b6000336107838185856117ee565b60019150505b92915050565b61014181815481106107a057600080fd5b60009182526020909120600290910201546001600160a01b0316905081565b600033816107cd8683611612565b9050600019811461083a578381101561082d5760405162461bcd60e51b815260206004820152601a60248201527f42423a20496e73756666696369656e7420616c6c6f77616e636500000000000060448201526064015b60405180910390fd5b61083a86838684036117ee565b6108458686866118de565b6001925050505b9392505050565b61085b611ac8565b6101ac54600160a01b900460ff16156108ad5760405162461bcd60e51b8152602060048201526014602482015273130e88125b9a5d1a585b081c985d1a5bc81cd95d60621b6044820152606401610824565b610145541580156108c457506108c2306111be565b155b6109065760405162461bcd60e51b81526020600482015260136024820152724c3a204e6f6e2d7a65726f2062616c616e636560681b6044820152606401610824565b6101ab80546001600160a01b0319166001600160a01b0383811691821790925560fc5460405163e6a4390560e01b81523060048201526024810192909252600092169063e6a4390590604401602060405180830381865afa15801561096f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109939190614031565b90506001600160a01b038116610a1c5760fc546040516364e329cb60e11b81523060048201526001600160a01b0384811660248301529091169063c9c65396906044016020604051808303816000875af11580156109f5573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a199190614031565b90505b6001600160a01b03811615610a5d57610a3881826000196117ee565b6001600160a01b038116600090815261010760205260409020805460ff191660011790555b33600090815261010a602052604081208054670de0b6b3a764000092839291610a87908490614064565b909155505030600090815261010a602052604081208054839290610aac908490614077565b90915550506101ab546001600160a01b0316636c74dd51336101ac5460405160e084901b6001600160e01b03191681526001600160a01b03928316600482015291166024820152604481018490526064016020604051808303816000875af1158015610b1c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b40919061408a565b50610b4d81828384611b22565b6101ac805460ff60a01b1916600160a01b179055610b6d610e10426140c2565b610b779042614064565b6101af55505050565b6001600160a01b038116600090815261014260205260409020546060908015610c58576101418181548110610bb757610bb76140d6565b9060005260206000209060020201600101805480602002602001604051908101604052809291908181526020016000905b82821015610c4c57838290600052602060002090600502016040518060a00160405290816000820154815260200160018201548152602001600282015481526020016003820154815260200160048201548152505081526020019060010190610be8565b50505050915050919050565b50919050565b6000806000806101af54600014610c7b57610c7842611d2a565b90505b6001600160a01b0386166000908152610142602052604081205490610ca08288611e13565b9050610cb0816080015142611f45565b610cbc90612710614064565b935082610cc8306111be565b610cd29190614077565b15610d4f5760006101455482604001516101465486610cf0306111be565b610cfa9190614077565b610d049190614077565b610d0e91906140ec565b610d189190614103565b8251909150811115610d4d578151612710908690610d369084614064565b610d4091906140ec565b610d4a9190614103565b96505b505b6101ab546101ac546040516370a0823160e01b81526001600160a01b0391821660048201529116906370a0823190602401602060405180830381865afa158015610d9d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610dc19190614117565b15610e97576101435460608201516101ab546101ac546040516370a0823160e01b81526001600160a01b039182166004820152600094939291909116906370a0823190602401602060405180830381865afa158015610e24573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e489190614117565b610e5291906140ec565b610e5c9190614103565b90508160200151811115610e955761271085836020015183610e7e9190614064565b610e8891906140ec565b610e929190614103565b95505b505b5050509250925092565b6001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000163003610ee95760405162461bcd60e51b815260040161082490614130565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316610f326000805160206142aa833981519152546001600160a01b031690565b6001600160a01b031614610f585760405162461bcd60e51b81526004016108249061417c565b610f6181611fa1565b60408051600080825260208201909252610f7d91839190611fa9565b50565b600033610783818585610f938383611612565b610f9d9190614077565b6117ee565b610faa612114565b610fb2612166565b565b6001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000163003610ffc5760405162461bcd60e51b815260040161082490614130565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03166110456000805160206142aa833981519152546001600160a01b031690565b6001600160a01b03161461106b5760405162461bcd60e51b81526004016108249061417c565b61107482611fa1565b61108082826001611fa9565b5050565b6000306001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016146111245760405162461bcd60e51b815260206004820152603860248201527f555550535570677261646561626c653a206d757374206e6f742062652063616c60448201527f6c6564207468726f7567682064656c656761746563616c6c00000000000000006064820152608401610824565b506000805160206142aa83398151915290565b61113f612114565b610106805460ff19166001179055565b6000805b610141548110156111a2576101418181548110611172576111726140d6565b60009182526020909120600160029092020101546111909083614077565b915061119b816141c8565b9050611153565b5090565b610141546000906111b990600190614064565b905090565b6001600160a01b0316600090815261010a602052604090205490565b6111e2611ac8565b610fb260006121c0565b606061010c80546106f290613ffd565b611204612212565b61120c61226d565b6112146122b3565b600080600080611224858761234b565b935093509350935061123d868285858860800151612875565b50505050611080600161017955565b6000338161125a8286611612565b9050838110156112ac5760405162461bcd60e51b815260206004820152601760248201527f42534b523a204465637265617365732062656c6f7720300000000000000000006044820152606401610824565b6112b982868684036117ee565b506001949350505050565b6112cc61226d565b6112d4612212565b806000036113245760405162461bcd60e51b815260206004820152601760248201527f4c3a2043616e6e6f74207374616b65206e6f7468696e670000000000000000006044820152606401610824565b33600090815261010a602052604090205481111561137a5760405162461bcd60e51b81526020600482015260136024820152724c3a20546f6f206d756368207374616b696e6760681b6044820152606401610824565b6113826122b3565b600061138d306111be565b6101465461139b9190614077565b610145546113a990846140ec565b6113b39190614103565b33600090815261010a60205260408120805492935084929091906113d8908490614064565b909155505030600090815261010a6020526040812080548492906113fd908490614077565b90915550506101ab546101ac546040516370a0823160e01b81526001600160a01b03918216600482015260009291909116906370a0823190602401602060405180830381865afa158015611455573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906114799190614117565b905060006114873085612da6565b9050600082610143548361149b91906140ec565b6114a59190614103565b90506114b385838684611b22565b50505050610f7d600161017955565b6000336107838185856118de565b6114d8612114565b610fb2612fad565b6001600160a01b03821660009081526101426020526040812054816115058285611e13565b9050611515816080015142611f45565b95945050505050565b6000548990610100900460ff1615801561153f575060005460ff8083169116105b6115a25760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b6064820152608401610824565b6000805461ffff191660ff83169081176101001761ff0019169091556040519081527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a150505050505050505050565b611605612114565b610106805460ff19169055565b6001600160a01b0391821660009081526101096020908152604080832093909416825291909152205490565b611646611ac8565b60005b8181101561170f576000838383818110611665576116656140d6565b61167b9260206040909202019081019150613c26565b6001600160a01b0316141580156116ae575082828281811061169f5761169f6140d6565b90506040020160200135600014155b156116ff576116ff8383838181106116c8576116c86140d6565b6116de9260206040909202019081019150613c26565b8484848181106116f0576116f06140d6565b90506040020160200135612fe6565b611708816141c8565b9050611649565b505050565b61171c612114565b60fb546040516001600160a01b038084169216907f80f15e9dbc60884fdb59fb8ed4fc48a9a689e028f055e893ed45ca5be67c5c8590600090a360fb80546001600160a01b0319166001600160a01b0392909216919091179055565b611780611ac8565b6001600160a01b0381166117e55760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610824565b610f7d816121c0565b6001600160a01b0383166118365760405162461bcd60e51b815260206004820152600f60248201526e21211d10233937b690181030b2323960891b6044820152606401610824565b6001600160a01b03821661187c5760405162461bcd60e51b815260206004820152600d60248201526c21211d102a3790181030b2323960991b6044820152606401610824565b6001600160a01b038381166000818152610109602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b0383166119255760405162461bcd60e51b815260206004820152600e60248201526d261d10233937b690181030b2323960911b6044820152606401610824565b6001600160a01b03821661196a5760405162461bcd60e51b815260206004820152600c60248201526b261d102a3790181030b2323960a11b6044820152606401610824565b806000036119a85760405162461bcd60e51b815260206004820152600b60248201526a130e880c08185b5bdd5b9d60aa1b6044820152606401610824565b6101065460ff16611a0a576119bd8383613004565b15611a0a5760405162461bcd60e51b815260206004820152601b60248201527f4c3a20556e69737761705633206e6f7420737570706f727465642100000000006044820152606401610824565b611a138361301e565b611a1c8261301e565b6001600160a01b0383166000908152610108602052604090205460019060ff1680611a6057506001600160a01b0383166000908152610108602052604090205460ff165b15611a69575060005b6001600160a01b0384166000908152610107602052604090205460ff16158015611aad57506001600160a01b0383166000908152610107602052604090205460ff16155b15611ab6575060005b611ac2848484846130fc565b50505050565b6033546001600160a01b03163314610fb25760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610824565b83600003611b725760405162461bcd60e51b815260206004820152601760248201527f533a2043616e6e6f74207374616b65206e6f7468696e670000000000000000006044820152606401610824565b3360009081526101426020526040812054904290829003611b9957611b963361332c565b91505b6101418281548110611bad57611bad6140d6565b600091825260208083206040805160a0810182528b81528084018b81529181018a8152606082018a81526080830189815260016002988902909601860180548088018255908a52968920935160059097029093019586559251938501939093559151938301939093559151600382015590516004909101556101468054889290611c38908490614077565b92505081905550846101446000828254611c529190614077565b92505081905550836101456000828254611c6c9190614077565b92505081905550826101436000828254611c869190614077565b909155503390506001600160a01b03167fc16be9a586414a157dd46b4d023aa9997a025dd1cbbaa67ac0c1b8273a5eaf558787878760016101418981548110611cd157611cd16140d6565b906000526020600020906002020160010180549050611cf09190614064565b604080519586526020860194909452928401919091526060830152608082015260a0810184905260c00160405180910390a2505050505050565b60006101af54600003611d7f5760405162461bcd60e51b815260206004820152601960248201527f4c3a20496e666c6174696f6e206e6f74207374617274656421000000000000006044820152606401610824565b6000610e106101af5484611d939190614064565b611d9d9190614103565b6101ac546001600160a01b0316600090815261010a60205260409020549091508115611e0c576000611ddb6b033b2c8af183120df3000000846133a5565b90506b033b2e3c9fd0803ce8000000611df482846140ec565b611dfe9190614103565b611e089083614064565b9350505b5050919050565b611e456040518060a0016040528060008152602001600081526020016000815260200160008152602001600081525090565b6101418381548110611e5957611e596140d6565b9060005260206000209060020201600101805490508210611ebc5760405162461bcd60e51b815260206004820152601960248201527f533a205374616b6520696e64657820696e636f727265637421000000000000006044820152606401610824565b6101418381548110611ed057611ed06140d6565b90600052602060002090600202016001018281548110611ef257611ef26140d6565b90600052602060002090600502016040518060a001604052908160008201548152602001600182015481526020016002820154815260200160038201548152602001600482015481525050905092915050565b600081611f56846301dfe200614077565b11156107895760006224ea00611f6c8585614064565b611f769190614103565b9050600d811015611f9a57611f8c81600d614064565b611f979060646140ec565b91505b5092915050565b610f7d611ac8565b7f4910fdfa16fed3260ed0e7147f7cc6da11a60208b5b9406d12a635614ffd91435460ff1615611fdc5761170f8361341e565b826001600160a01b03166352d1902d6040518163ffffffff1660e01b8152600401602060405180830381865afa925050508015612036575060408051601f3d908101601f1916820190925261203391810190614117565b60015b6120995760405162461bcd60e51b815260206004820152602e60248201527f45524331393637557067726164653a206e657720696d706c656d656e7461746960448201526d6f6e206973206e6f74205555505360901b6064820152608401610824565b6000805160206142aa83398151915281146121085760405162461bcd60e51b815260206004820152602960248201527f45524331393637557067726164653a20756e737570706f727465642070726f786044820152681a58589b195555525160ba1b6064820152608401610824565b5061170f8383836134ba565b60fb546001600160a01b03163314610fb25760405162461bcd60e51b8152602060048201526015602482015274269d1021b0b63632b9103737ba1036b0b730b3b2b960591b6044820152606401610824565b61216e61226d565b60c9805460ff191660011790557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a2586121a33390565b6040516001600160a01b03909116815260200160405180910390a1565b603380546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b600261017954036122655760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606401610824565b600261017955565b60c95460ff1615610fb25760405162461bcd60e51b815260206004820152601060248201526f14185d5cd8589b194e881c185d5cd95960821b6044820152606401610824565b60006122c1610e10426140c2565b6122cb9042614064565b90506101af54811115610f7d5760006122e382611d2a565b90508015611080576101af8290556101ac546001600160a01b0316600090815261010a60205260408120805483929061231d908490614064565b909155505030600090815261010a602052604081208054839290612342908490614077565b90915550505050565b61237d6040518060a0016040528060008152602001600081526020016000815260200160008152602001600081525090565b33600090815261014260205260408120548190819061239c8188611e13565b94508060011415806123ad57508615155b6123f95760405162461bcd60e51b815260206004820181905260248201527f533a2043616e6e6f742072656d6f766520746865206669727374207374616b656044820152606401610824565b845186111561245f5760405162461bcd60e51b815260206004820152602c60248201527f533a2043616e6e6f74207769746864726177206d6f7265207468616e20796f7560448201526b081a185d99481cdd185ad95960a21b6064820152608401610824565b8451604086015161247090886140ec565b61247a9190614103565b855160208701519195509061248f90886140ec565b6124999190614103565b85516060870151919350906124ae90886140ec565b6124b89190614103565b9250858560000151036127b757600161014182815481106124db576124db6140d6565b9060005260206000209060020201600101805490506124fa9190614064565b8710156125f3576101418181548110612515576125156140d6565b90600052602060002090600202016001016001610141838154811061253c5761253c6140d6565b90600052602060002090600202016001018054905061255b9190614064565b8154811061256b5761256b6140d6565b9060005260206000209060050201610141828154811061258d5761258d6140d6565b906000526020600020906002020160010188815481106125af576125af6140d6565b906000526020600020906005020160008201548160000155600182015481600101556002820154816002015560038201548160030155600482015481600401559050505b6101418181548110612607576126076140d6565b9060005260206000209060020201600101805480612627576126276141e1565b60008281526020812060056000199093019283020181815560018101829055600281018290556003810182905560040155905561014180548290811061266f5761266f6140d6565b6000918252602082206001600290920201015490036127b257610141805461269990600190614064565b815481106126a9576126a96140d6565b906000526020600020906002020161014182815481106126cb576126cb6140d6565b60009182526020909120825460029092020180546001600160a01b0319166001600160a01b039092169190911781556001808301805461270e9284019190613a3b565b50905050610141805480612724576127246141e1565b60008281526020812060026000199093019283020180546001600160a01b0319168155906127556001830182613ab5565b5050905533600090815261014260208190526040822082905561014180548493919084908110612787576127876140d6565b600091825260208083206002909202909101546001600160a01b031683528201929092526040019020555b61286b565b600061014182815481106127cd576127cd6140d6565b906000526020600020906002020160010188815481106127ef576127ef6140d6565b90600052602060002090600502019050868160000160008282546128139190614064565b925050819055508281600101600082825461282e9190614064565b92505081905550848160020160008282546128499190614064565b92505081905550838160030160008282546128649190614064565b9091555050505b5092959194509250565b60006128818242611f45565b61288d90612710614064565b9050600061289a306111be565b15612a695760006101455486610146546128b3306111be565b6128bd9190614077565b6128c791906140ec565b6128d19190614103565b905087811115612a6757612710836128e98a84614064565b6128f391906140ec565b6128fd9190614103565b915081156129875730600090815261010a602052604081208054849290612925908490614064565b909155505033600090815261010a60205260408120805484929061294a908490614077565b9091555050604051828152339030907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9060200160405180910390a35b612710831015612a675760006127106129a08582614064565b6129aa8b85614064565b6129b491906140ec565b6129be9190614103565b90508015612a655730600090815261010a6020526040812080548392906129e6908490614064565b9091555050600080805261010a6020527f8684156705e0cb91ffe15d87ba1902d313d1419968887339e417608630e963348054839290612a27908490614077565b909155505060405181815260009030907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9060200160405180910390a35b505b505b6101ab546101ac546040516370a0823160e01b81526001600160a01b03918216600482015260009291909116906370a0823190602401602060405180830381865afa158015612abc573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612ae09190614117565b15612cdf57612710612af284896140ec565b612afc9190614103565b90508015612be4576101ab546101ac546001600160a01b0391821691636c74dd519116336040516001600160e01b031960e085901b1681526001600160a01b03928316600482015291166024820152604481018490526064016020604051808303816000875af1158015612b74573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612b98919061408a565b612be45760405162461bcd60e51b815260206004820152601760248201527f4c3a2042534b52207472616e73666572206661696c65640000000000000000006044820152606401610824565b612710831015612cdf576000612710612bfd8582614064565b612c07908a6140ec565b612c119190614103565b90508015612cdd576101ab546101ac54604051636c74dd5160e01b81526001600160a01b0391821660048201526000602482015260448101849052911690636c74dd51906064016020604051808303816000875af1158015612c77573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612c9b919061408a565b612cdd5760405162461bcd60e51b8152602060048201526013602482015272130e881094d2d488189d5c9b8819985a5b1959606a1b6044820152606401610824565b505b876101466000828254612cf29190614064565b92505081905550866101446000828254612d0c9190614064565b92505081905550856101456000828254612d269190614064565b92505081905550846101436000828254612d409190614064565b9091555050604080518981526020810189905280820188905260608101879052608081018690524260a0820152905133917f99e303fc09f735c25e5c4484adf9e39fe63be9940fe6bab97a10697bd6a34a73919081900360c00190a25050505050505050565b604080516002808252606082018352600092839291906020830190803683370190505090503081600081518110612ddf57612ddf6140d6565b6001600160a01b0392831660209182029290920101526101ab54825191169082906001908110612e1157612e116140d6565b6001600160a01b03928316602091820292909201015260fd54612e3791869116856117ee565b6101ab546101ac546040516370a0823160e01b81526001600160a01b03918216600482015260009291909116906370a0823190602401602060405180830381865afa158015612e8a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612eae9190614117565b60fd546101ac549192506001600160a01b0390811691635c11d795918791600091879116612edd42600f614077565b6040518663ffffffff1660e01b8152600401612efd9594939291906141f7565b600060405180830381600087803b158015612f1757600080fd5b505af1158015612f2b573d6000803e3d6000fd5b50506101ab546101ac546040516370a0823160e01b81526001600160a01b039182166004820152859450911691506370a0823190602401602060405180830381865afa158015612f7f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612fa39190614117565b6115159190614064565b612fb56134df565b60c9805460ff191690557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa336121a3565b611080612ffb6033546001600160a01b031690565b838360006130fc565b600061300f83613528565b8061084c575061084c82613528565b806001600160a01b03163b6000036130335750565b60fd546001600160a01b039081169082160361304c5750565b610100546001600160a01b03908116908216036130665750565b6001600160a01b0381166000908152610107602052604090205460ff16610f7d57600061309282613609565b90506001600160a01b0381166130a6575050565b60006130b18361361c565b90506001600160a01b0381166130c657505050565b6130d383846000196117ee565b50506001600160a01b038116600090815261010760205260409020805460ff1916600117905550565b61310461226d565b61310c613ad6565b8161311957828152613184565b6127106101ad548461312b91906140ec565b6131359190614103565b60208201526101ae546127109061314c90856140ec565b6131569190614103565b604082018190526131689060026140ec565b60208201516131779085614064565b6131819190614064565b81525b6001600160a01b038516600090815261010a6020526040812080548592906131ad908490614064565b909155505080516001600160a01b038516600090815261010a6020526040812080549091906131dd908490614077565b90915550506020810151156132e057602080820151600080805261010a9092527f8684156705e0cb91ffe15d87ba1902d313d1419968887339e417608630e9633480549192909161322f908490614077565b909155505060408082015160fe546001600160a01b0316600090815261010a602052918220805491929091613265908490614077565b909155505060408082015160ff546001600160a01b0316600090815261010a60205291822080549192909161329b908490614077565b909155505060208082015160408051828152928301919091527f0e992691453a607a3e534af8638548f72f22fc0eb79c112bdf5c20a3729117aa910160405180910390a15b80516040519081526001600160a01b0385811691908716907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9060200160405180910390a35050505050565b610141805460019081018083556000928352829161334991614064565b9050826101418281548110613360576133606140d6565b6000918252602080832060029290920290910180546001600160a01b0319166001600160a01b0394851617905594909116815261014290935260409092208290555090565b60006133b26002836140c2565b6000036133cb576b033b2e3c9fd0803ce80000006133cd565b825b90506133da600283614103565b91505b8115610789576133ed838461362f565b92506133fa6002836140c2565b1561340c57613409818461362f565b90505b613417600283614103565b91506133dd565b6001600160a01b0381163b61348b5760405162461bcd60e51b815260206004820152602d60248201527f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60448201526c1bdd08184818dbdb9d1c9858dd609a1b6064820152608401610824565b6000805160206142aa83398151915280546001600160a01b0319166001600160a01b0392909216919091179055565b6134c383613667565b6000825111806134d05750805b1561170f57611ac283836136a7565b60c95460ff16610fb25760405162461bcd60e51b815260206004820152601460248201527314185d5cd8589b194e881b9bdd081c185d5cd95960621b6044820152606401610824565b60fd546000906001600160a01b039081169083160361354957506000919050565b610100546001600160a01b039081169083160361356857506000919050565b6001600160a01b0382166000908152610107602052604090205460ff161561359257506000919050565b600061359d83613609565b90506001600160a01b0381166135b65750600092915050565b60006135c18461361c565b90506001600160a01b0381166135db575060009392505050565b60006135e685613792565b905062ffffff8116156135fe57506001949350505050565b506000949350505050565b600061078982630dfe168160e01b6137a5565b60006107898263d21220a760e01b6137a5565b60006b033b2e3c9fd0803ce800000061365d61364b8585613875565b6b019d971e4fe8401e740000006138dc565b61084c9190614103565b6136708161341e565b6040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b60606001600160a01b0383163b61370f5760405162461bcd60e51b815260206004820152602660248201527f416464726573733a2064656c65676174652063616c6c20746f206e6f6e2d636f6044820152651b9d1c9858dd60d21b6064820152608401610824565b600080846001600160a01b03168460405161372a9190614268565b600060405180830381855af49150503d8060008114613765576040519150601f19603f3d011682016040523d82523d6000602084013e61376a565b606091505b509150915061151582826040518060600160405280602781526020016142ca60279139613931565b60006107898263ddca3f4360e01b61394a565b60408051600481526024810182526020810180516001600160e01b03166001600160e01b031985161790529051600091829182916001600160a01b038716916137ee9190614268565b600060405180830381855afa9150503d8060008114613829576040519150601f19603f3d011682016040523d82523d6000602084013e61382e565b606091505b509150915081158061383f57508051155b1561384f57600092505050610789565b80516020036135fe578080602001905181019061386c9190614031565b92505050610789565b60008115806138995750828261388b81836140ec565b92506138979083614103565b145b6107895760405162461bcd60e51b815260206004820152601460248201527364732d6d6174682d6d756c2d6f766572666c6f7760601b6044820152606401610824565b6000826138e98382614077565b91508110156107895760405162461bcd60e51b815260206004820152601460248201527364732d6d6174682d6164642d6f766572666c6f7760601b6044820152606401610824565b6060831561394057508161084c565b61084c8383613a11565b60408051600481526024810182526020810180516001600160e01b03166001600160e01b031985161790529051600091829182916001600160a01b038716916139939190614268565b600060405180830381855afa9150503d80600081146139ce576040519150601f19603f3d011682016040523d82523d6000602084013e6139d3565b606091505b50915091508115806139e457508051155b156139f457600092505050610789565b80516020036135fe578080602001905181019061386c9190614284565b815115613a215781518083602001fd5b8060405162461bcd60e51b81526004016108249190613b48565b828054828255906000526020600020906005028101928215613aa95760005260206000209160050282015b82811115613aa957825482556001808401549083015560028084015490830155600380840154908301556004808401549083015560059283019290910190613a66565b506111a2929150613af4565b5080546000825560050290600052602060002090810190610f7d9190613af4565b60405180606001604052806003906020820280368337509192915050565b5b808211156111a25760008082556001820181905560028201819055600382018190556004820155600501613af5565b60005b83811015613b3f578181015183820152602001613b27565b50506000910152565b6020815260008251806020840152613b67816040850160208701613b24565b601f01601f19169190910160400192915050565b6001600160a01b0381168114610f7d57600080fd5b8035613b9b81613b7b565b919050565b60008060408385031215613bb357600080fd5b8235613bbe81613b7b565b946020939093013593505050565b600060208284031215613bde57600080fd5b5035919050565b600080600060608486031215613bfa57600080fd5b8335613c0581613b7b565b92506020840135613c1581613b7b565b929592945050506040919091013590565b600060208284031215613c3857600080fd5b813561084c81613b7b565b602080825282518282018190526000919060409081850190868401855b82811015613ca45781518051855286810151878601528581015186860152606080820151908601526080908101519085015260a09093019290850190600101613c60565b5091979650505050505050565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f1916810167ffffffffffffffff81118282101715613cf057613cf0613cb1565b604052919050565b60008060408385031215613d0b57600080fd5b8235613d1681613b7b565b915060208381013567ffffffffffffffff80821115613d3457600080fd5b818601915086601f830112613d4857600080fd5b813581811115613d5a57613d5a613cb1565b613d6c601f8201601f19168501613cc7565b91508082528784828501011115613d8257600080fd5b80848401858401376000848284010152508093505050509250929050565b60008060408385031215613db357600080fd5b50508035926020909101359150565b60008083601f840112613dd457600080fd5b50813567ffffffffffffffff811115613dec57600080fd5b602083019150836020828501011115613e0457600080fd5b9250929050565b600082601f830112613e1c57600080fd5b60405160a0810181811067ffffffffffffffff82111715613e3f57613e3f613cb1565b6040528060a0840185811115613e5457600080fd5b845b81811015613e77578035613e6981613b7b565b835260209283019201613e56565b509195945050505050565b60008060008060008060008060006101608a8c031215613ea157600080fd5b893560ff81168114613eb257600080fd5b985060208a013567ffffffffffffffff80821115613ecf57600080fd5b613edb8d838e01613dc2565b909a50985060408c0135915080821115613ef457600080fd5b50613f018c828d01613dc2565b90975095505060608a0135613f1581613b7b565b9350613f2360808b01613b90565b9250613f3160a08b01613b90565b9150613f408b60c08c01613e0b565b90509295985092959850929598565b60008060408385031215613f6257600080fd5b8235613f6d81613b7b565b91506020830135613f7d81613b7b565b809150509250929050565b60008060208385031215613f9b57600080fd5b823567ffffffffffffffff80821115613fb357600080fd5b818501915085601f830112613fc757600080fd5b813581811115613fd657600080fd5b8660208260061b8501011115613feb57600080fd5b60209290920196919550909350505050565b600181811c9082168061401157607f821691505b602082108103610c5857634e487b7160e01b600052602260045260246000fd5b60006020828403121561404357600080fd5b815161084c81613b7b565b634e487b7160e01b600052601160045260246000fd5b818103818111156107895761078961404e565b808201808211156107895761078961404e565b60006020828403121561409c57600080fd5b8151801515811461084c57600080fd5b634e487b7160e01b600052601260045260246000fd5b6000826140d1576140d16140ac565b500690565b634e487b7160e01b600052603260045260246000fd5b80820281158282048414176107895761078961404e565b600082614112576141126140ac565b500490565b60006020828403121561412957600080fd5b5051919050565b6020808252602c908201527f46756e6374696f6e206d7573742062652063616c6c6564207468726f7567682060408201526b19195b1959d85d1958d85b1b60a21b606082015260800190565b6020808252602c908201527f46756e6374696f6e206d7573742062652063616c6c6564207468726f7567682060408201526b6163746976652070726f787960a01b606082015260800190565b6000600182016141da576141da61404e565b5060010190565b634e487b7160e01b600052603160045260246000fd5b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b818110156142475784516001600160a01b031683529383019391830191600101614222565b50506001600160a01b03969096166060850152505050608001529392505050565b6000825161427a818460208701613b24565b9190910192915050565b60006020828403121561429657600080fd5b815162ffffff8116811461084c57600080fdfe360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564a2646970667358221220e546f1315502529354ecf674c096831880dca92f50430f97371acb982447357464736f6c63430008130033
Deployed ByteCode
0x6080604052600436106102275760003560e01c806370a0823111610122578063a694fc3a116100a5578063d5f954241161006c578063d5f954241461064d578063dd62ed3e14610662578063e0c9ffc614610682578063e4edf852146106a2578063f2fde38b146106c257005b8063a694fc3a146105b8578063a9059cbb146105d8578063bac15203146105f8578063c1acbaf21461060d578063c93808e41461062d57005b80638da5cb5b116100e95780638da5cb5b1461052657806395d89b41146105445780639e2c8a5b146105595780639e99f53714610579578063a457c2d71461059857005b806370a08231146104ac578063715018a6146104cc5780637c72e7c6146104e157806387978fd1146104f85780638b71d6091461050f57005b80633659cfe6116101aa57806352d1902d1161017157806352d1902d146104405780635c975abb14610455578063664f73311461046d57806368c33627146104825780636fc436631461049757005b80633659cfe6146103ba57806339509351146103da578063439766ce146103fa578063481c6a751461040f5780634f1ef2861461042d57005b806323b872dd116101ee57806323b872dd146102fe5780632b3323411461031e578063313ce5671461033e57806333b69c4c1461035257806335941b1c1461037f57005b806306fdde0314610230578063095ea7b31461025b5780630f9f534c1461028b57806318160ddd146102b05780631d6b8b72146102c657005b3661022e57005b005b34801561023c57600080fd5b506102456106e2565b6040516102529190613b48565b60405180910390f35b34801561026757600080fd5b5061027b610276366004613ba0565b610775565b6040519015158152602001610252565b34801561029757600080fd5b506102a26101445481565b604051908152602001610252565b3480156102bc57600080fd5b5061010e546102a2565b3480156102d257600080fd5b506102e66102e1366004613bcc565b61078f565b6040516001600160a01b039091168152602001610252565b34801561030a57600080fd5b5061027b610319366004613be5565b6107bf565b34801561032a57600080fd5b5061022e610339366004613c26565b610853565b34801561034a57600080fd5b5060126102a2565b34801561035e57600080fd5b5061037261036d366004613c26565b610b80565b6040516102529190613c43565b34801561038b57600080fd5b5061039f61039a366004613ba0565b610c5e565b60408051938452602084019290925290820152606001610252565b3480156103c657600080fd5b5061022e6103d5366004613c26565b610ea1565b3480156103e657600080fd5b5061027b6103f5366004613ba0565b610f80565b34801561040657600080fd5b5061022e610fa2565b34801561041b57600080fd5b5060fb546001600160a01b03166102e6565b61022e61043b366004613cf8565b610fb4565b34801561044c57600080fd5b506102a2611084565b34801561046157600080fd5b5060c95460ff1661027b565b34801561047957600080fd5b5061022e611137565b34801561048e57600080fd5b506102a261114f565b3480156104a357600080fd5b506102a26111a6565b3480156104b857600080fd5b506102a26104c7366004613c26565b6111be565b3480156104d857600080fd5b5061022e6111da565b3480156104ed57600080fd5b506102a26101455481565b34801561050457600080fd5b506102a26101465481565b34801561051b57600080fd5b506102a26101435481565b34801561053257600080fd5b506033546001600160a01b03166102e6565b34801561055057600080fd5b506102456111ec565b34801561056557600080fd5b5061022e610574366004613da0565b6111fc565b34801561058557600080fd5b506101ab546001600160a01b03166102e6565b3480156105a457600080fd5b5061027b6105b3366004613ba0565b61124c565b3480156105c457600080fd5b5061022e6105d3366004613bcc565b6112c4565b3480156105e457600080fd5b5061027b6105f3366004613ba0565b6114c2565b34801561060457600080fd5b5061022e6114d0565b34801561061957600080fd5b506102a2610628366004613ba0565b6114e0565b34801561063957600080fd5b5061022e610648366004613e82565b61151e565b34801561065957600080fd5b5061022e6115fd565b34801561066e57600080fd5b506102a261067d366004613f4f565b611612565b34801561068e57600080fd5b5061022e61069d366004613f88565b61163e565b3480156106ae57600080fd5b5061022e6106bd366004613c26565b611714565b3480156106ce57600080fd5b5061022e6106dd366004613c26565b611778565b606061010b80546106f290613ffd565b80601f016020809104026020016040519081016040528092919081815260200182805461071e90613ffd565b801561076b5780601f106107405761010080835404028352916020019161076b565b820191906000526020600020905b81548152906001019060200180831161074e57829003601f168201915b5050505050905090565b6000336107838185856117ee565b60019150505b92915050565b61014181815481106107a057600080fd5b60009182526020909120600290910201546001600160a01b0316905081565b600033816107cd8683611612565b9050600019811461083a578381101561082d5760405162461bcd60e51b815260206004820152601a60248201527f42423a20496e73756666696369656e7420616c6c6f77616e636500000000000060448201526064015b60405180910390fd5b61083a86838684036117ee565b6108458686866118de565b6001925050505b9392505050565b61085b611ac8565b6101ac54600160a01b900460ff16156108ad5760405162461bcd60e51b8152602060048201526014602482015273130e88125b9a5d1a585b081c985d1a5bc81cd95d60621b6044820152606401610824565b610145541580156108c457506108c2306111be565b155b6109065760405162461bcd60e51b81526020600482015260136024820152724c3a204e6f6e2d7a65726f2062616c616e636560681b6044820152606401610824565b6101ab80546001600160a01b0319166001600160a01b0383811691821790925560fc5460405163e6a4390560e01b81523060048201526024810192909252600092169063e6a4390590604401602060405180830381865afa15801561096f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109939190614031565b90506001600160a01b038116610a1c5760fc546040516364e329cb60e11b81523060048201526001600160a01b0384811660248301529091169063c9c65396906044016020604051808303816000875af11580156109f5573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a199190614031565b90505b6001600160a01b03811615610a5d57610a3881826000196117ee565b6001600160a01b038116600090815261010760205260409020805460ff191660011790555b33600090815261010a602052604081208054670de0b6b3a764000092839291610a87908490614064565b909155505030600090815261010a602052604081208054839290610aac908490614077565b90915550506101ab546001600160a01b0316636c74dd51336101ac5460405160e084901b6001600160e01b03191681526001600160a01b03928316600482015291166024820152604481018490526064016020604051808303816000875af1158015610b1c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b40919061408a565b50610b4d81828384611b22565b6101ac805460ff60a01b1916600160a01b179055610b6d610e10426140c2565b610b779042614064565b6101af55505050565b6001600160a01b038116600090815261014260205260409020546060908015610c58576101418181548110610bb757610bb76140d6565b9060005260206000209060020201600101805480602002602001604051908101604052809291908181526020016000905b82821015610c4c57838290600052602060002090600502016040518060a00160405290816000820154815260200160018201548152602001600282015481526020016003820154815260200160048201548152505081526020019060010190610be8565b50505050915050919050565b50919050565b6000806000806101af54600014610c7b57610c7842611d2a565b90505b6001600160a01b0386166000908152610142602052604081205490610ca08288611e13565b9050610cb0816080015142611f45565b610cbc90612710614064565b935082610cc8306111be565b610cd29190614077565b15610d4f5760006101455482604001516101465486610cf0306111be565b610cfa9190614077565b610d049190614077565b610d0e91906140ec565b610d189190614103565b8251909150811115610d4d578151612710908690610d369084614064565b610d4091906140ec565b610d4a9190614103565b96505b505b6101ab546101ac546040516370a0823160e01b81526001600160a01b0391821660048201529116906370a0823190602401602060405180830381865afa158015610d9d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610dc19190614117565b15610e97576101435460608201516101ab546101ac546040516370a0823160e01b81526001600160a01b039182166004820152600094939291909116906370a0823190602401602060405180830381865afa158015610e24573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e489190614117565b610e5291906140ec565b610e5c9190614103565b90508160200151811115610e955761271085836020015183610e7e9190614064565b610e8891906140ec565b610e929190614103565b95505b505b5050509250925092565b6001600160a01b037f000000000000000000000000800e850bee5bb62905abef96422a040911251830163003610ee95760405162461bcd60e51b815260040161082490614130565b7f000000000000000000000000800e850bee5bb62905abef96422a0409112518306001600160a01b0316610f326000805160206142aa833981519152546001600160a01b031690565b6001600160a01b031614610f585760405162461bcd60e51b81526004016108249061417c565b610f6181611fa1565b60408051600080825260208201909252610f7d91839190611fa9565b50565b600033610783818585610f938383611612565b610f9d9190614077565b6117ee565b610faa612114565b610fb2612166565b565b6001600160a01b037f000000000000000000000000800e850bee5bb62905abef96422a040911251830163003610ffc5760405162461bcd60e51b815260040161082490614130565b7f000000000000000000000000800e850bee5bb62905abef96422a0409112518306001600160a01b03166110456000805160206142aa833981519152546001600160a01b031690565b6001600160a01b03161461106b5760405162461bcd60e51b81526004016108249061417c565b61107482611fa1565b61108082826001611fa9565b5050565b6000306001600160a01b037f000000000000000000000000800e850bee5bb62905abef96422a04091125183016146111245760405162461bcd60e51b815260206004820152603860248201527f555550535570677261646561626c653a206d757374206e6f742062652063616c60448201527f6c6564207468726f7567682064656c656761746563616c6c00000000000000006064820152608401610824565b506000805160206142aa83398151915290565b61113f612114565b610106805460ff19166001179055565b6000805b610141548110156111a2576101418181548110611172576111726140d6565b60009182526020909120600160029092020101546111909083614077565b915061119b816141c8565b9050611153565b5090565b610141546000906111b990600190614064565b905090565b6001600160a01b0316600090815261010a602052604090205490565b6111e2611ac8565b610fb260006121c0565b606061010c80546106f290613ffd565b611204612212565b61120c61226d565b6112146122b3565b600080600080611224858761234b565b935093509350935061123d868285858860800151612875565b50505050611080600161017955565b6000338161125a8286611612565b9050838110156112ac5760405162461bcd60e51b815260206004820152601760248201527f42534b523a204465637265617365732062656c6f7720300000000000000000006044820152606401610824565b6112b982868684036117ee565b506001949350505050565b6112cc61226d565b6112d4612212565b806000036113245760405162461bcd60e51b815260206004820152601760248201527f4c3a2043616e6e6f74207374616b65206e6f7468696e670000000000000000006044820152606401610824565b33600090815261010a602052604090205481111561137a5760405162461bcd60e51b81526020600482015260136024820152724c3a20546f6f206d756368207374616b696e6760681b6044820152606401610824565b6113826122b3565b600061138d306111be565b6101465461139b9190614077565b610145546113a990846140ec565b6113b39190614103565b33600090815261010a60205260408120805492935084929091906113d8908490614064565b909155505030600090815261010a6020526040812080548492906113fd908490614077565b90915550506101ab546101ac546040516370a0823160e01b81526001600160a01b03918216600482015260009291909116906370a0823190602401602060405180830381865afa158015611455573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906114799190614117565b905060006114873085612da6565b9050600082610143548361149b91906140ec565b6114a59190614103565b90506114b385838684611b22565b50505050610f7d600161017955565b6000336107838185856118de565b6114d8612114565b610fb2612fad565b6001600160a01b03821660009081526101426020526040812054816115058285611e13565b9050611515816080015142611f45565b95945050505050565b6000548990610100900460ff1615801561153f575060005460ff8083169116105b6115a25760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b6064820152608401610824565b6000805461ffff191660ff83169081176101001761ff0019169091556040519081527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a150505050505050505050565b611605612114565b610106805460ff19169055565b6001600160a01b0391821660009081526101096020908152604080832093909416825291909152205490565b611646611ac8565b60005b8181101561170f576000838383818110611665576116656140d6565b61167b9260206040909202019081019150613c26565b6001600160a01b0316141580156116ae575082828281811061169f5761169f6140d6565b90506040020160200135600014155b156116ff576116ff8383838181106116c8576116c86140d6565b6116de9260206040909202019081019150613c26565b8484848181106116f0576116f06140d6565b90506040020160200135612fe6565b611708816141c8565b9050611649565b505050565b61171c612114565b60fb546040516001600160a01b038084169216907f80f15e9dbc60884fdb59fb8ed4fc48a9a689e028f055e893ed45ca5be67c5c8590600090a360fb80546001600160a01b0319166001600160a01b0392909216919091179055565b611780611ac8565b6001600160a01b0381166117e55760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610824565b610f7d816121c0565b6001600160a01b0383166118365760405162461bcd60e51b815260206004820152600f60248201526e21211d10233937b690181030b2323960891b6044820152606401610824565b6001600160a01b03821661187c5760405162461bcd60e51b815260206004820152600d60248201526c21211d102a3790181030b2323960991b6044820152606401610824565b6001600160a01b038381166000818152610109602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b0383166119255760405162461bcd60e51b815260206004820152600e60248201526d261d10233937b690181030b2323960911b6044820152606401610824565b6001600160a01b03821661196a5760405162461bcd60e51b815260206004820152600c60248201526b261d102a3790181030b2323960a11b6044820152606401610824565b806000036119a85760405162461bcd60e51b815260206004820152600b60248201526a130e880c08185b5bdd5b9d60aa1b6044820152606401610824565b6101065460ff16611a0a576119bd8383613004565b15611a0a5760405162461bcd60e51b815260206004820152601b60248201527f4c3a20556e69737761705633206e6f7420737570706f727465642100000000006044820152606401610824565b611a138361301e565b611a1c8261301e565b6001600160a01b0383166000908152610108602052604090205460019060ff1680611a6057506001600160a01b0383166000908152610108602052604090205460ff165b15611a69575060005b6001600160a01b0384166000908152610107602052604090205460ff16158015611aad57506001600160a01b0383166000908152610107602052604090205460ff16155b15611ab6575060005b611ac2848484846130fc565b50505050565b6033546001600160a01b03163314610fb25760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610824565b83600003611b725760405162461bcd60e51b815260206004820152601760248201527f533a2043616e6e6f74207374616b65206e6f7468696e670000000000000000006044820152606401610824565b3360009081526101426020526040812054904290829003611b9957611b963361332c565b91505b6101418281548110611bad57611bad6140d6565b600091825260208083206040805160a0810182528b81528084018b81529181018a8152606082018a81526080830189815260016002988902909601860180548088018255908a52968920935160059097029093019586559251938501939093559151938301939093559151600382015590516004909101556101468054889290611c38908490614077565b92505081905550846101446000828254611c529190614077565b92505081905550836101456000828254611c6c9190614077565b92505081905550826101436000828254611c869190614077565b909155503390506001600160a01b03167fc16be9a586414a157dd46b4d023aa9997a025dd1cbbaa67ac0c1b8273a5eaf558787878760016101418981548110611cd157611cd16140d6565b906000526020600020906002020160010180549050611cf09190614064565b604080519586526020860194909452928401919091526060830152608082015260a0810184905260c00160405180910390a2505050505050565b60006101af54600003611d7f5760405162461bcd60e51b815260206004820152601960248201527f4c3a20496e666c6174696f6e206e6f74207374617274656421000000000000006044820152606401610824565b6000610e106101af5484611d939190614064565b611d9d9190614103565b6101ac546001600160a01b0316600090815261010a60205260409020549091508115611e0c576000611ddb6b033b2c8af183120df3000000846133a5565b90506b033b2e3c9fd0803ce8000000611df482846140ec565b611dfe9190614103565b611e089083614064565b9350505b5050919050565b611e456040518060a0016040528060008152602001600081526020016000815260200160008152602001600081525090565b6101418381548110611e5957611e596140d6565b9060005260206000209060020201600101805490508210611ebc5760405162461bcd60e51b815260206004820152601960248201527f533a205374616b6520696e64657820696e636f727265637421000000000000006044820152606401610824565b6101418381548110611ed057611ed06140d6565b90600052602060002090600202016001018281548110611ef257611ef26140d6565b90600052602060002090600502016040518060a001604052908160008201548152602001600182015481526020016002820154815260200160038201548152602001600482015481525050905092915050565b600081611f56846301dfe200614077565b11156107895760006224ea00611f6c8585614064565b611f769190614103565b9050600d811015611f9a57611f8c81600d614064565b611f979060646140ec565b91505b5092915050565b610f7d611ac8565b7f4910fdfa16fed3260ed0e7147f7cc6da11a60208b5b9406d12a635614ffd91435460ff1615611fdc5761170f8361341e565b826001600160a01b03166352d1902d6040518163ffffffff1660e01b8152600401602060405180830381865afa925050508015612036575060408051601f3d908101601f1916820190925261203391810190614117565b60015b6120995760405162461bcd60e51b815260206004820152602e60248201527f45524331393637557067726164653a206e657720696d706c656d656e7461746960448201526d6f6e206973206e6f74205555505360901b6064820152608401610824565b6000805160206142aa83398151915281146121085760405162461bcd60e51b815260206004820152602960248201527f45524331393637557067726164653a20756e737570706f727465642070726f786044820152681a58589b195555525160ba1b6064820152608401610824565b5061170f8383836134ba565b60fb546001600160a01b03163314610fb25760405162461bcd60e51b8152602060048201526015602482015274269d1021b0b63632b9103737ba1036b0b730b3b2b960591b6044820152606401610824565b61216e61226d565b60c9805460ff191660011790557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a2586121a33390565b6040516001600160a01b03909116815260200160405180910390a1565b603380546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b600261017954036122655760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606401610824565b600261017955565b60c95460ff1615610fb25760405162461bcd60e51b815260206004820152601060248201526f14185d5cd8589b194e881c185d5cd95960821b6044820152606401610824565b60006122c1610e10426140c2565b6122cb9042614064565b90506101af54811115610f7d5760006122e382611d2a565b90508015611080576101af8290556101ac546001600160a01b0316600090815261010a60205260408120805483929061231d908490614064565b909155505030600090815261010a602052604081208054839290612342908490614077565b90915550505050565b61237d6040518060a0016040528060008152602001600081526020016000815260200160008152602001600081525090565b33600090815261014260205260408120548190819061239c8188611e13565b94508060011415806123ad57508615155b6123f95760405162461bcd60e51b815260206004820181905260248201527f533a2043616e6e6f742072656d6f766520746865206669727374207374616b656044820152606401610824565b845186111561245f5760405162461bcd60e51b815260206004820152602c60248201527f533a2043616e6e6f74207769746864726177206d6f7265207468616e20796f7560448201526b081a185d99481cdd185ad95960a21b6064820152608401610824565b8451604086015161247090886140ec565b61247a9190614103565b855160208701519195509061248f90886140ec565b6124999190614103565b85516060870151919350906124ae90886140ec565b6124b89190614103565b9250858560000151036127b757600161014182815481106124db576124db6140d6565b9060005260206000209060020201600101805490506124fa9190614064565b8710156125f3576101418181548110612515576125156140d6565b90600052602060002090600202016001016001610141838154811061253c5761253c6140d6565b90600052602060002090600202016001018054905061255b9190614064565b8154811061256b5761256b6140d6565b9060005260206000209060050201610141828154811061258d5761258d6140d6565b906000526020600020906002020160010188815481106125af576125af6140d6565b906000526020600020906005020160008201548160000155600182015481600101556002820154816002015560038201548160030155600482015481600401559050505b6101418181548110612607576126076140d6565b9060005260206000209060020201600101805480612627576126276141e1565b60008281526020812060056000199093019283020181815560018101829055600281018290556003810182905560040155905561014180548290811061266f5761266f6140d6565b6000918252602082206001600290920201015490036127b257610141805461269990600190614064565b815481106126a9576126a96140d6565b906000526020600020906002020161014182815481106126cb576126cb6140d6565b60009182526020909120825460029092020180546001600160a01b0319166001600160a01b039092169190911781556001808301805461270e9284019190613a3b565b50905050610141805480612724576127246141e1565b60008281526020812060026000199093019283020180546001600160a01b0319168155906127556001830182613ab5565b5050905533600090815261014260208190526040822082905561014180548493919084908110612787576127876140d6565b600091825260208083206002909202909101546001600160a01b031683528201929092526040019020555b61286b565b600061014182815481106127cd576127cd6140d6565b906000526020600020906002020160010188815481106127ef576127ef6140d6565b90600052602060002090600502019050868160000160008282546128139190614064565b925050819055508281600101600082825461282e9190614064565b92505081905550848160020160008282546128499190614064565b92505081905550838160030160008282546128649190614064565b9091555050505b5092959194509250565b60006128818242611f45565b61288d90612710614064565b9050600061289a306111be565b15612a695760006101455486610146546128b3306111be565b6128bd9190614077565b6128c791906140ec565b6128d19190614103565b905087811115612a6757612710836128e98a84614064565b6128f391906140ec565b6128fd9190614103565b915081156129875730600090815261010a602052604081208054849290612925908490614064565b909155505033600090815261010a60205260408120805484929061294a908490614077565b9091555050604051828152339030907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9060200160405180910390a35b612710831015612a675760006127106129a08582614064565b6129aa8b85614064565b6129b491906140ec565b6129be9190614103565b90508015612a655730600090815261010a6020526040812080548392906129e6908490614064565b9091555050600080805261010a6020527f8684156705e0cb91ffe15d87ba1902d313d1419968887339e417608630e963348054839290612a27908490614077565b909155505060405181815260009030907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9060200160405180910390a35b505b505b6101ab546101ac546040516370a0823160e01b81526001600160a01b03918216600482015260009291909116906370a0823190602401602060405180830381865afa158015612abc573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612ae09190614117565b15612cdf57612710612af284896140ec565b612afc9190614103565b90508015612be4576101ab546101ac546001600160a01b0391821691636c74dd519116336040516001600160e01b031960e085901b1681526001600160a01b03928316600482015291166024820152604481018490526064016020604051808303816000875af1158015612b74573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612b98919061408a565b612be45760405162461bcd60e51b815260206004820152601760248201527f4c3a2042534b52207472616e73666572206661696c65640000000000000000006044820152606401610824565b612710831015612cdf576000612710612bfd8582614064565b612c07908a6140ec565b612c119190614103565b90508015612cdd576101ab546101ac54604051636c74dd5160e01b81526001600160a01b0391821660048201526000602482015260448101849052911690636c74dd51906064016020604051808303816000875af1158015612c77573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612c9b919061408a565b612cdd5760405162461bcd60e51b8152602060048201526013602482015272130e881094d2d488189d5c9b8819985a5b1959606a1b6044820152606401610824565b505b876101466000828254612cf29190614064565b92505081905550866101446000828254612d0c9190614064565b92505081905550856101456000828254612d269190614064565b92505081905550846101436000828254612d409190614064565b9091555050604080518981526020810189905280820188905260608101879052608081018690524260a0820152905133917f99e303fc09f735c25e5c4484adf9e39fe63be9940fe6bab97a10697bd6a34a73919081900360c00190a25050505050505050565b604080516002808252606082018352600092839291906020830190803683370190505090503081600081518110612ddf57612ddf6140d6565b6001600160a01b0392831660209182029290920101526101ab54825191169082906001908110612e1157612e116140d6565b6001600160a01b03928316602091820292909201015260fd54612e3791869116856117ee565b6101ab546101ac546040516370a0823160e01b81526001600160a01b03918216600482015260009291909116906370a0823190602401602060405180830381865afa158015612e8a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612eae9190614117565b60fd546101ac549192506001600160a01b0390811691635c11d795918791600091879116612edd42600f614077565b6040518663ffffffff1660e01b8152600401612efd9594939291906141f7565b600060405180830381600087803b158015612f1757600080fd5b505af1158015612f2b573d6000803e3d6000fd5b50506101ab546101ac546040516370a0823160e01b81526001600160a01b039182166004820152859450911691506370a0823190602401602060405180830381865afa158015612f7f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612fa39190614117565b6115159190614064565b612fb56134df565b60c9805460ff191690557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa336121a3565b611080612ffb6033546001600160a01b031690565b838360006130fc565b600061300f83613528565b8061084c575061084c82613528565b806001600160a01b03163b6000036130335750565b60fd546001600160a01b039081169082160361304c5750565b610100546001600160a01b03908116908216036130665750565b6001600160a01b0381166000908152610107602052604090205460ff16610f7d57600061309282613609565b90506001600160a01b0381166130a6575050565b60006130b18361361c565b90506001600160a01b0381166130c657505050565b6130d383846000196117ee565b50506001600160a01b038116600090815261010760205260409020805460ff1916600117905550565b61310461226d565b61310c613ad6565b8161311957828152613184565b6127106101ad548461312b91906140ec565b6131359190614103565b60208201526101ae546127109061314c90856140ec565b6131569190614103565b604082018190526131689060026140ec565b60208201516131779085614064565b6131819190614064565b81525b6001600160a01b038516600090815261010a6020526040812080548592906131ad908490614064565b909155505080516001600160a01b038516600090815261010a6020526040812080549091906131dd908490614077565b90915550506020810151156132e057602080820151600080805261010a9092527f8684156705e0cb91ffe15d87ba1902d313d1419968887339e417608630e9633480549192909161322f908490614077565b909155505060408082015160fe546001600160a01b0316600090815261010a602052918220805491929091613265908490614077565b909155505060408082015160ff546001600160a01b0316600090815261010a60205291822080549192909161329b908490614077565b909155505060208082015160408051828152928301919091527f0e992691453a607a3e534af8638548f72f22fc0eb79c112bdf5c20a3729117aa910160405180910390a15b80516040519081526001600160a01b0385811691908716907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9060200160405180910390a35050505050565b610141805460019081018083556000928352829161334991614064565b9050826101418281548110613360576133606140d6565b6000918252602080832060029290920290910180546001600160a01b0319166001600160a01b0394851617905594909116815261014290935260409092208290555090565b60006133b26002836140c2565b6000036133cb576b033b2e3c9fd0803ce80000006133cd565b825b90506133da600283614103565b91505b8115610789576133ed838461362f565b92506133fa6002836140c2565b1561340c57613409818461362f565b90505b613417600283614103565b91506133dd565b6001600160a01b0381163b61348b5760405162461bcd60e51b815260206004820152602d60248201527f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60448201526c1bdd08184818dbdb9d1c9858dd609a1b6064820152608401610824565b6000805160206142aa83398151915280546001600160a01b0319166001600160a01b0392909216919091179055565b6134c383613667565b6000825111806134d05750805b1561170f57611ac283836136a7565b60c95460ff16610fb25760405162461bcd60e51b815260206004820152601460248201527314185d5cd8589b194e881b9bdd081c185d5cd95960621b6044820152606401610824565b60fd546000906001600160a01b039081169083160361354957506000919050565b610100546001600160a01b039081169083160361356857506000919050565b6001600160a01b0382166000908152610107602052604090205460ff161561359257506000919050565b600061359d83613609565b90506001600160a01b0381166135b65750600092915050565b60006135c18461361c565b90506001600160a01b0381166135db575060009392505050565b60006135e685613792565b905062ffffff8116156135fe57506001949350505050565b506000949350505050565b600061078982630dfe168160e01b6137a5565b60006107898263d21220a760e01b6137a5565b60006b033b2e3c9fd0803ce800000061365d61364b8585613875565b6b019d971e4fe8401e740000006138dc565b61084c9190614103565b6136708161341e565b6040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b60606001600160a01b0383163b61370f5760405162461bcd60e51b815260206004820152602660248201527f416464726573733a2064656c65676174652063616c6c20746f206e6f6e2d636f6044820152651b9d1c9858dd60d21b6064820152608401610824565b600080846001600160a01b03168460405161372a9190614268565b600060405180830381855af49150503d8060008114613765576040519150601f19603f3d011682016040523d82523d6000602084013e61376a565b606091505b509150915061151582826040518060600160405280602781526020016142ca60279139613931565b60006107898263ddca3f4360e01b61394a565b60408051600481526024810182526020810180516001600160e01b03166001600160e01b031985161790529051600091829182916001600160a01b038716916137ee9190614268565b600060405180830381855afa9150503d8060008114613829576040519150601f19603f3d011682016040523d82523d6000602084013e61382e565b606091505b509150915081158061383f57508051155b1561384f57600092505050610789565b80516020036135fe578080602001905181019061386c9190614031565b92505050610789565b60008115806138995750828261388b81836140ec565b92506138979083614103565b145b6107895760405162461bcd60e51b815260206004820152601460248201527364732d6d6174682d6d756c2d6f766572666c6f7760601b6044820152606401610824565b6000826138e98382614077565b91508110156107895760405162461bcd60e51b815260206004820152601460248201527364732d6d6174682d6164642d6f766572666c6f7760601b6044820152606401610824565b6060831561394057508161084c565b61084c8383613a11565b60408051600481526024810182526020810180516001600160e01b03166001600160e01b031985161790529051600091829182916001600160a01b038716916139939190614268565b600060405180830381855afa9150503d80600081146139ce576040519150601f19603f3d011682016040523d82523d6000602084013e6139d3565b606091505b50915091508115806139e457508051155b156139f457600092505050610789565b80516020036135fe578080602001905181019061386c9190614284565b815115613a215781518083602001fd5b8060405162461bcd60e51b81526004016108249190613b48565b828054828255906000526020600020906005028101928215613aa95760005260206000209160050282015b82811115613aa957825482556001808401549083015560028084015490830155600380840154908301556004808401549083015560059283019290910190613a66565b506111a2929150613af4565b5080546000825560050290600052602060002090810190610f7d9190613af4565b60405180606001604052806003906020820280368337509192915050565b5b808211156111a25760008082556001820181905560028201819055600382018190556004820155600501613af5565b60005b83811015613b3f578181015183820152602001613b27565b50506000910152565b6020815260008251806020840152613b67816040850160208701613b24565b601f01601f19169190910160400192915050565b6001600160a01b0381168114610f7d57600080fd5b8035613b9b81613b7b565b919050565b60008060408385031215613bb357600080fd5b8235613bbe81613b7b565b946020939093013593505050565b600060208284031215613bde57600080fd5b5035919050565b600080600060608486031215613bfa57600080fd5b8335613c0581613b7b565b92506020840135613c1581613b7b565b929592945050506040919091013590565b600060208284031215613c3857600080fd5b813561084c81613b7b565b602080825282518282018190526000919060409081850190868401855b82811015613ca45781518051855286810151878601528581015186860152606080820151908601526080908101519085015260a09093019290850190600101613c60565b5091979650505050505050565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f1916810167ffffffffffffffff81118282101715613cf057613cf0613cb1565b604052919050565b60008060408385031215613d0b57600080fd5b8235613d1681613b7b565b915060208381013567ffffffffffffffff80821115613d3457600080fd5b818601915086601f830112613d4857600080fd5b813581811115613d5a57613d5a613cb1565b613d6c601f8201601f19168501613cc7565b91508082528784828501011115613d8257600080fd5b80848401858401376000848284010152508093505050509250929050565b60008060408385031215613db357600080fd5b50508035926020909101359150565b60008083601f840112613dd457600080fd5b50813567ffffffffffffffff811115613dec57600080fd5b602083019150836020828501011115613e0457600080fd5b9250929050565b600082601f830112613e1c57600080fd5b60405160a0810181811067ffffffffffffffff82111715613e3f57613e3f613cb1565b6040528060a0840185811115613e5457600080fd5b845b81811015613e77578035613e6981613b7b565b835260209283019201613e56565b509195945050505050565b60008060008060008060008060006101608a8c031215613ea157600080fd5b893560ff81168114613eb257600080fd5b985060208a013567ffffffffffffffff80821115613ecf57600080fd5b613edb8d838e01613dc2565b909a50985060408c0135915080821115613ef457600080fd5b50613f018c828d01613dc2565b90975095505060608a0135613f1581613b7b565b9350613f2360808b01613b90565b9250613f3160a08b01613b90565b9150613f408b60c08c01613e0b565b90509295985092959850929598565b60008060408385031215613f6257600080fd5b8235613f6d81613b7b565b91506020830135613f7d81613b7b565b809150509250929050565b60008060208385031215613f9b57600080fd5b823567ffffffffffffffff80821115613fb357600080fd5b818501915085601f830112613fc757600080fd5b813581811115613fd657600080fd5b8660208260061b8501011115613feb57600080fd5b60209290920196919550909350505050565b600181811c9082168061401157607f821691505b602082108103610c5857634e487b7160e01b600052602260045260246000fd5b60006020828403121561404357600080fd5b815161084c81613b7b565b634e487b7160e01b600052601160045260246000fd5b818103818111156107895761078961404e565b808201808211156107895761078961404e565b60006020828403121561409c57600080fd5b8151801515811461084c57600080fd5b634e487b7160e01b600052601260045260246000fd5b6000826140d1576140d16140ac565b500690565b634e487b7160e01b600052603260045260246000fd5b80820281158282048414176107895761078961404e565b600082614112576141126140ac565b500490565b60006020828403121561412957600080fd5b5051919050565b6020808252602c908201527f46756e6374696f6e206d7573742062652063616c6c6564207468726f7567682060408201526b19195b1959d85d1958d85b1b60a21b606082015260800190565b6020808252602c908201527f46756e6374696f6e206d7573742062652063616c6c6564207468726f7567682060408201526b6163746976652070726f787960a01b606082015260800190565b6000600182016141da576141da61404e565b5060010190565b634e487b7160e01b600052603160045260246000fd5b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b818110156142475784516001600160a01b031683529383019391830191600101614222565b50506001600160a01b03969096166060850152505050608001529392505050565b6000825161427a818460208701613b24565b9190910192915050565b60006020828403121561429657600080fd5b815162ffffff8116811461084c57600080fdfe360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564a2646970667358221220e546f1315502529354ecf674c096831880dca92f50430f97371acb982447357464736f6c63430008130033