Transactions
Token Transfers
Tokens
Internal Transactions
Coin Balance History
Logs
Code
Read Contract
Write Contract
Contract is not verified. However, we found a verified contract with the same bytecode in Blockscout DB 0x8058a8d155fccd3fcf84a3073d3f0a81326b2cd3.
All metadata displayed below is from that contract. In order to verify current contract, click Verify & Publish button
Verify & Publish
All metadata displayed below is from that contract. In order to verify current contract, click Verify & Publish button
- Contract name:
- Reflux
- Optimization enabled
- true
- Compiler version
- v0.8.21+commit.d9974bed
- Optimization runs
- 1000000
- Verified at
- 2023-10-13T00:44:29.642411Z
contracts/Reflux.sol
/*
* @title REFLUX - Earn reflections in native token
* @author Ra Murd <pulselorian@gmail.com>
* @notice https://pulselorian.com/
* @notice https://t.me/ThePulselorian
* @notice https://twitter.com/ThePulseLorian
*
* It's deflationary, burns portion of the fees, reflects rest of the fees in native tokens
*
* ( ( ( ( ( (( ( . ( ( (( ( ((
* )\ )\ )\ )\ )\ (\())\ . )\ )\ ))\)\ ))\
* ((_)((_)(_)(_) ((_))(_)(_) ((_)((_)(((_)_()((_)))
* | _ \ | | | | / __| __| | / _ \| _ \_ _| \ \| |
* | _/ |_| | |__\__ \ _|| |__| (_) | /| || - | . |
* |_| \___/|____|___/___|____|\___/|_|_\___|_|_|_|\_|
*
* Tokenomics (initial fees):
* Buy Sell Transfer
* Rfi 1.75% 1.75% 0.0%
* Burn 0.25% 0.25% 0.0%
*
* SPDX-License-Identifier: MIT
*/
pragma solidity 0.8.21;
import "./@openzeppelin/access/AccessControl.sol";
import "./@openzeppelin/access/Ownable.sol";
import "./@openzeppelin/token/ERC20/ERC20.sol";
import "./@uniswap/v2-core/interfaces/IUniswapV2Factory.sol";
import "./@uniswap/v2-core/interfaces/IUniswapV2Pair.sol";
import "./@uniswap/v2-periphery/interfaces/IUniswapV2Router02.sol";
import "./lib/RfiHelper.sol";
import "./lib/Utils.sol";
contract Reflux is ERC20, Ownable, Utils, AccessControl {
enum Fees {
BuyRfiFee,
BuyBurnFee,
SellRfiFee,
SellBurnFee
}
IUniswapV2Pair public plsV2LP;
IUniswapV2Router02 public plsxV2Router;
RfiHelper public rfiHelper;
address private _prevFrom;
address private _prevTo;
address public burnAddr;
address public rfiHelperAddr;
bool private _swapping;
bool public payoutEnabled = true;
bytes32 public constant MANAGER_ROLE = keccak256("MANAGER_ROLE");
mapping(address => bool) public isAMMPair;
mapping(address => bool) public noFee;
mapping(address => bool) public noRfi;
uint256 private constant _BIPS = 10000;
uint256 private constant _MAX_FEE = 500;
uint256 public lpRewardBips = 20000;
uint256 public maxGas = 200000;
uint256 public swapFactor = 1e5;
uint256[] public fees = new uint256[](uint256(type(Fees).max) + 1);
event UpdatedNoFeeWallet(address wallet, bool status);
event SwapFactorUpdated(uint256 newFactor);
event FeesUpdated(
uint256 buyRfiFee,
uint256 buyBurnFee,
uint256 sellRfiFee,
uint256 sellBurnFee
);
constructor(address plsxV2Router_) ERC20("REFLUX | Interest", "RFX") {
burnAddr = address(0x369);
plsxV2Router = IUniswapV2Router02(plsxV2Router_);
address plsLPAddr = IUniswapV2Factory(plsxV2Router.factory())
.createPair(address(this), plsxV2Router.WPLS());
plsV2LP = IUniswapV2Pair(plsLPAddr);
rfiHelper = new RfiHelper();
rfiHelperAddr = address(rfiHelper);
fees[uint256(Fees.BuyRfiFee)] = 175;
fees[uint256(Fees.BuyBurnFee)] = 25;
fees[uint256(Fees.SellRfiFee)] = 175;
fees[uint256(Fees.SellBurnFee)] = 25;
noFee[address(this)] = true;
noFee[msg.sender] = true;
noRfi[address(this)] = true;
noRfi[burnAddr] = true;
noRfi[plsLPAddr] = true;
noRfi[address(0)] = true;
isAMMPair[plsLPAddr] = true;
_mint(msg.sender, 1e27); // 1 billion
_grantRole(MANAGER_ROLE, msg.sender);
}
receive() external payable {}
function _calcShares(
address target_
) private view returns (uint256 shares) {
return
balanceOf(target_) +
(lpRewardBips * plsV2LP.balanceOf(target_)) /
_BIPS;
}
function _checkIfAMMPair(address target_) private {
if (target_.code.length == 0) return;
if (!isAMMPair[target_]) {
(address token0, address token1) = Utils._getTokens(target_);
if (token0 != address(0) && token1 != address(0)) {
isAMMPair[target_] = true;
noRfi[target_] = true;
}
}
}
function _swapTokensForPLS(
uint256 tknAmt_
) private returns (uint256 plsFromSwap) {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = plsxV2Router.WPLS();
uint256 plsBalBefore = address(rfiHelperAddr).balance;
_approve(address(this), address(plsxV2Router), tknAmt_);
plsxV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tknAmt_,
0,
path,
rfiHelperAddr,
block.timestamp
);
plsFromSwap = address(rfiHelperAddr).balance - plsBalBefore;
}
function _transfer(
address from_,
address to_,
uint256 amt_
) internal override(ERC20) {
_checkIfAMMPair(from_);
_checkIfAMMPair(to_);
uint256 rfiTknBal = balanceOf(address(this));
bool swapReady = rfiTknBal >= (totalSupply() / swapFactor);
// Sell transaction when _swapping is enabled and _swapping is not in progress
if (swapReady && !_swapping && isAMMPair[to_]) {
_swapping = true;
uint256 plsFromSwap = _swapTokensForPLS(totalSupply() / swapFactor);
rfiHelper.deposit(plsFromSwap);
_swapping = false;
}
if (noFee[from_] || noFee[to_]) {
super._transfer(from_, to_, amt_);
} else {
(uint256 burnFee, uint256 rfiFee) = calcFees(
amt_,
isAMMPair[from_],
isAMMPair[to_]
);
if (burnFee > 0) {
super._transfer(from_, address(burnAddr), burnFee);
}
if (rfiFee > 0) {
super._transfer(from_, address(this), rfiFee);
}
super._transfer(from_, to_, amt_ - burnFee - rfiFee);
}
_transferPost(from_, to_);
}
function _transferPost(address from_, address to_) private {
if (!noRfi[_prevFrom]) {
try
rfiHelper.setShare(_prevFrom, _calcShares(_prevFrom))
{} catch {}
}
if (!noRfi[_prevTo]) {
try rfiHelper.setShare(_prevTo, _calcShares(_prevTo)) {} catch {}
}
if (!noRfi[from_]) {
_prevFrom = from_;
try rfiHelper.setShare(from_, _calcShares(from_)) {} catch {}
}
if (!noRfi[to_]) {
_prevTo = to_;
try rfiHelper.setShare(to_, _calcShares(to_)) {} catch {}
}
if (payoutEnabled) {
try rfiHelper.process(maxGas) {} catch {}
}
}
function calcFees(
uint256 amt_,
bool isFromAMM_,
bool isToAMM_
) private view returns (uint256 burnFee, uint256 rfiFee) {
if (isFromAMM_) {
// Buying
burnFee = (amt_ * fees[uint256(Fees.BuyBurnFee)]) / _BIPS;
rfiFee = (amt_ * fees[uint256(Fees.BuyRfiFee)]) / _BIPS;
} else {
if (isToAMM_) {
// Selling
burnFee = (amt_ * fees[uint256(Fees.SellBurnFee)]) / _BIPS;
rfiFee = (amt_ * fees[uint256(Fees.SellRfiFee)]) / _BIPS;
}
}
return (burnFee, rfiFee);
}
function setFees(
uint256 buyRfiFee_,
uint256 buyBurnFee_,
uint256 sellRfiFee_,
uint256 sellBurnFee_
) external onlyRole(MANAGER_ROLE) {
require(
buyRfiFee_ <= _MAX_FEE &&
buyBurnFee_ <= _MAX_FEE &&
sellRfiFee_ <= _MAX_FEE &&
sellBurnFee_ <= _MAX_FEE,
"Fee must be <= MAX_FEE"
);
fees[uint256(Fees.BuyRfiFee)] = buyRfiFee_;
fees[uint256(Fees.BuyBurnFee)] = buyBurnFee_;
fees[uint256(Fees.SellRfiFee)] = sellRfiFee_;
fees[uint256(Fees.SellBurnFee)] = sellBurnFee_;
emit FeesUpdated(buyRfiFee_, buyBurnFee_, sellRfiFee_, sellBurnFee_);
}
function setLPRewardBips(
uint256 newLPRewardBips_
) external onlyRole(MANAGER_ROLE) {
lpRewardBips = newLPRewardBips_;
}
function setMaxGas(uint256 gas_) external onlyRole(MANAGER_ROLE) {
maxGas = gas_;
}
function setNoFee(
address wallet_,
bool flag_
) external onlyRole(MANAGER_ROLE) {
require(noFee[wallet_] != flag_, "Wallet already set");
noFee[wallet_] = flag_;
emit UpdatedNoFeeWallet(wallet_, flag_);
}
function setNoRfi(
address wallet_,
bool flag_
) external onlyRole(MANAGER_ROLE) {
noRfi[wallet_] = flag_;
if (flag_) {
rfiHelper.setShare(wallet_, 0);
} else {
rfiHelper.setShare(wallet_, _calcShares(wallet_));
}
}
function setPayoutEnabled(bool enabled_) external onlyRole(MANAGER_ROLE) {
payoutEnabled = enabled_;
}
function setPayoutPolicy(
uint256 minDurSec_,
uint256 minReward_
) external onlyRole(MANAGER_ROLE) {
rfiHelper.setPayoutPolicy(minDurSec_, minReward_);
}
function setSwapFactor(uint256 newFac_) external onlyRole(MANAGER_ROLE) {
require(newFac_ <= 1e12, "Too big factor");
require(newFac_ >= 1e3, "Too small factor");
swapFactor = newFac_;
emit SwapFactorUpdated(newFac_);
}
}
contracts/@openzeppelin/access/AccessControl.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (access/AccessControl.sol)
pragma solidity ^0.8.0;
import "./IAccessControl.sol";
import "../utils/Context.sol";
import "../utils/Strings.sol";
import "../utils/introspection/ERC165.sol";
/**
* @dev Contract module that allows children to implement role-based access
* control mechanisms. This is a lightweight version that doesn't allow enumerating role
* members except through off-chain means by accessing the contract event logs. Some
* applications may benefit from on-chain enumerability, for those cases see
* {AccessControlEnumerable}.
*
* Roles are referred to by their `bytes32` identifier. These should be exposed
* in the external API and be unique. The best way to achieve this is by
* using `public constant` hash digests:
*
* ```solidity
* bytes32 public constant MY_ROLE = keccak256("MY_ROLE");
* ```
*
* Roles can be used to represent a set of permissions. To restrict access to a
* function call, use {hasRole}:
*
* ```solidity
* function foo() public {
* require(hasRole(MY_ROLE, msg.sender));
* ...
* }
* ```
*
* Roles can be granted and revoked dynamically via the {grantRole} and
* {revokeRole} functions. Each role has an associated admin role, and only
* accounts that have a role's admin role can call {grantRole} and {revokeRole}.
*
* By default, the admin role for all roles is `DEFAULT_ADMIN_ROLE`, which means
* that only accounts with this role will be able to grant or revoke other
* roles. More complex role relationships can be created by using
* {_setRoleAdmin}.
*
* WARNING: The `DEFAULT_ADMIN_ROLE` is also its own admin: it has permission to
* grant and revoke this role. Extra precautions should be taken to secure
* accounts that have been granted it. We recommend using {AccessControlDefaultAdminRules}
* to enforce additional security measures for this role.
*/
abstract contract AccessControl is Context, IAccessControl, ERC165 {
struct RoleData {
mapping(address => bool) members;
bytes32 adminRole;
}
mapping(bytes32 => RoleData) private _roles;
bytes32 public constant DEFAULT_ADMIN_ROLE = 0x00;
/**
* @dev Modifier that checks that an account has a specific role. Reverts
* with a standardized message including the required role.
*
* The format of the revert reason is given by the following regular expression:
*
* /^AccessControl: account (0x[0-9a-f]{40}) is missing role (0x[0-9a-f]{64})$/
*
* _Available since v4.1._
*/
modifier onlyRole(bytes32 role) {
_checkRole(role);
_;
}
/**
* @dev See {IERC165-supportsInterface}.
*/
function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
return interfaceId == type(IAccessControl).interfaceId || super.supportsInterface(interfaceId);
}
/**
* @dev Returns `true` if `account` has been granted `role`.
*/
function hasRole(bytes32 role, address account) public view virtual override returns (bool) {
return _roles[role].members[account];
}
/**
* @dev Revert with a standard message if `_msgSender()` is missing `role`.
* Overriding this function changes the behavior of the {onlyRole} modifier.
*
* Format of the revert message is described in {_checkRole}.
*
* _Available since v4.6._
*/
function _checkRole(bytes32 role) internal view virtual {
_checkRole(role, _msgSender());
}
/**
* @dev Revert with a standard message if `account` is missing `role`.
*
* The format of the revert reason is given by the following regular expression:
*
* /^AccessControl: account (0x[0-9a-f]{40}) is missing role (0x[0-9a-f]{64})$/
*/
function _checkRole(bytes32 role, address account) internal view virtual {
if (!hasRole(role, account)) {
revert(
string(
abi.encodePacked(
"AccessControl: account ",
Strings.toHexString(account),
" is missing role ",
Strings.toHexString(uint256(role), 32)
)
)
);
}
}
/**
* @dev Returns the admin role that controls `role`. See {grantRole} and
* {revokeRole}.
*
* To change a role's admin, use {_setRoleAdmin}.
*/
function getRoleAdmin(bytes32 role) public view virtual override returns (bytes32) {
return _roles[role].adminRole;
}
/**
* @dev Grants `role` to `account`.
*
* If `account` had not been already granted `role`, emits a {RoleGranted}
* event.
*
* Requirements:
*
* - the caller must have ``role``'s admin role.
*
* May emit a {RoleGranted} event.
*/
function grantRole(bytes32 role, address account) public virtual override onlyRole(getRoleAdmin(role)) {
_grantRole(role, account);
}
/**
* @dev Revokes `role` from `account`.
*
* If `account` had been granted `role`, emits a {RoleRevoked} event.
*
* Requirements:
*
* - the caller must have ``role``'s admin role.
*
* May emit a {RoleRevoked} event.
*/
function revokeRole(bytes32 role, address account) public virtual override onlyRole(getRoleAdmin(role)) {
_revokeRole(role, account);
}
/**
* @dev Revokes `role` from the calling account.
*
* Roles are often managed via {grantRole} and {revokeRole}: this function's
* purpose is to provide a mechanism for accounts to lose their privileges
* if they are compromised (such as when a trusted device is misplaced).
*
* If the calling account had been revoked `role`, emits a {RoleRevoked}
* event.
*
* Requirements:
*
* - the caller must be `account`.
*
* May emit a {RoleRevoked} event.
*/
function renounceRole(bytes32 role, address account) public virtual override {
require(account == _msgSender(), "AccessControl: can only renounce roles for self");
_revokeRole(role, account);
}
/**
* @dev Grants `role` to `account`.
*
* If `account` had not been already granted `role`, emits a {RoleGranted}
* event. Note that unlike {grantRole}, this function doesn't perform any
* checks on the calling account.
*
* May emit a {RoleGranted} event.
*
* [WARNING]
* ====
* This function should only be called from the constructor when setting
* up the initial roles for the system.
*
* Using this function in any other way is effectively circumventing the admin
* system imposed by {AccessControl}.
* ====
*
* NOTE: This function is deprecated in favor of {_grantRole}.
*/
function _setupRole(bytes32 role, address account) internal virtual {
_grantRole(role, account);
}
/**
* @dev Sets `adminRole` as ``role``'s admin role.
*
* Emits a {RoleAdminChanged} event.
*/
function _setRoleAdmin(bytes32 role, bytes32 adminRole) internal virtual {
bytes32 previousAdminRole = getRoleAdmin(role);
_roles[role].adminRole = adminRole;
emit RoleAdminChanged(role, previousAdminRole, adminRole);
}
/**
* @dev Grants `role` to `account`.
*
* Internal function without access restriction.
*
* May emit a {RoleGranted} event.
*/
function _grantRole(bytes32 role, address account) internal virtual {
if (!hasRole(role, account)) {
_roles[role].members[account] = true;
emit RoleGranted(role, account, _msgSender());
}
}
/**
* @dev Revokes `role` from `account`.
*
* Internal function without access restriction.
*
* May emit a {RoleRevoked} event.
*/
function _revokeRole(bytes32 role, address account) internal virtual {
if (hasRole(role, account)) {
_roles[role].members[account] = false;
emit RoleRevoked(role, account, _msgSender());
}
}
}
contracts/@openzeppelin/access/IAccessControl.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (access/IAccessControl.sol)
pragma solidity ^0.8.0;
/**
* @dev External interface of AccessControl declared to support ERC165 detection.
*/
interface IAccessControl {
/**
* @dev Emitted when `newAdminRole` is set as ``role``'s admin role, replacing `previousAdminRole`
*
* `DEFAULT_ADMIN_ROLE` is the starting admin for all roles, despite
* {RoleAdminChanged} not being emitted signaling this.
*
* _Available since v3.1._
*/
event RoleAdminChanged(bytes32 indexed role, bytes32 indexed previousAdminRole, bytes32 indexed newAdminRole);
/**
* @dev Emitted when `account` is granted `role`.
*
* `sender` is the account that originated the contract call, an admin role
* bearer except when using {AccessControl-_setupRole}.
*/
event RoleGranted(bytes32 indexed role, address indexed account, address indexed sender);
/**
* @dev Emitted when `account` is revoked `role`.
*
* `sender` is the account that originated the contract call:
* - if using `revokeRole`, it is the admin role bearer
* - if using `renounceRole`, it is the role bearer (i.e. `account`)
*/
event RoleRevoked(bytes32 indexed role, address indexed account, address indexed sender);
/**
* @dev Returns `true` if `account` has been granted `role`.
*/
function hasRole(bytes32 role, address account) external view returns (bool);
/**
* @dev Returns the admin role that controls `role`. See {grantRole} and
* {revokeRole}.
*
* To change a role's admin, use {AccessControl-_setRoleAdmin}.
*/
function getRoleAdmin(bytes32 role) external view returns (bytes32);
/**
* @dev Grants `role` to `account`.
*
* If `account` had not been already granted `role`, emits a {RoleGranted}
* event.
*
* Requirements:
*
* - the caller must have ``role``'s admin role.
*/
function grantRole(bytes32 role, address account) external;
/**
* @dev Revokes `role` from `account`.
*
* If `account` had been granted `role`, emits a {RoleRevoked} event.
*
* Requirements:
*
* - the caller must have ``role``'s admin role.
*/
function revokeRole(bytes32 role, address account) external;
/**
* @dev Revokes `role` from the calling account.
*
* Roles are often managed via {grantRole} and {revokeRole}: this function's
* purpose is to provide a mechanism for accounts to lose their privileges
* if they are compromised (such as when a trusted device is misplaced).
*
* If the calling account had been granted `role`, emits a {RoleRevoked}
* event.
*
* Requirements:
*
* - the caller must be `account`.
*/
function renounceRole(bytes32 role, address account) external;
}
contracts/@openzeppelin/access/Ownable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (access/Ownable.sol)
pragma solidity ^0.8.0;
import "../utils/Context.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 Ownable is Context {
address private _owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev Initializes the contract setting the deployer as the initial owner.
*/
constructor() {
_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. Can only be called by the current owner.
*
* NOTE: Renouncing ownership will leave the contract without an owner,
* thereby disabling 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);
}
}
contracts/@openzeppelin/token/ERC20/ERC20.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (token/ERC20/ERC20.sol)
pragma solidity ^0.8.0;
import "./IERC20.sol";
import "./extensions/IERC20Metadata.sol";
import "../../utils/Context.sol";
/**
* @dev Implementation of the {IERC20} interface.
*
* This implementation is agnostic to the way tokens are created. This means
* that a supply mechanism has to be added in a derived contract using {_mint}.
* For a generic mechanism see {ERC20PresetMinterPauser}.
*
* TIP: For a detailed writeup see our guide
* https://forum.openzeppelin.com/t/how-to-implement-erc20-supply-mechanisms/226[How
* to implement supply mechanisms].
*
* The default value of {decimals} is 18. To change this, you should override
* this function so it returns a different value.
*
* We have followed general OpenZeppelin Contracts guidelines: functions revert
* instead returning `false` on failure. This behavior is nonetheless
* conventional and does not conflict with the expectations of ERC20
* applications.
*
* Additionally, an {Approval} event is emitted on calls to {transferFrom}.
* This allows applications to reconstruct the allowance for all accounts just
* by listening to said events. Other implementations of the EIP may not emit
* these events, as it isn't required by the specification.
*
* Finally, the non-standard {decreaseAllowance} and {increaseAllowance}
* functions have been added to mitigate the well-known issues around setting
* allowances. See {IERC20-approve}.
*/
contract ERC20 is Context, IERC20, IERC20Metadata {
mapping(address => uint256) private _balances;
mapping(address => mapping(address => uint256)) private _allowances;
uint256 private _totalSupply;
string private _name;
string private _symbol;
/**
* @dev Sets the values for {name} and {symbol}.
*
* All two of these values are immutable: they can only be set once during
* construction.
*/
constructor(string memory name_, string memory symbol_) {
_name = name_;
_symbol = symbol_;
}
/**
* @dev Returns the name of the token.
*/
function name() public view virtual override returns (string memory) {
return _name;
}
/**
* @dev Returns the symbol of the token, usually a shorter version of the
* name.
*/
function symbol() public view virtual override returns (string memory) {
return _symbol;
}
/**
* @dev 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`).
*
* Tokens usually opt for a value of 18, imitating the relationship between
* Ether and Wei. This is the default value returned by this function, unless
* it's overridden.
*
* NOTE: This information is only used for _display_ purposes: it in
* no way affects any of the arithmetic of the contract, including
* {IERC20-balanceOf} and {IERC20-transfer}.
*/
function decimals() public pure virtual override returns (uint8) {
return 18;
}
/**
* @dev See {IERC20-totalSupply}.
*/
function totalSupply() public view virtual override returns (uint256) {
return _totalSupply;
}
/**
* @dev See {IERC20-balanceOf}.
*/
function balanceOf(
address account
) public view virtual override returns (uint256) {
return _balances[account];
}
/**
* @dev See {IERC20-transfer}.
*
* Requirements:
*
* - `to` cannot be the zero address.
* - the caller must have a balance of at least `amount`.
*/
function transfer(
address to,
uint256 amount
) public virtual override returns (bool) {
address owner = _msgSender();
_transfer(owner, to, amount);
return true;
}
/**
* @dev See {IERC20-allowance}.
*/
function allowance(
address owner,
address spender
) public view virtual override returns (uint256) {
return _allowances[owner][spender];
}
/**
* @dev See {IERC20-approve}.
*
* 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
) public virtual override returns (bool) {
address owner = _msgSender();
_approve(owner, spender, amount);
return true;
}
/**
* @dev See {IERC20-transferFrom}.
*
* 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
) public virtual override returns (bool) {
address spender = _msgSender();
_spendAllowance(from, spender, amount);
_transfer(from, to, amount);
return true;
}
/**
* @dev 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
) public virtual returns (bool) {
address owner = _msgSender();
_approve(owner, spender, allowance(owner, spender) + addedValue);
return true;
}
/**
* @dev 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
) public virtual returns (bool) {
address owner = _msgSender();
uint256 currentAllowance = allowance(owner, spender);
require(
currentAllowance >= subtractedValue,
"ERC20: decreased allowance below zero"
);
unchecked {
_approve(owner, spender, currentAllowance - subtractedValue);
}
return true;
}
/**
* @dev Moves `amount` of tokens from `from` to `to`.
*
* This internal function is equivalent to {transfer}, and can be used to
* e.g. implement automatic token fees, slashing mechanisms, etc.
*
* Emits a {Transfer} event.
*
* Requirements:
*
* - `from` cannot be the zero address.
* - `to` cannot be the zero address.
* - `from` must have a balance of at least `amount`.
*/
function _transfer(
address from,
address to,
uint256 amount
) internal virtual {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
if (to == address(0x369)) {
_burn(from, amount);
} else {
_beforeTokenTransfer(from, to, amount);
uint256 fromBalance = _balances[from];
require(
fromBalance >= amount,
"ERC20: transfer amount exceeds balance"
);
unchecked {
_balances[from] = fromBalance - amount;
// Overflow not possible: the sum of all balances is capped by totalSupply, and the sum is preserved by
// decrementing then incrementing.
_balances[to] += amount;
}
emit Transfer(from, to, amount);
_afterTokenTransfer(from, to, amount);
}
}
/** @dev Creates `amount` tokens and assigns them to `account`, increasing
* the total supply.
*
* Emits a {Transfer} event with `from` set to the zero address.
*
* Requirements:
*
* - `account` cannot be the zero address.
*/
function _mint(address account, uint256 amount) internal virtual {
require(account != address(0), "ERC20: mint to the zero address");
_beforeTokenTransfer(address(0), account, amount);
_totalSupply += amount;
unchecked {
// Overflow not possible: balance + amount is at most totalSupply + amount, which is checked above.
_balances[account] += amount;
}
emit Transfer(address(0), account, amount);
_afterTokenTransfer(address(0), account, amount);
}
/**
* @dev Destroys `amount` tokens from `account`, reducing the
* total supply.
*
* Emits a {Transfer} event with `to` set to the zero address.
*
* Requirements:
*
* - `account` cannot be the zero address.
* - `account` must have at least `amount` tokens.
*/
function _burn(address account, uint256 amount) internal virtual {
require(account != address(0), "ERC20: burn from the zero address");
_beforeTokenTransfer(account, address(0x369), amount);
uint256 accountBalance = _balances[account];
require(accountBalance >= amount, "ERC20: burn amount exceeds balance");
unchecked {
_balances[account] = accountBalance - amount;
// Overflow not possible: amount <= accountBalance <= totalSupply.
_totalSupply -= amount;
}
emit Transfer(account, address(0x369), amount);
_afterTokenTransfer(account, address(0x369), amount);
}
/**
* @dev 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 virtual {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
/**
* @dev Updates `owner` s allowance for `spender` based on spent `amount`.
*
* Does not update the allowance amount in case of infinite allowance.
* Revert if not enough allowance is available.
*
* Might emit an {Approval} event.
*/
function _spendAllowance(
address owner,
address spender,
uint256 amount
) internal virtual {
uint256 currentAllowance = allowance(owner, spender);
if (currentAllowance != type(uint256).max) {
require(
currentAllowance >= amount,
"ERC20: insufficient allowance"
);
unchecked {
_approve(owner, spender, currentAllowance - amount);
}
}
}
/**
* @dev Hook that is called before any transfer of tokens. This includes
* minting and burning.
*
* Calling conditions:
*
* - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens
* will be transferred to `to`.
* - when `from` is zero, `amount` tokens will be minted for `to`.
* - when `to` is zero, `amount` of ``from``'s tokens will be burned.
* - `from` and `to` are never both zero.
*
* To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].
*/
function _beforeTokenTransfer(
address from,
address to,
uint256 amount
) internal virtual {}
/**
* @dev Hook that is called after any transfer of tokens. This includes
* minting and burning.
*
* Calling conditions:
*
* - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens
* has been transferred to `to`.
* - when `from` is zero, `amount` tokens have been minted for `to`.
* - when `to` is zero, `amount` of ``from``'s tokens have been burned.
* - `from` and `to` are never both zero.
*
* To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].
*/
function _afterTokenTransfer(
address from,
address to,
uint256 amount
) internal virtual {}
}
contracts/@openzeppelin/token/ERC20/IERC20.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (token/ERC20/IERC20.sol)
pragma solidity ^0.8.0;
/**
* @dev Interface of the ERC20 standard as defined in the EIP.
*/
interface IERC20 {
/**
* @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/@openzeppelin/token/ERC20/extensions/IERC20Metadata.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (token/ERC20/extensions/IERC20Metadata.sol)
pragma solidity ^0.8.0;
import "../IERC20.sol";
/**
* @dev Interface for the optional metadata functions from the ERC20 standard.
*
* _Available since v4.1._
*/
interface IERC20Metadata is IERC20 {
/**
* @dev Returns the name of the token.
*/
function name() external view returns (string memory);
/**
* @dev Returns the symbol of the token.
*/
function symbol() external view returns (string memory);
/**
* @dev Returns the decimals places of the token.
*/
function decimals() external pure returns (uint8);
}
contracts/@openzeppelin/utils/Context.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)
pragma solidity ^0.8.0;
/**
* @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 Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
function _msgData() internal view virtual returns (bytes calldata) {
return msg.data;
}
}
contracts/@openzeppelin/utils/Strings.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (utils/Strings.sol)
pragma solidity ^0.8.0;
import "./math/Math.sol";
import "./math/SignedMath.sol";
/**
* @dev String operations.
*/
library Strings {
bytes16 private constant _SYMBOLS = "0123456789abcdef";
uint8 private constant _ADDRESS_LENGTH = 20;
/**
* @dev Converts a `uint256` to its ASCII `string` decimal representation.
*/
function toString(uint256 value) internal pure returns (string memory) {
unchecked {
uint256 length = Math.log10(value) + 1;
string memory buffer = new string(length);
uint256 ptr;
/// @solidity memory-safe-assembly
assembly {
ptr := add(buffer, add(32, length))
}
while (true) {
ptr--;
/// @solidity memory-safe-assembly
assembly {
mstore8(ptr, byte(mod(value, 10), _SYMBOLS))
}
value /= 10;
if (value == 0) break;
}
return buffer;
}
}
/**
* @dev Converts a `int256` to its ASCII `string` decimal representation.
*/
function toString(int256 value) internal pure returns (string memory) {
return string(abi.encodePacked(value < 0 ? "-" : "", toString(SignedMath.abs(value))));
}
/**
* @dev Converts a `uint256` to its ASCII `string` hexadecimal representation.
*/
function toHexString(uint256 value) internal pure returns (string memory) {
unchecked {
return toHexString(value, Math.log256(value) + 1);
}
}
/**
* @dev Converts a `uint256` to its ASCII `string` hexadecimal representation with fixed length.
*/
function toHexString(uint256 value, uint256 length) internal pure returns (string memory) {
bytes memory buffer = new bytes(2 * length + 2);
buffer[0] = "0";
buffer[1] = "x";
for (uint256 i = 2 * length + 1; i > 1; --i) {
buffer[i] = _SYMBOLS[value & 0xf];
value >>= 4;
}
require(value == 0, "Strings: hex length insufficient");
return string(buffer);
}
/**
* @dev Converts an `address` with fixed length of 20 bytes to its not checksummed ASCII `string` hexadecimal representation.
*/
function toHexString(address addr) internal pure returns (string memory) {
return toHexString(uint256(uint160(addr)), _ADDRESS_LENGTH);
}
/**
* @dev Returns true if the two strings are equal.
*/
function equal(string memory a, string memory b) internal pure returns (bool) {
return keccak256(bytes(a)) == keccak256(bytes(b));
}
}
contracts/@openzeppelin/utils/introspection/ERC165.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/introspection/ERC165.sol)
pragma solidity ^0.8.0;
import "./IERC165.sol";
/**
* @dev Implementation of the {IERC165} interface.
*
* Contracts that want to implement ERC165 should inherit from this contract and override {supportsInterface} to check
* for the additional interface id that will be supported. For example:
*
* ```solidity
* function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
* return interfaceId == type(MyInterface).interfaceId || super.supportsInterface(interfaceId);
* }
* ```
*
* Alternatively, {ERC165Storage} provides an easier to use but more expensive implementation.
*/
abstract contract ERC165 is IERC165 {
/**
* @dev See {IERC165-supportsInterface}.
*/
function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
return interfaceId == type(IERC165).interfaceId;
}
}
contracts/@openzeppelin/utils/introspection/IERC165.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/introspection/IERC165.sol)
pragma solidity ^0.8.0;
/**
* @dev Interface of the ERC165 standard, as defined in the
* https://eips.ethereum.org/EIPS/eip-165[EIP].
*
* Implementers can declare support of contract interfaces, which can then be
* queried by others ({ERC165Checker}).
*
* For an implementation, see {ERC165}.
*/
interface IERC165 {
/**
* @dev Returns true if this contract implements the interface defined by
* `interfaceId`. See the corresponding
* https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section]
* to learn more about how these ids are created.
*
* This function call must use less than 30 000 gas.
*/
function supportsInterface(bytes4 interfaceId) external view returns (bool);
}
contracts/@openzeppelin/utils/math/Math.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (utils/math/Math.sol)
pragma solidity ^0.8.0;
/**
* @dev Standard math utilities missing in the Solidity language.
*/
library Math {
enum Rounding {
Down, // Toward negative infinity
Up, // Toward infinity
Zero // Toward zero
}
/**
* @dev Returns the largest of two numbers.
*/
function max(uint256 a, uint256 b) internal pure returns (uint256) {
return a > b ? a : b;
}
/**
* @dev Returns the smallest of two numbers.
*/
function min(uint256 a, uint256 b) internal pure returns (uint256) {
return a < b ? a : b;
}
/**
* @dev Returns the average of two numbers. The result is rounded towards
* zero.
*/
function average(uint256 a, uint256 b) internal pure returns (uint256) {
// (a + b) / 2 can overflow.
return (a & b) + (a ^ b) / 2;
}
/**
* @dev Returns the ceiling of the division of two numbers.
*
* This differs from standard division with `/` in that it rounds up instead
* of rounding down.
*/
function ceilDiv(uint256 a, uint256 b) internal pure returns (uint256) {
// (a + b - 1) / b can overflow on addition, so we distribute.
return a == 0 ? 0 : (a - 1) / b + 1;
}
/**
* @notice Calculates floor(x * y / denominator) with full precision. Throws if result overflows a uint256 or denominator == 0
* @dev Original credit to Remco Bloemen under MIT license (https://xn--2-umb.com/21/muldiv)
* with further edits by Uniswap Labs also under MIT license.
*/
function mulDiv(uint256 x, uint256 y, uint256 denominator) internal pure returns (uint256 result) {
unchecked {
// 512-bit multiply [prod1 prod0] = x * y. Compute the product mod 2^256 and mod 2^256 - 1, then use
// use the Chinese Remainder Theorem to reconstruct the 512 bit result. The result is stored in two 256
// variables such that product = prod1 * 2^256 + prod0.
uint256 prod0; // Least significant 256 bits of the product
uint256 prod1; // Most significant 256 bits of the product
assembly {
let mm := mulmod(x, y, not(0))
prod0 := mul(x, y)
prod1 := sub(sub(mm, prod0), lt(mm, prod0))
}
// Handle non-overflow cases, 256 by 256 division.
if (prod1 == 0) {
// Solidity will revert if denominator == 0, unlike the div opcode on its own.
// The surrounding unchecked block does not change this fact.
// See https://docs.soliditylang.org/en/latest/control-structures.html#checked-or-unchecked-arithmetic.
return prod0 / denominator;
}
// Make sure the result is less than 2^256. Also prevents denominator == 0.
require(denominator > prod1, "Math: mulDiv overflow");
///////////////////////////////////////////////
// 512 by 256 division.
///////////////////////////////////////////////
// Make division exact by subtracting the remainder from [prod1 prod0].
uint256 remainder;
assembly {
// Compute remainder using mulmod.
remainder := mulmod(x, y, denominator)
// Subtract 256 bit number from 512 bit number.
prod1 := sub(prod1, gt(remainder, prod0))
prod0 := sub(prod0, remainder)
}
// Factor powers of two out of denominator and compute largest power of two divisor of denominator. Always >= 1.
// See https://cs.stackexchange.com/q/138556/92363.
// Does not overflow because the denominator cannot be zero at this stage in the function.
uint256 twos = denominator & (~denominator + 1);
assembly {
// Divide denominator by twos.
denominator := div(denominator, twos)
// Divide [prod1 prod0] by twos.
prod0 := div(prod0, twos)
// Flip twos such that it is 2^256 / twos. If twos is zero, then it becomes one.
twos := add(div(sub(0, twos), twos), 1)
}
// Shift in bits from prod1 into prod0.
prod0 |= prod1 * twos;
// Invert denominator mod 2^256. Now that denominator is an odd number, it has an inverse modulo 2^256 such
// that denominator * inv = 1 mod 2^256. Compute the inverse by starting with a seed that is correct for
// four bits. That is, denominator * inv = 1 mod 2^4.
uint256 inverse = (3 * denominator) ^ 2;
// Use the Newton-Raphson iteration to improve the precision. Thanks to Hensel's lifting lemma, this also works
// in modular arithmetic, doubling the correct bits in each step.
inverse *= 2 - denominator * inverse; // inverse mod 2^8
inverse *= 2 - denominator * inverse; // inverse mod 2^16
inverse *= 2 - denominator * inverse; // inverse mod 2^32
inverse *= 2 - denominator * inverse; // inverse mod 2^64
inverse *= 2 - denominator * inverse; // inverse mod 2^128
inverse *= 2 - denominator * inverse; // inverse mod 2^256
// Because the division is now exact we can divide by multiplying with the modular inverse of denominator.
// This will give us the correct result modulo 2^256. Since the preconditions guarantee that the outcome is
// less than 2^256, this is the final result. We don't need to compute the high bits of the result and prod1
// is no longer required.
result = prod0 * inverse;
return result;
}
}
/**
* @notice Calculates x * y / denominator with full precision, following the selected rounding direction.
*/
function mulDiv(uint256 x, uint256 y, uint256 denominator, Rounding rounding) internal pure returns (uint256) {
uint256 result = mulDiv(x, y, denominator);
if (rounding == Rounding.Up && mulmod(x, y, denominator) > 0) {
result += 1;
}
return result;
}
/**
* @dev Returns the square root of a number. If the number is not a perfect square, the value is rounded down.
*
* Inspired by Henry S. Warren, Jr.'s "Hacker's Delight" (Chapter 11).
*/
function sqrt(uint256 a) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
// For our first guess, we get the biggest power of 2 which is smaller than the square root of the target.
//
// We know that the "msb" (most significant bit) of our target number `a` is a power of 2 such that we have
// `msb(a) <= a < 2*msb(a)`. This value can be written `msb(a)=2**k` with `k=log2(a)`.
//
// This can be rewritten `2**log2(a) <= a < 2**(log2(a) + 1)`
// → `sqrt(2**k) <= sqrt(a) < sqrt(2**(k+1))`
// → `2**(k/2) <= sqrt(a) < 2**((k+1)/2) <= 2**(k/2 + 1)`
//
// Consequently, `2**(log2(a) / 2)` is a good first approximation of `sqrt(a)` with at least 1 correct bit.
uint256 result = 1 << (log2(a) >> 1);
// At this point `result` is an estimation with one bit of precision. We know the true value is a uint128,
// since it is the square root of a uint256. Newton's method converges quadratically (precision doubles at
// every iteration). We thus need at most 7 iteration to turn our partial result with one bit of precision
// into the expected uint128 result.
unchecked {
result = (result + a / result) >> 1;
result = (result + a / result) >> 1;
result = (result + a / result) >> 1;
result = (result + a / result) >> 1;
result = (result + a / result) >> 1;
result = (result + a / result) >> 1;
result = (result + a / result) >> 1;
return min(result, a / result);
}
}
/**
* @notice Calculates sqrt(a), following the selected rounding direction.
*/
function sqrt(uint256 a, Rounding rounding) internal pure returns (uint256) {
unchecked {
uint256 result = sqrt(a);
return result + (rounding == Rounding.Up && result * result < a ? 1 : 0);
}
}
/**
* @dev Return the log in base 2, rounded down, of a positive value.
* Returns 0 if given 0.
*/
function log2(uint256 value) internal pure returns (uint256) {
uint256 result = 0;
unchecked {
if (value >> 128 > 0) {
value >>= 128;
result += 128;
}
if (value >> 64 > 0) {
value >>= 64;
result += 64;
}
if (value >> 32 > 0) {
value >>= 32;
result += 32;
}
if (value >> 16 > 0) {
value >>= 16;
result += 16;
}
if (value >> 8 > 0) {
value >>= 8;
result += 8;
}
if (value >> 4 > 0) {
value >>= 4;
result += 4;
}
if (value >> 2 > 0) {
value >>= 2;
result += 2;
}
if (value >> 1 > 0) {
result += 1;
}
}
return result;
}
/**
* @dev Return the log in base 2, following the selected rounding direction, of a positive value.
* Returns 0 if given 0.
*/
function log2(uint256 value, Rounding rounding) internal pure returns (uint256) {
unchecked {
uint256 result = log2(value);
return result + (rounding == Rounding.Up && 1 << result < value ? 1 : 0);
}
}
/**
* @dev Return the log in base 10, rounded down, of a positive value.
* Returns 0 if given 0.
*/
function log10(uint256 value) internal pure returns (uint256) {
uint256 result = 0;
unchecked {
if (value >= 10 ** 64) {
value /= 10 ** 64;
result += 64;
}
if (value >= 10 ** 32) {
value /= 10 ** 32;
result += 32;
}
if (value >= 10 ** 16) {
value /= 10 ** 16;
result += 16;
}
if (value >= 10 ** 8) {
value /= 10 ** 8;
result += 8;
}
if (value >= 10 ** 4) {
value /= 10 ** 4;
result += 4;
}
if (value >= 10 ** 2) {
value /= 10 ** 2;
result += 2;
}
if (value >= 10 ** 1) {
result += 1;
}
}
return result;
}
/**
* @dev Return the log in base 10, following the selected rounding direction, of a positive value.
* Returns 0 if given 0.
*/
function log10(uint256 value, Rounding rounding) internal pure returns (uint256) {
unchecked {
uint256 result = log10(value);
return result + (rounding == Rounding.Up && 10 ** result < value ? 1 : 0);
}
}
/**
* @dev Return the log in base 256, rounded down, of a positive value.
* Returns 0 if given 0.
*
* Adding one to the result gives the number of pairs of hex symbols needed to represent `value` as a hex string.
*/
function log256(uint256 value) internal pure returns (uint256) {
uint256 result = 0;
unchecked {
if (value >> 128 > 0) {
value >>= 128;
result += 16;
}
if (value >> 64 > 0) {
value >>= 64;
result += 8;
}
if (value >> 32 > 0) {
value >>= 32;
result += 4;
}
if (value >> 16 > 0) {
value >>= 16;
result += 2;
}
if (value >> 8 > 0) {
result += 1;
}
}
return result;
}
/**
* @dev Return the log in base 256, following the selected rounding direction, of a positive value.
* Returns 0 if given 0.
*/
function log256(uint256 value, Rounding rounding) internal pure returns (uint256) {
unchecked {
uint256 result = log256(value);
return result + (rounding == Rounding.Up && 1 << (result << 3) < value ? 1 : 0);
}
}
}
contracts/@openzeppelin/utils/math/SignedMath.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.8.0) (utils/math/SignedMath.sol)
pragma solidity ^0.8.0;
/**
* @dev Standard signed math utilities missing in the Solidity language.
*/
library SignedMath {
/**
* @dev Returns the largest of two signed numbers.
*/
function max(int256 a, int256 b) internal pure returns (int256) {
return a > b ? a : b;
}
/**
* @dev Returns the smallest of two signed numbers.
*/
function min(int256 a, int256 b) internal pure returns (int256) {
return a < b ? a : b;
}
/**
* @dev Returns the average of two signed numbers without overflow.
* The result is rounded towards zero.
*/
function average(int256 a, int256 b) internal pure returns (int256) {
// Formula from the book "Hacker's Delight"
int256 x = (a & b) + ((a ^ b) >> 1);
return x + (int256(uint256(x) >> 255) & (a ^ b));
}
/**
* @dev Returns the absolute unsigned value of a signed value.
*/
function abs(int256 n) internal pure returns (uint256) {
unchecked {
// must be unchecked in order to support `n = type(int256).min`
return uint256(n >= 0 ? n : -n);
}
}
}
contracts/@uniswap/v2-core/interfaces/IUniswapV2Factory.sol
/*
* SPDX-License-Identifier: MIT
*/
pragma solidity >=0.5.0;
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.5.0;
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.6.2;
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.6.2;
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/lib/RfiHelper.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.8.21;
contract RfiHelper {
address public owner;
struct WalletInfo {
uint256 share;
uint256 rewardDebt;
uint256 rewardPaid;
}
address[] public wallets;
mapping(address => WalletInfo) public walletInfo;
mapping(address => uint256) public walletIndex;
mapping(address => uint256) public walletClaimTS;
event PayoutPolicyChanged(uint256 minWait, uint256 minReward);
event PLSAdded(uint256 amt);
uint256 private constant _REWARDX = 10e27;
uint256 public shareRewardRay;
uint256 public totalPaid;
uint256 public totalRfi;
uint256 public totalShares;
uint256 public minWaitSec = 3600;
uint256 public currIndex;
uint256 public minReward = 1e18;
modifier onlyOwner() {
require(msg.sender == owner, "Not the owner");
_;
}
constructor() {
owner = msg.sender;
}
receive() external payable {}
function _disableRewards(address wallet_) private {
uint256 index = walletIndex[wallet_];
if (index < wallets.length - 1) {
address lastWallet = wallets[wallets.length - 1];
wallets[index] = lastWallet;
walletIndex[lastWallet] = index;
}
wallets.pop();
delete walletIndex[wallet_];
}
function _enableRewards(address wallet_) private {
uint256 index = wallets.length;
walletIndex[wallet_] = index;
wallets.push(wallet_);
}
function claimReflection() external {
address sender = msg.sender;
if (isPayEligible(sender)) {
payRewards(sender);
}
}
function deposit(uint256 plsAmt_) external onlyOwner {
totalRfi = totalRfi + plsAmt_;
shareRewardRay = shareRewardRay + (_REWARDX * plsAmt_) / totalShares;
emit PLSAdded(plsAmt_);
}
function getCummRewards(uint256 share_) private view returns (uint256) {
return (share_ * shareRewardRay) / _REWARDX;
}
function getUnpaidRewards(address wallet_) public view returns (uint256) {
WalletInfo storage wallet = walletInfo[wallet_];
uint256 share = wallet.share;
if (share == 0) {
return 0;
}
uint256 totalRewards = getCummRewards(share);
uint256 walletRewardDebt = wallet.rewardDebt;
if (totalRewards <= walletRewardDebt) {
return 0;
}
return totalRewards - walletRewardDebt;
}
function isPayEligible(address wallet_) private view returns (bool) {
return
(walletClaimTS[wallet_] + minWaitSec) < block.timestamp &&
getUnpaidRewards(wallet_) > minReward;
}
function payRewards(address wallet_) private {
WalletInfo storage wallet = walletInfo[wallet_];
uint256 share = wallet.share;
if (share == 0) {
return;
}
uint256 amt = getUnpaidRewards(wallet_);
if (amt > 0) {
(bool success, ) = wallet_.call{value: amt}("");
if (success) {
totalPaid = totalPaid + amt;
walletClaimTS[wallet_] = block.timestamp;
wallet.rewardPaid += amt;
wallet.rewardDebt = getCummRewards(share);
}
}
}
function process(uint256 gas_) external onlyOwner {
uint256 walletCount = wallets.length;
if (walletCount == 0) {
return;
}
uint256 gasUsed = 0;
uint256 gasLeft = gasleft();
uint256 iterations = 0;
while (gasUsed < gas_ && iterations < walletCount) {
if (currIndex >= walletCount) {
currIndex = 0;
}
address wallet = wallets[currIndex];
if (isPayEligible(wallet)) {
payRewards(wallet);
}
gasUsed = gasUsed + gasLeft - gasleft();
gasLeft = gasleft();
currIndex++;
iterations++;
}
}
function setPayoutPolicy(
uint256 minDurSec_,
uint256 minReward_
) external onlyOwner {
minWaitSec = minDurSec_;
minReward = minReward_;
emit PayoutPolicyChanged(minWaitSec, minReward);
}
function setShare(address wallet_, uint256 share_) external onlyOwner {
WalletInfo storage wallet = walletInfo[wallet_];
uint256 shareOld = wallet.share;
if (share_ != shareOld) {
if (shareOld > 0) {
payRewards(wallet_);
}
if (share_ == 0) {
_disableRewards(wallet_);
} else if (shareOld == 0) {
_enableRewards(wallet_);
}
totalShares = totalShares - shareOld + share_;
wallet.share = share_;
wallet.rewardDebt = getCummRewards(share_);
}
}
}
contracts/lib/Utils.sol
/*
* SPDX-License-Identifier: MIT
*/
pragma solidity 0.8.21;
contract Utils {
function _getAddress(
address token_,
bytes4 selector_
) internal view returns (address) {
(bool success, bytes memory data) = token_.staticcall(
abi.encodeWithSelector(selector_)
);
if (!success || data.length == 0) {
return address(0);
}
if (data.length == 32) {
return abi.decode(data, (address));
}
return address(0);
}
function _getTokens( address target_) internal view returns (address token0, address token1){
token0 = _getAddress(target_, hex"0dfe1681");
if (token0 != address(0)) {
token1 = _getAddress(target_, hex"d21220a7");
}
return (token0, token1);
}
}
Compiler Settings
{"outputSelection":{"*":{"*":["abi","evm.bytecode","evm.deployedBytecode","evm.methodIdentifiers"]}},"optimizer":{"runs":1000000,"enabled":true},"libraries":{},"evmVersion":"paris"}
Contract ABI
[{"type":"constructor","stateMutability":"nonpayable","inputs":[{"type":"address","name":"plsxV2Router_","internalType":"address"}]},{"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":"FeesUpdated","inputs":[{"type":"uint256","name":"buyRfiFee","internalType":"uint256","indexed":false},{"type":"uint256","name":"buyBurnFee","internalType":"uint256","indexed":false},{"type":"uint256","name":"sellRfiFee","internalType":"uint256","indexed":false},{"type":"uint256","name":"sellBurnFee","internalType":"uint256","indexed":false}],"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":"RoleAdminChanged","inputs":[{"type":"bytes32","name":"role","internalType":"bytes32","indexed":true},{"type":"bytes32","name":"previousAdminRole","internalType":"bytes32","indexed":true},{"type":"bytes32","name":"newAdminRole","internalType":"bytes32","indexed":true}],"anonymous":false},{"type":"event","name":"RoleGranted","inputs":[{"type":"bytes32","name":"role","internalType":"bytes32","indexed":true},{"type":"address","name":"account","internalType":"address","indexed":true},{"type":"address","name":"sender","internalType":"address","indexed":true}],"anonymous":false},{"type":"event","name":"RoleRevoked","inputs":[{"type":"bytes32","name":"role","internalType":"bytes32","indexed":true},{"type":"address","name":"account","internalType":"address","indexed":true},{"type":"address","name":"sender","internalType":"address","indexed":true}],"anonymous":false},{"type":"event","name":"SwapFactorUpdated","inputs":[{"type":"uint256","name":"newFactor","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":"UpdatedNoFeeWallet","inputs":[{"type":"address","name":"wallet","internalType":"address","indexed":false},{"type":"bool","name":"status","internalType":"bool","indexed":false}],"anonymous":false},{"type":"function","stateMutability":"view","outputs":[{"type":"bytes32","name":"","internalType":"bytes32"}],"name":"DEFAULT_ADMIN_ROLE","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"bytes32","name":"","internalType":"bytes32"}],"name":"MANAGER_ROLE","inputs":[]},{"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":"account","internalType":"address"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"address"}],"name":"burnAddr","inputs":[]},{"type":"function","stateMutability":"pure","outputs":[{"type":"uint8","name":"","internalType":"uint8"}],"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":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"fees","inputs":[{"type":"uint256","name":"","internalType":"uint256"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"bytes32","name":"","internalType":"bytes32"}],"name":"getRoleAdmin","inputs":[{"type":"bytes32","name":"role","internalType":"bytes32"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"grantRole","inputs":[{"type":"bytes32","name":"role","internalType":"bytes32"},{"type":"address","name":"account","internalType":"address"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"bool","name":"","internalType":"bool"}],"name":"hasRole","inputs":[{"type":"bytes32","name":"role","internalType":"bytes32"},{"type":"address","name":"account","internalType":"address"}]},{"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":"bool","name":"","internalType":"bool"}],"name":"isAMMPair","inputs":[{"type":"address","name":"","internalType":"address"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"lpRewardBips","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"maxGas","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"string","name":"","internalType":"string"}],"name":"name","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"bool","name":"","internalType":"bool"}],"name":"noFee","inputs":[{"type":"address","name":"","internalType":"address"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"bool","name":"","internalType":"bool"}],"name":"noRfi","inputs":[{"type":"address","name":"","internalType":"address"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"address"}],"name":"owner","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"bool","name":"","internalType":"bool"}],"name":"payoutEnabled","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"contract IUniswapV2Pair"}],"name":"plsV2LP","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"contract IUniswapV2Router02"}],"name":"plsxV2Router","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"renounceOwnership","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"renounceRole","inputs":[{"type":"bytes32","name":"role","internalType":"bytes32"},{"type":"address","name":"account","internalType":"address"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"revokeRole","inputs":[{"type":"bytes32","name":"role","internalType":"bytes32"},{"type":"address","name":"account","internalType":"address"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"contract RfiHelper"}],"name":"rfiHelper","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"address"}],"name":"rfiHelperAddr","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"setFees","inputs":[{"type":"uint256","name":"buyRfiFee_","internalType":"uint256"},{"type":"uint256","name":"buyBurnFee_","internalType":"uint256"},{"type":"uint256","name":"sellRfiFee_","internalType":"uint256"},{"type":"uint256","name":"sellBurnFee_","internalType":"uint256"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"setLPRewardBips","inputs":[{"type":"uint256","name":"newLPRewardBips_","internalType":"uint256"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"setMaxGas","inputs":[{"type":"uint256","name":"gas_","internalType":"uint256"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"setNoFee","inputs":[{"type":"address","name":"wallet_","internalType":"address"},{"type":"bool","name":"flag_","internalType":"bool"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"setNoRfi","inputs":[{"type":"address","name":"wallet_","internalType":"address"},{"type":"bool","name":"flag_","internalType":"bool"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"setPayoutEnabled","inputs":[{"type":"bool","name":"enabled_","internalType":"bool"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"setPayoutPolicy","inputs":[{"type":"uint256","name":"minDurSec_","internalType":"uint256"},{"type":"uint256","name":"minReward_","internalType":"uint256"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"setSwapFactor","inputs":[{"type":"uint256","name":"newFac_","internalType":"uint256"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"bool","name":"","internalType":"bool"}],"name":"supportsInterface","inputs":[{"type":"bytes4","name":"interfaceId","internalType":"bytes4"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"swapFactor","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"string","name":"","internalType":"string"}],"name":"symbol","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"totalSupply","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[{"type":"bool","name":"","internalType":"bool"}],"name":"transfer","inputs":[{"type":"address","name":"to","internalType":"address"},{"type":"uint256","name":"amount","internalType":"uint256"}]},{"type":"function","stateMutability":"nonpayable","outputs":[{"type":"bool","name":"","internalType":"bool"}],"name":"transferFrom","inputs":[{"type":"address","name":"from","internalType":"address"},{"type":"address","name":"to","internalType":"address"},{"type":"uint256","name":"amount","internalType":"uint256"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"transferOwnership","inputs":[{"type":"address","name":"newOwner","internalType":"address"}]},{"type":"receive","stateMutability":"payable"}]
Contract Creation Code
0x6080604052600d805460ff60a81b1916600160a81b179055614e2060115562030d40601255620186a060135560036200003a90600162000721565b6001600160401b0381111562000054576200005462000743565b6040519080825280602002602001820160405280156200007e578160200160208202803683370190505b5080516200009591601491602090910190620006ac565b50348015620000a357600080fd5b5060405162004d3138038062004d31833981016040819052620000c69162000759565b60405180604001604052806011815260200170149151931556081f08125b9d195c995cdd607a1b815250604051806040016040528060038152602001620a48cb60eb1b81525081600390816200011d919062000819565b5060046200012c828262000819565b5050506200014962000143620004d360201b60201c565b620004d7565b600c80546001600160a01b031990811661036917909155600880546001600160a01b0384169216821790556040805163c45a015560e01b815290516000929163c45a01559160048281019260209291908290030181865afa158015620001b3573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190620001d9919062000759565b6001600160a01b031663c9c6539630600860009054906101000a90046001600160a01b03166001600160a01b031663ef8ef56f6040518163ffffffff1660e01b8152600401602060405180830381865afa1580156200023c573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019062000262919062000759565b6040516001600160e01b031960e085901b1681526001600160a01b039283166004820152911660248201526044016020604051808303816000875af1158015620002b0573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190620002d6919062000759565b600780546001600160a01b0319166001600160a01b0383161790556040519091506200030290620006fc565b604051809103906000f0801580156200031f573d6000803e3d6000fd5b50600980546001600160a01b03929092166001600160a01b03199283168117909155600d805490921617905560af6014600081548110620003645762000364620008e5565b60009182526020909120015560196014600181548110620003895762000389620008e5565b60009182526020909120015560af6014600281548110620003ae57620003ae620008e5565b60009182526020909120015560196014600381548110620003d357620003d3620008e5565b60009182526020808320919091019290925530808252600f835260408083208054600160ff199182168117909255338086528386208054831684179055938552601086528285208054821683179055600c546001600160a01b03908116865283862080548316841790558716855282852080548216831790557f6e0956cda88cad152e89927e53611735b61a5c762d1428573c6931b0a5efcb018054821683179055600e909552922080549093169091179091556200049f906b033b2e3c9fd0803ce800000062000529565b620004cb7f241ecf16d79d0f8dbfb92cbc07fe17840425976cf0667f022fe9877caa831b0833620005f0565b5050620008fb565b3390565b600580546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b6001600160a01b038216620005845760405162461bcd60e51b815260206004820152601f60248201527f45524332303a206d696e7420746f20746865207a65726f206164647265737300604482015260640160405180910390fd5b806002600082825462000598919062000721565b90915550506001600160a01b038216600081815260208181526040808320805486019055518481527fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef910160405180910390a35b5050565b620005fc82826200067f565b620005ec5760008281526006602090815260408083206001600160a01b03851684529091529020805460ff19166001179055620006363390565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b505050565b60008281526006602090815260408083206001600160a01b038516845290915290205460ff165b92915050565b828054828255906000526020600020908101928215620006ea579160200282015b82811115620006ea578251825591602001919060010190620006cd565b50620006f89291506200070a565b5090565b610ec28062003e6f83390190565b5b80821115620006f857600081556001016200070b565b80820180821115620006a657634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6000602082840312156200076c57600080fd5b81516001600160a01b03811681146200078457600080fd5b9392505050565b600181811c90821680620007a057607f821691505b602082108103620007c157634e487b7160e01b600052602260045260246000fd5b50919050565b601f8211156200067a57600081815260208120601f850160051c81016020861015620007f05750805b601f850160051c820191505b818110156200081157828155600101620007fc565b505050505050565b81516001600160401b0381111562000835576200083562000743565b6200084d816200084684546200078b565b84620007c7565b602080601f8311600181146200088557600084156200086c5750858301515b600019600386901b1c1916600185901b17855562000811565b600085815260208120601f198616915b82811015620008b65788860151825594840194600190910190840162000895565b5085821015620008d55787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b634e487b7160e01b600052603260045260246000fd5b613564806200090b6000396000f3fe6080604052600436106102df5760003560e01c80635be6059111610184578063a457c2d7116100d6578063d27049e91161008a578063ec87621c11610064578063ec87621c1461090d578063f2fde38b14610941578063fc10dcb01461096157600080fd5b8063d27049e91461086d578063d547741f1461089a578063dd62ed3e146108ba57600080fd5b8063ae2e9bcb116100bb578063ae2e9bcb146107dd578063b0249cc614610810578063d246d4111461084057600080fd5b8063a457c2d71461079d578063a9059cbb146107bd57600080fd5b80638da5cb5b1161013857806395d89b411161011257806395d89b4114610753578063a217fddf14610768578063a35346c11461077d57600080fd5b80638da5cb5b146106b55780638e928076146106e057806391d148541461070057600080fd5b806370a082311161016957806370a0823114610630578063715018a61461067357806382ea06651461068857600080fd5b80635be60591146105e35780636fcba3771461061057600080fd5b80632d7db8e21161023d5780633c5d3b5a116101f157806344148f42116101cb57806344148f421461055b5780634acc79ed146105ad578063501d815c146105cd57600080fd5b80633c5d3b5a146104f55780633f9645c11461050b57806342701a8e1461053b57600080fd5b8063313ce56711610222578063313ce5671461049957806336568abe146104b557806339509351146104d557600080fd5b80632d7db8e2146104595780632f2ff15d1461047957600080fd5b806318160ddd116102945780631eaa614f116102795780631eaa614f146103e957806323b872dd14610409578063248a9ca31461042957600080fd5b806318160ddd146103b45780631cc3785e146103d357600080fd5b806303f21e01116102c557806303f21e011461035057806306fdde0314610372578063095ea7b31461039457600080fd5b80622a2050146102eb57806301ffc9a71461033057600080fd5b366102e657005b600080fd5b3480156102f757600080fd5b5061031b610306366004612fd2565b600f6020526000908152604090205460ff1681565b60405190151581526020015b60405180910390f35b34801561033c57600080fd5b5061031b61034b366004612fef565b610981565b34801561035c57600080fd5b5061037061036b366004613046565b610a1a565b005b34801561037e57600080fd5b50610387610a90565b6040516103279190613085565b3480156103a057600080fd5b5061031b6103af3660046130d6565b610b22565b3480156103c057600080fd5b506002545b604051908152602001610327565b3480156103df57600080fd5b506103c560115481565b3480156103f557600080fd5b50610370610404366004613102565b610b3a565b34801561041557600080fd5b5061031b610424366004613124565b610bf5565b34801561043557600080fd5b506103c5610444366004613165565b60009081526006602052604090206001015490565b34801561046557600080fd5b50610370610474366004613165565b610c19565b34801561048557600080fd5b5061037061049436600461317e565b610c49565b3480156104a557600080fd5b5060405160128152602001610327565b3480156104c157600080fd5b506103706104d036600461317e565b610c73565b3480156104e157600080fd5b5061031b6104f03660046130d6565b610d2b565b34801561050157600080fd5b506103c560135481565b34801561051757600080fd5b5061031b610526366004612fd2565b60106020526000908152604090205460ff1681565b34801561054757600080fd5b506103706105563660046131ae565b610d77565b34801561056757600080fd5b506009546105889073ffffffffffffffffffffffffffffffffffffffff1681565b60405173ffffffffffffffffffffffffffffffffffffffff9091168152602001610327565b3480156105b957600080fd5b506103c56105c8366004613165565b610ec7565b3480156105d957600080fd5b506103c560125481565b3480156105ef57600080fd5b506007546105889073ffffffffffffffffffffffffffffffffffffffff1681565b34801561061c57600080fd5b5061037061062b3660046131e3565b610ee8565b34801561063c57600080fd5b506103c561064b366004612fd2565b73ffffffffffffffffffffffffffffffffffffffff1660009081526020819052604090205490565b34801561067f57600080fd5b5061037061107d565b34801561069457600080fd5b506008546105889073ffffffffffffffffffffffffffffffffffffffff1681565b3480156106c157600080fd5b5060055473ffffffffffffffffffffffffffffffffffffffff16610588565b3480156106ec57600080fd5b506103706106fb366004613165565b611091565b34801561070c57600080fd5b5061031b61071b36600461317e565b600091825260066020908152604080842073ffffffffffffffffffffffffffffffffffffffff93909316845291905290205460ff1690565b34801561075f57600080fd5b506103876110c1565b34801561077457600080fd5b506103c5600081565b34801561078957600080fd5b506103706107983660046131ae565b6110d0565b3480156107a957600080fd5b5061031b6107b83660046130d6565b61122f565b3480156107c957600080fd5b5061031b6107d83660046130d6565b611300565b3480156107e957600080fd5b50600d5461031b907501000000000000000000000000000000000000000000900460ff1681565b34801561081c57600080fd5b5061031b61082b366004612fd2565b600e6020526000908152604090205460ff1681565b34801561084c57600080fd5b50600c546105889073ffffffffffffffffffffffffffffffffffffffff1681565b34801561087957600080fd5b50600d546105889073ffffffffffffffffffffffffffffffffffffffff1681565b3480156108a657600080fd5b506103706108b536600461317e565b61130e565b3480156108c657600080fd5b506103c56108d5366004613215565b73ffffffffffffffffffffffffffffffffffffffff918216600090815260016020908152604080832093909416825291909152205490565b34801561091957600080fd5b506103c57f241ecf16d79d0f8dbfb92cbc07fe17840425976cf0667f022fe9877caa831b0881565b34801561094d57600080fd5b5061037061095c366004612fd2565b611333565b34801561096d57600080fd5b5061037061097c366004613165565b6113ea565b60007fffffffff0000000000000000000000000000000000000000000000000000000082167f7965db0b000000000000000000000000000000000000000000000000000000001480610a1457507f01ffc9a7000000000000000000000000000000000000000000000000000000007fffffffff000000000000000000000000000000000000000000000000000000008316145b92915050565b7f241ecf16d79d0f8dbfb92cbc07fe17840425976cf0667f022fe9877caa831b08610a448161152b565b50600d80549115157501000000000000000000000000000000000000000000027fffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffffff909216919091179055565b606060038054610a9f90613243565b80601f0160208091040260200160405190810160405280929190818152602001828054610acb90613243565b8015610b185780601f10610aed57610100808354040283529160200191610b18565b820191906000526020600020905b815481529060010190602001808311610afb57829003601f168201915b5050505050905090565b600033610b30818585611535565b5060019392505050565b7f241ecf16d79d0f8dbfb92cbc07fe17840425976cf0667f022fe9877caa831b08610b648161152b565b6009546040517f1eaa614f000000000000000000000000000000000000000000000000000000008152600481018590526024810184905273ffffffffffffffffffffffffffffffffffffffff90911690631eaa614f906044015b600060405180830381600087803b158015610bd857600080fd5b505af1158015610bec573d6000803e3d6000fd5b50505050505050565b600033610c038582856116e8565b610c0e8585856117bf565b506001949350505050565b7f241ecf16d79d0f8dbfb92cbc07fe17840425976cf0667f022fe9877caa831b08610c438161152b565b50601155565b600082815260066020526040902060010154610c648161152b565b610c6e8383611a8f565b505050565b73ffffffffffffffffffffffffffffffffffffffff81163314610d1d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201527f20726f6c657320666f722073656c66000000000000000000000000000000000060648201526084015b60405180910390fd5b610d278282611b83565b5050565b33600081815260016020908152604080832073ffffffffffffffffffffffffffffffffffffffff87168452909152812054909190610b309082908690610d729087906132c5565b611535565b7f241ecf16d79d0f8dbfb92cbc07fe17840425976cf0667f022fe9877caa831b08610da18161152b565b73ffffffffffffffffffffffffffffffffffffffff83166000908152600f602052604090205482151560ff909116151503610e38576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601260248201527f57616c6c657420616c72656164792073657400000000000000000000000000006044820152606401610d14565b73ffffffffffffffffffffffffffffffffffffffff83166000818152600f602090815260409182902080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00168615159081179091558251938452908301527f159e89de74765c810beb8ea83c3ed2ee32b526687ca3cdbaa20c995998354b36910160405180910390a1505050565b60148181548110610ed757600080fd5b600091825260209091200154905081565b7f241ecf16d79d0f8dbfb92cbc07fe17840425976cf0667f022fe9877caa831b08610f128161152b565b6101f48511158015610f2657506101f48411155b8015610f3457506101f48311155b8015610f4257506101f48211155b610fa8576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601660248201527f466565206d757374206265203c3d204d41585f464545000000000000000000006044820152606401610d14565b846014600081548110610fbd57610fbd6132d8565b600091825260209091200155836014600181548110610fde57610fde6132d8565b600091825260209091200155826014600281548110610fff57610fff6132d8565b600091825260209091200155816014600381548110611020576110206132d8565b60009182526020918290200191909155604080518781529182018690528101849052606081018390527f16e6f67290546b8dd0e587f4b7f67d4f61932ae17ffd8c60d3509dbc05c175fe9060800160405180910390a15050505050565b611085611c3e565b61108f6000611cbf565b565b7f241ecf16d79d0f8dbfb92cbc07fe17840425976cf0667f022fe9877caa831b086110bb8161152b565b50601255565b606060048054610a9f90613243565b7f241ecf16d79d0f8dbfb92cbc07fe17840425976cf0667f022fe9877caa831b086110fa8161152b565b73ffffffffffffffffffffffffffffffffffffffff8316600090815260106020526040902080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001683158015919091179091556111b1576009546040517f14b6ca9600000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff858116600483015260006024830152909116906314b6ca9690604401610bbe565b60095473ffffffffffffffffffffffffffffffffffffffff166314b6ca96846111d981611d36565b6040517fffffffff0000000000000000000000000000000000000000000000000000000060e085901b16815273ffffffffffffffffffffffffffffffffffffffff90921660048301526024820152604401610bbe565b33600081815260016020908152604080832073ffffffffffffffffffffffffffffffffffffffff87168452909152812054909190838110156112f3576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602560248201527f45524332303a2064656372656173656420616c6c6f77616e63652062656c6f7760448201527f207a65726f0000000000000000000000000000000000000000000000000000006064820152608401610d14565b610c0e8286868403611535565b600033610b308185856117bf565b6000828152600660205260409020600101546113298161152b565b610c6e8383611b83565b61133b611c3e565b73ffffffffffffffffffffffffffffffffffffffff81166113de576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201527f64647265737300000000000000000000000000000000000000000000000000006064820152608401610d14565b6113e781611cbf565b50565b7f241ecf16d79d0f8dbfb92cbc07fe17840425976cf0667f022fe9877caa831b086114148161152b565b64e8d4a51000821115611483576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600e60248201527f546f6f2062696720666163746f720000000000000000000000000000000000006044820152606401610d14565b6103e88210156114ef576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601060248201527f546f6f20736d616c6c20666163746f72000000000000000000000000000000006044820152606401610d14565b60138290556040518281527fb6fc85abfd64ed22db8c9aae4dd40127d9f18b2acb64f8120f3f2e32184e26af9060200160405180910390a15050565b6113e78133611e17565b73ffffffffffffffffffffffffffffffffffffffff83166115d7576040517f08c379a0000000000000000000000000000000000000000000000000000000008152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460448201527f72657373000000000000000000000000000000000000000000000000000000006064820152608401610d14565b73ffffffffffffffffffffffffffffffffffffffff821661167a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f20616464726560448201527f73730000000000000000000000000000000000000000000000000000000000006064820152608401610d14565b73ffffffffffffffffffffffffffffffffffffffff83811660008181526001602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b73ffffffffffffffffffffffffffffffffffffffff8381166000908152600160209081526040808320938616835292905220547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff81146117b957818110156117ac576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601d60248201527f45524332303a20696e73756666696369656e7420616c6c6f77616e63650000006044820152606401610d14565b6117b98484848403611535565b50505050565b6117c883611ed1565b6117d182611ed1565b306000908152602081905260408120546013546002549192916117f49190613307565b82101590508080156118215750600d5474010000000000000000000000000000000000000000900460ff16155b8015611852575073ffffffffffffffffffffffffffffffffffffffff84166000908152600e602052604090205460ff165b1561196757600d80547fffffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffff16740100000000000000000000000000000000000000001790556013546000906118b8906118a960025490565b6118b39190613307565b611fd9565b6009546040517fb6b55f250000000000000000000000000000000000000000000000000000000081526004810183905291925073ffffffffffffffffffffffffffffffffffffffff169063b6b55f2590602401600060405180830381600087803b15801561192557600080fd5b505af1158015611939573d6000803e3d6000fd5b5050600d80547fffffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffff1690555050505b73ffffffffffffffffffffffffffffffffffffffff85166000908152600f602052604090205460ff16806119c0575073ffffffffffffffffffffffffffffffffffffffff84166000908152600f602052604090205460ff165b156119d5576119d08585856121c5565b611a7e565b73ffffffffffffffffffffffffffffffffffffffff8086166000908152600e602052604080822054928716825281205490918291611a1b91879160ff918216911661247b565b90925090508115611a4b57600c54611a4b90889073ffffffffffffffffffffffffffffffffffffffff16846121c5565b8015611a5c57611a5c8730836121c5565b611a7b878783611a6c868a613342565b611a769190613342565b6121c5565b50505b611a88858561257c565b5050505050565b600082815260066020908152604080832073ffffffffffffffffffffffffffffffffffffffff8516845290915290205460ff16610d2757600082815260066020908152604080832073ffffffffffffffffffffffffffffffffffffffff85168452909152902080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00166001179055611b253390565b73ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b600082815260066020908152604080832073ffffffffffffffffffffffffffffffffffffffff8516845290915290205460ff1615610d2757600082815260066020908152604080832073ffffffffffffffffffffffffffffffffffffffff8516808552925280832080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0016905551339285917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a45050565b60055473ffffffffffffffffffffffffffffffffffffffff16331461108f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610d14565b6005805473ffffffffffffffffffffffffffffffffffffffff8381167fffffffffffffffffffffffff0000000000000000000000000000000000000000831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b6007546040517f70a0823100000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff8381166004830152600092612710929116906370a0823190602401602060405180830381865afa158015611dac573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611dd09190613355565b601154611ddd919061336e565b611de79190613307565b73ffffffffffffffffffffffffffffffffffffffff8316600090815260208190526040902054610a1491906132c5565b600082815260066020908152604080832073ffffffffffffffffffffffffffffffffffffffff8516845290915290205460ff16610d2757611e57816129ed565b611e62836020612a0c565b604051602001611e73929190613385565b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0818403018152908290527f08c379a0000000000000000000000000000000000000000000000000000000008252610d1491600401613085565b8073ffffffffffffffffffffffffffffffffffffffff163b600003611ef35750565b73ffffffffffffffffffffffffffffffffffffffff81166000908152600e602052604090205460ff166113e757600080611f2c83612c56565b909250905073ffffffffffffffffffffffffffffffffffffffff821615801590611f6b575073ffffffffffffffffffffffffffffffffffffffff811615155b15610c6e57505073ffffffffffffffffffffffffffffffffffffffff166000908152600e60209081526040808320805460017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0091821681179092556010909352922080549091169091179055565b604080516002808252606082018352600092839291906020830190803683370190505090503081600081518110612012576120126132d8565b73ffffffffffffffffffffffffffffffffffffffff928316602091820292909201810191909152600854604080517fef8ef56f0000000000000000000000000000000000000000000000000000000081529051919093169263ef8ef56f9260048083019391928290030181865afa158015612091573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906120b59190613435565b816001815181106120c8576120c86132d8565b73ffffffffffffffffffffffffffffffffffffffff9283166020918202929092010152600d5460085490821631916121039130911686611535565b600854600d546040517f791ac94700000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff9283169263791ac9479261216692899260009289929116904290600401613452565b600060405180830381600087803b15801561218057600080fd5b505af1158015612194573d6000803e3d6000fd5b5050600d546121bd925083915073ffffffffffffffffffffffffffffffffffffffff1631613342565b949350505050565b73ffffffffffffffffffffffffffffffffffffffff8316612268576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f20616460448201527f64726573730000000000000000000000000000000000000000000000000000006064820152608401610d14565b73ffffffffffffffffffffffffffffffffffffffff821661230b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201527f65737300000000000000000000000000000000000000000000000000000000006064820152608401610d14565b7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc9773ffffffffffffffffffffffffffffffffffffffff83160161235257610c6e8382612cd3565b73ffffffffffffffffffffffffffffffffffffffff831660009081526020819052604090205481811015612408576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f45524332303a207472616e7366657220616d6f756e742065786365656473206260448201527f616c616e636500000000000000000000000000000000000000000000000000006064820152608401610d14565b73ffffffffffffffffffffffffffffffffffffffff848116600081815260208181526040808320878703905593871680835291849020805487019055925185815290927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef910160405180910390a36117b9565b60008083156124fb57612710601460018154811061249b5761249b6132d8565b9060005260206000200154866124b1919061336e565b6124bb9190613307565b915061271060146000815481106124d4576124d46132d8565b9060005260206000200154866124ea919061336e565b6124f49190613307565b9050612574565b8215612574576127106014600381548110612518576125186132d8565b90600052602060002001548661252e919061336e565b6125389190613307565b91506127106014600281548110612551576125516132d8565b906000526020600020015486612567919061336e565b6125719190613307565b90505b935093915050565b600a5473ffffffffffffffffffffffffffffffffffffffff1660009081526010602052604090205460ff1661265857600954600a5473ffffffffffffffffffffffffffffffffffffffff918216916314b6ca9691166125da81611d36565b6040517fffffffff0000000000000000000000000000000000000000000000000000000060e085901b16815273ffffffffffffffffffffffffffffffffffffffff90921660048301526024820152604401600060405180830381600087803b15801561264557600080fd5b505af1925050508015612656575060015b505b600b5473ffffffffffffffffffffffffffffffffffffffff1660009081526010602052604090205460ff1661273457600954600b5473ffffffffffffffffffffffffffffffffffffffff918216916314b6ca9691166126b681611d36565b6040517fffffffff0000000000000000000000000000000000000000000000000000000060e085901b16815273ffffffffffffffffffffffffffffffffffffffff90921660048301526024820152604401600060405180830381600087803b15801561272157600080fd5b505af1925050508015612732575060015b505b73ffffffffffffffffffffffffffffffffffffffff821660009081526010602052604090205460ff1661283757600a80547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff84811691909117909155600954166314b6ca96836127b981611d36565b6040517fffffffff0000000000000000000000000000000000000000000000000000000060e085901b16815273ffffffffffffffffffffffffffffffffffffffff90921660048301526024820152604401600060405180830381600087803b15801561282457600080fd5b505af1925050508015612835575060015b505b73ffffffffffffffffffffffffffffffffffffffff811660009081526010602052604090205460ff1661293a57600b80547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff83811691909117909155600954166314b6ca96826128bc81611d36565b6040517fffffffff0000000000000000000000000000000000000000000000000000000060e085901b16815273ffffffffffffffffffffffffffffffffffffffff90921660048301526024820152604401600060405180830381600087803b15801561292757600080fd5b505af1925050508015612938575060015b505b600d547501000000000000000000000000000000000000000000900460ff1615610d27576009546012546040517fffb2c47900000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff9092169163ffb2c479916129b99160040190815260200190565b600060405180830381600087803b1580156129d357600080fd5b505af19250505080156129e4575060015b15610d27575050565b6060610a1473ffffffffffffffffffffffffffffffffffffffff831660145b60606000612a1b83600261336e565b612a269060026132c5565b67ffffffffffffffff811115612a3e57612a3e613406565b6040519080825280601f01601f191660200182016040528015612a68576020820181803683370190505b5090507f300000000000000000000000000000000000000000000000000000000000000081600081518110612a9f57612a9f6132d8565b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a9053507f780000000000000000000000000000000000000000000000000000000000000081600181518110612b0257612b026132d8565b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a9053506000612b3e84600261336e565b612b499060016132c5565b90505b6001811115612be6577f303132333435363738396162636465660000000000000000000000000000000085600f1660108110612b8a57612b8a6132d8565b1a60f81b828281518110612ba057612ba06132d8565b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a90535060049490941c93612bdf816134dd565b9050612b4c565b508315612c4f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e746044820152606401610d14565b9392505050565b600080612c83837f0dfe168100000000000000000000000000000000000000000000000000000000612e9b565b915073ffffffffffffffffffffffffffffffffffffffff821615612cce57612ccb837fd21220a700000000000000000000000000000000000000000000000000000000612e9b565b90505b915091565b73ffffffffffffffffffffffffffffffffffffffff8216612d76576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602160248201527f45524332303a206275726e2066726f6d20746865207a65726f2061646472657360448201527f73000000000000000000000000000000000000000000000000000000000000006064820152608401610d14565b73ffffffffffffffffffffffffffffffffffffffff821660009081526020819052604090205481811015612e2c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602260248201527f45524332303a206275726e20616d6f756e7420657863656564732062616c616e60448201527f63650000000000000000000000000000000000000000000000000000000000006064820152608401610d14565b73ffffffffffffffffffffffffffffffffffffffff8316600081815260208181526040918290208585039055600280548690039055905184815261036992917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef910160405180910390a3505050565b60408051600481526024810182526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fffffffff00000000000000000000000000000000000000000000000000000000851617905290516000918291829173ffffffffffffffffffffffffffffffffffffffff871691612f1e9190613512565b600060405180830381855afa9150503d8060008114612f59576040519150601f19603f3d011682016040523d82523d6000602084013e612f5e565b606091505b5091509150811580612f6f57508051155b15612f7f57600092505050610a14565b8051602003612fa55780806020019051810190612f9c9190613435565b92505050610a14565b506000949350505050565b73ffffffffffffffffffffffffffffffffffffffff811681146113e757600080fd5b600060208284031215612fe457600080fd5b8135612c4f81612fb0565b60006020828403121561300157600080fd5b81357fffffffff0000000000000000000000000000000000000000000000000000000081168114612c4f57600080fd5b8035801515811461304157600080fd5b919050565b60006020828403121561305857600080fd5b612c4f82613031565b60005b8381101561307c578181015183820152602001613064565b50506000910152565b60208152600082518060208401526130a4816040850160208701613061565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169190910160400192915050565b600080604083850312156130e957600080fd5b82356130f481612fb0565b946020939093013593505050565b6000806040838503121561311557600080fd5b50508035926020909101359150565b60008060006060848603121561313957600080fd5b833561314481612fb0565b9250602084013561315481612fb0565b929592945050506040919091013590565b60006020828403121561317757600080fd5b5035919050565b6000806040838503121561319157600080fd5b8235915060208301356131a381612fb0565b809150509250929050565b600080604083850312156131c157600080fd5b82356131cc81612fb0565b91506131da60208401613031565b90509250929050565b600080600080608085870312156131f957600080fd5b5050823594602084013594506040840135936060013592509050565b6000806040838503121561322857600080fd5b823561323381612fb0565b915060208301356131a381612fb0565b600181811c9082168061325757607f821691505b602082108103613290577f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b50919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b80820180821115610a1457610a14613296565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60008261333d577f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b500490565b81810381811115610a1457610a14613296565b60006020828403121561336757600080fd5b5051919050565b8082028115828204841417610a1457610a14613296565b7f416363657373436f6e74726f6c3a206163636f756e74200000000000000000008152600083516133bd816017850160208801613061565b7f206973206d697373696e6720726f6c652000000000000000000000000000000060179184019182015283516133fa816028840160208801613061565b01602801949350505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b60006020828403121561344757600080fd5b8151612c4f81612fb0565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b818110156134af57845173ffffffffffffffffffffffffffffffffffffffff168352938301939183019160010161347d565b505073ffffffffffffffffffffffffffffffffffffffff969096166060850152505050608001529392505050565b6000816134ec576134ec613296565b507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0190565b60008251613524818460208701613061565b919091019291505056fea26469706673582212205f67cabd6f5d50357c646b21e637c7c3a99f2cdf8789e2f618ce2c4117ba1e0f64736f6c634300081500336080604052610e10600955670de0b6b3a7640000600b5534801561002257600080fd5b50600080546001600160a01b03191633179055610e7e806100446000396000f3fe60806040526004361061012d5760003560e01c80638da5cb5b116100a5578063b6b55f2511610074578063e7b0f66611610059578063e7b0f66614610373578063fe8f254e14610389578063ffb2c4791461039f57600080fd5b8063b6b55f251461033d578063ba16d6001461035d57600080fd5b80638da5cb5b146102ad578063a146a55b146102da578063a1fb098e146102f0578063aada9c381461031d57600080fd5b80633a98ef39116100fc5780634b0432f2116100e15780634b0432f2146101fc578063500e68e9146102125780637ad71f721461026857600080fd5b80633a98ef39146101b95780633d78d410146101cf57600080fd5b806314b6ca96146101395780631a6611811461015b5780631eaa614f1461018457806337563293146101a457600080fd5b3661013457005b600080fd5b34801561014557600080fd5b50610159610154366004610c84565b6103bf565b005b34801561016757600080fd5b5061017160075481565b6040519081526020015b60405180910390f35b34801561019057600080fd5b5061015961019f366004610cae565b610555565b3480156101b057600080fd5b5061015961061d565b3480156101c557600080fd5b5061017160085481565b3480156101db57600080fd5b506101716101ea366004610cd0565b60036020526000908152604090205481565b34801561020857600080fd5b5061017160095481565b34801561021e57600080fd5b5061024d61022d366004610cd0565b600260208190526000918252604090912080546001820154919092015483565b6040805193845260208401929092529082015260600161017b565b34801561027457600080fd5b50610288610283366004610cf2565b610638565b60405173ffffffffffffffffffffffffffffffffffffffff909116815260200161017b565b3480156102b957600080fd5b506000546102889073ffffffffffffffffffffffffffffffffffffffff1681565b3480156102e657600080fd5b50610171600a5481565b3480156102fc57600080fd5b5061017161030b366004610cd0565b60046020526000908152604090205481565b34801561032957600080fd5b50610171610338366004610cd0565b61066f565b34801561034957600080fd5b50610159610358366004610cf2565b6106e1565b34801561036957600080fd5b50610171600b5481565b34801561037f57600080fd5b5061017160065481565b34801561039557600080fd5b5061017160055481565b3480156103ab57600080fd5b506101596103ba366004610cf2565b6107dc565b60005473ffffffffffffffffffffffffffffffffffffffff163314610445576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600d60248201527f4e6f7420746865206f776e65720000000000000000000000000000000000000060448201526064015b60405180910390fd5b73ffffffffffffffffffffffffffffffffffffffff82166000908152600260205260409020805482811461054f5780156104825761048284610934565b826000036104985761049384610a4d565b610521565b80600003610521576001805473ffffffffffffffffffffffffffffffffffffffff861660008181526003602052604081208390558284018455929092527fb10e2d527612073b26eecdfd717e6a320cf44b4afac2b0732d9fcbe2b7fa0cf60180547fffffffffffffffffffffffff00000000000000000000000000000000000000001690911790555b82816008546105309190610d3a565b61053a9190610d4d565b60085582825561054983610bdc565b60018301555b50505050565b60005473ffffffffffffffffffffffffffffffffffffffff1633146105d6576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600d60248201527f4e6f7420746865206f776e657200000000000000000000000000000000000000604482015260640161043c565b6009829055600b81905560408051838152602081018390527f8e912126cff24393f67ad5e722cc158fe78433df9a3530fccbfea4f82f948b08910160405180910390a15050565b3361062781610c09565b156106355761063581610934565b50565b6001818154811061064857600080fd5b60009182526020909120015473ffffffffffffffffffffffffffffffffffffffff16905081565b73ffffffffffffffffffffffffffffffffffffffff8116600090815260026020526040812080548083036106a7575060009392505050565b60006106b282610bdc565b60018401549091508082116106cd5750600095945050505050565b6106d78183610d3a565b9695505050505050565b60005473ffffffffffffffffffffffffffffffffffffffff163314610762576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600d60248201527f4e6f7420746865206f776e657200000000000000000000000000000000000000604482015260640161043c565b806007546107709190610d4d565b60075560085461078c826b204fce5e3e25026110000000610d60565b6107969190610d77565b6005546107a39190610d4d565b6005556040518181527fe07d28de800f382832bf163ff388e6c41eb3e7ea1ab285275f4b1e292945bd269060200160405180910390a150565b60005473ffffffffffffffffffffffffffffffffffffffff16331461085d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600d60248201527f4e6f7420746865206f776e657200000000000000000000000000000000000000604482015260640161043c565b600154600081900361086d575050565b6000805a905060005b848310801561088457508381105b1561092d5783600a5410610898576000600a555b60006001600a54815481106108af576108af610db2565b60009182526020909120015473ffffffffffffffffffffffffffffffffffffffff1690506108dc81610c09565b156108ea576108ea81610934565b5a6108f58486610d4d565b6108ff9190610d3a565b93505a600a8054919450600061091483610de1565b9190505550818061092490610de1565b92505050610876565b5050505050565b73ffffffffffffffffffffffffffffffffffffffff811660009081526002602052604081208054909181900361096957505050565b60006109748461066f565b9050801561054f5760008473ffffffffffffffffffffffffffffffffffffffff168260405160006040518083038185875af1925050503d80600081146109d6576040519150601f19603f3d011682016040523d82523d6000602084013e6109db565b606091505b50509050801561092d57816006546109f39190610d4d565b60065573ffffffffffffffffffffffffffffffffffffffff85166000908152600460205260408120429055600285018054849290610a32908490610d4d565b90915550610a41905083610bdc565b60018501555050505050565b73ffffffffffffffffffffffffffffffffffffffff811660009081526003602052604090205460018054610a819190610d3a565b811015610b47576001805460009190610a9b908290610d3a565b81548110610aab57610aab610db2565b6000918252602090912001546001805473ffffffffffffffffffffffffffffffffffffffff9092169250829184908110610ae757610ae7610db2565b600091825260208083209190910180547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff9485161790559290911681526003909152604090208190555b6001805480610b5857610b58610e19565b6000828152602080822083017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff90810180547fffffffffffffffffffffffff000000000000000000000000000000000000000016905590920190925573ffffffffffffffffffffffffffffffffffffffff9390931681526003909252506040812055565b60006b204fce5e3e2502611000000060055483610bf99190610d60565b610c039190610d77565b92915050565b60095473ffffffffffffffffffffffffffffffffffffffff821660009081526004602052604081205490914291610c409190610d4d565b108015610c035750600b54610c548361066f565b1192915050565b803573ffffffffffffffffffffffffffffffffffffffff81168114610c7f57600080fd5b919050565b60008060408385031215610c9757600080fd5b610ca083610c5b565b946020939093013593505050565b60008060408385031215610cc157600080fd5b50508035926020909101359150565b600060208284031215610ce257600080fd5b610ceb82610c5b565b9392505050565b600060208284031215610d0457600080fd5b5035919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b81810381811115610c0357610c03610d0b565b80820180821115610c0357610c03610d0b565b8082028115828204841417610c0357610c03610d0b565b600082610dad577f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b500490565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8203610e1257610e12610d0b565b5060010190565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603160045260246000fdfea26469706673582212206a9b6317d92777e4527e210925fbf2c8637bb76f3624a94805db80cf164c047b64736f6c63430008150033000000000000000000000000636f6407b90661b73b1c0f7e24f4c79f624d0738
Deployed ByteCode
0x6080604052600436106102df5760003560e01c80635be6059111610184578063a457c2d7116100d6578063d27049e91161008a578063ec87621c11610064578063ec87621c1461090d578063f2fde38b14610941578063fc10dcb01461096157600080fd5b8063d27049e91461086d578063d547741f1461089a578063dd62ed3e146108ba57600080fd5b8063ae2e9bcb116100bb578063ae2e9bcb146107dd578063b0249cc614610810578063d246d4111461084057600080fd5b8063a457c2d71461079d578063a9059cbb146107bd57600080fd5b80638da5cb5b1161013857806395d89b411161011257806395d89b4114610753578063a217fddf14610768578063a35346c11461077d57600080fd5b80638da5cb5b146106b55780638e928076146106e057806391d148541461070057600080fd5b806370a082311161016957806370a0823114610630578063715018a61461067357806382ea06651461068857600080fd5b80635be60591146105e35780636fcba3771461061057600080fd5b80632d7db8e21161023d5780633c5d3b5a116101f157806344148f42116101cb57806344148f421461055b5780634acc79ed146105ad578063501d815c146105cd57600080fd5b80633c5d3b5a146104f55780633f9645c11461050b57806342701a8e1461053b57600080fd5b8063313ce56711610222578063313ce5671461049957806336568abe146104b557806339509351146104d557600080fd5b80632d7db8e2146104595780632f2ff15d1461047957600080fd5b806318160ddd116102945780631eaa614f116102795780631eaa614f146103e957806323b872dd14610409578063248a9ca31461042957600080fd5b806318160ddd146103b45780631cc3785e146103d357600080fd5b806303f21e01116102c557806303f21e011461035057806306fdde0314610372578063095ea7b31461039457600080fd5b80622a2050146102eb57806301ffc9a71461033057600080fd5b366102e657005b600080fd5b3480156102f757600080fd5b5061031b610306366004612fd2565b600f6020526000908152604090205460ff1681565b60405190151581526020015b60405180910390f35b34801561033c57600080fd5b5061031b61034b366004612fef565b610981565b34801561035c57600080fd5b5061037061036b366004613046565b610a1a565b005b34801561037e57600080fd5b50610387610a90565b6040516103279190613085565b3480156103a057600080fd5b5061031b6103af3660046130d6565b610b22565b3480156103c057600080fd5b506002545b604051908152602001610327565b3480156103df57600080fd5b506103c560115481565b3480156103f557600080fd5b50610370610404366004613102565b610b3a565b34801561041557600080fd5b5061031b610424366004613124565b610bf5565b34801561043557600080fd5b506103c5610444366004613165565b60009081526006602052604090206001015490565b34801561046557600080fd5b50610370610474366004613165565b610c19565b34801561048557600080fd5b5061037061049436600461317e565b610c49565b3480156104a557600080fd5b5060405160128152602001610327565b3480156104c157600080fd5b506103706104d036600461317e565b610c73565b3480156104e157600080fd5b5061031b6104f03660046130d6565b610d2b565b34801561050157600080fd5b506103c560135481565b34801561051757600080fd5b5061031b610526366004612fd2565b60106020526000908152604090205460ff1681565b34801561054757600080fd5b506103706105563660046131ae565b610d77565b34801561056757600080fd5b506009546105889073ffffffffffffffffffffffffffffffffffffffff1681565b60405173ffffffffffffffffffffffffffffffffffffffff9091168152602001610327565b3480156105b957600080fd5b506103c56105c8366004613165565b610ec7565b3480156105d957600080fd5b506103c560125481565b3480156105ef57600080fd5b506007546105889073ffffffffffffffffffffffffffffffffffffffff1681565b34801561061c57600080fd5b5061037061062b3660046131e3565b610ee8565b34801561063c57600080fd5b506103c561064b366004612fd2565b73ffffffffffffffffffffffffffffffffffffffff1660009081526020819052604090205490565b34801561067f57600080fd5b5061037061107d565b34801561069457600080fd5b506008546105889073ffffffffffffffffffffffffffffffffffffffff1681565b3480156106c157600080fd5b5060055473ffffffffffffffffffffffffffffffffffffffff16610588565b3480156106ec57600080fd5b506103706106fb366004613165565b611091565b34801561070c57600080fd5b5061031b61071b36600461317e565b600091825260066020908152604080842073ffffffffffffffffffffffffffffffffffffffff93909316845291905290205460ff1690565b34801561075f57600080fd5b506103876110c1565b34801561077457600080fd5b506103c5600081565b34801561078957600080fd5b506103706107983660046131ae565b6110d0565b3480156107a957600080fd5b5061031b6107b83660046130d6565b61122f565b3480156107c957600080fd5b5061031b6107d83660046130d6565b611300565b3480156107e957600080fd5b50600d5461031b907501000000000000000000000000000000000000000000900460ff1681565b34801561081c57600080fd5b5061031b61082b366004612fd2565b600e6020526000908152604090205460ff1681565b34801561084c57600080fd5b50600c546105889073ffffffffffffffffffffffffffffffffffffffff1681565b34801561087957600080fd5b50600d546105889073ffffffffffffffffffffffffffffffffffffffff1681565b3480156108a657600080fd5b506103706108b536600461317e565b61130e565b3480156108c657600080fd5b506103c56108d5366004613215565b73ffffffffffffffffffffffffffffffffffffffff918216600090815260016020908152604080832093909416825291909152205490565b34801561091957600080fd5b506103c57f241ecf16d79d0f8dbfb92cbc07fe17840425976cf0667f022fe9877caa831b0881565b34801561094d57600080fd5b5061037061095c366004612fd2565b611333565b34801561096d57600080fd5b5061037061097c366004613165565b6113ea565b60007fffffffff0000000000000000000000000000000000000000000000000000000082167f7965db0b000000000000000000000000000000000000000000000000000000001480610a1457507f01ffc9a7000000000000000000000000000000000000000000000000000000007fffffffff000000000000000000000000000000000000000000000000000000008316145b92915050565b7f241ecf16d79d0f8dbfb92cbc07fe17840425976cf0667f022fe9877caa831b08610a448161152b565b50600d80549115157501000000000000000000000000000000000000000000027fffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffffff909216919091179055565b606060038054610a9f90613243565b80601f0160208091040260200160405190810160405280929190818152602001828054610acb90613243565b8015610b185780601f10610aed57610100808354040283529160200191610b18565b820191906000526020600020905b815481529060010190602001808311610afb57829003601f168201915b5050505050905090565b600033610b30818585611535565b5060019392505050565b7f241ecf16d79d0f8dbfb92cbc07fe17840425976cf0667f022fe9877caa831b08610b648161152b565b6009546040517f1eaa614f000000000000000000000000000000000000000000000000000000008152600481018590526024810184905273ffffffffffffffffffffffffffffffffffffffff90911690631eaa614f906044015b600060405180830381600087803b158015610bd857600080fd5b505af1158015610bec573d6000803e3d6000fd5b50505050505050565b600033610c038582856116e8565b610c0e8585856117bf565b506001949350505050565b7f241ecf16d79d0f8dbfb92cbc07fe17840425976cf0667f022fe9877caa831b08610c438161152b565b50601155565b600082815260066020526040902060010154610c648161152b565b610c6e8383611a8f565b505050565b73ffffffffffffffffffffffffffffffffffffffff81163314610d1d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201527f20726f6c657320666f722073656c66000000000000000000000000000000000060648201526084015b60405180910390fd5b610d278282611b83565b5050565b33600081815260016020908152604080832073ffffffffffffffffffffffffffffffffffffffff87168452909152812054909190610b309082908690610d729087906132c5565b611535565b7f241ecf16d79d0f8dbfb92cbc07fe17840425976cf0667f022fe9877caa831b08610da18161152b565b73ffffffffffffffffffffffffffffffffffffffff83166000908152600f602052604090205482151560ff909116151503610e38576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601260248201527f57616c6c657420616c72656164792073657400000000000000000000000000006044820152606401610d14565b73ffffffffffffffffffffffffffffffffffffffff83166000818152600f602090815260409182902080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00168615159081179091558251938452908301527f159e89de74765c810beb8ea83c3ed2ee32b526687ca3cdbaa20c995998354b36910160405180910390a1505050565b60148181548110610ed757600080fd5b600091825260209091200154905081565b7f241ecf16d79d0f8dbfb92cbc07fe17840425976cf0667f022fe9877caa831b08610f128161152b565b6101f48511158015610f2657506101f48411155b8015610f3457506101f48311155b8015610f4257506101f48211155b610fa8576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601660248201527f466565206d757374206265203c3d204d41585f464545000000000000000000006044820152606401610d14565b846014600081548110610fbd57610fbd6132d8565b600091825260209091200155836014600181548110610fde57610fde6132d8565b600091825260209091200155826014600281548110610fff57610fff6132d8565b600091825260209091200155816014600381548110611020576110206132d8565b60009182526020918290200191909155604080518781529182018690528101849052606081018390527f16e6f67290546b8dd0e587f4b7f67d4f61932ae17ffd8c60d3509dbc05c175fe9060800160405180910390a15050505050565b611085611c3e565b61108f6000611cbf565b565b7f241ecf16d79d0f8dbfb92cbc07fe17840425976cf0667f022fe9877caa831b086110bb8161152b565b50601255565b606060048054610a9f90613243565b7f241ecf16d79d0f8dbfb92cbc07fe17840425976cf0667f022fe9877caa831b086110fa8161152b565b73ffffffffffffffffffffffffffffffffffffffff8316600090815260106020526040902080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001683158015919091179091556111b1576009546040517f14b6ca9600000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff858116600483015260006024830152909116906314b6ca9690604401610bbe565b60095473ffffffffffffffffffffffffffffffffffffffff166314b6ca96846111d981611d36565b6040517fffffffff0000000000000000000000000000000000000000000000000000000060e085901b16815273ffffffffffffffffffffffffffffffffffffffff90921660048301526024820152604401610bbe565b33600081815260016020908152604080832073ffffffffffffffffffffffffffffffffffffffff87168452909152812054909190838110156112f3576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602560248201527f45524332303a2064656372656173656420616c6c6f77616e63652062656c6f7760448201527f207a65726f0000000000000000000000000000000000000000000000000000006064820152608401610d14565b610c0e8286868403611535565b600033610b308185856117bf565b6000828152600660205260409020600101546113298161152b565b610c6e8383611b83565b61133b611c3e565b73ffffffffffffffffffffffffffffffffffffffff81166113de576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201527f64647265737300000000000000000000000000000000000000000000000000006064820152608401610d14565b6113e781611cbf565b50565b7f241ecf16d79d0f8dbfb92cbc07fe17840425976cf0667f022fe9877caa831b086114148161152b565b64e8d4a51000821115611483576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600e60248201527f546f6f2062696720666163746f720000000000000000000000000000000000006044820152606401610d14565b6103e88210156114ef576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601060248201527f546f6f20736d616c6c20666163746f72000000000000000000000000000000006044820152606401610d14565b60138290556040518281527fb6fc85abfd64ed22db8c9aae4dd40127d9f18b2acb64f8120f3f2e32184e26af9060200160405180910390a15050565b6113e78133611e17565b73ffffffffffffffffffffffffffffffffffffffff83166115d7576040517f08c379a0000000000000000000000000000000000000000000000000000000008152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460448201527f72657373000000000000000000000000000000000000000000000000000000006064820152608401610d14565b73ffffffffffffffffffffffffffffffffffffffff821661167a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f20616464726560448201527f73730000000000000000000000000000000000000000000000000000000000006064820152608401610d14565b73ffffffffffffffffffffffffffffffffffffffff83811660008181526001602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b73ffffffffffffffffffffffffffffffffffffffff8381166000908152600160209081526040808320938616835292905220547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff81146117b957818110156117ac576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601d60248201527f45524332303a20696e73756666696369656e7420616c6c6f77616e63650000006044820152606401610d14565b6117b98484848403611535565b50505050565b6117c883611ed1565b6117d182611ed1565b306000908152602081905260408120546013546002549192916117f49190613307565b82101590508080156118215750600d5474010000000000000000000000000000000000000000900460ff16155b8015611852575073ffffffffffffffffffffffffffffffffffffffff84166000908152600e602052604090205460ff165b1561196757600d80547fffffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffff16740100000000000000000000000000000000000000001790556013546000906118b8906118a960025490565b6118b39190613307565b611fd9565b6009546040517fb6b55f250000000000000000000000000000000000000000000000000000000081526004810183905291925073ffffffffffffffffffffffffffffffffffffffff169063b6b55f2590602401600060405180830381600087803b15801561192557600080fd5b505af1158015611939573d6000803e3d6000fd5b5050600d80547fffffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffff1690555050505b73ffffffffffffffffffffffffffffffffffffffff85166000908152600f602052604090205460ff16806119c0575073ffffffffffffffffffffffffffffffffffffffff84166000908152600f602052604090205460ff165b156119d5576119d08585856121c5565b611a7e565b73ffffffffffffffffffffffffffffffffffffffff8086166000908152600e602052604080822054928716825281205490918291611a1b91879160ff918216911661247b565b90925090508115611a4b57600c54611a4b90889073ffffffffffffffffffffffffffffffffffffffff16846121c5565b8015611a5c57611a5c8730836121c5565b611a7b878783611a6c868a613342565b611a769190613342565b6121c5565b50505b611a88858561257c565b5050505050565b600082815260066020908152604080832073ffffffffffffffffffffffffffffffffffffffff8516845290915290205460ff16610d2757600082815260066020908152604080832073ffffffffffffffffffffffffffffffffffffffff85168452909152902080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00166001179055611b253390565b73ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b600082815260066020908152604080832073ffffffffffffffffffffffffffffffffffffffff8516845290915290205460ff1615610d2757600082815260066020908152604080832073ffffffffffffffffffffffffffffffffffffffff8516808552925280832080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0016905551339285917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a45050565b60055473ffffffffffffffffffffffffffffffffffffffff16331461108f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610d14565b6005805473ffffffffffffffffffffffffffffffffffffffff8381167fffffffffffffffffffffffff0000000000000000000000000000000000000000831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b6007546040517f70a0823100000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff8381166004830152600092612710929116906370a0823190602401602060405180830381865afa158015611dac573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611dd09190613355565b601154611ddd919061336e565b611de79190613307565b73ffffffffffffffffffffffffffffffffffffffff8316600090815260208190526040902054610a1491906132c5565b600082815260066020908152604080832073ffffffffffffffffffffffffffffffffffffffff8516845290915290205460ff16610d2757611e57816129ed565b611e62836020612a0c565b604051602001611e73929190613385565b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0818403018152908290527f08c379a0000000000000000000000000000000000000000000000000000000008252610d1491600401613085565b8073ffffffffffffffffffffffffffffffffffffffff163b600003611ef35750565b73ffffffffffffffffffffffffffffffffffffffff81166000908152600e602052604090205460ff166113e757600080611f2c83612c56565b909250905073ffffffffffffffffffffffffffffffffffffffff821615801590611f6b575073ffffffffffffffffffffffffffffffffffffffff811615155b15610c6e57505073ffffffffffffffffffffffffffffffffffffffff166000908152600e60209081526040808320805460017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0091821681179092556010909352922080549091169091179055565b604080516002808252606082018352600092839291906020830190803683370190505090503081600081518110612012576120126132d8565b73ffffffffffffffffffffffffffffffffffffffff928316602091820292909201810191909152600854604080517fef8ef56f0000000000000000000000000000000000000000000000000000000081529051919093169263ef8ef56f9260048083019391928290030181865afa158015612091573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906120b59190613435565b816001815181106120c8576120c86132d8565b73ffffffffffffffffffffffffffffffffffffffff9283166020918202929092010152600d5460085490821631916121039130911686611535565b600854600d546040517f791ac94700000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff9283169263791ac9479261216692899260009289929116904290600401613452565b600060405180830381600087803b15801561218057600080fd5b505af1158015612194573d6000803e3d6000fd5b5050600d546121bd925083915073ffffffffffffffffffffffffffffffffffffffff1631613342565b949350505050565b73ffffffffffffffffffffffffffffffffffffffff8316612268576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f20616460448201527f64726573730000000000000000000000000000000000000000000000000000006064820152608401610d14565b73ffffffffffffffffffffffffffffffffffffffff821661230b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201527f65737300000000000000000000000000000000000000000000000000000000006064820152608401610d14565b7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc9773ffffffffffffffffffffffffffffffffffffffff83160161235257610c6e8382612cd3565b73ffffffffffffffffffffffffffffffffffffffff831660009081526020819052604090205481811015612408576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f45524332303a207472616e7366657220616d6f756e742065786365656473206260448201527f616c616e636500000000000000000000000000000000000000000000000000006064820152608401610d14565b73ffffffffffffffffffffffffffffffffffffffff848116600081815260208181526040808320878703905593871680835291849020805487019055925185815290927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef910160405180910390a36117b9565b60008083156124fb57612710601460018154811061249b5761249b6132d8565b9060005260206000200154866124b1919061336e565b6124bb9190613307565b915061271060146000815481106124d4576124d46132d8565b9060005260206000200154866124ea919061336e565b6124f49190613307565b9050612574565b8215612574576127106014600381548110612518576125186132d8565b90600052602060002001548661252e919061336e565b6125389190613307565b91506127106014600281548110612551576125516132d8565b906000526020600020015486612567919061336e565b6125719190613307565b90505b935093915050565b600a5473ffffffffffffffffffffffffffffffffffffffff1660009081526010602052604090205460ff1661265857600954600a5473ffffffffffffffffffffffffffffffffffffffff918216916314b6ca9691166125da81611d36565b6040517fffffffff0000000000000000000000000000000000000000000000000000000060e085901b16815273ffffffffffffffffffffffffffffffffffffffff90921660048301526024820152604401600060405180830381600087803b15801561264557600080fd5b505af1925050508015612656575060015b505b600b5473ffffffffffffffffffffffffffffffffffffffff1660009081526010602052604090205460ff1661273457600954600b5473ffffffffffffffffffffffffffffffffffffffff918216916314b6ca9691166126b681611d36565b6040517fffffffff0000000000000000000000000000000000000000000000000000000060e085901b16815273ffffffffffffffffffffffffffffffffffffffff90921660048301526024820152604401600060405180830381600087803b15801561272157600080fd5b505af1925050508015612732575060015b505b73ffffffffffffffffffffffffffffffffffffffff821660009081526010602052604090205460ff1661283757600a80547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff84811691909117909155600954166314b6ca96836127b981611d36565b6040517fffffffff0000000000000000000000000000000000000000000000000000000060e085901b16815273ffffffffffffffffffffffffffffffffffffffff90921660048301526024820152604401600060405180830381600087803b15801561282457600080fd5b505af1925050508015612835575060015b505b73ffffffffffffffffffffffffffffffffffffffff811660009081526010602052604090205460ff1661293a57600b80547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff83811691909117909155600954166314b6ca96826128bc81611d36565b6040517fffffffff0000000000000000000000000000000000000000000000000000000060e085901b16815273ffffffffffffffffffffffffffffffffffffffff90921660048301526024820152604401600060405180830381600087803b15801561292757600080fd5b505af1925050508015612938575060015b505b600d547501000000000000000000000000000000000000000000900460ff1615610d27576009546012546040517fffb2c47900000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff9092169163ffb2c479916129b99160040190815260200190565b600060405180830381600087803b1580156129d357600080fd5b505af19250505080156129e4575060015b15610d27575050565b6060610a1473ffffffffffffffffffffffffffffffffffffffff831660145b60606000612a1b83600261336e565b612a269060026132c5565b67ffffffffffffffff811115612a3e57612a3e613406565b6040519080825280601f01601f191660200182016040528015612a68576020820181803683370190505b5090507f300000000000000000000000000000000000000000000000000000000000000081600081518110612a9f57612a9f6132d8565b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a9053507f780000000000000000000000000000000000000000000000000000000000000081600181518110612b0257612b026132d8565b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a9053506000612b3e84600261336e565b612b499060016132c5565b90505b6001811115612be6577f303132333435363738396162636465660000000000000000000000000000000085600f1660108110612b8a57612b8a6132d8565b1a60f81b828281518110612ba057612ba06132d8565b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a90535060049490941c93612bdf816134dd565b9050612b4c565b508315612c4f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e746044820152606401610d14565b9392505050565b600080612c83837f0dfe168100000000000000000000000000000000000000000000000000000000612e9b565b915073ffffffffffffffffffffffffffffffffffffffff821615612cce57612ccb837fd21220a700000000000000000000000000000000000000000000000000000000612e9b565b90505b915091565b73ffffffffffffffffffffffffffffffffffffffff8216612d76576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602160248201527f45524332303a206275726e2066726f6d20746865207a65726f2061646472657360448201527f73000000000000000000000000000000000000000000000000000000000000006064820152608401610d14565b73ffffffffffffffffffffffffffffffffffffffff821660009081526020819052604090205481811015612e2c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602260248201527f45524332303a206275726e20616d6f756e7420657863656564732062616c616e60448201527f63650000000000000000000000000000000000000000000000000000000000006064820152608401610d14565b73ffffffffffffffffffffffffffffffffffffffff8316600081815260208181526040918290208585039055600280548690039055905184815261036992917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef910160405180910390a3505050565b60408051600481526024810182526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fffffffff00000000000000000000000000000000000000000000000000000000851617905290516000918291829173ffffffffffffffffffffffffffffffffffffffff871691612f1e9190613512565b600060405180830381855afa9150503d8060008114612f59576040519150601f19603f3d011682016040523d82523d6000602084013e612f5e565b606091505b5091509150811580612f6f57508051155b15612f7f57600092505050610a14565b8051602003612fa55780806020019051810190612f9c9190613435565b92505050610a14565b506000949350505050565b73ffffffffffffffffffffffffffffffffffffffff811681146113e757600080fd5b600060208284031215612fe457600080fd5b8135612c4f81612fb0565b60006020828403121561300157600080fd5b81357fffffffff0000000000000000000000000000000000000000000000000000000081168114612c4f57600080fd5b8035801515811461304157600080fd5b919050565b60006020828403121561305857600080fd5b612c4f82613031565b60005b8381101561307c578181015183820152602001613064565b50506000910152565b60208152600082518060208401526130a4816040850160208701613061565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169190910160400192915050565b600080604083850312156130e957600080fd5b82356130f481612fb0565b946020939093013593505050565b6000806040838503121561311557600080fd5b50508035926020909101359150565b60008060006060848603121561313957600080fd5b833561314481612fb0565b9250602084013561315481612fb0565b929592945050506040919091013590565b60006020828403121561317757600080fd5b5035919050565b6000806040838503121561319157600080fd5b8235915060208301356131a381612fb0565b809150509250929050565b600080604083850312156131c157600080fd5b82356131cc81612fb0565b91506131da60208401613031565b90509250929050565b600080600080608085870312156131f957600080fd5b5050823594602084013594506040840135936060013592509050565b6000806040838503121561322857600080fd5b823561323381612fb0565b915060208301356131a381612fb0565b600181811c9082168061325757607f821691505b602082108103613290577f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b50919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b80820180821115610a1457610a14613296565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60008261333d577f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b500490565b81810381811115610a1457610a14613296565b60006020828403121561336757600080fd5b5051919050565b8082028115828204841417610a1457610a14613296565b7f416363657373436f6e74726f6c3a206163636f756e74200000000000000000008152600083516133bd816017850160208801613061565b7f206973206d697373696e6720726f6c652000000000000000000000000000000060179184019182015283516133fa816028840160208801613061565b01602801949350505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b60006020828403121561344757600080fd5b8151612c4f81612fb0565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b818110156134af57845173ffffffffffffffffffffffffffffffffffffffff168352938301939183019160010161347d565b505073ffffffffffffffffffffffffffffffffffffffff969096166060850152505050608001529392505050565b6000816134ec576134ec613296565b507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0190565b60008251613524818460208701613061565b919091019291505056fea26469706673582212205f67cabd6f5d50357c646b21e637c7c3a99f2cdf8789e2f618ce2c4117ba1e0f64736f6c63430008150033