Warning! Contract bytecode has been changed and doesn't match the verified one. Therefore, interaction with this smart contract may be risky.
- Contract name:
- Ownable
- Optimization enabled
- true
- Compiler version
- v0.8.24+commit.e11b9ed9
- Optimization runs
- 200
- EVM Version
- cancun
- Verified at
- 2025-10-11T18:39:52.857058Z
lib/openzeppelin-contracts/contracts/access/Ownable.sol
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.0) (access/Ownable.sol) pragma solidity ^0.8.20; import {Context} from "../utils/Context.sol"; /** * @dev Contract module which provides a basic access control mechanism, where * there is an account (an owner) that can be granted exclusive access to * specific functions. * * 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 Ownable is Context { address private _owner; /** * @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. */ constructor(address initialOwner) { 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) { 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 { address oldOwner = _owner; _owner = newOwner; emit OwnershipTransferred(oldOwner, newOwner); } }
lib/openzeppelin-contracts/contracts/utils/introspection/IERC165.sol
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.4.0) (utils/introspection/IERC165.sol) pragma solidity >=0.4.16; /** * @dev Interface of the ERC-165 standard, as defined in the * https://eips.ethereum.org/EIPS/eip-165[ERC]. * * Implementers can declare support of contract interfaces, which can then be * queried by others ({ERC165Checker}). * * For an implementation, see {ERC165}. */ interface IERC165 { /** * @dev Returns true if this contract implements the interface defined by * `interfaceId`. See the corresponding * https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[ERC section] * to learn more about how these ids are created. * * This function call must use less than 30 000 gas. */ function supportsInterface(bytes4 interfaceId) external view returns (bool); }
lib/pancake-swap-core/contracts/interfaces/IPancakeFactory.sol
pragma solidity >=0.5.0; interface IPancakeFactory { event PairCreated(address indexed token0, address indexed token1, address pair, uint); function feeTo() external view returns (address); function feeToSetter() external view returns (address); function getPair(address tokenA, address tokenB) external view returns (address pair); function allPairs(uint) external view returns (address pair); function allPairsLength() external view returns (uint); function createPair(address tokenA, address tokenB) external returns (address pair); function setFeeTo(address) external; function setFeeToSetter(address) external; }
lib/pancake-swap-core/contracts/interfaces/IPancakePair.sol
pragma solidity >=0.5.0; interface IPancakePair { event Approval(address indexed owner, address indexed spender, uint value); event Transfer(address indexed from, address indexed to, uint value); function name() external pure returns (string memory); function symbol() external pure returns (string memory); function decimals() external pure returns (uint8); function totalSupply() external view returns (uint); function balanceOf(address owner) external view returns (uint); function allowance(address owner, address spender) external view returns (uint); function approve(address spender, uint value) external returns (bool); function transfer(address to, uint value) external returns (bool); function transferFrom(address from, address to, uint value) external returns (bool); function DOMAIN_SEPARATOR() external view returns (bytes32); function PERMIT_TYPEHASH() external pure returns (bytes32); function nonces(address owner) external view returns (uint); function permit(address owner, address spender, uint value, uint deadline, uint8 v, bytes32 r, bytes32 s) external; event Mint(address indexed sender, uint amount0, uint amount1); event Burn(address indexed sender, uint amount0, uint amount1, address indexed to); event Swap( address indexed sender, uint amount0In, uint amount1In, uint amount0Out, uint amount1Out, address indexed to ); event Sync(uint112 reserve0, uint112 reserve1); function MINIMUM_LIQUIDITY() external pure returns (uint); function factory() external view returns (address); function token0() external view returns (address); function token1() external view returns (address); function getReserves() external view returns (uint112 reserve0, uint112 reserve1, uint32 blockTimestampLast); function price0CumulativeLast() external view returns (uint); function price1CumulativeLast() external view returns (uint); function kLast() external view returns (uint); function mint(address to) external returns (uint liquidity); function burn(address to) external returns (uint amount0, uint amount1); function swap(uint amount0Out, uint amount1Out, address to, bytes calldata data) external; function skim(address to) external; function sync() external; function initialize(address, address) external; }
lib/pancake-swap-periphery/contracts/interfaces/IPancakeRouter01.sol
pragma solidity >=0.6.2; interface IPancakeRouter01 { function factory() external pure returns (address); function WETH() external pure returns (address); function addLiquidity( address tokenA, address tokenB, uint amountADesired, uint amountBDesired, uint amountAMin, uint amountBMin, address to, uint deadline ) external returns (uint amountA, uint amountB, uint liquidity); function addLiquidityETH( address token, uint amountTokenDesired, uint amountTokenMin, uint amountETHMin, address to, uint deadline ) external payable returns (uint amountToken, uint amountETH, uint liquidity); function removeLiquidity( address tokenA, address tokenB, uint liquidity, uint amountAMin, uint amountBMin, address to, uint deadline ) external returns (uint amountA, uint amountB); function removeLiquidityETH( address token, uint liquidity, uint amountTokenMin, uint amountETHMin, address to, uint deadline ) external returns (uint amountToken, uint amountETH); function removeLiquidityWithPermit( address tokenA, address tokenB, uint liquidity, uint amountAMin, uint amountBMin, address to, uint deadline, bool approveMax, uint8 v, bytes32 r, bytes32 s ) external returns (uint amountA, uint amountB); function removeLiquidityETHWithPermit( address token, uint liquidity, uint amountTokenMin, uint amountETHMin, address to, uint deadline, bool approveMax, uint8 v, bytes32 r, bytes32 s ) external returns (uint amountToken, uint amountETH); function swapExactTokensForTokens( uint amountIn, uint amountOutMin, address[] calldata path, address to, uint deadline ) external returns (uint[] memory amounts); function swapTokensForExactTokens( uint amountOut, uint amountInMax, address[] calldata path, address to, uint deadline ) external returns (uint[] memory amounts); function swapExactETHForTokens(uint amountOutMin, address[] calldata path, address to, uint deadline) external payable returns (uint[] memory amounts); function swapTokensForExactETH(uint amountOut, uint amountInMax, address[] calldata path, address to, uint deadline) external returns (uint[] memory amounts); function swapExactTokensForETH(uint amountIn, uint amountOutMin, address[] calldata path, address to, uint deadline) external returns (uint[] memory amounts); function swapETHForExactTokens(uint amountOut, address[] calldata path, address to, uint deadline) external payable returns (uint[] memory amounts); function quote(uint amountA, uint reserveA, uint reserveB) external pure returns (uint amountB); function getAmountOut(uint amountIn, uint reserveIn, uint reserveOut) external pure returns (uint amountOut); function getAmountIn(uint amountOut, uint reserveIn, uint reserveOut) external pure returns (uint amountIn); function getAmountsOut(uint amountIn, address[] calldata path) external view returns (uint[] memory amounts); function getAmountsIn(uint amountOut, address[] calldata path) external view returns (uint[] memory amounts); }
lib/openzeppelin-contracts/contracts/interfaces/IERC1363.sol
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.4.0) (interfaces/IERC1363.sol) pragma solidity >=0.6.2; import {IERC20} from "./IERC20.sol"; import {IERC165} from "./IERC165.sol"; /** * @title IERC1363 * @dev Interface of the ERC-1363 standard as defined in the https://eips.ethereum.org/EIPS/eip-1363[ERC-1363]. * * Defines an extension interface for ERC-20 tokens that supports executing code on a recipient contract * after `transfer` or `transferFrom`, or code on a spender contract after `approve`, in a single transaction. */ interface IERC1363 is IERC20, IERC165 { /* * Note: the ERC-165 identifier for this interface is 0xb0202a11. * 0xb0202a11 === * bytes4(keccak256('transferAndCall(address,uint256)')) ^ * bytes4(keccak256('transferAndCall(address,uint256,bytes)')) ^ * bytes4(keccak256('transferFromAndCall(address,address,uint256)')) ^ * bytes4(keccak256('transferFromAndCall(address,address,uint256,bytes)')) ^ * bytes4(keccak256('approveAndCall(address,uint256)')) ^ * bytes4(keccak256('approveAndCall(address,uint256,bytes)')) */ /** * @dev Moves a `value` amount of tokens from the caller's account to `to` * and then calls {IERC1363Receiver-onTransferReceived} on `to`. * @param to The address which you want to transfer to. * @param value The amount of tokens to be transferred. * @return A boolean value indicating whether the operation succeeded unless throwing. */ function transferAndCall(address to, uint256 value) external returns (bool); /** * @dev Moves a `value` amount of tokens from the caller's account to `to` * and then calls {IERC1363Receiver-onTransferReceived} on `to`. * @param to The address which you want to transfer to. * @param value The amount of tokens to be transferred. * @param data Additional data with no specified format, sent in call to `to`. * @return A boolean value indicating whether the operation succeeded unless throwing. */ function transferAndCall(address to, uint256 value, bytes calldata data) external returns (bool); /** * @dev Moves a `value` amount of tokens from `from` to `to` using the allowance mechanism * and then calls {IERC1363Receiver-onTransferReceived} on `to`. * @param from The address which you want to send tokens from. * @param to The address which you want to transfer to. * @param value The amount of tokens to be transferred. * @return A boolean value indicating whether the operation succeeded unless throwing. */ function transferFromAndCall(address from, address to, uint256 value) external returns (bool); /** * @dev Moves a `value` amount of tokens from `from` to `to` using the allowance mechanism * and then calls {IERC1363Receiver-onTransferReceived} on `to`. * @param from The address which you want to send tokens from. * @param to The address which you want to transfer to. * @param value The amount of tokens to be transferred. * @param data Additional data with no specified format, sent in call to `to`. * @return A boolean value indicating whether the operation succeeded unless throwing. */ function transferFromAndCall(address from, address to, uint256 value, bytes calldata data) external returns (bool); /** * @dev Sets a `value` amount of tokens as the allowance of `spender` over the * caller's tokens and then calls {IERC1363Spender-onApprovalReceived} on `spender`. * @param spender The address which will spend the funds. * @param value The amount of tokens to be spent. * @return A boolean value indicating whether the operation succeeded unless throwing. */ function approveAndCall(address spender, uint256 value) external returns (bool); /** * @dev Sets a `value` amount of tokens as the allowance of `spender` over the * caller's tokens and then calls {IERC1363Spender-onApprovalReceived} on `spender`. * @param spender The address which will spend the funds. * @param value The amount of tokens to be spent. * @param data Additional data with no specified format, sent in call to `spender`. * @return A boolean value indicating whether the operation succeeded unless throwing. */ function approveAndCall(address spender, uint256 value, bytes calldata data) external returns (bool); }
lib/openzeppelin-contracts/contracts/interfaces/IERC165.sol
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.4.0) (interfaces/IERC165.sol) pragma solidity >=0.4.16; import {IERC165} from "../utils/introspection/IERC165.sol";
lib/openzeppelin-contracts/contracts/interfaces/IERC20.sol
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.4.0) (interfaces/IERC20.sol) pragma solidity >=0.4.16; import {IERC20} from "../token/ERC20/IERC20.sol";
lib/openzeppelin-contracts/contracts/interfaces/draft-IERC6093.sol
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.4.0) (interfaces/draft-IERC6093.sol) pragma solidity >=0.8.4; /** * @dev Standard ERC-20 Errors * Interface of the https://eips.ethereum.org/EIPS/eip-6093[ERC-6093] custom errors for ERC-20 tokens. */ interface IERC20Errors { /** * @dev Indicates an error related to the current `balance` of a `sender`. Used in transfers. * @param sender Address whose tokens are being transferred. * @param balance Current balance for the interacting account. * @param needed Minimum amount required to perform a transfer. */ error ERC20InsufficientBalance(address sender, uint256 balance, uint256 needed); /** * @dev Indicates a failure with the token `sender`. Used in transfers. * @param sender Address whose tokens are being transferred. */ error ERC20InvalidSender(address sender); /** * @dev Indicates a failure with the token `receiver`. Used in transfers. * @param receiver Address to which tokens are being transferred. */ error ERC20InvalidReceiver(address receiver); /** * @dev Indicates a failure with the `spender`’s `allowance`. Used in transfers. * @param spender Address that may be allowed to operate on tokens without being their owner. * @param allowance Amount of tokens a `spender` is allowed to operate with. * @param needed Minimum amount required to perform a transfer. */ error ERC20InsufficientAllowance(address spender, uint256 allowance, uint256 needed); /** * @dev Indicates a failure with the `approver` of a token to be approved. Used in approvals. * @param approver Address initiating an approval operation. */ error ERC20InvalidApprover(address approver); /** * @dev Indicates a failure with the `spender` to be approved. Used in approvals. * @param spender Address that may be allowed to operate on tokens without being their owner. */ error ERC20InvalidSpender(address spender); } /** * @dev Standard ERC-721 Errors * Interface of the https://eips.ethereum.org/EIPS/eip-6093[ERC-6093] custom errors for ERC-721 tokens. */ interface IERC721Errors { /** * @dev Indicates that an address can't be an owner. For example, `address(0)` is a forbidden owner in ERC-20. * Used in balance queries. * @param owner Address of the current owner of a token. */ error ERC721InvalidOwner(address owner); /** * @dev Indicates a `tokenId` whose `owner` is the zero address. * @param tokenId Identifier number of a token. */ error ERC721NonexistentToken(uint256 tokenId); /** * @dev Indicates an error related to the ownership over a particular token. Used in transfers. * @param sender Address whose tokens are being transferred. * @param tokenId Identifier number of a token. * @param owner Address of the current owner of a token. */ error ERC721IncorrectOwner(address sender, uint256 tokenId, address owner); /** * @dev Indicates a failure with the token `sender`. Used in transfers. * @param sender Address whose tokens are being transferred. */ error ERC721InvalidSender(address sender); /** * @dev Indicates a failure with the token `receiver`. Used in transfers. * @param receiver Address to which tokens are being transferred. */ error ERC721InvalidReceiver(address receiver); /** * @dev Indicates a failure with the `operator`’s approval. Used in transfers. * @param operator Address that may be allowed to operate on tokens without being their owner. * @param tokenId Identifier number of a token. */ error ERC721InsufficientApproval(address operator, uint256 tokenId); /** * @dev Indicates a failure with the `approver` of a token to be approved. Used in approvals. * @param approver Address initiating an approval operation. */ error ERC721InvalidApprover(address approver); /** * @dev Indicates a failure with the `operator` to be approved. Used in approvals. * @param operator Address that may be allowed to operate on tokens without being their owner. */ error ERC721InvalidOperator(address operator); } /** * @dev Standard ERC-1155 Errors * Interface of the https://eips.ethereum.org/EIPS/eip-6093[ERC-6093] custom errors for ERC-1155 tokens. */ interface IERC1155Errors { /** * @dev Indicates an error related to the current `balance` of a `sender`. Used in transfers. * @param sender Address whose tokens are being transferred. * @param balance Current balance for the interacting account. * @param needed Minimum amount required to perform a transfer. * @param tokenId Identifier number of a token. */ error ERC1155InsufficientBalance(address sender, uint256 balance, uint256 needed, uint256 tokenId); /** * @dev Indicates a failure with the token `sender`. Used in transfers. * @param sender Address whose tokens are being transferred. */ error ERC1155InvalidSender(address sender); /** * @dev Indicates a failure with the token `receiver`. Used in transfers. * @param receiver Address to which tokens are being transferred. */ error ERC1155InvalidReceiver(address receiver); /** * @dev Indicates a failure with the `operator`’s approval. Used in transfers. * @param operator Address that may be allowed to operate on tokens without being their owner. * @param owner Address of the current owner of a token. */ error ERC1155MissingApprovalForAll(address operator, address owner); /** * @dev Indicates a failure with the `approver` of a token to be approved. Used in approvals. * @param approver Address initiating an approval operation. */ error ERC1155InvalidApprover(address approver); /** * @dev Indicates a failure with the `operator` to be approved. Used in approvals. * @param operator Address that may be allowed to operate on tokens without being their owner. */ error ERC1155InvalidOperator(address operator); /** * @dev Indicates an array length mismatch between ids and values in a safeBatchTransferFrom operation. * Used in batch transfers. * @param idsLength Length of the array of token identifiers * @param valuesLength Length of the array of token amounts */ error ERC1155InvalidArrayLength(uint256 idsLength, uint256 valuesLength); }
lib/openzeppelin-contracts/contracts/token/ERC20/ERC20.sol
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.4.0) (token/ERC20/ERC20.sol) pragma solidity ^0.8.20; import {IERC20} from "./IERC20.sol"; import {IERC20Metadata} from "./extensions/IERC20Metadata.sol"; import {Context} from "../../utils/Context.sol"; import {IERC20Errors} from "../../interfaces/draft-IERC6093.sol"; /** * @dev Implementation of the {IERC20} interface. * * This implementation is agnostic to the way tokens are created. This means * that a supply mechanism has to be added in a derived contract using {_mint}. * * TIP: For a detailed writeup see our guide * https://forum.openzeppelin.com/t/how-to-implement-erc20-supply-mechanisms/226[How * to implement supply mechanisms]. * * The default value of {decimals} is 18. To change this, you should override * this function so it returns a different value. * * We have followed general OpenZeppelin Contracts guidelines: functions revert * instead returning `false` on failure. This behavior is nonetheless * conventional and does not conflict with the expectations of ERC-20 * applications. */ abstract contract ERC20 is Context, IERC20, IERC20Metadata, IERC20Errors { mapping(address account => uint256) private _balances; mapping(address account => mapping(address spender => uint256)) private _allowances; uint256 private _totalSupply; string private _name; string private _symbol; /** * @dev Sets the values for {name} and {symbol}. * * Both values are immutable: they can only be set once during construction. */ constructor(string memory name_, string memory symbol_) { _name = name_; _symbol = symbol_; } /** * @dev Returns the name of the token. */ function name() public view virtual returns (string memory) { return _name; } /** * @dev Returns the symbol of the token, usually a shorter version of the * name. */ function symbol() public view virtual returns (string memory) { return _symbol; } /** * @dev Returns the number of decimals used to get its user representation. * For example, if `decimals` equals `2`, a balance of `505` tokens should * be displayed to a user as `5.05` (`505 / 10 ** 2`). * * Tokens usually opt for a value of 18, imitating the relationship between * Ether and Wei. This is the default value returned by this function, unless * it's overridden. * * NOTE: This information is only used for _display_ purposes: it in * no way affects any of the arithmetic of the contract, including * {IERC20-balanceOf} and {IERC20-transfer}. */ function decimals() public view virtual returns (uint8) { return 18; } /// @inheritdoc IERC20 function totalSupply() public view virtual returns (uint256) { return _totalSupply; } /// @inheritdoc IERC20 function balanceOf(address account) public view virtual returns (uint256) { return _balances[account]; } /** * @dev See {IERC20-transfer}. * * Requirements: * * - `to` cannot be the zero address. * - the caller must have a balance of at least `value`. */ function transfer(address to, uint256 value) public virtual returns (bool) { address owner = _msgSender(); _transfer(owner, to, value); return true; } /// @inheritdoc IERC20 function allowance(address owner, address spender) public view virtual returns (uint256) { return _allowances[owner][spender]; } /** * @dev See {IERC20-approve}. * * NOTE: If `value` is the maximum `uint256`, the allowance is not updated on * `transferFrom`. This is semantically equivalent to an infinite approval. * * Requirements: * * - `spender` cannot be the zero address. */ function approve(address spender, uint256 value) public virtual returns (bool) { address owner = _msgSender(); _approve(owner, spender, value); return true; } /** * @dev See {IERC20-transferFrom}. * * Skips emitting an {Approval} event indicating an allowance update. This is not * required by the ERC. See {xref-ERC20-_approve-address-address-uint256-bool-}[_approve]. * * NOTE: Does not update the allowance if the current allowance * is the maximum `uint256`. * * Requirements: * * - `from` and `to` cannot be the zero address. * - `from` must have a balance of at least `value`. * - the caller must have allowance for ``from``'s tokens of at least * `value`. */ function transferFrom(address from, address to, uint256 value) public virtual returns (bool) { address spender = _msgSender(); _spendAllowance(from, spender, value); _transfer(from, to, value); return true; } /** * @dev Moves a `value` amount of tokens from `from` to `to`. * * This internal function is equivalent to {transfer}, and can be used to * e.g. implement automatic token fees, slashing mechanisms, etc. * * Emits a {Transfer} event. * * NOTE: This function is not virtual, {_update} should be overridden instead. */ function _transfer(address from, address to, uint256 value) internal { if (from == address(0)) { revert ERC20InvalidSender(address(0)); } if (to == address(0)) { revert ERC20InvalidReceiver(address(0)); } _update(from, to, value); } /** * @dev Transfers a `value` amount of tokens from `from` to `to`, or alternatively mints (or burns) if `from` * (or `to`) is the zero address. All customizations to transfers, mints, and burns should be done by overriding * this function. * * Emits a {Transfer} event. */ function _update(address from, address to, uint256 value) internal virtual { if (from == address(0)) { // Overflow check required: The rest of the code assumes that totalSupply never overflows _totalSupply += value; } else { uint256 fromBalance = _balances[from]; if (fromBalance < value) { revert ERC20InsufficientBalance(from, fromBalance, value); } unchecked { // Overflow not possible: value <= fromBalance <= totalSupply. _balances[from] = fromBalance - value; } } if (to == address(0)) { unchecked { // Overflow not possible: value <= totalSupply or value <= fromBalance <= totalSupply. _totalSupply -= value; } } else { unchecked { // Overflow not possible: balance + value is at most totalSupply, which we know fits into a uint256. _balances[to] += value; } } emit Transfer(from, to, value); } /** * @dev Creates a `value` amount of tokens and assigns them to `account`, by transferring it from address(0). * Relies on the `_update` mechanism * * Emits a {Transfer} event with `from` set to the zero address. * * NOTE: This function is not virtual, {_update} should be overridden instead. */ function _mint(address account, uint256 value) internal { if (account == address(0)) { revert ERC20InvalidReceiver(address(0)); } _update(address(0), account, value); } /** * @dev Destroys a `value` amount of tokens from `account`, lowering the total supply. * Relies on the `_update` mechanism. * * Emits a {Transfer} event with `to` set to the zero address. * * NOTE: This function is not virtual, {_update} should be overridden instead */ function _burn(address account, uint256 value) internal { if (account == address(0)) { revert ERC20InvalidSender(address(0)); } _update(account, address(0), value); } /** * @dev Sets `value` as the allowance of `spender` over the `owner`'s tokens. * * This internal function is equivalent to `approve`, and can be used to * e.g. set automatic allowances for certain subsystems, etc. * * Emits an {Approval} event. * * Requirements: * * - `owner` cannot be the zero address. * - `spender` cannot be the zero address. * * Overrides to this logic should be done to the variant with an additional `bool emitEvent` argument. */ function _approve(address owner, address spender, uint256 value) internal { _approve(owner, spender, value, true); } /** * @dev Variant of {_approve} with an optional flag to enable or disable the {Approval} event. * * By default (when calling {_approve}) the flag is set to true. On the other hand, approval changes made by * `_spendAllowance` during the `transferFrom` operation set the flag to false. This saves gas by not emitting any * `Approval` event during `transferFrom` operations. * * Anyone who wishes to continue emitting `Approval` events on the`transferFrom` operation can force the flag to * true using the following override: * * ```solidity * function _approve(address owner, address spender, uint256 value, bool) internal virtual override { * super._approve(owner, spender, value, true); * } * ``` * * Requirements are the same as {_approve}. */ function _approve(address owner, address spender, uint256 value, bool emitEvent) internal virtual { if (owner == address(0)) { revert ERC20InvalidApprover(address(0)); } if (spender == address(0)) { revert ERC20InvalidSpender(address(0)); } _allowances[owner][spender] = value; if (emitEvent) { emit Approval(owner, spender, value); } } /** * @dev Updates `owner`'s allowance for `spender` based on spent `value`. * * Does not update the allowance value in case of infinite allowance. * Revert if not enough allowance is available. * * Does not emit an {Approval} event. */ function _spendAllowance(address owner, address spender, uint256 value) internal virtual { uint256 currentAllowance = allowance(owner, spender); if (currentAllowance < type(uint256).max) { if (currentAllowance < value) { revert ERC20InsufficientAllowance(spender, currentAllowance, value); } unchecked { _approve(owner, spender, currentAllowance - value, false); } } } }
lib/openzeppelin-contracts/contracts/token/ERC20/IERC20.sol
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.4.0) (token/ERC20/IERC20.sol) pragma solidity >=0.4.16; /** * @dev Interface of the ERC-20 standard as defined in the ERC. */ interface IERC20 { /** * @dev Emitted when `value` tokens are moved from one account (`from`) to * another (`to`). * * Note that `value` may be zero. */ event Transfer(address indexed from, address indexed to, uint256 value); /** * @dev Emitted when the allowance of a `spender` for an `owner` is set by * a call to {approve}. `value` is the new allowance. */ event Approval(address indexed owner, address indexed spender, uint256 value); /** * @dev Returns the value of tokens in existence. */ function totalSupply() external view returns (uint256); /** * @dev Returns the value of tokens owned by `account`. */ function balanceOf(address account) external view returns (uint256); /** * @dev Moves a `value` amount of tokens from the caller's account to `to`. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transfer(address to, uint256 value) external returns (bool); /** * @dev Returns the remaining number of tokens that `spender` will be * allowed to spend on behalf of `owner` through {transferFrom}. This is * zero by default. * * This value changes when {approve} or {transferFrom} are called. */ function allowance(address owner, address spender) external view returns (uint256); /** * @dev Sets a `value` amount of tokens as the allowance of `spender` over the * caller's tokens. * * Returns a boolean value indicating whether the operation succeeded. * * IMPORTANT: Beware that changing an allowance with this method brings the risk * that someone may use both the old and the new allowance by unfortunate * transaction ordering. One possible solution to mitigate this race * condition is to first reduce the spender's allowance to 0 and set the * desired value afterwards: * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * * Emits an {Approval} event. */ function approve(address spender, uint256 value) external returns (bool); /** * @dev Moves a `value` amount of tokens from `from` to `to` using the * allowance mechanism. `value` is then deducted from the caller's * allowance. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transferFrom(address from, address to, uint256 value) external returns (bool); }
lib/openzeppelin-contracts/contracts/token/ERC20/extensions/IERC20Metadata.sol
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.4.0) (token/ERC20/extensions/IERC20Metadata.sol) pragma solidity >=0.6.2; import {IERC20} from "../IERC20.sol"; /** * @dev Interface for the optional metadata functions from the ERC-20 standard. */ interface IERC20Metadata is IERC20 { /** * @dev Returns the name of the token. */ function name() external view returns (string memory); /** * @dev Returns the symbol of the token. */ function symbol() external view returns (string memory); /** * @dev Returns the decimals places of the token. */ function decimals() external view returns (uint8); }
lib/openzeppelin-contracts/contracts/token/ERC20/utils/SafeERC20.sol
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.3.0) (token/ERC20/utils/SafeERC20.sol) pragma solidity ^0.8.20; import {IERC20} from "../IERC20.sol"; import {IERC1363} from "../../../interfaces/IERC1363.sol"; /** * @title SafeERC20 * @dev Wrappers around ERC-20 operations that throw on failure (when the token * contract returns false). Tokens that return no value (and instead revert or * throw on failure) are also supported, non-reverting calls are assumed to be * successful. * To use this library you can add a `using SafeERC20 for IERC20;` statement to your contract, * which allows you to call the safe operations as `token.safeTransfer(...)`, etc. */ library SafeERC20 { /** * @dev An operation with an ERC-20 token failed. */ error SafeERC20FailedOperation(address token); /** * @dev Indicates a failed `decreaseAllowance` request. */ error SafeERC20FailedDecreaseAllowance(address spender, uint256 currentAllowance, uint256 requestedDecrease); /** * @dev Transfer `value` amount of `token` from the calling contract to `to`. If `token` returns no value, * non-reverting calls are assumed to be successful. */ function safeTransfer(IERC20 token, address to, uint256 value) internal { _callOptionalReturn(token, abi.encodeCall(token.transfer, (to, value))); } /** * @dev Transfer `value` amount of `token` from `from` to `to`, spending the approval given by `from` to the * calling contract. If `token` returns no value, non-reverting calls are assumed to be successful. */ function safeTransferFrom(IERC20 token, address from, address to, uint256 value) internal { _callOptionalReturn(token, abi.encodeCall(token.transferFrom, (from, to, value))); } /** * @dev Variant of {safeTransfer} that returns a bool instead of reverting if the operation is not successful. */ function trySafeTransfer(IERC20 token, address to, uint256 value) internal returns (bool) { return _callOptionalReturnBool(token, abi.encodeCall(token.transfer, (to, value))); } /** * @dev Variant of {safeTransferFrom} that returns a bool instead of reverting if the operation is not successful. */ function trySafeTransferFrom(IERC20 token, address from, address to, uint256 value) internal returns (bool) { return _callOptionalReturnBool(token, abi.encodeCall(token.transferFrom, (from, to, value))); } /** * @dev Increase the calling contract's allowance toward `spender` by `value`. If `token` returns no value, * non-reverting calls are assumed to be successful. * * IMPORTANT: If the token implements ERC-7674 (ERC-20 with temporary allowance), and if the "client" * smart contract uses ERC-7674 to set temporary allowances, then the "client" smart contract should avoid using * this function. Performing a {safeIncreaseAllowance} or {safeDecreaseAllowance} operation on a token contract * that has a non-zero temporary allowance (for that particular owner-spender) will result in unexpected behavior. */ function safeIncreaseAllowance(IERC20 token, address spender, uint256 value) internal { uint256 oldAllowance = token.allowance(address(this), spender); forceApprove(token, spender, oldAllowance + value); } /** * @dev Decrease the calling contract's allowance toward `spender` by `requestedDecrease`. If `token` returns no * value, non-reverting calls are assumed to be successful. * * IMPORTANT: If the token implements ERC-7674 (ERC-20 with temporary allowance), and if the "client" * smart contract uses ERC-7674 to set temporary allowances, then the "client" smart contract should avoid using * this function. Performing a {safeIncreaseAllowance} or {safeDecreaseAllowance} operation on a token contract * that has a non-zero temporary allowance (for that particular owner-spender) will result in unexpected behavior. */ function safeDecreaseAllowance(IERC20 token, address spender, uint256 requestedDecrease) internal { unchecked { uint256 currentAllowance = token.allowance(address(this), spender); if (currentAllowance < requestedDecrease) { revert SafeERC20FailedDecreaseAllowance(spender, currentAllowance, requestedDecrease); } forceApprove(token, spender, currentAllowance - requestedDecrease); } } /** * @dev Set the calling contract's allowance toward `spender` to `value`. If `token` returns no value, * non-reverting calls are assumed to be successful. Meant to be used with tokens that require the approval * to be set to zero before setting it to a non-zero value, such as USDT. * * NOTE: If the token implements ERC-7674, this function will not modify any temporary allowance. This function * only sets the "standard" allowance. Any temporary allowance will remain active, in addition to the value being * set here. */ function forceApprove(IERC20 token, address spender, uint256 value) internal { bytes memory approvalCall = abi.encodeCall(token.approve, (spender, value)); if (!_callOptionalReturnBool(token, approvalCall)) { _callOptionalReturn(token, abi.encodeCall(token.approve, (spender, 0))); _callOptionalReturn(token, approvalCall); } } /** * @dev Performs an {ERC1363} transferAndCall, with a fallback to the simple {ERC20} transfer if the target has no * code. This can be used to implement an {ERC721}-like safe transfer that rely on {ERC1363} checks when * targeting contracts. * * Reverts if the returned value is other than `true`. */ function transferAndCallRelaxed(IERC1363 token, address to, uint256 value, bytes memory data) internal { if (to.code.length == 0) { safeTransfer(token, to, value); } else if (!token.transferAndCall(to, value, data)) { revert SafeERC20FailedOperation(address(token)); } } /** * @dev Performs an {ERC1363} transferFromAndCall, with a fallback to the simple {ERC20} transferFrom if the target * has no code. This can be used to implement an {ERC721}-like safe transfer that rely on {ERC1363} checks when * targeting contracts. * * Reverts if the returned value is other than `true`. */ function transferFromAndCallRelaxed( IERC1363 token, address from, address to, uint256 value, bytes memory data ) internal { if (to.code.length == 0) { safeTransferFrom(token, from, to, value); } else if (!token.transferFromAndCall(from, to, value, data)) { revert SafeERC20FailedOperation(address(token)); } } /** * @dev Performs an {ERC1363} approveAndCall, with a fallback to the simple {ERC20} approve if the target has no * code. This can be used to implement an {ERC721}-like safe transfer that rely on {ERC1363} checks when * targeting contracts. * * NOTE: When the recipient address (`to`) has no code (i.e. is an EOA), this function behaves as {forceApprove}. * Opposedly, when the recipient address (`to`) has code, this function only attempts to call {ERC1363-approveAndCall} * once without retrying, and relies on the returned value to be true. * * Reverts if the returned value is other than `true`. */ function approveAndCallRelaxed(IERC1363 token, address to, uint256 value, bytes memory data) internal { if (to.code.length == 0) { forceApprove(token, to, value); } else if (!token.approveAndCall(to, value, data)) { revert SafeERC20FailedOperation(address(token)); } } /** * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement * on the return value: the return value is optional (but if data is returned, it must not be false). * @param token The token targeted by the call. * @param data The call data (encoded using abi.encode or one of its variants). * * This is a variant of {_callOptionalReturnBool} that reverts if call fails to meet the requirements. */ function _callOptionalReturn(IERC20 token, bytes memory data) private { uint256 returnSize; uint256 returnValue; assembly ("memory-safe") { let success := call(gas(), token, 0, add(data, 0x20), mload(data), 0, 0x20) // bubble errors if iszero(success) { let ptr := mload(0x40) returndatacopy(ptr, 0, returndatasize()) revert(ptr, returndatasize()) } returnSize := returndatasize() returnValue := mload(0) } if (returnSize == 0 ? address(token).code.length == 0 : returnValue != 1) { revert SafeERC20FailedOperation(address(token)); } } /** * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement * on the return value: the return value is optional (but if data is returned, it must not be false). * @param token The token targeted by the call. * @param data The call data (encoded using abi.encode or one of its variants). * * This is a variant of {_callOptionalReturn} that silently catches all reverts and returns a bool instead. */ function _callOptionalReturnBool(IERC20 token, bytes memory data) private returns (bool) { bool success; uint256 returnSize; uint256 returnValue; assembly ("memory-safe") { success := call(gas(), token, 0, add(data, 0x20), mload(data), 0, 0x20) returnSize := returndatasize() returnValue := mload(0) } return success && (returnSize == 0 ? address(token).code.length > 0 : returnValue == 1); } }
lib/openzeppelin-contracts/contracts/utils/Context.sol
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.1) (utils/Context.sol) pragma solidity ^0.8.20; /** * @dev Provides information about the current execution context, including the * sender of the transaction and its data. While these are generally available * via msg.sender and msg.data, they should not be accessed in such a direct * manner, since when dealing with meta-transactions the account sending and * paying for execution may not be the actual sender (as far as an application * is concerned). * * This contract is only required for intermediate, library-like contracts. */ abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } function _msgData() internal view virtual returns (bytes calldata) { return msg.data; } function _contextSuffixLength() internal view virtual returns (uint256) { return 0; } }
lib/openzeppelin-contracts/contracts/utils/ReentrancyGuard.sol
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.1.0) (utils/ReentrancyGuard.sol) pragma solidity ^0.8.20; /** * @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 ReentrancyGuard { // Booleans are more expensive than uint256 or any type that takes up a full // word because each write operation emits an extra SLOAD to first read the // slot's contents, replace the bits taken up by the boolean, and then write // back. This is the compiler's defense against contract upgrades and // pointer aliasing, and it cannot be disabled. // The values being non-zero value makes deployment a bit more expensive, // but in exchange the refund on every call to nonReentrant will be lower in // amount. Since refunds are capped to a percentage of the total // transaction's gas, it is best to keep them low in cases like this one, to // increase the likelihood of the full refund coming into effect. uint256 private constant NOT_ENTERED = 1; uint256 private constant ENTERED = 2; uint256 private _status; /** * @dev Unauthorized reentrant call. */ error ReentrancyGuardReentrantCall(); constructor() { _status = NOT_ENTERED; } /** * @dev Prevents a contract from calling itself, directly or indirectly. * Calling a `nonReentrant` function from another `nonReentrant` * function is not supported. It is possible to prevent this from happening * by making the `nonReentrant` function external, and making it call a * `private` function that does the actual work. */ modifier nonReentrant() { _nonReentrantBefore(); _; _nonReentrantAfter(); } function _nonReentrantBefore() private { // On the first call to nonReentrant, _status will be NOT_ENTERED if (_status == ENTERED) { revert ReentrancyGuardReentrantCall(); } // Any calls to nonReentrant after this point will fail _status = ENTERED; } function _nonReentrantAfter() private { // By storing the original value once again, a refund is triggered (see // https://eips.ethereum.org/EIPS/eip-2200) _status = NOT_ENTERED; } /** * @dev 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) { return _status == ENTERED; } }
lib/pancake-swap-periphery/contracts/interfaces/IPancakeRouter02.sol
pragma solidity >=0.6.2; import './IPancakeRouter01.sol'; interface IPancakeRouter02 is IPancakeRouter01 { function removeLiquidityETHSupportingFeeOnTransferTokens( address token, uint liquidity, uint amountTokenMin, uint amountETHMin, address to, uint deadline ) external returns (uint amountETH); function removeLiquidityETHWithPermitSupportingFeeOnTransferTokens( address token, uint liquidity, uint amountTokenMin, uint amountETHMin, address to, uint deadline, bool approveMax, uint8 v, bytes32 r, bytes32 s ) external returns (uint amountETH); function swapExactTokensForTokensSupportingFeeOnTransferTokens( uint amountIn, uint amountOutMin, address[] calldata path, address to, uint deadline ) external; function swapExactETHForTokensSupportingFeeOnTransferTokens( uint amountOutMin, address[] calldata path, address to, uint deadline ) external payable; function swapExactTokensForETHSupportingFeeOnTransferTokens( uint amountIn, uint amountOutMin, address[] calldata path, address to, uint deadline ) external; }
src/GoalToken/GoalToken.sol
// SPDX-License-Identifier: MIT pragma solidity ^0.8.24; /* ███████╗██╗ ██╗████████╗██████╗ ██████╗ ██╗ ██████╗ ██████╗ █████╗ ██╗ ██╗██╗ ██╔════╝██║ ██║╚══██╔══╝██╔══██╗██╔═══██╗██║ ██╔══██╗██╔══██╗██╔══██╗██║ ██║██║ █████╗ ██║ ██║ ██║ ██████╔╝██║ ██║██║ ██████╔╝██████╔╝███████║██║ █╗ ██║██║ ██╔══╝ ██║ ██║ ██║ ██╔══██╗██║ ██║██║ ██╔══██╗██╔══██╗██╔══██║██║███╗██║██║ ██║ ╚██████╔╝ ██║ ██████╔╝╚██████╔╝███████╗██████╔╝██║ ██║██║ ██║╚███╔███╔╝███████╗ ╚═╝ ╚═════╝ ╚═╝ ╚═════╝ ╚═════╝ ╚══════╝╚═════╝ ╚═╝ ╚═╝╚═╝ ╚═╝ ╚══╝╚══╝ ╚══════╝ F U T B O L B R A W L */ import "@openzeppelin/contracts/token/ERC20/ERC20.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/utils/ReentrancyGuard.sol"; import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol"; import "pancake-swap-core/interfaces/IPancakeFactory.sol"; import "pancake-swap-core/interfaces/IPancakePair.sol"; import "pancake-swap-periphery/interfaces/IPancakeRouter02.sol"; import "../interfaces/GoalToken/IGoalToken.sol"; /** * @title GoalToken v2 * @dev ERC-20 token for FutbolBrawl with deflationary mechanics and LP tax system * @notice Implements IGoalToken interface (implicitly, no inheritance) * * FEATURES: * - Buy/sell taxes (4.7% buy, 16.6% sell by default) * - Timelock governance for tax changes (48h delay) * - Deflationary burn mechanics via authorized burners * - LP auto-detection with factory verification * - Bulk transfer operations * * CRITICAL FIXES v2: * - Fixed: _update now allows mint/burn operations (CRITICAL - was blocking deployment) * - Fixed: setRouterAddress updates factory (sync issue) * - Fixed: transferOwnership removes old owner from exclusion list * - Fixed: Separated interface from implementation (cleaner architecture) * * @custom:security-contact security@futbolbrawl.com */ contract GoalToken is ERC20, Ownable, ReentrancyGuard, IGoalToken { using SafeERC20 for IERC20; // ───────────────────────────── Constants ───────────────────────────── uint256 public constant MAX_BUY_TAX = 100; uint256 public constant MAX_SELL_TAX = 200; uint256 public constant MAX_BULK_TRANSFER = 200; uint256 public constant TIMELOCK_DURATION = 48 hours; uint256 public constant TAX_DENOMINATOR = 1000; // ───────────────────────────── State Variables ───────────────────────────── IPancakeRouter02 public router; IPancakeFactory public factory; address public vaultAddr; uint256 public buyTax; uint256 public sellTax; mapping(address => bool) public isLp; mapping(address => bool) public isVerifiedLp; mapping(address => bool) public excludedFromFee; mapping(bytes32 => IGoalToken.Proposal) internal proposals; uint256 public proposalNonce; error TransferToZeroAddress(); // ───────────────────────────── Constructor ───────────────────────────── /** * @dev Initialize GoalToken with initial configuration * @param _vaultAddr Address to receive swapped BNB * @param routerAddress PancakeSwap router address (can be address(0) if no DEX available) * @param _buyTax Initial buy tax in per-mille (1000 = 100%) * @param _sellTax Initial sell tax in per-mille (1000 = 100%) * @notice If routerAddress is address(0), swapToVault() will not work until configured * @notice Taxes can be changed after deployment via timelock (48h delay) */ constructor( address _vaultAddr, address routerAddress, uint256 _buyTax, uint256 _sellTax ) ERC20("GOAL Token", "GOAL") Ownable(msg.sender) { if (_vaultAddr == address(0)) revert IGoalToken.ZeroAddress(); if (_buyTax > MAX_BUY_TAX) revert IGoalToken.TaxExceedsMaximum(); if (_sellTax > MAX_SELL_TAX) revert IGoalToken.TaxExceedsMaximum(); vaultAddr = _vaultAddr; // Router is optional (for chains without compatible DEX) if (routerAddress != address(0)) { IPancakeRouter02 _router = IPancakeRouter02(routerAddress); router = _router; factory = IPancakeFactory(_router.factory()); excludedFromFee[address(router)] = true; } buyTax = _buyTax; sellTax = _sellTax; excludedFromFee[msg.sender] = true; excludedFromFee[address(this)] = true; // Mint initial supply (1B tokens) _mint(msg.sender, 1000000000 * 10 ** 18); } // ───────────────────────────── Admin Functions ───────────────────────────── /** * @dev Set vault address for fee collection * @param addr New vault address */ function setVaultAddress(address addr) external onlyOwner { if (addr == address(0)) revert IGoalToken.ZeroAddress(); address oldVault = vaultAddr; vaultAddr = addr; emit VaultAddressChanged(oldVault, addr); } /** * @dev Set router address for DEX interactions * @param addr New router address * @notice Automatically updates factory and fee exclusions */ function setRouterAddress(address addr) external onlyOwner { if (addr == address(0)) revert IGoalToken.ZeroAddress(); address oldRouter = address(router); if (oldRouter != address(0) && excludedFromFee[oldRouter]) { excludedFromFee[oldRouter] = false; emit FeeExclusionUpdated(oldRouter, false); } IPancakeRouter02 newRouter = IPancakeRouter02(addr); router = newRouter; factory = IPancakeFactory(newRouter.factory()); excludedFromFee[addr] = true; emit FeeExclusionUpdated(addr, true); emit RouterAddressChanged(oldRouter, addr); } /** * @dev Transfer ownership and update fee exclusions * @param newOwner Address of new owner * @notice Removes old owner from exclusion list and adds new owner */ function transferOwnership(address newOwner) public override onlyOwner { if (newOwner == address(0)) revert IGoalToken.ZeroAddress(); address oldOwner = owner(); if (excludedFromFee[oldOwner]) { excludedFromFee[oldOwner] = false; emit FeeExclusionUpdated(oldOwner, false); } excludedFromFee[newOwner] = true; emit FeeExclusionUpdated(newOwner, true); super.transferOwnership(newOwner); } /** * @dev Manually set LP address * @param addr LP contract address * @param value Whether it's an LP */ function setLP(address addr, bool value) external onlyOwner { if (addr == address(0)) revert IGoalToken.ZeroAddress(); isLp[addr] = value; emit LPFlagUpdated(addr, value); } /** * @dev Verify and register LP from factory * @param tokenA First token address * @param tokenB Second token address * @notice Reverts if factory is not configured */ function verifyAndRegisterLP(address tokenA, address tokenB) external onlyOwner { if (address(factory) == address(0)) revert IGoalToken.ZeroAddress(); address pair = factory.getPair(tokenA, tokenB); if (pair == address(0)) revert IGoalToken.PairNotFound(); isVerifiedLp[pair] = true; emit LPVerified(pair, tokenA, tokenB); } /** * @dev Auto-register main LP pair (GOAL/WETH) * @notice Reverts if router/factory is not configured */ function registerMainLPPair() external onlyOwner { if (address(router) == address(0)) revert IGoalToken.ZeroAddress(); if (address(factory) == address(0)) revert IGoalToken.ZeroAddress(); address weth = router.WETH(); address pair = factory.getPair(address(this), weth); if (pair != address(0)) { isVerifiedLp[pair] = true; emit LPVerified(pair, address(this), weth); } } /** * @dev Exclude/include address from trading fees * @param addr Address to modify * @param value Whether to exclude from fees */ function excludeFromFee(address addr, bool value) external onlyOwner { if (addr == address(0)) revert IGoalToken.ZeroAddress(); excludedFromFee[addr] = value; emit FeeExclusionUpdated(addr, value); } /** * @dev Propose a tax change with 48-hour timelock * @param _buyTax New buy tax in per-mille (1000 = 100%) * @param _sellTax New sell tax in per-mille (1000 = 100%) */ function proposeTaxChange(uint256 _buyTax, uint256 _sellTax) external onlyOwner { if (_buyTax > MAX_BUY_TAX) revert IGoalToken.TaxExceedsMaximum(); if (_sellTax > MAX_SELL_TAX) revert IGoalToken.TaxExceedsMaximum(); bytes32 proposalId = keccak256(abi.encode(_buyTax, _sellTax, proposalNonce, msg.sender)); proposalNonce++; proposals[proposalId] = Proposal({timestamp: block.timestamp, executed: false, newBuyTax: _buyTax, newSellTax: _sellTax}); emit ProposalCreated(proposalId, block.timestamp, _buyTax, _sellTax); emit TaxChangeProposed(proposalId, _buyTax, _sellTax, block.timestamp + TIMELOCK_DURATION); } /** * @dev Execute a tax change after timelock expires * @param proposalId Proposal ID to execute */ function executeTaxChange(bytes32 proposalId) external onlyOwner { IGoalToken.Proposal storage proposal = proposals[proposalId]; if (proposal.timestamp == 0) revert IGoalToken.ProposalDoesNotExist(); if (proposal.executed) revert IGoalToken.ProposalAlreadyExecuted(); if (block.timestamp < proposal.timestamp + TIMELOCK_DURATION) revert IGoalToken.TimelockNotExpired(); proposal.executed = true; uint256 oldBuyTax = buyTax; uint256 oldSellTax = sellTax; buyTax = proposal.newBuyTax; sellTax = proposal.newSellTax; emit TaxUpdated(oldBuyTax, oldSellTax, proposal.newBuyTax, proposal.newSellTax); } /** * @dev Clean up executed proposals * @param proposalIds Array of proposal IDs to clean up */ function cleanupExecutedProposals(bytes32[] calldata proposalIds) external onlyOwner { for (uint256 i = 0; i < proposalIds.length; i++) { bytes32 proposalId = proposalIds[i]; IGoalToken.Proposal storage proposal = proposals[proposalId]; if (proposal.executed) { delete proposals[proposalId]; emit ProposalCleaned(proposalId); } } } // ───────────────────────────── Transfer Logic ───────────────────────────── /** * @dev Override transfer to implement tax logic * @param from Sender address * @param to Recipient address * @param amount Amount to transfer * * @notice Allows mint (from=0) and burn (to=0) without tax logic */ function _update(address from, address to, uint256 amount) internal override { if (from == address(0) || to == address(0)) { super._update(from, to, amount); return; } bool isBuy = _isLPToken(from) && !excludedFromFee[to]; bool isSell = _isLPToken(to) && !excludedFromFee[from]; if (isBuy) { uint256 fee = (amount * buyTax) / TAX_DENOMINATOR; super._update(from, to, amount - fee); super._update(from, address(this), fee); emit AccumulatedFee(to, from, fee, true); } else if (isSell) { uint256 fee = (amount * sellTax) / TAX_DENOMINATOR; super._update(from, to, amount - fee); super._update(from, address(this), fee); emit AccumulatedFee(from, to, fee, false); } else { super._update(from, to, amount); } } /** * @dev Checks if an address is a verified liquidity pool * @param addr Address to check * @return Whether the address is a verified LP */ function _isLPToken(address addr) internal view returns (bool) { if (addr.code.length == 0) return false; if (isLp[addr]) return true; if (isVerifiedLp[addr]) return true; return false; } // ───────────────────────────── Burning Functions ───────────────────────────── /** * @dev Burns tokens from sender's balance * @param amount Amount to burn */ function burn(uint256 amount) external { _burn(msg.sender, amount); emit TokensBurned(msg.sender, amount); } /** * @dev Burns tokens from an approved account * @param account Address to burn from * @param amount Amount to burn */ function burnFrom(address account, uint256 amount) external { uint256 currentAllowance = allowance(account, msg.sender); if (currentAllowance < amount) revert IGoalToken.BurnAmountExceedsAllowance(); _approve(account, msg.sender, currentAllowance - amount); _burn(account, amount); emit TokensBurned(account, amount); } // ───────────────────────────── Swap Functions ───────────────────────────── /** * @dev Receive BNB from swaps */ receive() external payable {} /** * @dev Swap accumulated fees to BNB and send to vault * @param minBNBOut Minimum BNB output for slippage protection * @notice Implements IGoalToken.swapToVault(uint256) * @notice Reverts if router is not configured (address(0)) */ function swapToVault(uint256 minBNBOut) external nonReentrant { if (address(router) == address(0)) revert IGoalToken.ZeroAddress(); uint256 amount = balanceOf(address(this)); if (amount == 0) revert IGoalToken.NothingToSwap(); _approve(address(this), address(router), amount); address[] memory path = new address[](2); path[0] = address(this); path[1] = router.WETH(); uint256 balanceBefore = address(this).balance; router.swapExactTokensForETHSupportingFeeOnTransferTokens( amount, minBNBOut, path, address(this), block.timestamp + 300 ); uint256 bnbReceived = address(this).balance - balanceBefore; (bool success,) = payable(vaultAddr).call{value: bnbReceived}(""); require(success, "GoalToken: BNB transfer to vault failed"); emit SwappedToVault(amount, bnbReceived); } /** * @dev Legacy swap function without slippage protection * @notice Implements IGoalToken.swapToVault() * @notice Reverts if router is not configured (address(0)) */ function swapToVault() external nonReentrant { if (address(router) == address(0)) revert IGoalToken.ZeroAddress(); uint256 amount = balanceOf(address(this)); if (amount == 0) revert IGoalToken.NothingToSwap(); _approve(address(this), address(router), amount); address[] memory path = new address[](2); path[0] = address(this); path[1] = router.WETH(); uint256 balanceBefore = address(this).balance; router.swapExactTokensForETHSupportingFeeOnTransferTokens(amount, 0, path, address(this), block.timestamp + 300); uint256 bnbReceived = address(this).balance - balanceBefore; (bool success,) = payable(vaultAddr).call{value: bnbReceived}(""); require(success, "GoalToken: BNB transfer to vault failed"); emit SwappedToVault(amount, bnbReceived); } // ───────────────────────────── Bulk Operations ───────────────────────────── /** * @dev Transfer tokens to multiple addresses * @param accounts Array of recipient addresses * @param amounts Array of amounts to transfer * * @notice ATOMIC: Either ALL transfers succeed or ALL revert (no partial execution) * @notice REVERTS if any recipient is an LP (prevents unexpected fees) * @notice REVERTS if insufficient balance for total amount (prevents partial transfers) */ function bulkTransfer(address[] calldata accounts, uint256[] calldata amounts) external { if (accounts.length != amounts.length) revert IGoalToken.LengthMismatch(); if (accounts.length > MAX_BULK_TRANSFER) revert IGoalToken.ExceedsMaxBulkTransfer(); if (accounts.length == 0) revert IGoalToken.EmptyArrays(); uint256 totalAmount; for (uint256 i = 0; i < amounts.length; i++) { totalAmount += amounts[i]; } if (balanceOf(msg.sender) < totalAmount) revert IGoalToken.InsufficientBalanceForBulkTransfer(); for (uint256 i = 0; i < accounts.length; i++) { if (accounts[i] == address(0)) revert TransferToZeroAddress(); if (_isLPToken(accounts[i])) { revert IGoalToken.BulkTransferToLPNotAllowed(); } } for (uint256 i = 0; i < accounts.length; i++) { transfer(accounts[i], amounts[i]); } emit BulkTransferCompleted(msg.sender, accounts.length); } // ───────────────────────────── View Functions (IGoalToken) ───────────────────────────── /** * @notice Implements IGoalToken.getBuyTax */ function getBuyTax() external view returns (uint256) { return buyTax; } /** * @notice Implements IGoalToken.getSellTax */ function getSellTax() external view returns (uint256) { return sellTax; } /** * @notice Implements IGoalToken.getAccumulatedFees */ function getAccumulatedFees() external view returns (uint256) { return balanceOf(address(this)); } /** * @dev Get proposal details */ function getProposal(bytes32 proposalId) external view returns (IGoalToken.Proposal memory) { return proposals[proposalId]; } /** * @dev Check if proposal can be executed */ function canExecuteProposal(bytes32 proposalId) external view returns (bool) { IGoalToken.Proposal storage proposal = proposals[proposalId]; return proposal.timestamp > 0 && !proposal.executed && block.timestamp >= proposal.timestamp + TIMELOCK_DURATION; } /** * @dev Get next proposal nonce */ function getNextProposalNonce() external view returns (uint256) { return proposalNonce; } /** * @dev Get contract version */ function version() external pure returns (string memory) { return "GoalToken v1"; } }
src/interfaces/GoalToken/IGoalToken.sol
// SPDX-License-Identifier: MIT pragma solidity ^0.8.24; /** * @title IGoalToken * @dev Interface for GoalToken - Used by external contracts (Treasury, Game) to interact with GoalToken * @notice This interface only declares external functions that other contracts need to call */ interface IGoalToken { // ───────────────────────────── Structs ───────────────────────────── struct Proposal { uint256 timestamp; bool executed; uint256 newBuyTax; uint256 newSellTax; } // ───────────────────────────── Events ───────────────────────────── event VaultAddressChanged(address indexed oldVault, address indexed newVault); event RouterAddressChanged(address indexed oldRouter, address indexed newRouter); event FeeExclusionUpdated(address indexed account, bool excluded); event LPFlagUpdated(address indexed pair, bool isLp); event LPVerified(address indexed pair, address indexed tokenA, address indexed tokenB); event TaxChangeProposed(bytes32 indexed proposalId, uint256 buyTax, uint256 sellTax, uint256 executeAfter); event ProposalCreated(bytes32 indexed proposalId, uint256 timestamp, uint256 buyTax, uint256 sellTax); event ProposalCleaned(bytes32 indexed proposalId); event TaxUpdated(uint256 oldBuyTax, uint256 oldSellTax, uint256 newBuyTax, uint256 newSellTax); event AccumulatedFee(address indexed payer, address indexed counterparty, uint256 amount, bool isBuy); event TokensBurned(address indexed account, uint256 amount); event SwappedToVault(uint256 tokensSwapped, uint256 bnbReceived); event BulkTransferCompleted(address indexed sender, uint256 count); // ───────────────────────────── Errors ───────────────────────────── error ZeroAddress(); error TaxExceedsMaximum(); error ProposalDoesNotExist(); error ProposalAlreadyExecuted(); error TimelockNotExpired(); error BurnAmountExceedsAllowance(); error NothingToSwap(); error LengthMismatch(); error ExceedsMaxBulkTransfer(); error EmptyArrays(); error PairNotFound(); error BulkTransferToLPNotAllowed(); error InsufficientBalanceForBulkTransfer(); // ───────────────────────────── Burning Functions ───────────────────────────── /** * @dev Burns tokens from sender's balance * @param amount Amount to burn */ function burn(uint256 amount) external; /** * @dev Burns tokens from an approved account * @param account Address to burn from * @param amount Amount to burn * @notice Requires prior approval via approve() */ function burnFrom(address account, uint256 amount) external; // ───────────────────────────── View Functions ───────────────────────────── /** * @dev Get current buy tax rate * @return Buy tax in per-mille (1000 = 100%) */ function getBuyTax() external view returns (uint256); /** * @dev Get current sell tax rate * @return Sell tax in per-mille (1000 = 100%) */ function getSellTax() external view returns (uint256); /** * @dev Get accumulated fees in the contract * @return Amount of accumulated fees */ function getAccumulatedFees() external view returns (uint256); /** * @dev Check if an address is excluded from fees * @param account Address to check * @return Whether the address is excluded from fees */ function excludedFromFee(address account) external view returns (bool); // ───────────────────────────── Swap Functions ───────────────────────────── /** * @dev Swap accumulated fees to BNB and send to vault */ function swapToVault() external; /** * @dev Swap accumulated fees to BNB with slippage protection * @param minBNBOut Minimum BNB output expected */ function swapToVault(uint256 minBNBOut) external; }
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":"error","name":"OwnableInvalidOwner","inputs":[{"type":"address","name":"owner","internalType":"address"}]},{"type":"error","name":"OwnableUnauthorizedAccount","inputs":[{"type":"address","name":"account","internalType":"address"}]},{"type":"event","name":"OwnershipTransferred","inputs":[{"type":"address","name":"previousOwner","internalType":"address","indexed":true},{"type":"address","name":"newOwner","internalType":"address","indexed":true}],"anonymous":false},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"address"}],"name":"owner","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"renounceOwnership","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"transferOwnership","inputs":[{"type":"address","name":"newOwner","internalType":"address"}]}]
Contract Creation Code
0x608060405234801562000010575f80fd5b5060405162002fc538038062002fc5833981016040819052620000339162000686565b336040518060400160405280600a81526020016923a7a0a6102a37b5b2b760b11b8152506040518060400160405280600481526020016311d3d05360e21b815250816003908162000085919062000761565b50600462000094828262000761565b5050506001600160a01b038116620000c657604051631e4fbdf760e01b81525f60048201526024015b60405180910390fd5b620000d18162000282565b5060016006556001600160a01b038416620000ff5760405163d92e233d60e01b815260040160405180910390fd5b60648211156200012257604051638f29344360e01b815260040160405180910390fd5b60c88111156200014557604051638f29344360e01b815260040160405180910390fd5b600980546001600160a01b0319166001600160a01b03868116919091179091558316156200022757600780546001600160a01b0319166001600160a01b0385169081179091556040805163c45a015560e01b8152905185929163c45a01559160048083019260209291908290030181865afa158015620001c7573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190620001ed91906200082d565b600880546001600160a01b0319166001600160a01b03928316179055600754165f908152600e60205260409020805460ff19166001179055505b600a829055600b819055335f818152600e60205260408082208054600160ff199182168117909255308452919092208054909116909117905562000278906b033b2e3c9fd0803ce8000000620002d3565b50505050620008d0565b600580546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0905f90a35050565b6001600160a01b038216620002fe5760405163ec442f0560e01b81525f6004820152602401620000bd565b6200030b5f83836200030f565b5050565b6001600160a01b03831615806200032d57506001600160a01b038216155b15620003455762000340838383620004c8565b505050565b5f6200035184620005f7565b80156200037657506001600160a01b0383165f908152600e602052604090205460ff16155b90505f6200038484620005f7565b8015620003a957506001600160a01b0385165f908152600e602052604090205460ff16155b9050811562000438575f6103e8600a5485620003c6919062000864565b620003d2919062000884565b9050620003ec8686620003e68488620008a4565b620004c8565b620003f9863083620004c8565b60408051828152600160208201526001600160a01b0380891692908816915f8051602062002fa583398151915291015b60405180910390a350620004c1565b8015620004b4575f6103e8600b548562000453919062000864565b6200045f919062000884565b9050620004738686620003e68488620008a4565b62000480863083620004c8565b604080518281525f60208201526001600160a01b0380881692908916915f8051602062002fa5833981519152910162000429565b620004c1858585620004c8565b5050505050565b6001600160a01b038316620004f6578060025f828254620004ea9190620008ba565b90915550620005689050565b6001600160a01b0383165f90815260208190526040902054818110156200054a5760405163391434e360e21b81526001600160a01b03851660048201526024810182905260448101839052606401620000bd565b6001600160a01b0384165f9081526020819052604090209082900390555b6001600160a01b0382166200058657600280548290039055620005a4565b6001600160a01b0382165f9081526020819052604090208054820190555b816001600160a01b0316836001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef83604051620005ea91815260200190565b60405180910390a3505050565b5f816001600160a01b03163b5f036200061157505f919050565b6001600160a01b0382165f908152600c602052604090205460ff16156200063a57506001919050565b6001600160a01b0382165f908152600d602052604090205460ff16156200066357506001919050565b505f919050565b80516001600160a01b038116811462000681575f80fd5b919050565b5f805f80608085870312156200069a575f80fd5b620006a5856200066a565b9350620006b5602086016200066a565b6040860151606090960151949790965092505050565b634e487b7160e01b5f52604160045260245ffd5b600181811c90821680620006f457607f821691505b6020821081036200071357634e487b7160e01b5f52602260045260245ffd5b50919050565b601f8211156200034057805f5260205f20601f840160051c81016020851015620007405750805b601f840160051c820191505b81811015620004c1575f81556001016200074c565b81516001600160401b038111156200077d576200077d620006cb565b62000795816200078e8454620006df565b8462000719565b602080601f831160018114620007cb575f8415620007b35750858301515b5f19600386901b1c1916600185901b17855562000825565b5f85815260208120601f198616915b82811015620007fb57888601518255948401946001909101908401620007da565b50858210156200081957878501515f19600388901b60f8161c191681555b505060018460011b0185555b505050505050565b5f602082840312156200083e575f80fd5b62000849826200066a565b9392505050565b634e487b7160e01b5f52601160045260245ffd5b80820281158282048414176200087e576200087e62000850565b92915050565b5f826200089f57634e487b7160e01b5f52601260045260245ffd5b500490565b818103818111156200087e576200087e62000850565b808201808211156200087e576200087e62000850565b6126c780620008de5f395ff3fe608060405260043610610283575f3560e01c806385535cc511610155578063c76791d3116100be578063df8408fe11610078578063df8408fe14610799578063e3369d68146107b8578063e5eba812146107e6578063e7cb0df914610766578063f2fde38b14610805578063f887ea4014610824575f80fd5b8063c76791d3146106fe578063cc1776d31461071d578063cc3c74a114610732578063d27567f214610747578063db03cdd714610766578063dd62ed3e1461077a575f80fd5b8063a51c9ace1161010f578063a51c9ace14610659578063a9059cbb1461066e578063ab0b13921461068d578063b0bc85de146106ac578063c31fd6aa146106c0578063c45a0155146106df575f80fd5b806385535cc51461059457806385ecafd7146105b35780638aa76544146105e15780638da5cb5b146106005780638e358d021461063157806395d89b4114610645575f80fd5b80633de7f844116101f757806354fd4d50116101b157806354fd4d50146104ba5780635df45a37146104ee578063629c92271461050e57806370a082311461052d578063715018a61461056157806379cc679014610575575f80fd5b80633de7f844146103e957806341cb87fc146103fd57806342966c681461041c578063430694cf1461043b5780634623c81e1461048f5780634f7041a5146104a5575f80fd5b806320733bc01161024857806320733bc01461033a57806323b872dd1461034e578063252d723a1461036d57806328d6793814610381578063313ce567146103a05780633652ab81146103bb575f80fd5b806306fdde031461028e578063095ea7b3146102b8578063153a1f3e146102e757806318160ddd146103085780631b4c695b14610326575f80fd5b3661028a57005b5f80fd5b348015610299575f80fd5b506102a2610843565b6040516102af919061224e565b60405180910390f35b3480156102c3575f80fd5b506102d76102d23660046122ae565b6108d3565b60405190151581526020016102af565b3480156102f2575f80fd5b50610306610301366004612320565b6108ec565b005b348015610313575f80fd5b506002545b6040519081526020016102af565b348015610331575f80fd5b50601054610318565b348015610345575f80fd5b50610306610b02565b348015610359575f80fd5b506102d7610368366004612387565b610d8f565b348015610378575f80fd5b50600a54610318565b34801561038c575f80fd5b5061030661039b3660046123c5565b610db2565b3480156103ab575f80fd5b50604051601281526020016102af565b3480156103c6575f80fd5b506102d76103d5366004612400565b600d6020525f908152604090205460ff1681565b3480156103f4575f80fd5b50610318606481565b348015610408575f80fd5b50610306610417366004612400565b610e40565b348015610427575f80fd5b5061030661043636600461241b565b611001565b348015610446575f80fd5b5061045a61045536600461241b565b611043565b6040516102af919081518152602080830151151590820152604080830151908201526060918201519181019190915260800190565b34801561049a575f80fd5b506103186202a30081565b3480156104b0575f80fd5b50610318600a5481565b3480156104c5575f80fd5b5060408051808201909152600c81526b476f616c546f6b656e20763160a01b60208201526102a2565b3480156104f9575f80fd5b50305f90815260208190526040902054610318565b348015610519575f80fd5b50610306610528366004612432565b6110b5565b348015610538575f80fd5b50610318610547366004612400565b6001600160a01b03165f9081526020819052604090205490565b34801561056c575f80fd5b50610306611165565b348015610580575f80fd5b5061030661058f3660046122ae565b611176565b34801561059f575f80fd5b506103066105ae366004612400565b61120a565b3480156105be575f80fd5b506102d76105cd366004612400565b600e6020525f908152604090205460ff1681565b3480156105ec575f80fd5b506103066105fb36600461241b565b61128a565b34801561060b575f80fd5b506005546001600160a01b03165b6040516001600160a01b0390911681526020016102af565b34801561063c575f80fd5b50610306611396565b348015610650575f80fd5b506102a2611537565b348015610664575f80fd5b506103186103e881565b348015610679575f80fd5b506102d76106883660046122ae565b611546565b348015610698575f80fd5b506103066106a736600461241b565b611553565b3480156106b7575f80fd5b50600b54610318565b3480156106cb575f80fd5b506102d76106da36600461241b565b6117d8565b3480156106ea575f80fd5b50600854610619906001600160a01b031681565b348015610709575f80fd5b50610306610718366004612471565b61181c565b348015610728575f80fd5b50610318600b5481565b34801561073d575f80fd5b5061031860105481565b348015610752575f80fd5b50600954610619906001600160a01b031681565b348015610771575f80fd5b5061031860c881565b348015610785575f80fd5b50610318610794366004612471565b61193f565b3480156107a4575f80fd5b506103066107b33660046123c5565b611969565b3480156107c3575f80fd5b506102d76107d2366004612400565b600c6020525f908152604090205460ff1681565b3480156107f1575f80fd5b5061030661080036600461249d565b6119dc565b348015610810575f80fd5b5061030661081f366004612400565b611b5a565b34801561082f575f80fd5b50600754610619906001600160a01b031681565b606060038054610852906124bd565b80601f016020809104026020016040519081016040528092919081815260200182805461087e906124bd565b80156108c95780601f106108a0576101008083540402835291602001916108c9565b820191905f5260205f20905b8154815290600101906020018083116108ac57829003601f168201915b5050505050905090565b5f336108e0818585611c4d565b60019150505b92915050565b82811461090f576040516001621398b960e31b0319815260040160405180910390fd5b60c8831115610931576040516367267fc360e01b815260040160405180910390fd5b5f8390036109525760405163a600c81d60e01b815260040160405180910390fd5b5f805b8281101561098b5783838281811061096f5761096f6124f5565b9050602002013582610981919061251d565b9150600101610955565b50335f908152602081905260409020548111156109bb576040516304cb6d2160e01b815260040160405180910390fd5b5f5b84811015610a69575f8686838181106109d8576109d86124f5565b90506020020160208101906109ed9190612400565b6001600160a01b031603610a1457604051633a954ecd60e21b815260040160405180910390fd5b610a43868683818110610a2957610a296124f5565b9050602002016020810190610a3e9190612400565b611c5a565b15610a61576040516308b430e560e31b815260040160405180910390fd5b6001016109bd565b505f5b84811015610ac557610abc868683818110610a8957610a896124f5565b9050602002016020810190610a9e9190612400565b858584818110610ab057610ab06124f5565b90506020020135611546565b50600101610a6c565b5060405184815233907fbc191cb2bd38ab4390b0c7bf04e842977c8d8fd56f6a52582c3a5438aded99e89060200160405180910390a25050505050565b610b0a611cca565b6007546001600160a01b0316610b335760405163d92e233d60e01b815260040160405180910390fd5b305f9081526020819052604081205490819003610b63576040516302f24bf360e51b815260040160405180910390fd5b600754610b7b9030906001600160a01b031683611c4d565b6040805160028082526060820183525f9260208301908036833701905050905030815f81518110610bae57610bae6124f5565b6001600160a01b03928316602091820292909201810191909152600754604080516315ab88c960e31b81529051919093169263ad5c46489260048083019391928290030181865afa158015610c05573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190610c299190612530565b81600181518110610c3c57610c3c6124f5565b6001600160a01b03928316602091820292909201015260075447911663791ac947845f8530610c6d4261012c61251d565b6040518663ffffffff1660e01b8152600401610c8d95949392919061258e565b5f604051808303815f87803b158015610ca4575f80fd5b505af1158015610cb6573d5f803e3d5ffd5b505050505f8147610cc791906125c9565b6009546040519192505f916001600160a01b039091169083908381818185875af1925050503d805f8114610d16576040519150601f19603f3d011682016040523d82523d5f602084013e610d1b565b606091505b5050905080610d455760405162461bcd60e51b8152600401610d3c906125dc565b60405180910390fd5b60408051868152602081018490527f805abfeabf00095a4501c6a90059e54d98d892561289820deaef88e225fb5539910160405180910390a15050505050610d8d6001600655565b565b5f33610d9c858285611cf4565b610da7858585611d58565b506001949350505050565b610dba611db5565b6001600160a01b038216610de15760405163d92e233d60e01b815260040160405180910390fd5b6001600160a01b0382165f818152600c6020908152604091829020805460ff191685151590811790915591519182527f28f7e828bdf5fa28ba8db28a20e7f4c0c8c69dce50783d4cdbe0e2b5e30329ce91015b60405180910390a25050565b610e48611db5565b6001600160a01b038116610e6f5760405163d92e233d60e01b815260040160405180910390fd5b6007546001600160a01b03168015801590610ea157506001600160a01b0381165f908152600e602052604090205460ff165b15610ee5576001600160a01b0381165f818152600e60209081526040808320805460ff19169055519182525f80516020612672833981519152910160405180910390a25b600780546001600160a01b0319166001600160a01b0384169081179091556040805163c45a015560e01b8152905184929163c45a01559160048083019260209291908290030181865afa158015610f3e573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190610f629190612530565b600880546001600160a01b0319166001600160a01b0392831617905583165f818152600e6020908152604091829020805460ff1916600190811790915591519182525f80516020612672833981519152910160405180910390a2826001600160a01b0316826001600160a01b03167fba8909f452a8d4e389cf607ef89115b537d1aae7b3519cd1ee95100864b545e460405160405180910390a3505050565b61100b3382611de2565b60405181815233907ffd38818f5291bf0bb3a2a48aadc06ba8757865d1dabd804585338aab3009dcb69060200160405180910390a250565b61106c60405180608001604052805f81526020015f151581526020015f81526020015f81525090565b505f908152600f6020908152604091829020825160808101845281548152600182015460ff16151592810192909252600281015492820192909252600390910154606082015290565b6110bd611db5565b5f5b81811015611160575f8383838181106110da576110da6124f5565b602090810292909201355f818152600f909352604090922060018101549293509160ff16159050611156575f828152600f602052604080822082815560018101805460ff19169055600281018390556003018290555183917fe85a8685fbe12614c81241cf7c6a07578ec2281627f81f3de92ab12900d9f46c91a25b50506001016110bf565b505050565b61116d611db5565b610d8d5f611e16565b5f611181833361193f565b9050818110156111a457604051631c57b09b60e21b815260040160405180910390fd5b6111b883336111b385856125c9565b611c4d565b6111c28383611de2565b826001600160a01b03167ffd38818f5291bf0bb3a2a48aadc06ba8757865d1dabd804585338aab3009dcb6836040516111fd91815260200190565b60405180910390a2505050565b611212611db5565b6001600160a01b0381166112395760405163d92e233d60e01b815260040160405180910390fd5b600980546001600160a01b038381166001600160a01b0319831681179093556040519116919082907fa4f45a63389e7031375b7e4422cccea56ab403ecedbd3ce1f0587acaa1999ae3905f90a35050565b611292611db5565b5f818152600f6020526040812080549091036112c157604051636ce3c70160e11b815260040160405180910390fd5b600181015460ff16156112e7576040516351618d5360e01b815260040160405180910390fd5b80546112f7906202a3009061251d565b4210156113175760405163621e25c360e01b815260040160405180910390fd5b6001818101805460ff19169091179055600a8054600b8054600285018054909455600385015491829055925460408051848152602081018690529081019190915260608101919091529091907f42f773a26531834b9d9fb1891f7bf40fc29c7c0fa47165b80c9ac2c1ff1b80c39060800160405180910390a150505050565b61139e611db5565b6007546001600160a01b03166113c75760405163d92e233d60e01b815260040160405180910390fd5b6008546001600160a01b03166113f05760405163d92e233d60e01b815260040160405180910390fd5b600754604080516315ab88c960e31b815290515f926001600160a01b03169163ad5c46489160048083019260209291908290030181865afa158015611437573d5f803e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061145b9190612530565b60085460405163e6a4390560e01b81523060048201526001600160a01b0380841660248301529293505f929091169063e6a4390590604401602060405180830381865afa1580156114ae573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906114d29190612530565b90506001600160a01b03811615611533576001600160a01b038082165f818152600d6020526040808220805460ff1916600117905551928516923092917fc5acef6ec6431321979d2ae107dfeeccc0f86af21a724aeece84113be38e52eb91a45b5050565b606060048054610852906124bd565b5f336108e0818585611d58565b61155b611cca565b6007546001600160a01b03166115845760405163d92e233d60e01b815260040160405180910390fd5b305f90815260208190526040812054908190036115b4576040516302f24bf360e51b815260040160405180910390fd5b6007546115cc9030906001600160a01b031683611c4d565b6040805160028082526060820183525f9260208301908036833701905050905030815f815181106115ff576115ff6124f5565b6001600160a01b03928316602091820292909201810191909152600754604080516315ab88c960e31b81529051919093169263ad5c46489260048083019391928290030181865afa158015611656573d5f803e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061167a9190612530565b8160018151811061168d5761168d6124f5565b6001600160a01b03928316602091820292909201015260075447911663791ac947848685306116be4261012c61251d565b6040518663ffffffff1660e01b81526004016116de95949392919061258e565b5f604051808303815f87803b1580156116f5575f80fd5b505af1158015611707573d5f803e3d5ffd5b505050505f814761171891906125c9565b6009546040519192505f916001600160a01b039091169083908381818185875af1925050503d805f8114611767576040519150601f19603f3d011682016040523d82523d5f602084013e61176c565b606091505b505090508061178d5760405162461bcd60e51b8152600401610d3c906125dc565b60408051868152602081018490527f805abfeabf00095a4501c6a90059e54d98d892561289820deaef88e225fb5539910160405180910390a150505050506117d56001600655565b50565b5f818152600f602052604081208054158015906117fa5750600181015460ff16155b801561181557508054611811906202a3009061251d565b4210155b9392505050565b611824611db5565b6008546001600160a01b031661184d5760405163d92e233d60e01b815260040160405180910390fd5b60085460405163e6a4390560e01b81526001600160a01b03848116600483015283811660248301525f92169063e6a4390590604401602060405180830381865afa15801561189d573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906118c19190612530565b90506001600160a01b0381166118ea5760405163d719ab6960e01b815260040160405180910390fd5b6001600160a01b038082165f818152600d6020526040808220805460ff191660011790555185841693871692917fc5acef6ec6431321979d2ae107dfeeccc0f86af21a724aeece84113be38e52eb91a4505050565b6001600160a01b039182165f90815260016020908152604080832093909416825291909152205490565b611971611db5565b6001600160a01b0382166119985760405163d92e233d60e01b815260040160405180910390fd5b6001600160a01b0382165f818152600e6020908152604091829020805460ff191685151590811790915591519182525f805160206126728339815191529101610e34565b6119e4611db5565b6064821115611a0657604051638f29344360e01b815260040160405180910390fd5b60c8811115611a2857604051638f29344360e01b815260040160405180910390fd5b6010805460408051602080820187905281830186905260608201849052336080808401919091528351808403909101815260a09092019092528051910120915f611a7183612623565b909155505060408051608081018252428082525f602080840182815284860189815260608087018a8152898652600f85529488902096518755915160018701805460ff19169115159190911790555160028601559151600390940193909355835191825291810186905291820184905282917f15bc7c7565a4550e787e85a5260e4c48610c8bce561b8d638d5d4a2498cd8426910160405180910390a2807f0482e27a97166db6a21080394f4e48f0a8fe073d1f3d771f60d1e4e984cd391d8484611b3f6202a3004261251d565b604080519384526020840192909252908201526060016111fd565b611b62611db5565b6001600160a01b038116611b895760405163d92e233d60e01b815260040160405180910390fd5b5f611b9c6005546001600160a01b031690565b6001600160a01b0381165f908152600e602052604090205490915060ff1615611bfe576001600160a01b0381165f818152600e60209081526040808320805460ff19169055519182525f80516020612672833981519152910160405180910390a25b6001600160a01b0382165f818152600e6020908152604091829020805460ff1916600190811790915591519182525f80516020612672833981519152910160405180910390a261153382611e67565b6111608383836001611ea1565b5f816001600160a01b03163b5f03611c7357505f919050565b6001600160a01b0382165f908152600c602052604090205460ff1615611c9b57506001919050565b6001600160a01b0382165f908152600d602052604090205460ff1615611cc357506001919050565b505f919050565b600260065403611ced57604051633ee5aeb560e01b815260040160405180910390fd5b6002600655565b5f611cff848461193f565b90505f19811015611d525781811015611d4457604051637dc7a0d960e11b81526001600160a01b03841660048201526024810182905260448101839052606401610d3c565b611d5284848484035f611ea1565b50505050565b6001600160a01b038316611d8157604051634b637e8f60e11b81525f6004820152602401610d3c565b6001600160a01b038216611daa5760405163ec442f0560e01b81525f6004820152602401610d3c565b611160838383611f73565b6005546001600160a01b03163314610d8d5760405163118cdaa760e01b8152336004820152602401610d3c565b6001600160a01b038216611e0b57604051634b637e8f60e11b81525f6004820152602401610d3c565b611533825f83611f73565b600580546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0905f90a35050565b611e6f611db5565b6001600160a01b038116611e9857604051631e4fbdf760e01b81525f6004820152602401610d3c565b6117d581611e16565b6001600160a01b038416611eca5760405163e602df0560e01b81525f6004820152602401610d3c565b6001600160a01b038316611ef357604051634a1406b160e11b81525f6004820152602401610d3c565b6001600160a01b038085165f9081526001602090815260408083209387168352929052208290558015611d5257826001600160a01b0316846001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92584604051611f6591815260200190565b60405180910390a350505050565b6001600160a01b0383161580611f9057506001600160a01b038216155b15611fa057611160838383612128565b5f611faa84611c5a565b8015611fce57506001600160a01b0383165f908152600e602052604090205460ff16155b90505f611fda84611c5a565b8015611ffe57506001600160a01b0385165f908152600e602052604090205460ff16155b90508115612093575f6103e8600a5485612018919061263b565b6120229190612652565b9050612038868661203384886125c9565b612128565b612043863083612128565b60408051828152600160208201526001600160a01b0380891692908816917f4a14a7d0e124e2f99023f368cf10cd8d400f821b69289115cefcadf07fbd8c9191015b60405180910390a350612121565b8015612116575f6103e8600b54856120ab919061263b565b6120b59190612652565b90506120c6868661203384886125c9565b6120d1863083612128565b604080518281525f60208201526001600160a01b0380881692908916917f4a14a7d0e124e2f99023f368cf10cd8d400f821b69289115cefcadf07fbd8c919101612085565b612121858585612128565b5050505050565b6001600160a01b038316612152578060025f828254612147919061251d565b909155506121c29050565b6001600160a01b0383165f90815260208190526040902054818110156121a45760405163391434e360e21b81526001600160a01b03851660048201526024810182905260448101839052606401610d3c565b6001600160a01b0384165f9081526020819052604090209082900390555b6001600160a01b0382166121de576002805482900390556121fc565b6001600160a01b0382165f9081526020819052604090208054820190555b816001600160a01b0316836001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8360405161224191815260200190565b60405180910390a3505050565b5f602080835283518060208501525f5b8181101561227a5785810183015185820160400152820161225e565b505f604082860101526040601f19601f8301168501019250505092915050565b6001600160a01b03811681146117d5575f80fd5b5f80604083850312156122bf575f80fd5b82356122ca8161229a565b946020939093013593505050565b5f8083601f8401126122e8575f80fd5b50813567ffffffffffffffff8111156122ff575f80fd5b6020830191508360208260051b8501011115612319575f80fd5b9250929050565b5f805f8060408587031215612333575f80fd5b843567ffffffffffffffff8082111561234a575f80fd5b612356888389016122d8565b9096509450602087013591508082111561236e575f80fd5b5061237b878288016122d8565b95989497509550505050565b5f805f60608486031215612399575f80fd5b83356123a48161229a565b925060208401356123b48161229a565b929592945050506040919091013590565b5f80604083850312156123d6575f80fd5b82356123e18161229a565b9150602083013580151581146123f5575f80fd5b809150509250929050565b5f60208284031215612410575f80fd5b81356118158161229a565b5f6020828403121561242b575f80fd5b5035919050565b5f8060208385031215612443575f80fd5b823567ffffffffffffffff811115612459575f80fd5b612465858286016122d8565b90969095509350505050565b5f8060408385031215612482575f80fd5b823561248d8161229a565b915060208301356123f58161229a565b5f80604083850312156124ae575f80fd5b50508035926020909101359150565b600181811c908216806124d157607f821691505b6020821081036124ef57634e487b7160e01b5f52602260045260245ffd5b50919050565b634e487b7160e01b5f52603260045260245ffd5b634e487b7160e01b5f52601160045260245ffd5b808201808211156108e6576108e6612509565b5f60208284031215612540575f80fd5b81516118158161229a565b5f815180845260208085019450602084015f5b838110156125835781516001600160a01b03168752958201959082019060010161255e565b509495945050505050565b85815284602082015260a060408201525f6125ac60a083018661254b565b6001600160a01b0394909416606083015250608001529392505050565b818103818111156108e6576108e6612509565b60208082526027908201527f476f616c546f6b656e3a20424e42207472616e7366657220746f207661756c746040820152660819985a5b195960ca1b606082015260800190565b5f6001820161263457612634612509565b5060010190565b80820281158282048414176108e6576108e6612509565b5f8261266c57634e487b7160e01b5f52601260045260245ffd5b50049056fe567d369e9bbbf0ca3aabb9976ba5d311e9e83e4c63bbab2a4771335bb167f86fa2646970667358221220f9354363d87d1aafb17950d069ca0129a89c088686358b34839b241651f9d33b64736f6c634300081800334a14a7d0e124e2f99023f368cf10cd8d400f821b69289115cefcadf07fbd8c91000000000000000000000000de27dbd849e7fb3a852fb2e484681041d8f3aff5000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000320000000000000000000000000000000000000000000000000000000000000096
Deployed ByteCode
0x608060405260043610610283575f3560e01c806385535cc511610155578063c76791d3116100be578063df8408fe11610078578063df8408fe14610799578063e3369d68146107b8578063e5eba812146107e6578063e7cb0df914610766578063f2fde38b14610805578063f887ea4014610824575f80fd5b8063c76791d3146106fe578063cc1776d31461071d578063cc3c74a114610732578063d27567f214610747578063db03cdd714610766578063dd62ed3e1461077a575f80fd5b8063a51c9ace1161010f578063a51c9ace14610659578063a9059cbb1461066e578063ab0b13921461068d578063b0bc85de146106ac578063c31fd6aa146106c0578063c45a0155146106df575f80fd5b806385535cc51461059457806385ecafd7146105b35780638aa76544146105e15780638da5cb5b146106005780638e358d021461063157806395d89b4114610645575f80fd5b80633de7f844116101f757806354fd4d50116101b157806354fd4d50146104ba5780635df45a37146104ee578063629c92271461050e57806370a082311461052d578063715018a61461056157806379cc679014610575575f80fd5b80633de7f844146103e957806341cb87fc146103fd57806342966c681461041c578063430694cf1461043b5780634623c81e1461048f5780634f7041a5146104a5575f80fd5b806320733bc01161024857806320733bc01461033a57806323b872dd1461034e578063252d723a1461036d57806328d6793814610381578063313ce567146103a05780633652ab81146103bb575f80fd5b806306fdde031461028e578063095ea7b3146102b8578063153a1f3e146102e757806318160ddd146103085780631b4c695b14610326575f80fd5b3661028a57005b5f80fd5b348015610299575f80fd5b506102a2610843565b6040516102af919061224e565b60405180910390f35b3480156102c3575f80fd5b506102d76102d23660046122ae565b6108d3565b60405190151581526020016102af565b3480156102f2575f80fd5b50610306610301366004612320565b6108ec565b005b348015610313575f80fd5b506002545b6040519081526020016102af565b348015610331575f80fd5b50601054610318565b348015610345575f80fd5b50610306610b02565b348015610359575f80fd5b506102d7610368366004612387565b610d8f565b348015610378575f80fd5b50600a54610318565b34801561038c575f80fd5b5061030661039b3660046123c5565b610db2565b3480156103ab575f80fd5b50604051601281526020016102af565b3480156103c6575f80fd5b506102d76103d5366004612400565b600d6020525f908152604090205460ff1681565b3480156103f4575f80fd5b50610318606481565b348015610408575f80fd5b50610306610417366004612400565b610e40565b348015610427575f80fd5b5061030661043636600461241b565b611001565b348015610446575f80fd5b5061045a61045536600461241b565b611043565b6040516102af919081518152602080830151151590820152604080830151908201526060918201519181019190915260800190565b34801561049a575f80fd5b506103186202a30081565b3480156104b0575f80fd5b50610318600a5481565b3480156104c5575f80fd5b5060408051808201909152600c81526b476f616c546f6b656e20763160a01b60208201526102a2565b3480156104f9575f80fd5b50305f90815260208190526040902054610318565b348015610519575f80fd5b50610306610528366004612432565b6110b5565b348015610538575f80fd5b50610318610547366004612400565b6001600160a01b03165f9081526020819052604090205490565b34801561056c575f80fd5b50610306611165565b348015610580575f80fd5b5061030661058f3660046122ae565b611176565b34801561059f575f80fd5b506103066105ae366004612400565b61120a565b3480156105be575f80fd5b506102d76105cd366004612400565b600e6020525f908152604090205460ff1681565b3480156105ec575f80fd5b506103066105fb36600461241b565b61128a565b34801561060b575f80fd5b506005546001600160a01b03165b6040516001600160a01b0390911681526020016102af565b34801561063c575f80fd5b50610306611396565b348015610650575f80fd5b506102a2611537565b348015610664575f80fd5b506103186103e881565b348015610679575f80fd5b506102d76106883660046122ae565b611546565b348015610698575f80fd5b506103066106a736600461241b565b611553565b3480156106b7575f80fd5b50600b54610318565b3480156106cb575f80fd5b506102d76106da36600461241b565b6117d8565b3480156106ea575f80fd5b50600854610619906001600160a01b031681565b348015610709575f80fd5b50610306610718366004612471565b61181c565b348015610728575f80fd5b50610318600b5481565b34801561073d575f80fd5b5061031860105481565b348015610752575f80fd5b50600954610619906001600160a01b031681565b348015610771575f80fd5b5061031860c881565b348015610785575f80fd5b50610318610794366004612471565b61193f565b3480156107a4575f80fd5b506103066107b33660046123c5565b611969565b3480156107c3575f80fd5b506102d76107d2366004612400565b600c6020525f908152604090205460ff1681565b3480156107f1575f80fd5b5061030661080036600461249d565b6119dc565b348015610810575f80fd5b5061030661081f366004612400565b611b5a565b34801561082f575f80fd5b50600754610619906001600160a01b031681565b606060038054610852906124bd565b80601f016020809104026020016040519081016040528092919081815260200182805461087e906124bd565b80156108c95780601f106108a0576101008083540402835291602001916108c9565b820191905f5260205f20905b8154815290600101906020018083116108ac57829003601f168201915b5050505050905090565b5f336108e0818585611c4d565b60019150505b92915050565b82811461090f576040516001621398b960e31b0319815260040160405180910390fd5b60c8831115610931576040516367267fc360e01b815260040160405180910390fd5b5f8390036109525760405163a600c81d60e01b815260040160405180910390fd5b5f805b8281101561098b5783838281811061096f5761096f6124f5565b9050602002013582610981919061251d565b9150600101610955565b50335f908152602081905260409020548111156109bb576040516304cb6d2160e01b815260040160405180910390fd5b5f5b84811015610a69575f8686838181106109d8576109d86124f5565b90506020020160208101906109ed9190612400565b6001600160a01b031603610a1457604051633a954ecd60e21b815260040160405180910390fd5b610a43868683818110610a2957610a296124f5565b9050602002016020810190610a3e9190612400565b611c5a565b15610a61576040516308b430e560e31b815260040160405180910390fd5b6001016109bd565b505f5b84811015610ac557610abc868683818110610a8957610a896124f5565b9050602002016020810190610a9e9190612400565b858584818110610ab057610ab06124f5565b90506020020135611546565b50600101610a6c565b5060405184815233907fbc191cb2bd38ab4390b0c7bf04e842977c8d8fd56f6a52582c3a5438aded99e89060200160405180910390a25050505050565b610b0a611cca565b6007546001600160a01b0316610b335760405163d92e233d60e01b815260040160405180910390fd5b305f9081526020819052604081205490819003610b63576040516302f24bf360e51b815260040160405180910390fd5b600754610b7b9030906001600160a01b031683611c4d565b6040805160028082526060820183525f9260208301908036833701905050905030815f81518110610bae57610bae6124f5565b6001600160a01b03928316602091820292909201810191909152600754604080516315ab88c960e31b81529051919093169263ad5c46489260048083019391928290030181865afa158015610c05573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190610c299190612530565b81600181518110610c3c57610c3c6124f5565b6001600160a01b03928316602091820292909201015260075447911663791ac947845f8530610c6d4261012c61251d565b6040518663ffffffff1660e01b8152600401610c8d95949392919061258e565b5f604051808303815f87803b158015610ca4575f80fd5b505af1158015610cb6573d5f803e3d5ffd5b505050505f8147610cc791906125c9565b6009546040519192505f916001600160a01b039091169083908381818185875af1925050503d805f8114610d16576040519150601f19603f3d011682016040523d82523d5f602084013e610d1b565b606091505b5050905080610d455760405162461bcd60e51b8152600401610d3c906125dc565b60405180910390fd5b60408051868152602081018490527f805abfeabf00095a4501c6a90059e54d98d892561289820deaef88e225fb5539910160405180910390a15050505050610d8d6001600655565b565b5f33610d9c858285611cf4565b610da7858585611d58565b506001949350505050565b610dba611db5565b6001600160a01b038216610de15760405163d92e233d60e01b815260040160405180910390fd5b6001600160a01b0382165f818152600c6020908152604091829020805460ff191685151590811790915591519182527f28f7e828bdf5fa28ba8db28a20e7f4c0c8c69dce50783d4cdbe0e2b5e30329ce91015b60405180910390a25050565b610e48611db5565b6001600160a01b038116610e6f5760405163d92e233d60e01b815260040160405180910390fd5b6007546001600160a01b03168015801590610ea157506001600160a01b0381165f908152600e602052604090205460ff165b15610ee5576001600160a01b0381165f818152600e60209081526040808320805460ff19169055519182525f80516020612672833981519152910160405180910390a25b600780546001600160a01b0319166001600160a01b0384169081179091556040805163c45a015560e01b8152905184929163c45a01559160048083019260209291908290030181865afa158015610f3e573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190610f629190612530565b600880546001600160a01b0319166001600160a01b0392831617905583165f818152600e6020908152604091829020805460ff1916600190811790915591519182525f80516020612672833981519152910160405180910390a2826001600160a01b0316826001600160a01b03167fba8909f452a8d4e389cf607ef89115b537d1aae7b3519cd1ee95100864b545e460405160405180910390a3505050565b61100b3382611de2565b60405181815233907ffd38818f5291bf0bb3a2a48aadc06ba8757865d1dabd804585338aab3009dcb69060200160405180910390a250565b61106c60405180608001604052805f81526020015f151581526020015f81526020015f81525090565b505f908152600f6020908152604091829020825160808101845281548152600182015460ff16151592810192909252600281015492820192909252600390910154606082015290565b6110bd611db5565b5f5b81811015611160575f8383838181106110da576110da6124f5565b602090810292909201355f818152600f909352604090922060018101549293509160ff16159050611156575f828152600f602052604080822082815560018101805460ff19169055600281018390556003018290555183917fe85a8685fbe12614c81241cf7c6a07578ec2281627f81f3de92ab12900d9f46c91a25b50506001016110bf565b505050565b61116d611db5565b610d8d5f611e16565b5f611181833361193f565b9050818110156111a457604051631c57b09b60e21b815260040160405180910390fd5b6111b883336111b385856125c9565b611c4d565b6111c28383611de2565b826001600160a01b03167ffd38818f5291bf0bb3a2a48aadc06ba8757865d1dabd804585338aab3009dcb6836040516111fd91815260200190565b60405180910390a2505050565b611212611db5565b6001600160a01b0381166112395760405163d92e233d60e01b815260040160405180910390fd5b600980546001600160a01b038381166001600160a01b0319831681179093556040519116919082907fa4f45a63389e7031375b7e4422cccea56ab403ecedbd3ce1f0587acaa1999ae3905f90a35050565b611292611db5565b5f818152600f6020526040812080549091036112c157604051636ce3c70160e11b815260040160405180910390fd5b600181015460ff16156112e7576040516351618d5360e01b815260040160405180910390fd5b80546112f7906202a3009061251d565b4210156113175760405163621e25c360e01b815260040160405180910390fd5b6001818101805460ff19169091179055600a8054600b8054600285018054909455600385015491829055925460408051848152602081018690529081019190915260608101919091529091907f42f773a26531834b9d9fb1891f7bf40fc29c7c0fa47165b80c9ac2c1ff1b80c39060800160405180910390a150505050565b61139e611db5565b6007546001600160a01b03166113c75760405163d92e233d60e01b815260040160405180910390fd5b6008546001600160a01b03166113f05760405163d92e233d60e01b815260040160405180910390fd5b600754604080516315ab88c960e31b815290515f926001600160a01b03169163ad5c46489160048083019260209291908290030181865afa158015611437573d5f803e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061145b9190612530565b60085460405163e6a4390560e01b81523060048201526001600160a01b0380841660248301529293505f929091169063e6a4390590604401602060405180830381865afa1580156114ae573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906114d29190612530565b90506001600160a01b03811615611533576001600160a01b038082165f818152600d6020526040808220805460ff1916600117905551928516923092917fc5acef6ec6431321979d2ae107dfeeccc0f86af21a724aeece84113be38e52eb91a45b5050565b606060048054610852906124bd565b5f336108e0818585611d58565b61155b611cca565b6007546001600160a01b03166115845760405163d92e233d60e01b815260040160405180910390fd5b305f90815260208190526040812054908190036115b4576040516302f24bf360e51b815260040160405180910390fd5b6007546115cc9030906001600160a01b031683611c4d565b6040805160028082526060820183525f9260208301908036833701905050905030815f815181106115ff576115ff6124f5565b6001600160a01b03928316602091820292909201810191909152600754604080516315ab88c960e31b81529051919093169263ad5c46489260048083019391928290030181865afa158015611656573d5f803e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061167a9190612530565b8160018151811061168d5761168d6124f5565b6001600160a01b03928316602091820292909201015260075447911663791ac947848685306116be4261012c61251d565b6040518663ffffffff1660e01b81526004016116de95949392919061258e565b5f604051808303815f87803b1580156116f5575f80fd5b505af1158015611707573d5f803e3d5ffd5b505050505f814761171891906125c9565b6009546040519192505f916001600160a01b039091169083908381818185875af1925050503d805f8114611767576040519150601f19603f3d011682016040523d82523d5f602084013e61176c565b606091505b505090508061178d5760405162461bcd60e51b8152600401610d3c906125dc565b60408051868152602081018490527f805abfeabf00095a4501c6a90059e54d98d892561289820deaef88e225fb5539910160405180910390a150505050506117d56001600655565b50565b5f818152600f602052604081208054158015906117fa5750600181015460ff16155b801561181557508054611811906202a3009061251d565b4210155b9392505050565b611824611db5565b6008546001600160a01b031661184d5760405163d92e233d60e01b815260040160405180910390fd5b60085460405163e6a4390560e01b81526001600160a01b03848116600483015283811660248301525f92169063e6a4390590604401602060405180830381865afa15801561189d573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906118c19190612530565b90506001600160a01b0381166118ea5760405163d719ab6960e01b815260040160405180910390fd5b6001600160a01b038082165f818152600d6020526040808220805460ff191660011790555185841693871692917fc5acef6ec6431321979d2ae107dfeeccc0f86af21a724aeece84113be38e52eb91a4505050565b6001600160a01b039182165f90815260016020908152604080832093909416825291909152205490565b611971611db5565b6001600160a01b0382166119985760405163d92e233d60e01b815260040160405180910390fd5b6001600160a01b0382165f818152600e6020908152604091829020805460ff191685151590811790915591519182525f805160206126728339815191529101610e34565b6119e4611db5565b6064821115611a0657604051638f29344360e01b815260040160405180910390fd5b60c8811115611a2857604051638f29344360e01b815260040160405180910390fd5b6010805460408051602080820187905281830186905260608201849052336080808401919091528351808403909101815260a09092019092528051910120915f611a7183612623565b909155505060408051608081018252428082525f602080840182815284860189815260608087018a8152898652600f85529488902096518755915160018701805460ff19169115159190911790555160028601559151600390940193909355835191825291810186905291820184905282917f15bc7c7565a4550e787e85a5260e4c48610c8bce561b8d638d5d4a2498cd8426910160405180910390a2807f0482e27a97166db6a21080394f4e48f0a8fe073d1f3d771f60d1e4e984cd391d8484611b3f6202a3004261251d565b604080519384526020840192909252908201526060016111fd565b611b62611db5565b6001600160a01b038116611b895760405163d92e233d60e01b815260040160405180910390fd5b5f611b9c6005546001600160a01b031690565b6001600160a01b0381165f908152600e602052604090205490915060ff1615611bfe576001600160a01b0381165f818152600e60209081526040808320805460ff19169055519182525f80516020612672833981519152910160405180910390a25b6001600160a01b0382165f818152600e6020908152604091829020805460ff1916600190811790915591519182525f80516020612672833981519152910160405180910390a261153382611e67565b6111608383836001611ea1565b5f816001600160a01b03163b5f03611c7357505f919050565b6001600160a01b0382165f908152600c602052604090205460ff1615611c9b57506001919050565b6001600160a01b0382165f908152600d602052604090205460ff1615611cc357506001919050565b505f919050565b600260065403611ced57604051633ee5aeb560e01b815260040160405180910390fd5b6002600655565b5f611cff848461193f565b90505f19811015611d525781811015611d4457604051637dc7a0d960e11b81526001600160a01b03841660048201526024810182905260448101839052606401610d3c565b611d5284848484035f611ea1565b50505050565b6001600160a01b038316611d8157604051634b637e8f60e11b81525f6004820152602401610d3c565b6001600160a01b038216611daa5760405163ec442f0560e01b81525f6004820152602401610d3c565b611160838383611f73565b6005546001600160a01b03163314610d8d5760405163118cdaa760e01b8152336004820152602401610d3c565b6001600160a01b038216611e0b57604051634b637e8f60e11b81525f6004820152602401610d3c565b611533825f83611f73565b600580546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0905f90a35050565b611e6f611db5565b6001600160a01b038116611e9857604051631e4fbdf760e01b81525f6004820152602401610d3c565b6117d581611e16565b6001600160a01b038416611eca5760405163e602df0560e01b81525f6004820152602401610d3c565b6001600160a01b038316611ef357604051634a1406b160e11b81525f6004820152602401610d3c565b6001600160a01b038085165f9081526001602090815260408083209387168352929052208290558015611d5257826001600160a01b0316846001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92584604051611f6591815260200190565b60405180910390a350505050565b6001600160a01b0383161580611f9057506001600160a01b038216155b15611fa057611160838383612128565b5f611faa84611c5a565b8015611fce57506001600160a01b0383165f908152600e602052604090205460ff16155b90505f611fda84611c5a565b8015611ffe57506001600160a01b0385165f908152600e602052604090205460ff16155b90508115612093575f6103e8600a5485612018919061263b565b6120229190612652565b9050612038868661203384886125c9565b612128565b612043863083612128565b60408051828152600160208201526001600160a01b0380891692908816917f4a14a7d0e124e2f99023f368cf10cd8d400f821b69289115cefcadf07fbd8c9191015b60405180910390a350612121565b8015612116575f6103e8600b54856120ab919061263b565b6120b59190612652565b90506120c6868661203384886125c9565b6120d1863083612128565b604080518281525f60208201526001600160a01b0380881692908916917f4a14a7d0e124e2f99023f368cf10cd8d400f821b69289115cefcadf07fbd8c919101612085565b612121858585612128565b5050505050565b6001600160a01b038316612152578060025f828254612147919061251d565b909155506121c29050565b6001600160a01b0383165f90815260208190526040902054818110156121a45760405163391434e360e21b81526001600160a01b03851660048201526024810182905260448101839052606401610d3c565b6001600160a01b0384165f9081526020819052604090209082900390555b6001600160a01b0382166121de576002805482900390556121fc565b6001600160a01b0382165f9081526020819052604090208054820190555b816001600160a01b0316836001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8360405161224191815260200190565b60405180910390a3505050565b5f602080835283518060208501525f5b8181101561227a5785810183015185820160400152820161225e565b505f604082860101526040601f19601f8301168501019250505092915050565b6001600160a01b03811681146117d5575f80fd5b5f80604083850312156122bf575f80fd5b82356122ca8161229a565b946020939093013593505050565b5f8083601f8401126122e8575f80fd5b50813567ffffffffffffffff8111156122ff575f80fd5b6020830191508360208260051b8501011115612319575f80fd5b9250929050565b5f805f8060408587031215612333575f80fd5b843567ffffffffffffffff8082111561234a575f80fd5b612356888389016122d8565b9096509450602087013591508082111561236e575f80fd5b5061237b878288016122d8565b95989497509550505050565b5f805f60608486031215612399575f80fd5b83356123a48161229a565b925060208401356123b48161229a565b929592945050506040919091013590565b5f80604083850312156123d6575f80fd5b82356123e18161229a565b9150602083013580151581146123f5575f80fd5b809150509250929050565b5f60208284031215612410575f80fd5b81356118158161229a565b5f6020828403121561242b575f80fd5b5035919050565b5f8060208385031215612443575f80fd5b823567ffffffffffffffff811115612459575f80fd5b612465858286016122d8565b90969095509350505050565b5f8060408385031215612482575f80fd5b823561248d8161229a565b915060208301356123f58161229a565b5f80604083850312156124ae575f80fd5b50508035926020909101359150565b600181811c908216806124d157607f821691505b6020821081036124ef57634e487b7160e01b5f52602260045260245ffd5b50919050565b634e487b7160e01b5f52603260045260245ffd5b634e487b7160e01b5f52601160045260245ffd5b808201808211156108e6576108e6612509565b5f60208284031215612540575f80fd5b81516118158161229a565b5f815180845260208085019450602084015f5b838110156125835781516001600160a01b03168752958201959082019060010161255e565b509495945050505050565b85815284602082015260a060408201525f6125ac60a083018661254b565b6001600160a01b0394909416606083015250608001529392505050565b818103818111156108e6576108e6612509565b60208082526027908201527f476f616c546f6b656e3a20424e42207472616e7366657220746f207661756c746040820152660819985a5b195960ca1b606082015260800190565b5f6001820161263457612634612509565b5060010190565b80820281158282048414176108e6576108e6612509565b5f8261266c57634e487b7160e01b5f52601260045260245ffd5b50049056fe567d369e9bbbf0ca3aabb9976ba5d311e9e83e4c63bbab2a4771335bb167f86fa2646970667358221220f9354363d87d1aafb17950d069ca0129a89c088686358b34839b241651f9d33b64736f6c63430008180033