Warning! Contract bytecode has been changed and doesn't match the verified one. Therefore, interaction with this smart contract may be risky.
- Contract name:
- BrawlBank
- Optimization enabled
- true
- Compiler version
- v0.8.24+commit.e11b9ed9
- Optimization runs
- 200
- EVM Version
- cancun
- Verified at
- 2025-10-11T18:11:29.730018Z
src/BrawlBank/BrawlBank.sol
// SPDX-License-Identifier: MIT pragma solidity ^0.8.24; /* ███████╗██╗ ██╗████████╗██████╗ ██████╗ ██╗ ██████╗ ██████╗ █████╗ ██╗ ██╗██╗ ██╔════╝██║ ██║╚══██╔══╝██╔══██╗██╔═══██╗██║ ██╔══██╗██╔══██╗██╔══██╗██║ ██║██║ █████╗ ██║ ██║ ██║ ██████╔╝██║ ██║██║ ██████╔╝██████╔╝███████║██║ █╗ ██║██║ ██╔══╝ ██║ ██║ ██║ ██╔══██╗██║ ██║██║ ██╔══██╗██╔══██╗██╔══██║██║███╗██║██║ ██║ ╚██████╔╝ ██║ ██████╔╝╚██████╔╝███████╗██████╔╝██║ ██║██║ ██║╚███╔███╔╝███████╗ ╚═╝ ╚═════╝ ╚═╝ ╚═════╝ ╚═════╝ ╚══════╝╚═════╝ ╚═╝ ╚═╝╚═╝ ╚═╝ ╚══╝╚══╝ ╚══════╝ F U T B O L B R A W L */ import {Initializable} from "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol"; import {UUPSUpgradeable} from "@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol"; import {OwnableUpgradeable} from "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol"; import {PausableUpgradeable} from "@openzeppelin/contracts-upgradeable/utils/PausableUpgradeable.sol"; import {ReentrancyGuardUpgradeable} from "@openzeppelin/contracts-upgradeable/utils/ReentrancyGuardUpgradeable.sol"; import {IBrawlBank} from "../interfaces/BrawlBank/IBrawlBank.sol"; import {IBrawlBankEvents} from "../interfaces/BrawlBank/IBrawlBankEvents.sol"; import {IBrawlBankErrors} from "../interfaces/BrawlBank/IBrawlBankErrors.sol"; /// @title BrawlBank (UUPS) /// @notice Non-transferable ERC20-like bank with admin and contract-authorized flows. /// @dev Designed for OZ v5 Upgradeable. Events & Errors split in interfaces. contract BrawlBank is Initializable, UUPSUpgradeable, OwnableUpgradeable, PausableUpgradeable, ReentrancyGuardUpgradeable, IBrawlBank, IBrawlBankEvents, IBrawlBankErrors { uint256 private constant MAX_TOTAL_P2P_FEE_BPS = 2000; uint256 private constant MAX_COOLDOWN = 1 hours; /// @custom:oz-upgrades-unsafe-allow constructor constructor() { _disableInitializers(); } // ─────────────────────── Storage Layout (V1) ─────────────────────── // Slot 0-50: OpenZeppelin Upgradeable (Ownable, Pausable, ReentrancyGuard, UUPS) // Slot 51: _name (string) // Slot 52: _symbol (string) // Slot 53: _balances (mapping) // Slot 54: _allowances (mapping) // Slot 55: _totalSupply (uint256) // Slot 56: _totalBurned (uint256) // Slot 57: frozen (mapping) // Slot 58: feeCollector (address) // Slot 59: p2pFeePercent (uint256) // Slot 60: p2pBurnPercent (uint256) // Slot 61: p2pCooldown (uint256) // Slot 62: lastP2PTransfer (mapping) // Slot 63: isAuthorized (mapping) // Slot 64: contractDailyMintLimit (mapping) // Slot 65: contractDailyMintUsed (mapping) // Slot 66: _contractDailyMintLastReset (mapping) // Slot 67: adminDailyMintLimit (uint256) // Slot 68: adminDailyMintUsed (uint256) // Slot 69: _adminDailyMintLastReset (uint256) // Slot 70-119: __gap[50] (reserved for future upgrades) // ──────────────────────────────────────────────────────────────────── string private _name; string private _symbol; mapping(address => uint256) private _balances; mapping(address => mapping(address => uint256)) private _allowances; uint256 private _totalSupply; uint256 private _totalBurned; mapping(address => bool) public frozen; address public override feeCollector; uint256 public override p2pFeePercent; uint256 public override p2pBurnPercent; uint256 public override p2pCooldown; mapping(address => uint256) public override lastP2PTransfer; mapping(address => bool) public override isAuthorized; mapping(address => uint256) public override contractDailyMintLimit; mapping(address => uint256) public override contractDailyMintUsed; mapping(address => uint256) private _contractDailyMintLastReset; uint256 public override adminDailyMintLimit; uint256 public override adminDailyMintUsed; uint256 private _adminDailyMintLastReset; modifier onlyAuthorized() { if (!isAuthorized[msg.sender]) revert NotAuthorized(); _; } modifier notFrozen(address account) { if (frozen[account]) revert AccountIsFrozen(account); _; } modifier whenBankNotPaused() { if (paused()) revert BankPaused(); _; } // ---- Initializer ---- function initialize(address _feeCollector) external initializer { if (_feeCollector == address(0)) revert ZeroAddress(); __Ownable_init(msg.sender); __UUPSUpgradeable_init(); __Pausable_init(); __ReentrancyGuard_init(); _name = "Brawl Cash"; _symbol = "BRAWLCASH"; feeCollector = _feeCollector; // sane defaults p2pFeePercent = 300; // 3% p2pBurnPercent = 700; // 7% if (p2pFeePercent + p2pBurnPercent > MAX_TOTAL_P2P_FEE_BPS) revert TotalFeesTooHigh(); p2pCooldown = 15 minutes; if (p2pCooldown > MAX_COOLDOWN) revert CooldownTooLong(); adminDailyMintLimit = 1_000_000 ether; _adminDailyMintLastReset = block.timestamp; } // ---- UUPS ---- function _authorizeUpgrade(address) internal override onlyOwner {} // ---- ERC20-like views ---- function name() external view override returns (string memory) { return _name; } function symbol() external view override returns (string memory) { return _symbol; } function decimals() external pure override returns (uint8) { return 18; } function totalSupply() external view override returns (uint256) { return _totalSupply; } function totalBurned() external view override returns (uint256) { return _totalBurned; } function balanceOf(address a) external view override returns (uint256) { return _balances[a]; } function allowance(address o, address s) external view override returns (uint256) { return _allowances[o][s]; } // ---- Internal helpers ---- function _resetIfNewDay(uint256 last) private view returns (bool isNew) { return block.timestamp / 1 days > last / 1 days; } function _bumpContractMint(address account, uint256 amount) private { if (_resetIfNewDay(_contractDailyMintLastReset[account])) { contractDailyMintUsed[account] = 0; _contractDailyMintLastReset[account] = block.timestamp; } uint256 used = contractDailyMintUsed[account] + amount; uint256 limit = contractDailyMintLimit[account]; if (limit > 0 && used > limit) revert InsufficientBalance(); contractDailyMintUsed[account] = used; // warn at >= 80% if (limit > 0) { uint256 pct = (used * 10_000) / limit; if (pct >= 8000) { emit MintLimitWarning(account, used, limit, pct); } } } function _bumpAdminMint(uint256 amount) private { if (_resetIfNewDay(_adminDailyMintLastReset)) { adminDailyMintUsed = 0; _adminDailyMintLastReset = block.timestamp; } uint256 used = adminDailyMintUsed + amount; uint256 limit = adminDailyMintLimit; if (limit > 0 && used > limit) revert InsufficientBalance(); adminDailyMintUsed = used; if (limit > 0) { uint256 pct = (used * 10_000) / limit; if (pct >= 8000) { emit MintLimitWarning(address(this), used, limit, pct); } } } function _transfer(address from, address to, uint256 amount) internal { if (to == address(0) || from == address(0)) revert ZeroAddress(); uint256 bal = _balances[from]; if (bal < amount) revert InsufficientBalance(); unchecked { _balances[from] = bal - amount; _balances[to] += amount; } emit Transfer(from, to, amount); } // ---- Approvals (ERC20-like) ---- function approve(address spender, uint256 amount) external override whenBankNotPaused returns (bool) { if (spender == address(0)) revert ZeroAddress(); _allowances[msg.sender][spender] = amount; emit Approval(msg.sender, spender, amount); return true; } function increaseAllowance(address spender, uint256 addedValue) external override whenBankNotPaused returns (bool) { if (spender == address(0)) revert ZeroAddress(); uint256 current = _allowances[msg.sender][spender]; uint256 updated = current + addedValue; _allowances[msg.sender][spender] = updated; emit Approval(msg.sender, spender, updated); return true; } function decreaseAllowance(address spender, uint256 subtractedValue) external override whenBankNotPaused returns (bool) { if (spender == address(0)) revert ZeroAddress(); uint256 current = _allowances[msg.sender][spender]; if (current < subtractedValue) revert InsufficientAllowance(); unchecked { _allowances[msg.sender][spender] = current - subtractedValue; } emit Approval(msg.sender, spender, _allowances[msg.sender][spender]); return true; } // ---- Transfers (restricted) ---- /// @notice ERC20-like transferFrom but only for authorized callers (routers, products). function transferFrom(address from, address to, uint256 amount) external override onlyAuthorized whenBankNotPaused nonReentrant notFrozen(from) notFrozen(to) { if (to == address(0) || from == address(0)) revert ZeroAddress(); uint256 a = _allowances[from][msg.sender]; if (a < amount) revert InsufficientAllowance(); if (_balances[from] < amount) revert InsufficientBalance(); unchecked { _allowances[from][msg.sender] = a - amount; } _transfer(from, to, amount); } /// @notice Contract-to-contract internal transfer by authorized products. function internalTransfer(address from, address to, uint256 amount) external override onlyAuthorized whenBankNotPaused nonReentrant notFrozen(from) notFrozen(to) { _transfer(from, to, amount); } /// @notice End-user P2P transfer applying fee+burn and cooldown. function p2pTransfer(address to, uint256 amount) external override whenBankNotPaused nonReentrant notFrozen(msg.sender) notFrozen(to) { if (to == address(0)) revert ZeroAddress(); // cooldown uint256 last = lastP2PTransfer[msg.sender]; if (last != 0) { uint256 passed = block.timestamp - last; if (passed < p2pCooldown) revert CooldownActive(p2pCooldown - passed); } lastP2PTransfer[msg.sender] = block.timestamp; // fee/burn uint256 fee = (amount * p2pFeePercent) / 10_000; uint256 burned = (amount * p2pBurnPercent) / 10_000; uint256 net = amount - fee - burned; if (net == 0) revert NetAmountZero(); // move & burn _transfer(msg.sender, to, net); if (fee > 0) _transfer(msg.sender, feeCollector, fee); if (burned > 0) { uint256 bal = _balances[msg.sender]; if (bal < burned) revert InsufficientBalance(); unchecked { _balances[msg.sender] = bal - burned; } _totalSupply -= burned; _totalBurned += burned; emit Burned(msg.sender, burned, "p2pTransfer"); emit Transfer(msg.sender, address(0), burned); } emit P2PTransfer(msg.sender, to, amount, fee, burned, net); } // ---- Core mint/burn ---- function mint(address to, uint256 amount, string calldata reason) external override whenBankNotPaused nonReentrant notFrozen(to) { if (to == address(0)) revert ZeroAddress(); if (isAuthorized[msg.sender]) { _bumpContractMint(msg.sender, amount); } else if (msg.sender == owner()) { _bumpAdminMint(amount); } else { revert NotAuthorized(); } _totalSupply += amount; _balances[to] += amount; emit Minted(to, amount, reason); emit Transfer(address(0), to, amount); } function burn(address from, uint256 amount, string calldata reason) external override whenBankNotPaused nonReentrant notFrozen(from) { if (msg.sender != from && !isAuthorized[msg.sender]) revert NotAuthorized(); uint256 bal = _balances[from]; if (bal < amount) revert InsufficientBalance(); unchecked { _balances[from] = bal - amount; } _totalSupply -= amount; _totalBurned += amount; emit Burned(from, amount, reason); emit Transfer(from, address(0), amount); } // ---- Admin operations (owner) ---- function adminMint(address to, uint256 amount, string calldata reason) external override whenBankNotPaused onlyOwner nonReentrant // intentionally ignores frozen to allow emergency ops; add notFrozen(to) if you want strict freeze. { if (to == address(0)) revert ZeroAddress(); _bumpAdminMint(amount); _totalSupply += amount; _balances[to] += amount; emit AdminMint(to, amount, reason); emit Transfer(address(0), to, amount); } function batchAdminMint(address[] calldata recipients, uint256[] calldata amounts, string calldata reason) external override whenBankNotPaused onlyOwner nonReentrant { if (recipients.length != amounts.length) revert LengthMismatch(); uint256 len = recipients.length; uint256 total; for (uint256 i; i < len;) { address to = recipients[i]; if (to == address(0)) revert ZeroAddress(); uint256 amt = amounts[i]; total += amt; unchecked { ++i; } } _bumpAdminMint(total); for (uint256 i; i < len;) { address to = recipients[i]; uint256 amt = amounts[i]; _totalSupply += amt; _balances[to] += amt; emit AdminMint(to, amt, reason); emit Transfer(address(0), to, amt); unchecked { ++i; } } emit BatchAdminMint(len, total, reason); } function adminBurn(address from, uint256 amount, string calldata reason) external override whenBankNotPaused onlyOwner nonReentrant // intentionally ignores frozen to allow emergency burn; add notFrozen(from) if desired. { uint256 bal = _balances[from]; if (bal < amount) revert InsufficientBalance(); unchecked { _balances[from] = bal - amount; } _totalSupply -= amount; _totalBurned += amount; emit AdminBurn(from, amount, reason); emit Transfer(from, address(0), amount); } function adminTransfer(address from, address to, uint256 amount, string calldata reason) external override whenBankNotPaused onlyOwner nonReentrant // intentionally ignores frozen; add notFrozen(from)/notFrozen(to) if you want strict freeze. { _transfer(from, to, amount); emit AdminTransfer(from, to, amount, reason); } // ---- Auth / policy ---- function setAuthorizedContract(address account, bool status) external override onlyOwner { if (account == address(0)) revert ZeroAddress(); isAuthorized[account] = status; emit AuthorizedContractUpdated(account, status); } function setContractDailyMintLimit(address account, uint256 limit) external override onlyOwner { if (account == address(0)) revert ZeroAddress(); contractDailyMintLimit[account] = limit; emit ContractDailyMintLimitSet(account, limit); } function setAdminDailyMintLimit(uint256 limit) external override onlyOwner { adminDailyMintLimit = limit; emit AdminDailyMintLimitSet(limit); } function freezeAccount(address account, string calldata reason) external override onlyOwner { if (account == address(0)) revert ZeroAddress(); frozen[account] = true; emit AccountFrozen(account, reason); } function unfreezeAccount(address account) external override onlyOwner { if (account == address(0)) revert ZeroAddress(); frozen[account] = false; emit AccountUnfrozen(account); } function pause() external override onlyOwner { _pause(); } function unpause() external override onlyOwner { _unpause(); } function frozenAccounts(address account) external view override returns (bool) { return frozen[account]; } // ---- Fee / P2P params ---- function setFeeCollector(address collector) external override onlyOwner { if (collector == address(0)) revert ZeroAddress(); address old = feeCollector; feeCollector = collector; emit FeeCollectorUpdated(old, collector); } function setP2PParams(uint256 feeBps, uint256 burnBps, uint256 cooldown) external override onlyOwner { if (feeBps + burnBps > MAX_TOTAL_P2P_FEE_BPS) revert TotalFeesTooHigh(); if (cooldown > MAX_COOLDOWN) revert CooldownTooLong(); p2pFeePercent = feeBps; p2pBurnPercent = burnBps; p2pCooldown = cooldown; emit P2PParamsUpdated(feeBps, burnBps, cooldown); } // ───────────────────────── Gap ──────────────────────────── uint256[50] private __gap; }
lib/openzeppelin-contracts/contracts/utils/Address.sol
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.4.0) (utils/Address.sol) pragma solidity ^0.8.20; import {Errors} from "./Errors.sol"; /** * @dev Collection of functions related to the address type */ library Address { /** * @dev There's no code at `target` (it is not a contract). */ error AddressEmptyCode(address target); /** * @dev Replacement for Solidity's `transfer`: sends `amount` wei to * `recipient`, forwarding all available gas and reverting on errors. * * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost * of certain opcodes, possibly making contracts go over the 2300 gas limit * imposed by `transfer`, making them unable to receive funds via * `transfer`. {sendValue} removes this limitation. * * https://consensys.net/diligence/blog/2019/09/stop-using-soliditys-transfer-now/[Learn more]. * * IMPORTANT: because control is transferred to `recipient`, care must be * taken to not create reentrancy vulnerabilities. Consider using * {ReentrancyGuard} or the * https://solidity.readthedocs.io/en/v0.8.20/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern]. */ function sendValue(address payable recipient, uint256 amount) internal { if (address(this).balance < amount) { revert Errors.InsufficientBalance(address(this).balance, amount); } (bool success, bytes memory returndata) = recipient.call{value: amount}(""); if (!success) { _revert(returndata); } } /** * @dev Performs a Solidity function call using a low level `call`. A * plain `call` is an unsafe replacement for a function call: use this * function instead. * * If `target` reverts with a revert reason or custom error, it is bubbled * up by this function (like regular Solidity function calls). However, if * the call reverted with no returned reason, this function reverts with a * {Errors.FailedCall} error. * * Returns the raw returned data. To convert to the expected return value, * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`]. * * Requirements: * * - `target` must be a contract. * - calling `target` with `data` must not revert. */ function functionCall(address target, bytes memory data) internal returns (bytes memory) { return functionCallWithValue(target, data, 0); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but also transferring `value` wei to `target`. * * Requirements: * * - the calling contract must have an ETH balance of at least `value`. * - the called Solidity function must be `payable`. */ function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) { if (address(this).balance < value) { revert Errors.InsufficientBalance(address(this).balance, value); } (bool success, bytes memory returndata) = target.call{value: value}(data); return verifyCallResultFromTarget(target, success, returndata); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but performing a static call. */ function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) { (bool success, bytes memory returndata) = target.staticcall(data); return verifyCallResultFromTarget(target, success, returndata); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but performing a delegate call. */ function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) { (bool success, bytes memory returndata) = target.delegatecall(data); return verifyCallResultFromTarget(target, success, returndata); } /** * @dev Tool to verify that a low level call to smart-contract was successful, and reverts if the target * was not a contract or bubbling up the revert reason (falling back to {Errors.FailedCall}) in case * of an unsuccessful call. */ function verifyCallResultFromTarget( address target, bool success, bytes memory returndata ) internal view returns (bytes memory) { if (!success) { _revert(returndata); } else { // only check if target is a contract if the call was successful and the return data is empty // otherwise we already know that it was a contract if (returndata.length == 0 && target.code.length == 0) { revert AddressEmptyCode(target); } return returndata; } } /** * @dev Tool to verify that a low level call was successful, and reverts if it wasn't, either by bubbling the * revert reason or with a default {Errors.FailedCall} error. */ function verifyCallResult(bool success, bytes memory returndata) internal pure returns (bytes memory) { if (!success) { _revert(returndata); } else { return returndata; } } /** * @dev Reverts with returndata if present. Otherwise reverts with {Errors.FailedCall}. */ function _revert(bytes memory returndata) private pure { // Look for revert reason and bubble it up if present if (returndata.length > 0) { // The easiest way to bubble the revert reason is using memory via assembly assembly ("memory-safe") { revert(add(returndata, 0x20), mload(returndata)) } } else { revert Errors.FailedCall(); } } }
lib/openzeppelin-contracts/contracts/utils/Errors.sol
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.1.0) (utils/Errors.sol) pragma solidity ^0.8.20; /** * @dev Collection of common custom errors used in multiple contracts * * IMPORTANT: Backwards compatibility is not guaranteed in future versions of the library. * It is recommended to avoid relying on the error API for critical functionality. * * _Available since v5.1._ */ library Errors { /** * @dev The ETH balance of the account is not enough to perform the operation. */ error InsufficientBalance(uint256 balance, uint256 needed); /** * @dev A call to an address target failed. The target may have reverted. */ error FailedCall(); /** * @dev The deployment failed. */ error FailedDeployment(); /** * @dev A necessary precompile is missing. */ error MissingPrecompile(address); }
lib/openzeppelin-contracts-upgradeable/contracts/access/OwnableUpgradeable.sol
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.0) (access/Ownable.sol) pragma solidity ^0.8.20; import {ContextUpgradeable} from "../utils/ContextUpgradeable.sol"; import {Initializable} from "../proxy/utils/Initializable.sol"; /** * @dev Contract module which provides a basic access control mechanism, where * there is an account (an owner) that can be granted exclusive access to * specific functions. * * The initial owner is set to the address provided by the deployer. This can * later be changed with {transferOwnership}. * * This module is used through inheritance. It will make available the modifier * `onlyOwner`, which can be applied to your functions to restrict their use to * the owner. */ abstract contract OwnableUpgradeable is Initializable, ContextUpgradeable { /// @custom:storage-location erc7201:openzeppelin.storage.Ownable struct OwnableStorage { address _owner; } // keccak256(abi.encode(uint256(keccak256("openzeppelin.storage.Ownable")) - 1)) & ~bytes32(uint256(0xff)) bytes32 private constant OwnableStorageLocation = 0x9016d09d72d40fdae2fd8ceac6b6234c7706214fd39c1cd1e609a0528c199300; function _getOwnableStorage() private pure returns (OwnableStorage storage $) { assembly { $.slot := OwnableStorageLocation } } /** * @dev The caller account is not authorized to perform an operation. */ error OwnableUnauthorizedAccount(address account); /** * @dev The owner is not a valid owner account. (eg. `address(0)`) */ error OwnableInvalidOwner(address owner); event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev Initializes the contract setting the address provided by the deployer as the initial owner. */ function __Ownable_init(address initialOwner) internal onlyInitializing { __Ownable_init_unchained(initialOwner); } function __Ownable_init_unchained(address initialOwner) internal onlyInitializing { if (initialOwner == address(0)) { revert OwnableInvalidOwner(address(0)); } _transferOwnership(initialOwner); } /** * @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) { OwnableStorage storage $ = _getOwnableStorage(); return $._owner; } /** * @dev Throws if the sender is not the owner. */ function _checkOwner() internal view virtual { if (owner() != _msgSender()) { revert OwnableUnauthorizedAccount(_msgSender()); } } /** * @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 { if (newOwner == address(0)) { revert OwnableInvalidOwner(address(0)); } _transferOwnership(newOwner); } /** * @dev Transfers ownership of the contract to a new account (`newOwner`). * Internal function without access restriction. */ function _transferOwnership(address newOwner) internal virtual { OwnableStorage storage $ = _getOwnableStorage(); address oldOwner = $._owner; $._owner = newOwner; emit OwnershipTransferred(oldOwner, newOwner); } }
lib/openzeppelin-contracts-upgradeable/contracts/proxy/utils/Initializable.sol
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.3.0) (proxy/utils/Initializable.sol) pragma solidity ^0.8.20; /** * @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed * behind a proxy. Since proxied contracts do not make use of a constructor, it's common to move constructor logic to an * external initializer function, usually called `initialize`. It then becomes necessary to protect this initializer * function so it can only be called once. The {initializer} modifier provided by this contract will have this effect. * * The initialization functions use a version number. Once a version number is used, it is consumed and cannot be * reused. This mechanism prevents re-execution of each "step" but allows the creation of new initialization steps in * case an upgrade adds a module that needs to be initialized. * * For example: * * [.hljs-theme-light.nopadding] * ```solidity * contract MyToken is ERC20Upgradeable { * function initialize() initializer public { * __ERC20_init("MyToken", "MTK"); * } * } * * contract MyTokenV2 is MyToken, ERC20PermitUpgradeable { * function initializeV2() reinitializer(2) public { * __ERC20Permit_init("MyToken"); * } * } * ``` * * TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as * possible by providing the encoded function call as the `_data` argument to {ERC1967Proxy-constructor}. * * CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure * that all initializers are idempotent. This is not verified automatically as constructors are by Solidity. * * [CAUTION] * ==== * Avoid leaving a contract uninitialized. * * An uninitialized contract can be taken over by an attacker. This applies to both a proxy and its implementation * contract, which may impact the proxy. To prevent the implementation contract from being used, you should invoke * the {_disableInitializers} function in the constructor to automatically lock it when it is deployed: * * [.hljs-theme-light.nopadding] * ``` * /// @custom:oz-upgrades-unsafe-allow constructor * constructor() { * _disableInitializers(); * } * ``` * ==== */ abstract contract Initializable { /** * @dev Storage of the initializable contract. * * It's implemented on a custom ERC-7201 namespace to reduce the risk of storage collisions * when using with upgradeable contracts. * * @custom:storage-location erc7201:openzeppelin.storage.Initializable */ struct InitializableStorage { /** * @dev Indicates that the contract has been initialized. */ uint64 _initialized; /** * @dev Indicates that the contract is in the process of being initialized. */ bool _initializing; } // keccak256(abi.encode(uint256(keccak256("openzeppelin.storage.Initializable")) - 1)) & ~bytes32(uint256(0xff)) bytes32 private constant INITIALIZABLE_STORAGE = 0xf0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a00; /** * @dev The contract is already initialized. */ error InvalidInitialization(); /** * @dev The contract is not initializing. */ error NotInitializing(); /** * @dev Triggered when the contract has been initialized or reinitialized. */ event Initialized(uint64 version); /** * @dev A modifier that defines a protected initializer function that can be invoked at most once. In its scope, * `onlyInitializing` functions can be used to initialize parent contracts. * * Similar to `reinitializer(1)`, except that in the context of a constructor an `initializer` may be invoked any * number of times. This behavior in the constructor can be useful during testing and is not expected to be used in * production. * * Emits an {Initialized} event. */ modifier initializer() { // solhint-disable-next-line var-name-mixedcase InitializableStorage storage $ = _getInitializableStorage(); // Cache values to avoid duplicated sloads bool isTopLevelCall = !$._initializing; uint64 initialized = $._initialized; // Allowed calls: // - initialSetup: the contract is not in the initializing state and no previous version was // initialized // - construction: the contract is initialized at version 1 (no reinitialization) and the // current contract is just being deployed bool initialSetup = initialized == 0 && isTopLevelCall; bool construction = initialized == 1 && address(this).code.length == 0; if (!initialSetup && !construction) { revert InvalidInitialization(); } $._initialized = 1; if (isTopLevelCall) { $._initializing = true; } _; if (isTopLevelCall) { $._initializing = false; emit Initialized(1); } } /** * @dev A modifier that defines a protected reinitializer function that can be invoked at most once, and only if the * contract hasn't been initialized to a greater version before. In its scope, `onlyInitializing` functions can be * used to initialize parent contracts. * * A reinitializer may be used after the original initialization step. This is essential to configure modules that * are added through upgrades and that require initialization. * * When `version` is 1, this modifier is similar to `initializer`, except that functions marked with `reinitializer` * cannot be nested. If one is invoked in the context of another, execution will revert. * * Note that versions can jump in increments greater than 1; this implies that if multiple reinitializers coexist in * a contract, executing them in the right order is up to the developer or operator. * * WARNING: Setting the version to 2**64 - 1 will prevent any future reinitialization. * * Emits an {Initialized} event. */ modifier reinitializer(uint64 version) { // solhint-disable-next-line var-name-mixedcase InitializableStorage storage $ = _getInitializableStorage(); if ($._initializing || $._initialized >= version) { revert InvalidInitialization(); } $._initialized = version; $._initializing = true; _; $._initializing = false; emit Initialized(version); } /** * @dev Modifier to protect an initialization function so that it can only be invoked by functions with the * {initializer} and {reinitializer} modifiers, directly or indirectly. */ modifier onlyInitializing() { _checkInitializing(); _; } /** * @dev Reverts if the contract is not in an initializing state. See {onlyInitializing}. */ function _checkInitializing() internal view virtual { if (!_isInitializing()) { revert NotInitializing(); } } /** * @dev Locks the contract, preventing any future reinitialization. This cannot be part of an initializer call. * Calling this in the constructor of a contract will prevent that contract from being initialized or reinitialized * to any version. It is recommended to use this to lock implementation contracts that are designed to be called * through proxies. * * Emits an {Initialized} event the first time it is successfully executed. */ function _disableInitializers() internal virtual { // solhint-disable-next-line var-name-mixedcase InitializableStorage storage $ = _getInitializableStorage(); if ($._initializing) { revert InvalidInitialization(); } if ($._initialized != type(uint64).max) { $._initialized = type(uint64).max; emit Initialized(type(uint64).max); } } /** * @dev Returns the highest version that has been initialized. See {reinitializer}. */ function _getInitializedVersion() internal view returns (uint64) { return _getInitializableStorage()._initialized; } /** * @dev Returns `true` if the contract is currently initializing. See {onlyInitializing}. */ function _isInitializing() internal view returns (bool) { return _getInitializableStorage()._initializing; } /** * @dev Pointer to storage slot. Allows integrators to override it with a custom storage location. * * NOTE: Consider following the ERC-7201 formula to derive storage locations. */ function _initializableStorageSlot() internal pure virtual returns (bytes32) { return INITIALIZABLE_STORAGE; } /** * @dev Returns a pointer to the storage namespace. */ // solhint-disable-next-line var-name-mixedcase function _getInitializableStorage() private pure returns (InitializableStorage storage $) { bytes32 slot = _initializableStorageSlot(); assembly { $.slot := slot } } }
lib/openzeppelin-contracts-upgradeable/contracts/proxy/utils/UUPSUpgradeable.sol
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.3.0) (proxy/utils/UUPSUpgradeable.sol) pragma solidity ^0.8.22; import {IERC1822Proxiable} from "@openzeppelin/contracts/interfaces/draft-IERC1822.sol"; import {ERC1967Utils} from "@openzeppelin/contracts/proxy/ERC1967/ERC1967Utils.sol"; import {Initializable} from "./Initializable.sol"; /** * @dev An upgradeability mechanism designed for UUPS proxies. The functions included here can perform an upgrade of an * {ERC1967Proxy}, when this contract is set as the implementation behind such a proxy. * * A security mechanism ensures that an upgrade does not turn off upgradeability accidentally, although this risk is * reinstated if the upgrade retains upgradeability but removes the security mechanism, e.g. by replacing * `UUPSUpgradeable` with a custom implementation of upgrades. * * The {_authorizeUpgrade} function must be overridden to include access restriction to the upgrade mechanism. */ abstract contract UUPSUpgradeable is Initializable, IERC1822Proxiable { /// @custom:oz-upgrades-unsafe-allow state-variable-immutable address private immutable __self = address(this); /** * @dev The version of the upgrade interface of the contract. If this getter is missing, both `upgradeTo(address)` * and `upgradeToAndCall(address,bytes)` are present, and `upgradeTo` must be used if no function should be called, * while `upgradeToAndCall` will invoke the `receive` function if the second argument is the empty byte string. * If the getter returns `"5.0.0"`, only `upgradeToAndCall(address,bytes)` is present, and the second argument must * be the empty byte string if no function should be called, making it impossible to invoke the `receive` function * during an upgrade. */ string public constant UPGRADE_INTERFACE_VERSION = "5.0.0"; /** * @dev The call is from an unauthorized context. */ error UUPSUnauthorizedCallContext(); /** * @dev The storage `slot` is unsupported as a UUID. */ error UUPSUnsupportedProxiableUUID(bytes32 slot); /** * @dev Check that the execution is being performed through a delegatecall call and that the execution context is * a proxy contract with an implementation (as defined in ERC-1967) pointing to self. This should only be the case * for UUPS and transparent proxies that are using the current contract as their implementation. Execution of a * function through ERC-1167 minimal proxies (clones) would not normally pass this test, but is not guaranteed to * fail. */ modifier onlyProxy() { _checkProxy(); _; } /** * @dev Check that the execution is not being performed through a delegate call. This allows a function to be * callable on the implementing contract but not through proxies. */ modifier notDelegated() { _checkNotDelegated(); _; } function __UUPSUpgradeable_init() internal onlyInitializing { } function __UUPSUpgradeable_init_unchained() internal onlyInitializing { } /** * @dev Implementation of the ERC-1822 {proxiableUUID} function. This returns the storage slot used by the * implementation. It is used to validate the implementation's compatibility when performing an upgrade. * * IMPORTANT: A proxy pointing at a proxiable contract should not be considered proxiable itself, because this risks * bricking a proxy that upgrades to it, by delegating to itself until out of gas. Thus it is critical that this * function revert if invoked through a proxy. This is guaranteed by the `notDelegated` modifier. */ function proxiableUUID() external view virtual notDelegated returns (bytes32) { return ERC1967Utils.IMPLEMENTATION_SLOT; } /** * @dev Upgrade the implementation of the proxy to `newImplementation`, and subsequently execute the function call * encoded in `data`. * * Calls {_authorizeUpgrade}. * * Emits an {Upgraded} event. * * @custom:oz-upgrades-unsafe-allow-reachable delegatecall */ function upgradeToAndCall(address newImplementation, bytes memory data) public payable virtual onlyProxy { _authorizeUpgrade(newImplementation); _upgradeToAndCallUUPS(newImplementation, data); } /** * @dev Reverts if the execution is not performed via delegatecall or the execution * context is not of a proxy with an ERC-1967 compliant implementation pointing to self. */ function _checkProxy() internal view virtual { if ( address(this) == __self || // Must be called through delegatecall ERC1967Utils.getImplementation() != __self // Must be called through an active proxy ) { revert UUPSUnauthorizedCallContext(); } } /** * @dev Reverts if the execution is performed via delegatecall. * See {notDelegated}. */ function _checkNotDelegated() internal view virtual { if (address(this) != __self) { // Must not be called through delegatecall revert UUPSUnauthorizedCallContext(); } } /** * @dev Function that should revert when `msg.sender` is not authorized to upgrade the contract. Called by * {upgradeToAndCall}. * * Normally, this function will use an xref:access.adoc[access control] modifier such as {Ownable-onlyOwner}. * * ```solidity * function _authorizeUpgrade(address) internal onlyOwner {} * ``` */ function _authorizeUpgrade(address newImplementation) internal virtual; /** * @dev Performs an implementation upgrade with a security check for UUPS proxies, and additional setup call. * * As a security check, {proxiableUUID} is invoked in the new implementation, and the return value * is expected to be the implementation slot in ERC-1967. * * Emits an {IERC1967-Upgraded} event. */ function _upgradeToAndCallUUPS(address newImplementation, bytes memory data) private { try IERC1822Proxiable(newImplementation).proxiableUUID() returns (bytes32 slot) { if (slot != ERC1967Utils.IMPLEMENTATION_SLOT) { revert UUPSUnsupportedProxiableUUID(slot); } ERC1967Utils.upgradeToAndCall(newImplementation, data); } catch { // The implementation is not UUPS revert ERC1967Utils.ERC1967InvalidImplementation(newImplementation); } } }
lib/openzeppelin-contracts-upgradeable/contracts/utils/ContextUpgradeable.sol
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.1) (utils/Context.sol) pragma solidity ^0.8.20; import {Initializable} from "../proxy/utils/Initializable.sol"; /** * @dev Provides information about the current execution context, including the * sender of the transaction and its data. While these are generally available * via msg.sender and msg.data, they should not be accessed in such a direct * manner, since when dealing with meta-transactions the account sending and * paying for execution may not be the actual sender (as far as an application * is concerned). * * This contract is only required for intermediate, library-like contracts. */ abstract contract ContextUpgradeable is Initializable { function __Context_init() internal onlyInitializing { } function __Context_init_unchained() internal onlyInitializing { } function _msgSender() internal view virtual returns (address) { return msg.sender; } function _msgData() internal view virtual returns (bytes calldata) { return msg.data; } function _contextSuffixLength() internal view virtual returns (uint256) { return 0; } }
lib/openzeppelin-contracts-upgradeable/contracts/utils/PausableUpgradeable.sol
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.3.0) (utils/Pausable.sol) pragma solidity ^0.8.20; import {ContextUpgradeable} from "../utils/ContextUpgradeable.sol"; import {Initializable} from "../proxy/utils/Initializable.sol"; /** * @dev Contract module which allows children to implement an emergency stop * mechanism that can be triggered by an authorized account. * * This module is used through inheritance. It will make available the * modifiers `whenNotPaused` and `whenPaused`, which can be applied to * the functions of your contract. Note that they will not be pausable by * simply including this module, only once the modifiers are put in place. */ abstract contract PausableUpgradeable is Initializable, ContextUpgradeable { /// @custom:storage-location erc7201:openzeppelin.storage.Pausable struct PausableStorage { bool _paused; } // keccak256(abi.encode(uint256(keccak256("openzeppelin.storage.Pausable")) - 1)) & ~bytes32(uint256(0xff)) bytes32 private constant PausableStorageLocation = 0xcd5ed15c6e187e77e9aee88184c21f4f2182ab5827cb3b7e07fbedcd63f03300; function _getPausableStorage() private pure returns (PausableStorage storage $) { assembly { $.slot := PausableStorageLocation } } /** * @dev Emitted when the pause is triggered by `account`. */ event Paused(address account); /** * @dev Emitted when the pause is lifted by `account`. */ event Unpaused(address account); /** * @dev The operation failed because the contract is paused. */ error EnforcedPause(); /** * @dev The operation failed because the contract is not paused. */ error ExpectedPause(); /** * @dev Modifier to make a function callable only when the contract is not paused. * * Requirements: * * - The contract must not be paused. */ modifier whenNotPaused() { _requireNotPaused(); _; } /** * @dev Modifier to make a function callable only when the contract is paused. * * Requirements: * * - The contract must be paused. */ modifier whenPaused() { _requirePaused(); _; } function __Pausable_init() internal onlyInitializing { } function __Pausable_init_unchained() internal onlyInitializing { } /** * @dev Returns true if the contract is paused, and false otherwise. */ function paused() public view virtual returns (bool) { PausableStorage storage $ = _getPausableStorage(); return $._paused; } /** * @dev Throws if the contract is paused. */ function _requireNotPaused() internal view virtual { if (paused()) { revert EnforcedPause(); } } /** * @dev Throws if the contract is not paused. */ function _requirePaused() internal view virtual { if (!paused()) { revert ExpectedPause(); } } /** * @dev Triggers stopped state. * * Requirements: * * - The contract must not be paused. */ function _pause() internal virtual whenNotPaused { PausableStorage storage $ = _getPausableStorage(); $._paused = true; emit Paused(_msgSender()); } /** * @dev Returns to normal state. * * Requirements: * * - The contract must be paused. */ function _unpause() internal virtual whenPaused { PausableStorage storage $ = _getPausableStorage(); $._paused = false; emit Unpaused(_msgSender()); } }
lib/openzeppelin-contracts-upgradeable/contracts/utils/ReentrancyGuardUpgradeable.sol
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.1.0) (utils/ReentrancyGuard.sol) pragma solidity ^0.8.20; import {Initializable} from "../proxy/utils/Initializable.sol"; /** * @dev Contract module that helps prevent reentrant calls to a function. * * Inheriting from `ReentrancyGuard` will make the {nonReentrant} modifier * available, which can be applied to functions to make sure there are no nested * (reentrant) calls to them. * * Note that because there is a single `nonReentrant` guard, functions marked as * `nonReentrant` may not call one another. This can be worked around by making * those functions `private`, and then adding `external` `nonReentrant` entry * points to them. * * TIP: If EIP-1153 (transient storage) is available on the chain you're deploying at, * consider using {ReentrancyGuardTransient} instead. * * TIP: If you would like to learn more about reentrancy and alternative ways * to protect against it, check out our blog post * https://blog.openzeppelin.com/reentrancy-after-istanbul/[Reentrancy After Istanbul]. */ abstract contract ReentrancyGuardUpgradeable is Initializable { // Booleans are more expensive than uint256 or any type that takes up a full // word because each write operation emits an extra SLOAD to first read the // slot's contents, replace the bits taken up by the boolean, and then write // back. This is the compiler's defense against contract upgrades and // pointer aliasing, and it cannot be disabled. // The values being non-zero value makes deployment a bit more expensive, // but in exchange the refund on every call to nonReentrant will be lower in // amount. Since refunds are capped to a percentage of the total // transaction's gas, it is best to keep them low in cases like this one, to // increase the likelihood of the full refund coming into effect. uint256 private constant NOT_ENTERED = 1; uint256 private constant ENTERED = 2; /// @custom:storage-location erc7201:openzeppelin.storage.ReentrancyGuard struct ReentrancyGuardStorage { uint256 _status; } // keccak256(abi.encode(uint256(keccak256("openzeppelin.storage.ReentrancyGuard")) - 1)) & ~bytes32(uint256(0xff)) bytes32 private constant ReentrancyGuardStorageLocation = 0x9b779b17422d0df92223018b32b4d1fa46e071723d6817e2486d003becc55f00; function _getReentrancyGuardStorage() private pure returns (ReentrancyGuardStorage storage $) { assembly { $.slot := ReentrancyGuardStorageLocation } } /** * @dev Unauthorized reentrant call. */ error ReentrancyGuardReentrantCall(); function __ReentrancyGuard_init() internal onlyInitializing { __ReentrancyGuard_init_unchained(); } function __ReentrancyGuard_init_unchained() internal onlyInitializing { ReentrancyGuardStorage storage $ = _getReentrancyGuardStorage(); $._status = NOT_ENTERED; } /** * @dev Prevents a contract from calling itself, directly or indirectly. * Calling a `nonReentrant` function from another `nonReentrant` * function is not supported. It is possible to prevent this from happening * by making the `nonReentrant` function external, and making it call a * `private` function that does the actual work. */ modifier nonReentrant() { _nonReentrantBefore(); _; _nonReentrantAfter(); } function _nonReentrantBefore() private { ReentrancyGuardStorage storage $ = _getReentrancyGuardStorage(); // On the first call to nonReentrant, _status will be NOT_ENTERED if ($._status == ENTERED) { revert ReentrancyGuardReentrantCall(); } // Any calls to nonReentrant after this point will fail $._status = ENTERED; } function _nonReentrantAfter() private { ReentrancyGuardStorage storage $ = _getReentrancyGuardStorage(); // By storing the original value once again, a refund is triggered (see // https://eips.ethereum.org/EIPS/eip-2200) $._status = NOT_ENTERED; } /** * @dev Returns true if the reentrancy guard is currently set to "entered", which indicates there is a * `nonReentrant` function in the call stack. */ function _reentrancyGuardEntered() internal view returns (bool) { ReentrancyGuardStorage storage $ = _getReentrancyGuardStorage(); return $._status == ENTERED; } }
lib/openzeppelin-contracts/contracts/interfaces/IERC1967.sol
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.4.0) (interfaces/IERC1967.sol) pragma solidity >=0.4.11; /** * @dev ERC-1967: Proxy Storage Slots. This interface contains the events defined in the ERC. */ interface IERC1967 { /** * @dev Emitted when the implementation is upgraded. */ event Upgraded(address indexed implementation); /** * @dev Emitted when the admin account has changed. */ event AdminChanged(address previousAdmin, address newAdmin); /** * @dev Emitted when the beacon is changed. */ event BeaconUpgraded(address indexed beacon); }
lib/openzeppelin-contracts/contracts/interfaces/draft-IERC1822.sol
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.4.0) (interfaces/draft-IERC1822.sol) pragma solidity >=0.4.16; /** * @dev ERC-1822: Universal Upgradeable Proxy Standard (UUPS) documents a method for upgradeability through a simplified * proxy whose upgrades are fully controlled by the current implementation. */ interface IERC1822Proxiable { /** * @dev Returns the storage slot that the proxiable contract assumes is being used to store the implementation * address. * * IMPORTANT: A proxy pointing at a proxiable contract should not be considered proxiable itself, because this risks * bricking a proxy that upgrades to it, by delegating to itself until out of gas. Thus it is critical that this * function revert if invoked through a proxy. */ function proxiableUUID() external view returns (bytes32); }
lib/openzeppelin-contracts/contracts/proxy/ERC1967/ERC1967Utils.sol
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.4.0) (proxy/ERC1967/ERC1967Utils.sol) pragma solidity ^0.8.21; import {IBeacon} from "../beacon/IBeacon.sol"; import {IERC1967} from "../../interfaces/IERC1967.sol"; import {Address} from "../../utils/Address.sol"; import {StorageSlot} from "../../utils/StorageSlot.sol"; /** * @dev This library provides getters and event emitting update functions for * https://eips.ethereum.org/EIPS/eip-1967[ERC-1967] slots. */ library ERC1967Utils { /** * @dev Storage slot with the address of the current implementation. * This is the keccak-256 hash of "eip1967.proxy.implementation" subtracted by 1. */ // solhint-disable-next-line private-vars-leading-underscore bytes32 internal constant IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc; /** * @dev The `implementation` of the proxy is invalid. */ error ERC1967InvalidImplementation(address implementation); /** * @dev The `admin` of the proxy is invalid. */ error ERC1967InvalidAdmin(address admin); /** * @dev The `beacon` of the proxy is invalid. */ error ERC1967InvalidBeacon(address beacon); /** * @dev An upgrade function sees `msg.value > 0` that may be lost. */ error ERC1967NonPayable(); /** * @dev Returns the current implementation address. */ function getImplementation() internal view returns (address) { return StorageSlot.getAddressSlot(IMPLEMENTATION_SLOT).value; } /** * @dev Stores a new address in the ERC-1967 implementation slot. */ function _setImplementation(address newImplementation) private { if (newImplementation.code.length == 0) { revert ERC1967InvalidImplementation(newImplementation); } StorageSlot.getAddressSlot(IMPLEMENTATION_SLOT).value = newImplementation; } /** * @dev Performs implementation upgrade with additional setup call if data is nonempty. * This function is payable only if the setup call is performed, otherwise `msg.value` is rejected * to avoid stuck value in the contract. * * Emits an {IERC1967-Upgraded} event. */ function upgradeToAndCall(address newImplementation, bytes memory data) internal { _setImplementation(newImplementation); emit IERC1967.Upgraded(newImplementation); if (data.length > 0) { Address.functionDelegateCall(newImplementation, data); } else { _checkNonPayable(); } } /** * @dev Storage slot with the admin of the contract. * This is the keccak-256 hash of "eip1967.proxy.admin" subtracted by 1. */ // solhint-disable-next-line private-vars-leading-underscore bytes32 internal constant ADMIN_SLOT = 0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103; /** * @dev Returns the current admin. * * TIP: To get this value clients can read directly from the storage slot shown below (specified by ERC-1967) using * the https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call. * `0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103` */ function getAdmin() internal view returns (address) { return StorageSlot.getAddressSlot(ADMIN_SLOT).value; } /** * @dev Stores a new address in the ERC-1967 admin slot. */ function _setAdmin(address newAdmin) private { if (newAdmin == address(0)) { revert ERC1967InvalidAdmin(address(0)); } StorageSlot.getAddressSlot(ADMIN_SLOT).value = newAdmin; } /** * @dev Changes the admin of the proxy. * * Emits an {IERC1967-AdminChanged} event. */ function changeAdmin(address newAdmin) internal { emit IERC1967.AdminChanged(getAdmin(), newAdmin); _setAdmin(newAdmin); } /** * @dev The storage slot of the UpgradeableBeacon contract which defines the implementation for this proxy. * This is the keccak-256 hash of "eip1967.proxy.beacon" subtracted by 1. */ // solhint-disable-next-line private-vars-leading-underscore bytes32 internal constant BEACON_SLOT = 0xa3f0ad74e5423aebfd80d3ef4346578335a9a72aeaee59ff6cb3582b35133d50; /** * @dev Returns the current beacon. */ function getBeacon() internal view returns (address) { return StorageSlot.getAddressSlot(BEACON_SLOT).value; } /** * @dev Stores a new beacon in the ERC-1967 beacon slot. */ function _setBeacon(address newBeacon) private { if (newBeacon.code.length == 0) { revert ERC1967InvalidBeacon(newBeacon); } StorageSlot.getAddressSlot(BEACON_SLOT).value = newBeacon; address beaconImplementation = IBeacon(newBeacon).implementation(); if (beaconImplementation.code.length == 0) { revert ERC1967InvalidImplementation(beaconImplementation); } } /** * @dev Change the beacon and trigger a setup call if data is nonempty. * This function is payable only if the setup call is performed, otherwise `msg.value` is rejected * to avoid stuck value in the contract. * * Emits an {IERC1967-BeaconUpgraded} event. * * CAUTION: Invoking this function has no effect on an instance of {BeaconProxy} since v5, since * it uses an immutable beacon without looking at the value of the ERC-1967 beacon slot for * efficiency. */ function upgradeBeaconToAndCall(address newBeacon, bytes memory data) internal { _setBeacon(newBeacon); emit IERC1967.BeaconUpgraded(newBeacon); if (data.length > 0) { Address.functionDelegateCall(IBeacon(newBeacon).implementation(), data); } else { _checkNonPayable(); } } /** * @dev Reverts if `msg.value` is not zero. It can be used to avoid `msg.value` stuck in the contract * if an upgrade doesn't perform an initialization call. */ function _checkNonPayable() private { if (msg.value > 0) { revert ERC1967NonPayable(); } } }
lib/openzeppelin-contracts/contracts/proxy/beacon/IBeacon.sol
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.4.0) (proxy/beacon/IBeacon.sol) pragma solidity >=0.4.16; /** * @dev This is the interface that {BeaconProxy} expects of its beacon. */ interface IBeacon { /** * @dev Must return an address that can be used as a delegate call target. * * {UpgradeableBeacon} will check that this address is a contract. */ function implementation() external view returns (address); }
lib/openzeppelin-contracts/contracts/utils/StorageSlot.sol
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.1.0) (utils/StorageSlot.sol) // This file was procedurally generated from scripts/generate/templates/StorageSlot.js. pragma solidity ^0.8.20; /** * @dev Library for reading and writing primitive types to specific storage slots. * * Storage slots are often used to avoid storage conflict when dealing with upgradeable contracts. * This library helps with reading and writing to such slots without the need for inline assembly. * * The functions in this library return Slot structs that contain a `value` member that can be used to read or write. * * Example usage to set ERC-1967 implementation slot: * ```solidity * contract ERC1967 { * // Define the slot. Alternatively, use the SlotDerivation library to derive the slot. * bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc; * * function _getImplementation() internal view returns (address) { * return StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value; * } * * function _setImplementation(address newImplementation) internal { * require(newImplementation.code.length > 0); * StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation; * } * } * ``` * * TIP: Consider using this library along with {SlotDerivation}. */ library StorageSlot { struct AddressSlot { address value; } struct BooleanSlot { bool value; } struct Bytes32Slot { bytes32 value; } struct Uint256Slot { uint256 value; } struct Int256Slot { int256 value; } struct StringSlot { string value; } struct BytesSlot { bytes value; } /** * @dev Returns an `AddressSlot` with member `value` located at `slot`. */ function getAddressSlot(bytes32 slot) internal pure returns (AddressSlot storage r) { assembly ("memory-safe") { r.slot := slot } } /** * @dev Returns a `BooleanSlot` with member `value` located at `slot`. */ function getBooleanSlot(bytes32 slot) internal pure returns (BooleanSlot storage r) { assembly ("memory-safe") { r.slot := slot } } /** * @dev Returns a `Bytes32Slot` with member `value` located at `slot`. */ function getBytes32Slot(bytes32 slot) internal pure returns (Bytes32Slot storage r) { assembly ("memory-safe") { r.slot := slot } } /** * @dev Returns a `Uint256Slot` with member `value` located at `slot`. */ function getUint256Slot(bytes32 slot) internal pure returns (Uint256Slot storage r) { assembly ("memory-safe") { r.slot := slot } } /** * @dev Returns a `Int256Slot` with member `value` located at `slot`. */ function getInt256Slot(bytes32 slot) internal pure returns (Int256Slot storage r) { assembly ("memory-safe") { r.slot := slot } } /** * @dev Returns a `StringSlot` with member `value` located at `slot`. */ function getStringSlot(bytes32 slot) internal pure returns (StringSlot storage r) { assembly ("memory-safe") { r.slot := slot } } /** * @dev Returns an `StringSlot` representation of the string storage pointer `store`. */ function getStringSlot(string storage store) internal pure returns (StringSlot storage r) { assembly ("memory-safe") { r.slot := store.slot } } /** * @dev Returns a `BytesSlot` with member `value` located at `slot`. */ function getBytesSlot(bytes32 slot) internal pure returns (BytesSlot storage r) { assembly ("memory-safe") { r.slot := slot } } /** * @dev Returns an `BytesSlot` representation of the bytes storage pointer `store`. */ function getBytesSlot(bytes storage store) internal pure returns (BytesSlot storage r) { assembly ("memory-safe") { r.slot := store.slot } } }
src/interfaces/BrawlBank/IBrawlBank.sol
// SPDX-License-Identifier: MIT pragma solidity ^0.8.24; /// @notice Function-only interface for BrawlBank. /// @dev Events and custom errors are split into their own interfaces for modular imports. interface IBrawlBank { // ---- ERC20-like views ---- function name() external view returns (string memory); function symbol() external view returns (string memory); function decimals() external pure returns (uint8); function totalSupply() external view returns (uint256); function totalBurned() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function allowance(address owner, address spender) external view returns (uint256); // ---- ERC20-like approvals ---- function approve(address spender, uint256 amount) external returns (bool); function increaseAllowance(address spender, uint256 addedValue) external returns (bool); function decreaseAllowance(address spender, uint256 subtractedValue) external returns (bool); // ---- Bank core external ---- function mint(address to, uint256 amount, string calldata reason) external; function burn(address from, uint256 amount, string calldata reason) external; function transferFrom(address from, address to, uint256 amount) external; // Contract-to-contract and product flows function internalTransfer(address from, address to, uint256 amount) external; function p2pTransfer(address to, uint256 amount) external; // ---- Admin ops ---- function adminMint(address to, uint256 amount, string calldata reason) external; function batchAdminMint(address[] calldata recipients, uint256[] calldata amounts, string calldata reason) external; function adminBurn(address from, uint256 amount, string calldata reason) external; function adminTransfer(address from, address to, uint256 amount, string calldata reason) external; // ---- Auth / policy ---- function setAuthorizedContract(address account, bool status) external; function setContractDailyMintLimit(address account, uint256 limit) external; function setAdminDailyMintLimit(uint256 limit) external; function freezeAccount(address account, string calldata reason) external; function unfreezeAccount(address account) external; function pause() external; function unpause() external; // ---- Fee/policy setters ---- function setFeeCollector(address collector) external; function setP2PParams(uint256 feeBps, uint256 burnBps, uint256 cooldown) external; // ---- Views policy ---- function isAuthorized(address account) external view returns (bool); function frozenAccounts(address account) external view returns (bool); function feeCollector() external view returns (address); function p2pFeePercent() external view returns (uint256); // in basis points function p2pBurnPercent() external view returns (uint256); // in basis points function p2pCooldown() external view returns (uint256); // seconds function lastP2PTransfer(address account) external view returns (uint256); function contractDailyMintLimit(address account) external view returns (uint256); function contractDailyMintUsed(address account) external view returns (uint256); function adminDailyMintLimit() external view returns (uint256); function adminDailyMintUsed() external view returns (uint256); }
src/interfaces/BrawlBank/IBrawlBankErrors.sol
// SPDX-License-Identifier: MIT pragma solidity ^0.8.24; interface IBrawlBankErrors { error NotAuthorized(); error OnlyOwner(); error ZeroAddress(); error AccountIsFrozen(address account); error InsufficientBalance(); error InsufficientAllowance(); error TotalFeesTooHigh(); error CooldownTooLong(); error CooldownActive(uint256 remainingSeconds); error NetAmountZero(); error LengthMismatch(); error BankPaused(); }
src/interfaces/BrawlBank/IBrawlBankEvents.sol
// SPDX-License-Identifier: MIT pragma solidity ^0.8.24; interface IBrawlBankEvents { // ERC20-ish event Transfer(address indexed from, address indexed to, uint256 amount); event Approval(address indexed owner, address indexed spender, uint256 amount); // Core mint/burn event Minted(address indexed to, uint256 amount, string reason); event Burned(address indexed from, uint256 amount, string reason); // Admin ops event AdminMint(address indexed to, uint256 amount, string reason); event BatchAdminMint(uint256 recipients, uint256 totalAmount, string reason); event AdminBurn(address indexed from, uint256 amount, string reason); event AdminTransfer(address indexed from, address indexed to, uint256 amount, string reason); // P2P event P2PTransfer( address indexed from, address indexed to, uint256 amount, uint256 fee, uint256 burned, uint256 netAmount ); // Policy / config event AuthorizedContractUpdated(address indexed account, bool status); event ContractDailyMintLimitSet(address indexed account, uint256 limit); event AdminDailyMintLimitSet(uint256 limit); event MintLimitWarning(address indexed account, uint256 used, uint256 limit, uint256 percentUsed); event AccountFrozen(address indexed account, string reason); event AccountUnfrozen(address indexed account); event FeeCollectorUpdated(address indexed oldCollector, address indexed newCollector); event P2PParamsUpdated(uint256 feeBps, uint256 burnBps, uint256 cooldownSec); }
Compiler Settings
{"viaIR":false,"remappings":["@openzeppelin/contracts-upgradeable/=lib/openzeppelin-contracts-upgradeable/contracts/","@openzeppelin/contracts/=lib/openzeppelin-contracts/contracts/","erc4626-tests/=lib/openzeppelin-contracts-upgradeable/lib/erc4626-tests/","forge-std/=lib/forge-std/src/","halmos-cheatcodes/=lib/openzeppelin-contracts-upgradeable/lib/halmos-cheatcodes/src/","openzeppelin-contracts-upgradeable/=lib/openzeppelin-contracts-upgradeable/","openzeppelin-contracts/=lib/openzeppelin-contracts/","pancake-swap-core/=lib/pancake-swap-core/contracts/","pancake-swap-periphery/=lib/pancake-swap-periphery/contracts/"],"outputSelection":{"*":{"*":["*"],"":["*"]}},"optimizer":{"runs":200,"enabled":true},"metadata":{"useLiteralContent":false,"bytecodeHash":"ipfs","appendCBOR":true},"libraries":{},"evmVersion":"cancun"}
Contract ABI
[{"type":"constructor","stateMutability":"nonpayable","inputs":[]},{"type":"error","name":"AccountIsFrozen","inputs":[{"type":"address","name":"account","internalType":"address"}]},{"type":"error","name":"AddressEmptyCode","inputs":[{"type":"address","name":"target","internalType":"address"}]},{"type":"error","name":"BankPaused","inputs":[]},{"type":"error","name":"CooldownActive","inputs":[{"type":"uint256","name":"remainingSeconds","internalType":"uint256"}]},{"type":"error","name":"CooldownTooLong","inputs":[]},{"type":"error","name":"ERC1967InvalidImplementation","inputs":[{"type":"address","name":"implementation","internalType":"address"}]},{"type":"error","name":"ERC1967NonPayable","inputs":[]},{"type":"error","name":"EnforcedPause","inputs":[]},{"type":"error","name":"ExpectedPause","inputs":[]},{"type":"error","name":"FailedCall","inputs":[]},{"type":"error","name":"InsufficientAllowance","inputs":[]},{"type":"error","name":"InsufficientBalance","inputs":[]},{"type":"error","name":"InvalidInitialization","inputs":[]},{"type":"error","name":"LengthMismatch","inputs":[]},{"type":"error","name":"NetAmountZero","inputs":[]},{"type":"error","name":"NotAuthorized","inputs":[]},{"type":"error","name":"NotInitializing","inputs":[]},{"type":"error","name":"OnlyOwner","inputs":[]},{"type":"error","name":"OwnableInvalidOwner","inputs":[{"type":"address","name":"owner","internalType":"address"}]},{"type":"error","name":"OwnableUnauthorizedAccount","inputs":[{"type":"address","name":"account","internalType":"address"}]},{"type":"error","name":"ReentrancyGuardReentrantCall","inputs":[]},{"type":"error","name":"TotalFeesTooHigh","inputs":[]},{"type":"error","name":"UUPSUnauthorizedCallContext","inputs":[]},{"type":"error","name":"UUPSUnsupportedProxiableUUID","inputs":[{"type":"bytes32","name":"slot","internalType":"bytes32"}]},{"type":"error","name":"ZeroAddress","inputs":[]},{"type":"event","name":"AccountFrozen","inputs":[{"type":"address","name":"account","internalType":"address","indexed":true},{"type":"string","name":"reason","internalType":"string","indexed":false}],"anonymous":false},{"type":"event","name":"AccountUnfrozen","inputs":[{"type":"address","name":"account","internalType":"address","indexed":true}],"anonymous":false},{"type":"event","name":"AdminBurn","inputs":[{"type":"address","name":"from","internalType":"address","indexed":true},{"type":"uint256","name":"amount","internalType":"uint256","indexed":false},{"type":"string","name":"reason","internalType":"string","indexed":false}],"anonymous":false},{"type":"event","name":"AdminDailyMintLimitSet","inputs":[{"type":"uint256","name":"limit","internalType":"uint256","indexed":false}],"anonymous":false},{"type":"event","name":"AdminMint","inputs":[{"type":"address","name":"to","internalType":"address","indexed":true},{"type":"uint256","name":"amount","internalType":"uint256","indexed":false},{"type":"string","name":"reason","internalType":"string","indexed":false}],"anonymous":false},{"type":"event","name":"AdminTransfer","inputs":[{"type":"address","name":"from","internalType":"address","indexed":true},{"type":"address","name":"to","internalType":"address","indexed":true},{"type":"uint256","name":"amount","internalType":"uint256","indexed":false},{"type":"string","name":"reason","internalType":"string","indexed":false}],"anonymous":false},{"type":"event","name":"Approval","inputs":[{"type":"address","name":"owner","internalType":"address","indexed":true},{"type":"address","name":"spender","internalType":"address","indexed":true},{"type":"uint256","name":"amount","internalType":"uint256","indexed":false}],"anonymous":false},{"type":"event","name":"AuthorizedContractUpdated","inputs":[{"type":"address","name":"account","internalType":"address","indexed":true},{"type":"bool","name":"status","internalType":"bool","indexed":false}],"anonymous":false},{"type":"event","name":"BatchAdminMint","inputs":[{"type":"uint256","name":"recipients","internalType":"uint256","indexed":false},{"type":"uint256","name":"totalAmount","internalType":"uint256","indexed":false},{"type":"string","name":"reason","internalType":"string","indexed":false}],"anonymous":false},{"type":"event","name":"Burned","inputs":[{"type":"address","name":"from","internalType":"address","indexed":true},{"type":"uint256","name":"amount","internalType":"uint256","indexed":false},{"type":"string","name":"reason","internalType":"string","indexed":false}],"anonymous":false},{"type":"event","name":"ContractDailyMintLimitSet","inputs":[{"type":"address","name":"account","internalType":"address","indexed":true},{"type":"uint256","name":"limit","internalType":"uint256","indexed":false}],"anonymous":false},{"type":"event","name":"FeeCollectorUpdated","inputs":[{"type":"address","name":"oldCollector","internalType":"address","indexed":true},{"type":"address","name":"newCollector","internalType":"address","indexed":true}],"anonymous":false},{"type":"event","name":"Initialized","inputs":[{"type":"uint64","name":"version","internalType":"uint64","indexed":false}],"anonymous":false},{"type":"event","name":"MintLimitWarning","inputs":[{"type":"address","name":"account","internalType":"address","indexed":true},{"type":"uint256","name":"used","internalType":"uint256","indexed":false},{"type":"uint256","name":"limit","internalType":"uint256","indexed":false},{"type":"uint256","name":"percentUsed","internalType":"uint256","indexed":false}],"anonymous":false},{"type":"event","name":"Minted","inputs":[{"type":"address","name":"to","internalType":"address","indexed":true},{"type":"uint256","name":"amount","internalType":"uint256","indexed":false},{"type":"string","name":"reason","internalType":"string","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":"P2PParamsUpdated","inputs":[{"type":"uint256","name":"feeBps","internalType":"uint256","indexed":false},{"type":"uint256","name":"burnBps","internalType":"uint256","indexed":false},{"type":"uint256","name":"cooldownSec","internalType":"uint256","indexed":false}],"anonymous":false},{"type":"event","name":"P2PTransfer","inputs":[{"type":"address","name":"from","internalType":"address","indexed":true},{"type":"address","name":"to","internalType":"address","indexed":true},{"type":"uint256","name":"amount","internalType":"uint256","indexed":false},{"type":"uint256","name":"fee","internalType":"uint256","indexed":false},{"type":"uint256","name":"burned","internalType":"uint256","indexed":false},{"type":"uint256","name":"netAmount","internalType":"uint256","indexed":false}],"anonymous":false},{"type":"event","name":"Paused","inputs":[{"type":"address","name":"account","internalType":"address","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":"amount","internalType":"uint256","indexed":false}],"anonymous":false},{"type":"event","name":"Unpaused","inputs":[{"type":"address","name":"account","internalType":"address","indexed":false}],"anonymous":false},{"type":"event","name":"Upgraded","inputs":[{"type":"address","name":"implementation","internalType":"address","indexed":true}],"anonymous":false},{"type":"function","stateMutability":"view","outputs":[{"type":"string","name":"","internalType":"string"}],"name":"UPGRADE_INTERFACE_VERSION","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"adminBurn","inputs":[{"type":"address","name":"from","internalType":"address"},{"type":"uint256","name":"amount","internalType":"uint256"},{"type":"string","name":"reason","internalType":"string"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"adminDailyMintLimit","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"adminDailyMintUsed","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"adminMint","inputs":[{"type":"address","name":"to","internalType":"address"},{"type":"uint256","name":"amount","internalType":"uint256"},{"type":"string","name":"reason","internalType":"string"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"adminTransfer","inputs":[{"type":"address","name":"from","internalType":"address"},{"type":"address","name":"to","internalType":"address"},{"type":"uint256","name":"amount","internalType":"uint256"},{"type":"string","name":"reason","internalType":"string"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"allowance","inputs":[{"type":"address","name":"o","internalType":"address"},{"type":"address","name":"s","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":"a","internalType":"address"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"batchAdminMint","inputs":[{"type":"address[]","name":"recipients","internalType":"address[]"},{"type":"uint256[]","name":"amounts","internalType":"uint256[]"},{"type":"string","name":"reason","internalType":"string"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"burn","inputs":[{"type":"address","name":"from","internalType":"address"},{"type":"uint256","name":"amount","internalType":"uint256"},{"type":"string","name":"reason","internalType":"string"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"contractDailyMintLimit","inputs":[{"type":"address","name":"","internalType":"address"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"contractDailyMintUsed","inputs":[{"type":"address","name":"","internalType":"address"}]},{"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":"address","name":"","internalType":"address"}],"name":"feeCollector","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"freezeAccount","inputs":[{"type":"address","name":"account","internalType":"address"},{"type":"string","name":"reason","internalType":"string"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"bool","name":"","internalType":"bool"}],"name":"frozen","inputs":[{"type":"address","name":"","internalType":"address"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"bool","name":"","internalType":"bool"}],"name":"frozenAccounts","inputs":[{"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":"nonpayable","outputs":[],"name":"initialize","inputs":[{"type":"address","name":"_feeCollector","internalType":"address"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"internalTransfer","inputs":[{"type":"address","name":"from","internalType":"address"},{"type":"address","name":"to","internalType":"address"},{"type":"uint256","name":"amount","internalType":"uint256"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"bool","name":"","internalType":"bool"}],"name":"isAuthorized","inputs":[{"type":"address","name":"","internalType":"address"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"lastP2PTransfer","inputs":[{"type":"address","name":"","internalType":"address"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"mint","inputs":[{"type":"address","name":"to","internalType":"address"},{"type":"uint256","name":"amount","internalType":"uint256"},{"type":"string","name":"reason","internalType":"string"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"string","name":"","internalType":"string"}],"name":"name","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"address"}],"name":"owner","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"p2pBurnPercent","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"p2pCooldown","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"p2pFeePercent","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"p2pTransfer","inputs":[{"type":"address","name":"to","internalType":"address"},{"type":"uint256","name":"amount","internalType":"uint256"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"pause","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"bool","name":"","internalType":"bool"}],"name":"paused","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"bytes32","name":"","internalType":"bytes32"}],"name":"proxiableUUID","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"renounceOwnership","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"setAdminDailyMintLimit","inputs":[{"type":"uint256","name":"limit","internalType":"uint256"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"setAuthorizedContract","inputs":[{"type":"address","name":"account","internalType":"address"},{"type":"bool","name":"status","internalType":"bool"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"setContractDailyMintLimit","inputs":[{"type":"address","name":"account","internalType":"address"},{"type":"uint256","name":"limit","internalType":"uint256"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"setFeeCollector","inputs":[{"type":"address","name":"collector","internalType":"address"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"setP2PParams","inputs":[{"type":"uint256","name":"feeBps","internalType":"uint256"},{"type":"uint256","name":"burnBps","internalType":"uint256"},{"type":"uint256","name":"cooldown","internalType":"uint256"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"string","name":"","internalType":"string"}],"name":"symbol","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"totalBurned","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"totalSupply","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[],"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":"function","stateMutability":"nonpayable","outputs":[],"name":"unfreezeAccount","inputs":[{"type":"address","name":"account","internalType":"address"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"unpause","inputs":[]},{"type":"function","stateMutability":"payable","outputs":[],"name":"upgradeToAndCall","inputs":[{"type":"address","name":"newImplementation","internalType":"address"},{"type":"bytes","name":"data","internalType":"bytes"}]}]
Contract Creation Code
0x60a06040523060805234801562000014575f80fd5b506200001f62000025565b620000d9565b7ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a00805468010000000000000000900460ff1615620000765760405163f92ee8a960e01b815260040160405180910390fd5b80546001600160401b0390811614620000d65780546001600160401b0319166001600160401b0390811782556040519081527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d29060200160405180910390a15b50565b608051613263620001005f395f81816123630152818161238c01526124cb01526132635ff3fe60806040526004361061028b575f3560e01c8063860838a511610155578063d0516650116100be578063ed6d33d611610078578063ed6d33d6146107df578063f2fa7392146107f4578063f2fde38b14610813578063f8cd5ff114610832578063fe9fbb8014610851578063ffbe3a721461087f575f80fd5b8063d051665014610706578063d1edc0c514610734578063d3fc986414610749578063d89135cd14610768578063d9cb86061461077c578063dd62ed3e1461079b575f80fd5b8063ad3cb1cc1161010f578063ad3cb1cc14610639578063c415b95c14610669578063c4d66de814610688578063c8957bd7146106a7578063c91435e2146106d2578063cc4352f4146106f1575f80fd5b8063860838a5146105655780638da5cb5b1461059c57806392656378146105c857806395d89b41146105e7578063a42dce80146105fb578063a457c2d71461061a575f80fd5b806342b733e6116101f75780635c975abb116101b15780635c975abb146104ab578063691d7c9c146104bf57806370a08231146104ea578063715018a61461051e578063788649ea146105325780638456cb5914610551575f80fd5b806342b733e6146103fc5780634c872a9f1461041b5780634d36cd15146104465780634f1ef2861461046557806352d1902d1461047857806359e026f71461048c575f80fd5b806320ee02551161024857806320ee02551461035157806323b872dd14610370578063313ce5671461038f57806339509351146103aa5780633f4ba83a146103c957806342358401146103dd575f80fd5b806304ab2e771461028f57806306fdde03146102b7578063095ea7b3146102d85780631385a17b1461030757806315f570dc1461031c57806318160ddd1461033d575b5f80fd5b34801561029a575f80fd5b506102a460085481565b6040519081526020015b60405180910390f35b3480156102c2575f80fd5b506102cb61089e565b6040516102ae9190612af1565b3480156102e3575f80fd5b506102f76102f2366004612b3e565b61092d565b60405190151581526020016102ae565b348015610312575f80fd5b506102a460105481565b348015610327575f80fd5b5061033b610336366004612bab565b6109df565b005b348015610348575f80fd5b506004546102a4565b34801561035c575f80fd5b5061033b61036b366004612bab565b610bb4565b34801561037b575f80fd5b5061033b61038a366004612c01565b610cfa565b34801561039a575f80fd5b50604051601281526020016102ae565b3480156103b5575f80fd5b506102f76103c4366004612b3e565b610eea565b3480156103d4575f80fd5b5061033b610fcd565b3480156103e8575f80fd5b5061033b6103f7366004612c3a565b610fdf565b348015610407575f80fd5b5061033b610416366004612b3e565b61108a565b348015610426575f80fd5b506102a4610435366004612c63565b600d6020525f908152604090205481565b348015610451575f80fd5b5061033b610460366004612b3e565b611111565b61033b610473366004612c90565b61145e565b348015610483575f80fd5b506102a4611479565b348015610497575f80fd5b5061033b6104a6366004612c01565b611494565b3480156104b6575f80fd5b506102f76115a0565b3480156104ca575f80fd5b506102a46104d9366004612c63565b600e6020525f908152604090205481565b3480156104f5575f80fd5b506102a4610504366004612c63565b6001600160a01b03165f9081526002602052604090205490565b348015610529575f80fd5b5061033b6115c8565b34801561053d575f80fd5b5061033b61054c366004612c63565b6115d9565b34801561055c575f80fd5b5061033b611650565b348015610570575f80fd5b506102f761057f366004612c63565b6001600160a01b03165f9081526006602052604090205460ff1690565b3480156105a7575f80fd5b506105b0611660565b6040516001600160a01b0390911681526020016102ae565b3480156105d3575f80fd5b5061033b6105e2366004612d8d565b61168e565b3480156105f2575f80fd5b506102cb6118f3565b348015610606575f80fd5b5061033b610615366004612c63565b611902565b348015610625575f80fd5b506102f7610634366004612b3e565b611982565b348015610644575f80fd5b506102cb604051806040016040528060058152602001640352e302e360dc1b81525081565b348015610674575f80fd5b506007546105b0906001600160a01b031681565b348015610693575f80fd5b5061033b6106a2366004612c63565b611a7d565b3480156106b2575f80fd5b506102a46106c1366004612c63565b600b6020525f908152604090205481565b3480156106dd575f80fd5b5061033b6106ec366004612bab565b611c7f565b3480156106fc575f80fd5b506102a4600a5481565b348015610711575f80fd5b506102f7610720366004612c63565b60066020525f908152604090205460ff1681565b34801561073f575f80fd5b506102a460095481565b348015610754575f80fd5b5061033b610763366004612bab565b611db1565b348015610773575f80fd5b506005546102a4565b348015610787575f80fd5b5061033b610796366004612e20565b611f5e565b3480156107a6575f80fd5b506102a46107b5366004612e6f565b6001600160a01b039182165f90815260036020908152604080832093909416825291909152205490565b3480156107ea575f80fd5b506102a460115481565b3480156107ff575f80fd5b5061033b61080e366004612ea0565b611fee565b34801561081e575f80fd5b5061033b61082d366004612c63565b612074565b34801561083d575f80fd5b5061033b61084c366004612ed9565b6120b1565b34801561085c575f80fd5b506102f761086b366004612c63565b600c6020525f908152604090205460ff1681565b34801561088a575f80fd5b5061033b610899366004612f43565b61215e565b60605f80546108ac90612f5a565b80601f01602080910402602001604051908101604052809291908181526020018280546108d890612f5a565b80156109235780601f106108fa57610100808354040283529160200191610923565b820191905f5260205f20905b81548152906001019060200180831161090657829003601f168201915b5050505050905090565b5f6109366115a0565b1561095457604051631350757d60e11b815260040160405180910390fd5b6001600160a01b03831661097b5760405163d92e233d60e01b815260040160405180910390fd5b335f8181526003602090815260408083206001600160a01b03881680855290835292819020869055518581529192917f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a35060015b92915050565b6109e76115a0565b15610a0557604051631350757d60e11b815260040160405180910390fd5b610a0d6121a2565b6001600160a01b0384165f90815260066020526040902054849060ff1615610a585760405163cf8eb59760e01b81526001600160a01b03821660048201526024015b60405180910390fd5b336001600160a01b03861614801590610a805750335f908152600c602052604090205460ff16155b15610a9e5760405163ea8e4eb560e01b815260040160405180910390fd5b6001600160a01b0385165f9081526002602052604090205484811015610ad757604051631e9acf1760e31b815260040160405180910390fd5b6001600160a01b0386165f908152600260205260408120868303905560048054879290610b05908490612fa6565b925050819055508460055f828254610b1d9190612fb9565b92505081905550856001600160a01b03167f0bd10d08cdd688ae27d8149d34aea2ddb78c6e0116355640cf1af79a2c9ab394868686604051610b6193929190612ff4565b60405180910390a26040518581525f906001600160a01b038816905f805160206131ee8339815191529060200160405180910390a35050610bae60015f8051602061320e83398151915255565b50505050565b610bbc6115a0565b15610bda57604051631350757d60e11b815260040160405180910390fd5b610be26121ec565b610bea6121a2565b6001600160a01b0384165f9081526002602052604090205483811015610c2357604051631e9acf1760e31b815260040160405180910390fd5b6001600160a01b0385165f908152600260205260408120858303905560048054869290610c51908490612fa6565b925050819055508360055f828254610c699190612fb9565b92505081905550846001600160a01b03167fad73e7d12b30d639a7527e87040fc8f21a5cf6efd3dd34db76ee6f42fd0ac6a8858585604051610cad93929190612ff4565b60405180910390a26040518481525f906001600160a01b038716905f805160206131ee833981519152906020015b60405180910390a350610bae60015f8051602061320e83398151915255565b335f908152600c602052604090205460ff16610d295760405163ea8e4eb560e01b815260040160405180910390fd5b610d316115a0565b15610d4f57604051631350757d60e11b815260040160405180910390fd5b610d576121a2565b6001600160a01b0383165f90815260066020526040902054839060ff1615610d9d5760405163cf8eb59760e01b81526001600160a01b0382166004820152602401610a4f565b6001600160a01b0383165f90815260066020526040902054839060ff1615610de35760405163cf8eb59760e01b81526001600160a01b0382166004820152602401610a4f565b6001600160a01b0384161580610e0057506001600160a01b038516155b15610e1e5760405163d92e233d60e01b815260040160405180910390fd5b6001600160a01b0385165f90815260036020908152604080832033845290915290205483811015610e62576040516313be252b60e01b815260040160405180910390fd5b6001600160a01b0386165f90815260026020526040902054841115610e9a57604051631e9acf1760e31b815260040160405180910390fd5b6001600160a01b0386165f90815260036020908152604080832033845290915290208482039055610ecc86868661221e565b505050610ee560015f8051602061320e83398151915255565b505050565b5f610ef36115a0565b15610f1157604051631350757d60e11b815260040160405180910390fd5b6001600160a01b038316610f385760405163d92e233d60e01b815260040160405180910390fd5b335f9081526003602090815260408083206001600160a01b038716845290915281205490610f668483612fb9565b335f8181526003602090815260408083206001600160a01b038b16808552908352928190208590555184815293945090927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3506001949350505050565b610fd56121ec565b610fdd6122ec565b565b610fe76121ec565b6107d0610ff48385612fb9565b11156110125760405162a2e87d60e81b815260040160405180910390fd5b610e108111156110355760405163f31366db60e01b815260040160405180910390fd5b60088390556009829055600a81905560408051848152602081018490529081018290527fe95d5f390b896b81ce33d52543ff520538bb59749ef823ba075f55ac216766959060600160405180910390a1505050565b6110926121ec565b6001600160a01b0382166110b95760405163d92e233d60e01b815260040160405180910390fd5b6001600160a01b0382165f818152600d602052604090819020839055517f07a85c99c6fd4df0c73c99c597cba3be7ced1d0dc663443a37207e8fca246674906111059084815260200190565b60405180910390a25050565b6111196115a0565b1561113757604051631350757d60e11b815260040160405180910390fd5b61113f6121a2565b335f8181526006602052604090205460ff161561117a5760405163cf8eb59760e01b81526001600160a01b0382166004820152602401610a4f565b6001600160a01b0383165f90815260066020526040902054839060ff16156111c05760405163cf8eb59760e01b81526001600160a01b0382166004820152602401610a4f565b6001600160a01b0384166111e75760405163d92e233d60e01b815260040160405180910390fd5b335f908152600b6020526040902054801561123f575f6112078242612fa6565b9050600a5481101561123d5780600a546112219190612fa6565b60405163c1ab61a160e01b8152600401610a4f91815260200190565b505b335f908152600b6020526040812042905560085461271090611261908761300d565b61126b9190613024565b90505f6127106009548761127f919061300d565b6112899190613024565b90505f816112978489612fa6565b6112a19190612fa6565b9050805f036112c3576040516372d035c760e01b815260040160405180910390fd5b6112ce33898361221e565b82156112ec576007546112ec9033906001600160a01b03168561221e565b81156113e957335f908152600260205260409020548281101561132257604051631e9acf1760e31b815260040160405180910390fd5b335f908152600260205260408120848303905560048054859290611347908490612fa6565b925050819055508260055f82825461135f9190612fb9565b909155505060405133907f0bd10d08cdd688ae27d8149d34aea2ddb78c6e0116355640cf1af79a2c9ab394906113bb90868152604060208201819052600b908201526a3819382a3930b739b332b960a91b606082015260800190565b60405180910390a26040518381525f9033905f805160206131ee8339815191529060200160405180910390a3505b6040805188815260208101859052908101839052606081018290526001600160a01b0389169033907f9ab8a7f9d959d58ffb0db0a25058e3aaed86788cda0fd39c5b78975a94a3e87a9060800160405180910390a350505050505061145a60015f8051602061320e83398151915255565b5050565b611466612358565b61146f826123fc565b61145a8282612404565b5f6114826124c0565b505f805160206131ce83398151915290565b335f908152600c602052604090205460ff166114c35760405163ea8e4eb560e01b815260040160405180910390fd5b6114cb6115a0565b156114e957604051631350757d60e11b815260040160405180910390fd5b6114f16121a2565b6001600160a01b0383165f90815260066020526040902054839060ff16156115375760405163cf8eb59760e01b81526001600160a01b0382166004820152602401610a4f565b6001600160a01b0383165f90815260066020526040902054839060ff161561157d5760405163cf8eb59760e01b81526001600160a01b0382166004820152602401610a4f565b61158885858561221e565b5050610ee560015f8051602061320e83398151915255565b7fcd5ed15c6e187e77e9aee88184c21f4f2182ab5827cb3b7e07fbedcd63f033005460ff1690565b6115d06121ec565b610fdd5f612509565b6115e16121ec565b6001600160a01b0381166116085760405163d92e233d60e01b815260040160405180910390fd5b6001600160a01b0381165f81815260066020526040808220805460ff19169055517ff915cd9fe234de6e8d3afe7bf2388d35b2b6d48e8c629a24602019bde79c213a9190a250565b6116586121ec565b610fdd612579565b7f9016d09d72d40fdae2fd8ceac6b6234c7706214fd39c1cd1e609a0528c199300546001600160a01b031690565b6116966115a0565b156116b457604051631350757d60e11b815260040160405180910390fd5b6116bc6121ec565b6116c46121a2565b8483146116e7576040516001621398b960e31b0319815260040160405180910390fd5b845f805b8281101561177b575f89898381811061170657611706613043565b905060200201602081019061171b9190612c63565b90506001600160a01b0381166117445760405163d92e233d60e01b815260040160405180910390fd5b5f88888481811061175757611757613043565b905060200201359050808461176c9190612fb9565b935082600101925050506116eb565b50611785816125d4565b5f5b82811015611895575f8989838181106117a2576117a2613043565b90506020020160208101906117b79190612c63565b90505f8888848181106117cc576117cc613043565b9050602002013590508060045f8282546117e69190612fb9565b90915550506001600160a01b0382165f9081526002602052604081208054839290611812908490612fb9565b92505081905550816001600160a01b03167fa9c9babda5ff67ffbbc2a32ea801faa859a4ff810d358a4b0ca2559d745bd15282898960405161185693929190612ff4565b60405180910390a26040518181526001600160a01b038316905f905f805160206131ee8339815191529060200160405180910390a35050600101611787565b507fc37365484f73a79b97b94cfea39563bae82e465dc43e7a90b47ffbadad125036828286866040516118cb9493929190613057565b60405180910390a150506118eb60015f8051602061320e83398151915255565b505050505050565b6060600180546108ac90612f5a565b61190a6121ec565b6001600160a01b0381166119315760405163d92e233d60e01b815260040160405180910390fd5b600780546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f5d16ad41baeb009cd23eb8f6c7cde5c2e0cd5acf4a33926ab488875c37c37f38905f90a35050565b5f61198b6115a0565b156119a957604051631350757d60e11b815260040160405180910390fd5b6001600160a01b0383166119d05760405163d92e233d60e01b815260040160405180910390fd5b335f9081526003602090815260408083206001600160a01b038716845290915290205482811015611a14576040516313be252b60e01b815260040160405180910390fd5b335f8181526003602090815260408083206001600160a01b038916808552908352928190208786039081905590519081529192917f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a35060019392505050565b5f611a866126a5565b805490915060ff600160401b820416159067ffffffffffffffff165f81158015611aad5750825b90505f8267ffffffffffffffff166001148015611ac95750303b155b905081158015611ad7575080155b15611af55760405163f92ee8a960e01b815260040160405180910390fd5b845467ffffffffffffffff191660011785558315611b1f57845460ff60401b1916600160401b1785555b6001600160a01b038616611b465760405163d92e233d60e01b815260040160405180910390fd5b611b4f336126cd565b611b576126de565b611b5f6126de565b611b676126e6565b60408051808201909152600a815269084e4c2eed84086c2e6d60b31b60208201525f90611b9490826130c4565b50604080518082019091526009815268084a482ae988682a6960bb1b6020820152600190611bc290826130c4565b50600780546001600160a01b0319166001600160a01b03881617905561012c60088190556102bc60098190556107d091611bfc9190612fb9565b1115611c1a5760405162a2e87d60e81b815260040160405180910390fd5b610384600a5569d3c21bcecceda10000006010554260125583156118eb57845460ff60401b19168555604051600181527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d29060200160405180910390a1505050505050565b611c876115a0565b15611ca557604051631350757d60e11b815260040160405180910390fd5b611cad6121ec565b611cb56121a2565b6001600160a01b038416611cdc5760405163d92e233d60e01b815260040160405180910390fd5b611ce5836125d4565b8260045f828254611cf69190612fb9565b90915550506001600160a01b0384165f9081526002602052604081208054859290611d22908490612fb9565b92505081905550836001600160a01b03167fa9c9babda5ff67ffbbc2a32ea801faa859a4ff810d358a4b0ca2559d745bd152848484604051611d6693929190612ff4565b60405180910390a26040518381526001600160a01b038516905f905f805160206131ee8339815191529060200160405180910390a3610bae60015f8051602061320e83398151915255565b611db96115a0565b15611dd757604051631350757d60e11b815260040160405180910390fd5b611ddf6121a2565b6001600160a01b0384165f90815260066020526040902054849060ff1615611e255760405163cf8eb59760e01b81526001600160a01b0382166004820152602401610a4f565b6001600160a01b038516611e4c5760405163d92e233d60e01b815260040160405180910390fd5b335f908152600c602052604090205460ff1615611e7257611e6d33856126f6565b611eab565b611e7a611660565b6001600160a01b03163303611e9257611e6d846125d4565b60405163ea8e4eb560e01b815260040160405180910390fd5b8360045f828254611ebc9190612fb9565b90915550506001600160a01b0385165f9081526002602052604081208054869290611ee8908490612fb9565b92505081905550846001600160a01b03167fe7cd4ce7f2a465edc730269a1305e8a48bad821e8fb7e152ec413829c01a53c4858585604051611f2c93929190612ff4565b60405180910390a26040518481526001600160a01b038616905f905f805160206131ee83398151915290602001610cdb565b611f666121ec565b6001600160a01b038316611f8d5760405163d92e233d60e01b815260040160405180910390fd5b6001600160a01b0383165f8181526006602052604090819020805460ff19166001179055517fc71267b66b2c8820cf488bba23c122cee8408eb55e75428bab72cce8d259e6b990611fe19085908590613180565b60405180910390a2505050565b611ff66121ec565b6001600160a01b03821661201d5760405163d92e233d60e01b815260040160405180910390fd5b6001600160a01b0382165f818152600c6020908152604091829020805460ff191685151590811790915591519182527f8f689f580b739f90591fbd591709dd98941c0afe7a47c812b93e978c4702bceb9101611105565b61207c6121ec565b6001600160a01b0381166120a557604051631e4fbdf760e01b81525f6004820152602401610a4f565b6120ae81612509565b50565b6120b96115a0565b156120d757604051631350757d60e11b815260040160405180910390fd5b6120df6121ec565b6120e76121a2565b6120f285858561221e565b836001600160a01b0316856001600160a01b03167f22b8cdaa403be9e59aeeb2b120f6387ce17d5ce83a74d6f26c1a044834e1a8ee85858560405161213993929190612ff4565b60405180910390a361215760015f8051602061320e83398151915255565b5050505050565b6121666121ec565b60108190556040518181527fdb0dc86f180d834568959e050d725ac38c4568efde8b6c3454afb7b4091f1033906020015b60405180910390a150565b5f8051602061320e8339815191528054600119016121d357604051633ee5aeb560e01b815260040160405180910390fd5b60029055565b60015f8051602061320e83398151915255565b336121f5611660565b6001600160a01b031614610fdd5760405163118cdaa760e01b8152336004820152602401610a4f565b6001600160a01b038216158061223b57506001600160a01b038316155b156122595760405163d92e233d60e01b815260040160405180910390fd5b6001600160a01b0383165f908152600260205260409020548181101561229257604051631e9acf1760e31b815260040160405180910390fd5b6001600160a01b038085165f8181526002602052604080822086860390559286168082529083902080548601905591515f805160206131ee833981519152906122de9086815260200190565b60405180910390a350505050565b6122f4612844565b7fcd5ed15c6e187e77e9aee88184c21f4f2182ab5827cb3b7e07fbedcd63f03300805460ff191681557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa335b6040516001600160a01b039091168152602001612197565b306001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001614806123de57507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03166123d25f805160206131ce833981519152546001600160a01b031690565b6001600160a01b031614155b15610fdd5760405163703e46dd60e11b815260040160405180910390fd5b6120ae6121ec565b816001600160a01b03166352d1902d6040518163ffffffff1660e01b8152600401602060405180830381865afa92505050801561245e575060408051601f3d908101601f1916820190925261245b9181019061319b565b60015b61248657604051634c9c8ce360e01b81526001600160a01b0383166004820152602401610a4f565b5f805160206131ce83398151915281146124b657604051632a87526960e21b815260048101829052602401610a4f565b610ee58383612869565b306001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001614610fdd5760405163703e46dd60e11b815260040160405180910390fd5b7f9016d09d72d40fdae2fd8ceac6b6234c7706214fd39c1cd1e609a0528c19930080546001600160a01b031981166001600160a01b03848116918217845560405192169182907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0905f90a3505050565b6125816128be565b7fcd5ed15c6e187e77e9aee88184c21f4f2182ab5827cb3b7e07fbedcd63f03300805460ff191660011781557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a25833612340565b6125df6012546128e4565b156125ed575f601155426012555b5f816011546125fc9190612fb9565b601054909150801580159061261057508082115b1561262e57604051631e9acf1760e31b815260040160405180910390fd5b60118290558015610ee5575f816126478461271061300d565b6126519190613024565b9050611f408110610bae57604080518481526020810184905290810182905230907ff3fd91d389f57abcdccfe63274f3615a09524e46a9ba4ca3b9c1b077b35892ba9060600160405180910390a250505050565b5f807ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a006109d9565b6126d5612906565b6120ae8161292b565b610fdd612906565b6126ee612906565b610fdd612933565b6001600160a01b0382165f908152600f6020526040902054612717906128e4565b15612744576001600160a01b0382165f908152600e60209081526040808320839055600f90915290204290555b6001600160a01b0382165f908152600e6020526040812054612767908390612fb9565b6001600160a01b0384165f908152600d6020526040902054909150801580159061279057508082115b156127ae57604051631e9acf1760e31b815260040160405180910390fd5b6001600160a01b0384165f908152600e602052604090208290558015610bae575f816127dc8461271061300d565b6127e69190613024565b9050611f4081106121575760408051848152602081018490529081018290526001600160a01b038616907ff3fd91d389f57abcdccfe63274f3615a09524e46a9ba4ca3b9c1b077b35892ba9060600160405180910390a25050505050565b61284c6115a0565b610fdd57604051638dfc202b60e01b815260040160405180910390fd5b6128728261293b565b6040516001600160a01b038316907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b905f90a28051156128b657610ee5828261299e565b61145a612a10565b6128c66115a0565b15610fdd5760405163d93c066560e01b815260040160405180910390fd5b5f6128f26201518083613024565b6128ff6201518042613024565b1192915050565b61290e612a2f565b610fdd57604051631afcd79f60e31b815260040160405180910390fd5b61207c612906565b6121d9612906565b806001600160a01b03163b5f0361297057604051634c9c8ce360e01b81526001600160a01b0382166004820152602401610a4f565b5f805160206131ce83398151915280546001600160a01b0319166001600160a01b0392909216919091179055565b60605f80846001600160a01b0316846040516129ba91906131b2565b5f60405180830381855af49150503d805f81146129f2576040519150601f19603f3d011682016040523d82523d5f602084013e6129f7565b606091505b5091509150612a07858383612a48565b95945050505050565b3415610fdd5760405163b398979f60e01b815260040160405180910390fd5b5f612a386126a5565b54600160401b900460ff16919050565b606082612a5d57612a5882612aa7565b612aa0565b8151158015612a7457506001600160a01b0384163b155b15612a9d57604051639996b31560e01b81526001600160a01b0385166004820152602401610a4f565b50805b9392505050565b805115612ab657805160208201fd5b60405163d6bda27560e01b815260040160405180910390fd5b5f5b83811015612ae9578181015183820152602001612ad1565b50505f910152565b602081525f8251806020840152612b0f816040850160208701612acf565b601f01601f19169190910160400192915050565b80356001600160a01b0381168114612b39575f80fd5b919050565b5f8060408385031215612b4f575f80fd5b612b5883612b23565b946020939093013593505050565b5f8083601f840112612b76575f80fd5b50813567ffffffffffffffff811115612b8d575f80fd5b602083019150836020828501011115612ba4575f80fd5b9250929050565b5f805f8060608587031215612bbe575f80fd5b612bc785612b23565b935060208501359250604085013567ffffffffffffffff811115612be9575f80fd5b612bf587828801612b66565b95989497509550505050565b5f805f60608486031215612c13575f80fd5b612c1c84612b23565b9250612c2a60208501612b23565b9150604084013590509250925092565b5f805f60608486031215612c4c575f80fd5b505081359360208301359350604090920135919050565b5f60208284031215612c73575f80fd5b612aa082612b23565b634e487b7160e01b5f52604160045260245ffd5b5f8060408385031215612ca1575f80fd5b612caa83612b23565b9150602083013567ffffffffffffffff80821115612cc6575f80fd5b818501915085601f830112612cd9575f80fd5b813581811115612ceb57612ceb612c7c565b604051601f8201601f19908116603f01168101908382118183101715612d1357612d13612c7c565b81604052828152886020848701011115612d2b575f80fd5b826020860160208301375f6020848301015280955050505050509250929050565b5f8083601f840112612d5c575f80fd5b50813567ffffffffffffffff811115612d73575f80fd5b6020830191508360208260051b8501011115612ba4575f80fd5b5f805f805f8060608789031215612da2575f80fd5b863567ffffffffffffffff80821115612db9575f80fd5b612dc58a838b01612d4c565b90985096506020890135915080821115612ddd575f80fd5b612de98a838b01612d4c565b90965094506040890135915080821115612e01575f80fd5b50612e0e89828a01612b66565b979a9699509497509295939492505050565b5f805f60408486031215612e32575f80fd5b612e3b84612b23565b9250602084013567ffffffffffffffff811115612e56575f80fd5b612e6286828701612b66565b9497909650939450505050565b5f8060408385031215612e80575f80fd5b612e8983612b23565b9150612e9760208401612b23565b90509250929050565b5f8060408385031215612eb1575f80fd5b612eba83612b23565b915060208301358015158114612ece575f80fd5b809150509250929050565b5f805f805f60808688031215612eed575f80fd5b612ef686612b23565b9450612f0460208701612b23565b935060408601359250606086013567ffffffffffffffff811115612f26575f80fd5b612f3288828901612b66565b969995985093965092949392505050565b5f60208284031215612f53575f80fd5b5035919050565b600181811c90821680612f6e57607f821691505b602082108103612f8c57634e487b7160e01b5f52602260045260245ffd5b50919050565b634e487b7160e01b5f52601160045260245ffd5b818103818111156109d9576109d9612f92565b808201808211156109d9576109d9612f92565b81835281816020850137505f828201602090810191909152601f909101601f19169091010190565b838152604060208201525f612a07604083018486612fcc565b80820281158282048414176109d9576109d9612f92565b5f8261303e57634e487b7160e01b5f52601260045260245ffd5b500490565b634e487b7160e01b5f52603260045260245ffd5b848152836020820152606060408201525f613076606083018486612fcc565b9695505050505050565b601f821115610ee557805f5260205f20601f840160051c810160208510156130a55750805b601f840160051c820191505b81811015612157575f81556001016130b1565b815167ffffffffffffffff8111156130de576130de612c7c565b6130f2816130ec8454612f5a565b84613080565b602080601f831160018114613125575f841561310e5750858301515b5f19600386901b1c1916600185901b1785556118eb565b5f85815260208120601f198616915b8281101561315357888601518255948401946001909101908401613134565b508582101561317057878501515f19600388901b60f8161c191681555b5050505050600190811b01905550565b602081525f613193602083018486612fcc565b949350505050565b5f602082840312156131ab575f80fd5b5051919050565b5f82516131c3818460208701612acf565b919091019291505056fe360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbcddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9b779b17422d0df92223018b32b4d1fa46e071723d6817e2486d003becc55f00a2646970667358221220087f111d68cbc505843841bbb06b0e6dc992157b44c4d2ccf0e981c64bc0fe1964736f6c63430008180033
Deployed ByteCode
0x60806040526004361061028b575f3560e01c8063860838a511610155578063d0516650116100be578063ed6d33d611610078578063ed6d33d6146107df578063f2fa7392146107f4578063f2fde38b14610813578063f8cd5ff114610832578063fe9fbb8014610851578063ffbe3a721461087f575f80fd5b8063d051665014610706578063d1edc0c514610734578063d3fc986414610749578063d89135cd14610768578063d9cb86061461077c578063dd62ed3e1461079b575f80fd5b8063ad3cb1cc1161010f578063ad3cb1cc14610639578063c415b95c14610669578063c4d66de814610688578063c8957bd7146106a7578063c91435e2146106d2578063cc4352f4146106f1575f80fd5b8063860838a5146105655780638da5cb5b1461059c57806392656378146105c857806395d89b41146105e7578063a42dce80146105fb578063a457c2d71461061a575f80fd5b806342b733e6116101f75780635c975abb116101b15780635c975abb146104ab578063691d7c9c146104bf57806370a08231146104ea578063715018a61461051e578063788649ea146105325780638456cb5914610551575f80fd5b806342b733e6146103fc5780634c872a9f1461041b5780634d36cd15146104465780634f1ef2861461046557806352d1902d1461047857806359e026f71461048c575f80fd5b806320ee02551161024857806320ee02551461035157806323b872dd14610370578063313ce5671461038f57806339509351146103aa5780633f4ba83a146103c957806342358401146103dd575f80fd5b806304ab2e771461028f57806306fdde03146102b7578063095ea7b3146102d85780631385a17b1461030757806315f570dc1461031c57806318160ddd1461033d575b5f80fd5b34801561029a575f80fd5b506102a460085481565b6040519081526020015b60405180910390f35b3480156102c2575f80fd5b506102cb61089e565b6040516102ae9190612af1565b3480156102e3575f80fd5b506102f76102f2366004612b3e565b61092d565b60405190151581526020016102ae565b348015610312575f80fd5b506102a460105481565b348015610327575f80fd5b5061033b610336366004612bab565b6109df565b005b348015610348575f80fd5b506004546102a4565b34801561035c575f80fd5b5061033b61036b366004612bab565b610bb4565b34801561037b575f80fd5b5061033b61038a366004612c01565b610cfa565b34801561039a575f80fd5b50604051601281526020016102ae565b3480156103b5575f80fd5b506102f76103c4366004612b3e565b610eea565b3480156103d4575f80fd5b5061033b610fcd565b3480156103e8575f80fd5b5061033b6103f7366004612c3a565b610fdf565b348015610407575f80fd5b5061033b610416366004612b3e565b61108a565b348015610426575f80fd5b506102a4610435366004612c63565b600d6020525f908152604090205481565b348015610451575f80fd5b5061033b610460366004612b3e565b611111565b61033b610473366004612c90565b61145e565b348015610483575f80fd5b506102a4611479565b348015610497575f80fd5b5061033b6104a6366004612c01565b611494565b3480156104b6575f80fd5b506102f76115a0565b3480156104ca575f80fd5b506102a46104d9366004612c63565b600e6020525f908152604090205481565b3480156104f5575f80fd5b506102a4610504366004612c63565b6001600160a01b03165f9081526002602052604090205490565b348015610529575f80fd5b5061033b6115c8565b34801561053d575f80fd5b5061033b61054c366004612c63565b6115d9565b34801561055c575f80fd5b5061033b611650565b348015610570575f80fd5b506102f761057f366004612c63565b6001600160a01b03165f9081526006602052604090205460ff1690565b3480156105a7575f80fd5b506105b0611660565b6040516001600160a01b0390911681526020016102ae565b3480156105d3575f80fd5b5061033b6105e2366004612d8d565b61168e565b3480156105f2575f80fd5b506102cb6118f3565b348015610606575f80fd5b5061033b610615366004612c63565b611902565b348015610625575f80fd5b506102f7610634366004612b3e565b611982565b348015610644575f80fd5b506102cb604051806040016040528060058152602001640352e302e360dc1b81525081565b348015610674575f80fd5b506007546105b0906001600160a01b031681565b348015610693575f80fd5b5061033b6106a2366004612c63565b611a7d565b3480156106b2575f80fd5b506102a46106c1366004612c63565b600b6020525f908152604090205481565b3480156106dd575f80fd5b5061033b6106ec366004612bab565b611c7f565b3480156106fc575f80fd5b506102a4600a5481565b348015610711575f80fd5b506102f7610720366004612c63565b60066020525f908152604090205460ff1681565b34801561073f575f80fd5b506102a460095481565b348015610754575f80fd5b5061033b610763366004612bab565b611db1565b348015610773575f80fd5b506005546102a4565b348015610787575f80fd5b5061033b610796366004612e20565b611f5e565b3480156107a6575f80fd5b506102a46107b5366004612e6f565b6001600160a01b039182165f90815260036020908152604080832093909416825291909152205490565b3480156107ea575f80fd5b506102a460115481565b3480156107ff575f80fd5b5061033b61080e366004612ea0565b611fee565b34801561081e575f80fd5b5061033b61082d366004612c63565b612074565b34801561083d575f80fd5b5061033b61084c366004612ed9565b6120b1565b34801561085c575f80fd5b506102f761086b366004612c63565b600c6020525f908152604090205460ff1681565b34801561088a575f80fd5b5061033b610899366004612f43565b61215e565b60605f80546108ac90612f5a565b80601f01602080910402602001604051908101604052809291908181526020018280546108d890612f5a565b80156109235780601f106108fa57610100808354040283529160200191610923565b820191905f5260205f20905b81548152906001019060200180831161090657829003601f168201915b5050505050905090565b5f6109366115a0565b1561095457604051631350757d60e11b815260040160405180910390fd5b6001600160a01b03831661097b5760405163d92e233d60e01b815260040160405180910390fd5b335f8181526003602090815260408083206001600160a01b03881680855290835292819020869055518581529192917f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a35060015b92915050565b6109e76115a0565b15610a0557604051631350757d60e11b815260040160405180910390fd5b610a0d6121a2565b6001600160a01b0384165f90815260066020526040902054849060ff1615610a585760405163cf8eb59760e01b81526001600160a01b03821660048201526024015b60405180910390fd5b336001600160a01b03861614801590610a805750335f908152600c602052604090205460ff16155b15610a9e5760405163ea8e4eb560e01b815260040160405180910390fd5b6001600160a01b0385165f9081526002602052604090205484811015610ad757604051631e9acf1760e31b815260040160405180910390fd5b6001600160a01b0386165f908152600260205260408120868303905560048054879290610b05908490612fa6565b925050819055508460055f828254610b1d9190612fb9565b92505081905550856001600160a01b03167f0bd10d08cdd688ae27d8149d34aea2ddb78c6e0116355640cf1af79a2c9ab394868686604051610b6193929190612ff4565b60405180910390a26040518581525f906001600160a01b038816905f805160206131ee8339815191529060200160405180910390a35050610bae60015f8051602061320e83398151915255565b50505050565b610bbc6115a0565b15610bda57604051631350757d60e11b815260040160405180910390fd5b610be26121ec565b610bea6121a2565b6001600160a01b0384165f9081526002602052604090205483811015610c2357604051631e9acf1760e31b815260040160405180910390fd5b6001600160a01b0385165f908152600260205260408120858303905560048054869290610c51908490612fa6565b925050819055508360055f828254610c699190612fb9565b92505081905550846001600160a01b03167fad73e7d12b30d639a7527e87040fc8f21a5cf6efd3dd34db76ee6f42fd0ac6a8858585604051610cad93929190612ff4565b60405180910390a26040518481525f906001600160a01b038716905f805160206131ee833981519152906020015b60405180910390a350610bae60015f8051602061320e83398151915255565b335f908152600c602052604090205460ff16610d295760405163ea8e4eb560e01b815260040160405180910390fd5b610d316115a0565b15610d4f57604051631350757d60e11b815260040160405180910390fd5b610d576121a2565b6001600160a01b0383165f90815260066020526040902054839060ff1615610d9d5760405163cf8eb59760e01b81526001600160a01b0382166004820152602401610a4f565b6001600160a01b0383165f90815260066020526040902054839060ff1615610de35760405163cf8eb59760e01b81526001600160a01b0382166004820152602401610a4f565b6001600160a01b0384161580610e0057506001600160a01b038516155b15610e1e5760405163d92e233d60e01b815260040160405180910390fd5b6001600160a01b0385165f90815260036020908152604080832033845290915290205483811015610e62576040516313be252b60e01b815260040160405180910390fd5b6001600160a01b0386165f90815260026020526040902054841115610e9a57604051631e9acf1760e31b815260040160405180910390fd5b6001600160a01b0386165f90815260036020908152604080832033845290915290208482039055610ecc86868661221e565b505050610ee560015f8051602061320e83398151915255565b505050565b5f610ef36115a0565b15610f1157604051631350757d60e11b815260040160405180910390fd5b6001600160a01b038316610f385760405163d92e233d60e01b815260040160405180910390fd5b335f9081526003602090815260408083206001600160a01b038716845290915281205490610f668483612fb9565b335f8181526003602090815260408083206001600160a01b038b16808552908352928190208590555184815293945090927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3506001949350505050565b610fd56121ec565b610fdd6122ec565b565b610fe76121ec565b6107d0610ff48385612fb9565b11156110125760405162a2e87d60e81b815260040160405180910390fd5b610e108111156110355760405163f31366db60e01b815260040160405180910390fd5b60088390556009829055600a81905560408051848152602081018490529081018290527fe95d5f390b896b81ce33d52543ff520538bb59749ef823ba075f55ac216766959060600160405180910390a1505050565b6110926121ec565b6001600160a01b0382166110b95760405163d92e233d60e01b815260040160405180910390fd5b6001600160a01b0382165f818152600d602052604090819020839055517f07a85c99c6fd4df0c73c99c597cba3be7ced1d0dc663443a37207e8fca246674906111059084815260200190565b60405180910390a25050565b6111196115a0565b1561113757604051631350757d60e11b815260040160405180910390fd5b61113f6121a2565b335f8181526006602052604090205460ff161561117a5760405163cf8eb59760e01b81526001600160a01b0382166004820152602401610a4f565b6001600160a01b0383165f90815260066020526040902054839060ff16156111c05760405163cf8eb59760e01b81526001600160a01b0382166004820152602401610a4f565b6001600160a01b0384166111e75760405163d92e233d60e01b815260040160405180910390fd5b335f908152600b6020526040902054801561123f575f6112078242612fa6565b9050600a5481101561123d5780600a546112219190612fa6565b60405163c1ab61a160e01b8152600401610a4f91815260200190565b505b335f908152600b6020526040812042905560085461271090611261908761300d565b61126b9190613024565b90505f6127106009548761127f919061300d565b6112899190613024565b90505f816112978489612fa6565b6112a19190612fa6565b9050805f036112c3576040516372d035c760e01b815260040160405180910390fd5b6112ce33898361221e565b82156112ec576007546112ec9033906001600160a01b03168561221e565b81156113e957335f908152600260205260409020548281101561132257604051631e9acf1760e31b815260040160405180910390fd5b335f908152600260205260408120848303905560048054859290611347908490612fa6565b925050819055508260055f82825461135f9190612fb9565b909155505060405133907f0bd10d08cdd688ae27d8149d34aea2ddb78c6e0116355640cf1af79a2c9ab394906113bb90868152604060208201819052600b908201526a3819382a3930b739b332b960a91b606082015260800190565b60405180910390a26040518381525f9033905f805160206131ee8339815191529060200160405180910390a3505b6040805188815260208101859052908101839052606081018290526001600160a01b0389169033907f9ab8a7f9d959d58ffb0db0a25058e3aaed86788cda0fd39c5b78975a94a3e87a9060800160405180910390a350505050505061145a60015f8051602061320e83398151915255565b5050565b611466612358565b61146f826123fc565b61145a8282612404565b5f6114826124c0565b505f805160206131ce83398151915290565b335f908152600c602052604090205460ff166114c35760405163ea8e4eb560e01b815260040160405180910390fd5b6114cb6115a0565b156114e957604051631350757d60e11b815260040160405180910390fd5b6114f16121a2565b6001600160a01b0383165f90815260066020526040902054839060ff16156115375760405163cf8eb59760e01b81526001600160a01b0382166004820152602401610a4f565b6001600160a01b0383165f90815260066020526040902054839060ff161561157d5760405163cf8eb59760e01b81526001600160a01b0382166004820152602401610a4f565b61158885858561221e565b5050610ee560015f8051602061320e83398151915255565b7fcd5ed15c6e187e77e9aee88184c21f4f2182ab5827cb3b7e07fbedcd63f033005460ff1690565b6115d06121ec565b610fdd5f612509565b6115e16121ec565b6001600160a01b0381166116085760405163d92e233d60e01b815260040160405180910390fd5b6001600160a01b0381165f81815260066020526040808220805460ff19169055517ff915cd9fe234de6e8d3afe7bf2388d35b2b6d48e8c629a24602019bde79c213a9190a250565b6116586121ec565b610fdd612579565b7f9016d09d72d40fdae2fd8ceac6b6234c7706214fd39c1cd1e609a0528c199300546001600160a01b031690565b6116966115a0565b156116b457604051631350757d60e11b815260040160405180910390fd5b6116bc6121ec565b6116c46121a2565b8483146116e7576040516001621398b960e31b0319815260040160405180910390fd5b845f805b8281101561177b575f89898381811061170657611706613043565b905060200201602081019061171b9190612c63565b90506001600160a01b0381166117445760405163d92e233d60e01b815260040160405180910390fd5b5f88888481811061175757611757613043565b905060200201359050808461176c9190612fb9565b935082600101925050506116eb565b50611785816125d4565b5f5b82811015611895575f8989838181106117a2576117a2613043565b90506020020160208101906117b79190612c63565b90505f8888848181106117cc576117cc613043565b9050602002013590508060045f8282546117e69190612fb9565b90915550506001600160a01b0382165f9081526002602052604081208054839290611812908490612fb9565b92505081905550816001600160a01b03167fa9c9babda5ff67ffbbc2a32ea801faa859a4ff810d358a4b0ca2559d745bd15282898960405161185693929190612ff4565b60405180910390a26040518181526001600160a01b038316905f905f805160206131ee8339815191529060200160405180910390a35050600101611787565b507fc37365484f73a79b97b94cfea39563bae82e465dc43e7a90b47ffbadad125036828286866040516118cb9493929190613057565b60405180910390a150506118eb60015f8051602061320e83398151915255565b505050505050565b6060600180546108ac90612f5a565b61190a6121ec565b6001600160a01b0381166119315760405163d92e233d60e01b815260040160405180910390fd5b600780546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f5d16ad41baeb009cd23eb8f6c7cde5c2e0cd5acf4a33926ab488875c37c37f38905f90a35050565b5f61198b6115a0565b156119a957604051631350757d60e11b815260040160405180910390fd5b6001600160a01b0383166119d05760405163d92e233d60e01b815260040160405180910390fd5b335f9081526003602090815260408083206001600160a01b038716845290915290205482811015611a14576040516313be252b60e01b815260040160405180910390fd5b335f8181526003602090815260408083206001600160a01b038916808552908352928190208786039081905590519081529192917f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a35060019392505050565b5f611a866126a5565b805490915060ff600160401b820416159067ffffffffffffffff165f81158015611aad5750825b90505f8267ffffffffffffffff166001148015611ac95750303b155b905081158015611ad7575080155b15611af55760405163f92ee8a960e01b815260040160405180910390fd5b845467ffffffffffffffff191660011785558315611b1f57845460ff60401b1916600160401b1785555b6001600160a01b038616611b465760405163d92e233d60e01b815260040160405180910390fd5b611b4f336126cd565b611b576126de565b611b5f6126de565b611b676126e6565b60408051808201909152600a815269084e4c2eed84086c2e6d60b31b60208201525f90611b9490826130c4565b50604080518082019091526009815268084a482ae988682a6960bb1b6020820152600190611bc290826130c4565b50600780546001600160a01b0319166001600160a01b03881617905561012c60088190556102bc60098190556107d091611bfc9190612fb9565b1115611c1a5760405162a2e87d60e81b815260040160405180910390fd5b610384600a5569d3c21bcecceda10000006010554260125583156118eb57845460ff60401b19168555604051600181527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d29060200160405180910390a1505050505050565b611c876115a0565b15611ca557604051631350757d60e11b815260040160405180910390fd5b611cad6121ec565b611cb56121a2565b6001600160a01b038416611cdc5760405163d92e233d60e01b815260040160405180910390fd5b611ce5836125d4565b8260045f828254611cf69190612fb9565b90915550506001600160a01b0384165f9081526002602052604081208054859290611d22908490612fb9565b92505081905550836001600160a01b03167fa9c9babda5ff67ffbbc2a32ea801faa859a4ff810d358a4b0ca2559d745bd152848484604051611d6693929190612ff4565b60405180910390a26040518381526001600160a01b038516905f905f805160206131ee8339815191529060200160405180910390a3610bae60015f8051602061320e83398151915255565b611db96115a0565b15611dd757604051631350757d60e11b815260040160405180910390fd5b611ddf6121a2565b6001600160a01b0384165f90815260066020526040902054849060ff1615611e255760405163cf8eb59760e01b81526001600160a01b0382166004820152602401610a4f565b6001600160a01b038516611e4c5760405163d92e233d60e01b815260040160405180910390fd5b335f908152600c602052604090205460ff1615611e7257611e6d33856126f6565b611eab565b611e7a611660565b6001600160a01b03163303611e9257611e6d846125d4565b60405163ea8e4eb560e01b815260040160405180910390fd5b8360045f828254611ebc9190612fb9565b90915550506001600160a01b0385165f9081526002602052604081208054869290611ee8908490612fb9565b92505081905550846001600160a01b03167fe7cd4ce7f2a465edc730269a1305e8a48bad821e8fb7e152ec413829c01a53c4858585604051611f2c93929190612ff4565b60405180910390a26040518481526001600160a01b038616905f905f805160206131ee83398151915290602001610cdb565b611f666121ec565b6001600160a01b038316611f8d5760405163d92e233d60e01b815260040160405180910390fd5b6001600160a01b0383165f8181526006602052604090819020805460ff19166001179055517fc71267b66b2c8820cf488bba23c122cee8408eb55e75428bab72cce8d259e6b990611fe19085908590613180565b60405180910390a2505050565b611ff66121ec565b6001600160a01b03821661201d5760405163d92e233d60e01b815260040160405180910390fd5b6001600160a01b0382165f818152600c6020908152604091829020805460ff191685151590811790915591519182527f8f689f580b739f90591fbd591709dd98941c0afe7a47c812b93e978c4702bceb9101611105565b61207c6121ec565b6001600160a01b0381166120a557604051631e4fbdf760e01b81525f6004820152602401610a4f565b6120ae81612509565b50565b6120b96115a0565b156120d757604051631350757d60e11b815260040160405180910390fd5b6120df6121ec565b6120e76121a2565b6120f285858561221e565b836001600160a01b0316856001600160a01b03167f22b8cdaa403be9e59aeeb2b120f6387ce17d5ce83a74d6f26c1a044834e1a8ee85858560405161213993929190612ff4565b60405180910390a361215760015f8051602061320e83398151915255565b5050505050565b6121666121ec565b60108190556040518181527fdb0dc86f180d834568959e050d725ac38c4568efde8b6c3454afb7b4091f1033906020015b60405180910390a150565b5f8051602061320e8339815191528054600119016121d357604051633ee5aeb560e01b815260040160405180910390fd5b60029055565b60015f8051602061320e83398151915255565b336121f5611660565b6001600160a01b031614610fdd5760405163118cdaa760e01b8152336004820152602401610a4f565b6001600160a01b038216158061223b57506001600160a01b038316155b156122595760405163d92e233d60e01b815260040160405180910390fd5b6001600160a01b0383165f908152600260205260409020548181101561229257604051631e9acf1760e31b815260040160405180910390fd5b6001600160a01b038085165f8181526002602052604080822086860390559286168082529083902080548601905591515f805160206131ee833981519152906122de9086815260200190565b60405180910390a350505050565b6122f4612844565b7fcd5ed15c6e187e77e9aee88184c21f4f2182ab5827cb3b7e07fbedcd63f03300805460ff191681557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa335b6040516001600160a01b039091168152602001612197565b306001600160a01b037f0000000000000000000000005ca0b47148e6c1ccb3e54d67cef814d828db30981614806123de57507f0000000000000000000000005ca0b47148e6c1ccb3e54d67cef814d828db30986001600160a01b03166123d25f805160206131ce833981519152546001600160a01b031690565b6001600160a01b031614155b15610fdd5760405163703e46dd60e11b815260040160405180910390fd5b6120ae6121ec565b816001600160a01b03166352d1902d6040518163ffffffff1660e01b8152600401602060405180830381865afa92505050801561245e575060408051601f3d908101601f1916820190925261245b9181019061319b565b60015b61248657604051634c9c8ce360e01b81526001600160a01b0383166004820152602401610a4f565b5f805160206131ce83398151915281146124b657604051632a87526960e21b815260048101829052602401610a4f565b610ee58383612869565b306001600160a01b037f0000000000000000000000005ca0b47148e6c1ccb3e54d67cef814d828db30981614610fdd5760405163703e46dd60e11b815260040160405180910390fd5b7f9016d09d72d40fdae2fd8ceac6b6234c7706214fd39c1cd1e609a0528c19930080546001600160a01b031981166001600160a01b03848116918217845560405192169182907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0905f90a3505050565b6125816128be565b7fcd5ed15c6e187e77e9aee88184c21f4f2182ab5827cb3b7e07fbedcd63f03300805460ff191660011781557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a25833612340565b6125df6012546128e4565b156125ed575f601155426012555b5f816011546125fc9190612fb9565b601054909150801580159061261057508082115b1561262e57604051631e9acf1760e31b815260040160405180910390fd5b60118290558015610ee5575f816126478461271061300d565b6126519190613024565b9050611f408110610bae57604080518481526020810184905290810182905230907ff3fd91d389f57abcdccfe63274f3615a09524e46a9ba4ca3b9c1b077b35892ba9060600160405180910390a250505050565b5f807ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a006109d9565b6126d5612906565b6120ae8161292b565b610fdd612906565b6126ee612906565b610fdd612933565b6001600160a01b0382165f908152600f6020526040902054612717906128e4565b15612744576001600160a01b0382165f908152600e60209081526040808320839055600f90915290204290555b6001600160a01b0382165f908152600e6020526040812054612767908390612fb9565b6001600160a01b0384165f908152600d6020526040902054909150801580159061279057508082115b156127ae57604051631e9acf1760e31b815260040160405180910390fd5b6001600160a01b0384165f908152600e602052604090208290558015610bae575f816127dc8461271061300d565b6127e69190613024565b9050611f4081106121575760408051848152602081018490529081018290526001600160a01b038616907ff3fd91d389f57abcdccfe63274f3615a09524e46a9ba4ca3b9c1b077b35892ba9060600160405180910390a25050505050565b61284c6115a0565b610fdd57604051638dfc202b60e01b815260040160405180910390fd5b6128728261293b565b6040516001600160a01b038316907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b905f90a28051156128b657610ee5828261299e565b61145a612a10565b6128c66115a0565b15610fdd5760405163d93c066560e01b815260040160405180910390fd5b5f6128f26201518083613024565b6128ff6201518042613024565b1192915050565b61290e612a2f565b610fdd57604051631afcd79f60e31b815260040160405180910390fd5b61207c612906565b6121d9612906565b806001600160a01b03163b5f0361297057604051634c9c8ce360e01b81526001600160a01b0382166004820152602401610a4f565b5f805160206131ce83398151915280546001600160a01b0319166001600160a01b0392909216919091179055565b60605f80846001600160a01b0316846040516129ba91906131b2565b5f60405180830381855af49150503d805f81146129f2576040519150601f19603f3d011682016040523d82523d5f602084013e6129f7565b606091505b5091509150612a07858383612a48565b95945050505050565b3415610fdd5760405163b398979f60e01b815260040160405180910390fd5b5f612a386126a5565b54600160401b900460ff16919050565b606082612a5d57612a5882612aa7565b612aa0565b8151158015612a7457506001600160a01b0384163b155b15612a9d57604051639996b31560e01b81526001600160a01b0385166004820152602401610a4f565b50805b9392505050565b805115612ab657805160208201fd5b60405163d6bda27560e01b815260040160405180910390fd5b5f5b83811015612ae9578181015183820152602001612ad1565b50505f910152565b602081525f8251806020840152612b0f816040850160208701612acf565b601f01601f19169190910160400192915050565b80356001600160a01b0381168114612b39575f80fd5b919050565b5f8060408385031215612b4f575f80fd5b612b5883612b23565b946020939093013593505050565b5f8083601f840112612b76575f80fd5b50813567ffffffffffffffff811115612b8d575f80fd5b602083019150836020828501011115612ba4575f80fd5b9250929050565b5f805f8060608587031215612bbe575f80fd5b612bc785612b23565b935060208501359250604085013567ffffffffffffffff811115612be9575f80fd5b612bf587828801612b66565b95989497509550505050565b5f805f60608486031215612c13575f80fd5b612c1c84612b23565b9250612c2a60208501612b23565b9150604084013590509250925092565b5f805f60608486031215612c4c575f80fd5b505081359360208301359350604090920135919050565b5f60208284031215612c73575f80fd5b612aa082612b23565b634e487b7160e01b5f52604160045260245ffd5b5f8060408385031215612ca1575f80fd5b612caa83612b23565b9150602083013567ffffffffffffffff80821115612cc6575f80fd5b818501915085601f830112612cd9575f80fd5b813581811115612ceb57612ceb612c7c565b604051601f8201601f19908116603f01168101908382118183101715612d1357612d13612c7c565b81604052828152886020848701011115612d2b575f80fd5b826020860160208301375f6020848301015280955050505050509250929050565b5f8083601f840112612d5c575f80fd5b50813567ffffffffffffffff811115612d73575f80fd5b6020830191508360208260051b8501011115612ba4575f80fd5b5f805f805f8060608789031215612da2575f80fd5b863567ffffffffffffffff80821115612db9575f80fd5b612dc58a838b01612d4c565b90985096506020890135915080821115612ddd575f80fd5b612de98a838b01612d4c565b90965094506040890135915080821115612e01575f80fd5b50612e0e89828a01612b66565b979a9699509497509295939492505050565b5f805f60408486031215612e32575f80fd5b612e3b84612b23565b9250602084013567ffffffffffffffff811115612e56575f80fd5b612e6286828701612b66565b9497909650939450505050565b5f8060408385031215612e80575f80fd5b612e8983612b23565b9150612e9760208401612b23565b90509250929050565b5f8060408385031215612eb1575f80fd5b612eba83612b23565b915060208301358015158114612ece575f80fd5b809150509250929050565b5f805f805f60808688031215612eed575f80fd5b612ef686612b23565b9450612f0460208701612b23565b935060408601359250606086013567ffffffffffffffff811115612f26575f80fd5b612f3288828901612b66565b969995985093965092949392505050565b5f60208284031215612f53575f80fd5b5035919050565b600181811c90821680612f6e57607f821691505b602082108103612f8c57634e487b7160e01b5f52602260045260245ffd5b50919050565b634e487b7160e01b5f52601160045260245ffd5b818103818111156109d9576109d9612f92565b808201808211156109d9576109d9612f92565b81835281816020850137505f828201602090810191909152601f909101601f19169091010190565b838152604060208201525f612a07604083018486612fcc565b80820281158282048414176109d9576109d9612f92565b5f8261303e57634e487b7160e01b5f52601260045260245ffd5b500490565b634e487b7160e01b5f52603260045260245ffd5b848152836020820152606060408201525f613076606083018486612fcc565b9695505050505050565b601f821115610ee557805f5260205f20601f840160051c810160208510156130a55750805b601f840160051c820191505b81811015612157575f81556001016130b1565b815167ffffffffffffffff8111156130de576130de612c7c565b6130f2816130ec8454612f5a565b84613080565b602080601f831160018114613125575f841561310e5750858301515b5f19600386901b1c1916600185901b1785556118eb565b5f85815260208120601f198616915b8281101561315357888601518255948401946001909101908401613134565b508582101561317057878501515f19600388901b60f8161c191681555b5050505050600190811b01905550565b602081525f613193602083018486612fcc565b949350505050565b5f602082840312156131ab575f80fd5b5051919050565b5f82516131c3818460208701612acf565b919091019291505056fe360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbcddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9b779b17422d0df92223018b32b4d1fa46e071723d6817e2486d003becc55f00a2646970667358221220087f111d68cbc505843841bbb06b0e6dc992157b44c4d2ccf0e981c64bc0fe1964736f6c63430008180033