Address Details
contract
token
0xF82e6a3D0fE40EDdf0Bcf3c4bBe9c0bE795D7Fb7
- Token
- YandaToken (YND)
- Creator
- 0x675e3c–2327e5 at 0xafaef3–62a240
- Balance
- 0 CELO ( )
- Locked CELO Balance
- 0.00 CELO
- Voting CELO Balance
- 0.00 CELO
- Pending Unlocked Gold
- 0.00 CELO
- Tokens
-
Fetching tokens...
- Transactions
- 795 Transactions
- Transfers
- 331 Transfers
- Gas Used
- 41,788,316
- Last Balance Update
- 9313331
Transactions
Token Transfers
Tokens
Internal Transactions
Coin Balance History
Logs
Code
Read Contract
Write Contract
This contract has been verified via Sourcify.
View contract in Sourcify repository
- Contract name:
- YandaToken
- Optimization enabled
- true
- Compiler version
- v0.8.7+commit.e28d00a7
- Optimization runs
- 200
- EVM Version
- istanbul
- Verified at
- 2022-06-12T20:11:26.532912Z
YND_contract_v2.sol
// SPDX-License-Identifier: MIT pragma solidity ^0.8.3; import "@openzeppelin/contracts/token/ERC20/ERC20.sol"; import "@openzeppelin/contracts/security/Pausable.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/token/ERC20/extensions/draft-ERC20Permit.sol"; import "@openzeppelin/contracts/token/ERC20/extensions/ERC20Votes.sol"; contract YandaToken is ERC20, Pausable, Ownable, ERC20Permit, ERC20Votes { enum State { AWAITING_TRANSFER, AWAITING_TERMINATION, AWAITING_VALIDATION, COMPLETED } struct Process { State state; uint cost; address service; bytes32 productId; string productData; uint validations; uint failedValidations; } struct Service { address[] validators; uint validationPerc; uint commissionPerc; uint validatorVersion; } struct Validator { uint requests; uint validations; } mapping(address => mapping(bytes32 => Process)) public processes; mapping(address => bytes32) public depositingProducts; mapping(address => Service) public services; mapping(address => Validator) public validators; event Deposit( address indexed customer, address indexed service, bytes32 indexed productId, uint256 weiAmount ); event Action( address indexed customer, address indexed service, bytes32 indexed productId, string data ); event Terminate( address indexed customer, address indexed service, bytes32 indexed productId ); event Complete( address indexed customer, address indexed service, bytes32 indexed productId, bool success ); modifier onlyService() { require(services[msg.sender].validationPerc > 0, "Only service can call this method"); _; } modifier onlyValidator() { require(validators[msg.sender].requests > 0, "Only validator can call this method"); _; } constructor() ERC20("YandaToken", "YND") ERC20Permit("YandaToken") { _mint(msg.sender, 10000000 * 10 ** decimals()); } function pause() public onlyOwner { _pause(); } function unpause() public onlyOwner { _unpause(); } function mint(address to, uint256 amount) public onlyOwner { _mint(to, amount); } function _beforeTokenTransfer(address from, address to, uint256 amount) internal whenNotPaused override { super._beforeTokenTransfer(from, to, amount); } // The following functions are overrides required by Solidity. function _afterTokenTransfer(address from, address to, uint256 amount) internal override(ERC20, ERC20Votes) { super._afterTokenTransfer(from, to, amount); } function _mint(address to, uint256 amount) internal override(ERC20, ERC20Votes) { super._mint(to, amount); } function _burn(address account, uint256 amount) internal override(ERC20, ERC20Votes) { super._burn(account, amount); } function transfer(address recipient, uint256 amount) public virtual override returns (bool) { if(recipient == address(this)) { require( processes[msg.sender][depositingProducts[msg.sender]].state == State.AWAITING_TRANSFER, "You don't have a deposit awaiting process, please create it first" ); _transfer(_msgSender(), recipient, amount); processes[msg.sender][depositingProducts[msg.sender]].state = State.AWAITING_TERMINATION; emit Deposit( _msgSender(), processes[msg.sender][depositingProducts[msg.sender]].service, processes[msg.sender][depositingProducts[msg.sender]].productId, amount ); } else { _transfer(_msgSender(), recipient, amount); } return true; } function addService(address service, address[] calldata vList, uint vPerc, uint cPerc, uint vVer) public onlyOwner { services[service] = Service({ validators: vList, validationPerc: vPerc, commissionPerc: cPerc, validatorVersion: vVer }); } function setValidators(address[] calldata vList) public onlyService { services[msg.sender].validators = vList; } function setValidatorVer(uint vVer) public onlyService { services[msg.sender].validatorVersion = vVer; } function createProcess(address service, uint256 amount, bytes32 productId, string calldata data) public { require(services[service].validationPerc > 0, 'Requested service address not found'); require(processes[msg.sender][productId].service == address(0), 'Process with specified productId already exist'); processes[msg.sender][productId] = Process({ state: State.AWAITING_TRANSFER, cost: amount, service: service, productId: productId, productData: data, validations: 0, failedValidations: 0 }); if(depositingProducts[msg.sender].length > 0) { // Delete previous product if still waits for a deposit if(processes[msg.sender][depositingProducts[msg.sender]].state == State.AWAITING_TRANSFER) { delete processes[msg.sender][depositingProducts[msg.sender]]; } } depositingProducts[msg.sender] = productId; } function declareAction(address customer, bytes32 productId, string calldata data) public onlyService { emit Action(customer, msg.sender, productId, data); } function _updateValidatorsScore(Service memory service) internal { for(uint i=0; i < service.validators.length; i++) { validators[service.validators[i]].requests += 1; } } function startTermination(address customer, bytes32 productId) public onlyService { require(processes[customer][productId].state == State.AWAITING_TERMINATION, "Cannot start termination"); processes[customer][productId].state = State.AWAITING_VALIDATION; // Update validators requests score _updateValidatorsScore(services[processes[customer][productId].service]); // Emit Terminate event to trigger validators emit Terminate(customer, msg.sender, productId); } function _validatorsHolding(Service memory service) view internal returns(uint256) { uint256 result = 0; for(uint i=0; i < service.validators.length; i++) { result += this.balanceOf(service.validators[i]); } return result; } function _scoredReward(address validator, uint256 reward) view internal returns(uint256) { uint256 score = (validators[validator].validations * 100) / validators[validator].requests; return (reward * score) / 100; } function _rewardValidators(Service memory service, uint256 amount) internal returns(uint256) { uint256 rewards_sum = 0; // Sum of validators YND token balances uint256 holdings = _validatorsHolding(service); for(uint i=0; i < service.validators.length; i++) { uint256 validator_balance = this.balanceOf(service.validators[i]); if(validator_balance > 0) { uint256 reward = amount / (holdings / validator_balance); // Reward after scoring filter uint256 scored_reward = _scoredReward(service.validators[i], reward); if(scored_reward > 0) { this.transfer(payable(service.validators[i]), scored_reward); rewards_sum += scored_reward; } } } return rewards_sum; } function validateTermination(address customer, bytes32 productId, bool passed) public onlyValidator { require(processes[customer][productId].state >= State.AWAITING_VALIDATION, "Cannot validate delivary"); if(passed) { processes[customer][productId].validations += 1; } else { processes[customer][productId].failedValidations += 1; } // Update validator score validators[msg.sender].validations += 1; if(processes[customer][productId].state == State.AWAITING_VALIDATION) { if(processes[customer][productId].validations > services[processes[customer][productId].service].validators.length / 2) { // Update process state to COMPLETED processes[customer][productId].state = State.COMPLETED; // Reward validators uint256 reward_amount = (processes[customer][productId].cost * services[processes[customer][productId].service].validationPerc) / 100; uint256 executed_amount = _rewardValidators(services[processes[customer][productId].service], reward_amount); // Pay service commission uint256 commission_amount = (processes[customer][productId].cost * services[processes[customer][productId].service].commissionPerc) / 100; this.transfer(payable(processes[customer][productId].service), commission_amount); // Burn remaining funds _burn(address(this), processes[customer][productId].cost - executed_amount - commission_amount); emit Complete(customer, processes[customer][productId].service, productId, true); } else { if(processes[customer][productId].failedValidations >= services[processes[customer][productId].service].validators.length / 2) { // Update process state to COMPLETED processes[customer][productId].state = State.COMPLETED; // Reward validators uint256 reward_amount = (processes[customer][productId].cost * services[processes[customer][productId].service].validationPerc) / 100; uint256 executed_amount = _rewardValidators(services[processes[customer][productId].service], reward_amount); // Make refund this.transfer(payable(customer), processes[customer][productId].cost - executed_amount); emit Complete(customer, processes[customer][productId].service, productId, false); } } } } function claimToken(uint256 amount) public returns (bool) { if(this.balanceOf(msg.sender) < 20 ether && amount < 100 ether) { _transfer(this.owner(), _msgSender(), amount); return true; } else { return false; } } }
/_openzeppelin/contracts/access/Ownable.sol
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "../utils/Context.sol"; /** * @dev Contract module which provides a basic access control mechanism, where * there is an account (an owner) that can be granted exclusive access to * specific functions. * * By default, the owner account will be the one that deploys the contract. This * can later be changed with {transferOwnership}. * * This module is used through inheritance. It will make available the modifier * `onlyOwner`, which can be applied to your functions to restrict their use to * the owner. */ abstract contract Ownable is Context { address private _owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev Initializes the contract setting the deployer as the initial owner. */ constructor() { _setOwner(_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 { _setOwner(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"); _setOwner(newOwner); } function _setOwner(address newOwner) private { address oldOwner = _owner; _owner = newOwner; emit OwnershipTransferred(oldOwner, newOwner); } }
/_openzeppelin/contracts/security/Pausable.sol
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "../utils/Context.sol"; /** * @dev Contract module which allows children to implement an emergency stop * mechanism that can be triggered by an authorized account. * * This module is used through inheritance. It will make available the * modifiers `whenNotPaused` and `whenPaused`, which can be applied to * the functions of your contract. Note that they will not be pausable by * simply including this module, only once the modifiers are put in place. */ abstract contract Pausable is Context { /** * @dev Emitted when the pause is triggered by `account`. */ event Paused(address account); /** * @dev Emitted when the pause is lifted by `account`. */ event Unpaused(address account); bool private _paused; /** * @dev Initializes the contract in unpaused state. */ constructor() { _paused = false; } /** * @dev Returns true if the contract is paused, and false otherwise. */ function paused() public view virtual returns (bool) { return _paused; } /** * @dev Modifier to make a function callable only when the contract is not paused. * * Requirements: * * - The contract must not be paused. */ modifier whenNotPaused() { require(!paused(), "Pausable: paused"); _; } /** * @dev Modifier to make a function callable only when the contract is paused. * * Requirements: * * - The contract must be paused. */ modifier whenPaused() { require(paused(), "Pausable: not paused"); _; } /** * @dev Triggers stopped state. * * Requirements: * * - The contract must not be paused. */ function _pause() internal virtual whenNotPaused { _paused = true; emit Paused(_msgSender()); } /** * @dev Returns to normal state. * * Requirements: * * - The contract must be paused. */ function _unpause() internal virtual whenPaused { _paused = false; emit Unpaused(_msgSender()); } }
/_openzeppelin/contracts/token/ERC20/ERC20.sol
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "./IERC20.sol"; import "./extensions/IERC20Metadata.sol"; import "../../utils/Context.sol"; /** * @dev Implementation of the {IERC20} interface. * * This implementation is agnostic to the way tokens are created. This means * that a supply mechanism has to be added in a derived contract using {_mint}. * For a generic mechanism see {ERC20PresetMinterPauser}. * * TIP: For a detailed writeup see our guide * https://forum.zeppelin.solutions/t/how-to-implement-erc20-supply-mechanisms/226[How * to implement supply mechanisms]. * * We have followed general OpenZeppelin Contracts guidelines: functions revert * instead returning `false` on failure. This behavior is nonetheless * conventional and does not conflict with the expectations of ERC20 * applications. * * Additionally, an {Approval} event is emitted on calls to {transferFrom}. * This allows applications to reconstruct the allowance for all accounts just * by listening to said events. Other implementations of the EIP may not emit * these events, as it isn't required by the specification. * * Finally, the non-standard {decreaseAllowance} and {increaseAllowance} * functions have been added to mitigate the well-known issues around setting * allowances. See {IERC20-approve}. */ contract ERC20 is Context, IERC20, IERC20Metadata { mapping(address => uint256) private _balances; mapping(address => mapping(address => uint256)) private _allowances; uint256 private _totalSupply; string private _name; string private _symbol; /** * @dev Sets the values for {name} and {symbol}. * * The default value of {decimals} is 18. To select a different value for * {decimals} you should overload it. * * All two of these values are immutable: they can only be set once during * construction. */ constructor(string memory name_, string memory symbol_) { _name = name_; _symbol = symbol_; } /** * @dev Returns the name of the token. */ function name() public view virtual override returns (string memory) { return _name; } /** * @dev Returns the symbol of the token, usually a shorter version of the * name. */ function symbol() public view virtual override returns (string memory) { return _symbol; } /** * @dev Returns the number of decimals used to get its user representation. * For example, if `decimals` equals `2`, a balance of `505` tokens should * be displayed to a user as `5.05` (`505 / 10 ** 2`). * * Tokens usually opt for a value of 18, imitating the relationship between * Ether and Wei. This is the value {ERC20} uses, unless this function is * 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 override returns (uint8) { return 18; } /** * @dev See {IERC20-totalSupply}. */ function totalSupply() public view virtual override returns (uint256) { return _totalSupply; } /** * @dev See {IERC20-balanceOf}. */ function balanceOf(address account) public view virtual override returns (uint256) { return _balances[account]; } /** * @dev See {IERC20-transfer}. * * Requirements: * * - `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); uint256 currentAllowance = _allowances[sender][_msgSender()]; require(currentAllowance >= amount, "ERC20: transfer amount exceeds allowance"); unchecked { _approve(sender, _msgSender(), currentAllowance - amount); } return true; } /** * @dev Atomically increases the allowance granted to `spender` by the caller. * * This is an alternative to {approve} that can be used as a mitigation for * problems described in {IERC20-approve}. * * Emits an {Approval} event indicating the updated allowance. * * Requirements: * * - `spender` cannot be the zero address. */ function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) { _approve(_msgSender(), spender, _allowances[_msgSender()][spender] + addedValue); return true; } /** * @dev Atomically decreases the allowance granted to `spender` by the caller. * * This is an alternative to {approve} that can be used as a mitigation for * problems described in {IERC20-approve}. * * Emits an {Approval} event indicating the updated allowance. * * Requirements: * * - `spender` cannot be the zero address. * - `spender` must have allowance for the caller of at least * `subtractedValue`. */ function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) { uint256 currentAllowance = _allowances[_msgSender()][spender]; require(currentAllowance >= subtractedValue, "ERC20: decreased allowance below zero"); unchecked { _approve(_msgSender(), spender, currentAllowance - subtractedValue); } return true; } /** * @dev Moves `amount` of tokens from `sender` to `recipient`. * * This internal function is equivalent to {transfer}, and can be used to * e.g. implement automatic token fees, slashing mechanisms, etc. * * Emits a {Transfer} event. * * Requirements: * * - `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); uint256 senderBalance = _balances[sender]; require(senderBalance >= amount, "ERC20: transfer amount exceeds balance"); unchecked { _balances[sender] = senderBalance - amount; } _balances[recipient] += amount; emit Transfer(sender, recipient, amount); _afterTokenTransfer(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: * * - `account` cannot be the zero address. */ function _mint(address account, uint256 amount) internal virtual { require(account != address(0), "ERC20: mint to the zero address"); _beforeTokenTransfer(address(0), account, amount); _totalSupply += amount; _balances[account] += amount; emit Transfer(address(0), account, amount); _afterTokenTransfer(address(0), account, amount); } /** * @dev Destroys `amount` tokens from `account`, reducing the * total supply. * * Emits a {Transfer} event with `to` set to the zero address. * * Requirements: * * - `account` cannot be the zero address. * - `account` must have at least `amount` tokens. */ function _burn(address account, uint256 amount) internal virtual { require(account != address(0), "ERC20: burn from the zero address"); _beforeTokenTransfer(account, address(0), amount); uint256 accountBalance = _balances[account]; require(accountBalance >= amount, "ERC20: burn amount exceeds balance"); unchecked { _balances[account] = accountBalance - amount; } _totalSupply -= amount; emit Transfer(account, address(0), amount); _afterTokenTransfer(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 Hook that is called before any transfer of tokens. This includes * minting and burning. * * Calling conditions: * * - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens * will be transferred to `to`. * - when `from` is zero, `amount` tokens will be minted for `to`. * - when `to` is zero, `amount` of ``from``'s tokens will be burned. * - `from` and `to` are never both zero. * * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks]. */ function _beforeTokenTransfer( address from, address to, uint256 amount ) internal virtual {} /** * @dev Hook that is called after any transfer of tokens. This includes * minting and burning. * * Calling conditions: * * - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens * has been transferred to `to`. * - when `from` is zero, `amount` tokens have been minted for `to`. * - when `to` is zero, `amount` of ``from``'s tokens have been burned. * - `from` and `to` are never both zero. * * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks]. */ function _afterTokenTransfer( address from, address to, uint256 amount ) internal virtual {} }
/_openzeppelin/contracts/token/ERC20/IERC20.sol
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; /** * @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); }
/_openzeppelin/contracts/token/ERC20/extensions/ERC20Votes.sol
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "./draft-ERC20Permit.sol"; import "../../../utils/math/Math.sol"; import "../../../utils/math/SafeCast.sol"; import "../../../utils/cryptography/ECDSA.sol"; /** * @dev Extension of ERC20 to support Compound-like voting and delegation. This version is more generic than Compound's, * and supports token supply up to 2^224^ - 1, while COMP is limited to 2^96^ - 1. * * NOTE: If exact COMP compatibility is required, use the {ERC20VotesComp} variant of this module. * * This extension keeps a history (checkpoints) of each account's vote power. Vote power can be delegated either * by calling the {delegate} function directly, or by providing a signature to be used with {delegateBySig}. Voting * power can be queried through the public accessors {getVotes} and {getPastVotes}. * * By default, token balance does not account for voting power. This makes transfers cheaper. The downside is that it * requires users to delegate to themselves in order to activate checkpoints and have their voting power tracked. * Enabling self-delegation can easily be done by overriding the {delegates} function. Keep in mind however that this * will significantly increase the base gas cost of transfers. * * _Available since v4.2._ */ abstract contract ERC20Votes is ERC20Permit { struct Checkpoint { uint32 fromBlock; uint224 votes; } bytes32 private constant _DELEGATION_TYPEHASH = keccak256("Delegation(address delegatee,uint256 nonce,uint256 expiry)"); mapping(address => address) private _delegates; mapping(address => Checkpoint[]) private _checkpoints; Checkpoint[] private _totalSupplyCheckpoints; /** * @dev Emitted when an account changes their delegate. */ event DelegateChanged(address indexed delegator, address indexed fromDelegate, address indexed toDelegate); /** * @dev Emitted when a token transfer or delegate change results in changes to an account's voting power. */ event DelegateVotesChanged(address indexed delegate, uint256 previousBalance, uint256 newBalance); /** * @dev Get the `pos`-th checkpoint for `account`. */ function checkpoints(address account, uint32 pos) public view virtual returns (Checkpoint memory) { return _checkpoints[account][pos]; } /** * @dev Get number of checkpoints for `account`. */ function numCheckpoints(address account) public view virtual returns (uint32) { return SafeCast.toUint32(_checkpoints[account].length); } /** * @dev Get the address `account` is currently delegating to. */ function delegates(address account) public view virtual returns (address) { return _delegates[account]; } /** * @dev Gets the current votes balance for `account` */ function getVotes(address account) public view returns (uint256) { uint256 pos = _checkpoints[account].length; return pos == 0 ? 0 : _checkpoints[account][pos - 1].votes; } /** * @dev Retrieve the number of votes for `account` at the end of `blockNumber`. * * Requirements: * * - `blockNumber` must have been already mined */ function getPastVotes(address account, uint256 blockNumber) public view returns (uint256) { require(blockNumber < block.number, "ERC20Votes: block not yet mined"); return _checkpointsLookup(_checkpoints[account], blockNumber); } /** * @dev Retrieve the `totalSupply` at the end of `blockNumber`. Note, this value is the sum of all balances. * It is but NOT the sum of all the delegated votes! * * Requirements: * * - `blockNumber` must have been already mined */ function getPastTotalSupply(uint256 blockNumber) public view returns (uint256) { require(blockNumber < block.number, "ERC20Votes: block not yet mined"); return _checkpointsLookup(_totalSupplyCheckpoints, blockNumber); } /** * @dev Lookup a value in a list of (sorted) checkpoints. */ function _checkpointsLookup(Checkpoint[] storage ckpts, uint256 blockNumber) private view returns (uint256) { // We run a binary search to look for the earliest checkpoint taken after `blockNumber`. // // During the loop, the index of the wanted checkpoint remains in the range [low-1, high). // With each iteration, either `low` or `high` is moved towards the middle of the range to maintain the invariant. // - If the middle checkpoint is after `blockNumber`, we look in [low, mid) // - If the middle checkpoint is before or equal to `blockNumber`, we look in [mid+1, high) // Once we reach a single value (when low == high), we've found the right checkpoint at the index high-1, if not // out of bounds (in which case we're looking too far in the past and the result is 0). // Note that if the latest checkpoint available is exactly for `blockNumber`, we end up with an index that is // past the end of the array, so we technically don't find a checkpoint after `blockNumber`, but it works out // the same. uint256 high = ckpts.length; uint256 low = 0; while (low < high) { uint256 mid = Math.average(low, high); if (ckpts[mid].fromBlock > blockNumber) { high = mid; } else { low = mid + 1; } } return high == 0 ? 0 : ckpts[high - 1].votes; } /** * @dev Delegate votes from the sender to `delegatee`. */ function delegate(address delegatee) public virtual { return _delegate(_msgSender(), delegatee); } /** * @dev Delegates votes from signer to `delegatee` */ function delegateBySig( address delegatee, uint256 nonce, uint256 expiry, uint8 v, bytes32 r, bytes32 s ) public virtual { require(block.timestamp <= expiry, "ERC20Votes: signature expired"); address signer = ECDSA.recover( _hashTypedDataV4(keccak256(abi.encode(_DELEGATION_TYPEHASH, delegatee, nonce, expiry))), v, r, s ); require(nonce == _useNonce(signer), "ERC20Votes: invalid nonce"); return _delegate(signer, delegatee); } /** * @dev Maximum token supply. Defaults to `type(uint224).max` (2^224^ - 1). */ function _maxSupply() internal view virtual returns (uint224) { return type(uint224).max; } /** * @dev Snapshots the totalSupply after it has been increased. */ function _mint(address account, uint256 amount) internal virtual override { super._mint(account, amount); require(totalSupply() <= _maxSupply(), "ERC20Votes: total supply risks overflowing votes"); _writeCheckpoint(_totalSupplyCheckpoints, _add, amount); } /** * @dev Snapshots the totalSupply after it has been decreased. */ function _burn(address account, uint256 amount) internal virtual override { super._burn(account, amount); _writeCheckpoint(_totalSupplyCheckpoints, _subtract, amount); } /** * @dev Move voting power when tokens are transferred. * * Emits a {DelegateVotesChanged} event. */ function _afterTokenTransfer( address from, address to, uint256 amount ) internal virtual override { super._afterTokenTransfer(from, to, amount); _moveVotingPower(delegates(from), delegates(to), amount); } /** * @dev Change delegation for `delegator` to `delegatee`. * * Emits events {DelegateChanged} and {DelegateVotesChanged}. */ function _delegate(address delegator, address delegatee) internal virtual { address currentDelegate = delegates(delegator); uint256 delegatorBalance = balanceOf(delegator); _delegates[delegator] = delegatee; emit DelegateChanged(delegator, currentDelegate, delegatee); _moveVotingPower(currentDelegate, delegatee, delegatorBalance); } function _moveVotingPower( address src, address dst, uint256 amount ) private { if (src != dst && amount > 0) { if (src != address(0)) { (uint256 oldWeight, uint256 newWeight) = _writeCheckpoint(_checkpoints[src], _subtract, amount); emit DelegateVotesChanged(src, oldWeight, newWeight); } if (dst != address(0)) { (uint256 oldWeight, uint256 newWeight) = _writeCheckpoint(_checkpoints[dst], _add, amount); emit DelegateVotesChanged(dst, oldWeight, newWeight); } } } function _writeCheckpoint( Checkpoint[] storage ckpts, function(uint256, uint256) view returns (uint256) op, uint256 delta ) private returns (uint256 oldWeight, uint256 newWeight) { uint256 pos = ckpts.length; oldWeight = pos == 0 ? 0 : ckpts[pos - 1].votes; newWeight = op(oldWeight, delta); if (pos > 0 && ckpts[pos - 1].fromBlock == block.number) { ckpts[pos - 1].votes = SafeCast.toUint224(newWeight); } else { ckpts.push(Checkpoint({fromBlock: SafeCast.toUint32(block.number), votes: SafeCast.toUint224(newWeight)})); } } function _add(uint256 a, uint256 b) private pure returns (uint256) { return a + b; } function _subtract(uint256 a, uint256 b) private pure returns (uint256) { return a - b; } }
/_openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "../IERC20.sol"; /** * @dev Interface for the optional metadata functions from the ERC20 standard. * * _Available since v4.1._ */ interface IERC20Metadata is IERC20 { /** * @dev Returns the name of the token. */ function name() external view returns (string memory); /** * @dev Returns the symbol of the token. */ function symbol() external view returns (string memory); /** * @dev Returns the decimals places of the token. */ function decimals() external view returns (uint8); }
/_openzeppelin/contracts/token/ERC20/extensions/draft-ERC20Permit.sol
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "./draft-IERC20Permit.sol"; import "../ERC20.sol"; import "../../../utils/cryptography/draft-EIP712.sol"; import "../../../utils/cryptography/ECDSA.sol"; import "../../../utils/Counters.sol"; /** * @dev Implementation of the ERC20 Permit extension allowing approvals to be made via signatures, as defined in * https://eips.ethereum.org/EIPS/eip-2612[EIP-2612]. * * Adds the {permit} method, which can be used to change an account's ERC20 allowance (see {IERC20-allowance}) by * presenting a message signed by the account. By not relying on `{IERC20-approve}`, the token holder account doesn't * need to send a transaction, and thus is not required to hold Ether at all. * * _Available since v3.4._ */ abstract contract ERC20Permit is ERC20, IERC20Permit, EIP712 { using Counters for Counters.Counter; mapping(address => Counters.Counter) private _nonces; // solhint-disable-next-line var-name-mixedcase bytes32 private immutable _PERMIT_TYPEHASH = keccak256("Permit(address owner,address spender,uint256 value,uint256 nonce,uint256 deadline)"); /** * @dev Initializes the {EIP712} domain separator using the `name` parameter, and setting `version` to `"1"`. * * It's a good idea to use the same `name` that is defined as the ERC20 token name. */ constructor(string memory name) EIP712(name, "1") {} /** * @dev See {IERC20Permit-permit}. */ function permit( address owner, address spender, uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s ) public virtual override { require(block.timestamp <= deadline, "ERC20Permit: expired deadline"); bytes32 structHash = keccak256(abi.encode(_PERMIT_TYPEHASH, owner, spender, value, _useNonce(owner), deadline)); bytes32 hash = _hashTypedDataV4(structHash); address signer = ECDSA.recover(hash, v, r, s); require(signer == owner, "ERC20Permit: invalid signature"); _approve(owner, spender, value); } /** * @dev See {IERC20Permit-nonces}. */ function nonces(address owner) public view virtual override returns (uint256) { return _nonces[owner].current(); } /** * @dev See {IERC20Permit-DOMAIN_SEPARATOR}. */ // solhint-disable-next-line func-name-mixedcase function DOMAIN_SEPARATOR() external view override returns (bytes32) { return _domainSeparatorV4(); } /** * @dev "Consume a nonce": return the current value and increment. * * _Available since v4.1._ */ function _useNonce(address owner) internal virtual returns (uint256 current) { Counters.Counter storage nonce = _nonces[owner]; current = nonce.current(); nonce.increment(); } }
/_openzeppelin/contracts/token/ERC20/extensions/draft-IERC20Permit.sol
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; /** * @dev Interface of the ERC20 Permit extension allowing approvals to be made via signatures, as defined in * https://eips.ethereum.org/EIPS/eip-2612[EIP-2612]. * * Adds the {permit} method, which can be used to change an account's ERC20 allowance (see {IERC20-allowance}) by * presenting a message signed by the account. By not relying on {IERC20-approve}, the token holder account doesn't * need to send a transaction, and thus is not required to hold Ether at all. */ interface IERC20Permit { /** * @dev Sets `value` as the allowance of `spender` over ``owner``'s tokens, * given ``owner``'s signed approval. * * IMPORTANT: The same issues {IERC20-approve} has related to transaction * ordering also apply here. * * Emits an {Approval} event. * * Requirements: * * - `spender` cannot be the zero address. * - `deadline` must be a timestamp in the future. * - `v`, `r` and `s` must be a valid `secp256k1` signature from `owner` * over the EIP712-formatted function arguments. * - the signature must use ``owner``'s current nonce (see {nonces}). * * For more information on the signature format, see the * https://eips.ethereum.org/EIPS/eip-2612#specification[relevant EIP * section]. */ function permit( address owner, address spender, uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s ) external; /** * @dev Returns the current nonce for `owner`. This value must be * included whenever a signature is generated for {permit}. * * Every successful call to {permit} increases ``owner``'s nonce by one. This * prevents a signature from being used multiple times. */ function nonces(address owner) external view returns (uint256); /** * @dev Returns the domain separator used in the encoding of the signature for {permit}, as defined by {EIP712}. */ // solhint-disable-next-line func-name-mixedcase function DOMAIN_SEPARATOR() external view returns (bytes32); }
/_openzeppelin/contracts/utils/Context.sol
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; /** * @dev Provides information about the current execution context, including the * sender of the transaction and its data. While these are generally available * via msg.sender and msg.data, they should not be accessed in such a direct * manner, since when dealing with meta-transactions the account sending and * paying for execution may not be the actual sender (as far as an application * is concerned). * * This contract is only required for intermediate, library-like contracts. */ abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } function _msgData() internal view virtual returns (bytes calldata) { return msg.data; } }
/_openzeppelin/contracts/utils/Counters.sol
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; /** * @title Counters * @author Matt Condon (@shrugs) * @dev Provides counters that can only be incremented, decremented or reset. This can be used e.g. to track the number * of elements in a mapping, issuing ERC721 ids, or counting request ids. * * Include with `using Counters for Counters.Counter;` */ library Counters { struct Counter { // This variable should never be directly accessed by users of the library: interactions must be restricted to // the library's function. As of Solidity v0.5.2, this cannot be enforced, though there is a proposal to add // this feature: see https://github.com/ethereum/solidity/issues/4637 uint256 _value; // default: 0 } function current(Counter storage counter) internal view returns (uint256) { return counter._value; } function increment(Counter storage counter) internal { unchecked { counter._value += 1; } } function decrement(Counter storage counter) internal { uint256 value = counter._value; require(value > 0, "Counter: decrement overflow"); unchecked { counter._value = value - 1; } } function reset(Counter storage counter) internal { counter._value = 0; } }
/_openzeppelin/contracts/utils/cryptography/ECDSA.sol
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; /** * @dev Elliptic Curve Digital Signature Algorithm (ECDSA) operations. * * These functions can be used to verify that a message was signed by the holder * of the private keys of a given address. */ library ECDSA { enum RecoverError { NoError, InvalidSignature, InvalidSignatureLength, InvalidSignatureS, InvalidSignatureV } function _throwError(RecoverError error) private pure { if (error == RecoverError.NoError) { return; // no error: do nothing } else if (error == RecoverError.InvalidSignature) { revert("ECDSA: invalid signature"); } else if (error == RecoverError.InvalidSignatureLength) { revert("ECDSA: invalid signature length"); } else if (error == RecoverError.InvalidSignatureS) { revert("ECDSA: invalid signature 's' value"); } else if (error == RecoverError.InvalidSignatureV) { revert("ECDSA: invalid signature 'v' value"); } } /** * @dev Returns the address that signed a hashed message (`hash`) with * `signature` or error string. This address can then be used for verification purposes. * * The `ecrecover` EVM opcode allows for malleable (non-unique) signatures: * this function rejects them by requiring the `s` value to be in the lower * half order, and the `v` value to be either 27 or 28. * * IMPORTANT: `hash` _must_ be the result of a hash operation for the * verification to be secure: it is possible to craft signatures that * recover to arbitrary addresses for non-hashed data. A safe way to ensure * this is by receiving a hash of the original message (which may otherwise * be too long), and then calling {toEthSignedMessageHash} on it. * * Documentation for signature generation: * - with https://web3js.readthedocs.io/en/v1.3.4/web3-eth-accounts.html#sign[Web3.js] * - with https://docs.ethers.io/v5/api/signer/#Signer-signMessage[ethers] * * _Available since v4.3._ */ function tryRecover(bytes32 hash, bytes memory signature) internal pure returns (address, RecoverError) { // Check the signature length // - case 65: r,s,v signature (standard) // - case 64: r,vs signature (cf https://eips.ethereum.org/EIPS/eip-2098) _Available since v4.1._ if (signature.length == 65) { bytes32 r; bytes32 s; uint8 v; // ecrecover takes the signature parameters, and the only way to get them // currently is to use assembly. assembly { r := mload(add(signature, 0x20)) s := mload(add(signature, 0x40)) v := byte(0, mload(add(signature, 0x60))) } return tryRecover(hash, v, r, s); } else if (signature.length == 64) { bytes32 r; bytes32 vs; // ecrecover takes the signature parameters, and the only way to get them // currently is to use assembly. assembly { r := mload(add(signature, 0x20)) vs := mload(add(signature, 0x40)) } return tryRecover(hash, r, vs); } else { return (address(0), RecoverError.InvalidSignatureLength); } } /** * @dev Returns the address that signed a hashed message (`hash`) with * `signature`. This address can then be used for verification purposes. * * The `ecrecover` EVM opcode allows for malleable (non-unique) signatures: * this function rejects them by requiring the `s` value to be in the lower * half order, and the `v` value to be either 27 or 28. * * IMPORTANT: `hash` _must_ be the result of a hash operation for the * verification to be secure: it is possible to craft signatures that * recover to arbitrary addresses for non-hashed data. A safe way to ensure * this is by receiving a hash of the original message (which may otherwise * be too long), and then calling {toEthSignedMessageHash} on it. */ function recover(bytes32 hash, bytes memory signature) internal pure returns (address) { (address recovered, RecoverError error) = tryRecover(hash, signature); _throwError(error); return recovered; } /** * @dev Overload of {ECDSA-tryRecover} that receives the `r` and `vs` short-signature fields separately. * * See https://eips.ethereum.org/EIPS/eip-2098[EIP-2098 short signatures] * * _Available since v4.3._ */ function tryRecover( bytes32 hash, bytes32 r, bytes32 vs ) internal pure returns (address, RecoverError) { bytes32 s; uint8 v; assembly { s := and(vs, 0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff) v := add(shr(255, vs), 27) } return tryRecover(hash, v, r, s); } /** * @dev Overload of {ECDSA-recover} that receives the `r and `vs` short-signature fields separately. * * _Available since v4.2._ */ function recover( bytes32 hash, bytes32 r, bytes32 vs ) internal pure returns (address) { (address recovered, RecoverError error) = tryRecover(hash, r, vs); _throwError(error); return recovered; } /** * @dev Overload of {ECDSA-tryRecover} that receives the `v`, * `r` and `s` signature fields separately. * * _Available since v4.3._ */ function tryRecover( bytes32 hash, uint8 v, bytes32 r, bytes32 s ) internal pure returns (address, RecoverError) { // EIP-2 still allows signature malleability for ecrecover(). Remove this possibility and make the signature // unique. Appendix F in the Ethereum Yellow paper (https://ethereum.github.io/yellowpaper/paper.pdf), defines // the valid range for s in (301): 0 < s < secp256k1n ÷ 2 + 1, and for v in (302): v ∈ {27, 28}. Most // signatures from current libraries generate a unique signature with an s-value in the lower half order. // // If your library generates malleable signatures, such as s-values in the upper range, calculate a new s-value // with 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEBAAEDCE6AF48A03BBFD25E8CD0364141 - s1 and flip v from 27 to 28 or // vice versa. If your library also generates signatures with 0/1 for v instead 27/28, add 27 to v to accept // these malleable signatures as well. if (uint256(s) > 0x7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF5D576E7357A4501DDFE92F46681B20A0) { return (address(0), RecoverError.InvalidSignatureS); } if (v != 27 && v != 28) { return (address(0), RecoverError.InvalidSignatureV); } // If the signature is valid (and not malleable), return the signer address address signer = ecrecover(hash, v, r, s); if (signer == address(0)) { return (address(0), RecoverError.InvalidSignature); } return (signer, RecoverError.NoError); } /** * @dev Overload of {ECDSA-recover} that receives the `v`, * `r` and `s` signature fields separately. */ function recover( bytes32 hash, uint8 v, bytes32 r, bytes32 s ) internal pure returns (address) { (address recovered, RecoverError error) = tryRecover(hash, v, r, s); _throwError(error); return recovered; } /** * @dev Returns an Ethereum Signed Message, created from a `hash`. This * produces hash corresponding to the one signed with the * https://eth.wiki/json-rpc/API#eth_sign[`eth_sign`] * JSON-RPC method as part of EIP-191. * * See {recover}. */ function toEthSignedMessageHash(bytes32 hash) internal pure returns (bytes32) { // 32 is the length in bytes of hash, // enforced by the type signature above return keccak256(abi.encodePacked("\x19Ethereum Signed Message:\n32", hash)); } /** * @dev Returns an Ethereum Signed Typed Data, created from a * `domainSeparator` and a `structHash`. This produces hash corresponding * to the one signed with the * https://eips.ethereum.org/EIPS/eip-712[`eth_signTypedData`] * JSON-RPC method as part of EIP-712. * * See {recover}. */ function toTypedDataHash(bytes32 domainSeparator, bytes32 structHash) internal pure returns (bytes32) { return keccak256(abi.encodePacked("\x19\x01", domainSeparator, structHash)); } }
/_openzeppelin/contracts/utils/cryptography/draft-EIP712.sol
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "./ECDSA.sol"; /** * @dev https://eips.ethereum.org/EIPS/eip-712[EIP 712] is a standard for hashing and signing of typed structured data. * * The encoding specified in the EIP is very generic, and such a generic implementation in Solidity is not feasible, * thus this contract does not implement the encoding itself. Protocols need to implement the type-specific encoding * they need in their contracts using a combination of `abi.encode` and `keccak256`. * * This contract implements the EIP 712 domain separator ({_domainSeparatorV4}) that is used as part of the encoding * scheme, and the final step of the encoding to obtain the message digest that is then signed via ECDSA * ({_hashTypedDataV4}). * * The implementation of the domain separator was designed to be as efficient as possible while still properly updating * the chain id to protect against replay attacks on an eventual fork of the chain. * * NOTE: This contract implements the version of the encoding known as "v4", as implemented by the JSON RPC method * https://docs.metamask.io/guide/signing-data.html[`eth_signTypedDataV4` in MetaMask]. * * _Available since v3.4._ */ abstract contract EIP712 { /* solhint-disable var-name-mixedcase */ // Cache the domain separator as an immutable value, but also store the chain id that it corresponds to, in order to // invalidate the cached domain separator if the chain id changes. bytes32 private immutable _CACHED_DOMAIN_SEPARATOR; uint256 private immutable _CACHED_CHAIN_ID; bytes32 private immutable _HASHED_NAME; bytes32 private immutable _HASHED_VERSION; bytes32 private immutable _TYPE_HASH; /* solhint-enable var-name-mixedcase */ /** * @dev Initializes the domain separator and parameter caches. * * The meaning of `name` and `version` is specified in * https://eips.ethereum.org/EIPS/eip-712#definition-of-domainseparator[EIP 712]: * * - `name`: the user readable name of the signing domain, i.e. the name of the DApp or the protocol. * - `version`: the current major version of the signing domain. * * NOTE: These parameters cannot be changed except through a xref:learn::upgrading-smart-contracts.adoc[smart * contract upgrade]. */ constructor(string memory name, string memory version) { bytes32 hashedName = keccak256(bytes(name)); bytes32 hashedVersion = keccak256(bytes(version)); bytes32 typeHash = keccak256( "EIP712Domain(string name,string version,uint256 chainId,address verifyingContract)" ); _HASHED_NAME = hashedName; _HASHED_VERSION = hashedVersion; _CACHED_CHAIN_ID = block.chainid; _CACHED_DOMAIN_SEPARATOR = _buildDomainSeparator(typeHash, hashedName, hashedVersion); _TYPE_HASH = typeHash; } /** * @dev Returns the domain separator for the current chain. */ function _domainSeparatorV4() internal view returns (bytes32) { if (block.chainid == _CACHED_CHAIN_ID) { return _CACHED_DOMAIN_SEPARATOR; } else { return _buildDomainSeparator(_TYPE_HASH, _HASHED_NAME, _HASHED_VERSION); } } function _buildDomainSeparator( bytes32 typeHash, bytes32 nameHash, bytes32 versionHash ) private view returns (bytes32) { return keccak256(abi.encode(typeHash, nameHash, versionHash, block.chainid, address(this))); } /** * @dev Given an already https://eips.ethereum.org/EIPS/eip-712#definition-of-hashstruct[hashed struct], this * function returns the hash of the fully encoded EIP712 message for this domain. * * This hash can be used together with {ECDSA-recover} to obtain the signer of a message. For example: * * ```solidity * bytes32 digest = _hashTypedDataV4(keccak256(abi.encode( * keccak256("Mail(address to,string contents)"), * mailTo, * keccak256(bytes(mailContents)) * ))); * address signer = ECDSA.recover(digest, signature); * ``` */ function _hashTypedDataV4(bytes32 structHash) internal view virtual returns (bytes32) { return ECDSA.toTypedDataHash(_domainSeparatorV4(), structHash); } }
/_openzeppelin/contracts/utils/math/Math.sol
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; /** * @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. return (a & b) + (a ^ b) / 2; } /** * @dev Returns the ceiling of the division of two numbers. * * This differs from standard division with `/` in that it rounds up instead * of rounding down. */ function ceilDiv(uint256 a, uint256 b) internal pure returns (uint256) { // (a + b - 1) / b can overflow on addition, so we distribute. return a / b + (a % b == 0 ? 0 : 1); } }
/_openzeppelin/contracts/utils/math/SafeCast.sol
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; /** * @dev Wrappers over Solidity's uintXX/intXX casting operators with added overflow * checks. * * Downcasting from uint256/int256 in Solidity does not revert on overflow. This can * easily result in undesired exploitation or bugs, since developers usually * assume that overflows raise errors. `SafeCast` restores this intuition by * reverting the transaction when such 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. * * Can be combined with {SafeMath} and {SignedSafeMath} to extend it to smaller types, by performing * all math on `uint256` and `int256` and then downcasting. */ library SafeCast { /** * @dev Returns the downcasted uint224 from uint256, reverting on * overflow (when the input is greater than largest uint224). * * Counterpart to Solidity's `uint224` operator. * * Requirements: * * - input must fit into 224 bits */ function toUint224(uint256 value) internal pure returns (uint224) { require(value <= type(uint224).max, "SafeCast: value doesn't fit in 224 bits"); return uint224(value); } /** * @dev Returns the downcasted uint128 from uint256, reverting on * overflow (when the input is greater than largest uint128). * * Counterpart to Solidity's `uint128` operator. * * Requirements: * * - input must fit into 128 bits */ function toUint128(uint256 value) internal pure returns (uint128) { require(value <= type(uint128).max, "SafeCast: value doesn't fit in 128 bits"); return uint128(value); } /** * @dev Returns the downcasted uint96 from uint256, reverting on * overflow (when the input is greater than largest uint96). * * Counterpart to Solidity's `uint96` operator. * * Requirements: * * - input must fit into 96 bits */ function toUint96(uint256 value) internal pure returns (uint96) { require(value <= type(uint96).max, "SafeCast: value doesn't fit in 96 bits"); return uint96(value); } /** * @dev Returns the downcasted uint64 from uint256, reverting on * overflow (when the input is greater than largest uint64). * * Counterpart to Solidity's `uint64` operator. * * Requirements: * * - input must fit into 64 bits */ function toUint64(uint256 value) internal pure returns (uint64) { require(value <= type(uint64).max, "SafeCast: value doesn't fit in 64 bits"); return uint64(value); } /** * @dev Returns the downcasted uint32 from uint256, reverting on * overflow (when the input is greater than largest uint32). * * Counterpart to Solidity's `uint32` operator. * * Requirements: * * - input must fit into 32 bits */ function toUint32(uint256 value) internal pure returns (uint32) { require(value <= type(uint32).max, "SafeCast: value doesn't fit in 32 bits"); return uint32(value); } /** * @dev Returns the downcasted uint16 from uint256, reverting on * overflow (when the input is greater than largest uint16). * * Counterpart to Solidity's `uint16` operator. * * Requirements: * * - input must fit into 16 bits */ function toUint16(uint256 value) internal pure returns (uint16) { require(value <= type(uint16).max, "SafeCast: value doesn't fit in 16 bits"); return uint16(value); } /** * @dev Returns the downcasted uint8 from uint256, reverting on * overflow (when the input is greater than largest uint8). * * Counterpart to Solidity's `uint8` operator. * * Requirements: * * - input must fit into 8 bits. */ function toUint8(uint256 value) internal pure returns (uint8) { require(value <= type(uint8).max, "SafeCast: value doesn't fit in 8 bits"); return uint8(value); } /** * @dev Converts a signed int256 into an unsigned uint256. * * Requirements: * * - input must be greater than or equal to 0. */ function toUint256(int256 value) internal pure returns (uint256) { require(value >= 0, "SafeCast: value must be positive"); return uint256(value); } /** * @dev Returns the downcasted int128 from int256, reverting on * overflow (when the input is less than smallest int128 or * greater than largest int128). * * Counterpart to Solidity's `int128` operator. * * Requirements: * * - input must fit into 128 bits * * _Available since v3.1._ */ function toInt128(int256 value) internal pure returns (int128) { require(value >= type(int128).min && value <= type(int128).max, "SafeCast: value doesn't fit in 128 bits"); return int128(value); } /** * @dev Returns the downcasted int64 from int256, reverting on * overflow (when the input is less than smallest int64 or * greater than largest int64). * * Counterpart to Solidity's `int64` operator. * * Requirements: * * - input must fit into 64 bits * * _Available since v3.1._ */ function toInt64(int256 value) internal pure returns (int64) { require(value >= type(int64).min && value <= type(int64).max, "SafeCast: value doesn't fit in 64 bits"); return int64(value); } /** * @dev Returns the downcasted int32 from int256, reverting on * overflow (when the input is less than smallest int32 or * greater than largest int32). * * Counterpart to Solidity's `int32` operator. * * Requirements: * * - input must fit into 32 bits * * _Available since v3.1._ */ function toInt32(int256 value) internal pure returns (int32) { require(value >= type(int32).min && value <= type(int32).max, "SafeCast: value doesn't fit in 32 bits"); return int32(value); } /** * @dev Returns the downcasted int16 from int256, reverting on * overflow (when the input is less than smallest int16 or * greater than largest int16). * * Counterpart to Solidity's `int16` operator. * * Requirements: * * - input must fit into 16 bits * * _Available since v3.1._ */ function toInt16(int256 value) internal pure returns (int16) { require(value >= type(int16).min && value <= type(int16).max, "SafeCast: value doesn't fit in 16 bits"); return int16(value); } /** * @dev Returns the downcasted int8 from int256, reverting on * overflow (when the input is less than smallest int8 or * greater than largest int8). * * Counterpart to Solidity's `int8` operator. * * Requirements: * * - input must fit into 8 bits. * * _Available since v3.1._ */ function toInt8(int256 value) internal pure returns (int8) { require(value >= type(int8).min && value <= type(int8).max, "SafeCast: value doesn't fit in 8 bits"); return int8(value); } /** * @dev Converts an unsigned uint256 into a signed int256. * * Requirements: * * - input must be less than or equal to maxInt256. */ function toInt256(uint256 value) internal pure returns (int256) { // Note: Unsafe cast below is okay because `type(int256).max` is guaranteed to be positive require(value <= uint256(type(int256).max), "SafeCast: value doesn't fit in an int256"); return int256(value); } }
Contract ABI
[{"type":"constructor","stateMutability":"nonpayable","inputs":[]},{"type":"event","name":"Action","inputs":[{"type":"address","name":"customer","internalType":"address","indexed":true},{"type":"address","name":"service","internalType":"address","indexed":true},{"type":"bytes32","name":"productId","internalType":"bytes32","indexed":true},{"type":"string","name":"data","internalType":"string","indexed":false}],"anonymous":false},{"type":"event","name":"Approval","inputs":[{"type":"address","name":"owner","internalType":"address","indexed":true},{"type":"address","name":"spender","internalType":"address","indexed":true},{"type":"uint256","name":"value","internalType":"uint256","indexed":false}],"anonymous":false},{"type":"event","name":"Complete","inputs":[{"type":"address","name":"customer","internalType":"address","indexed":true},{"type":"address","name":"service","internalType":"address","indexed":true},{"type":"bytes32","name":"productId","internalType":"bytes32","indexed":true},{"type":"bool","name":"success","internalType":"bool","indexed":false}],"anonymous":false},{"type":"event","name":"DelegateChanged","inputs":[{"type":"address","name":"delegator","internalType":"address","indexed":true},{"type":"address","name":"fromDelegate","internalType":"address","indexed":true},{"type":"address","name":"toDelegate","internalType":"address","indexed":true}],"anonymous":false},{"type":"event","name":"DelegateVotesChanged","inputs":[{"type":"address","name":"delegate","internalType":"address","indexed":true},{"type":"uint256","name":"previousBalance","internalType":"uint256","indexed":false},{"type":"uint256","name":"newBalance","internalType":"uint256","indexed":false}],"anonymous":false},{"type":"event","name":"Deposit","inputs":[{"type":"address","name":"customer","internalType":"address","indexed":true},{"type":"address","name":"service","internalType":"address","indexed":true},{"type":"bytes32","name":"productId","internalType":"bytes32","indexed":true},{"type":"uint256","name":"weiAmount","internalType":"uint256","indexed":false}],"anonymous":false},{"type":"event","name":"OwnershipTransferred","inputs":[{"type":"address","name":"previousOwner","internalType":"address","indexed":true},{"type":"address","name":"newOwner","internalType":"address","indexed":true}],"anonymous":false},{"type":"event","name":"Paused","inputs":[{"type":"address","name":"account","internalType":"address","indexed":false}],"anonymous":false},{"type":"event","name":"Terminate","inputs":[{"type":"address","name":"customer","internalType":"address","indexed":true},{"type":"address","name":"service","internalType":"address","indexed":true},{"type":"bytes32","name":"productId","internalType":"bytes32","indexed":true}],"anonymous":false},{"type":"event","name":"Transfer","inputs":[{"type":"address","name":"from","internalType":"address","indexed":true},{"type":"address","name":"to","internalType":"address","indexed":true},{"type":"uint256","name":"value","internalType":"uint256","indexed":false}],"anonymous":false},{"type":"event","name":"Unpaused","inputs":[{"type":"address","name":"account","internalType":"address","indexed":false}],"anonymous":false},{"type":"function","stateMutability":"view","outputs":[{"type":"bytes32","name":"","internalType":"bytes32"}],"name":"DOMAIN_SEPARATOR","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"addService","inputs":[{"type":"address","name":"service","internalType":"address"},{"type":"address[]","name":"vList","internalType":"address[]"},{"type":"uint256","name":"vPerc","internalType":"uint256"},{"type":"uint256","name":"cPerc","internalType":"uint256"},{"type":"uint256","name":"vVer","internalType":"uint256"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"allowance","inputs":[{"type":"address","name":"owner","internalType":"address"},{"type":"address","name":"spender","internalType":"address"}]},{"type":"function","stateMutability":"nonpayable","outputs":[{"type":"bool","name":"","internalType":"bool"}],"name":"approve","inputs":[{"type":"address","name":"spender","internalType":"address"},{"type":"uint256","name":"amount","internalType":"uint256"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"balanceOf","inputs":[{"type":"address","name":"account","internalType":"address"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"tuple","name":"","internalType":"struct ERC20Votes.Checkpoint","components":[{"type":"uint32","name":"fromBlock","internalType":"uint32"},{"type":"uint224","name":"votes","internalType":"uint224"}]}],"name":"checkpoints","inputs":[{"type":"address","name":"account","internalType":"address"},{"type":"uint32","name":"pos","internalType":"uint32"}]},{"type":"function","stateMutability":"nonpayable","outputs":[{"type":"bool","name":"","internalType":"bool"}],"name":"claimToken","inputs":[{"type":"uint256","name":"amount","internalType":"uint256"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"createProcess","inputs":[{"type":"address","name":"service","internalType":"address"},{"type":"uint256","name":"amount","internalType":"uint256"},{"type":"bytes32","name":"productId","internalType":"bytes32"},{"type":"string","name":"data","internalType":"string"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint8","name":"","internalType":"uint8"}],"name":"decimals","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"declareAction","inputs":[{"type":"address","name":"customer","internalType":"address"},{"type":"bytes32","name":"productId","internalType":"bytes32"},{"type":"string","name":"data","internalType":"string"}]},{"type":"function","stateMutability":"nonpayable","outputs":[{"type":"bool","name":"","internalType":"bool"}],"name":"decreaseAllowance","inputs":[{"type":"address","name":"spender","internalType":"address"},{"type":"uint256","name":"subtractedValue","internalType":"uint256"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"delegate","inputs":[{"type":"address","name":"delegatee","internalType":"address"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"delegateBySig","inputs":[{"type":"address","name":"delegatee","internalType":"address"},{"type":"uint256","name":"nonce","internalType":"uint256"},{"type":"uint256","name":"expiry","internalType":"uint256"},{"type":"uint8","name":"v","internalType":"uint8"},{"type":"bytes32","name":"r","internalType":"bytes32"},{"type":"bytes32","name":"s","internalType":"bytes32"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"address"}],"name":"delegates","inputs":[{"type":"address","name":"account","internalType":"address"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"bytes32","name":"","internalType":"bytes32"}],"name":"depositingProducts","inputs":[{"type":"address","name":"","internalType":"address"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"getPastTotalSupply","inputs":[{"type":"uint256","name":"blockNumber","internalType":"uint256"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"getPastVotes","inputs":[{"type":"address","name":"account","internalType":"address"},{"type":"uint256","name":"blockNumber","internalType":"uint256"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"getVotes","inputs":[{"type":"address","name":"account","internalType":"address"}]},{"type":"function","stateMutability":"nonpayable","outputs":[{"type":"bool","name":"","internalType":"bool"}],"name":"increaseAllowance","inputs":[{"type":"address","name":"spender","internalType":"address"},{"type":"uint256","name":"addedValue","internalType":"uint256"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"mint","inputs":[{"type":"address","name":"to","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":"uint256","name":"","internalType":"uint256"}],"name":"nonces","inputs":[{"type":"address","name":"owner","internalType":"address"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint32","name":"","internalType":"uint32"}],"name":"numCheckpoints","inputs":[{"type":"address","name":"account","internalType":"address"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"address"}],"name":"owner","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"pause","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"bool","name":"","internalType":"bool"}],"name":"paused","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"permit","inputs":[{"type":"address","name":"owner","internalType":"address"},{"type":"address","name":"spender","internalType":"address"},{"type":"uint256","name":"value","internalType":"uint256"},{"type":"uint256","name":"deadline","internalType":"uint256"},{"type":"uint8","name":"v","internalType":"uint8"},{"type":"bytes32","name":"r","internalType":"bytes32"},{"type":"bytes32","name":"s","internalType":"bytes32"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint8","name":"state","internalType":"enum YandaToken.State"},{"type":"uint256","name":"cost","internalType":"uint256"},{"type":"address","name":"service","internalType":"address"},{"type":"bytes32","name":"productId","internalType":"bytes32"},{"type":"string","name":"productData","internalType":"string"},{"type":"uint256","name":"validations","internalType":"uint256"},{"type":"uint256","name":"failedValidations","internalType":"uint256"}],"name":"processes","inputs":[{"type":"address","name":"","internalType":"address"},{"type":"bytes32","name":"","internalType":"bytes32"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"renounceOwnership","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"validationPerc","internalType":"uint256"},{"type":"uint256","name":"commissionPerc","internalType":"uint256"},{"type":"uint256","name":"validatorVersion","internalType":"uint256"}],"name":"services","inputs":[{"type":"address","name":"","internalType":"address"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"setValidatorVer","inputs":[{"type":"uint256","name":"vVer","internalType":"uint256"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"setValidators","inputs":[{"type":"address[]","name":"vList","internalType":"address[]"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"startTermination","inputs":[{"type":"address","name":"customer","internalType":"address"},{"type":"bytes32","name":"productId","internalType":"bytes32"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"string","name":"","internalType":"string"}],"name":"symbol","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"totalSupply","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[{"type":"bool","name":"","internalType":"bool"}],"name":"transfer","inputs":[{"type":"address","name":"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":[],"name":"transferOwnership","inputs":[{"type":"address","name":"newOwner","internalType":"address"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"unpause","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"validateTermination","inputs":[{"type":"address","name":"customer","internalType":"address"},{"type":"bytes32","name":"productId","internalType":"bytes32"},{"type":"bool","name":"passed","internalType":"bool"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"requests","internalType":"uint256"},{"type":"uint256","name":"validations","internalType":"uint256"}],"name":"validators","inputs":[{"type":"address","name":"","internalType":"address"}]}]
Contract Creation Code
0x6101406040527f6e71edae12b1b97f4d1f60370fef10105fa2faae0126114a169c64845d6126c9610120523480156200003757600080fd5b506040518060400160405280600a8152602001692cb0b73230aa37b5b2b760b11b81525080604051806040016040528060018152602001603160f81b8152506040518060400160405280600a8152602001692cb0b73230aa37b5b2b760b11b8152506040518060400160405280600381526020016216539160ea1b8152508160039080519060200190620000cd9291906200087b565b508051620000e39060049060208401906200087b565b50506005805460ff1916905550620000fb33620001b3565b815160209283012081519183019190912060c082815260e08290524660a0818152604080517f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f8189018190528183019790975260608101959095526080808601939093523085830152805180860390920182529390920190925280519301929092209091526101005250620001ad33620001986012600a6200097b565b620001a7906298968062000a3a565b6200020d565b62000adf565b600580546001600160a01b03838116610100818102610100600160a81b031985161790945560405193909204169182907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b6200022482826200022860201b620020ca1760201c565b5050565b6200023f8282620002df60201b6200215a1760201c565b6001600160e01b0362000253620003dc8216565b1115620002c05760405162461bcd60e51b815260206004820152603060248201527f4552433230566f7465733a20746f74616c20737570706c79207269736b73206f60448201526f766572666c6f77696e6720766f74657360801b60648201526084015b60405180910390fd5b620002d960096200224d620003e260201b1783620003f9565b50505050565b6001600160a01b038216620003375760405162461bcd60e51b815260206004820152601f60248201527f45524332303a206d696e7420746f20746865207a65726f2061646472657373006044820152606401620002b7565b6200034560008383620005ab565b806002600082825462000359919062000917565b90915550506001600160a01b038216600090815260208190526040812080548392906200038890849062000917565b90915550506040518181526001600160a01b038316906000907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9060200160405180910390a3620002246000838362000610565b60025490565b6000620003f0828462000917565b90505b92915050565b8254600090819080156200044b57856200041560018362000a5c565b8154811062000428576200042862000ac9565b60009182526020909120015464010000000090046001600160e01b03166200044e565b60005b6001600160e01b031692506200046583858760201c565b9150600081118015620004a9575043866200048260018462000a5c565b8154811062000495576200049562000ac9565b60009182526020909120015463ffffffff16145b156200051d57620004c5826200062860201b620022591760201c565b86620004d360018462000a5c565b81548110620004e657620004e662000ac9565b9060005260206000200160000160046101000a8154816001600160e01b0302191690836001600160e01b03160217905550620005a2565b8560405180604001604052806200053f436200069760201b620022c61760201c565b63ffffffff16815260200162000560856200062860201b620022591760201c565b6001600160e01b0390811690915282546001810184556000938452602093849020835194909301519091166401000000000263ffffffff909316929092179101555b50935093915050565b60055460ff1615620005f35760405162461bcd60e51b815260206004820152601060248201526f14185d5cd8589b194e881c185d5cd95960821b6044820152606401620002b7565b6200060b8383836200060b60201b620016f91760201c565b505050565b6200060b838383620006fe60201b6200232b1760201c565b60006001600160e01b03821115620006935760405162461bcd60e51b815260206004820152602760248201527f53616665436173743a2076616c756520646f65736e27742066697420696e20326044820152663234206269747360c81b6064820152608401620002b7565b5090565b600063ffffffff821115620006935760405162461bcd60e51b815260206004820152602660248201527f53616665436173743a2076616c756520646f65736e27742066697420696e203360448201526532206269747360d01b6064820152608401620002b7565b620007168383836200060b60201b620016f91760201c565b6001600160a01b038381166000908152600760205260408082205485841683529120546200060b92918216911683818314801590620007555750600081115b156200060b576001600160a01b03831615620007e2576001600160a01b0383166000908152600860209081526040822082916200079f91906200086d901b6200235d1785620003f9565b91509150846001600160a01b0316600080516020620049788339815191528383604051620007d7929190918252602082015260400190565b60405180910390a250505b6001600160a01b038216156200060b576001600160a01b038216600090815260086020908152604082208291620008269190620003e2901b6200224d1785620003f9565b91509150836001600160a01b03166000805160206200497883398151915283836040516200085e929190918252602082015260400190565b60405180910390a25050505050565b6000620003f0828462000a5c565b828054620008899062000a76565b90600052602060002090601f016020900481019282620008ad5760008555620008f8565b82601f10620008c857805160ff1916838001178555620008f8565b82800160010185558215620008f8579182015b82811115620008f8578251825591602001919060010190620008db565b50620006939291505b8082111562000693576000815560010162000901565b600082198211156200092d576200092d62000ab3565b500190565b600181815b808511156200097357816000190482111562000957576200095762000ab3565b808516156200096557918102915b93841c939080029062000937565b509250929050565b6000620003f060ff8416836000826200099757506001620003f3565b81620009a657506000620003f3565b8160018114620009bf5760028114620009ca57620009ea565b6001915050620003f3565b60ff841115620009de57620009de62000ab3565b50506001821b620003f3565b5060208310610133831016604e8410600b841016171562000a0f575081810a620003f3565b62000a1b838362000932565b806000190482111562000a325762000a3262000ab3565b029392505050565b600081600019048311821515161562000a575762000a5762000ab3565b500290565b60008282101562000a715762000a7162000ab3565b500390565b600181811c9082168062000a8b57607f821691505b6020821081141562000aad57634e487b7160e01b600052602260045260246000fd5b50919050565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b60805160a05160c05160e0516101005161012051613e4962000b2f6000396000611dba0152600061273d0152600061278c01526000612767015260006126eb015260006127140152613e496000f3fe608060405234801561001057600080fd5b50600436106102535760003560e01c806373b4bd6f11610146578063a9059cbb116100c3578063dd62ed3e11610087578063dd62ed3e14610563578063e4a7c46f1461059c578063ebd30af4146105bc578063f1127ed8146105e2578063f2fde38b1461061f578063fa52c7d81461063257600080fd5b8063a9059cbb14610504578063a9e7c2e514610517578063c0f99d671461052a578063c3cda5201461053d578063d505accf1461055057600080fd5b80638e539e8c1161010a5780638e539e8c146104b05780639300c926146104c357806395d89b41146104d65780639ab24eb0146104de578063a457c2d7146104f157600080fd5b806373b4bd6f146104595780637ecebe001461046c5780638456cb591461047f57806389bf146a146104875780638da5cb5b1461049a57600080fd5b80633f4ba83a116101d457806363de06f81161019857806363de06f8146103a05780636d966d01146103b35780636fcfff451461040057806370a0823114610428578063715018a61461045157600080fd5b80633f4ba83a1461032357806340c10f191461032b578063587cde1e1461033e5780635c19a95c146103825780635c975abb1461039557600080fd5b806323b872dd1161021b57806323b872dd146102d3578063313ce567146102e65780633644e515146102f557806339509351146102fd5780633a46b1a81461031057600080fd5b806304f32b5d1461025857806306fdde031461026d578063095ea7b31461028b5780630e53e633146102ae57806318160ddd146102c1575b600080fd5b61026b61026636600461399a565b61066e565b005b6102756106fa565b6040516102829190613c65565b60405180910390f35b61029e61029936600461392c565b61078c565b6040519015158152602001610282565b61026b6102bc36600461392c565b6107a2565b6002545b604051908152602001610282565b61029e6102e136600461380e565b61095b565b60405160128152602001610282565b6102c5610a05565b61029e61030b36600461392c565b610a14565b6102c561031e36600461392c565b610a50565b61026b610aca565b61026b61033936600461392c565b610b04565b61036a61034c36600461379b565b6001600160a01b039081166000908152600760205260409020541690565b6040516001600160a01b039091168152602001610282565b61026b61039036600461379b565b610b42565b60055460ff1661029e565b61026b6103ae366004613b50565b610b4f565b6103e56103c136600461379b565b600c6020526000908152604090206001810154600282015460039092015490919083565b60408051938452602084019290925290820152606001610282565b61041361040e36600461379b565b610b93565b60405163ffffffff9091168152602001610282565b6102c561043636600461379b565b6001600160a01b031660009081526020819052604090205490565b61026b610bbb565b61026b6104673660046139f6565b610bf5565b6102c561047a36600461379b565b610ec0565b61026b610ede565b61026b610495366004613958565b610f16565b60055461010090046001600160a01b031661036a565b6102c56104be366004613b50565b6116fe565b61026b6104d1366004613af1565b61175a565b6102756117a3565b6102c56104ec36600461379b565b6117b2565b61029e6104ff36600461392c565b611839565b61029e61051236600461392c565b6118d2565b61029e610525366004613b50565b611a31565b61026b6105383660046138bd565b611b57565b61026b61054b366004613a60565b611c30565b61026b61055e36600461384f565b611d66565b6102c56105713660046137d5565b6001600160a01b03918216600090815260016020908152604080832093909416825291909152205490565b6102c56105aa36600461379b565b600b6020526000908152604090205481565b6105cf6105ca36600461392c565b611eca565b6040516102829796959493929190613bcf565b6105f56105f0366004613aba565b611fa8565b60408051825163ffffffff1681526020928301516001600160e01b03169281019290925201610282565b61026b61062d36600461379b565b61202c565b61065961064036600461379b565b600d602052600090815260409020805460019091015482565b60408051928352602083019190915201610282565b336000908152600c60205260409020600101546106a65760405162461bcd60e51b815260040161069d90613cad565b60405180910390fd5b82336001600160a01b0316856001600160a01b03167fb67fab32200b6a6d186136689c0b4c4072ae0bd5dd17b98fb8105d1b9747939985856040516106ec929190613c36565b60405180910390a450505050565b60606003805461070990613d5e565b80601f016020809104026020016040519081016040528092919081815260200182805461073590613d5e565b80156107825780601f1061075757610100808354040283529160200191610782565b820191906000526020600020905b81548152906001019060200180831161076557829003601f168201915b5050505050905090565b6000610799338484612369565b50600192915050565b336000908152600c60205260409020600101546107d15760405162461bcd60e51b815260040161069d90613cad565b60016001600160a01b0383166000908152600a6020908152604080832085845290915290205460ff16600381111561080b5761080b613dc4565b146108585760405162461bcd60e51b815260206004820152601860248201527f43616e6e6f74207374617274207465726d696e6174696f6e0000000000000000604482015260640161069d565b6001600160a01b038281166000908152600a6020908152604080832085845282528083208054600260ff199091168117825501549093168252600c8152908290208251815460a0938102820184019094526080810184815261091f949193849284918401828280156108f357602002820191906000526020600020905b81546001600160a01b031681526001909101906020018083116108d5575b50505050508152602001600182015481526020016002820154815260200160038201548152505061248d565b604051819033906001600160a01b038516907f3dc016b59ffc70a71e689716c312b2b7415f9e4f11803ff7cc3730801811497a90600090a45050565b6000610968848484612508565b6001600160a01b0384166000908152600160209081526040808320338452909152902054828110156109ed5760405162461bcd60e51b815260206004820152602860248201527f45524332303a207472616e7366657220616d6f756e74206578636565647320616044820152676c6c6f77616e636560c01b606482015260840161069d565b6109fa8533858403612369565b506001949350505050565b6000610a0f6126e7565b905090565b3360008181526001602090815260408083206001600160a01b03871684529091528120549091610799918590610a4b908690613cee565b612369565b6000438210610aa15760405162461bcd60e51b815260206004820152601f60248201527f4552433230566f7465733a20626c6f636b206e6f7420796574206d696e656400604482015260640161069d565b6001600160a01b0383166000908152600860205260409020610ac390836127da565b9392505050565b6005546001600160a01b03610100909104163314610afa5760405162461bcd60e51b815260040161069d90613c78565b610b02612897565b565b6005546001600160a01b03610100909104163314610b345760405162461bcd60e51b815260040161069d90613c78565b610b3e828261292a565b5050565b610b4c3382612934565b50565b336000908152600c6020526040902060010154610b7e5760405162461bcd60e51b815260040161069d90613cad565b336000908152600c6020526040902060030155565b6001600160a01b038116600090815260086020526040812054610bb5906122c6565b92915050565b6005546001600160a01b03610100909104163314610beb5760405162461bcd60e51b815260040161069d90613c78565b610b0260006129ad565b6001600160a01b0385166000908152600c6020526040902060010154610c695760405162461bcd60e51b815260206004820152602360248201527f52657175657374656420736572766963652061646472657373206e6f7420666f6044820152621d5b9960ea1b606482015260840161069d565b336000908152600a602090815260408083208684529091529020600201546001600160a01b031615610cf45760405162461bcd60e51b815260206004820152602e60248201527f50726f636573732077697468207370656369666965642070726f64756374496460448201526d08185b1c9958591e48195e1a5cdd60921b606482015260840161069d565b6040805160e081019091528060008152602001858152602001866001600160a01b0316815260200184815260200183838080601f016020809104026020016040519081016040528093929190818152602001838380828437600092018290525093855250505060208083018290526040928301829052338252600a815282822087835290522081518154829060ff19166001836003811115610d9857610d98613dc4565b0217905550602082810151600183015560408301516002830180546001600160a01b0319166001600160a01b039092169190911790556060830151600383015560808301518051610def9260048501920190613585565b5060a0820151600582015560c090910151600690910155336000908152600a60209081526040808320600b835281842054845290915281205460ff166003811115610e3c57610e3c613dc4565b1415610eaa57336000908152600a60209081526040808320600b83528184205484529091528120805460ff19168155600181018290556002810180546001600160a01b03191690556003810182905590610e996004830182613605565b506000600582018190556006909101555b5050336000908152600b60205260409020555050565b6001600160a01b038116600090815260066020526040812054610bb5565b6005546001600160a01b03610100909104163314610f0e5760405162461bcd60e51b815260040161069d90613c78565b610b02612a07565b336000908152600d6020526040902054610f7e5760405162461bcd60e51b815260206004820152602360248201527f4f6e6c792076616c696461746f722063616e2063616c6c2074686973206d65746044820152621a1bd960ea1b606482015260840161069d565b60026001600160a01b0384166000908152600a6020908152604080832086845290915290205460ff166003811115610fb857610fb8613dc4565b10156110065760405162461bcd60e51b815260206004820152601860248201527f43616e6e6f742076616c69646174652064656c69766172790000000000000000604482015260640161069d565b801561104e576001600160a01b0383166000908152600a602090815260408083208584529091528120600501805460019290611043908490613cee565b9091555061108b9050565b6001600160a01b0383166000908152600a602090815260408083208584529091528120600601805460019290611085908490613cee565b90915550505b336000908152600d6020526040812060019081018054919290916110b0908490613cee565b90915550600290506001600160a01b0384166000908152600a6020908152604080832086845290915290205460ff1660038111156110f0576110f0613dc4565b14156116f9576001600160a01b038084166000908152600a6020908152604080832086845282528083206002908101549094168352600c9091529020546111379190613d06565b6001600160a01b0384166000908152600a602090815260408083208684529091529020600501541115611446576001600160a01b038381166000908152600a60209081526040808320868452808352818420805460ff1916600317815560028101549095168452600c83529083206001908101548785529190925292015490916064916111c49190613d28565b6111ce9190613d06565b6001600160a01b038086166000908152600a602090815260408083208884528252808320600201549093168252600c81528282208351815460a09381028201840190955260808101858152959650929461128e9491928492849184018282801561126157602002820191906000526020600020905b81546001600160a01b03168152600190910190602001808311611243575b50505050508152602001600182015481526020016002820154815260200160038201548152505083612a82565b6001600160a01b038087166000908152600a602090815260408083208984528083528184206002808201549096168552600c8452918420909401548984529390915260010154929350916064916112e491613d28565b6112ee9190613d06565b6001600160a01b038781166000908152600a602090815260408083208a84529091529081902060020154905163a9059cbb60e01b81529116600482015260248101829052909150309063a9059cbb90604401602060405180830381600087803b15801561135a57600080fd5b505af115801561136e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113929190613b33565b506001600160a01b0386166000908152600a602090815260408083208884529091529020600101546113dc90309083906113cd908690613d47565b6113d79190613d47565b612c6f565b6001600160a01b038681166000818152600a602090815260408083208a84528252918290206002015491516001815289949290921692917f5c2cc6518d5891ba2f9c21f49d712982ba12450a2a8adeb21e4a41f85a995b70910160405180910390a4505050505050565b6001600160a01b038084166000908152600a6020908152604080832086845282528083206002908101549094168352600c9091529020546114879190613d06565b6001600160a01b0384166000908152600a60209081526040808320868452909152902060060154106116f9576001600160a01b038381166000908152600a60209081526040808320868452808352818420805460ff1916600317815560028101549095168452600c83529083206001908101548785529190925292015490916064916115139190613d28565b61151d9190613d06565b6001600160a01b038086166000908152600a602090815260408083208884528252808320600201549093168252600c81528282208351815460a0938102820184019095526080810185815295965092946115db94919284928491840182828015611261576020028201919060005260206000209081546001600160a01b031681526001909101906020018083116112435750505050508152602001600182015481526020016002820154815260200160038201548152505083612a82565b6001600160a01b0386166000908152600a60209081526040808320888452909152902060010154909150309063a9059cbb90879061161a908590613d47565b6040516001600160e01b031960e085901b1681526001600160a01b0390921660048301526024820152604401602060405180830381600087803b15801561166057600080fd5b505af1158015611674573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906116989190613b33565b506001600160a01b038581166000818152600a60209081526040808320898452825280832060020154905192835288941692917f5c2cc6518d5891ba2f9c21f49d712982ba12450a2a8adeb21e4a41f85a995b70910160405180910390a450505b505050565b600043821061174f5760405162461bcd60e51b815260206004820152601f60248201527f4552433230566f7465733a20626c6f636b206e6f7420796574206d696e656400604482015260640161069d565b610bb56009836127da565b336000908152600c60205260409020600101546117895760405162461bcd60e51b815260040161069d90613cad565b336000908152600c602052604090206116f990838361363f565b60606004805461070990613d5e565b6001600160a01b0381166000908152600860205260408120548015611826576001600160a01b03831660009081526008602052604090206117f4600183613d47565b8154811061180457611804613dda565b60009182526020909120015464010000000090046001600160e01b0316611829565b60005b6001600160e01b03169392505050565b3360009081526001602090815260408083206001600160a01b0386168452909152812054828110156118bb5760405162461bcd60e51b815260206004820152602560248201527f45524332303a2064656372656173656420616c6c6f77616e63652062656c6f77604482015264207a65726f60d81b606482015260840161069d565b6118c83385858403612369565b5060019392505050565b60006001600160a01b038316301415611a2857336000908152600a60209081526040808320600b835281842054845290915281205460ff16600381111561191b5761191b613dc4565b146119985760405162461bcd60e51b815260206004820152604160248201527f596f7520646f6e277420686176652061206465706f736974206177616974696e60448201527f672070726f636573732c20706c656173652063726561746520697420666972736064820152601d60fa1b608482015260a40161069d565b6119a4335b8484612508565b336000818152600a60209081526040808320600b835281842080548552908352818420805460ff19166001179055548352918290206003810154600290910154925186815290936001600160a01b0390931692917f1f0f1dee49a1720a0d98e3a0575a04dd9f143ff5e29555c3085471c1c70eed5b910160405180910390a4610799565b6107993361199d565b6040516370a0823160e01b81523360048201526000906801158e460913d000009030906370a082319060240160206040518083038186803b158015611a7557600080fd5b505afa158015611a89573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611aad9190613b69565b108015611ac2575068056bc75e2d6310000082105b15611b4a57611b42306001600160a01b0316638da5cb5b6040518163ffffffff1660e01b815260040160206040518083038186803b158015611b0357600080fd5b505afa158015611b17573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611b3b91906137b8565b3384612508565b506001919050565b506000919050565b919050565b6005546001600160a01b03610100909104163314611b875760405162461bcd60e51b815260040161069d90613c78565b604051806080016040528086868080602002602001604051908101604052809392919081815260200183836020028082843760009201829052509385525050506020808301879052604080840187905260609093018590526001600160a01b038a168252600c8152919020825180519192611c0792849290910190613692565b506020820151600182015560408201516002820155606090910151600390910155505050505050565b83421115611c805760405162461bcd60e51b815260206004820152601d60248201527f4552433230566f7465733a207369676e61747572652065787069726564000000604482015260640161069d565b604080517fe48329057bfd03d55e49b547132e39cffd9c1820ad7b9d4c5307691425d15adf60208201526001600160a01b038816918101919091526060810186905260808101859052600090611cfa90611cf29060a00160405160208183030381529060405280519060200120612c79565b858585612cc7565b9050611d0581612cef565b8614611d535760405162461bcd60e51b815260206004820152601960248201527f4552433230566f7465733a20696e76616c6964206e6f6e636500000000000000604482015260640161069d565b611d5d8188612934565b50505050505050565b83421115611db65760405162461bcd60e51b815260206004820152601d60248201527f45524332305065726d69743a206578706972656420646561646c696e65000000604482015260640161069d565b60007f0000000000000000000000000000000000000000000000000000000000000000888888611de58c612cef565b6040805160208101969096526001600160a01b0394851690860152929091166060840152608083015260a082015260c0810186905260e0016040516020818303038152906040528051906020012090506000611e4082612c79565b90506000611e5082878787612cc7565b9050896001600160a01b0316816001600160a01b031614611eb35760405162461bcd60e51b815260206004820152601e60248201527f45524332305065726d69743a20696e76616c6964207369676e61747572650000604482015260640161069d565b611ebe8a8a8a612369565b50505050505050505050565b600a6020908152600092835260408084209091529082529020805460018201546002830154600384015460048501805460ff9095169593946001600160a01b03909316939192611f1990613d5e565b80601f0160208091040260200160405190810160405280929190818152602001828054611f4590613d5e565b8015611f925780601f10611f6757610100808354040283529160200191611f92565b820191906000526020600020905b815481529060010190602001808311611f7557829003601f168201915b5050505050908060050154908060060154905087565b60408051808201909152600080825260208201526001600160a01b0383166000908152600860205260409020805463ffffffff8416908110611fec57611fec613dda565b60009182526020918290206040805180820190915291015463ffffffff8116825264010000000090046001600160e01b0316918101919091529392505050565b6005546001600160a01b0361010090910416331461205c5760405162461bcd60e51b815260040161069d90613c78565b6001600160a01b0381166120c15760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b606482015260840161069d565b610b4c816129ad565b6120d4828261215a565b6002546001600160e01b0310156121465760405162461bcd60e51b815260206004820152603060248201527f4552433230566f7465733a20746f74616c20737570706c79207269736b73206f60448201526f766572666c6f77696e6720766f74657360801b606482015260840161069d565b612154600961224d83612d17565b50505050565b6001600160a01b0382166121b05760405162461bcd60e51b815260206004820152601f60248201527f45524332303a206d696e7420746f20746865207a65726f206164647265737300604482015260640161069d565b6121bc60008383612e90565b80600260008282546121ce9190613cee565b90915550506001600160a01b038216600090815260208190526040812080548392906121fb908490613cee565b90915550506040518181526001600160a01b038316906000907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9060200160405180910390a3610b3e60008383612ed6565b6000610ac38284613cee565b60006001600160e01b038211156122c25760405162461bcd60e51b815260206004820152602760248201527f53616665436173743a2076616c756520646f65736e27742066697420696e20326044820152663234206269747360c81b606482015260840161069d565b5090565b600063ffffffff8211156122c25760405162461bcd60e51b815260206004820152602660248201527f53616665436173743a2076616c756520646f65736e27742066697420696e203360448201526532206269747360d01b606482015260840161069d565b6001600160a01b038381166000908152600760205260408082205485841683529120546116f992918216911683612ee1565b6000610ac38284613d47565b6001600160a01b0383166123cb5760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b606482015260840161069d565b6001600160a01b03821661242c5760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b606482015260840161069d565b6001600160a01b0383811660008181526001602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b60005b815151811015610b3e576001600d6000846000015184815181106124b6576124b6613dda565b60200260200101516001600160a01b03166001600160a01b0316815260200190815260200160002060000160008282546124f09190613cee565b9091555081905061250081613d93565b915050612490565b6001600160a01b03831661256c5760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b606482015260840161069d565b6001600160a01b0382166125ce5760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b606482015260840161069d565b6125d9838383612e90565b6001600160a01b038316600090815260208190526040902054818110156126515760405162461bcd60e51b815260206004820152602660248201527f45524332303a207472616e7366657220616d6f756e7420657863656564732062604482015265616c616e636560d01b606482015260840161069d565b6001600160a01b03808516600090815260208190526040808220858503905591851681529081208054849290612688908490613cee565b92505081905550826001600160a01b0316846001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040516126d491815260200190565b60405180910390a3612154848484612ed6565b60007f000000000000000000000000000000000000000000000000000000000000000046141561273657507f000000000000000000000000000000000000000000000000000000000000000090565b50604080517f00000000000000000000000000000000000000000000000000000000000000006020808301919091527f0000000000000000000000000000000000000000000000000000000000000000828401527f000000000000000000000000000000000000000000000000000000000000000060608301524660808301523060a0808401919091528351808403909101815260c0909201909252805191012090565b8154600090815b8181101561283e5760006127f5828461301e565b90508486828154811061280a5761280a613dda565b60009182526020909120015463ffffffff16111561282a57809250612838565b612835816001613cee565b91505b506127e1565b81156128825784612850600184613d47565b8154811061286057612860613dda565b60009182526020909120015464010000000090046001600160e01b0316612885565b60005b6001600160e01b031695945050505050565b60055460ff166128e05760405162461bcd60e51b815260206004820152601460248201527314185d5cd8589b194e881b9bdd081c185d5cd95960621b604482015260640161069d565b6005805460ff191690557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa335b6040516001600160a01b03909116815260200160405180910390a1565b610b3e82826120ca565b6001600160a01b038281166000818152600760208181526040808420805485845282862054949093528787166001600160a01b03198416811790915590519190951694919391928592917f3134e8a2e6d97e929a7e54011ea5485d7d196dd5f0ba4d4ef95803e8e3fc257f9190a4612154828483612ee1565b600580546001600160a01b03838116610100818102610100600160a81b031985161790945560405193909204169182907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b60055460ff1615612a4d5760405162461bcd60e51b815260206004820152601060248201526f14185d5cd8589b194e881c185d5cd95960821b604482015260640161069d565b6005805460ff191660011790557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a25861290d3390565b60008080612a8f85613039565b905060005b855151811015612c65576000306001600160a01b03166370a0823188600001518481518110612ac557612ac5613dda565b60200260200101516040518263ffffffff1660e01b8152600401612af891906001600160a01b0391909116815260200190565b60206040518083038186803b158015612b1057600080fd5b505afa158015612b24573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612b489190613b69565b90508015612c52576000612b5c8285613d06565b612b669088613d06565b90506000612b9189600001518581518110612b8357612b83613dda565b60200260200101518361310c565b90508015612c4f5788518051309163a9059cbb9187908110612bb557612bb5613dda565b6020026020010151836040518363ffffffff1660e01b8152600401612bef9291906001600160a01b03929092168252602082015260400190565b602060405180830381600087803b158015612c0957600080fd5b505af1158015612c1d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612c419190613b33565b50612c4c8187613cee565b95505b50505b5080612c5d81613d93565b915050612a94565b5090949350505050565b610b3e8282613164565b6000610bb5612c866126e7565b8360405161190160f01b6020820152602281018390526042810182905260009060620160405160208183030381529060405280519060200120905092915050565b6000806000612cd88787878761317c565b91509150612ce581613269565b5095945050505050565b6001600160a01b03811660009081526006602052604090208054600181018255905b50919050565b825460009081908015612d625785612d30600183613d47565b81548110612d4057612d40613dda565b60009182526020909120015464010000000090046001600160e01b0316612d65565b60005b6001600160e01b03169250612d7e83858763ffffffff16565b9150600081118015612dbc57504386612d98600184613d47565b81548110612da857612da8613dda565b60009182526020909120015463ffffffff16145b15612e1c57612dca82612259565b86612dd6600184613d47565b81548110612de657612de6613dda565b9060005260206000200160000160046101000a8154816001600160e01b0302191690836001600160e01b03160217905550612e87565b856040518060400160405280612e31436122c6565b63ffffffff168152602001612e4585612259565b6001600160e01b0390811690915282546001810184556000938452602093849020835194909301519091166401000000000263ffffffff909316929092179101555b50935093915050565b60055460ff16156116f95760405162461bcd60e51b815260206004820152601060248201526f14185d5cd8589b194e881c185d5cd95960821b604482015260640161069d565b6116f983838361232b565b816001600160a01b0316836001600160a01b031614158015612f035750600081115b156116f9576001600160a01b03831615612f91576001600160a01b03831660009081526008602052604081208190612f3e9061235d85612d17565b91509150846001600160a01b03167fdec2bacdd2f05b59de34da9b523dff8be42e5e38e818c82fdb0bae774387a7248383604051612f86929190918252602082015260400190565b60405180910390a250505b6001600160a01b038216156116f9576001600160a01b03821660009081526008602052604081208190612fc79061224d85612d17565b91509150836001600160a01b03167fdec2bacdd2f05b59de34da9b523dff8be42e5e38e818c82fdb0bae774387a724838360405161300f929190918252602082015260400190565b60405180910390a25050505050565b600061302d6002848418613d06565b610ac390848416613cee565b600080805b835151811015613105578351805130916370a08231918490811061306457613064613dda565b60200260200101516040518263ffffffff1660e01b815260040161309791906001600160a01b0391909116815260200190565b60206040518083038186803b1580156130af57600080fd5b505afa1580156130c3573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906130e79190613b69565b6130f19083613cee565b9150806130fd81613d93565b91505061303e565b5092915050565b6001600160a01b0382166000908152600d60205260408120805460019091015482919061313a906064613d28565b6131449190613d06565b905060646131528285613d28565b61315c9190613d06565b949350505050565b61316e8282613424565b612154600961235d83612d17565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a08311156131b35750600090506003613260565b8460ff16601b141580156131cb57508460ff16601c14155b156131dc5750600090506004613260565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa158015613230573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b03811661325957600060019250925050613260565b9150600090505b94509492505050565b600081600481111561327d5761327d613dc4565b14156132865750565b600181600481111561329a5761329a613dc4565b14156132e85760405162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e61747572650000000000000000604482015260640161069d565b60028160048111156132fc576132fc613dc4565b141561334a5760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e67746800604482015260640161069d565b600381600481111561335e5761335e613dc4565b14156133b75760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c604482015261756560f01b606482015260840161069d565b60048160048111156133cb576133cb613dc4565b1415610b4c5760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202776272076616c604482015261756560f01b606482015260840161069d565b6001600160a01b0382166134845760405162461bcd60e51b815260206004820152602160248201527f45524332303a206275726e2066726f6d20746865207a65726f206164647265736044820152607360f81b606482015260840161069d565b61349082600083612e90565b6001600160a01b038216600090815260208190526040902054818110156135045760405162461bcd60e51b815260206004820152602260248201527f45524332303a206275726e20616d6f756e7420657863656564732062616c616e604482015261636560f01b606482015260840161069d565b6001600160a01b0383166000908152602081905260408120838303905560028054849290613533908490613d47565b90915550506040518281526000906001600160a01b038516907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9060200160405180910390a36116f983600084612ed6565b82805461359190613d5e565b90600052602060002090601f0160209004810192826135b357600085556135f9565b82601f106135cc57805160ff19168380011785556135f9565b828001600101855582156135f9579182015b828111156135f95782518255916020019190600101906135de565b506122c29291506136e7565b50805461361190613d5e565b6000825580601f10613621575050565b601f016020900490600052602060002090810190610b4c91906136e7565b8280548282559060005260206000209081019282156135f9579160200282015b828111156135f95781546001600160a01b0319166001600160a01b0384351617825560209092019160019091019061365f565b8280548282559060005260206000209081019282156135f9579160200282015b828111156135f957825182546001600160a01b0319166001600160a01b039091161782556020909201916001909101906136b2565b5b808211156122c257600081556001016136e8565b60008083601f84011261370e57600080fd5b50813567ffffffffffffffff81111561372657600080fd5b6020830191508360208260051b850101111561374157600080fd5b9250929050565b60008083601f84011261375a57600080fd5b50813567ffffffffffffffff81111561377257600080fd5b60208301915083602082850101111561374157600080fd5b803560ff81168114611b5257600080fd5b6000602082840312156137ad57600080fd5b8135610ac381613df0565b6000602082840312156137ca57600080fd5b8151610ac381613df0565b600080604083850312156137e857600080fd5b82356137f381613df0565b9150602083013561380381613df0565b809150509250929050565b60008060006060848603121561382357600080fd5b833561382e81613df0565b9250602084013561383e81613df0565b929592945050506040919091013590565b600080600080600080600060e0888a03121561386a57600080fd5b873561387581613df0565b9650602088013561388581613df0565b955060408801359450606088013593506138a16080890161378a565b925060a0880135915060c0880135905092959891949750929550565b60008060008060008060a087890312156138d657600080fd5b86356138e181613df0565b9550602087013567ffffffffffffffff8111156138fd57600080fd5b61390989828a016136fc565b979a90995096976040810135976060820135975060809091013595509350505050565b6000806040838503121561393f57600080fd5b823561394a81613df0565b946020939093013593505050565b60008060006060848603121561396d57600080fd5b833561397881613df0565b925060208401359150604084013561398f81613e05565b809150509250925092565b600080600080606085870312156139b057600080fd5b84356139bb81613df0565b935060208501359250604085013567ffffffffffffffff8111156139de57600080fd5b6139ea87828801613748565b95989497509550505050565b600080600080600060808688031215613a0e57600080fd5b8535613a1981613df0565b94506020860135935060408601359250606086013567ffffffffffffffff811115613a4357600080fd5b613a4f88828901613748565b969995985093965092949392505050565b60008060008060008060c08789031215613a7957600080fd5b8635613a8481613df0565b95506020870135945060408701359350613aa06060880161378a565b92506080870135915060a087013590509295509295509295565b60008060408385031215613acd57600080fd5b8235613ad881613df0565b9150602083013563ffffffff8116811461380357600080fd5b60008060208385031215613b0457600080fd5b823567ffffffffffffffff811115613b1b57600080fd5b613b27858286016136fc565b90969095509350505050565b600060208284031215613b4557600080fd5b8151610ac381613e05565b600060208284031215613b6257600080fd5b5035919050565b600060208284031215613b7b57600080fd5b5051919050565b6000815180845260005b81811015613ba857602081850181015186830182015201613b8c565b81811115613bba576000602083870101525b50601f01601f19169290920160200192915050565b600060048910613bef57634e487b7160e01b600052602160045260246000fd5b88825287602083015260018060a01b038716604083015285606083015260e06080830152613c2060e0830186613b82565b60a08301949094525060c0015295945050505050565b60208152816020820152818360408301376000818301604090810191909152601f909201601f19160101919050565b602081526000610ac36020830184613b82565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b60208082526021908201527f4f6e6c7920736572766963652063616e2063616c6c2074686973206d6574686f6040820152601960fa1b606082015260800190565b60008219821115613d0157613d01613dae565b500190565b600082613d2357634e487b7160e01b600052601260045260246000fd5b500490565b6000816000190483118215151615613d4257613d42613dae565b500290565b600082821015613d5957613d59613dae565b500390565b600181811c90821680613d7257607f821691505b60208210811415612d1157634e487b7160e01b600052602260045260246000fd5b6000600019821415613da757613da7613dae565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052602160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b6001600160a01b0381168114610b4c57600080fd5b8015158114610b4c57600080fdfea2646970667358221220e5989ce76693a988e7a5c58c56a53a770a313d10010f4d363affd1e5c1af025e64736f6c63430008070033dec2bacdd2f05b59de34da9b523dff8be42e5e38e818c82fdb0bae774387a724
Deployed ByteCode
0x608060405234801561001057600080fd5b50600436106102535760003560e01c806373b4bd6f11610146578063a9059cbb116100c3578063dd62ed3e11610087578063dd62ed3e14610563578063e4a7c46f1461059c578063ebd30af4146105bc578063f1127ed8146105e2578063f2fde38b1461061f578063fa52c7d81461063257600080fd5b8063a9059cbb14610504578063a9e7c2e514610517578063c0f99d671461052a578063c3cda5201461053d578063d505accf1461055057600080fd5b80638e539e8c1161010a5780638e539e8c146104b05780639300c926146104c357806395d89b41146104d65780639ab24eb0146104de578063a457c2d7146104f157600080fd5b806373b4bd6f146104595780637ecebe001461046c5780638456cb591461047f57806389bf146a146104875780638da5cb5b1461049a57600080fd5b80633f4ba83a116101d457806363de06f81161019857806363de06f8146103a05780636d966d01146103b35780636fcfff451461040057806370a0823114610428578063715018a61461045157600080fd5b80633f4ba83a1461032357806340c10f191461032b578063587cde1e1461033e5780635c19a95c146103825780635c975abb1461039557600080fd5b806323b872dd1161021b57806323b872dd146102d3578063313ce567146102e65780633644e515146102f557806339509351146102fd5780633a46b1a81461031057600080fd5b806304f32b5d1461025857806306fdde031461026d578063095ea7b31461028b5780630e53e633146102ae57806318160ddd146102c1575b600080fd5b61026b61026636600461399a565b61066e565b005b6102756106fa565b6040516102829190613c65565b60405180910390f35b61029e61029936600461392c565b61078c565b6040519015158152602001610282565b61026b6102bc36600461392c565b6107a2565b6002545b604051908152602001610282565b61029e6102e136600461380e565b61095b565b60405160128152602001610282565b6102c5610a05565b61029e61030b36600461392c565b610a14565b6102c561031e36600461392c565b610a50565b61026b610aca565b61026b61033936600461392c565b610b04565b61036a61034c36600461379b565b6001600160a01b039081166000908152600760205260409020541690565b6040516001600160a01b039091168152602001610282565b61026b61039036600461379b565b610b42565b60055460ff1661029e565b61026b6103ae366004613b50565b610b4f565b6103e56103c136600461379b565b600c6020526000908152604090206001810154600282015460039092015490919083565b60408051938452602084019290925290820152606001610282565b61041361040e36600461379b565b610b93565b60405163ffffffff9091168152602001610282565b6102c561043636600461379b565b6001600160a01b031660009081526020819052604090205490565b61026b610bbb565b61026b6104673660046139f6565b610bf5565b6102c561047a36600461379b565b610ec0565b61026b610ede565b61026b610495366004613958565b610f16565b60055461010090046001600160a01b031661036a565b6102c56104be366004613b50565b6116fe565b61026b6104d1366004613af1565b61175a565b6102756117a3565b6102c56104ec36600461379b565b6117b2565b61029e6104ff36600461392c565b611839565b61029e61051236600461392c565b6118d2565b61029e610525366004613b50565b611a31565b61026b6105383660046138bd565b611b57565b61026b61054b366004613a60565b611c30565b61026b61055e36600461384f565b611d66565b6102c56105713660046137d5565b6001600160a01b03918216600090815260016020908152604080832093909416825291909152205490565b6102c56105aa36600461379b565b600b6020526000908152604090205481565b6105cf6105ca36600461392c565b611eca565b6040516102829796959493929190613bcf565b6105f56105f0366004613aba565b611fa8565b60408051825163ffffffff1681526020928301516001600160e01b03169281019290925201610282565b61026b61062d36600461379b565b61202c565b61065961064036600461379b565b600d602052600090815260409020805460019091015482565b60408051928352602083019190915201610282565b336000908152600c60205260409020600101546106a65760405162461bcd60e51b815260040161069d90613cad565b60405180910390fd5b82336001600160a01b0316856001600160a01b03167fb67fab32200b6a6d186136689c0b4c4072ae0bd5dd17b98fb8105d1b9747939985856040516106ec929190613c36565b60405180910390a450505050565b60606003805461070990613d5e565b80601f016020809104026020016040519081016040528092919081815260200182805461073590613d5e565b80156107825780601f1061075757610100808354040283529160200191610782565b820191906000526020600020905b81548152906001019060200180831161076557829003601f168201915b5050505050905090565b6000610799338484612369565b50600192915050565b336000908152600c60205260409020600101546107d15760405162461bcd60e51b815260040161069d90613cad565b60016001600160a01b0383166000908152600a6020908152604080832085845290915290205460ff16600381111561080b5761080b613dc4565b146108585760405162461bcd60e51b815260206004820152601860248201527f43616e6e6f74207374617274207465726d696e6174696f6e0000000000000000604482015260640161069d565b6001600160a01b038281166000908152600a6020908152604080832085845282528083208054600260ff199091168117825501549093168252600c8152908290208251815460a0938102820184019094526080810184815261091f949193849284918401828280156108f357602002820191906000526020600020905b81546001600160a01b031681526001909101906020018083116108d5575b50505050508152602001600182015481526020016002820154815260200160038201548152505061248d565b604051819033906001600160a01b038516907f3dc016b59ffc70a71e689716c312b2b7415f9e4f11803ff7cc3730801811497a90600090a45050565b6000610968848484612508565b6001600160a01b0384166000908152600160209081526040808320338452909152902054828110156109ed5760405162461bcd60e51b815260206004820152602860248201527f45524332303a207472616e7366657220616d6f756e74206578636565647320616044820152676c6c6f77616e636560c01b606482015260840161069d565b6109fa8533858403612369565b506001949350505050565b6000610a0f6126e7565b905090565b3360008181526001602090815260408083206001600160a01b03871684529091528120549091610799918590610a4b908690613cee565b612369565b6000438210610aa15760405162461bcd60e51b815260206004820152601f60248201527f4552433230566f7465733a20626c6f636b206e6f7420796574206d696e656400604482015260640161069d565b6001600160a01b0383166000908152600860205260409020610ac390836127da565b9392505050565b6005546001600160a01b03610100909104163314610afa5760405162461bcd60e51b815260040161069d90613c78565b610b02612897565b565b6005546001600160a01b03610100909104163314610b345760405162461bcd60e51b815260040161069d90613c78565b610b3e828261292a565b5050565b610b4c3382612934565b50565b336000908152600c6020526040902060010154610b7e5760405162461bcd60e51b815260040161069d90613cad565b336000908152600c6020526040902060030155565b6001600160a01b038116600090815260086020526040812054610bb5906122c6565b92915050565b6005546001600160a01b03610100909104163314610beb5760405162461bcd60e51b815260040161069d90613c78565b610b0260006129ad565b6001600160a01b0385166000908152600c6020526040902060010154610c695760405162461bcd60e51b815260206004820152602360248201527f52657175657374656420736572766963652061646472657373206e6f7420666f6044820152621d5b9960ea1b606482015260840161069d565b336000908152600a602090815260408083208684529091529020600201546001600160a01b031615610cf45760405162461bcd60e51b815260206004820152602e60248201527f50726f636573732077697468207370656369666965642070726f64756374496460448201526d08185b1c9958591e48195e1a5cdd60921b606482015260840161069d565b6040805160e081019091528060008152602001858152602001866001600160a01b0316815260200184815260200183838080601f016020809104026020016040519081016040528093929190818152602001838380828437600092018290525093855250505060208083018290526040928301829052338252600a815282822087835290522081518154829060ff19166001836003811115610d9857610d98613dc4565b0217905550602082810151600183015560408301516002830180546001600160a01b0319166001600160a01b039092169190911790556060830151600383015560808301518051610def9260048501920190613585565b5060a0820151600582015560c090910151600690910155336000908152600a60209081526040808320600b835281842054845290915281205460ff166003811115610e3c57610e3c613dc4565b1415610eaa57336000908152600a60209081526040808320600b83528184205484529091528120805460ff19168155600181018290556002810180546001600160a01b03191690556003810182905590610e996004830182613605565b506000600582018190556006909101555b5050336000908152600b60205260409020555050565b6001600160a01b038116600090815260066020526040812054610bb5565b6005546001600160a01b03610100909104163314610f0e5760405162461bcd60e51b815260040161069d90613c78565b610b02612a07565b336000908152600d6020526040902054610f7e5760405162461bcd60e51b815260206004820152602360248201527f4f6e6c792076616c696461746f722063616e2063616c6c2074686973206d65746044820152621a1bd960ea1b606482015260840161069d565b60026001600160a01b0384166000908152600a6020908152604080832086845290915290205460ff166003811115610fb857610fb8613dc4565b10156110065760405162461bcd60e51b815260206004820152601860248201527f43616e6e6f742076616c69646174652064656c69766172790000000000000000604482015260640161069d565b801561104e576001600160a01b0383166000908152600a602090815260408083208584529091528120600501805460019290611043908490613cee565b9091555061108b9050565b6001600160a01b0383166000908152600a602090815260408083208584529091528120600601805460019290611085908490613cee565b90915550505b336000908152600d6020526040812060019081018054919290916110b0908490613cee565b90915550600290506001600160a01b0384166000908152600a6020908152604080832086845290915290205460ff1660038111156110f0576110f0613dc4565b14156116f9576001600160a01b038084166000908152600a6020908152604080832086845282528083206002908101549094168352600c9091529020546111379190613d06565b6001600160a01b0384166000908152600a602090815260408083208684529091529020600501541115611446576001600160a01b038381166000908152600a60209081526040808320868452808352818420805460ff1916600317815560028101549095168452600c83529083206001908101548785529190925292015490916064916111c49190613d28565b6111ce9190613d06565b6001600160a01b038086166000908152600a602090815260408083208884528252808320600201549093168252600c81528282208351815460a09381028201840190955260808101858152959650929461128e9491928492849184018282801561126157602002820191906000526020600020905b81546001600160a01b03168152600190910190602001808311611243575b50505050508152602001600182015481526020016002820154815260200160038201548152505083612a82565b6001600160a01b038087166000908152600a602090815260408083208984528083528184206002808201549096168552600c8452918420909401548984529390915260010154929350916064916112e491613d28565b6112ee9190613d06565b6001600160a01b038781166000908152600a602090815260408083208a84529091529081902060020154905163a9059cbb60e01b81529116600482015260248101829052909150309063a9059cbb90604401602060405180830381600087803b15801561135a57600080fd5b505af115801561136e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113929190613b33565b506001600160a01b0386166000908152600a602090815260408083208884529091529020600101546113dc90309083906113cd908690613d47565b6113d79190613d47565b612c6f565b6001600160a01b038681166000818152600a602090815260408083208a84528252918290206002015491516001815289949290921692917f5c2cc6518d5891ba2f9c21f49d712982ba12450a2a8adeb21e4a41f85a995b70910160405180910390a4505050505050565b6001600160a01b038084166000908152600a6020908152604080832086845282528083206002908101549094168352600c9091529020546114879190613d06565b6001600160a01b0384166000908152600a60209081526040808320868452909152902060060154106116f9576001600160a01b038381166000908152600a60209081526040808320868452808352818420805460ff1916600317815560028101549095168452600c83529083206001908101548785529190925292015490916064916115139190613d28565b61151d9190613d06565b6001600160a01b038086166000908152600a602090815260408083208884528252808320600201549093168252600c81528282208351815460a0938102820184019095526080810185815295965092946115db94919284928491840182828015611261576020028201919060005260206000209081546001600160a01b031681526001909101906020018083116112435750505050508152602001600182015481526020016002820154815260200160038201548152505083612a82565b6001600160a01b0386166000908152600a60209081526040808320888452909152902060010154909150309063a9059cbb90879061161a908590613d47565b6040516001600160e01b031960e085901b1681526001600160a01b0390921660048301526024820152604401602060405180830381600087803b15801561166057600080fd5b505af1158015611674573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906116989190613b33565b506001600160a01b038581166000818152600a60209081526040808320898452825280832060020154905192835288941692917f5c2cc6518d5891ba2f9c21f49d712982ba12450a2a8adeb21e4a41f85a995b70910160405180910390a450505b505050565b600043821061174f5760405162461bcd60e51b815260206004820152601f60248201527f4552433230566f7465733a20626c6f636b206e6f7420796574206d696e656400604482015260640161069d565b610bb56009836127da565b336000908152600c60205260409020600101546117895760405162461bcd60e51b815260040161069d90613cad565b336000908152600c602052604090206116f990838361363f565b60606004805461070990613d5e565b6001600160a01b0381166000908152600860205260408120548015611826576001600160a01b03831660009081526008602052604090206117f4600183613d47565b8154811061180457611804613dda565b60009182526020909120015464010000000090046001600160e01b0316611829565b60005b6001600160e01b03169392505050565b3360009081526001602090815260408083206001600160a01b0386168452909152812054828110156118bb5760405162461bcd60e51b815260206004820152602560248201527f45524332303a2064656372656173656420616c6c6f77616e63652062656c6f77604482015264207a65726f60d81b606482015260840161069d565b6118c83385858403612369565b5060019392505050565b60006001600160a01b038316301415611a2857336000908152600a60209081526040808320600b835281842054845290915281205460ff16600381111561191b5761191b613dc4565b146119985760405162461bcd60e51b815260206004820152604160248201527f596f7520646f6e277420686176652061206465706f736974206177616974696e60448201527f672070726f636573732c20706c656173652063726561746520697420666972736064820152601d60fa1b608482015260a40161069d565b6119a4335b8484612508565b336000818152600a60209081526040808320600b835281842080548552908352818420805460ff19166001179055548352918290206003810154600290910154925186815290936001600160a01b0390931692917f1f0f1dee49a1720a0d98e3a0575a04dd9f143ff5e29555c3085471c1c70eed5b910160405180910390a4610799565b6107993361199d565b6040516370a0823160e01b81523360048201526000906801158e460913d000009030906370a082319060240160206040518083038186803b158015611a7557600080fd5b505afa158015611a89573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611aad9190613b69565b108015611ac2575068056bc75e2d6310000082105b15611b4a57611b42306001600160a01b0316638da5cb5b6040518163ffffffff1660e01b815260040160206040518083038186803b158015611b0357600080fd5b505afa158015611b17573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611b3b91906137b8565b3384612508565b506001919050565b506000919050565b919050565b6005546001600160a01b03610100909104163314611b875760405162461bcd60e51b815260040161069d90613c78565b604051806080016040528086868080602002602001604051908101604052809392919081815260200183836020028082843760009201829052509385525050506020808301879052604080840187905260609093018590526001600160a01b038a168252600c8152919020825180519192611c0792849290910190613692565b506020820151600182015560408201516002820155606090910151600390910155505050505050565b83421115611c805760405162461bcd60e51b815260206004820152601d60248201527f4552433230566f7465733a207369676e61747572652065787069726564000000604482015260640161069d565b604080517fe48329057bfd03d55e49b547132e39cffd9c1820ad7b9d4c5307691425d15adf60208201526001600160a01b038816918101919091526060810186905260808101859052600090611cfa90611cf29060a00160405160208183030381529060405280519060200120612c79565b858585612cc7565b9050611d0581612cef565b8614611d535760405162461bcd60e51b815260206004820152601960248201527f4552433230566f7465733a20696e76616c6964206e6f6e636500000000000000604482015260640161069d565b611d5d8188612934565b50505050505050565b83421115611db65760405162461bcd60e51b815260206004820152601d60248201527f45524332305065726d69743a206578706972656420646561646c696e65000000604482015260640161069d565b60007f6e71edae12b1b97f4d1f60370fef10105fa2faae0126114a169c64845d6126c9888888611de58c612cef565b6040805160208101969096526001600160a01b0394851690860152929091166060840152608083015260a082015260c0810186905260e0016040516020818303038152906040528051906020012090506000611e4082612c79565b90506000611e5082878787612cc7565b9050896001600160a01b0316816001600160a01b031614611eb35760405162461bcd60e51b815260206004820152601e60248201527f45524332305065726d69743a20696e76616c6964207369676e61747572650000604482015260640161069d565b611ebe8a8a8a612369565b50505050505050505050565b600a6020908152600092835260408084209091529082529020805460018201546002830154600384015460048501805460ff9095169593946001600160a01b03909316939192611f1990613d5e565b80601f0160208091040260200160405190810160405280929190818152602001828054611f4590613d5e565b8015611f925780601f10611f6757610100808354040283529160200191611f92565b820191906000526020600020905b815481529060010190602001808311611f7557829003601f168201915b5050505050908060050154908060060154905087565b60408051808201909152600080825260208201526001600160a01b0383166000908152600860205260409020805463ffffffff8416908110611fec57611fec613dda565b60009182526020918290206040805180820190915291015463ffffffff8116825264010000000090046001600160e01b0316918101919091529392505050565b6005546001600160a01b0361010090910416331461205c5760405162461bcd60e51b815260040161069d90613c78565b6001600160a01b0381166120c15760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b606482015260840161069d565b610b4c816129ad565b6120d4828261215a565b6002546001600160e01b0310156121465760405162461bcd60e51b815260206004820152603060248201527f4552433230566f7465733a20746f74616c20737570706c79207269736b73206f60448201526f766572666c6f77696e6720766f74657360801b606482015260840161069d565b612154600961224d83612d17565b50505050565b6001600160a01b0382166121b05760405162461bcd60e51b815260206004820152601f60248201527f45524332303a206d696e7420746f20746865207a65726f206164647265737300604482015260640161069d565b6121bc60008383612e90565b80600260008282546121ce9190613cee565b90915550506001600160a01b038216600090815260208190526040812080548392906121fb908490613cee565b90915550506040518181526001600160a01b038316906000907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9060200160405180910390a3610b3e60008383612ed6565b6000610ac38284613cee565b60006001600160e01b038211156122c25760405162461bcd60e51b815260206004820152602760248201527f53616665436173743a2076616c756520646f65736e27742066697420696e20326044820152663234206269747360c81b606482015260840161069d565b5090565b600063ffffffff8211156122c25760405162461bcd60e51b815260206004820152602660248201527f53616665436173743a2076616c756520646f65736e27742066697420696e203360448201526532206269747360d01b606482015260840161069d565b6001600160a01b038381166000908152600760205260408082205485841683529120546116f992918216911683612ee1565b6000610ac38284613d47565b6001600160a01b0383166123cb5760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b606482015260840161069d565b6001600160a01b03821661242c5760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b606482015260840161069d565b6001600160a01b0383811660008181526001602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b60005b815151811015610b3e576001600d6000846000015184815181106124b6576124b6613dda565b60200260200101516001600160a01b03166001600160a01b0316815260200190815260200160002060000160008282546124f09190613cee565b9091555081905061250081613d93565b915050612490565b6001600160a01b03831661256c5760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b606482015260840161069d565b6001600160a01b0382166125ce5760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b606482015260840161069d565b6125d9838383612e90565b6001600160a01b038316600090815260208190526040902054818110156126515760405162461bcd60e51b815260206004820152602660248201527f45524332303a207472616e7366657220616d6f756e7420657863656564732062604482015265616c616e636560d01b606482015260840161069d565b6001600160a01b03808516600090815260208190526040808220858503905591851681529081208054849290612688908490613cee565b92505081905550826001600160a01b0316846001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040516126d491815260200190565b60405180910390a3612154848484612ed6565b60007f000000000000000000000000000000000000000000000000000000000000aef346141561273657507fc55bbb699cf9077af68b90f77796bfd744b313d81ec9250120eb533928d9b60790565b50604080517f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f6020808301919091527ff63d9825e7d575d1e406ce55e897bded8d13828ce455c395f670da7f6c3cfa5e828401527fc89efdaa54c0f20c7adf612882df0950f5a951637e0307cdcb4c672f298b8bc660608301524660808301523060a0808401919091528351808403909101815260c0909201909252805191012090565b8154600090815b8181101561283e5760006127f5828461301e565b90508486828154811061280a5761280a613dda565b60009182526020909120015463ffffffff16111561282a57809250612838565b612835816001613cee565b91505b506127e1565b81156128825784612850600184613d47565b8154811061286057612860613dda565b60009182526020909120015464010000000090046001600160e01b0316612885565b60005b6001600160e01b031695945050505050565b60055460ff166128e05760405162461bcd60e51b815260206004820152601460248201527314185d5cd8589b194e881b9bdd081c185d5cd95960621b604482015260640161069d565b6005805460ff191690557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa335b6040516001600160a01b03909116815260200160405180910390a1565b610b3e82826120ca565b6001600160a01b038281166000818152600760208181526040808420805485845282862054949093528787166001600160a01b03198416811790915590519190951694919391928592917f3134e8a2e6d97e929a7e54011ea5485d7d196dd5f0ba4d4ef95803e8e3fc257f9190a4612154828483612ee1565b600580546001600160a01b03838116610100818102610100600160a81b031985161790945560405193909204169182907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b60055460ff1615612a4d5760405162461bcd60e51b815260206004820152601060248201526f14185d5cd8589b194e881c185d5cd95960821b604482015260640161069d565b6005805460ff191660011790557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a25861290d3390565b60008080612a8f85613039565b905060005b855151811015612c65576000306001600160a01b03166370a0823188600001518481518110612ac557612ac5613dda565b60200260200101516040518263ffffffff1660e01b8152600401612af891906001600160a01b0391909116815260200190565b60206040518083038186803b158015612b1057600080fd5b505afa158015612b24573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612b489190613b69565b90508015612c52576000612b5c8285613d06565b612b669088613d06565b90506000612b9189600001518581518110612b8357612b83613dda565b60200260200101518361310c565b90508015612c4f5788518051309163a9059cbb9187908110612bb557612bb5613dda565b6020026020010151836040518363ffffffff1660e01b8152600401612bef9291906001600160a01b03929092168252602082015260400190565b602060405180830381600087803b158015612c0957600080fd5b505af1158015612c1d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612c419190613b33565b50612c4c8187613cee565b95505b50505b5080612c5d81613d93565b915050612a94565b5090949350505050565b610b3e8282613164565b6000610bb5612c866126e7565b8360405161190160f01b6020820152602281018390526042810182905260009060620160405160208183030381529060405280519060200120905092915050565b6000806000612cd88787878761317c565b91509150612ce581613269565b5095945050505050565b6001600160a01b03811660009081526006602052604090208054600181018255905b50919050565b825460009081908015612d625785612d30600183613d47565b81548110612d4057612d40613dda565b60009182526020909120015464010000000090046001600160e01b0316612d65565b60005b6001600160e01b03169250612d7e83858763ffffffff16565b9150600081118015612dbc57504386612d98600184613d47565b81548110612da857612da8613dda565b60009182526020909120015463ffffffff16145b15612e1c57612dca82612259565b86612dd6600184613d47565b81548110612de657612de6613dda565b9060005260206000200160000160046101000a8154816001600160e01b0302191690836001600160e01b03160217905550612e87565b856040518060400160405280612e31436122c6565b63ffffffff168152602001612e4585612259565b6001600160e01b0390811690915282546001810184556000938452602093849020835194909301519091166401000000000263ffffffff909316929092179101555b50935093915050565b60055460ff16156116f95760405162461bcd60e51b815260206004820152601060248201526f14185d5cd8589b194e881c185d5cd95960821b604482015260640161069d565b6116f983838361232b565b816001600160a01b0316836001600160a01b031614158015612f035750600081115b156116f9576001600160a01b03831615612f91576001600160a01b03831660009081526008602052604081208190612f3e9061235d85612d17565b91509150846001600160a01b03167fdec2bacdd2f05b59de34da9b523dff8be42e5e38e818c82fdb0bae774387a7248383604051612f86929190918252602082015260400190565b60405180910390a250505b6001600160a01b038216156116f9576001600160a01b03821660009081526008602052604081208190612fc79061224d85612d17565b91509150836001600160a01b03167fdec2bacdd2f05b59de34da9b523dff8be42e5e38e818c82fdb0bae774387a724838360405161300f929190918252602082015260400190565b60405180910390a25050505050565b600061302d6002848418613d06565b610ac390848416613cee565b600080805b835151811015613105578351805130916370a08231918490811061306457613064613dda565b60200260200101516040518263ffffffff1660e01b815260040161309791906001600160a01b0391909116815260200190565b60206040518083038186803b1580156130af57600080fd5b505afa1580156130c3573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906130e79190613b69565b6130f19083613cee565b9150806130fd81613d93565b91505061303e565b5092915050565b6001600160a01b0382166000908152600d60205260408120805460019091015482919061313a906064613d28565b6131449190613d06565b905060646131528285613d28565b61315c9190613d06565b949350505050565b61316e8282613424565b612154600961235d83612d17565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a08311156131b35750600090506003613260565b8460ff16601b141580156131cb57508460ff16601c14155b156131dc5750600090506004613260565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa158015613230573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b03811661325957600060019250925050613260565b9150600090505b94509492505050565b600081600481111561327d5761327d613dc4565b14156132865750565b600181600481111561329a5761329a613dc4565b14156132e85760405162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e61747572650000000000000000604482015260640161069d565b60028160048111156132fc576132fc613dc4565b141561334a5760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e67746800604482015260640161069d565b600381600481111561335e5761335e613dc4565b14156133b75760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c604482015261756560f01b606482015260840161069d565b60048160048111156133cb576133cb613dc4565b1415610b4c5760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202776272076616c604482015261756560f01b606482015260840161069d565b6001600160a01b0382166134845760405162461bcd60e51b815260206004820152602160248201527f45524332303a206275726e2066726f6d20746865207a65726f206164647265736044820152607360f81b606482015260840161069d565b61349082600083612e90565b6001600160a01b038216600090815260208190526040902054818110156135045760405162461bcd60e51b815260206004820152602260248201527f45524332303a206275726e20616d6f756e7420657863656564732062616c616e604482015261636560f01b606482015260840161069d565b6001600160a01b0383166000908152602081905260408120838303905560028054849290613533908490613d47565b90915550506040518281526000906001600160a01b038516907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9060200160405180910390a36116f983600084612ed6565b82805461359190613d5e565b90600052602060002090601f0160209004810192826135b357600085556135f9565b82601f106135cc57805160ff19168380011785556135f9565b828001600101855582156135f9579182015b828111156135f95782518255916020019190600101906135de565b506122c29291506136e7565b50805461361190613d5e565b6000825580601f10613621575050565b601f016020900490600052602060002090810190610b4c91906136e7565b8280548282559060005260206000209081019282156135f9579160200282015b828111156135f95781546001600160a01b0319166001600160a01b0384351617825560209092019160019091019061365f565b8280548282559060005260206000209081019282156135f9579160200282015b828111156135f957825182546001600160a01b0319166001600160a01b039091161782556020909201916001909101906136b2565b5b808211156122c257600081556001016136e8565b60008083601f84011261370e57600080fd5b50813567ffffffffffffffff81111561372657600080fd5b6020830191508360208260051b850101111561374157600080fd5b9250929050565b60008083601f84011261375a57600080fd5b50813567ffffffffffffffff81111561377257600080fd5b60208301915083602082850101111561374157600080fd5b803560ff81168114611b5257600080fd5b6000602082840312156137ad57600080fd5b8135610ac381613df0565b6000602082840312156137ca57600080fd5b8151610ac381613df0565b600080604083850312156137e857600080fd5b82356137f381613df0565b9150602083013561380381613df0565b809150509250929050565b60008060006060848603121561382357600080fd5b833561382e81613df0565b9250602084013561383e81613df0565b929592945050506040919091013590565b600080600080600080600060e0888a03121561386a57600080fd5b873561387581613df0565b9650602088013561388581613df0565b955060408801359450606088013593506138a16080890161378a565b925060a0880135915060c0880135905092959891949750929550565b60008060008060008060a087890312156138d657600080fd5b86356138e181613df0565b9550602087013567ffffffffffffffff8111156138fd57600080fd5b61390989828a016136fc565b979a90995096976040810135976060820135975060809091013595509350505050565b6000806040838503121561393f57600080fd5b823561394a81613df0565b946020939093013593505050565b60008060006060848603121561396d57600080fd5b833561397881613df0565b925060208401359150604084013561398f81613e05565b809150509250925092565b600080600080606085870312156139b057600080fd5b84356139bb81613df0565b935060208501359250604085013567ffffffffffffffff8111156139de57600080fd5b6139ea87828801613748565b95989497509550505050565b600080600080600060808688031215613a0e57600080fd5b8535613a1981613df0565b94506020860135935060408601359250606086013567ffffffffffffffff811115613a4357600080fd5b613a4f88828901613748565b969995985093965092949392505050565b60008060008060008060c08789031215613a7957600080fd5b8635613a8481613df0565b95506020870135945060408701359350613aa06060880161378a565b92506080870135915060a087013590509295509295509295565b60008060408385031215613acd57600080fd5b8235613ad881613df0565b9150602083013563ffffffff8116811461380357600080fd5b60008060208385031215613b0457600080fd5b823567ffffffffffffffff811115613b1b57600080fd5b613b27858286016136fc565b90969095509350505050565b600060208284031215613b4557600080fd5b8151610ac381613e05565b600060208284031215613b6257600080fd5b5035919050565b600060208284031215613b7b57600080fd5b5051919050565b6000815180845260005b81811015613ba857602081850181015186830182015201613b8c565b81811115613bba576000602083870101525b50601f01601f19169290920160200192915050565b600060048910613bef57634e487b7160e01b600052602160045260246000fd5b88825287602083015260018060a01b038716604083015285606083015260e06080830152613c2060e0830186613b82565b60a08301949094525060c0015295945050505050565b60208152816020820152818360408301376000818301604090810191909152601f909201601f19160101919050565b602081526000610ac36020830184613b82565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b60208082526021908201527f4f6e6c7920736572766963652063616e2063616c6c2074686973206d6574686f6040820152601960fa1b606082015260800190565b60008219821115613d0157613d01613dae565b500190565b600082613d2357634e487b7160e01b600052601260045260246000fd5b500490565b6000816000190483118215151615613d4257613d42613dae565b500290565b600082821015613d5957613d59613dae565b500390565b600181811c90821680613d7257607f821691505b60208210811415612d1157634e487b7160e01b600052602260045260246000fd5b6000600019821415613da757613da7613dae565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052602160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b6001600160a01b0381168114610b4c57600080fd5b8015158114610b4c57600080fdfea2646970667358221220e5989ce76693a988e7a5c58c56a53a770a313d10010f4d363affd1e5c1af025e64736f6c63430008070033