Contract Overview
Balance:
0 xDAI
xDAI Value:
$0.00
My Name Tag:
Not Available, login to update
[ Download CSV Export ]
View more zero value Internal Transactions in Advanced View mode
Contract Name:
Redistribution
Compiler Version
v0.8.1+commit.df193b15
Contract Source Code (Solidity)
/** *Submitted for verification at gnosisscan.io on 2022-12-19 */ // Sources flattened with hardhat v2.11.2 https://hardhat.org // File src/OrderStatisticsTree/HitchensOrderStatisticsTreeLib.sol // pragma solidity ^0.8.1; /* Hitchens Order Statistics Tree v0.99 A Solidity Red-Black Tree library to store and maintain a sorted data structure in a Red-Black binary search tree, with O(log 2n) insert, remove and search time (and gas, approximately) https://github.com/rob-Hitchens/OrderStatisticsTree Copyright (c) Rob Hitchens. the MIT License Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. Significant portions from BokkyPooBahsRedBlackTreeLibrary, https://github.com/bokkypoobah/BokkyPooBahsRedBlackTreeLibrary THIS SOFTWARE IS NOT TESTED OR AUDITED. DO NOT USE FOR PRODUCTION. */ library HitchensOrderStatisticsTreeLib { uint private constant EMPTY = 0; struct Node { uint parent; uint left; uint right; bool red; bytes32[] keys; mapping(bytes32 => uint ) keyMap; uint count; } struct Tree { uint root; mapping(uint => Node) nodes; } function first(Tree storage self) internal view returns (uint _value) { _value = self.root; if (_value == EMPTY) return 0; while (self.nodes[_value].left != EMPTY) { _value = self.nodes[_value].left; } } function exists(Tree storage self, uint value) internal view returns (bool _exists) { if (value == EMPTY) return false; if (value == self.root) return true; if (self.nodes[value].parent != EMPTY) return true; return false; } function keyExists( Tree storage self, bytes32 key, uint value ) internal view returns (bool _exists) { if (!exists(self, value)) return false; return self.nodes[value].keys[self.nodes[value].keyMap[key]] == key; } function getNode(Tree storage self, uint value) internal view returns ( uint _parent, uint _left, uint _right, bool _red, uint keyCount, uint __count ) { require(exists(self, value), "OrderStatisticsTree(403) - Value does not exist."); Node storage gn = self.nodes[value]; return (gn.parent, gn.left, gn.right, gn.red, gn.keys.length, gn.keys.length + gn.count); } function getNodeCount(Tree storage self, uint value) internal view returns (uint __count) { Node storage gn = self.nodes[value]; return gn.keys.length + gn.count; } function valueKeyAtIndex( Tree storage self, uint value, uint index ) internal view returns (bytes32 _key) { require(exists(self, value), "OrderStatisticsTree(404) - Value does not exist."); return self.nodes[value].keys[index]; } function count(Tree storage self) internal view returns (uint _count) { return getNodeCount(self, self.root); } /* We don't use this functionality, so it is commented out to make audit easier function percentile(Tree storage self, uint value) internal view returns(uint _percentile) { uint denominator = count(self); uint numerator = rank(self, value); _percentile = ((uint(1000) * numerator)/denominator+(uint(5)))/uint(10); } function permil(Tree storage self, uint value) internal view returns(uint _permil) { uint denominator = count(self); uint numerator = rank(self, value); _permil = ((uint(10000) * numerator)/denominator+(uint(5)))/uint(10); } function atPercentile(Tree storage self, uint _percentile) internal view returns(uint _value) { uint findRank = (((_percentile * count(self))/uint(10)) + uint(5)) / uint(10); return atRank(self,findRank); } function atPermil(Tree storage self, uint _permil) internal view returns(uint _value) { uint findRank = (((_permil * count(self))/uint(100)) + uint(5)) / uint(10); return atRank(self,findRank); } function median(Tree storage self) internal view returns(uint value) { return atPercentile(self,50); } function below(Tree storage self, uint value) public view returns(uint _below) { if(count(self) > 0 && value > 0) _below = rank(self,value)-uint(1); } function above(Tree storage self, uint value) public view returns(uint _above) { if(count(self) > 0) _above = count(self)-rank(self,value); } function valueBelowEstimate(Tree storage self, uint estimate) public view returns(uint _below) { if(count(self) > 0 && estimate > 0) { uint highestValue = last(self); uint lowestValue = first(self); if(estimate < lowestValue) { return 0; } if(estimate >= highestValue) { return highestValue; } uint rankOfValue = rank(self, estimate); // approximation _below = atRank(self, rankOfValue); if(_below > estimate) { // fix error in approximation rankOfValue--; _below = atRank(self, rankOfValue); } } } function valueAboveEstimate(Tree storage self, uint estimate) public view returns(uint _above) { if(count(self) > 0 && estimate > 0) { uint highestValue = last(self); uint lowestValue = first(self); if(estimate > highestValue) { return 0; } if(estimate <= lowestValue) { return lowestValue; } uint rankOfValue = rank(self, estimate); // approximation _above = atRank(self, rankOfValue); if(_above < estimate) { // fix error in approximation rankOfValue++; _above = atRank(self, rankOfValue); } } } function rank(Tree storage self, uint value) internal view returns(uint _rank) { if(count(self) > 0) { bool finished; uint cursor = self.root; Node storage c = self.nodes[cursor]; uint smaller = getNodeCount(self,c.left); while (!finished) { uint keyCount = c.keys.length; if(cursor == value) { finished = true; } else { if(cursor < value) { cursor = c.right; c = self.nodes[cursor]; smaller += keyCount + getNodeCount(self,c.left); } else { cursor = c.left; c = self.nodes[cursor]; smaller -= (keyCount + getNodeCount(self,c.right)); } } if (!exists(self,cursor)) { finished = true; } } return smaller + 1; } } function atRank(Tree storage self, uint _rank) internal view returns(uint _value) { bool finished; uint cursor = self.root; Node storage c = self.nodes[cursor]; uint smaller = getNodeCount(self,c.left); while (!finished) { _value = cursor; c = self.nodes[cursor]; uint keyCount = c.keys.length; if(smaller + 1 >= _rank && smaller + keyCount <= _rank) { _value = cursor; finished = true; } else { if(smaller + keyCount <= _rank) { cursor = c.right; c = self.nodes[cursor]; smaller += keyCount + getNodeCount(self,c.left); } else { cursor = c.left; c = self.nodes[cursor]; smaller -= (keyCount + getNodeCount(self,c.right)); } } if (!exists(self,cursor)) { finished = true; } } } */ function insert( Tree storage self, bytes32 key, uint value ) internal { require(value != EMPTY, "OrderStatisticsTree(405) - Value to insert cannot be zero"); require( !keyExists(self, key, value), "OrderStatisticsTree(406) - Value and Key pair exists. Cannot be inserted again." ); uint cursor; uint probe = self.root; while (probe != EMPTY) { cursor = probe; if (value < probe) { probe = self.nodes[probe].left; } else if (value > probe) { probe = self.nodes[probe].right; } else if (value == probe) { self.nodes[probe].keys.push(key); self.nodes[probe].keyMap[key] = self.nodes[probe].keys.length - uint (1); return; } self.nodes[cursor].count++; } Node storage nValue = self.nodes[value]; nValue.parent = cursor; nValue.left = EMPTY; nValue.right = EMPTY; nValue.red = true; nValue.keys.push(key); nValue.keyMap[key] = nValue.keys.length - uint (1); if (cursor == EMPTY) { self.root = value; } else if (value < cursor) { self.nodes[cursor].left = value; } else { self.nodes[cursor].right = value; } insertFixup(self, value); } function remove( Tree storage self, bytes32 key, uint value ) internal { require(value != EMPTY, "OrderStatisticsTree(407) - Value to delete cannot be zero"); require(keyExists(self, key, value), "OrderStatisticsTree(408) - Value to delete does not exist."); Node storage nValue = self.nodes[value]; uint rowToDelete = nValue.keyMap[key]; bytes32 last = nValue.keys[nValue.keys.length - uint (1)]; nValue.keys[rowToDelete] = last; nValue.keyMap[last] = rowToDelete; nValue.keys.pop(); uint probe; uint cursor; if (nValue.keys.length == 0) { if (self.nodes[value].left == EMPTY || self.nodes[value].right == EMPTY) { cursor = value; } else { cursor = self.nodes[value].right; while (self.nodes[cursor].left != EMPTY) { cursor = self.nodes[cursor].left; } } if (self.nodes[cursor].left != EMPTY) { probe = self.nodes[cursor].left; } else { probe = self.nodes[cursor].right; } uint cursorParent = self.nodes[cursor].parent; self.nodes[probe].parent = cursorParent; if (cursorParent != EMPTY) { if (cursor == self.nodes[cursorParent].left) { self.nodes[cursorParent].left = probe; } else { self.nodes[cursorParent].right = probe; } } else { self.root = probe; } bool doFixup = !self.nodes[cursor].red; if (cursor != value) { replaceParent(self, cursor, value); self.nodes[cursor].left = self.nodes[value].left; self.nodes[self.nodes[cursor].left].parent = cursor; self.nodes[cursor].right = self.nodes[value].right; self.nodes[self.nodes[cursor].right].parent = cursor; self.nodes[cursor].red = self.nodes[value].red; (cursor, value) = (value, cursor); fixCountRecurse(self, value); } if (doFixup) { removeFixup(self, probe); } fixCountRecurse(self, cursorParent); delete self.nodes[cursor]; } } function fixCountRecurse(Tree storage self, uint value) private { while (value != EMPTY) { self.nodes[value].count = getNodeCount(self, self.nodes[value].left) + getNodeCount(self, self.nodes[value].right); value = self.nodes[value].parent; } } function treeMinimum(Tree storage self, uint value) private view returns (uint ) { while (self.nodes[value].left != EMPTY) { value = self.nodes[value].left; } return value; } function treeMaximum(Tree storage self, uint value) private view returns (uint ) { while (self.nodes[value].right != EMPTY) { value = self.nodes[value].right; } return value; } function rotateLeft(Tree storage self, uint value) private { uint cursor = self.nodes[value].right; uint parent = self.nodes[value].parent; uint cursorLeft = self.nodes[cursor].left; self.nodes[value].right = cursorLeft; if (cursorLeft != EMPTY) { self.nodes[cursorLeft].parent = value; } self.nodes[cursor].parent = parent; if (parent == EMPTY) { self.root = cursor; } else if (value == self.nodes[parent].left) { self.nodes[parent].left = cursor; } else { self.nodes[parent].right = cursor; } self.nodes[cursor].left = value; self.nodes[value].parent = cursor; self.nodes[value].count = getNodeCount(self, self.nodes[value].left) + getNodeCount(self, self.nodes[value].right); self.nodes[cursor].count = getNodeCount(self, self.nodes[cursor].left) + getNodeCount(self, self.nodes[cursor].right); } function rotateRight(Tree storage self, uint value) private { uint cursor = self.nodes[value].left; uint parent = self.nodes[value].parent; uint cursorRight = self.nodes[cursor].right; self.nodes[value].left = cursorRight; if (cursorRight != EMPTY) { self.nodes[cursorRight].parent = value; } self.nodes[cursor].parent = parent; if (parent == EMPTY) { self.root = cursor; } else if (value == self.nodes[parent].right) { self.nodes[parent].right = cursor; } else { self.nodes[parent].left = cursor; } self.nodes[cursor].right = value; self.nodes[value].parent = cursor; self.nodes[value].count = getNodeCount(self, self.nodes[value].left) + getNodeCount(self, self.nodes[value].right); self.nodes[cursor].count = getNodeCount(self, self.nodes[cursor].left) + getNodeCount(self, self.nodes[cursor].right); } function insertFixup(Tree storage self, uint value) private { uint cursor; while (value != self.root && self.nodes[self.nodes[value].parent].red) { uint valueParent = self.nodes[value].parent; if (valueParent == self.nodes[self.nodes[valueParent].parent].left) { cursor = self.nodes[self.nodes[valueParent].parent].right; if (self.nodes[cursor].red) { self.nodes[valueParent].red = false; self.nodes[cursor].red = false; self.nodes[self.nodes[valueParent].parent].red = true; value = self.nodes[valueParent].parent; } else { if (value == self.nodes[valueParent].right) { value = valueParent; rotateLeft(self, value); } valueParent = self.nodes[value].parent; self.nodes[valueParent].red = false; self.nodes[self.nodes[valueParent].parent].red = true; rotateRight(self, self.nodes[valueParent].parent); } } else { cursor = self.nodes[self.nodes[valueParent].parent].left; if (self.nodes[cursor].red) { self.nodes[valueParent].red = false; self.nodes[cursor].red = false; self.nodes[self.nodes[valueParent].parent].red = true; value = self.nodes[valueParent].parent; } else { if (value == self.nodes[valueParent].left) { value = valueParent; rotateRight(self, value); } valueParent = self.nodes[value].parent; self.nodes[valueParent].red = false; self.nodes[self.nodes[valueParent].parent].red = true; rotateLeft(self, self.nodes[valueParent].parent); } } } self.nodes[self.root].red = false; } function replaceParent( Tree storage self, uint a, uint b ) private { uint bParent = self.nodes[b].parent; self.nodes[a].parent = bParent; if (bParent == EMPTY) { self.root = a; } else { if (b == self.nodes[bParent].left) { self.nodes[bParent].left = a; } else { self.nodes[bParent].right = a; } } } function removeFixup(Tree storage self, uint value) private { uint cursor; while (value != self.root && !self.nodes[value].red) { uint valueParent = self.nodes[value].parent; if (value == self.nodes[valueParent].left) { cursor = self.nodes[valueParent].right; if (self.nodes[cursor].red) { self.nodes[cursor].red = false; self.nodes[valueParent].red = true; rotateLeft(self, valueParent); cursor = self.nodes[valueParent].right; } if (!self.nodes[self.nodes[cursor].left].red && !self.nodes[self.nodes[cursor].right].red) { self.nodes[cursor].red = true; value = valueParent; } else { if (!self.nodes[self.nodes[cursor].right].red) { self.nodes[self.nodes[cursor].left].red = false; self.nodes[cursor].red = true; rotateRight(self, cursor); cursor = self.nodes[valueParent].right; } self.nodes[cursor].red = self.nodes[valueParent].red; self.nodes[valueParent].red = false; self.nodes[self.nodes[cursor].right].red = false; rotateLeft(self, valueParent); value = self.root; } } else { cursor = self.nodes[valueParent].left; if (self.nodes[cursor].red) { self.nodes[cursor].red = false; self.nodes[valueParent].red = true; rotateRight(self, valueParent); cursor = self.nodes[valueParent].left; } if (!self.nodes[self.nodes[cursor].right].red && !self.nodes[self.nodes[cursor].left].red) { self.nodes[cursor].red = true; value = valueParent; } else { if (!self.nodes[self.nodes[cursor].left].red) { self.nodes[self.nodes[cursor].right].red = false; self.nodes[cursor].red = true; rotateLeft(self, cursor); cursor = self.nodes[valueParent].left; } self.nodes[cursor].red = self.nodes[valueParent].red; self.nodes[valueParent].red = false; self.nodes[self.nodes[cursor].left].red = false; rotateRight(self, valueParent); value = self.root; } } } self.nodes[value].red = false; } } // File @openzeppelin/contracts/utils/[email protected] // 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) { this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691 return msg.data; } } // File @openzeppelin/contracts/security/[email protected] // pragma solidity ^0.8.0; /** * @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()); } } // File @openzeppelin/contracts/utils/introspection/[email protected] // pragma solidity ^0.8.0; /** * @dev Interface of the ERC165 standard, as defined in the * https://eips.ethereum.org/EIPS/eip-165[EIP]. * * Implementers can declare support of contract interfaces, which can then be * queried by others ({ERC165Checker}). * * For an implementation, see {ERC165}. */ interface IERC165 { /** * @dev Returns true if this contract implements the interface defined by * `interfaceId`. See the corresponding * https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section] * to learn more about how these ids are created. * * This function call must use less than 30 000 gas. */ function supportsInterface(bytes4 interfaceId) external view returns (bool); } // File @openzeppelin/contracts/utils/introspection/[email protected] // pragma solidity ^0.8.0; /** * @dev Implementation of the {IERC165} interface. * * Contracts that want to implement ERC165 should inherit from this contract and override {supportsInterface} to check * for the additional interface id that will be supported. For example: * * ```solidity * function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) { * return interfaceId == type(MyInterface).interfaceId || super.supportsInterface(interfaceId); * } * ``` * * Alternatively, {ERC165Storage} provides an easier to use but more expensive implementation. */ abstract contract ERC165 is IERC165 { /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) { return interfaceId == type(IERC165).interfaceId; } } // File @openzeppelin/contracts/access/[email protected] // pragma solidity ^0.8.0; /** * @dev External interface of AccessControl declared to support ERC165 detection. */ interface IAccessControl { function hasRole(bytes32 role, address account) external view returns (bool); function getRoleAdmin(bytes32 role) external view returns (bytes32); function grantRole(bytes32 role, address account) external; function revokeRole(bytes32 role, address account) external; function renounceRole(bytes32 role, address account) external; } /** * @dev Contract module that allows children to implement role-based access * control mechanisms. This is a lightweight version that doesn't allow enumerating role * members except through off-chain means by accessing the contract event logs. Some * applications may benefit from on-chain enumerability, for those cases see * {AccessControlEnumerable}. * * Roles are referred to by their `bytes32` identifier. These should be exposed * in the external API and be unique. The best way to achieve this is by * using `public constant` hash digests: * * ``` * bytes32 public constant MY_ROLE = keccak256("MY_ROLE"); * ``` * * Roles can be used to represent a set of permissions. To restrict access to a * function call, use {hasRole}: * * ``` * function foo() public { * require(hasRole(MY_ROLE, msg.sender)); * ... * } * ``` * * Roles can be granted and revoked dynamically via the {grantRole} and * {revokeRole} functions. Each role has an associated admin role, and only * accounts that have a role's admin role can call {grantRole} and {revokeRole}. * * By default, the admin role for all roles is `DEFAULT_ADMIN_ROLE`, which means * that only accounts with this role will be able to grant or revoke other * roles. More complex role relationships can be created by using * {_setRoleAdmin}. * * WARNING: The `DEFAULT_ADMIN_ROLE` is also its own admin: it has permission to * grant and revoke this role. Extra precautions should be taken to secure * accounts that have been granted it. */ abstract contract AccessControl is Context, IAccessControl, ERC165 { struct RoleData { mapping (address => bool) members; bytes32 adminRole; } mapping (bytes32 => RoleData) private _roles; bytes32 public constant DEFAULT_ADMIN_ROLE = 0x00; /** * @dev Emitted when `newAdminRole` is set as ``role``'s admin role, replacing `previousAdminRole` * * `DEFAULT_ADMIN_ROLE` is the starting admin for all roles, despite * {RoleAdminChanged} not being emitted signaling this. * * _Available since v3.1._ */ event RoleAdminChanged(bytes32 indexed role, bytes32 indexed previousAdminRole, bytes32 indexed newAdminRole); /** * @dev Emitted when `account` is granted `role`. * * `sender` is the account that originated the contract call, an admin role * bearer except when using {_setupRole}. */ event RoleGranted(bytes32 indexed role, address indexed account, address indexed sender); /** * @dev Emitted when `account` is revoked `role`. * * `sender` is the account that originated the contract call: * - if using `revokeRole`, it is the admin role bearer * - if using `renounceRole`, it is the role bearer (i.e. `account`) */ event RoleRevoked(bytes32 indexed role, address indexed account, address indexed sender); /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) { return interfaceId == type(IAccessControl).interfaceId || super.supportsInterface(interfaceId); } /** * @dev Returns `true` if `account` has been granted `role`. */ function hasRole(bytes32 role, address account) public view override returns (bool) { return _roles[role].members[account]; } /** * @dev Returns the admin role that controls `role`. See {grantRole} and * {revokeRole}. * * To change a role's admin, use {_setRoleAdmin}. */ function getRoleAdmin(bytes32 role) public view override returns (bytes32) { return _roles[role].adminRole; } /** * @dev Grants `role` to `account`. * * If `account` had not been already granted `role`, emits a {RoleGranted} * event. * * Requirements: * * - the caller must have ``role``'s admin role. */ function grantRole(bytes32 role, address account) public virtual override { require(hasRole(getRoleAdmin(role), _msgSender()), "AccessControl: sender must be an admin to grant"); _grantRole(role, account); } /** * @dev Revokes `role` from `account`. * * If `account` had been granted `role`, emits a {RoleRevoked} event. * * Requirements: * * - the caller must have ``role``'s admin role. */ function revokeRole(bytes32 role, address account) public virtual override { require(hasRole(getRoleAdmin(role), _msgSender()), "AccessControl: sender must be an admin to revoke"); _revokeRole(role, account); } /** * @dev Revokes `role` from the calling account. * * Roles are often managed via {grantRole} and {revokeRole}: this function's * purpose is to provide a mechanism for accounts to lose their privileges * if they are compromised (such as when a trusted device is misplaced). * * If the calling account had been granted `role`, emits a {RoleRevoked} * event. * * Requirements: * * - the caller must be `account`. */ function renounceRole(bytes32 role, address account) public virtual override { require(account == _msgSender(), "AccessControl: can only renounce roles for self"); _revokeRole(role, account); } /** * @dev Grants `role` to `account`. * * If `account` had not been already granted `role`, emits a {RoleGranted} * event. Note that unlike {grantRole}, this function doesn't perform any * checks on the calling account. * * [WARNING] * ==== * This function should only be called from the constructor when setting * up the initial roles for the system. * * Using this function in any other way is effectively circumventing the admin * system imposed by {AccessControl}. * ==== */ function _setupRole(bytes32 role, address account) internal virtual { _grantRole(role, account); } /** * @dev Sets `adminRole` as ``role``'s admin role. * * Emits a {RoleAdminChanged} event. */ function _setRoleAdmin(bytes32 role, bytes32 adminRole) internal virtual { emit RoleAdminChanged(role, getRoleAdmin(role), adminRole); _roles[role].adminRole = adminRole; } function _grantRole(bytes32 role, address account) private { if (!hasRole(role, account)) { _roles[role].members[account] = true; emit RoleGranted(role, account, _msgSender()); } } function _revokeRole(bytes32 role, address account) private { if (hasRole(role, account)) { _roles[role].members[account] = false; emit RoleRevoked(role, account, _msgSender()); } } } // File @openzeppelin/contracts/token/ERC20/[email protected] // 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); } // File @openzeppelin/contracts/token/ERC20/[email protected] // pragma solidity ^0.8.0; /** * @dev Implementation of the {IERC20} interface. * * This implementation is agnostic to the way tokens are created. This means * that a supply mechanism has to be added in a derived contract using {_mint}. * For a generic mechanism see {ERC20PresetMinterPauser}. * * TIP: For a detailed writeup see our guide * https://forum.zeppelin.solutions/t/how-to-implement-erc20-supply-mechanisms/226[How * to implement supply mechanisms]. * * We have followed general OpenZeppelin guidelines: functions revert instead * of returning `false` on failure. This behavior is nonetheless conventional * and does not conflict with the expectations of ERC20 applications. * * Additionally, an {Approval} event is emitted on calls to {transferFrom}. * This allows applications to reconstruct the allowance for all accounts just * by listening to said events. Other implementations of the EIP may not emit * these events, as it isn't required by the specification. * * Finally, the non-standard {decreaseAllowance} and {increaseAllowance} * functions have been added to mitigate the well-known issues around setting * allowances. See {IERC20-approve}. */ contract ERC20 is Context, IERC20 { 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 defaut value of {decimals} is 18. To select a different value for * {decimals} you should overload it. * * All three 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 returns (string memory) { return _name; } /** * @dev Returns the symbol of the token, usually a shorter version of the * name. */ function symbol() public view virtual returns (string memory) { return _symbol; } /** * @dev Returns the number of decimals used to get its user representation. * For example, if `decimals` equals `2`, a balance of `505` tokens should * be displayed to a user as `5,05` (`505 / 10 ** 2`). * * Tokens usually opt for a value of 18, imitating the relationship between * Ether and Wei. This is the value {ERC20} uses, unless this function is * overloaded; * * NOTE: This information is only used for _display_ purposes: it in * no way affects any of the arithmetic of the contract, including * {IERC20-balanceOf} and {IERC20-transfer}. */ function decimals() public view virtual returns (uint8) { return 18; } /** * @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"); _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"); _approve(_msgSender(), spender, currentAllowance - subtractedValue); return true; } /** * @dev Moves tokens `amount` from `sender` to `recipient`. * * This is internal function is equivalent to {transfer}, and can be used to * e.g. implement automatic token fees, slashing mechanisms, etc. * * Emits a {Transfer} event. * * Requirements: * * - `sender` cannot be the zero address. * - `recipient` cannot be the zero address. * - `sender` must have a balance of at least `amount`. */ function _transfer(address sender, address recipient, uint256 amount) internal virtual { require(sender != address(0), "ERC20: transfer from the zero address"); require(recipient != address(0), "ERC20: transfer to the zero address"); _beforeTokenTransfer(sender, recipient, amount); uint256 senderBalance = _balances[sender]; require(senderBalance >= amount, "ERC20: transfer amount exceeds balance"); _balances[sender] = senderBalance - amount; _balances[recipient] += amount; emit Transfer(sender, recipient, amount); } /** @dev Creates `amount` tokens and assigns them to `account`, increasing * the total supply. * * Emits a {Transfer} event with `from` set to the zero address. * * Requirements: * * - `to` cannot be the zero address. */ function _mint(address account, uint256 amount) internal virtual { require(account != address(0), "ERC20: mint to the zero address"); _beforeTokenTransfer(address(0), account, amount); _totalSupply += amount; _balances[account] += amount; emit Transfer(address(0), account, amount); } /** * @dev Destroys `amount` tokens from `account`, reducing the * total supply. * * Emits a {Transfer} event with `to` set to the zero address. * * Requirements: * * - `account` cannot be the zero address. * - `account` must have at least `amount` tokens. */ function _burn(address account, uint256 amount) internal virtual { require(account != address(0), "ERC20: burn from the zero address"); _beforeTokenTransfer(account, address(0), amount); uint256 accountBalance = _balances[account]; require(accountBalance >= amount, "ERC20: burn amount exceeds balance"); _balances[account] = accountBalance - amount; _totalSupply -= amount; emit Transfer(account, address(0), amount); } /** * @dev Sets `amount` as the allowance of `spender` over the `owner` s tokens. * * This internal function is equivalent to `approve`, and can be used to * e.g. set automatic allowances for certain subsystems, etc. * * Emits an {Approval} event. * * Requirements: * * - `owner` cannot be the zero address. * - `spender` cannot be the zero address. */ function _approve(address owner, address spender, uint256 amount) internal virtual { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } /** * @dev Hook that is called before any transfer of tokens. This includes * minting and burning. * * Calling conditions: * * - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens * will be to transferred to `to`. * - when `from` is zero, `amount` tokens will be minted for `to`. * - when `to` is zero, `amount` of ``from``'s tokens will be burned. * - `from` and `to` are never both zero. * * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks]. */ function _beforeTokenTransfer(address from, address to, uint256 amount) internal virtual { } } // File src/PostageStamp.sol // pragma solidity ^0.8.1; /** * @title PostageStamp contract * @author The Swarm Authors * @dev The postage stamp contracts allows users to create and manage postage stamp batches. * The current balance for each batch is stored ordered in descending order of normalised balance. * Balance is normalised to be per chunk and the total spend since the contract was deployed, i.e. when a batch * is bought, its per-chunk balance is supplemented with the current cost of storing one chunk since the beginning of time, * as if the batch had existed since the contract's inception. During the _expiry_ process, each of these balances is * checked against the _currentTotalOutPayment_, a similarly normalised figure that represents the current cost of * storing one chunk since the beginning of time. A batch with a normalised balance less than _currentTotalOutPayment_ * is treated as expired. * * The _currentTotalOutPayment_ is calculated using _totalOutPayment_ which is updated during _setPrice_ events so * that the applicable per-chunk prices can be charged for the relevant periods of time. This can then be multiplied * by the amount of chunks which are allowed to be stamped by each batch to get the actual cost of storage. * * The amount of chunks a batch can stamp is determined by the _bucketDepth_. A batch may store a maximum of 2^depth chunks. * The global figure for the currently allowed chunks is tracked by _validChunkCount_ and updated during batch _expiry_ events. */ contract PostageStamp is AccessControl, Pausable { using HitchensOrderStatisticsTreeLib for HitchensOrderStatisticsTreeLib.Tree; /** * @dev Emitted when a new batch is created. */ event BatchCreated( bytes32 indexed batchId, uint256 totalAmount, uint256 normalisedBalance, address owner, uint8 depth, uint8 bucketDepth, bool immutableFlag ); /** * @dev Emitted when an existing batch is topped up. */ event BatchTopUp(bytes32 indexed batchId, uint256 topupAmount, uint256 normalisedBalance); /** * @dev Emitted when the depth of an existing batch increases. */ event BatchDepthIncrease(bytes32 indexed batchId, uint8 newDepth, uint256 normalisedBalance); /** *@dev Emitted on every price update. */ event PriceUpdate(uint256 price); struct Batch { // Owner of this batch (0 if not valid). address owner; // Current depth of this batch. uint8 depth; // Whether this batch is immutable. bool immutableFlag; // Normalised balance per chunk. uint256 normalisedBalance; } // Role allowed to increase totalOutPayment. bytes32 public constant PRICE_ORACLE_ROLE = keccak256("PRICE_ORACLE"); // Role allowed to pause bytes32 public constant PAUSER_ROLE = keccak256("PAUSER_ROLE"); // Role allowed to withdraw the pot. bytes32 public constant REDISTRIBUTOR_ROLE = keccak256("REDISTRIBUTOR_ROLE"); // Associate every batch id with batch data. mapping(bytes32 => Batch) public batches; // Store every batch id ordered by normalisedBalance. HitchensOrderStatisticsTreeLib.Tree tree; // Address of the ERC20 token this contract references. address public bzzToken; // Total out payment per chunk, at the blockheight of the last price change. uint256 private totalOutPayment; // Minimum allowed depth of bucket. uint8 public minimumBucketDepth; // Combined global chunk capacity of valid batches remaining at the blockheight expire() was last called. uint256 public validChunkCount; // Lottery pot at last update. uint256 public pot; // Price from the last update. uint256 public lastPrice = 0; // Block at which the last update occured. uint256 public lastUpdatedBlock; // Normalised balance at the blockheight expire() was last called. uint256 public lastExpiryBalance; /** * @param _bzzToken The ERC20 token address to reference in this contract. * @param _minimumBucketDepth The minimum bucket depth of batches that can be purchased. */ constructor(address _bzzToken, uint8 _minimumBucketDepth) { bzzToken = _bzzToken; minimumBucketDepth = _minimumBucketDepth; _setupRole(DEFAULT_ADMIN_ROLE, msg.sender); _setupRole(PAUSER_ROLE, msg.sender); } /** * @notice Create a new batch. * @dev At least `_initialBalancePerChunk*2^depth` tokens must be approved in the ERC20 token contract. * @param _owner Owner of the new batch. * @param _initialBalancePerChunk Initial balance per chunk. * @param _depth Initial depth of the new batch. * @param _nonce A random value used in the batch id derivation to allow multiple batches per owner. * @param _immutable Whether the batch is mutable. */ function createBatch( address _owner, uint256 _initialBalancePerChunk, uint8 _depth, uint8 _bucketDepth, bytes32 _nonce, bool _immutable ) external whenNotPaused { require(_owner != address(0), "owner cannot be the zero address"); // bucket depth should be non-zero and smaller than the depth require(_bucketDepth != 0 && minimumBucketDepth <= _bucketDepth && _bucketDepth < _depth, "invalid bucket depth"); // derive batchId from msg.sender to ensure another party cannot use the same batch id and frontrun us. bytes32 batchId = keccak256(abi.encode(msg.sender, _nonce)); require(batches[batchId].owner == address(0), "batch already exists"); // per chunk balance multiplied by the batch size in chunks must be transferred from the sender uint256 totalAmount = _initialBalancePerChunk * (1 << _depth); require(ERC20(bzzToken).transferFrom(msg.sender, address(this), totalAmount), "failed transfer"); // normalisedBalance is an absolute value per chunk, as if the batch had existed // since the block the contract was deployed, so we must supplement this batch's // _initialBalancePerChunk with the currentTotalOutPayment() uint256 normalisedBalance = currentTotalOutPayment() + (_initialBalancePerChunk); //update validChunkCount to remove currently expired batches expireLimited(type(uint256).max); //then add the chunks this batch will contribute validChunkCount += 1 << _depth; batches[batchId] = Batch({ owner: _owner, depth: _depth, immutableFlag: _immutable, normalisedBalance: normalisedBalance }); require(normalisedBalance > 0, "normalisedBalance cannot be zero"); // insert into the ordered tree tree.insert(batchId, normalisedBalance); emit BatchCreated(batchId, totalAmount, normalisedBalance, _owner, _depth, _bucketDepth, _immutable); } /** * @notice Manually create a new batch when faciliatating migration, can only be called by the Admin role. * @dev At least `_initialBalancePerChunk*2^depth` tokens must be approved in the ERC20 token contract. * @param _owner Owner of the new batch. * @param _initialBalancePerChunk Initial balance per chunk of the batch. * @param _depth Initial depth of the new batch. * @param _batchId BatchId being copied (from previous version contract data). * @param _immutable Whether the batch is mutable. */ function copyBatch( address _owner, uint256 _initialBalancePerChunk, uint8 _depth, uint8 _bucketDepth, bytes32 _batchId, bool _immutable ) external whenNotPaused { require(hasRole(DEFAULT_ADMIN_ROLE, msg.sender), "only administrator can use copy method"); require(_owner != address(0), "owner cannot be the zero address"); require(_bucketDepth != 0 && _bucketDepth < _depth, "invalid bucket depth"); require(batches[_batchId].owner == address(0), "batch already exists"); // per chunk balance multiplied by the batch size in chunks must be transferred from the sender uint256 totalAmount = _initialBalancePerChunk * (1 << _depth); require(ERC20(bzzToken).transferFrom(msg.sender, address(this), totalAmount), "failed transfer"); uint256 normalisedBalance = currentTotalOutPayment() + (_initialBalancePerChunk); validChunkCount += 1 << _depth; batches[_batchId] = Batch({ owner: _owner, depth: _depth, immutableFlag: _immutable, normalisedBalance: normalisedBalance }); require(normalisedBalance > 0, "normalisedBalance cannot be zero"); tree.insert(_batchId, normalisedBalance); emit BatchCreated(_batchId, totalAmount, normalisedBalance, _owner, _depth, _bucketDepth, _immutable); } /** * @notice Top up an existing batch. * @dev At least `_topupAmountPerChunk*2^depth` tokens must be approved in the ERC20 token contract. * @param _batchId The id of an existing batch. * @param _topupAmountPerChunk The amount of additional tokens to add per chunk. */ function topUp(bytes32 _batchId, uint256 _topupAmountPerChunk) external whenNotPaused { Batch storage batch = batches[_batchId]; require(batch.owner != address(0), "batch does not exist or has expired"); require(batch.normalisedBalance > currentTotalOutPayment(), "batch already expired"); require(batch.depth > minimumBucketDepth, "batch too small to renew"); // per chunk balance multiplied by the batch size in chunks must be transferred from the sender uint256 totalAmount = _topupAmountPerChunk * (1 << batch.depth); require(ERC20(bzzToken).transferFrom(msg.sender, address(this), totalAmount), "failed transfer"); // update by removing batch and then reinserting tree.remove(_batchId, batch.normalisedBalance); batch.normalisedBalance = batch.normalisedBalance + (_topupAmountPerChunk); tree.insert(_batchId, batch.normalisedBalance); emit BatchTopUp(_batchId, totalAmount, batch.normalisedBalance); } /** * @notice Increase the depth of an existing batch. * @dev Can only be called by the owner of the batch. * @param _batchId the id of an existing batch. * @param _newDepth the new (larger than the previous one) depth for this batch. */ function increaseDepth(bytes32 _batchId, uint8 _newDepth) external whenNotPaused { Batch storage batch = batches[_batchId]; require(batch.owner == msg.sender, "not batch owner"); require(minimumBucketDepth < _newDepth && batch.depth < _newDepth, "depth not increasing"); require(!batch.immutableFlag, "batch is immutable"); require(batch.normalisedBalance > currentTotalOutPayment(), "batch already expired"); uint8 depthChange = _newDepth - batch.depth; // divide by the change in batch size (2^depthChange) uint256 newRemainingBalance = remainingBalance(_batchId) / (1 << depthChange); // expire batches up to current block before amending validChunkCount to include // the new chunks resultant of the depth increase expireLimited(type(uint256).max); validChunkCount += (1 << _newDepth) - (1 << batch.depth); // update by removing batch and then reinserting tree.remove(_batchId, batch.normalisedBalance); batch.depth = _newDepth; batch.normalisedBalance = currentTotalOutPayment() + (newRemainingBalance); tree.insert(_batchId, batch.normalisedBalance); emit BatchDepthIncrease(_batchId, _newDepth, batch.normalisedBalance); } /** * @notice Return the per chunk balance not yet used up. * @param _batchId The id of an existing batch. */ function remainingBalance(bytes32 _batchId) public view returns (uint256) { Batch storage batch = batches[_batchId]; require(batch.owner != address(0), "batch does not exist or expired"); if (batch.normalisedBalance <= currentTotalOutPayment()) { return 0; } return batch.normalisedBalance - currentTotalOutPayment(); } /** * @notice Set a new price. * @dev Can only be called by the price oracle role. * @param _price The new price. */ function setPrice(uint256 _price) external { require(hasRole(PRICE_ORACLE_ROLE, msg.sender), "only price oracle can set the price"); // if there was a last price, add the outpayment since the last update // using the last price to _totalOutPayment_. if there was not a lastPrice, // the lastprice must have been zero. if (lastPrice != 0) { totalOutPayment = currentTotalOutPayment(); } lastPrice = _price; lastUpdatedBlock = block.number; emit PriceUpdate(_price); } /** * @notice Total per-chunk cost since the contract's deployment. * @dev Returns the total normalised all-time per chunk payout. * Only Batches with a normalised balance greater than this are valid. */ function currentTotalOutPayment() public view returns (uint256) { uint256 blocks = block.number - lastUpdatedBlock; uint256 increaseSinceLastUpdate = lastPrice * (blocks); return totalOutPayment + (increaseSinceLastUpdate); } /** * @notice Pause the contract. * @dev Can only be called by the pauser when not paused. * The contract can be provably stopped by renouncing the pauser role and the admin role once paused. */ function pause() public { require(hasRole(PAUSER_ROLE, msg.sender), "only pauser can pause"); _pause(); } /** * @notice Unpause the contract. * @dev Can only be called by the pauser role while paused. */ function unPause() public { require(hasRole(PAUSER_ROLE, msg.sender), "only pauser can unpause"); _unpause(); } /** * @notice Return true if no batches exist */ function empty() public view returns (bool) { return tree.count() == 0; } /** * @notice Get the first batch id ordered by ascending normalised balance. * @dev If more than one batch id, return index at 0, if no batches, revert. */ function firstBatchId() public view returns (bytes32) { uint256 val = tree.first(); require(val > 0, "no batches exist"); return tree.valueKeyAtIndex(val, 0); } /** * @notice Reclaims a limited number of expired batches * @dev Can be used if reclaiming all expired batches would exceed the block gas limit, causing other * contract method calls to fail. * @param limit The maximum number of batches to expire. */ function expireLimited(uint256 limit) public { // the lower bound of the normalised balance for which we will check if batches have expired uint256 leb = lastExpiryBalance; uint256 i; for (i = 0; i < limit; i++) { if (empty()) { lastExpiryBalance = currentTotalOutPayment(); break; } // get the batch with the smallest normalised balance bytes32 fbi = firstBatchId(); // if the batch with the smallest balance has not yet expired // we have already reached the end of the batches we need // to expire, so exit the loop if (remainingBalance(fbi) > 0) { // the upper bound of the normalised balance for which we will check if batches have expired // value is updated when there are no expired batches left lastExpiryBalance = currentTotalOutPayment(); break; } // otherwise, the batch with the smallest balance has expired, // so we must remove the chunks this batch contributes to the global validChunkCount Batch storage batch = batches[fbi]; uint256 batchSize = 1 << batch.depth; require(validChunkCount >= batchSize , "insufficient valid chunk count"); validChunkCount -= batchSize; // since the batch expired _during_ the period we must add // remaining normalised payout for this batch only pot += batchSize * (batch.normalisedBalance - leb); tree.remove(fbi, batch.normalisedBalance); delete batches[fbi]; } // then, for all batches that have _not_ expired during the period // add the total normalised payout of all batches // multiplied by the remaining total valid chunk count // to the pot for the period since the last expiry require(lastExpiryBalance >= leb, "current total outpayment should never decrease"); // then, for all batches that have _not_ expired during the period // add the total normalised payout of all batches // multiplied by the remaining total valid chunk count // to the pot for the period since the last expiry pot += validChunkCount * (lastExpiryBalance - leb); } /** * @notice Indicates whether expired batches exist. */ function expiredBatchesExist() public view returns (bool) { if (empty()){ return false; } return (remainingBalance(firstBatchId()) <= 0); } /** * @notice The current pot. */ function totalPot() public returns (uint256) { expireLimited(type(uint256).max); uint256 balance = ERC20(bzzToken).balanceOf(address(this)); return pot < balance ? pot : balance; } /** * @notice Withdraw the pot, authorised callers only. * @param beneficiary Recieves the current total pot. */ function withdraw(address beneficiary) external { require(hasRole(REDISTRIBUTOR_ROLE, msg.sender), "only redistributor can withdraw from the contract"); require(ERC20(bzzToken).transfer(beneficiary, totalPot()), "failed transfer"); pot = 0; } /** * @notice Topup the pot. * @param amount Amount of tokens the pot will be topped up by. */ function topupPot(uint256 amount) external { require(ERC20(bzzToken).transferFrom(msg.sender, address(this), amount), "failed transfer"); pot += amount; } } // File src/Staking.sol // pragma solidity ^0.8.1; /** * @title Staking contract for the Swarm storage incentives * @author The Swarm Authors * @dev Allows users to stake tokens in order to be eligible for the Redistribution Schelling co-ordination game. * Stakes are not withdrawable unless the contract is paused, e.g. in the event of migration to a new staking * contract. Stakes are frozen or slashed by the Redistribution contract in response to violations of the * protocol. */ contract StakeRegistry is AccessControl, Pausable { /** * @dev Emitted when a stake is created or updated by `owner` of the `overlay` by `stakeamount`, during `lastUpdatedBlock`. */ event StakeUpdated(bytes32 indexed overlay, uint256 stakeAmount, address owner, uint256 lastUpdatedBlock); /** * @dev Emitted when a stake for overlay `slashed` is slashed by `amount`. */ event StakeSlashed(bytes32 slashed, uint256 amount); /** * @dev Emitted when a stake for overlay `frozen` for `time` blocks. */ event StakeFrozen(bytes32 slashed, uint256 time); struct Stake { // Overlay of the node that is being staked bytes32 overlay; // Amount of tokens staked uint256 stakeAmount; // Owner of `overlay` address owner; // Block height the stake was updated uint256 lastUpdatedBlockNumber; // Used to indicate presents in stakes struct bool isValue; } // Associate every stake id with overlay data. mapping(bytes32 => Stake) public stakes; // Role allowed to pause bytes32 public constant PAUSER_ROLE = keccak256("PAUSER_ROLE"); // Role allowed to freeze and slash entries bytes32 public constant REDISTRIBUTOR_ROLE = keccak256("REDISTRIBUTOR_ROLE"); // Swarm network ID uint64 NetworkId; // Address of the staked ERC20 token address public bzzToken; /** * @param _bzzToken Address of the staked ERC20 token * @param _NetworkId Swarm network ID */ constructor(address _bzzToken, uint64 _NetworkId) { NetworkId = _NetworkId; bzzToken = _bzzToken; _setupRole(DEFAULT_ADMIN_ROLE, msg.sender); _setupRole(PAUSER_ROLE, msg.sender); } /** * @dev Checks to see if `overlay` is frozen. * @param overlay Overlay of staked overlay * * Returns a boolean value indicating whether the operation succeeded. */ function overlayNotFrozen(bytes32 overlay) internal view returns (bool) { return stakes[overlay].lastUpdatedBlockNumber < block.number; } /** * @dev Returns the current `stakeAmount` of `overlay`. * @param overlay Overlay of node */ function stakeOfOverlay(bytes32 overlay) public view returns (uint256) { return stakes[overlay].stakeAmount; } /** * @dev Returns the current usable `stakeAmount` of `overlay`. * Checks whether the stake is currently frozen. * @param overlay Overlay of node */ function usableStakeOfOverlay(bytes32 overlay) public view returns (uint256) { return overlayNotFrozen(overlay) ? stakes[overlay].stakeAmount : 0; } /** * @dev Returns the `lastUpdatedBlockNumber` of `overlay`. */ function lastUpdatedBlockNumberOfOverlay(bytes32 overlay) public view returns (uint256) { return stakes[overlay].lastUpdatedBlockNumber; } /** * @dev Returns the eth address of the owner of `overlay`. * @param overlay Overlay of node */ function ownerOfOverlay(bytes32 overlay) public view returns (address) { return stakes[overlay].owner; } /** * @dev Please both Endians 🥚. * @param input Eth address used for overlay calculation. */ function reverse(uint64 input) internal pure returns (uint64 v) { v = input; // swap bytes v = ((v & 0xFF00FF00FF00FF00) >> 8) | ((v & 0x00FF00FF00FF00FF) << 8); // swap 2-byte long pairs v = ((v & 0xFFFF0000FFFF0000) >> 16) | ((v & 0x0000FFFF0000FFFF) << 16); // swap 4-byte long pairs v = (v >> 32) | (v << 32); } /** * @notice Create a new stake or update an existing one. * @dev At least `_initialBalancePerChunk*2^depth` number of tokens need to be preapproved for this contract. * @param _owner Eth address used for overlay calculation. * @param nonce Nonce that was used for overlay calculation. * @param amount Deposited amount of ERC20 tokens. */ function depositStake( address _owner, bytes32 nonce, uint256 amount ) external whenNotPaused { require(_owner == msg.sender, "only owner can update stake"); bytes32 overlay = keccak256(abi.encodePacked(_owner, reverse(NetworkId), nonce)); uint256 updatedAmount = amount; if (stakes[overlay].isValue) { require(overlayNotFrozen(overlay), "overlay currently frozen"); updatedAmount = amount + stakes[overlay].stakeAmount; } require(ERC20(bzzToken).transferFrom(msg.sender, address(this), amount), "failed transfer"); emit StakeUpdated(overlay, updatedAmount, _owner, block.number); stakes[overlay] = Stake({ owner: _owner, overlay: overlay, stakeAmount: updatedAmount, lastUpdatedBlockNumber: block.number, isValue: true }); } /** * @dev Withdraw stake only when the staking contract is paused, * can only be called by the owner specific to the associated `overlay` * @param overlay The overlay to withdraw from * @param amount The amount of ERC20 tokens to be withdrawn */ function withdrawFromStake(bytes32 overlay, uint256 amount) external whenPaused { require(stakes[overlay].owner == msg.sender, "only owner can withdraw stake"); uint256 withDrawLimit = amount; if (amount > stakes[overlay].stakeAmount) { withDrawLimit = stakes[overlay].stakeAmount; } if (withDrawLimit < stakes[overlay].stakeAmount) { stakes[overlay].stakeAmount -= withDrawLimit; stakes[overlay].lastUpdatedBlockNumber = block.number; require(ERC20(bzzToken).transfer(msg.sender, withDrawLimit), "failed withdrawal"); } else { delete stakes[overlay]; require(ERC20(bzzToken).transfer(msg.sender, withDrawLimit), "failed withdrawal"); } } /** * @dev Freeze an existing stake, can only be called by the redistributor * @param overlay the overlay selected * @param time penalty length in blocknumbers */ function freezeDeposit(bytes32 overlay, uint256 time) external { require(hasRole(REDISTRIBUTOR_ROLE, msg.sender), "only redistributor can freeze stake"); if (stakes[overlay].isValue) { emit StakeFrozen(overlay, time); stakes[overlay].lastUpdatedBlockNumber = block.number + time; } } /** * @dev Slash an existing stake, can only be called by the `redistributor` * @param overlay the overlay selected * @param amount the amount to be slashed */ function slashDeposit(bytes32 overlay, uint256 amount) external { require(hasRole(REDISTRIBUTOR_ROLE, msg.sender), "only redistributor can slash stake"); emit StakeSlashed(overlay, amount); if (stakes[overlay].isValue) { if (stakes[overlay].stakeAmount > amount) { stakes[overlay].stakeAmount -= amount; stakes[overlay].lastUpdatedBlockNumber = block.number; } else { delete stakes[overlay]; } } } /** * @dev Pause the contract. The contract is provably stopped by renouncing the pauser role and the admin role after pausing, can only be called by the `PAUSER` */ function pause() public { require(hasRole(PAUSER_ROLE, msg.sender), "only pauser can pause"); _pause(); } /** * @dev Unpause the contract, can only be called by the pauser when paused */ function unPause() public { require(hasRole(PAUSER_ROLE, msg.sender), "only pauser can unpause"); _unpause(); } } // File src/PriceOracle.sol // pragma solidity ^0.8.1; /** * @title PriceOracle contract. * @author The Swarm Authors. * @dev The price oracle contract emits a price feed using events. */ contract PriceOracle is AccessControl { /** *@dev Emitted on every price update. */ event PriceUpdate(uint256 price); // Role allowed to update price bytes32 public constant PRICE_UPDATER_ROLE = keccak256("PRICE_UPDATER"); // The minimum price allowed uint256 public constant minimumPrice = 1024; // The current price is the atomic unit. uint256 public currentPrice = minimumPrice; // Constants used to modulate the price, see below usage uint256[] public increaseRate = [0, 1069, 1048, 1032, 1024, 1021, 1015, 1003, 980]; uint16 targetRedundancy = 4; uint16 maxConsideredExtraRedundancy = 4; // When the contract is paused, price changes are not effective bool public isPaused = true; // The address of the linked PostageStamp contract PostageStamp public postageStamp; constructor(address _postageStamp) { _setupRole(DEFAULT_ADMIN_ROLE, msg.sender); postageStamp = PostageStamp(_postageStamp); } /** * @notice Manually set the price. * @dev Can only be called by the admin role. * @param _price The new price. */ function setPrice(uint256 _price) external { require(hasRole(DEFAULT_ADMIN_ROLE, msg.sender), "caller is not the admin"); currentPrice = _price; //enforce minimum price if (currentPrice < minimumPrice) { currentPrice = minimumPrice; } postageStamp.setPrice(currentPrice); emit PriceUpdate(currentPrice); } /** * @notice Pause the contract. * @dev Can only be called by the admin role. */ function pause() external { require(hasRole(DEFAULT_ADMIN_ROLE, msg.sender), "caller is not the admin"); isPaused = true; } /** * @notice Unpause the contract. * @dev Can only be called by the admin role. */ function unPause() external { require(hasRole(DEFAULT_ADMIN_ROLE, msg.sender), "caller is not the admin"); isPaused = false; } /** * @notice Automatically adjusts the price, called from the Redistribution contract * @dev The ideal redundancy in Swarm is 4 nodes per neighbourhood. Each round, the * Redistribution contract reports the current amount of nodes in the neighbourhood * who have commited and revealed truthy reserve commitment hashes, this is called * the redundancy signal. The target redundancy is 4, so, if the redundancy signal is 4, * no action is taken. If the redundancy signal is greater than 4, i.e. there is extra * redundancy, a price decrease is applied in order to reduce the incentive to run a node. * If the redundancy signal is less than 4, a price increase is applied in order to * increase the incentive to run a node. If the redundancy signal is more than 8, we * apply the max price decrease as if there were just four extra nodes. * * Can only be called by the price updater role, this should be set to be the deployed * Redistribution contract's address. Rounds down to return an integer. */ function adjustPrice(uint256 redundancy) external { if (isPaused == false) { require(hasRole(PRICE_UPDATER_ROLE, msg.sender), "caller is not a price updater"); uint256 multiplier = minimumPrice; uint256 usedRedundancy = redundancy; // redundancy may not be zero require(redundancy > 0, "unexpected zero"); // enforce maximum considered extra redundancy uint16 maxConsideredRedundancy = targetRedundancy + maxConsideredExtraRedundancy; if (redundancy > maxConsideredRedundancy) { usedRedundancy = maxConsideredRedundancy; } // use the increaseRate array of constants to determine // the rate at which the price will modulate - if usedRedundancy // is the target value 4 there is no change, > 4 causes an increase // and < 4 a decrease. uint256 ir = increaseRate[usedRedundancy]; // the multiplier is used to ensure whole number currentPrice = (ir * currentPrice) / multiplier; //enforce minimum price if (currentPrice < minimumPrice) { currentPrice = minimumPrice; } postageStamp.setPrice(currentPrice); emit PriceUpdate(currentPrice); } } } // File src/Redistribution.sol // SPDX-License-Identifier: BSD-3-Clause pragma solidity ^0.8.1; /** * @title Redistribution contract * @author The Swarm Authors * @dev Implements a Schelling Co-ordination game to form consensus around the Reserve Commitment hash. This takes * place in three phases: _commit_, _reveal_ and _claim_. * * A node, upon establishing that it _isParticipatingInUpcomingRound_, i.e. it's overlay falls within proximity order * of its reported depth with the _currentRoundAnchor_, prepares a "reserve commitment hash" using the chunks * it currently stores in its reserve and calculates the "storage depth" (see Bee for details). These values, if calculated * honestly, and with the right chunks stored, should be the same for every node in a neighbourhood. This is the Schelling point. * Each eligible node can then use these values, together with a random, single use, secret _revealNonce_ and their * _overlay_ as the pre-image values for the obsfucated _commit_, using the _wrapCommit_ method. * * Once the _commit_ round has elapsed, participating nodes must provide the values used to calculate their obsfucated * _commit_ hash, which, once verified for correctness and proximity to the anchor are retained in the _currentReveals_. * Nodes that have commited but do not reveal the correct values used to create the pre-image will have their stake * "frozen" for a period of rounds proportional to their reported depth. * * During the _reveal_ round, randomness is updated after every successful reveal. Once the reveal round is concluded, * the _currentRoundAnchor_ is updated and users can determine if they will be eligible their overlay will be eligible * for the next commit phase using _isParticipatingInUpcomingRound_. * * When the _reveal_ phase has been concluded, the claim phase can begin. At this point, the truth teller and winner * are already determined. By calling _isWinner_, an applicant node can run the relevant logic to determine if they have * been selected as the beneficiary of this round. When calling _claim_, the current pot from the PostageStamp contract * is withdrawn and transferred to that beneficiaries address. Nodes that have revealed values that differ from the truth, * have their stakes "frozen" for a period of rounds proportional to their reported depth. */ contract Redistribution is AccessControl, Pausable { // An eligible user may commit to an _obfuscatedHash_ during the commit phase... struct Commit { bytes32 overlay; address owner; uint256 stake; bytes32 obfuscatedHash; bool revealed; uint256 revealIndex; } // ...then provide the actual values that are the constituents of the pre-image of the _obfuscatedHash_ // during the reveal phase. struct Reveal { address owner; bytes32 overlay; uint256 stake; uint256 stakeDensity; bytes32 hash; uint8 depth; } // The address of the linked PostageStamp contract. PostageStamp public PostageContract; // The address of the linked PriceOracle contract. PriceOracle public OracleContract; // The address of the linked Staking contract. StakeRegistry public Stakes; // Commits for the current round. Commit[] public currentCommits; // Reveals for the current round. Reveal[] public currentReveals; // Role allowed to pause. bytes32 public constant PAUSER_ROLE = keccak256("PAUSER_ROLE"); uint256 public constant penaltyMultiplierDisagreement = 3; uint256 public constant penaltyMultiplierNonRevealed = 7; // Maximum value of the keccack256 hash. bytes32 MaxH = bytes32(0x00000000000000000000000000000000ffffffffffffffffffffffffffffffff); // The current anchor that being processed for the reveal and claim phases of the round. bytes32 currentRevealRoundAnchor; // The current random value from which we will random. // inputs for selection of the truth teller and beneficiary. bytes32 seed; // The miniumum stake allowed to be staked using the Staking contract. uint256 public minimumStake = 100000000000000000; // The number of the currently active round phases. uint256 public currentCommitRound; uint256 public currentRevealRound; uint256 public currentClaimRound; // The length of a round in blocks. uint256 public roundLength = 152; // The reveal of the winner of the last round. Reveal public winner; /** * @dev Pause the contract. The contract is provably stopped by renouncing the pauser role and the admin role after pausing, can only be called by the `PAUSER` */ function pause() public { require(hasRole(PAUSER_ROLE, msg.sender), "only pauser can pause"); _pause(); } /** * @dev Unpause the contract, can only be called by the pauser when paused */ function unPause() public { require(hasRole(PAUSER_ROLE, msg.sender), "only pauser can unpause"); _unpause(); } /** * @param staking the address of the linked Staking contract. * @param postageContract the address of the linked PostageStamp contract. * @param oracleContract the address of the linked PriceOracle contract. */ constructor( address staking, address postageContract, address oracleContract ) { Stakes = StakeRegistry(staking); PostageContract = PostageStamp(postageContract); OracleContract = PriceOracle(oracleContract); _setupRole(DEFAULT_ADMIN_ROLE, msg.sender); _setupRole(PAUSER_ROLE, msg.sender); } /** * @dev Emitted when the winner of a round is selected in the claim phase. */ event WinnerSelected(Reveal winner); /** * @dev Emitted when the truth oracle of a round is selected in the claim phase. */ event TruthSelected(bytes32 hash, uint8 depth); // Next two events to be removed after testing phase pending some other usefulness being found. /** * @dev Emits the number of commits being processed by the claim phase. */ event CountCommits(uint256 _count); /** * @dev Emits the number of reveals being processed by the claim phase. */ event CountReveals(uint256 _count); /** * @dev Logs that an overlay has committed */ event Committed(uint256 roundNumber, bytes32 overlay); /** * @dev Logs that an overlay has revealed */ event Revealed( uint256 roundNumber, bytes32 overlay, uint256 stake, uint256 stakeDensity, bytes32 reserveCommitment, uint8 depth ); /** * @notice The number of the current round. */ function currentRound() public view returns (uint256) { return (block.number / roundLength); } /** * @notice Returns true if current block is during commit phase. */ function currentPhaseCommit() public view returns (bool) { if (block.number % roundLength < roundLength / 4) { return true; } return false; } /** * @notice Returns true if current block is during reveal phase. */ function currentPhaseReveal() public view returns (bool) { uint256 number = block.number % roundLength; if ( number >= roundLength / 4 && number < roundLength / 2 ) { return true; } return false; } /** * @notice Returns true if current block is during claim phase. */ function currentPhaseClaim() public view returns (bool){ if ( block.number % roundLength >= roundLength / 2 ) { return true; } return false; } /** * @notice Returns true if current block is during reveal phase. */ function currentRoundReveals() public view returns (Reveal[] memory) { require(currentPhaseClaim(), "not in claim phase"); uint256 cr = currentRound(); require(cr == currentRevealRound, "round received no reveals"); return currentReveals; } /** * @notice Begin application for a round if eligible. Commit a hashed value for which the pre-image will be * subsequently revealed. * @dev If a node's overlay is _inProximity_(_depth_) of the _currentRoundAnchor_, that node may compute an * _obfuscatedHash_ by providing their _overlay_, reported storage _depth_, reserve commitment _hash_ and a * randomly generated, and secret _revealNonce_ to the _wrapCommit_ method. * @param _obfuscatedHash The calculated hash resultant of the required pre-image values. * @param _overlay The overlay referenced in the pre-image. Must be staked by at least the minimum value, * and be derived from the same key pair as the message sender. */ function commit( bytes32 _obfuscatedHash, bytes32 _overlay, uint256 _roundNumber ) external whenNotPaused { require(currentPhaseCommit(), "not in commit phase"); require( block.number % roundLength != ( roundLength / 4 ) - 1, "can not commit in last block of phase"); uint256 cr = currentRound(); require(cr <= _roundNumber, "commit round over"); require(cr >= _roundNumber, "commit round not started yet"); uint256 nstake = Stakes.stakeOfOverlay(_overlay); require(nstake >= minimumStake, "stake must exceed minimum"); require(Stakes.ownerOfOverlay(_overlay) == msg.sender, "owner must match sender"); require( Stakes.lastUpdatedBlockNumberOfOverlay(_overlay) < block.number - 2 * roundLength, "must have staked 2 rounds prior" ); // if we are in a new commit phase, reset the array of commits and // set the currentCommitRound to be the current one if (cr != currentCommitRound) { delete currentCommits; currentCommitRound = cr; } uint256 commitsArrayLength = currentCommits.length; for (uint256 i = 0; i < commitsArrayLength; i++) { require(currentCommits[i].overlay != _overlay, "only one commit each per round"); } currentCommits.push( Commit({ owner: msg.sender, overlay: _overlay, stake: nstake, obfuscatedHash: _obfuscatedHash, revealed: false, revealIndex: 0 }) ); emit Committed(_roundNumber, _overlay); } /** * @notice Returns the current random seed which is used to determine later utilised random numbers. * If rounds have elapsed without reveals, hash the seed with an incremented nonce to produce a new * random seed and hence a new round anchor. */ function currentSeed() public view returns (bytes32) { uint256 cr = currentRound(); bytes32 currentSeedValue = seed; if (cr > currentRevealRound + 1) { uint256 difference = cr - currentRevealRound - 1; currentSeedValue = keccak256(abi.encodePacked(currentSeedValue, difference)); } return currentSeedValue; } /** * @notice Returns the seed which will become current once the next commit phase begins. * Used to determine what the next round's anchor will be. */ function nextSeed() public view returns (bytes32) { uint256 cr = currentRound() + 1; bytes32 currentSeedValue = seed; if (cr > currentRevealRound + 1) { uint256 difference = cr - currentRevealRound - 1; currentSeedValue = keccak256(abi.encodePacked(currentSeedValue, difference)); } return currentSeedValue; } /** * @notice Updates the source of randomness. Uses block.difficulty in pre-merge chains, this is substituted * to block.prevrandao in post merge chains. */ function updateRandomness() private { seed = keccak256(abi.encode(seed, block.difficulty)); } function nonceBasedRandomness(bytes32 nonce) private { seed = seed ^ nonce; } /** * @notice Returns true if an overlay address _A_ is within proximity order _minimum_ of _B_. * @param A An overlay address to compare. * @param B An overlay address to compare. * @param minimum Minimum proximity order. */ function inProximity( bytes32 A, bytes32 B, uint8 minimum ) public pure returns (bool) { if (minimum == 0) { return true; } return uint256(A ^ B) < uint256(2**(256 - minimum)); } /** * @notice Hash the pre-image values to the obsfucated hash. * @dev _revealNonce_ must be randomly generated, used once and kept secret until the reveal phase. * @param _overlay The overlay address of the applicant. * @param _depth The reported depth. * @param _hash The reserve commitment hash. * @param revealNonce A random, single use, secret nonce. */ function wrapCommit( bytes32 _overlay, uint8 _depth, bytes32 _hash, bytes32 revealNonce ) public pure returns (bytes32) { return keccak256(abi.encodePacked(_overlay, _depth, _hash, revealNonce)); } /** * @notice Reveal the pre-image values used to generate commit provided during this round's commit phase. * @param _overlay The overlay address of the applicant. * @param _depth The reported depth. * @param _hash The reserve commitment hash. * @param _revealNonce The nonce used to generate the commit that is being revealed. */ function reveal( bytes32 _overlay, uint8 _depth, bytes32 _hash, bytes32 _revealNonce ) external whenNotPaused { require(currentPhaseReveal(), "not in reveal phase"); uint256 cr = currentRound(); require(cr == currentCommitRound, "round received no commits"); if (cr != currentRevealRound) { currentRevealRoundAnchor = currentRoundAnchor(); delete currentReveals; currentRevealRound = cr; updateRandomness(); } bytes32 commitHash = wrapCommit(_overlay, _depth, _hash, _revealNonce); uint256 commitsArrayLength = currentCommits.length; for (uint256 i = 0; i < commitsArrayLength; i++) { if (currentCommits[i].overlay == _overlay && commitHash == currentCommits[i].obfuscatedHash) { require( inProximity(currentCommits[i].overlay, currentRevealRoundAnchor, _depth), "anchor out of self reported depth" ); //check can only revealed once require(currentCommits[i].revealed == false, "participant already revealed"); currentCommits[i].revealed = true; currentCommits[i].revealIndex = currentReveals.length; currentReveals.push( Reveal({ owner: currentCommits[i].owner, overlay: currentCommits[i].overlay, stake: currentCommits[i].stake, stakeDensity: currentCommits[i].stake * uint256(2**_depth), hash: _hash, depth: _depth }) ); nonceBasedRandomness(_revealNonce); emit Revealed( cr, currentCommits[i].overlay, currentCommits[i].stake, currentCommits[i].stake * uint256(2**_depth), _hash, _depth ); return; } } require(false, "no matching commit or hash"); } /** * @notice Determine if a the owner of a given overlay will be the beneficiary of the claim phase. * @param _overlay The overlay address of the applicant. */ function isWinner(bytes32 _overlay) public view returns (bool) { require(currentPhaseClaim(), "winner not determined yet"); uint256 cr = currentRound(); require(cr == currentRevealRound, "round received no reveals"); require(cr > currentClaimRound, "round already received successful claim"); string memory truthSelectionAnchor = currentTruthSelectionAnchor(); uint256 currentSum; uint256 currentWinnerSelectionSum; bytes32 winnerIs; bytes32 randomNumber; bytes32 truthRevealedHash; uint8 truthRevealedDepth; uint256 commitsArrayLength = currentCommits.length; uint256 revIndex; uint256 k = 0; for (uint256 i = 0; i < commitsArrayLength; i++) { if (currentCommits[i].revealed) { revIndex = currentCommits[i].revealIndex; currentSum += currentReveals[revIndex].stakeDensity; randomNumber = keccak256(abi.encodePacked(truthSelectionAnchor, k)); if (uint256(randomNumber & MaxH) * currentSum < currentReveals[revIndex].stakeDensity * (uint256(MaxH) + 1)) { truthRevealedHash = currentReveals[revIndex].hash; truthRevealedDepth = currentReveals[revIndex].depth; } k++; } } k = 0; string memory winnerSelectionAnchor = currentWinnerSelectionAnchor(); for (uint256 i = 0; i < commitsArrayLength; i++) { revIndex = currentCommits[i].revealIndex; if (currentCommits[i].revealed && truthRevealedHash == currentReveals[revIndex].hash && truthRevealedDepth == currentReveals[revIndex].depth) { currentWinnerSelectionSum += currentReveals[revIndex].stakeDensity; randomNumber = keccak256(abi.encodePacked(winnerSelectionAnchor, k)); if ( uint256(randomNumber & MaxH) * currentWinnerSelectionSum < currentReveals[revIndex].stakeDensity * (uint256(MaxH) + 1) ) { winnerIs = currentReveals[revIndex].overlay; } k++; } } return (winnerIs == _overlay); } /** * @notice Determine if a the owner of a given overlay can participate in the upcoming round. * @param overlay The overlay address of the applicant. * @param depth The storage depth the applicant intends to report. */ function isParticipatingInUpcomingRound(bytes32 overlay, uint8 depth) public view returns (bool) { require(currentPhaseClaim() || currentPhaseCommit(), "not determined for upcoming round yet"); require( Stakes.lastUpdatedBlockNumberOfOverlay(overlay) < block.number - 2 * roundLength, "stake updated recently" ); require(Stakes.stakeOfOverlay(overlay) >= minimumStake, "stake amount does not meet minimum"); return inProximity(overlay, currentRoundAnchor(), depth); } /** * @notice The random value used to choose the selected truth teller. */ function currentTruthSelectionAnchor() private view returns (string memory) { require(currentPhaseClaim(), "not determined for current round yet"); uint256 cr = currentRound(); require(cr == currentRevealRound, "round received no reveals"); return string(abi.encodePacked(seed, "0")); } /** * @notice The random value used to choose the selected beneficiary. */ function currentWinnerSelectionAnchor() private view returns (string memory) { require(currentPhaseClaim(), "not determined for current round yet"); uint256 cr = currentRound(); require(cr == currentRevealRound, "round received no reveals"); return string(abi.encodePacked(seed, "1")); } /** * @notice The anchor used to determine eligibility for the current round. * @dev A node must be within proximity order of less than or equal to the storage depth they intend to report. */ function currentRoundAnchor() public view returns (bytes32 returnVal) { uint256 cr = currentRound(); if (currentPhaseCommit() || (cr > currentRevealRound && !currentPhaseClaim())) { return currentSeed(); } if (currentPhaseReveal() && cr == currentRevealRound) { require(false, "can't return value after first reveal"); } if (currentPhaseClaim()) { return nextSeed(); } } /** * @notice Conclude the current round by identifying the selected truth teller and beneficiary. * @dev */ function claim() external whenNotPaused { require(currentPhaseClaim(), "not in claim phase"); uint256 cr = currentRound(); require(cr == currentRevealRound, "round received no reveals"); require(cr > currentClaimRound, "round already received successful claim"); string memory truthSelectionAnchor = currentTruthSelectionAnchor(); uint256 currentSum; uint256 currentWinnerSelectionSum; bytes32 randomNumber; uint256 randomNumberTrunc; bytes32 truthRevealedHash; uint8 truthRevealedDepth; uint256 commitsArrayLength = currentCommits.length; uint256 revealsArrayLength = currentReveals.length; emit CountCommits(commitsArrayLength); emit CountReveals(revealsArrayLength); uint256 revIndex; uint256 k = 0; for (uint256 i = 0; i < commitsArrayLength; i++) { if (currentCommits[i].revealed) { revIndex = currentCommits[i].revealIndex; currentSum += currentReveals[revIndex].stakeDensity; randomNumber = keccak256(abi.encodePacked(truthSelectionAnchor, k)); randomNumberTrunc = uint256(randomNumber & MaxH); // question is whether randomNumber / MaxH < probability // where probability is stakeDensity / currentSum // to avoid resorting to floating points all divisions should be // simplified with multiplying both sides (as long as divisor > 0) // randomNumber / (MaxH + 1) < stakeDensity / currentSum // ( randomNumber / (MaxH + 1) ) * currentSum < stakeDensity // randomNumber * currentSum < stakeDensity * (MaxH + 1) if (randomNumberTrunc * currentSum < currentReveals[revIndex].stakeDensity * (uint256(MaxH) + 1)) { truthRevealedHash = currentReveals[revIndex].hash; truthRevealedDepth = currentReveals[revIndex].depth; } k++; } } emit TruthSelected(truthRevealedHash, truthRevealedDepth); k = 0; string memory winnerSelectionAnchor = currentWinnerSelectionAnchor(); for (uint256 i = 0; i < commitsArrayLength; i++) { revIndex = currentCommits[i].revealIndex; if (currentCommits[i].revealed ) { if ( truthRevealedHash == currentReveals[revIndex].hash && truthRevealedDepth == currentReveals[revIndex].depth) { currentWinnerSelectionSum += currentReveals[revIndex].stakeDensity; randomNumber = keccak256(abi.encodePacked(winnerSelectionAnchor, k)); randomNumberTrunc = uint256(randomNumber & MaxH); if ( randomNumberTrunc * currentWinnerSelectionSum < currentReveals[revIndex].stakeDensity * (uint256(MaxH) + 1) ) { winner = currentReveals[revIndex]; } k++; } else { Stakes.freezeDeposit(currentReveals[revIndex].overlay, penaltyMultiplierDisagreement * roundLength * uint256(2**truthRevealedDepth)); // slash ph5 } } else { // slash in later phase // Stakes.slashDeposit(currentCommits[i].overlay, currentCommits[i].stake); Stakes.freezeDeposit(currentCommits[i].overlay, penaltyMultiplierNonRevealed * roundLength * uint256(2**truthRevealedDepth)); continue; } } emit WinnerSelected(winner); PostageContract.withdraw(winner.owner); OracleContract.adjustPrice(uint256(k)); currentClaimRound = cr; } }
[{"inputs":[{"internalType":"address","name":"staking","type":"address"},{"internalType":"address","name":"postageContract","type":"address"},{"internalType":"address","name":"oracleContract","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"roundNumber","type":"uint256"},{"indexed":false,"internalType":"bytes32","name":"overlay","type":"bytes32"}],"name":"Committed","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"_count","type":"uint256"}],"name":"CountCommits","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"_count","type":"uint256"}],"name":"CountReveals","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"account","type":"address"}],"name":"Paused","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"roundNumber","type":"uint256"},{"indexed":false,"internalType":"bytes32","name":"overlay","type":"bytes32"},{"indexed":false,"internalType":"uint256","name":"stake","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"stakeDensity","type":"uint256"},{"indexed":false,"internalType":"bytes32","name":"reserveCommitment","type":"bytes32"},{"indexed":false,"internalType":"uint8","name":"depth","type":"uint8"}],"name":"Revealed","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"bytes32","name":"previousAdminRole","type":"bytes32"},{"indexed":true,"internalType":"bytes32","name":"newAdminRole","type":"bytes32"}],"name":"RoleAdminChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"sender","type":"address"}],"name":"RoleGranted","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"sender","type":"address"}],"name":"RoleRevoked","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"bytes32","name":"hash","type":"bytes32"},{"indexed":false,"internalType":"uint8","name":"depth","type":"uint8"}],"name":"TruthSelected","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"account","type":"address"}],"name":"Unpaused","type":"event"},{"anonymous":false,"inputs":[{"components":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"bytes32","name":"overlay","type":"bytes32"},{"internalType":"uint256","name":"stake","type":"uint256"},{"internalType":"uint256","name":"stakeDensity","type":"uint256"},{"internalType":"bytes32","name":"hash","type":"bytes32"},{"internalType":"uint8","name":"depth","type":"uint8"}],"indexed":false,"internalType":"struct Redistribution.Reveal","name":"winner","type":"tuple"}],"name":"WinnerSelected","type":"event"},{"inputs":[],"name":"DEFAULT_ADMIN_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"OracleContract","outputs":[{"internalType":"contract PriceOracle","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"PAUSER_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"PostageContract","outputs":[{"internalType":"contract PostageStamp","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"Stakes","outputs":[{"internalType":"contract StakeRegistry","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"claim","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"_obfuscatedHash","type":"bytes32"},{"internalType":"bytes32","name":"_overlay","type":"bytes32"},{"internalType":"uint256","name":"_roundNumber","type":"uint256"}],"name":"commit","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"currentClaimRound","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"currentCommitRound","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"currentCommits","outputs":[{"internalType":"bytes32","name":"overlay","type":"bytes32"},{"internalType":"address","name":"owner","type":"address"},{"internalType":"uint256","name":"stake","type":"uint256"},{"internalType":"bytes32","name":"obfuscatedHash","type":"bytes32"},{"internalType":"bool","name":"revealed","type":"bool"},{"internalType":"uint256","name":"revealIndex","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"currentPhaseClaim","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"currentPhaseCommit","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"currentPhaseReveal","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"currentRevealRound","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"currentReveals","outputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"bytes32","name":"overlay","type":"bytes32"},{"internalType":"uint256","name":"stake","type":"uint256"},{"internalType":"uint256","name":"stakeDensity","type":"uint256"},{"internalType":"bytes32","name":"hash","type":"bytes32"},{"internalType":"uint8","name":"depth","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"currentRound","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"currentRoundAnchor","outputs":[{"internalType":"bytes32","name":"returnVal","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"currentRoundReveals","outputs":[{"components":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"bytes32","name":"overlay","type":"bytes32"},{"internalType":"uint256","name":"stake","type":"uint256"},{"internalType":"uint256","name":"stakeDensity","type":"uint256"},{"internalType":"bytes32","name":"hash","type":"bytes32"},{"internalType":"uint8","name":"depth","type":"uint8"}],"internalType":"struct Redistribution.Reveal[]","name":"","type":"tuple[]"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"currentSeed","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"}],"name":"getRoleAdmin","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"grantRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"hasRole","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"A","type":"bytes32"},{"internalType":"bytes32","name":"B","type":"bytes32"},{"internalType":"uint8","name":"minimum","type":"uint8"}],"name":"inProximity","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"pure","type":"function"},{"inputs":[{"internalType":"bytes32","name":"overlay","type":"bytes32"},{"internalType":"uint8","name":"depth","type":"uint8"}],"name":"isParticipatingInUpcomingRound","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"_overlay","type":"bytes32"}],"name":"isWinner","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"minimumStake","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"nextSeed","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pause","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"paused","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"penaltyMultiplierDisagreement","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"penaltyMultiplierNonRevealed","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"renounceRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"_overlay","type":"bytes32"},{"internalType":"uint8","name":"_depth","type":"uint8"},{"internalType":"bytes32","name":"_hash","type":"bytes32"},{"internalType":"bytes32","name":"_revealNonce","type":"bytes32"}],"name":"reveal","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"revokeRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"roundLength","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes4","name":"interfaceId","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"unPause","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"winner","outputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"bytes32","name":"overlay","type":"bytes32"},{"internalType":"uint256","name":"stake","type":"uint256"},{"internalType":"uint256","name":"stakeDensity","type":"uint256"},{"internalType":"bytes32","name":"hash","type":"bytes32"},{"internalType":"uint8","name":"depth","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"_overlay","type":"bytes32"},{"internalType":"uint8","name":"_depth","type":"uint8"},{"internalType":"bytes32","name":"_hash","type":"bytes32"},{"internalType":"bytes32","name":"revealNonce","type":"bytes32"}],"name":"wrapCommit","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"pure","type":"function"}]
Contract Creation Code
60806040526001600160801b0360065567016345785d8a00006009556098600d553480156200002d57600080fd5b50604051620035fb380380620035fb8339810160408190526200005091620001c3565b60018054600380546001600160a01b03199081166001600160a01b03888116919091179092556001600160a81b0319909216610100868316021790925560028054909116918316919091179055620000aa600033620000df565b620000d67f65d7a28e3265b37a6474929f336521b332c1681b933f6cb9f3376673440d862a33620000df565b5050506200020c565b620000eb8282620000ef565b5050565b620000fb828262000179565b620000eb576000828152602081815260408083206001600160a01b03851684529091529020805460ff1916600117905562000135620001a2565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b6000918252602082815260408084206001600160a01b0393909316845291905290205460ff1690565b3390565b80516001600160a01b0381168114620001be57600080fd5b919050565b600080600060608486031215620001d8578283fd5b620001e384620001a6565b9250620001f360208501620001a6565b91506200020360408501620001a6565b90509250925092565b6133df806200021c6000396000f3fe608060405234801561001057600080fd5b506004361061023d5760003560e01c80637fe019c61161013b578063c1d810d5116100b8578063dfbf53ae1161007c578063dfbf53ae14610444578063e63ab1e91461044c578063ec5ffac214610454578063f7b188a51461045c578063fb00f2f3146104645761023d565b8063c1d810d5146103fb578063c203ce521461040e578063ce98774514610416578063d1e8b63d14610429578063d547741f146104315761023d565b80638b649b94116100ff5780638b649b94146103bd5780638d8b6428146103c557806391d14854146103cd578063a217fddf146103e0578063b78a52a7146103e85761023d565b80637fe019c61461037857806382b39b1b1461038057806383220626146103a55780638456cb59146103ad5780638a19c8bc146103b55761023d565b80634e71d92d116101c957806369bfac011161018d57806369bfac011461032857806369da9114146103305780636f94aaf21461033857806372286cba1461034057806377c75d10146103655761023d565b80634e71d92d146103005780635c975abb146103085780635d4844ea1461031057806362fd29ae1461031857806364c34a85146103205761023d565b80632f2ff15d116102105780632f2ff15d146102b55780632f3906da146102ca57806336568abe146102d25780634a2e7598146102e55780634e3727d2146102f85761023d565b806301ffc9a714610242578063183500961461026b578063248a9ca3146102805780632a4e6249146102a0575b600080fd5b610255610250366004612884565b610477565b6040516102629190612a2d565b60405180910390f35b6102736104a4565b604051610262919061295f565b61029361028e366004612779565b6104b8565b6040516102629190612a38565b6102a86104cd565b60405161026291906129a9565b6102c86102c3366004612791565b6105ca565b005b610255610608565b6102c86102e0366004612791565b61065d565b6102c86102f33660046127c0565b61069f565b610293610b9a565b6102c8610b9f565b6102556113a4565b6102736113ad565b6102936113bc565b61029361143f565b6102936114d0565b6102736114d6565b6102936114e5565b61035361034e366004612779565b6114eb565b60405161026296959493929190612a41565b610255610373366004612779565b611541565b6102936119fb565b61039361038e366004612779565b611a01565b60405161026296959493929190612973565b610293611a54565b6102c8611a5f565b610293611aaf565b610293611ac4565b610255611aca565b6102556103db366004612791565b611afb565b610293611b24565b6102556103f636600461281f565b611b29565b6102c861040936600461284a565b611ccc565b610293612207565b61029361042436600461284a565b61220c565b610255612245565b6102c861043f366004612791565b612271565b610393612299565b6102936122bd565b6102936122e1565b6102c86122e7565b6102556104723660046127eb565b612335565b60006001600160e01b03198216637965db0b60e01b148061049c575061049c8261236e565b90505b919050565b60015461010090046001600160a01b031681565b60009081526020819052604090206001015490565b60606104d7611aca565b6104fc5760405162461bcd60e51b81526004016104f390612b31565b60405180910390fd5b6000610506611aaf565b9050600b5481146105295760405162461bcd60e51b81526004016104f390612faf565b6005805480602002602001604051908101604052809291908181526020016000905b828210156105bf5760008481526020908190206040805160c0810182526006860290920180546001600160a01b031683526001808201548486015260028201549284019290925260038101546060840152600481015460808401526005015460ff1660a0830152908352909201910161054b565b505050509150505b90565b6105de6105d6836104b8565b6103db612387565b6105fa5760405162461bcd60e51b81526004016104f390612ab4565b610604828261238b565b5050565b600080600d54436106199190613354565b90506004600d5461062a91906131a1565b811015801561064657506002600d5461064391906131a1565b81105b156106555760019150506105c7565b600091505090565b610665612387565b6001600160a01b0316816001600160a01b0316146106955760405162461bcd60e51b81526004016104f3906130c6565b6106048282612410565b6106a76113a4565b156106c45760405162461bcd60e51b81526004016104f390612db8565b6106cc612245565b6106e85760405162461bcd60e51b81526004016104f390612c5f565b60016004600d546106f991906131a1565b6107039190613322565b600d546107109043613354565b141561072e5760405162461bcd60e51b81526004016104f390612b5d565b6000610738611aaf565b90508181111561075a5760405162461bcd60e51b81526004016104f39061301d565b8181101561077a5760405162461bcd60e51b81526004016104f390612f78565b6003546040516348962b9360e01b81526000916001600160a01b0316906348962b93906107ab908790600401612a38565b60206040518083038186803b1580156107c357600080fd5b505afa1580156107d7573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107fb91906128ac565b905060095481101561081f5760405162461bcd60e51b81526004016104f390612ec6565b60035460405163a0d22b2160e01b815233916001600160a01b03169063a0d22b219061084f908890600401612a38565b60206040518083038186803b15801561086757600080fd5b505afa15801561087b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061089f919061275d565b6001600160a01b0316146108c55760405162461bcd60e51b81526004016104f390612ba2565b600d546108d39060026132e0565b6108dd9043613322565b6003546040516376f2098160e11b81526001600160a01b039091169063ede413029061090d908890600401612a38565b60206040518083038186803b15801561092557600080fd5b505afa158015610939573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061095d91906128ac565b1061097a5760405162461bcd60e51b81526004016104f390612efd565b600a5482146109955761098f60046000612679565b600a8290555b60045460005b81811015610a075785600482815481106109c557634e487b7160e01b600052603260045260246000fd5b90600052602060002090600602016000015414156109f55760405162461bcd60e51b81526004016104f390612fe6565b806109ff81613339565b91505061099b565b506040805160c0810182528681523360208201908152818301858152606083018a815260006080850181815260a0860182815260048054600181018255935295517f8a35acfbc15ff81a39ae7d344fd709f28e8600b4aa8c65c6b64bfe7fe36bd19b60069093029283015593517f8a35acfbc15ff81a39ae7d344fd709f28e8600b4aa8c65c6b64bfe7fe36bd19c820180546001600160a01b0319166001600160a01b0390921691909117905591517f8a35acfbc15ff81a39ae7d344fd709f28e8600b4aa8c65c6b64bfe7fe36bd19d830155517f8a35acfbc15ff81a39ae7d344fd709f28e8600b4aa8c65c6b64bfe7fe36bd19e82015590517f8a35acfbc15ff81a39ae7d344fd709f28e8600b4aa8c65c6b64bfe7fe36bd19f8201805460ff191691151591909117905590517f8a35acfbc15ff81a39ae7d344fd709f28e8600b4aa8c65c6b64bfe7fe36bd1a090910155517f68e0867601a98978930107aee7f425665e61edd70ca594c68ca5da9e81f84c2990610b8a90869088906128ea565b60405180910390a1505050505050565b600381565b610ba76113a4565b15610bc45760405162461bcd60e51b81526004016104f390612db8565b610bcc611aca565b610be85760405162461bcd60e51b81526004016104f390612b31565b6000610bf2611aaf565b9050600b548114610c155760405162461bcd60e51b81526004016104f390612faf565b600c548111610c365760405162461bcd60e51b81526004016104f390613048565b6000610c40612493565b6004546005546040519293506000928392839283928392839290917f6752c5e71c95fb93bc7137adeb115a33fa4e54e2683e33d3f90c2bb1c4b6c2a590610c88908490612a38565b60405180910390a17f4c03de6a759749c0c9387b7014634dc5c6af610e1366023d90751c783a998f8d81604051610cbf9190612a38565b60405180910390a1600080805b84811015610ea45760048181548110610cf557634e487b7160e01b600052603260045260246000fd5b600091825260209091206004600690920201015460ff1615610e925760048181548110610d3257634e487b7160e01b600052603260045260246000fd5b906000526020600020906006020160050154925060058381548110610d6757634e487b7160e01b600052603260045260246000fd5b9060005260206000209060060201600301548b610d849190613189565b9a508b82604051602001610d99929190612920565b60408051601f198184030181529190528051602090910120600654909950808a169850610dc7906001613189565b60058481548110610de857634e487b7160e01b600052603260045260246000fd5b906000526020600020906006020160030154610e0491906132e0565b610e0e8c8a6132e0565b1015610e845760058381548110610e3557634e487b7160e01b600052603260045260246000fd5b906000526020600020906006020160040154965060058381548110610e6a57634e487b7160e01b600052603260045260246000fd5b600091825260209091206005600690920201015460ff1695505b81610e8e81613339565b9250505b80610e9c81613339565b915050610ccc565b507f34e8eda4cd857cd2865becf58a47748f31415f4a382cbb2cc0c64b9a27c717be8686604051610ed6929190612a74565b60405180910390a150600080610eea61250e565b905060005b8581101561128a5760048181548110610f1857634e487b7160e01b600052603260045260246000fd5b906000526020600020906006020160050154935060048181548110610f4d57634e487b7160e01b600052603260045260246000fd5b600091825260209091206004600690920201015460ff16156112165760058481548110610f8a57634e487b7160e01b600052603260045260246000fd5b90600052602060002090600602016004015488148015610fe3575060058481548110610fc657634e487b7160e01b600052603260045260246000fd5b600091825260209091206005600690920201015460ff8881169116145b15611152576005848154811061100957634e487b7160e01b600052603260045260246000fd5b9060005260206000209060060201600301548b6110269190613189565b9a50818360405160200161103b929190612920565b60408051601f198184030181529190528051602090910120600654909a50808b169950611069906001613189565b6005858154811061108a57634e487b7160e01b600052603260045260246000fd5b9060005260206000209060060201600301546110a691906132e0565b6110b08c8b6132e0565b101561114057600584815481106110d757634e487b7160e01b600052603260045260246000fd5b600091825260209091206006909102018054600e80546001600160a01b0319166001600160a01b039092169190911790556001810154600f55600281015460105560038101546011556004810154601255600501546013805460ff191660ff9092169190911790555b8261114a81613339565b935050611211565b600354600580546001600160a01b039092169163837fd16a91908790811061118a57634e487b7160e01b600052603260045260246000fd5b9060005260206000209060060201600101548960026111a9919061320e565b600d546111b79060036132e0565b6111c191906132e0565b6040518363ffffffff1660e01b81526004016111de9291906128ea565b600060405180830381600087803b1580156111f857600080fd5b505af115801561120c573d6000803e3d6000fd5b505050505b611278565b600354600480546001600160a01b039092169163837fd16a91908490811061124e57634e487b7160e01b600052603260045260246000fd5b600091825260209091206006909102015461126a8a600261320e565b600d546111b79060076132e0565b8061128281613339565b915050610eef565b507f2756aa512df0e32847d196f374c5b2fa5f30705f2fe3a75b8baeac52f2af5b39600e6040516112bb9190613115565b60405180910390a1600154600e546040516351cff8d960e01b81526001600160a01b036101009093048316926351cff8d9926112fc9291169060040161295f565b600060405180830381600087803b15801561131657600080fd5b505af115801561132a573d6000803e3d6000fd5b505060025460405163395f83cf60e11b81526001600160a01b0390911692506372bf079e915061135e908590600401612a38565b600060405180830381600087803b15801561137857600080fd5b505af115801561138c573d6000803e3d6000fd5b505050600c9d909d5550505050505050505050505050565b60015460ff1690565b6003546001600160a01b031681565b6000806113c7611aaf565b6113d2906001613189565b600854600b54919250906113e7906001613189565b8211156114395760006001600b54846114009190613322565b61140a9190613322565b9050818160405160200161141f9291906128ea565b604051602081830303815290604052805190602001209150505b91505090565b60008061144a611aaf565b9050611454612245565b806114705750600b5481118015611470575061146e611aca565b155b156114855761147d611a54565b9150506105c7565b61148d610608565b801561149a5750600b5481145b156114b75760405162461bcd60e51b81526004016104f390612bd9565b6114bf611aca565b156114cc5761147d6113bc565b5090565b600a5481565b6002546001600160a01b031681565b600c5481565b600481815481106114fb57600080fd5b60009182526020909120600690910201805460018201546002830154600384015460048501546005909501549395506001600160a01b0390921693909260ff9091169086565b600061154b611aca565b6115675760405162461bcd60e51b81526004016104f390612cc3565b6000611571611aaf565b9050600b5481146115945760405162461bcd60e51b81526004016104f390612faf565b600c5481116115b55760405162461bcd60e51b81526004016104f390613048565b60006115bf612493565b600454909150600090819081908190819081908180805b838110156117b057600481815481106115ff57634e487b7160e01b600052603260045260246000fd5b600091825260209091206004600690920201015460ff161561179e576004818154811061163c57634e487b7160e01b600052603260045260246000fd5b90600052602060002090600602016005015492506005838154811061167157634e487b7160e01b600052603260045260246000fd5b9060005260206000209060060201600301548a61168e9190613189565b99508a826040516020016116a3929190612920565b60405160208183030381529060405280519060200120965060065460001c60016116cd9190613189565b600584815481106116ee57634e487b7160e01b600052603260045260246000fd5b90600052602060002090600602016003015461170a91906132e0565b60065461171a908c908a166132e0565b1015611790576005838154811061174157634e487b7160e01b600052603260045260246000fd5b90600052602060002090600602016004015495506005838154811061177657634e487b7160e01b600052603260045260246000fd5b600091825260209091206005600690920201015460ff1694505b8161179a81613339565b9250505b806117a881613339565b9150506115d6565b506000905060006117bf61250e565b905060005b848110156119e657600481815481106117ed57634e487b7160e01b600052603260045260246000fd5b90600052602060002090600602016005015493506004818154811061182257634e487b7160e01b600052603260045260246000fd5b600091825260209091206004600690920201015460ff16801561187657506005848154811061186157634e487b7160e01b600052603260045260246000fd5b90600052602060002090600602016004015487145b80156118bb57506005848154811061189e57634e487b7160e01b600052603260045260246000fd5b600091825260209091206005600690920201015460ff8781169116145b156119d457600584815481106118e157634e487b7160e01b600052603260045260246000fd5b9060005260206000209060060201600301548a6118fe9190613189565b99508183604051602001611913929190612920565b60405160208183030381529060405280519060200120975060065460001c600161193d9190613189565b6005858154811061195e57634e487b7160e01b600052603260045260246000fd5b90600052602060002090600602016003015461197a91906132e0565b60065461198a908c908b166132e0565b10156119c657600584815481106119b157634e487b7160e01b600052603260045260246000fd5b90600052602060002090600602016001015498505b826119d081613339565b9350505b806119de81613339565b9150506117c4565b5050509a9094149a9950505050505050505050565b600b5481565b60058181548110611a1157600080fd5b60009182526020909120600690910201805460018201546002830154600384015460048501546005909501546001600160a01b0390941695509193909260ff1686565b6000806113d2611aaf565b611a897f65d7a28e3265b37a6474929f336521b332c1681b933f6cb9f3376673440d862a33611afb565b611aa55760405162461bcd60e51b81526004016104f390612a85565b611aad612574565b565b6000600d5443611abf91906131a1565b905090565b600d5481565b60006002600d54611adb91906131a1565b600d54611ae89043613354565b10611af5575060016105c7565b50600090565b6000918252602082815260408084206001600160a01b0393909316845291905290205460ff1690565b600081565b6000611b33611aca565b80611b415750611b41612245565b611b5d5760405162461bcd60e51b81526004016104f390612de2565b600d54611b6b9060026132e0565b611b759043613322565b6003546040516376f2098160e11b81526001600160a01b039091169063ede4130290611ba5908790600401612a38565b60206040518083038186803b158015611bbd57600080fd5b505afa158015611bd1573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611bf591906128ac565b10611c125760405162461bcd60e51b81526004016104f390612e96565b6009546003546040516348962b9360e01b81526001600160a01b03909116906348962b9390611c45908790600401612a38565b60206040518083038186803b158015611c5d57600080fd5b505afa158015611c71573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611c9591906128ac565b1015611cb35760405162461bcd60e51b81526004016104f390612e54565b611cc583611cbf61143f565b84612335565b9392505050565b611cd46113a4565b15611cf15760405162461bcd60e51b81526004016104f390612db8565b611cf9610608565b611d155760405162461bcd60e51b81526004016104f390612e27565b6000611d1f611aaf565b9050600a548114611d425760405162461bcd60e51b81526004016104f390612cfa565b600b548114611d6f57611d5361143f565b600755611d626005600061269d565b600b819055611d6f6125e5565b6000611d7d8686868661220c565b60045490915060005b818110156121e8578760048281548110611db057634e487b7160e01b600052603260045260246000fd5b906000526020600020906006020160000154148015611e00575060048181548110611deb57634e487b7160e01b600052603260045260246000fd5b90600052602060002090600602016003015483145b156121d657611e4460048281548110611e2957634e487b7160e01b600052603260045260246000fd5b90600052602060002090600602016000015460075489612335565b611e605760405162461bcd60e51b81526004016104f390612c1e565b60048181548110611e8157634e487b7160e01b600052603260045260246000fd5b600091825260209091206004600690920201015460ff1615611eb55760405162461bcd60e51b81526004016104f390612c8c565b600160048281548110611ed857634e487b7160e01b600052603260045260246000fd5b906000526020600020906006020160040160006101000a81548160ff02191690831515021790555060058054905060048281548110611f2757634e487b7160e01b600052603260045260246000fd5b90600052602060002090600602016005018190555060056040518060c0016040528060048481548110611f6a57634e487b7160e01b600052603260045260246000fd5b6000918252602091829020600160069092020101546001600160a01b0316825260048054929091019185908110611fb157634e487b7160e01b600052603260045260246000fd5b906000526020600020906006020160000154815260200160048481548110611fe957634e487b7160e01b600052603260045260246000fd5b906000526020600020906006020160020154815260200189600261200d919061320e565b6004858154811061202e57634e487b7160e01b600052603260045260246000fd5b90600052602060002090600602016002015461204a91906132e0565b815260208082018a905260ff8b8116604093840152845460018082018755600096875295839020855160069092020180546001600160a01b0319166001600160a01b039092169190911781559184015194820194909455908201516002820155606082015160038201556080820151600482015560a0909101516005909101805460ff1916919092161790556120df85612617565b7f13fc17fd71632266fe82092de6dd91a06b4fa68d8dc950492e5421cbed55a6a5846004838154811061212257634e487b7160e01b600052603260045260246000fd5b9060005260206000209060060201600001546004848154811061215557634e487b7160e01b600052603260045260246000fd5b9060005260206000209060060201600201548a6002612174919061320e565b6004868154811061219557634e487b7160e01b600052603260045260246000fd5b9060005260206000209060060201600201546121b191906132e0565b8a8c6040516121c59695949392919061315e565b60405180910390a150505050612201565b806121e081613339565b915050611d86565b5060405162461bcd60e51b81526004016104f39061308f565b50505050565b600781565b60008484848460405160200161222594939291906128f8565b604051602081830303815290604052805190602001209050949350505050565b60006004600d5461225691906131a1565b600d546122639043613354565b1015611af5575060016105c7565b61227d6105d6836104b8565b6106955760405162461bcd60e51b81526004016104f390612d68565b600e54600f546010546011546012546013546001600160a01b039095169460ff1686565b7f65d7a28e3265b37a6474929f336521b332c1681b933f6cb9f3376673440d862a81565b60095481565b6123117f65d7a28e3265b37a6474929f336521b332c1681b933f6cb9f3376673440d862a33611afb565b61232d5760405162461bcd60e51b81526004016104f390612d31565b611aad612622565b600060ff821661234757506001611cc5565b61235660ff83166101006132ff565b6123619060026131fb565b8484181090509392505050565b6001600160e01b031981166301ffc9a760e01b14919050565b3390565b6123958282611afb565b610604576000828152602081815260408083206001600160a01b03851684529091529020805460ff191660011790556123cc612387565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b61241a8282611afb565b15610604576000828152602081815260408083206001600160a01b03851684529091529020805460ff1916905561244f612387565b6001600160a01b0316816001600160a01b0316837ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b60405160405180910390a45050565b606061249d611aca565b6124b95760405162461bcd60e51b81526004016104f390612f34565b60006124c3611aaf565b9050600b5481146124e65760405162461bcd60e51b81526004016104f390612faf565b6008546040516020016124f991906128c4565b60405160208183030381529060405291505090565b6060612518611aca565b6125345760405162461bcd60e51b81526004016104f390612f34565b600061253e611aaf565b9050600b5481146125615760405162461bcd60e51b81526004016104f390612faf565b6008546040516020016124f991906128d7565b61257c6113a4565b156125995760405162461bcd60e51b81526004016104f390612db8565b6001805460ff1916811790557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a2586125ce612387565b6040516125db919061295f565b60405180910390a1565b600854446040516020016125fa9291906128ea565b60408051601f198184030181529190528051602090910120600855565b600880549091189055565b61262a6113a4565b6126465760405162461bcd60e51b81526004016104f390612b03565b6001805460ff191690557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa6125ce612387565b508054600082556006029060005260206000209081019061269a91906126be565b50565b508054600082556006029060005260206000209081019061269a9190612705565b5b808211156114cc5760008082556001820180546001600160a01b0319169055600282018190556003820181905560048201805460ff1916905560058201556006016126bf565b5b808211156114cc5780546001600160a01b03191681556000600182018190556002820181905560038201819055600482015560058101805460ff19169055600601612706565b803560ff8116811461049f57600080fd5b60006020828403121561276e578081fd5b8151611cc581613394565b60006020828403121561278a578081fd5b5035919050565b600080604083850312156127a3578081fd5b8235915060208301356127b581613394565b809150509250929050565b6000806000606084860312156127d4578081fd5b505081359360208301359350604090920135919050565b6000806000606084860312156127ff578283fd5b83359250602084013591506128166040850161274c565b90509250925092565b60008060408385031215612831578182fd5b823591506128416020840161274c565b90509250929050565b6000806000806080858703121561285f578081fd5b8435935061286f6020860161274c565b93969395505050506040820135916060013590565b600060208284031215612895578081fd5b81356001600160e01b031981168114611cc5578182fd5b6000602082840312156128bd578081fd5b5051919050565b908152600360fc1b602082015260210190565b908152603160f81b602082015260210190565b918252602082015260400190565b93845260f89290921b6001600160f81b03191660208401526021830152604182015260610190565b60008351815b818110156129405760208187018101518583015201612926565b8181111561294e5782828501525b509190910191825250602001919050565b6001600160a01b0391909116815260200190565b6001600160a01b03969096168652602086019490945260408501929092526060840152608083015260ff1660a082015260c00190565b602080825282518282018190526000919060409081850190868401855b82811015612a2057815180516001600160a01b0316855286810151878601528581015186860152606080820151908601526080808201519086015260a09081015160ff169085015260c090930192908501906001016129c6565b5091979650505050505050565b901515815260200190565b90815260200190565b9586526001600160a01b03949094166020860152604085019290925260608401521515608083015260a082015260c00190565b91825260ff16602082015260400190565b6020808252601590820152746f6e6c79207061757365722063616e20706175736560581b604082015260600190565b6020808252602f908201527f416363657373436f6e74726f6c3a2073656e646572206d75737420626520616e60408201526e0818591b5a5b881d1bc819dc985b9d608a1b606082015260800190565b60208082526014908201527314185d5cd8589b194e881b9bdd081c185d5cd95960621b604082015260600190565b6020808252601290820152716e6f7420696e20636c61696d20706861736560701b604082015260600190565b60208082526025908201527f63616e206e6f7420636f6d6d697420696e206c61737420626c6f636b206f6620604082015264706861736560d81b606082015260800190565b60208082526017908201527f6f776e6572206d757374206d617463682073656e646572000000000000000000604082015260600190565b60208082526025908201527f63616e27742072657475726e2076616c75652061667465722066697273742072604082015264195d99585b60da1b606082015260800190565b60208082526021908201527f616e63686f72206f7574206f662073656c66207265706f7274656420646570746040820152600d60fb1b606082015260800190565b6020808252601390820152726e6f7420696e20636f6d6d697420706861736560681b604082015260600190565b6020808252601c908201527f7061727469636970616e7420616c72656164792072657665616c656400000000604082015260600190565b60208082526019908201527f77696e6e6572206e6f742064657465726d696e65642079657400000000000000604082015260600190565b60208082526019908201527f726f756e64207265636569766564206e6f20636f6d6d69747300000000000000604082015260600190565b60208082526017908201527f6f6e6c79207061757365722063616e20756e7061757365000000000000000000604082015260600190565b60208082526030908201527f416363657373436f6e74726f6c3a2073656e646572206d75737420626520616e60408201526f2061646d696e20746f207265766f6b6560801b606082015260800190565b60208082526010908201526f14185d5cd8589b194e881c185d5cd95960821b604082015260600190565b60208082526025908201527f6e6f742064657465726d696e656420666f72207570636f6d696e6720726f756e60408201526419081e595d60da1b606082015260800190565b6020808252601390820152726e6f7420696e2072657665616c20706861736560681b604082015260600190565b60208082526022908201527f7374616b6520616d6f756e7420646f6573206e6f74206d656574206d696e696d604082015261756d60f01b606082015260800190565b6020808252601690820152757374616b65207570646174656420726563656e746c7960501b604082015260600190565b60208082526019908201527f7374616b65206d75737420657863656564206d696e696d756d00000000000000604082015260600190565b6020808252601f908201527f6d7573742068617665207374616b6564203220726f756e6473207072696f7200604082015260600190565b60208082526024908201527f6e6f742064657465726d696e656420666f722063757272656e7420726f756e64604082015263081e595d60e21b606082015260800190565b6020808252601c908201527f636f6d6d697420726f756e64206e6f7420737461727465642079657400000000604082015260600190565b60208082526019908201527f726f756e64207265636569766564206e6f2072657665616c7300000000000000604082015260600190565b6020808252601e908201527f6f6e6c79206f6e6520636f6d6d697420656163682070657220726f756e640000604082015260600190565b60208082526011908201527031b7b6b6b4ba103937bab7321037bb32b960791b604082015260600190565b60208082526027908201527f726f756e6420616c7265616479207265636569766564207375636365737366756040820152666c20636c61696d60c81b606082015260800190565b6020808252601a908201527f6e6f206d61746368696e6720636f6d6d6974206f722068617368000000000000604082015260600190565b6020808252602f908201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560408201526e103937b632b9903337b91039b2b63360891b606082015260800190565b81546001600160a01b031681526001820154602082015260028201546040820152600382015460608201526004820154608082015260059091015460ff1660a082015260c00190565b958652602086019490945260408501929092526060840152608083015260ff1660a082015260c00190565b6000821982111561319c5761319c613368565b500190565b6000826131b0576131b061337e565b500490565b80825b60018086116131c757506131f2565b8187048211156131d9576131d9613368565b808616156131e657918102915b9490941c9380026131b8565b94509492505050565b6000611cc560001961ffff85168461321c565b6000611cc560001960ff8516845b60008261322b57506001611cc5565b8161323857506000611cc5565b816001811461324e576002811461325857613285565b6001915050611cc5565b60ff84111561326957613269613368565b6001841b91508482111561327f5761327f613368565b50611cc5565b5060208310610133831016604e8410600b84101617156132b8575081810a838111156132b3576132b3613368565b611cc5565b6132c584848460016131b5565b8086048211156132d7576132d7613368565b02949350505050565b60008160001904831182151516156132fa576132fa613368565b500290565b600061ffff8381169083168181101561331a5761331a613368565b039392505050565b60008282101561333457613334613368565b500390565b600060001982141561334d5761334d613368565b5060010190565b6000826133635761336361337e565b500690565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052601260045260246000fd5b6001600160a01b038116811461269a57600080fdfea2646970667358221220c07b1ff04ecf02889c42a9329b78db8d959b6ece4b080339ffe785198fbfe91f64736f6c63430008010033000000000000000000000000781c6d1f0eae6f1da1f604c6cdccdb8b76428ba700000000000000000000000030d155478ef27ab32a1d578be7b84bc5988af381000000000000000000000000344a2cc7304b32a87efdc5407cd4bec7cf98f035
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
000000000000000000000000781c6d1f0eae6f1da1f604c6cdccdb8b76428ba700000000000000000000000030d155478ef27ab32a1d578be7b84bc5988af381000000000000000000000000344a2cc7304b32a87efdc5407cd4bec7cf98f035
-----Decoded View---------------
Arg [0] : staking (address): 0x781c6d1f0eae6f1da1f604c6cdccdb8b76428ba7
Arg [1] : postageContract (address): 0x30d155478ef27ab32a1d578be7b84bc5988af381
Arg [2] : oracleContract (address): 0x344a2cc7304b32a87efdc5407cd4bec7cf98f035
-----Encoded View---------------
3 Constructor Arguments found :
Arg [0] : 000000000000000000000000781c6d1f0eae6f1da1f604c6cdccdb8b76428ba7
Arg [1] : 00000000000000000000000030d155478ef27ab32a1d578be7b84bc5988af381
Arg [2] : 000000000000000000000000344a2cc7304b32a87efdc5407cd4bec7cf98f035
Deployed ByteCode Sourcemap
82562:22834:0:-:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;30273:217;;;;;;:::i;:::-;;:::i;:::-;;;;;;;:::i;:::-;;;;;;;;83274:35;;;:::i;:::-;;;;;;;:::i;30910:123::-;;;;;;:::i;:::-;;:::i;:::-;;;;;;;:::i;88227:281::-;;;:::i;:::-;;;;;;;:::i;31295:232::-;;;;;;:::i;:::-;;:::i;:::-;;87598:251;;;:::i;32514:218::-;;;;;;:::i;:::-;;:::i;89260:1739::-;;;;;;:::i;:::-;;:::i;83756:57::-;;;:::i;101477:3916::-;;;:::i;23630:86::-;;;:::i;83464:27::-;;;:::i;91858:389::-;;;:::i;100854:483::-;;;:::i;84502:33::-;;;:::i;83372:::-;;;:::i;84582:32::-;;;:::i;83539:30::-;;;;;;:::i;:::-;;:::i;:::-;;;;;;;;;;;;:::i;96656:2316::-;;;;;;:::i;:::-;;:::i;84542:33::-;;;:::i;83615:30::-;;;;;;:::i;:::-;;:::i;:::-;;;;;;;;;;;;:::i;91286:388::-;;;:::i;84974:128::-;;;:::i;87112:108::-;;;:::i;84664:32::-;;;:::i;87944:187::-;;;:::i;30582:139::-;;;;;;:::i;:::-;;:::i;29038:49::-;;;:::i;99228:543::-;;;;;;:::i;:::-;;:::i;94213:2251::-;;;;;;:::i;:::-;;:::i;83820:56::-;;;:::i;93580:252::-;;;;;;:::i;:::-;;:::i;87316:186::-;;;:::i;31772:235::-;;;;;;:::i;:::-;;:::i;84757:20::-;;;:::i;83685:62::-;;;:::i;84388:48::-;;;:::i;85208:134::-;;;:::i;92911:255::-;;;;;;:::i;:::-;;:::i;30273:217::-;30358:4;-1:-1:-1;;;;;;30382:47:0;;-1:-1:-1;;;30382:47:0;;:100;;;30446:36;30470:11;30446:23;:36::i;:::-;30375:107;;30273:217;;;;:::o;83274:35::-;;;;;;-1:-1:-1;;;;;83274:35:0;;:::o;30910:123::-;30976:7;31003:12;;;;;;;;;;:22;;;;30910:123::o;88227:281::-;88279:15;88315:19;:17;:19::i;:::-;88307:50;;;;-1:-1:-1;;;88307:50:0;;;;;;;:::i;:::-;;;;;;;;;88368:10;88381:14;:12;:14::i;:::-;88368:27;;88420:18;;88414:2;:24;88406:62;;;;-1:-1:-1;;;88406:62:0;;;;;;;:::i;:::-;88486:14;88479:21;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;;;;88479:21:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;88227:281;;:::o;31295:232::-;31388:41;31396:18;31409:4;31396:12;:18::i;:::-;31416:12;:10;:12::i;31388:41::-;31380:101;;;;-1:-1:-1;;;31380:101:0;;;;;;;:::i;:::-;31494:25;31505:4;31511:7;31494:10;:25::i;:::-;31295:232;;:::o;87598:251::-;87649:4;87666:14;87698:11;;87683:12;:26;;;;:::i;:::-;87666:43;;87749:1;87735:11;;:15;;;;:::i;:::-;87725:6;:25;;:53;;;;;87777:1;87763:11;;:15;;;;:::i;:::-;87754:6;:24;87725:53;87720:99;;;87803:4;87796:11;;;;;87720:99;87836:5;87829:12;;;87598:251;:::o;32514:218::-;32621:12;:10;:12::i;:::-;-1:-1:-1;;;;;32610:23:0;:7;-1:-1:-1;;;;;32610:23:0;;32602:83;;;;-1:-1:-1;;;32602:83:0;;;;;;;:::i;:::-;32698:26;32710:4;32716:7;32698:11;:26::i;89260:1739::-;23956:8;:6;:8::i;:::-;23955:9;23947:38;;;;-1:-1:-1;;;23947:38:0;;;;;;;:::i;:::-;89417:20:::1;:18;:20::i;:::-;89409:52;;;;-1:-1:-1::0;;;89409:52:0::1;;;;;;;:::i;:::-;89533:1;89527;89513:11;;:15;;;;:::i;:::-;89511:23;;;;:::i;:::-;89496:11;::::0;89481:26:::1;::::0;:12:::1;:26;:::i;:::-;:53;;89472:104;;;;-1:-1:-1::0;;;89472:104:0::1;;;;;;;:::i;:::-;89587:10;89600:14;:12;:14::i;:::-;89587:27;;89639:12;89633:2;:18;;89625:48;;;;-1:-1:-1::0;;;89625:48:0::1;;;;;;;:::i;:::-;89698:12;89692:2;:18;;89684:59;;;;-1:-1:-1::0;;;89684:59:0::1;;;;;;;:::i;:::-;89773:6;::::0;:31:::1;::::0;-1:-1:-1;;;89773:31:0;;89756:14:::1;::::0;-1:-1:-1;;;;;89773:6:0::1;::::0;:21:::1;::::0;:31:::1;::::0;89795:8;;89773:31:::1;;;:::i;:::-;;;;;;;;;;;;;;;;;::::0;::::1;;;;;;;;;;;;::::0;::::1;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;89756:48;;89833:12;;89823:6;:22;;89815:60;;;;-1:-1:-1::0;;;89815:60:0::1;;;;;;;:::i;:::-;89894:6;::::0;:31:::1;::::0;-1:-1:-1;;;89894:31:0;;89929:10:::1;::::0;-1:-1:-1;;;;;89894:6:0::1;::::0;:21:::1;::::0;:31:::1;::::0;89916:8;;89894:31:::1;;;:::i;:::-;;;;;;;;;;;;;;;;;::::0;::::1;;;;;;;;;;;;::::0;::::1;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;-1:-1:-1::0;;;;;89894:45:0::1;;89886:81;;;;-1:-1:-1::0;;;89886:81:0::1;;;;;;;:::i;:::-;90072:11;::::0;90068:15:::1;::::0;:1:::1;:15;:::i;:::-;90053:30;::::0;:12:::1;:30;:::i;:::-;90002:6;::::0;:48:::1;::::0;-1:-1:-1;;;90002:48:0;;-1:-1:-1;;;;;90002:6:0;;::::1;::::0;:38:::1;::::0;:48:::1;::::0;90041:8;;90002:48:::1;;;:::i;:::-;;;;;;;;;;;;;;;;;::::0;::::1;;;;;;;;;;;;::::0;::::1;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;:81;89980:162;;;;-1:-1:-1::0;;;89980:162:0::1;;;;;;;:::i;:::-;90302:18;;90296:2;:24;90292:116;;90337:21;90344:14;;90337:21;:::i;:::-;90373:18;:23:::0;;;90292:116:::1;90449:14;:21:::0;90420:26:::1;90483:156;90507:18;90503:1;:22;90483:156;;;90584:8;90555:14;90570:1;90555:17;;;;;;-1:-1:-1::0;;;90555:17:0::1;;;;;;;;;;;;;;;;;;;:25;;;:37;;90547:80;;;;-1:-1:-1::0;;;90547:80:0::1;;;;;;;:::i;:::-;90527:3:::0;::::1;::::0;::::1;:::i;:::-;;;;90483:156;;;-1:-1:-1::0;90685:244:0::1;::::0;;::::1;::::0;::::1;::::0;;;;;90718:10:::1;90685:244;::::0;::::1;::::0;;;;;;;;;;;;;;;-1:-1:-1;90685:244:0;;;;;;;;;;;;90651:14:::1;:289:::0;;90685:244;90651:289;::::1;::::0;;;;;;;::::1;::::0;;::::1;::::0;;::::1;::::0;;;;;;;;-1:-1:-1;;;;;;90651:289:0::1;-1:-1:-1::0;;;;;90651:289:0;;::::1;::::0;;;::::1;::::0;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;90651:289:0::1;::::0;::::1;;::::0;;;::::1;::::0;;;;;;;;;90958:33;::::1;::::0;::::1;::::0;90968:12;;90685:244;;90958:33:::1;:::i;:::-;;;;;;;;23996:1;;;89260:1739:::0;;;:::o;83756:57::-;83812:1;83756:57;:::o;101477:3916::-;23956:8;:6;:8::i;:::-;23955:9;23947:38;;;;-1:-1:-1;;;23947:38:0;;;;;;;:::i;:::-;101536:19:::1;:17;:19::i;:::-;101528:50;;;;-1:-1:-1::0;;;101528:50:0::1;;;;;;;:::i;:::-;101591:10;101604:14;:12;:14::i;:::-;101591:27;;101645:18;;101639:2;:24;101631:62;;;;-1:-1:-1::0;;;101631:62:0::1;;;;;;;:::i;:::-;101717:17;;101712:2;:22;101704:74;;;;-1:-1:-1::0;;;101704:74:0::1;;;;;;;:::i;:::-;101791:34;101828:29;:27;:29::i;:::-;102114:14;:21:::0;102175:14:::1;:21:::0;102214:32:::1;::::0;101791:66;;-1:-1:-1;101870:18:0::1;::::0;;;;;;;;;;;102114:21;;102214:32:::1;::::0;::::1;::::0;102114:21;;102214:32:::1;:::i;:::-;;;;;;;;102262;102275:18;102262:32;;;;;;:::i;:::-;;;;;;;;102307:16;::::0;;102360:1248:::1;102384:18;102380:1;:22;102360:1248;;;102428:14;102443:1;102428:17;;;;;;-1:-1:-1::0;;;102428:17:0::1;;;;;;;;;;::::0;;;::::1;::::0;;;:26:::1;:17;::::0;;::::1;;:26;::::0;::::1;;102424:1173;;;102486:14;102501:1;102486:17;;;;;;-1:-1:-1::0;;;102486:17:0::1;;;;;;;;;;;;;;;;;;;:29;;;102475:40;;102548:14;102563:8;102548:24;;;;;;-1:-1:-1::0;;;102548:24:0::1;;;;;;;;;;;;;;;;;;;:37;;;102534:51;;;;;:::i;:::-;;;102646:20;102668:1;102629:41;;;;;;;;;:::i;:::-;;::::0;;-1:-1:-1;;102629:41:0;;::::1;::::0;;;;;;102619:52;;102629:41:::1;102619:52:::0;;::::1;::::0;102735:4:::1;::::0;102619:52;;-1:-1:-1;102720:19:0;;::::1;::::0;-1:-1:-1;103372:17:0::1;::::0;103388:1:::1;103372:17;:::i;:::-;103331:14;103346:8;103331:24;;;;;;-1:-1:-1::0;;;103331:24:0::1;;;;;;;;;;;;;;;;;;;:37;;;:59;;;;:::i;:::-;103298:30;103318:10:::0;103298:17;:30:::1;:::i;:::-;:92;103294:264;;;103435:14;103450:8;103435:24;;;;;;-1:-1:-1::0;;;103435:24:0::1;;;;;;;;;;;;;;;;;;;:29;;;103415:49;;103508:14;103523:8;103508:24;;;;;;-1:-1:-1::0;;;103508:24:0::1;;;;;;;;;;::::0;;;::::1;::::0;;;:30:::1;:24;::::0;;::::1;;:30;::::0;::::1;;::::0;-1:-1:-1;103294:264:0::1;103578:3:::0;::::1;::::0;::::1;:::i;:::-;;;;102424:1173;102404:3:::0;::::1;::::0;::::1;:::i;:::-;;;;102360:1248;;;;103625:52;103639:17;103658:18;103625:52;;;;;;;:::i;:::-;;;;;;;;-1:-1:-1::0;103694:1:0::1;::::0;103746:30:::1;:28;:30::i;:::-;103708:68;;103794:9;103789:1420;103813:18;103809:1;:22;103789:1420;;;103864:14;103879:1;103864:17;;;;;;-1:-1:-1::0;;;103864:17:0::1;;;;;;;;;;;;;;;;;;;:29;;;103853:40;;103912:14;103927:1;103912:17;;;;;;-1:-1:-1::0;;;103912:17:0::1;;;;;;;;;;::::0;;;::::1;::::0;;;:26:::1;:17;::::0;;::::1;;:26;::::0;::::1;;103908:1290;;;103985:14;104000:8;103985:24;;;;;;-1:-1:-1::0;;;103985:24:0::1;;;;;;;;;;;;;;;;;;;:29;;;103964:17;:50;:106;;;;;104040:14;104055:8;104040:24;;;;;;-1:-1:-1::0;;;104040:24:0::1;;;;;;;;;;::::0;;;::::1;::::0;;;:30:::1;:24;::::0;;::::1;;:30;::::0;::::1;104018:52:::0;;::::1;104040:30:::0;::::1;104018:52;103964:106;103959:898;;;104124:14;104139:8;104124:24;;;;;;-1:-1:-1::0;;;104124:24:0::1;;;;;;;;;;;;;;;;;;;:37;;;104095:66;;;;;:::i;:::-;;;104226:21;104249:1;104209:42;;;;;;;;;:::i;:::-;;::::0;;-1:-1:-1;;104209:42:0;;::::1;::::0;;;;;;104199:53;;104209:42:::1;104199:53:::0;;::::1;::::0;104320:4:::1;::::0;104199:53;;-1:-1:-1;104305:19:0;;::::1;::::0;-1:-1:-1;104469:17:0::1;::::0;104485:1:::1;104469:17;:::i;:::-;104428:14;104443:8;104428:24;;;;;;-1:-1:-1::0;;;104428:24:0::1;;;;;;;;;;;;;;;;;;;:37;;;:59;;;;:::i;:::-;104380:45;104400:25:::0;104380:17;:45:::1;:::i;:::-;:107;104350:245;;;104547:14;104562:8;104547:24;;;;;;-1:-1:-1::0;;;104547:24:0::1;;;;;;;;;;::::0;;;::::1;::::0;;;::::1;::::0;;::::1;;104538:33:::0;;:6:::1;:33:::0;;-1:-1:-1;;;;;;104538:33:0::1;-1:-1:-1::0;;;;;104538:33:0;;::::1;::::0;;;::::1;::::0;;;;::::1;::::0;;;::::1;::::0;::::1;::::0;;;::::1;::::0;::::1;::::0;;;::::1;::::0;::::1;::::0;;;::::1;;::::0;;;;-1:-1:-1;;104538:33:0::1;;::::0;;::::1;::::0;;;::::1;::::0;;104350:245:::1;104619:3:::0;::::1;::::0;::::1;:::i;:::-;;;;103959:898;;;104671:6;::::0;104692:14:::1;:24:::0;;-1:-1:-1;;;;;104671:6:0;;::::1;::::0;:20:::1;::::0;104692:14;104707:8;;104692:24;::::1;;;-1:-1:-1::0;;;104692:24:0::1;;;;;;;;;;;;;;;;;;;:32;;;104783:18;104780:1;:21;;;;:::i;:::-;104758:11;::::0;104726:43:::1;::::0;83812:1:::1;104726:43;:::i;:::-;:76;;;;:::i;:::-;104671:132;;;;;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;::::0;::::1;;;;;;;;;;;;::::0;::::1;;;;;;;;;103959:898;103908:1290;;;105031:6;::::0;105052:14:::1;:17:::0;;-1:-1:-1;;;;;105031:6:0;;::::1;::::0;:20:::1;::::0;105052:14;105067:1;;105052:17;::::1;;;-1:-1:-1::0;;;105052:17:0::1;;;;;;;;;;::::0;;;::::1;::::0;;;::::1;::::0;;::::1;;:25:::0;105132:21:::1;105135:18:::0;105132:1:::1;:21;:::i;:::-;105110:11;::::0;105079:42:::1;::::0;83875:1:::1;105079:42;:::i;103908:1290::-;103833:3:::0;::::1;::::0;::::1;:::i;:::-;;;;103789:1420;;;;105226:22;105241:6;105226:22;;;;;;:::i;:::-;;;;;;;;105261:15;::::0;105286:6:::1;:12:::0;105261:38:::1;::::0;-1:-1:-1;;;105261:38:0;;-1:-1:-1;;;;;105261:15:0::1;::::0;;::::1;::::0;::::1;::::0;:24:::1;::::0;:38:::1;::::0;105286:12;::::1;::::0;105261:38:::1;;;:::i;:::-;;;;;;;;;;;;;;;;;;::::0;::::1;;;;;;;;;;;;::::0;::::1;;;;;-1:-1:-1::0;;105312:14:0::1;::::0;:38:::1;::::0;-1:-1:-1;;;105312:38:0;;-1:-1:-1;;;;;105312:14:0;;::::1;::::0;-1:-1:-1;105312:26:0::1;::::0;-1:-1:-1;105312:38:0::1;::::0;105347:1;;105312:38:::1;;;:::i;:::-;;;;;;;;;;;;;;;;;;::::0;::::1;;;;;;;;;;;;::::0;::::1;;;;;-1:-1:-1::0;;;105363:17:0::1;:22:::0;;;;-1:-1:-1;;;;;;;;;;;;;101477:3916:0:o;23630:86::-;23701:7;;;;23630:86;:::o;83464:27::-;;;-1:-1:-1;;;;;83464:27:0;;:::o;91858:389::-;91899:7;91919:10;91932:14;:12;:14::i;:::-;:18;;91949:1;91932:18;:::i;:::-;91988:4;;92014:18;;91919:31;;-1:-1:-1;91988:4:0;92014:22;;92035:1;92014:22;:::i;:::-;92009:2;:27;92005:199;;;92053:18;92100:1;92079:18;;92074:2;:23;;;;:::i;:::-;:27;;;;:::i;:::-;92053:48;;92162:16;92180:10;92145:46;;;;;;;;;:::i;:::-;;;;;;;;;;;;;92135:57;;;;;;92116:76;;92005:199;;92223:16;-1:-1:-1;;91858:389:0;:::o;100854:483::-;100905:17;100935:10;100948:14;:12;:14::i;:::-;100935:27;;100979:20;:18;:20::i;:::-;:73;;;;101009:18;;101004:2;:23;:47;;;;;101032:19;:17;:19::i;:::-;101031:20;101004:47;100975:126;;;101076:13;:11;:13::i;:::-;101069:20;;;;;100975:126;101117:20;:18;:20::i;:::-;:48;;;;;101147:18;;101141:2;:24;101117:48;101113:136;;;101182:55;;-1:-1:-1;;;101182:55:0;;;;;;;:::i;:::-;101265:19;:17;:19::i;:::-;101261:69;;;101308:10;:8;:10::i;101261:69::-;100854:483;;:::o;84502:33::-;;;;:::o;83372:::-;;;-1:-1:-1;;;;;83372:33:0;;:::o;84582:32::-;;;;:::o;83539:30::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;;;;;83539:30:0;;;;;;;;;;;;:::o;96656:2316::-;96713:4;96738:19;:17;:19::i;:::-;96730:57;;;;-1:-1:-1;;;96730:57:0;;;;;;;:::i;:::-;96800:10;96813:14;:12;:14::i;:::-;96800:27;;96854:18;;96848:2;:24;96840:62;;;;-1:-1:-1;;;96840:62:0;;;;;;;:::i;:::-;96926:17;;96921:2;:22;96913:74;;;;-1:-1:-1;;;96913:74:0;;;;;;;:::i;:::-;97000:34;97037:29;:27;:29::i;:::-;97314:14;:21;97000:66;;-1:-1:-1;97079:18:0;;;;;;;;;;;;;;;97401:657;97425:18;97421:1;:22;97401:657;;;97469:14;97484:1;97469:17;;;;;;-1:-1:-1;;;97469:17:0;;;;;;;;;;;;;;;;;:26;:17;;;;;:26;;;;97465:582;;;97527:14;97542:1;97527:17;;;;;;-1:-1:-1;;;97527:17:0;;;;;;;;;;;;;;;;;;;:29;;;97516:40;;97589:14;97604:8;97589:24;;;;;;-1:-1:-1;;;97589:24:0;;;;;;;;;;;;;;;;;;;:37;;;97575:51;;;;;:::i;:::-;;;97687:20;97709:1;97670:41;;;;;;;;;:::i;:::-;;;;;;;;;;;;;97660:52;;;;;;97645:67;;97830:4;;97822:13;;97838:1;97822:17;;;;:::i;:::-;97781:14;97796:8;97781:24;;;;;;-1:-1:-1;;;97781:24:0;;;;;;;;;;;;;;;;;;;:37;;;:59;;;;:::i;:::-;97760:4;;97737:41;;97768:10;;97745:19;;97737:41;:::i;:::-;:103;97733:275;;;97885:14;97900:8;97885:24;;;;;;-1:-1:-1;;;97885:24:0;;;;;;;;;;;;;;;;;;;:29;;;97865:49;;97958:14;97973:8;97958:24;;;;;;-1:-1:-1;;;97958:24:0;;;;;;;;;;;;;;;;;:30;:24;;;;;:30;;;;;-1:-1:-1;97733:275:0;98028:3;;;;:::i;:::-;;;;97465:582;97445:3;;;;:::i;:::-;;;;97401:657;;;;98074:1;98070:5;;98088:35;98126:30;:28;:30::i;:::-;98088:68;;98174:9;98169:754;98193:18;98189:1;:22;98169:754;;;98244:14;98259:1;98244:17;;;;;;-1:-1:-1;;;98244:17:0;;;;;;;;;;;;;;;;;;;:29;;;98233:40;;98292:14;98307:1;98292:17;;;;;;-1:-1:-1;;;98292:17:0;;;;;;;;;;;;;;;;;:26;:17;;;;;:26;;;;:80;;;;;98343:14;98358:8;98343:24;;;;;;-1:-1:-1;;;98343:24:0;;;;;;;;;;;;;;;;;;;:29;;;98322:17;:50;98292:80;:136;;;;;98398:14;98413:8;98398:24;;;;;;-1:-1:-1;;;98398:24:0;;;;;;;;;;;;;;;;;:30;:24;;;;;:30;;;98376:52;;;98398:30;;98376:52;98292:136;98288:624;;;98478:14;98493:8;98478:24;;;;;;-1:-1:-1;;;98478:24:0;;;;;;;;;;;;;;;;;;;:37;;;98449:66;;;;;:::i;:::-;;;98576:21;98599:1;98559:42;;;;;;;;;:::i;:::-;;;;;;;;;;;;;98549:53;;;;;;98534:68;;98757:4;;98749:13;;98765:1;98749:17;;;;:::i;:::-;98708:14;98723:8;98708:24;;;;;;-1:-1:-1;;;98708:24:0;;;;;;;;;;;;;;;;;;;:37;;;:59;;;;:::i;:::-;98672:4;;98649:56;;98680:25;;98657:19;;98649:56;:::i;:::-;:118;98623:250;;;98821:14;98836:8;98821:24;;;;;;-1:-1:-1;;;98821:24:0;;;;;;;;;;;;;;;;;;;:32;;;98810:43;;98623:250;98893:3;;;;:::i;:::-;;;;98288:624;98213:3;;;;:::i;:::-;;;;98169:754;;;-1:-1:-1;;;98943:20:0;;;;;96656:2316;-1:-1:-1;;;;;;;;;;96656:2316:0:o;84542:33::-;;;;:::o;83615:30::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;;;;83615:30:0;;;;-1:-1:-1;83615:30:0;;;;;;;:::o;91286:388::-;91330:7;91350:10;91363:14;:12;:14::i;84974:128::-;85017:32;83723:24;85038:10;85017:7;:32::i;:::-;85009:66;;;;-1:-1:-1;;;85009:66:0;;;;;;;:::i;:::-;85086:8;:6;:8::i;:::-;84974:128::o;87112:108::-;87157:7;87200:11;;87185:12;:26;;;;:::i;:::-;87177:35;;87112:108;:::o;84664:32::-;;;;:::o;87944:187::-;87994:4;88059:1;88045:11;;:15;;;;:::i;:::-;88030:11;;88015:26;;:12;:26;:::i;:::-;:45;88010:91;;-1:-1:-1;88085:4:0;88078:11;;88010:91;-1:-1:-1;88118:5:0;87944:187;:::o;30582:139::-;30660:4;30684:12;;;;;;;;;;;-1:-1:-1;;;;;30684:29:0;;;;;;;;;;;;;;;30582:139::o;29038:49::-;29083:4;29038:49;:::o;99228:543::-;99319:4;99344:19;:17;:19::i;:::-;:43;;;;99367:20;:18;:20::i;:::-;99336:93;;;;-1:-1:-1;;;99336:93:0;;;;;;;:::i;:::-;99531:11;;99527:15;;:1;:15;:::i;:::-;99512:30;;:12;:30;:::i;:::-;99462:6;;:47;;-1:-1:-1;;;99462:47:0;;-1:-1:-1;;;;;99462:6:0;;;;:38;;:47;;99501:7;;99462:47;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;:80;99440:152;;;;-1:-1:-1;;;99440:152:0;;;;;;;:::i;:::-;99645:12;;99611:6;;:30;;-1:-1:-1;;;99611:30:0;;-1:-1:-1;;;;;99611:6:0;;;;:21;;:30;;99633:7;;99611:30;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;:46;;99603:93;;;;-1:-1:-1;;;99603:93:0;;;;;;;:::i;:::-;99714:49;99726:7;99735:20;:18;:20::i;:::-;99757:5;99714:11;:49::i;:::-;99707:56;99228:543;-1:-1:-1;;;99228:543:0:o;94213:2251::-;23956:8;:6;:8::i;:::-;23955:9;23947:38;;;;-1:-1:-1;;;23947:38:0;;;;;;;:::i;:::-;94383:20:::1;:18;:20::i;:::-;94375:52;;;;-1:-1:-1::0;;;94375:52:0::1;;;;;;;:::i;:::-;94440:10;94453:14;:12;:14::i;:::-;94440:27;;94494:18;;94488:2;:24;94480:62;;;;-1:-1:-1::0;;;94480:62:0::1;;;;;;;:::i;:::-;94563:18;;94557:2;:24;94553:211;;94625:20;:18;:20::i;:::-;94598:24;:47:::0;94660:21:::1;94667:14;;94660:21;:::i;:::-;94696:18;:23:::0;;;94734:18:::1;:16;:18::i;:::-;94776;94797:49;94808:8;94818:6;94826:5;94833:12;94797:10;:49::i;:::-;94888:14;:21:::0;94776:70;;-1:-1:-1;94859:26:0::1;94922:1478;94946:18;94942:1;:22;94922:1478;;;95019:8;94990:14;95005:1;94990:17;;;;;;-1:-1:-1::0;;;94990:17:0::1;;;;;;;;;;;;;;;;;;;:25;;;:37;:87;;;;;95045:14;95060:1;95045:17;;;;;;-1:-1:-1::0;;;95045:17:0::1;;;;;;;;;;;;;;;;;;;:32;;;95031:10;:46;94990:87;94986:1403;;;95128:72;95140:14;95155:1;95140:17;;;;;;-1:-1:-1::0;;;95140:17:0::1;;;;;;;;;;;;;;;;;;;:25;;;95167:24;;95193:6;95128:11;:72::i;:::-;95098:179;;;;-1:-1:-1::0;;;95098:179:0::1;;;;;;;:::i;:::-;95352:14;95367:1;95352:17;;;;;;-1:-1:-1::0;;;95352:17:0::1;;;;;;;;;;::::0;;;::::1;::::0;;;:26:::1;:17;::::0;;::::1;;:26;::::0;::::1;;:35;95344:76;;;;-1:-1:-1::0;;;95344:76:0::1;;;;;;;:::i;:::-;95468:4;95439:14;95454:1;95439:17;;;;;;-1:-1:-1::0;;;95439:17:0::1;;;;;;;;;;;;;;;;;;;:26;;;:33;;;;;;;;;;;;;;;;;;95523:14;:21;;;;95491:14;95506:1;95491:17;;;;;;-1:-1:-1::0;;;95491:17:0::1;;;;;;;;;;;;;;;;;;;:29;;:53;;;;95565:14;95607:369;;;;;;;;95648:14;95663:1;95648:17;;;;;;-1:-1:-1::0;;;95648:17:0::1;;;;;;;;;;::::0;;;::::1;::::0;;;;:23:::1;:17;::::0;;::::1;;:23;::::0;-1:-1:-1;;;;;95648:23:0::1;95607:369:::0;;95707:14:::1;:17:::0;;95607:369;;;::::1;::::0;95722:1;;95707:17;::::1;;;-1:-1:-1::0;;;95707:17:0::1;;;;;;;;;;;;;;;;;;;:25;;;95607:369;;;;95766:14;95781:1;95766:17;;;;;;-1:-1:-1::0;;;95766:17:0::1;;;;;;;;;;;;;;;;;;;:23;;;95607:369;;;;95867:6;95864:1;:9;;;;:::i;:::-;95830:14;95845:1;95830:17;;;;;;-1:-1:-1::0;;;95830:17:0::1;;;;;;;;;;;;;;;;;;;:23;;;:44;;;;:::i;:::-;95607:369:::0;;::::1;::::0;;::::1;::::0;;;::::1;::::0;;::::1;::::0;;;;;95565:430;;::::1;::::0;;::::1;::::0;;-1:-1:-1;95565:430:0;;;;;;;;;::::1;::::0;;::::1;;::::0;;-1:-1:-1;;;;;;95565:430:0::1;-1:-1:-1::0;;;;;95565:430:0;;::::1;::::0;;;::::1;::::0;;;;::::1;::::0;;;::::1;::::0;;;;;;::::1;::::0;::::1;::::0;::::1;::::0;::::1;::::0;::::1;::::0;::::1;::::0;::::1;::::0;::::1;::::0;::::1;::::0;::::1;::::0;::::1;::::0;::::1;::::0;;::::1;::::0;::::1;::::0;;::::1;::::0;;-1:-1:-1;;95565:430:0::1;::::0;;;::::1;;::::0;;96016:34:::1;96037:12:::0;96016:20:::1;:34::i;:::-;96076:270;96107:2;96132:14;96147:1;96132:17;;;;;;-1:-1:-1::0;;;96132:17:0::1;;;;;;;;;;;;;;;;;;;:25;;;96180:14;96195:1;96180:17;;;;;;-1:-1:-1::0;;;96180:17:0::1;;;;;;;;;;;;;;;;;;;:23;;;96263:6;96260:1;:9;;;;:::i;:::-;96226:14;96241:1;96226:17;;;;;;-1:-1:-1::0;;;96226:17:0::1;;;;;;;;;;;;;;;;;;;:23;;;:44;;;;:::i;:::-;96293:5;96321:6;96076:270;;;;;;;;;;;:::i;:::-;;;;;;;;96367:7;;;;;;94986:1403;94966:3:::0;::::1;::::0;::::1;:::i;:::-;;;;94922:1478;;;-1:-1:-1::0;96412:44:0::1;;-1:-1:-1::0;;;96412:44:0::1;;;;;;;:::i;23996:1::-;94213:2251:::0;;;;:::o;83820:56::-;83875:1;83820:56;:::o;93580:252::-;93732:7;93786:8;93796:6;93804:5;93811:11;93769:54;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;93759:65;;;;;;93752:72;;93580:252;;;;;;:::o;87316:186::-;87367:4;87431:1;87417:11;;:15;;;;:::i;:::-;87403:11;;87388:26;;:12;:26;:::i;:::-;:44;87384:88;;;-1:-1:-1;87456:4:0;87449:11;;31772:235;31866:41;31874:18;31887:4;31874:12;:18::i;31866:41::-;31858:102;;;;-1:-1:-1;;;31858:102:0;;;;;;;:::i;84757:20::-;;;;;;;;;;;;;-1:-1:-1;;;;;84757:20:0;;;;;;;:::o;83685:62::-;83723:24;83685:62;:::o;84388:48::-;;;;:::o;85208:134::-;85253:32;83723:24;85274:10;85253:7;:32::i;:::-;85245:68;;;;-1:-1:-1;;;85245:68:0;;;;;;;:::i;:::-;85324:10;:8;:10::i;92911:255::-;93024:4;93045:12;;;93041:56;;-1:-1:-1;93081:4:0;93074:11;;93041:56;93143:13;;;;:3;:13;:::i;:::-;93139:18;;:1;:18;:::i;:::-;93122:5;;;93114:44;;-1:-1:-1;92911:255:0;;;;;:::o;26483:157::-;-1:-1:-1;;;;;;26592:40:0;;-1:-1:-1;;;26592:40:0;26483:157;;;:::o;22198:98::-;22278:10;22198:98;:::o;33762:229::-;33837:22;33845:4;33851:7;33837;:22::i;:::-;33832:152;;33876:6;:12;;;;;;;;;;;-1:-1:-1;;;;;33876:29:0;;;;;;;;;:36;;-1:-1:-1;;33876:36:0;33908:4;33876:36;;;33959:12;:10;:12::i;:::-;-1:-1:-1;;;;;33932:40:0;33950:7;-1:-1:-1;;;;;33932:40:0;33944:4;33932:40;;;;;;;;;;33762:229;;:::o;33999:230::-;34074:22;34082:4;34088:7;34074;:22::i;:::-;34070:152;;;34145:5;34113:12;;;;;;;;;;;-1:-1:-1;;;;;34113:29:0;;;;;;;;;:37;;-1:-1:-1;;34113:37:0;;;34197:12;:10;:12::i;:::-;-1:-1:-1;;;;;34170:40:0;34188:7;-1:-1:-1;;;;;34170:40:0;34182:4;34170:40;;;;;;;;;;33999:230;;:::o;99872:329::-;99933:13;99967:19;:17;:19::i;:::-;99959:68;;;;-1:-1:-1;;;99959:68:0;;;;;;;:::i;:::-;100038:10;100051:14;:12;:14::i;:::-;100038:27;;100090:18;;100084:2;:24;100076:62;;;;-1:-1:-1;;;100076:62:0;;;;;;;:::i;:::-;100182:4;;100165:27;;;;;;;;:::i;:::-;;;;;;;;;;;;;100151:42;;;99872:329;:::o;100301:330::-;100363:13;100397:19;:17;:19::i;:::-;100389:68;;;;-1:-1:-1;;;100389:68:0;;;;;;;:::i;:::-;100468:10;100481:14;:12;:14::i;:::-;100468:27;;100520:18;;100514:2;:24;100506:62;;;;-1:-1:-1;;;100506:62:0;;;;;;;:::i;:::-;100612:4;;100595:27;;;;;;;;:::i;24430:118::-;23956:8;:6;:8::i;:::-;23955:9;23947:38;;;;-1:-1:-1;;;23947:38:0;;;;;;;:::i;:::-;24500:4:::1;24490:14:::0;;-1:-1:-1;;24490:14:0::1;::::0;::::1;::::0;;24520:20:::1;24527:12;:10;:12::i;:::-;24520:20;;;;;;:::i;:::-;;;;;;;;24430:118::o:0;92436:107::-;92511:4;;92517:16;92500:34;;;;;;;;;:::i;:::-;;;;-1:-1:-1;;92500:34:0;;;;;;;;;92490:45;;92500:34;92490:45;;;;92483:4;:52;92436:107::o;92551:91::-;92622:4;;;:12;;;92615:19;;92551:91::o;24689:120::-;24233:8;:6;:8::i;:::-;24225:41;;;;-1:-1:-1;;;24225:41:0;;;;;;;:::i;:::-;24748:7:::1;:15:::0;;-1:-1:-1;;24748:15:0::1;::::0;;24779:22:::1;24788:12;:10;:12::i;-1:-1:-1:-:0;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;:::o;:::-;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;14:158:1;82:20;;142:4;131:16;;121:27;;111:2;;162:1;159;152:12;177:263;;300:2;288:9;279:7;275:23;271:32;268:2;;;321:6;313;306:22;268:2;358:9;352:16;377:33;404:5;377:33;:::i;445:190::-;;557:2;545:9;536:7;532:23;528:32;525:2;;;578:6;570;563:22;525:2;-1:-1:-1;606:23:1;;515:120;-1:-1:-1;515:120:1:o;640:327::-;;;769:2;757:9;748:7;744:23;740:32;737:2;;;790:6;782;775:22;737:2;831:9;818:23;808:33;;891:2;880:9;876:18;863:32;904:33;931:5;904:33;:::i;:::-;956:5;946:15;;;727:240;;;;;:::o;972:326::-;;;;1118:2;1106:9;1097:7;1093:23;1089:32;1086:2;;;1139:6;1131;1124:22;1086:2;-1:-1:-1;;1167:23:1;;;1237:2;1222:18;;1209:32;;-1:-1:-1;1288:2:1;1273:18;;;1260:32;;1076:222;-1:-1:-1;1076:222:1:o;1303:330::-;;;;1447:2;1435:9;1426:7;1422:23;1418:32;1415:2;;;1468:6;1460;1453:22;1415:2;1509:9;1496:23;1486:33;;1566:2;1555:9;1551:18;1538:32;1528:42;;1589:38;1623:2;1612:9;1608:18;1589:38;:::i;:::-;1579:48;;1405:228;;;;;:::o;1638:262::-;;;1765:2;1753:9;1744:7;1740:23;1736:32;1733:2;;;1786:6;1778;1771:22;1733:2;1827:9;1814:23;1804:33;;1856:38;1890:2;1879:9;1875:18;1856:38;:::i;:::-;1846:48;;1723:177;;;;;:::o;1905:399::-;;;;;2066:3;2054:9;2045:7;2041:23;2037:33;2034:2;;;2088:6;2080;2073:22;2034:2;2129:9;2116:23;2106:33;;2158:38;2192:2;2181:9;2177:18;2158:38;:::i;:::-;2024:280;;2148:48;;-1:-1:-1;;;;2243:2:1;2228:18;;2215:32;;2294:2;2279:18;2266:32;;2024:280::o;2309:306::-;;2420:2;2408:9;2399:7;2395:23;2391:32;2388:2;;;2441:6;2433;2426:22;2388:2;2472:23;;-1:-1:-1;;;;;;2524:32:1;;2514:43;;2504:2;;2576:6;2568;2561:22;2815:194;;2938:2;2926:9;2917:7;2913:23;2909:32;2906:2;;;2959:6;2951;2944:22;2906:2;-1:-1:-1;2987:16:1;;2896:113;-1:-1:-1;2896:113:1:o;3014:317::-;3244:19;;;-1:-1:-1;;;3288:2:1;3279:12;;3272:25;3322:2;3313:12;;3234:97::o;3336:317::-;3566:19;;;-1:-1:-1;;;3610:2:1;3601:12;;3594:25;3644:2;3635:12;;3556:97::o;3658:247::-;3815:19;;;3859:2;3850:12;;3843:28;3896:2;3887:12;;3805:100::o;3910:403::-;4119:19;;;4194:3;4172:16;;;;-1:-1:-1;;;;;;4168:36:1;4163:2;4154:12;;4147:58;4230:2;4221:12;;4214:28;4267:2;4258:12;;4251:28;4304:2;4295:12;;4109:204::o;4318:528::-;;4515:6;4509:13;4540:3;4552:129;4566:6;4563:1;4560:13;4552:129;;;4664:4;4648:14;;;4644:25;;4638:32;4625:11;;;4618:53;4581:12;4552:129;;;4699:6;4696:1;4693:13;4690:2;;;4734:3;4725:6;4720:3;4716:16;4709:29;4690:2;-1:-1:-1;4762:16:1;;;;4787:21;;;-1:-1:-1;4835:4:1;4824:16;;4485:361;-1:-1:-1;4485:361:1:o;4851:203::-;-1:-1:-1;;;;;5015:32:1;;;;4997:51;;4985:2;4970:18;;4952:102::o;5059:568::-;-1:-1:-1;;;;;5360:32:1;;;;5342:51;;5424:2;5409:18;;5402:34;;;;5467:2;5452:18;;5445:34;;;;5510:2;5495:18;;5488:34;5553:3;5538:19;;5531:35;5615:4;5603:17;5380:3;5582:19;;5575:46;5329:3;5314:19;;5296:331::o;5632:1121::-;5851:2;5903:21;;;5973:13;;5876:18;;;5995:22;;;5632:1121;;5851:2;6036;;6054:18;;;;6095:15;;;5632:1121;6141:586;6155:6;6152:1;6149:13;6141:586;;;6214:13;;6256:9;;-1:-1:-1;;;;;6252:35:1;6240:48;;6328:11;;;6322:18;6308:12;;;6301:40;6381:11;;;6375:18;6361:12;;;6354:40;6417:4;6461:11;;;6455:18;6441:12;;;6434:40;6497:4;6541:11;;;6535:18;6521:12;;;6514:40;6275:3;6625:11;;;6619:18;6639:4;6615:29;6601:12;;;6594:51;6674:4;6665:14;;;;6702:15;;;;6284:1;6170:9;6141:586;;;-1:-1:-1;6744:3:1;;5831:922;-1:-1:-1;;;;;;;5831:922:1:o;6758:187::-;6923:14;;6916:22;6898:41;;6886:2;6871:18;;6853:92::o;6950:177::-;7096:25;;;7084:2;7069:18;;7051:76::o;7132:571::-;7413:25;;;-1:-1:-1;;;;;7474:32:1;;;;7469:2;7454:18;;7447:60;7538:2;7523:18;;7516:34;;;;7581:2;7566:18;;7559:34;7637:14;7630:22;7624:3;7609:19;;7602:51;7494:3;7669:19;;7662:35;7400:3;7385:19;;7367:336::o;7961:255::-;8131:25;;;8204:4;8192:17;8187:2;8172:18;;8165:45;8119:2;8104:18;;8086:130::o;8908:345::-;9110:2;9092:21;;;9149:2;9129:18;;;9122:30;-1:-1:-1;;;9183:2:1;9168:18;;9161:51;9244:2;9229:18;;9082:171::o;9258:411::-;9460:2;9442:21;;;9499:2;9479:18;;;9472:30;9538:34;9533:2;9518:18;;9511:62;-1:-1:-1;;;9604:2:1;9589:18;;9582:45;9659:3;9644:19;;9432:237::o;9674:344::-;9876:2;9858:21;;;9915:2;9895:18;;;9888:30;-1:-1:-1;;;9949:2:1;9934:18;;9927:50;10009:2;9994:18;;9848:170::o;10023:342::-;10225:2;10207:21;;;10264:2;10244:18;;;10237:30;-1:-1:-1;;;10298:2:1;10283:18;;10276:48;10356:2;10341:18;;10197:168::o;10370:401::-;10572:2;10554:21;;;10611:2;10591:18;;;10584:30;10650:34;10645:2;10630:18;;10623:62;-1:-1:-1;;;10716:2:1;10701:18;;10694:35;10761:3;10746:19;;10544:227::o;10776:347::-;10978:2;10960:21;;;11017:2;10997:18;;;10990:30;11056:25;11051:2;11036:18;;11029:53;11114:2;11099:18;;10950:173::o;11128:401::-;11330:2;11312:21;;;11369:2;11349:18;;;11342:30;11408:34;11403:2;11388:18;;11381:62;-1:-1:-1;;;11474:2:1;11459:18;;11452:35;11519:3;11504:19;;11302:227::o;11534:397::-;11736:2;11718:21;;;11775:2;11755:18;;;11748:30;11814:34;11809:2;11794:18;;11787:62;-1:-1:-1;;;11880:2:1;11865:18;;11858:31;11921:3;11906:19;;11708:223::o;11936:343::-;12138:2;12120:21;;;12177:2;12157:18;;;12150:30;-1:-1:-1;;;12211:2:1;12196:18;;12189:49;12270:2;12255:18;;12110:169::o;12284:352::-;12486:2;12468:21;;;12525:2;12505:18;;;12498:30;12564;12559:2;12544:18;;12537:58;12627:2;12612:18;;12458:178::o;12641:349::-;12843:2;12825:21;;;12882:2;12862:18;;;12855:30;12921:27;12916:2;12901:18;;12894:55;12981:2;12966:18;;12815:175::o;12995:349::-;13197:2;13179:21;;;13236:2;13216:18;;;13209:30;13275:27;13270:2;13255:18;;13248:55;13335:2;13320:18;;13169:175::o;13349:347::-;13551:2;13533:21;;;13590:2;13570:18;;;13563:30;13629:25;13624:2;13609:18;;13602:53;13687:2;13672:18;;13523:173::o;13701:412::-;13903:2;13885:21;;;13942:2;13922:18;;;13915:30;13981:34;13976:2;13961:18;;13954:62;-1:-1:-1;;;14047:2:1;14032:18;;14025:46;14103:3;14088:19;;13875:238::o;14118:340::-;14320:2;14302:21;;;14359:2;14339:18;;;14332:30;-1:-1:-1;;;14393:2:1;14378:18;;14371:46;14449:2;14434:18;;14292:166::o;14463:401::-;14665:2;14647:21;;;14704:2;14684:18;;;14677:30;14743:34;14738:2;14723:18;;14716:62;-1:-1:-1;;;14809:2:1;14794:18;;14787:35;14854:3;14839:19;;14637:227::o;14869:343::-;15071:2;15053:21;;;15110:2;15090:18;;;15083:30;-1:-1:-1;;;15144:2:1;15129:18;;15122:49;15203:2;15188:18;;15043:169::o;15217:398::-;15419:2;15401:21;;;15458:2;15438:18;;;15431:30;15497:34;15492:2;15477:18;;15470:62;-1:-1:-1;;;15563:2:1;15548:18;;15541:32;15605:3;15590:19;;15391:224::o;15620:346::-;15822:2;15804:21;;;15861:2;15841:18;;;15834:30;-1:-1:-1;;;15895:2:1;15880:18;;15873:52;15957:2;15942:18;;15794:172::o;15971:349::-;16173:2;16155:21;;;16212:2;16192:18;;;16185:30;16251:27;16246:2;16231:18;;16224:55;16311:2;16296:18;;16145:175::o;16325:355::-;16527:2;16509:21;;;16566:2;16546:18;;;16539:30;16605:33;16600:2;16585:18;;16578:61;16671:2;16656:18;;16499:181::o;16685:400::-;16887:2;16869:21;;;16926:2;16906:18;;;16899:30;16965:34;16960:2;16945:18;;16938:62;-1:-1:-1;;;17031:2:1;17016:18;;17009:34;17075:3;17060:19;;16859:226::o;17090:352::-;17292:2;17274:21;;;17331:2;17311:18;;;17304:30;17370;17365:2;17350:18;;17343:58;17433:2;17418:18;;17264:178::o;17447:349::-;17649:2;17631:21;;;17688:2;17668:18;;;17661:30;17727:27;17722:2;17707:18;;17700:55;17787:2;17772:18;;17621:175::o;17801:354::-;18003:2;17985:21;;;18042:2;18022:18;;;18015:30;18081:32;18076:2;18061:18;;18054:60;18146:2;18131:18;;17975:180::o;18160:341::-;18362:2;18344:21;;;18401:2;18381:18;;;18374:30;-1:-1:-1;;;18435:2:1;18420:18;;18413:47;18492:2;18477:18;;18334:167::o;18506:403::-;18708:2;18690:21;;;18747:2;18727:18;;;18720:30;18786:34;18781:2;18766:18;;18759:62;-1:-1:-1;;;18852:2:1;18837:18;;18830:37;18899:3;18884:19;;18680:229::o;18914:350::-;19116:2;19098:21;;;19155:2;19135:18;;;19128:30;19194:28;19189:2;19174:18;;19167:56;19255:2;19240:18;;19088:176::o;19269:411::-;19471:2;19453:21;;;19510:2;19490:18;;;19483:30;19549:34;19544:2;19529:18;;19522:62;-1:-1:-1;;;19615:2:1;19600:18;;19593:45;19670:3;19655:19;;19443:237::o;19685:582::-;19899:13;;-1:-1:-1;;;;;19895:39:1;19877:58;;19931:1;19979:17;;19973:24;19966:4;19951:20;;19944:54;20054:4;20042:17;;20036:24;20029:4;20014:20;;20007:54;20117:4;20105:17;;20099:24;20092:4;20077:20;;20070:54;20180:4;20168:17;;20162:24;20155:4;20140:20;;20133:54;20247:4;20235:17;;;20229:24;20255:4;20225:35;19922:3;20203:20;;20196:65;19864:3;19849:19;;19831:436::o;20707:542::-;20990:25;;;21046:2;21031:18;;21024:34;;;;21089:2;21074:18;;21067:34;;;;21132:2;21117:18;;21110:34;21175:3;21160:19;;21153:35;21237:4;21225:17;21219:3;21204:19;;21197:46;20977:3;20962:19;;20944:305::o;21254:128::-;;21325:1;21321:6;21318:1;21315:13;21312:2;;;21331:18;;:::i;:::-;-1:-1:-1;21367:9:1;;21302:80::o;21387:120::-;;21453:1;21443:2;;21458:18;;:::i;:::-;-1:-1:-1;21492:9:1;;21433:74::o;21512:453::-;21608:6;21631:5;21645:314;21694:1;21731:2;21721:8;21718:16;21708:2;;21738:5;;;21708:2;21779:4;21774:3;21770:14;21764:4;21761:24;21758:2;;;21788:18;;:::i;:::-;21838:2;21828:8;21824:17;21821:2;;;21853:16;;;;21821:2;21932:17;;;;;21892:15;;21645:314;;;21589:376;;;;;;;:::o;21970:151::-;;22058:57;-1:-1:-1;;22099:6:1;22085:21;;22079:4;22058:57;:::i;22126:148::-;;22213:55;-1:-1:-1;;22254:4:1;22240:19;;22234:4;22279:922;;22363:8;22353:2;;-1:-1:-1;22404:1:1;22418:5;;22353:2;22452:4;22442:2;;-1:-1:-1;22489:1:1;22503:5;;22442:2;22534:4;22552:1;22547:59;;;;22620:1;22615:183;;;;22527:271;;22547:59;22577:1;22568:10;;22591:5;;;22615:183;22652:3;22642:8;22639:17;22636:2;;;22659:18;;:::i;:::-;22715:1;22705:8;22701:16;22692:25;;22743:3;22736:5;22733:14;22730:2;;;22750:18;;:::i;:::-;22783:5;;;22527:271;;22882:2;22872:8;22869:16;22863:3;22857:4;22854:13;22850:36;22844:2;22834:8;22831:16;22826:2;22820:4;22817:12;22813:35;22810:77;22807:2;;;-1:-1:-1;22919:19:1;;;22954:14;;;22951:2;;;22971:18;;:::i;:::-;23004:5;;22807:2;23051:42;23089:3;23079:8;23073:4;23070:1;23051:42;:::i;:::-;23126:6;23121:3;23117:16;23108:7;23105:29;23102:2;;;23137:18;;:::i;:::-;23175:20;;22343:858;-1:-1:-1;;;;22343:858:1:o;23206:168::-;;23312:1;23308;23304:6;23300:14;23297:1;23294:21;23289:1;23282:9;23275:17;23271:45;23268:2;;;23319:18;;:::i;:::-;-1:-1:-1;23359:9:1;;23258:116::o;23379:217::-;;23447:6;23503:10;;;;23473;;23525:12;;;23522:2;;;23540:18;;:::i;:::-;23577:13;;23427:169;-1:-1:-1;;;23427:169:1:o;23601:125::-;;23669:1;23666;23663:8;23660:2;;;23674:18;;:::i;:::-;-1:-1:-1;23711:9:1;;23650:76::o;23731:135::-;;-1:-1:-1;;23791:17:1;;23788:2;;;23811:18;;:::i;:::-;-1:-1:-1;23858:1:1;23847:13;;23778:88::o;23871:112::-;;23929:1;23919:2;;23934:18;;:::i;:::-;-1:-1:-1;23968:9:1;;23909:74::o;23988:127::-;24049:10;24044:3;24040:20;24037:1;24030:31;24080:4;24077:1;24070:15;24104:4;24101:1;24094:15;24120:127;24181:10;24176:3;24172:20;24169:1;24162:31;24212:4;24209:1;24202:15;24236:4;24233:1;24226:15;24252:133;-1:-1:-1;;;;;24329:31:1;;24319:42;;24309:2;;24375:1;24372;24365:12
Swarm Source
ipfs://c07b1ff04ecf02889c42a9329b78db8d959b6ece4b080339ffe785198fbfe91f
Age | Block | Fee Address | BC Fee Address | Voting Power | Jailed | Incoming |
---|
Make sure to use the "Vote Down" button for any spammy posts, and the "Vote Up" for interesting conversations.