- Contract name:
- Gaur
- Optimization enabled
- true
- Compiler version
- v0.6.12+commit.27d51765
- Optimization runs
- 25000
- EVM Version
- default
- Verified at
- 2021-12-21T16:19:14.703493Z
Constructor Arguments
000000000000000000000000000000000000000000000000000000000000000000000000000000000000000018f706ac35571ab7006151cd235a1fa5a00f94cc
Arg [0] (uint256) : 0
Arg [1] (address) : 0x18f706ac35571ab7006151cd235a1fa5a00f94cc
Contract source code
// SPDX-License-Identifier: MIT pragma solidity >=0.6.0 <0.8.0; /* * @dev Provides information about the current execution context, including the * sender of the transaction and its data. While these are generally available * via msg.sender and msg.data, they should not be accessed in such a direct * manner, since when dealing with GSN 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 payable) { return msg.sender; } function _msgData() internal view virtual returns (bytes memory) { this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691 return msg.data; } } interface IOracle { function update() external; function consult(address _token, uint256 _amountIn) external view returns (uint144 amountOut); function twap(address _token, uint256 _amountIn) external view returns (uint144 _amountOut); } /** * @dev Interface of the ERC20 standard as defined in the EIP. */ interface IERC20 { /** * @dev Returns the amount of tokens in existence. */ function totalSupply() external view returns (uint256); /** * @dev Returns the amount of tokens owned by `account`. */ function balanceOf(address account) external view returns (uint256); /** * @dev Moves `amount` tokens from the caller's account to `recipient`. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transfer(address recipient, uint256 amount) external returns (bool); /** * @dev Returns the remaining number of tokens that `spender` will be * allowed to spend on behalf of `owner` through {transferFrom}. This is * zero by default. * * This value changes when {approve} or {transferFrom} are called. */ function allowance(address owner, address spender) external view returns (uint256); /** * @dev Sets `amount` as the allowance of `spender` over the caller's tokens. * * Returns a boolean value indicating whether the operation succeeded. * * IMPORTANT: Beware that changing an allowance with this method brings the risk * that someone may use both the old and the new allowance by unfortunate * transaction ordering. One possible solution to mitigate this race * condition is to first reduce the spender's allowance to 0 and set the * desired value afterwards: * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * * Emits an {Approval} event. */ function approve(address spender, uint256 amount) external returns (bool); /** * @dev Moves `amount` tokens from `sender` to `recipient` using the * allowance mechanism. `amount` is then deducted from the caller's * allowance. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transferFrom(address sender, address recipient, uint256 amount) external returns (bool); /** * @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 Wrappers over Solidity's arithmetic operations with added overflow * checks. * * Arithmetic operations in Solidity wrap on overflow. This can easily result * in bugs, because programmers usually assume that an overflow raises an * error, which is the standard behavior in high level programming languages. * `SafeMath` restores this intuition by reverting the transaction when an * operation overflows. * * Using this library instead of the unchecked operations eliminates an entire * class of bugs, so it's recommended to use it always. */ library SafeMath { /** * @dev Returns the addition of two unsigned integers, with an overflow flag. * * _Available since v3.4._ */ function tryAdd(uint256 a, uint256 b) internal pure returns (bool, uint256) { uint256 c = a + b; if (c < a) return (false, 0); return (true, c); } /** * @dev Returns the substraction of two unsigned integers, with an overflow flag. * * _Available since v3.4._ */ function trySub(uint256 a, uint256 b) internal pure returns (bool, uint256) { if (b > a) return (false, 0); return (true, a - b); } /** * @dev Returns the multiplication of two unsigned integers, with an overflow flag. * * _Available since v3.4._ */ function tryMul(uint256 a, uint256 b) internal pure returns (bool, uint256) { // Gas optimization: this is cheaper than requiring 'a' not being zero, but the // benefit is lost if 'b' is also tested. // See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522 if (a == 0) return (true, 0); uint256 c = a * b; if (c / a != b) return (false, 0); return (true, c); } /** * @dev Returns the division of two unsigned integers, with a division by zero flag. * * _Available since v3.4._ */ function tryDiv(uint256 a, uint256 b) internal pure returns (bool, uint256) { if (b == 0) return (false, 0); return (true, a / b); } /** * @dev Returns the remainder of dividing two unsigned integers, with a division by zero flag. * * _Available since v3.4._ */ function tryMod(uint256 a, uint256 b) internal pure returns (bool, uint256) { if (b == 0) return (false, 0); return (true, a % b); } /** * @dev Returns the addition of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `+` operator. * * Requirements: * * - Addition cannot overflow. */ function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } /** * @dev Returns the subtraction of two unsigned integers, reverting on * overflow (when the result is negative). * * Counterpart to Solidity's `-` operator. * * Requirements: * * - Subtraction cannot overflow. */ function sub(uint256 a, uint256 b) internal pure returns (uint256) { require(b <= a, "SafeMath: subtraction overflow"); return a - b; } /** * @dev Returns the multiplication of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `*` operator. * * Requirements: * * - Multiplication cannot overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) return 0; uint256 c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } /** * @dev Returns the integer division of two unsigned integers, reverting on * division by zero. The result is rounded towards zero. * * Counterpart to Solidity's `/` operator. Note: this function uses a * `revert` opcode (which leaves remaining gas untouched) while Solidity * uses an invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function div(uint256 a, uint256 b) internal pure returns (uint256) { require(b > 0, "SafeMath: division by zero"); return a / b; } /** * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo), * reverting when dividing by zero. * * Counterpart to Solidity's `%` operator. This function uses a `revert` * opcode (which leaves remaining gas untouched) while Solidity uses an * invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function mod(uint256 a, uint256 b) internal pure returns (uint256) { require(b > 0, "SafeMath: modulo by zero"); return a % b; } /** * @dev Returns the subtraction of two unsigned integers, reverting with custom message on * overflow (when the result is negative). * * CAUTION: This function is deprecated because it requires allocating memory for the error * message unnecessarily. For custom revert reasons use {trySub}. * * Counterpart to Solidity's `-` operator. * * Requirements: * * - Subtraction cannot overflow. */ function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b <= a, errorMessage); return a - b; } /** * @dev Returns the integer division of two unsigned integers, reverting with custom message on * division by zero. The result is rounded towards zero. * * CAUTION: This function is deprecated because it requires allocating memory for the error * message unnecessarily. For custom revert reasons use {tryDiv}. * * Counterpart to Solidity's `/` operator. Note: this function uses a * `revert` opcode (which leaves remaining gas untouched) while Solidity * uses an invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b > 0, errorMessage); return a / b; } /** * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo), * reverting with custom message when dividing by zero. * * CAUTION: This function is deprecated because it requires allocating memory for the error * message unnecessarily. For custom revert reasons use {tryMod}. * * Counterpart to Solidity's `%` operator. This function uses a `revert` * opcode (which leaves remaining gas untouched) while Solidity uses an * invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b > 0, errorMessage); return a % b; } } /** * @dev Implementation of the {IERC20} interface. * * This implementation is agnostic to the way tokens are created. This means * that a supply mechanism has to be added in a derived contract using {_mint}. * For a generic mechanism see {ERC20PresetMinterPauser}. * * TIP: For a detailed writeup see our guide * https://forum.zeppelin.solutions/t/how-to-implement-erc20-supply-mechanisms/226[How * to implement supply mechanisms]. * * We have followed general OpenZeppelin guidelines: functions revert instead * of returning `false` on failure. This behavior is nonetheless conventional * and does not conflict with the expectations of ERC20 applications. * * Additionally, an {Approval} event is emitted on calls to {transferFrom}. * This allows applications to reconstruct the allowance for all accounts just * by listening to said events. Other implementations of the EIP may not emit * these events, as it isn't required by the specification. * * Finally, the non-standard {decreaseAllowance} and {increaseAllowance} * functions have been added to mitigate the well-known issues around setting * allowances. See {IERC20-approve}. */ contract ERC20 is Context, IERC20 { using SafeMath for uint256; mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowances; uint256 private _totalSupply; string private _name; string private _symbol; uint8 private _decimals; /** * @dev Sets the values for {name} and {symbol}, initializes {decimals} with * a default value of 18. * * To select a different value for {decimals}, use {_setupDecimals}. * * All three of these values are immutable: they can only be set once during * construction. */ constructor (string memory name_, string memory symbol_) public { _name = name_; _symbol = symbol_; _decimals = 18; } /** * @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 value {ERC20} uses, unless {_setupDecimals} is * called. * * 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 _decimals; } /** * @dev See {IERC20-totalSupply}. */ function totalSupply() public view virtual override returns (uint256) { return _totalSupply; } /** * @dev See {IERC20-balanceOf}. */ function balanceOf(address account) public view virtual override returns (uint256) { return _balances[account]; } /** * @dev See {IERC20-transfer}. * * Requirements: * * - `recipient` cannot be the zero address. * - the caller must have a balance of at least `amount`. */ function transfer(address recipient, uint256 amount) public virtual override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } /** * @dev See {IERC20-allowance}. */ function allowance(address owner, address spender) public view virtual override returns (uint256) { return _allowances[owner][spender]; } /** * @dev See {IERC20-approve}. * * Requirements: * * - `spender` cannot be the zero address. */ function approve(address spender, uint256 amount) public virtual override returns (bool) { _approve(_msgSender(), spender, amount); return true; } /** * @dev See {IERC20-transferFrom}. * * Emits an {Approval} event indicating the updated allowance. This is not * required by the EIP. See the note at the beginning of {ERC20}. * * Requirements: * * - `sender` and `recipient` cannot be the zero address. * - `sender` must have a balance of at least `amount`. * - the caller must have allowance for ``sender``'s tokens of at least * `amount`. */ function transferFrom(address sender, address recipient, uint256 amount) public virtual override returns (bool) { _transfer(sender, recipient, amount); _approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance")); return true; } /** * @dev Atomically increases the allowance granted to `spender` by the caller. * * This is an alternative to {approve} that can be used as a mitigation for * problems described in {IERC20-approve}. * * Emits an {Approval} event indicating the updated allowance. * * Requirements: * * - `spender` cannot be the zero address. */ function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) { _approve(_msgSender(), spender, _allowances[_msgSender()][spender].add(addedValue)); return true; } /** * @dev Atomically decreases the allowance granted to `spender` by the caller. * * This is an alternative to {approve} that can be used as a mitigation for * problems described in {IERC20-approve}. * * Emits an {Approval} event indicating the updated allowance. * * Requirements: * * - `spender` cannot be the zero address. * - `spender` must have allowance for the caller of at least * `subtractedValue`. */ function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) { _approve(_msgSender(), spender, _allowances[_msgSender()][spender].sub(subtractedValue, "ERC20: decreased allowance below zero")); return true; } /** * @dev Moves tokens `amount` from `sender` to `recipient`. * * This is internal function is equivalent to {transfer}, and can be used to * e.g. implement automatic token fees, slashing mechanisms, etc. * * Emits a {Transfer} event. * * Requirements: * * - `sender` cannot be the zero address. * - `recipient` cannot be the zero address. * - `sender` must have a balance of at least `amount`. */ function _transfer(address sender, address recipient, uint256 amount) internal virtual { require(sender != address(0), "ERC20: transfer from the zero address"); require(recipient != address(0), "ERC20: transfer to the zero address"); _beforeTokenTransfer(sender, recipient, amount); _balances[sender] = _balances[sender].sub(amount, "ERC20: transfer amount exceeds balance"); _balances[recipient] = _balances[recipient].add(amount); emit Transfer(sender, recipient, amount); } /** @dev Creates `amount` tokens and assigns them to `account`, increasing * the total supply. * * Emits a {Transfer} event with `from` set to the zero address. * * Requirements: * * - `to` cannot be the zero address. */ function _mint(address account, uint256 amount) internal virtual { require(account != address(0), "ERC20: mint to the zero address"); _beforeTokenTransfer(address(0), account, amount); _totalSupply = _totalSupply.add(amount); _balances[account] = _balances[account].add(amount); emit Transfer(address(0), account, amount); } /** * @dev Destroys `amount` tokens from `account`, reducing the * total supply. * * Emits a {Transfer} event with `to` set to the zero address. * * Requirements: * * - `account` cannot be the zero address. * - `account` must have at least `amount` tokens. */ function _burn(address account, uint256 amount) internal virtual { require(account != address(0), "ERC20: burn from the zero address"); _beforeTokenTransfer(account, address(0), amount); _balances[account] = _balances[account].sub(amount, "ERC20: burn amount exceeds balance"); _totalSupply = _totalSupply.sub(amount); emit Transfer(account, address(0), amount); } /** * @dev Sets `amount` as the allowance of `spender` over the `owner` s tokens. * * This internal function is equivalent to `approve`, and can be used to * e.g. set automatic allowances for certain subsystems, etc. * * Emits an {Approval} event. * * Requirements: * * - `owner` cannot be the zero address. * - `spender` cannot be the zero address. */ function _approve(address owner, address spender, uint256 amount) internal virtual { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } /** * @dev Sets {decimals} to a value other than the default one of 18. * * WARNING: This function should only be called from the constructor. Most * applications that interact with token contracts will not expect * {decimals} to ever change, and may work incorrectly if it does. */ function _setupDecimals(uint8 decimals_) internal virtual { _decimals = decimals_; } /** * @dev Hook that is called before any transfer of tokens. This includes * minting and burning. * * Calling conditions: * * - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens * will be to transferred to `to`. * - when `from` is zero, `amount` tokens will be minted for `to`. * - when `to` is zero, `amount` of ``from``'s tokens will be burned. * - `from` and `to` are never both zero. * * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks]. */ function _beforeTokenTransfer(address from, address to, uint256 amount) internal virtual { } } /** * @dev Extension of {ERC20} that allows token holders to destroy both their own * tokens and those that they have an allowance for, in a way that can be * recognized off-chain (via event analysis). */ abstract contract ERC20Burnable is Context, ERC20 { using SafeMath for uint256; /** * @dev Destroys `amount` tokens from the caller. * * See {ERC20-_burn}. */ function burn(uint256 amount) public virtual { _burn(_msgSender(), amount); } /** * @dev Destroys `amount` tokens from `account`, deducting from the caller's * allowance. * * See {ERC20-_burn} and {ERC20-allowance}. * * Requirements: * * - the caller must have allowance for ``accounts``'s tokens of at least * `amount`. */ function burnFrom(address account, uint256 amount) public virtual { uint256 decreasedAllowance = allowance(account, _msgSender()).sub(amount, "ERC20: burn amount exceeds allowance"); _approve(account, _msgSender(), decreasedAllowance); _burn(account, amount); } } /** * @dev Standard math utilities missing in the Solidity language. */ library Math { /** * @dev Returns the largest of two numbers. */ function max(uint256 a, uint256 b) internal pure returns (uint256) { return a >= b ? a : b; } /** * @dev Returns the smallest of two numbers. */ function min(uint256 a, uint256 b) internal pure returns (uint256) { return a < b ? a : b; } /** * @dev Returns the average of two numbers. The result is rounded towards * zero. */ function average(uint256 a, uint256 b) internal pure returns (uint256) { // (a + b) / 2 can overflow, so we distribute return (a / 2) + (b / 2) + ((a % 2 + b % 2) / 2); } } /** * @dev Wrappers over Solidity's arithmetic operations with added overflow * checks. * * Arithmetic operations in Solidity wrap on overflow. This can easily result * in bugs, because programmers usually assume that an overflow raises an * error, which is the standard behavior in high level programming languages. * `SafeMath` restores this intuition by reverting the transaction when an * operation overflows. * * Using this library instead of the unchecked operations eliminates an entire * class of bugs, so it's recommended to use it always. */ library SafeMath8 { /** * @dev Returns the addition of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `+` operator. * * Requirements: * * - Addition cannot overflow. */ function add(uint8 a, uint8 b) internal pure returns (uint8) { uint8 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } /** * @dev Returns the subtraction of two unsigned integers, reverting on * overflow (when the result is negative). * * Counterpart to Solidity's `-` operator. * * Requirements: * * - Subtraction cannot overflow. */ function sub(uint8 a, uint8 b) internal pure returns (uint8) { return sub(a, b, "SafeMath: subtraction overflow"); } /** * @dev Returns the subtraction of two unsigned integers, reverting with custom message on * overflow (when the result is negative). * * Counterpart to Solidity's `-` operator. * * Requirements: * * - Subtraction cannot overflow. */ function sub(uint8 a, uint8 b, string memory errorMessage) internal pure returns (uint8) { require(b <= a, errorMessage); uint8 c = a - b; return c; } /** * @dev Returns the multiplication of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `*` operator. * * Requirements: * * - Multiplication cannot overflow. */ function mul(uint8 a, uint8 b) internal pure returns (uint8) { // Gas optimization: this is cheaper than requiring 'a' not being zero, but the // benefit is lost if 'b' is also tested. // See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522 if (a == 0) { return 0; } uint8 c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } /** * @dev Returns the integer division of two unsigned integers. Reverts on * division by zero. The result is rounded towards zero. * * Counterpart to Solidity's `/` operator. Note: this function uses a * `revert` opcode (which leaves remaining gas untouched) while Solidity * uses an invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function div(uint8 a, uint8 b) internal pure returns (uint8) { return div(a, b, "SafeMath: division by zero"); } /** * @dev Returns the integer division of two unsigned integers. Reverts with custom message on * division by zero. The result is rounded towards zero. * * Counterpart to Solidity's `/` operator. Note: this function uses a * `revert` opcode (which leaves remaining gas untouched) while Solidity * uses an invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function div(uint8 a, uint8 b, string memory errorMessage) internal pure returns (uint8) { require(b > 0, errorMessage); uint8 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn't hold return c; } /** * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo), * Reverts when dividing by zero. * * Counterpart to Solidity's `%` operator. This function uses a `revert` * opcode (which leaves remaining gas untouched) while Solidity uses an * invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function mod(uint8 a, uint8 b) internal pure returns (uint8) { return mod(a, b, "SafeMath: modulo by zero"); } /** * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo), * Reverts with custom message when dividing by zero. * * Counterpart to Solidity's `%` operator. This function uses a `revert` * opcode (which leaves remaining gas untouched) while Solidity uses an * invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function mod(uint8 a, uint8 b, string memory errorMessage) internal pure returns (uint8) { require(b != 0, errorMessage); return a % b; } } /** * @dev Contract module which provides a basic access control mechanism, where * there is an account (an owner) that can be granted exclusive access to * specific functions. * * By default, the owner account will be the one that deploys the contract. This * can later be changed with {transferOwnership}. * * This module is used through inheritance. It will make available the modifier * `onlyOwner`, which can be applied to your functions to restrict their use to * the owner. */ abstract contract Ownable is Context { address private _owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev Initializes the contract setting the deployer as the initial owner. */ constructor () internal { address msgSender = _msgSender(); _owner = msgSender; emit OwnershipTransferred(address(0), msgSender); } /** * @dev Returns the address of the current owner. */ function owner() public view virtual returns (address) { return _owner; } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { require(owner() == _msgSender(), "Ownable: caller is not the owner"); _; } /** * @dev Leaves the contract without owner. It will not be possible to call * `onlyOwner` functions anymore. Can only be called by the current owner. * * NOTE: Renouncing ownership will leave the contract without an owner, * thereby removing any functionality that is only available to the owner. */ function renounceOwnership() public virtual onlyOwner { emit OwnershipTransferred(_owner, address(0)); _owner = address(0); } /** * @dev Transfers ownership of the contract to a new account (`newOwner`). * Can only be called by the current owner. */ function transferOwnership(address newOwner) public virtual onlyOwner { require(newOwner != address(0), "Ownable: new owner is the zero address"); emit OwnershipTransferred(_owner, newOwner); _owner = newOwner; } } contract Operator is Context, Ownable { address private _operator; event OperatorTransferred(address indexed previousOperator, address indexed newOperator); constructor() internal { _operator = _msgSender(); emit OperatorTransferred(address(0), _operator); } function operator() public view returns (address) { return _operator; } modifier onlyOperator() { require(_operator == msg.sender, "operator: caller is not the operator"); _; } function isOperator() public view returns (bool) { return _msgSender() == _operator; } function transferOperator(address newOperator_) public onlyOwner returns (bool) { _transferOperator(newOperator_); return true; } function _transferOperator(address newOperator_) internal { require(newOperator_ != address(0), "operator: zero address given for new operator"); emit OperatorTransferred(address(0), newOperator_); _operator = newOperator_; } } contract Gaur is ERC20Burnable, Operator { using SafeMath8 for uint8; using SafeMath for uint256; // Initial distribution for the first 24h genesis pools uint256 public constant INITIAL_GENESIS_POOL_DISTRIBUTION = 11000 ether; // Initial distribution for the day 2-5 GAUR-WETH LP -> GAUR pool uint256 public constant INITIAL_GAUR_POOL_DISTRIBUTION = 140000 ether; // Distribution for airdrops wallet uint256 public constant INITIAL_AIRDROP_WALLET_DISTRIBUTION = 9000 ether; // Have the rewards been distributed to the pools bool public rewardPoolDistributed = false; /* ================= Taxation =============== */ // Address of the Oracle address public gaurOracle; // Address of the Tax Office address public taxOffice; // Current tax rate uint256 public taxRate; // Price threshold below which taxes will get burned uint256 public burnThreshold = 1.10e18; // Address of the tax collector wallet address public taxCollectorAddress; // Should the taxes be calculated using the tax tiers bool public autoCalculateTax; // Tax Tiers uint256[] public taxTiersTwaps = [0, 5e17, 6e17, 7e17, 8e17, 9e17, 9.5e17, 1e18, 1.05e18, 1.10e18, 1.20e18, 1.30e18, 1.40e18, 1.50e18]; uint256[] public taxTiersRates = [2000, 1900, 1800, 1700, 1600, 1500, 1500, 1500, 1500, 1400, 900, 400, 200, 100]; // Sender addresses excluded from Tax mapping(address => bool) public excludedAddresses; event TaxOfficeTransferred(address oldAddress, address newAddress); modifier onlyTaxOffice() { require(taxOffice == msg.sender, "Caller is not the tax office"); _; } modifier onlyOperatorOrTaxOffice() { require(isOperator() || taxOffice == msg.sender, "Caller is not the operator or the tax office"); _; } /** * @notice Constructs the GAUR ERC-20 contract. */ constructor(uint256 _taxRate, address _taxCollectorAddress) public ERC20("gaur.money", "GAUR") { // Mints 1 GAUR to contract creator for initial pool setup require(_taxRate < 10000, "tax equal or bigger to 100%"); require(_taxCollectorAddress != address(0), "tax collector address must be non-zero address"); excludeAddress(address(this)); _mint(msg.sender, 1 ether); taxRate = _taxRate; taxCollectorAddress = _taxCollectorAddress; } /* ============= Taxation ============= */ function getTaxTiersTwapsCount() public view returns (uint256 count) { return taxTiersTwaps.length; } function getTaxTiersRatesCount() public view returns (uint256 count) { return taxTiersRates.length; } function isAddressExcluded(address _address) external view returns (bool) { return excludedAddresses[_address]; } function setTaxTiersTwap(uint8 _index, uint256 _value) external onlyTaxOffice returns (bool) { require(_index >= 0, "Index has to be higher than 0"); require(_index < getTaxTiersTwapsCount(), "Index has to lower than count of tax tiers"); if (_index > 0) { require(_value > taxTiersTwaps[_index - 1]); } if (_index < getTaxTiersTwapsCount().sub(1)) { require(_value < taxTiersTwaps[_index + 1]); } taxTiersTwaps[_index] = _value; return true; } function setTaxTiersRate(uint8 _index, uint256 _value) external onlyTaxOffice returns (bool) { require(_index >= 0, "Index has to be higher than 0"); require(_index < getTaxTiersRatesCount(), "Index has to lower than count of tax tiers"); taxTiersRates[_index] = _value; return true; } function setBurnThreshold(uint256 _burnThreshold) external onlyTaxOffice returns (bool) { burnThreshold = _burnThreshold; return true; } function _getGaurPrice() internal view returns (uint256 _gaurPrice) { try IOracle(gaurOracle).consult(address(this), 1e18) returns (uint144 _price) { return uint256(_price); } catch { revert("Gaur: failed to fetch GAUR price from Oracle"); } } function _updateTaxRate(uint256 _gaurPrice) internal returns (uint256) { if (autoCalculateTax) { for (uint8 tierId = uint8(getTaxTiersTwapsCount()).sub(1); tierId >= 0; --tierId) { if (_gaurPrice >= taxTiersTwaps[tierId]) { require(taxTiersRates[tierId] < 10000, "tax equal or bigger to 100%"); taxRate = taxTiersRates[tierId]; return taxTiersRates[tierId]; } } } } function enableAutoCalculateTax() external onlyTaxOffice returns (bool) { autoCalculateTax = true; return true; } function disableAutoCalculateTax() external onlyTaxOffice returns (bool) { autoCalculateTax = false; return true; } function setGaurOracle(address _gaurOracle) external onlyOperatorOrTaxOffice returns (bool) { require(_gaurOracle != address(0), "oracle address cannot be 0 address"); gaurOracle = _gaurOracle; return true; } function setTaxOffice(address _taxOffice) external onlyOperatorOrTaxOffice returns (bool) { require(_taxOffice != address(0), "tax office address cannot be 0 address"); emit TaxOfficeTransferred(taxOffice, _taxOffice); taxOffice = _taxOffice; return true; } function setTaxCollectorAddress(address _taxCollectorAddress) external onlyTaxOffice returns (bool) { require(_taxCollectorAddress != address(0), "tax collector address must be non-zero address"); taxCollectorAddress = _taxCollectorAddress; return true; } function setTaxRate(uint256 _taxRate) external onlyTaxOffice returns (bool) { require(!autoCalculateTax, "auto calculate tax cannot be enabled"); require(_taxRate < 10000, "tax equal or bigger to 100%"); taxRate = _taxRate; return true; } function excludeAddress(address _address) public onlyOperatorOrTaxOffice returns (bool) { require(!excludedAddresses[_address], "address can't be excluded"); excludedAddresses[_address] = true; return true; } function includeAddress(address _address) external onlyOperatorOrTaxOffice returns (bool) { require(excludedAddresses[_address], "address can't be included"); excludedAddresses[_address] = false; return true; } /** * @notice Operator mints GAUR to a recipient * @param recipient_ The address of recipient * @param amount_ The amount of GAUR to mint to * @return whether the process has been done */ function mint(address recipient_, uint256 amount_) public onlyOperator returns (bool) { uint256 balanceBefore = balanceOf(recipient_); _mint(recipient_, amount_); uint256 balanceAfter = balanceOf(recipient_); return balanceAfter > balanceBefore; } function burn(uint256 amount) public override { super.burn(amount); } function burnFrom(address account, uint256 amount) public override onlyOperator { super.burnFrom(account, amount); } function transferFrom( address sender, address recipient, uint256 amount ) public override returns (bool) { uint256 currentTaxRate = 0; bool burnTax = false; if (autoCalculateTax) { uint256 currentGaurPrice = _getGaurPrice(); currentTaxRate = _updateTaxRate(currentGaurPrice); if (currentGaurPrice < burnThreshold) { burnTax = true; } } if (currentTaxRate == 0 || excludedAddresses[sender]) { _transfer(sender, recipient, amount); } else { _transferWithTax(sender, recipient, amount, burnTax); } _approve(sender, _msgSender(), allowance(sender, _msgSender()).sub(amount, "ERC20: transfer amount exceeds allowance")); return true; } function _transferWithTax( address sender, address recipient, uint256 amount, bool burnTax ) internal returns (bool) { uint256 taxAmount = amount.mul(taxRate).div(10000); uint256 amountAfterTax = amount.sub(taxAmount); if (burnTax) { // Burn tax super.burnFrom(sender, taxAmount); } else { // Transfer tax to tax collector _transfer(sender, taxCollectorAddress, taxAmount); } // Transfer amount after tax to recipient _transfer(sender, recipient, amountAfterTax); return true; } /** * @notice distribute to reward pool (only once) */ function distributeReward( address _genesisPool, address _gaurPool, address _airdropWallet ) external onlyOperator returns (bool) { require(!rewardPoolDistributed, "only can distribute once"); require(_genesisPool != address(0), "!_genesisPool"); require(_gaurPool != address(0), "!_gaurPool"); require(_airdropWallet != address(0), "!_airdropWallet"); rewardPoolDistributed = true; _mint(_genesisPool, INITIAL_GENESIS_POOL_DISTRIBUTION); _mint(_gaurPool, INITIAL_GAUR_POOL_DISTRIBUTION); _mint(_airdropWallet, INITIAL_AIRDROP_WALLET_DISTRIBUTION); return true; } function governanceRecoverUnsupported( IERC20 _token, uint256 _amount, address _to ) external onlyOperator returns (bool) { _token.transfer(_to, _amount); return true; } }
Contract ABI
[{"type":"constructor","stateMutability":"nonpayable","inputs":[{"type":"uint256","name":"_taxRate","internalType":"uint256"},{"type":"address","name":"_taxCollectorAddress","internalType":"address"}]},{"type":"event","name":"Approval","inputs":[{"type":"address","name":"owner","internalType":"address","indexed":true},{"type":"address","name":"spender","internalType":"address","indexed":true},{"type":"uint256","name":"value","internalType":"uint256","indexed":false}],"anonymous":false},{"type":"event","name":"OperatorTransferred","inputs":[{"type":"address","name":"previousOperator","internalType":"address","indexed":true},{"type":"address","name":"newOperator","internalType":"address","indexed":true}],"anonymous":false},{"type":"event","name":"OwnershipTransferred","inputs":[{"type":"address","name":"previousOwner","internalType":"address","indexed":true},{"type":"address","name":"newOwner","internalType":"address","indexed":true}],"anonymous":false},{"type":"event","name":"TaxOfficeTransferred","inputs":[{"type":"address","name":"oldAddress","internalType":"address","indexed":false},{"type":"address","name":"newAddress","internalType":"address","indexed":false}],"anonymous":false},{"type":"event","name":"Transfer","inputs":[{"type":"address","name":"from","internalType":"address","indexed":true},{"type":"address","name":"to","internalType":"address","indexed":true},{"type":"uint256","name":"value","internalType":"uint256","indexed":false}],"anonymous":false},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"INITIAL_AIRDROP_WALLET_DISTRIBUTION","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"INITIAL_GAUR_POOL_DISTRIBUTION","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"INITIAL_GENESIS_POOL_DISTRIBUTION","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"allowance","inputs":[{"type":"address","name":"owner","internalType":"address"},{"type":"address","name":"spender","internalType":"address"}]},{"type":"function","stateMutability":"nonpayable","outputs":[{"type":"bool","name":"","internalType":"bool"}],"name":"approve","inputs":[{"type":"address","name":"spender","internalType":"address"},{"type":"uint256","name":"amount","internalType":"uint256"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"bool","name":"","internalType":"bool"}],"name":"autoCalculateTax","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"balanceOf","inputs":[{"type":"address","name":"account","internalType":"address"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"burn","inputs":[{"type":"uint256","name":"amount","internalType":"uint256"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"burnFrom","inputs":[{"type":"address","name":"account","internalType":"address"},{"type":"uint256","name":"amount","internalType":"uint256"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"burnThreshold","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint8","name":"","internalType":"uint8"}],"name":"decimals","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[{"type":"bool","name":"","internalType":"bool"}],"name":"decreaseAllowance","inputs":[{"type":"address","name":"spender","internalType":"address"},{"type":"uint256","name":"subtractedValue","internalType":"uint256"}]},{"type":"function","stateMutability":"nonpayable","outputs":[{"type":"bool","name":"","internalType":"bool"}],"name":"disableAutoCalculateTax","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[{"type":"bool","name":"","internalType":"bool"}],"name":"distributeReward","inputs":[{"type":"address","name":"_genesisPool","internalType":"address"},{"type":"address","name":"_gaurPool","internalType":"address"},{"type":"address","name":"_airdropWallet","internalType":"address"}]},{"type":"function","stateMutability":"nonpayable","outputs":[{"type":"bool","name":"","internalType":"bool"}],"name":"enableAutoCalculateTax","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[{"type":"bool","name":"","internalType":"bool"}],"name":"excludeAddress","inputs":[{"type":"address","name":"_address","internalType":"address"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"bool","name":"","internalType":"bool"}],"name":"excludedAddresses","inputs":[{"type":"address","name":"","internalType":"address"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"address"}],"name":"gaurOracle","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"count","internalType":"uint256"}],"name":"getTaxTiersRatesCount","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"count","internalType":"uint256"}],"name":"getTaxTiersTwapsCount","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[{"type":"bool","name":"","internalType":"bool"}],"name":"governanceRecoverUnsupported","inputs":[{"type":"address","name":"_token","internalType":"contract IERC20"},{"type":"uint256","name":"_amount","internalType":"uint256"},{"type":"address","name":"_to","internalType":"address"}]},{"type":"function","stateMutability":"nonpayable","outputs":[{"type":"bool","name":"","internalType":"bool"}],"name":"includeAddress","inputs":[{"type":"address","name":"_address","internalType":"address"}]},{"type":"function","stateMutability":"nonpayable","outputs":[{"type":"bool","name":"","internalType":"bool"}],"name":"increaseAllowance","inputs":[{"type":"address","name":"spender","internalType":"address"},{"type":"uint256","name":"addedValue","internalType":"uint256"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"bool","name":"","internalType":"bool"}],"name":"isAddressExcluded","inputs":[{"type":"address","name":"_address","internalType":"address"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"bool","name":"","internalType":"bool"}],"name":"isOperator","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[{"type":"bool","name":"","internalType":"bool"}],"name":"mint","inputs":[{"type":"address","name":"recipient_","internalType":"address"},{"type":"uint256","name":"amount_","internalType":"uint256"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"string","name":"","internalType":"string"}],"name":"name","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"address"}],"name":"operator","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"address"}],"name":"owner","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"renounceOwnership","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"bool","name":"","internalType":"bool"}],"name":"rewardPoolDistributed","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[{"type":"bool","name":"","internalType":"bool"}],"name":"setBurnThreshold","inputs":[{"type":"uint256","name":"_burnThreshold","internalType":"uint256"}]},{"type":"function","stateMutability":"nonpayable","outputs":[{"type":"bool","name":"","internalType":"bool"}],"name":"setGaurOracle","inputs":[{"type":"address","name":"_gaurOracle","internalType":"address"}]},{"type":"function","stateMutability":"nonpayable","outputs":[{"type":"bool","name":"","internalType":"bool"}],"name":"setTaxCollectorAddress","inputs":[{"type":"address","name":"_taxCollectorAddress","internalType":"address"}]},{"type":"function","stateMutability":"nonpayable","outputs":[{"type":"bool","name":"","internalType":"bool"}],"name":"setTaxOffice","inputs":[{"type":"address","name":"_taxOffice","internalType":"address"}]},{"type":"function","stateMutability":"nonpayable","outputs":[{"type":"bool","name":"","internalType":"bool"}],"name":"setTaxRate","inputs":[{"type":"uint256","name":"_taxRate","internalType":"uint256"}]},{"type":"function","stateMutability":"nonpayable","outputs":[{"type":"bool","name":"","internalType":"bool"}],"name":"setTaxTiersRate","inputs":[{"type":"uint8","name":"_index","internalType":"uint8"},{"type":"uint256","name":"_value","internalType":"uint256"}]},{"type":"function","stateMutability":"nonpayable","outputs":[{"type":"bool","name":"","internalType":"bool"}],"name":"setTaxTiersTwap","inputs":[{"type":"uint8","name":"_index","internalType":"uint8"},{"type":"uint256","name":"_value","internalType":"uint256"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"string","name":"","internalType":"string"}],"name":"symbol","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"address"}],"name":"taxCollectorAddress","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"address"}],"name":"taxOffice","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"taxRate","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"taxTiersRates","inputs":[{"type":"uint256","name":"","internalType":"uint256"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"taxTiersTwaps","inputs":[{"type":"uint256","name":"","internalType":"uint256"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"totalSupply","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[{"type":"bool","name":"","internalType":"bool"}],"name":"transfer","inputs":[{"type":"address","name":"recipient","internalType":"address"},{"type":"uint256","name":"amount","internalType":"uint256"}]},{"type":"function","stateMutability":"nonpayable","outputs":[{"type":"bool","name":"","internalType":"bool"}],"name":"transferFrom","inputs":[{"type":"address","name":"sender","internalType":"address"},{"type":"address","name":"recipient","internalType":"address"},{"type":"uint256","name":"amount","internalType":"uint256"}]},{"type":"function","stateMutability":"nonpayable","outputs":[{"type":"bool","name":"","internalType":"bool"}],"name":"transferOperator","inputs":[{"type":"address","name":"newOperator_","internalType":"address"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"transferOwnership","inputs":[{"type":"address","name":"newOwner","internalType":"address"}]}]
Deployed ByteCode
0x608060405234801561001057600080fd5b506004361061032b5760003560e01c806369356d47116101b2578063a6431bba116100f9578063dd62ed3e116100a2578063ee2a95351161007c578063ee2a9535146109a8578063f2fde38b146109b0578063ff87fc7c146109e3578063ffa8226e146109eb5761032b565b8063dd62ed3e14610932578063ebca1bd91461096d578063ed18f984146109a05761032b565b8063c3bdf613116100d3578063c3bdf613146108da578063c6d69a30146108e2578063cf011b26146108ff5761032b565b8063a6431bba14610873578063a9059cbb1461087b578063b87c5a4a146108b45761032b565b80638da5cb5b1161015b5780639662676c116101355780639662676c146108155780639d6b5f211461081d578063a457c2d71461083a5761032b565b80638da5cb5b146107d257806393995d4b146107da57806395d89b411461080d5761032b565b8063771a3a1d1161018c578063771a3a1d1461078957806379cc6790146107915780638d3cc818146107ca5761032b565b806369356d471461071b57806370a082311461074e578063715018a6146107815761032b565b806340c10f1911610276578063521181d51161021f5780635c29908d116101f95780635c29908d146106d057806365bbacd9146106ed57806366206ce9146106f55761032b565b8063521181d51461064057806354575af414610685578063570ca735146106c85761032b565b80634456eda2116102505780634456eda2146106285780634e20a02c146106305780634f6d38d0146106385761032b565b806340c10f19146105b357806342966c68146105ec57806342c6b4f11461060b5761032b565b80632fe3fea1116102d857806339509351116102b257806339509351146105165780633e5f13d41461054f5780633f07d76a146105805761032b565b80632fe3fea1146104bd578063313ce567146104c55780633758e6ce146104e35761032b565b806320eef2181161030957806320eef2181461041457806323b872dd1461044757806329605e771461048a5761032b565b806306fdde0314610330578063095ea7b3146103ad57806318160ddd146103fa575b600080fd5b6103386109f3565b6040805160208082528351818301528351919283929083019185019080838360005b8381101561037257818101518382015260200161035a565b50505050905090810190601f16801561039f5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6103e6600480360360408110156103c357600080fd5b5073ffffffffffffffffffffffffffffffffffffffff8135169060200135610aa8565b604080519115158252519081900360200190f35b610402610ac6565b60408051918252519081900360200190f35b6103e66004803603602081101561042a57600080fd5b503573ffffffffffffffffffffffffffffffffffffffff16610acc565b6103e66004803603606081101561045d57600080fd5b5073ffffffffffffffffffffffffffffffffffffffff813581169160208101359091169060400135610bce565b6103e6600480360360208110156104a057600080fd5b503573ffffffffffffffffffffffffffffffffffffffff16610cc7565b610402610d68565b6104cd610d76565b6040805160ff9092168252519081900360200190f35b6103e6600480360360208110156104f957600080fd5b503573ffffffffffffffffffffffffffffffffffffffff16610d7f565b6103e66004803603604081101561052c57600080fd5b5073ffffffffffffffffffffffffffffffffffffffff8135169060200135610eb5565b610557610f10565b6040805173ffffffffffffffffffffffffffffffffffffffff9092168252519081900360200190f35b6103e66004803603602081101561059657600080fd5b503573ffffffffffffffffffffffffffffffffffffffff16610f2c565b6103e6600480360360408110156105c957600080fd5b5073ffffffffffffffffffffffffffffffffffffffff8135169060200135611084565b6106096004803603602081101561060257600080fd5b503561110b565b005b6104026004803603602081101561062157600080fd5b5035611117565b6103e6611135565b610402611175565b610402611183565b6103e66004803603606081101561065657600080fd5b5073ffffffffffffffffffffffffffffffffffffffff8135811691602081013582169160409091013516611189565b6103e66004803603606081101561069b57600080fd5b5073ffffffffffffffffffffffffffffffffffffffff81358116916020810135916040909101351661140f565b610557611503565b610402600480360360208110156106e657600080fd5b503561151f565b6103e661152c565b6103e66004803603604081101561070b57600080fd5b5060ff81351690602001356115c9565b6103e66004803603602081101561073157600080fd5b503573ffffffffffffffffffffffffffffffffffffffff1661171e565b6104026004803603602081101561076457600080fd5b503573ffffffffffffffffffffffffffffffffffffffff16611829565b610609611851565b610402611953565b610609600480360360408110156107a757600080fd5b5073ffffffffffffffffffffffffffffffffffffffff8135169060200135611959565b6103e66119bd565b6105576119de565b6103e6600480360360208110156107f057600080fd5b503573ffffffffffffffffffffffffffffffffffffffff166119ff565b610338611b30565b6103e6611baf565b6103e66004803603602081101561083357600080fd5b5035611bd0565b6103e66004803603604081101561085057600080fd5b5073ffffffffffffffffffffffffffffffffffffffff8135169060200135611c48565b610402611cbd565b6103e66004803603604081101561089157600080fd5b5073ffffffffffffffffffffffffffffffffffffffff8135169060200135611cc3565b6103e6600480360360408110156108ca57600080fd5b5060ff8135169060200135611cd7565b610557611d9f565b6103e6600480360360208110156108f857600080fd5b5035611dbb565b6103e66004803603602081101561091557600080fd5b503573ffffffffffffffffffffffffffffffffffffffff16611ee3565b6104026004803603604081101561094857600080fd5b5073ffffffffffffffffffffffffffffffffffffffff81358116916020013516611ef8565b6103e66004803603602081101561098357600080fd5b503573ffffffffffffffffffffffffffffffffffffffff16611f30565b610557611f5b565b610402611f77565b610609600480360360208110156109c657600080fd5b503573ffffffffffffffffffffffffffffffffffffffff16611f7d565b6103e66120f5565b6104026121a9565b60038054604080516020601f60027fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff610100600188161502019095169490940493840181900481028201810190925282815260609390929091830182828015610a9d5780601f10610a7257610100808354040283529160200191610a9d565b820191906000526020600020905b815481529060010190602001808311610a8057829003601f168201915b505050505090505b90565b6000610abc610ab5612218565b848461221c565b5060015b92915050565b60025490565b6000610ad6611135565b80610af8575060085473ffffffffffffffffffffffffffffffffffffffff1633145b610b335760405162461bcd60e51b815260040180806020018281038252602c815260200180613001602c913960400191505060405180910390fd5b73ffffffffffffffffffffffffffffffffffffffff8216610b855760405162461bcd60e51b8152600401808060200182810382526022815260200180612f966022913960400191505060405180910390fd5b50600780547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff831617905560015b919050565b600b546000908190819074010000000000000000000000000000000000000000900460ff1615610c20576000610c0261232f565b9050610c0d81612429565b9250600a54811015610c1e57600191505b505b811580610c52575073ffffffffffffffffffffffffffffffffffffffff86166000908152600e602052604090205460ff165b15610c6757610c62868686612566565b610c75565b610c7386868684612702565b505b610cbb86610c81612218565b610cb687604051806060016040528060288152602001612ead60289139610caf8c610caa612218565b611ef8565b9190612788565b61221c565b50600195945050505050565b6000610cd1612218565b73ffffffffffffffffffffffffffffffffffffffff16610cef6119de565b73ffffffffffffffffffffffffffffffffffffffff1614610d57576040805162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015290519081900360640190fd5b610d608261281f565b506001919050565b691da56a4b0835bf80000081565b60055460ff1690565b6000610d89611135565b80610dab575060085473ffffffffffffffffffffffffffffffffffffffff1633145b610de65760405162461bcd60e51b815260040180806020018281038252602c815260200180613001602c913960400191505060405180910390fd5b73ffffffffffffffffffffffffffffffffffffffff82166000908152600e602052604090205460ff1615610e61576040805162461bcd60e51b815260206004820152601960248201527f616464726573732063616e2774206265206578636c7564656400000000000000604482015290519081900360640190fd5b5073ffffffffffffffffffffffffffffffffffffffff166000908152600e6020526040902080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0016600190811790915590565b6000610abc610ec2612218565b84610cb68560016000610ed3612218565b73ffffffffffffffffffffffffffffffffffffffff908116825260208083019390935260409182016000908120918c1681529252902054906121b7565b60085473ffffffffffffffffffffffffffffffffffffffff1681565b6000610f36611135565b80610f58575060085473ffffffffffffffffffffffffffffffffffffffff1633145b610f935760405162461bcd60e51b815260040180806020018281038252602c815260200180613001602c913960400191505060405180910390fd5b73ffffffffffffffffffffffffffffffffffffffff8216610fe55760405162461bcd60e51b8152600401808060200182810382526026815260200180612e0d6026913960400191505060405180910390fd5b6008546040805173ffffffffffffffffffffffffffffffffffffffff9283168152918416602083015280517f75237613d1cfb394eb7979839ecbeacaca4592ef0cf96791979625803948a6019281900390910190a1506008805473ffffffffffffffffffffffffffffffffffffffff83167fffffffffffffffffffffffff00000000000000000000000000000000000000009091161790556001919050565b60065460009073ffffffffffffffffffffffffffffffffffffffff1633146110dd5760405162461bcd60e51b8152600401808060200182810382526024815260200180612f276024913960400191505060405180910390fd5b60006110e884611829565b90506110f484846128fb565b60006110ff85611829565b91909111949350505050565b61111481612a12565b50565b600c818154811061112457fe5b600091825260209091200154905081565b60065460009073ffffffffffffffffffffffffffffffffffffffff16611159612218565b73ffffffffffffffffffffffffffffffffffffffff1614905090565b6902544faa778090e0000081565b600a5481565b60065460009073ffffffffffffffffffffffffffffffffffffffff1633146111e25760405162461bcd60e51b8152600401808060200182810382526024815260200180612f276024913960400191505060405180910390fd5b60065474010000000000000000000000000000000000000000900460ff1615611252576040805162461bcd60e51b815260206004820152601860248201527f6f6e6c792063616e2064697374726962757465206f6e63650000000000000000604482015290519081900360640190fd5b73ffffffffffffffffffffffffffffffffffffffff84166112ba576040805162461bcd60e51b815260206004820152600d60248201527f215f67656e65736973506f6f6c00000000000000000000000000000000000000604482015290519081900360640190fd5b73ffffffffffffffffffffffffffffffffffffffff8316611322576040805162461bcd60e51b815260206004820152600a60248201527f215f67617572506f6f6c00000000000000000000000000000000000000000000604482015290519081900360640190fd5b73ffffffffffffffffffffffffffffffffffffffff821661138a576040805162461bcd60e51b815260206004820152600f60248201527f215f61697264726f7057616c6c65740000000000000000000000000000000000604482015290519081900360640190fd5b600680547fffffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffff16740100000000000000000000000000000000000000001790556113dd846902544faa778090e000006128fb565b6113f183691da56a4b0835bf8000006128fb565b611405826901e7e4171bf4d3a000006128fb565b5060019392505050565b60065460009073ffffffffffffffffffffffffffffffffffffffff1633146114685760405162461bcd60e51b8152600401808060200182810382526024815260200180612f276024913960400191505060405180910390fd5b8373ffffffffffffffffffffffffffffffffffffffff1663a9059cbb83856040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b1580156114d957600080fd5b505af11580156114ed573d6000803e3d6000fd5b505050506040513d6020811015610cbb57600080fd5b60065473ffffffffffffffffffffffffffffffffffffffff1690565b600d818154811061112457fe5b60085460009073ffffffffffffffffffffffffffffffffffffffff16331461159b576040805162461bcd60e51b815260206004820152601c60248201527f43616c6c6572206973206e6f742074686520746178206f666669636500000000604482015290519081900360640190fd5b50600b80547fffffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffff169055600190565b60085460009073ffffffffffffffffffffffffffffffffffffffff163314611638576040805162461bcd60e51b815260206004820152601c60248201527f43616c6c6572206973206e6f742074686520746178206f666669636500000000604482015290519081900360640190fd5b611640611cbd565b8360ff16106116805760405162461bcd60e51b815260040180806020018281038252602a815260200180612f4b602a913960400191505060405180910390fd5b60ff8316156116b257600c6001840360ff168154811061169c57fe5b906000526020600020015482116116b257600080fd5b6116c560016116bf611cbd565b90612a23565b8360ff1610156116f857600c8360010160ff16815481106116e257fe5b906000526020600020015482106116f857600080fd5b81600c8460ff168154811061170957fe5b60009182526020909120015550600192915050565b60085460009073ffffffffffffffffffffffffffffffffffffffff16331461178d576040805162461bcd60e51b815260206004820152601c60248201527f43616c6c6572206973206e6f742074686520746178206f666669636500000000604482015290519081900360640190fd5b73ffffffffffffffffffffffffffffffffffffffff82166117df5760405162461bcd60e51b815260040180806020018281038252602e815260200180612ed5602e913960400191505060405180910390fd5b50600b805473ffffffffffffffffffffffffffffffffffffffff83167fffffffffffffffffffffffff00000000000000000000000000000000000000009091161790556001919050565b73ffffffffffffffffffffffffffffffffffffffff1660009081526020819052604090205490565b611859612218565b73ffffffffffffffffffffffffffffffffffffffff166118776119de565b73ffffffffffffffffffffffffffffffffffffffff16146118df576040805162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015290519081900360640190fd5b600554604051600091610100900473ffffffffffffffffffffffffffffffffffffffff16907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600580547fffffffffffffffffffffff0000000000000000000000000000000000000000ff169055565b60095481565b60065473ffffffffffffffffffffffffffffffffffffffff1633146119af5760405162461bcd60e51b8152600401808060200182810382526024815260200180612f276024913960400191505060405180910390fd5b6119b98282612a80565b5050565b600b5474010000000000000000000000000000000000000000900460ff1681565b600554610100900473ffffffffffffffffffffffffffffffffffffffff1690565b6000611a09611135565b80611a2b575060085473ffffffffffffffffffffffffffffffffffffffff1633145b611a665760405162461bcd60e51b815260040180806020018281038252602c815260200180613001602c913960400191505060405180910390fd5b73ffffffffffffffffffffffffffffffffffffffff82166000908152600e602052604090205460ff16611ae0576040805162461bcd60e51b815260206004820152601960248201527f616464726573732063616e277420626520696e636c7564656400000000000000604482015290519081900360640190fd5b5073ffffffffffffffffffffffffffffffffffffffff166000908152600e6020526040902080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00169055600190565b60048054604080516020601f60027fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff610100600188161502019095169490940493840181900481028201810190925282815260609390929091830182828015610a9d5780601f10610a7257610100808354040283529160200191610a9d565b60065474010000000000000000000000000000000000000000900460ff1681565b60085460009073ffffffffffffffffffffffffffffffffffffffff163314611c3f576040805162461bcd60e51b815260206004820152601c60248201527f43616c6c6572206973206e6f742074686520746178206f666669636500000000604482015290519081900360640190fd5b50600a55600190565b6000610abc611c55612218565b84610cb6856040518060600160405280602581526020016130516025913960016000611c7f612218565b73ffffffffffffffffffffffffffffffffffffffff908116825260208083019390935260409182016000908120918d16815292529020549190612788565b600c5490565b6000610abc611cd0612218565b8484612566565b60085460009073ffffffffffffffffffffffffffffffffffffffff163314611d46576040805162461bcd60e51b815260206004820152601c60248201527f43616c6c6572206973206e6f742074686520746178206f666669636500000000604482015290519081900360640190fd5b611d4e611f77565b8360ff1610611d8e5760405162461bcd60e51b815260040180806020018281038252602a815260200180612f4b602a913960400191505060405180910390fd5b81600d8460ff168154811061170957fe5b600b5473ffffffffffffffffffffffffffffffffffffffff1681565b60085460009073ffffffffffffffffffffffffffffffffffffffff163314611e2a576040805162461bcd60e51b815260206004820152601c60248201527f43616c6c6572206973206e6f742074686520746178206f666669636500000000604482015290519081900360640190fd5b600b5474010000000000000000000000000000000000000000900460ff1615611e845760405162461bcd60e51b8152600401808060200182810382526024815260200180612fb86024913960400191505060405180910390fd5b6127108210611eda576040805162461bcd60e51b815260206004820152601b60248201527f74617820657175616c206f722062696767657220746f20313030250000000000604482015290519081900360640190fd5b50600955600190565b600e6020526000908152604090205460ff1681565b73ffffffffffffffffffffffffffffffffffffffff918216600090815260016020908152604080832093909416825291909152205490565b73ffffffffffffffffffffffffffffffffffffffff166000908152600e602052604090205460ff1690565b60075473ffffffffffffffffffffffffffffffffffffffff1681565b600d5490565b611f85612218565b73ffffffffffffffffffffffffffffffffffffffff16611fa36119de565b73ffffffffffffffffffffffffffffffffffffffff161461200b576040805162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015290519081900360640190fd5b73ffffffffffffffffffffffffffffffffffffffff811661205d5760405162461bcd60e51b8152600401808060200182810382526026815260200180612d9f6026913960400191505060405180910390fd5b60055460405173ffffffffffffffffffffffffffffffffffffffff80841692610100900416907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a36005805473ffffffffffffffffffffffffffffffffffffffff909216610100027fffffffffffffffffffffff0000000000000000000000000000000000000000ff909216919091179055565b60085460009073ffffffffffffffffffffffffffffffffffffffff163314612164576040805162461bcd60e51b815260206004820152601c60248201527f43616c6c6572206973206e6f742074686520746178206f666669636500000000604482015290519081900360640190fd5b50600b80547fffffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffff1674010000000000000000000000000000000000000000179055600190565b6901e7e4171bf4d3a0000081565b600082820183811015612211576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b9392505050565b3390565b73ffffffffffffffffffffffffffffffffffffffff831661226e5760405162461bcd60e51b815260040180806020018281038252602481526020018061302d6024913960400191505060405180910390fd5b73ffffffffffffffffffffffffffffffffffffffff82166122c05760405162461bcd60e51b8152600401808060200182810382526022815260200180612dc56022913960400191505060405180910390fd5b73ffffffffffffffffffffffffffffffffffffffff808416600081815260016020908152604080832094871680845294825291829020859055815185815291517f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259281900390910190a3505050565b600754604080517f3ddac953000000000000000000000000000000000000000000000000000000008152306004820152670de0b6b3a76400006024820152905160009273ffffffffffffffffffffffffffffffffffffffff1691633ddac953916044808301926020929190829003018186803b1580156123ae57600080fd5b505afa9250505080156123d357506040513d60208110156123ce57600080fd5b505160015b61240e5760405162461bcd60e51b815260040180806020018281038252602c815260200180612e60602c913960400191505060405180910390fd5b71ffffffffffffffffffffffffffffffffffff169050610aa5565b600b5460009074010000000000000000000000000000000000000000900460ff1615610bc9576000612467600161245e611cbd565b60ff1690612ace565b90505b600c8160ff168154811061247a57fe5b9060005260206000200154831061253f57612710600d8260ff168154811061249e57fe5b9060005260206000200154106124fb576040805162461bcd60e51b815260206004820152601b60248201527f74617820657175616c206f722062696767657220746f20313030250000000000604482015290519081900360640190fd5b600d8160ff168154811061250b57fe5b9060005260206000200154600981905550600d8160ff168154811061252c57fe5b9060005260206000200154915050610bc9565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0161246a565b73ffffffffffffffffffffffffffffffffffffffff83166125b85760405162461bcd60e51b8152600401808060200182810382526025815260200180612fdc6025913960400191505060405180910390fd5b73ffffffffffffffffffffffffffffffffffffffff821661260a5760405162461bcd60e51b8152600401808060200182810382526023815260200180612d5a6023913960400191505060405180910390fd5b612615838383612ac9565b61265f81604051806060016040528060268152602001612de76026913973ffffffffffffffffffffffffffffffffffffffff86166000908152602081905260409020549190612788565b73ffffffffffffffffffffffffffffffffffffffff808516600090815260208190526040808220939093559084168152205461269b90826121b7565b73ffffffffffffffffffffffffffffffffffffffff8084166000818152602081815260409182902094909455805185815290519193928716927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef92918290030190a3505050565b60008061272661271061272060095487612b1090919063ffffffff16565b90612b69565b905060006127348583612a23565b9050831561274b576127468783612a80565b612770565b600b5461277090889073ffffffffffffffffffffffffffffffffffffffff1684612566565b61277b878783612566565b5060019695505050505050565b600081848411156128175760405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b838110156127dc5781810151838201526020016127c4565b50505050905090810190601f1680156128095780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b505050900390565b73ffffffffffffffffffffffffffffffffffffffff81166128715760405162461bcd60e51b815260040180806020018281038252602d815260200180612e33602d913960400191505060405180910390fd5b60405173ffffffffffffffffffffffffffffffffffffffff8216906000907f74da04524d50c64947f5dd5381ef1a4dca5cba8ed1d816243f9e48aa0b5617ed908290a3600680547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff92909216919091179055565b73ffffffffffffffffffffffffffffffffffffffff8216612963576040805162461bcd60e51b815260206004820152601f60248201527f45524332303a206d696e7420746f20746865207a65726f206164647265737300604482015290519081900360640190fd5b61296f60008383612ac9565b60025461297c90826121b7565b60025573ffffffffffffffffffffffffffffffffffffffff82166000908152602081905260409020546129af90826121b7565b73ffffffffffffffffffffffffffffffffffffffff83166000818152602081815260408083209490945583518581529351929391927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9281900390910190a35050565b611114612a1d612218565b82612bd0565b600082821115612a7a576040805162461bcd60e51b815260206004820152601e60248201527f536166654d6174683a207375627472616374696f6e206f766572666c6f770000604482015290519081900360640190fd5b50900390565b6000612aab82604051806060016040528060248152602001612f0360249139610caf86610caa612218565b9050612abf83612ab9612218565b8361221c565b612ac98383612bd0565b505050565b600061221183836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250612d00565b600082612b1f57506000610ac0565b82820282848281612b2c57fe5b04146122115760405162461bcd60e51b8152600401808060200182810382526021815260200180612e8c6021913960400191505060405180910390fd5b6000808211612bbf576040805162461bcd60e51b815260206004820152601a60248201527f536166654d6174683a206469766973696f6e206279207a65726f000000000000604482015290519081900360640190fd5b818381612bc857fe5b049392505050565b73ffffffffffffffffffffffffffffffffffffffff8216612c225760405162461bcd60e51b8152600401808060200182810382526021815260200180612f756021913960400191505060405180910390fd5b612c2e82600083612ac9565b612c7881604051806060016040528060228152602001612d7d6022913973ffffffffffffffffffffffffffffffffffffffff85166000908152602081905260409020549190612788565b73ffffffffffffffffffffffffffffffffffffffff8316600090815260208190526040902055600254612cab9082612a23565b60025560408051828152905160009173ffffffffffffffffffffffffffffffffffffffff8516917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9181900360200190a35050565b60008360ff168360ff16111582906128175760405162461bcd60e51b81526020600482018181528351602484015283519092839260449091019190850190808383600083156127dc5781810151838201526020016127c456fe45524332303a207472616e7366657220746f20746865207a65726f206164647265737345524332303a206275726e20616d6f756e7420657863656564732062616c616e63654f776e61626c653a206e6577206f776e657220697320746865207a65726f206164647265737345524332303a20617070726f766520746f20746865207a65726f206164647265737345524332303a207472616e7366657220616d6f756e7420657863656564732062616c616e6365746178206f666669636520616464726573732063616e6e6f74206265203020616464726573736f70657261746f723a207a65726f206164647265737320676976656e20666f72206e6577206f70657261746f72476175723a206661696c656420746f20666574636820474155522070726963652066726f6d204f7261636c65536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f7745524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e636574617820636f6c6c6563746f722061646472657373206d757374206265206e6f6e2d7a65726f206164647265737345524332303a206275726e20616d6f756e74206578636565647320616c6c6f77616e63656f70657261746f723a2063616c6c6572206973206e6f7420746865206f70657261746f72496e6465782068617320746f206c6f776572207468616e20636f756e74206f662074617820746965727345524332303a206275726e2066726f6d20746865207a65726f20616464726573736f7261636c6520616464726573732063616e6e6f74206265203020616464726573736175746f2063616c63756c617465207461782063616e6e6f7420626520656e61626c656445524332303a207472616e736665722066726f6d20746865207a65726f206164647265737343616c6c6572206973206e6f7420746865206f70657261746f72206f722074686520746178206f666669636545524332303a20617070726f76652066726f6d20746865207a65726f206164647265737345524332303a2064656372656173656420616c6c6f77616e63652062656c6f77207a65726fa2646970667358221220a49a6c6e2b82f3aadb9621911245a0dce750d9b90284be68feed756f5f0e0ce264736f6c634300060c0033