- Contract name:
- VoteTokenImplementation
- Optimization enabled
- false
- Compiler version
- v0.5.1+commit.c8a2cb62
- EVM Version
- default
- Verified at
- 2023-09-28T14:37:58.411721Z
Contract source code
// File: @openzeppelin/upgrades/contracts/Initializable.sol
pragma solidity 0.5.1;
/**
* @title Initializable
*
* @dev Helper contract to support initializer functions. To use it, replace
* the constructor with a function that has the initializer modifier.
* WARNING: Unlike constructors, initializer functions must be manually
* invoked. This applies both to deploying an Initializable contract, as well
* as extending an Initializable contract via inheritance.
* WARNING: When used with inheritance, manual care must be taken to not invoke
* a parent initializer twice, or ensure that all initializers are idempotent,
* because this is not dealt with automatically as with constructors.
*/
contract Initializable {
/**
* @dev Indicates that the contract has been initialized.
*/
bool private initialized;
/**
* @dev Indicates that the contract is in the process of being initialized.
*/
bool private initializing;
/**
* @dev Modifier to use in the initializer function of a contract.
*/
modifier initializer() {
require(
initializing || isConstructor() || !initialized,
"Contract instance has already been initialized"
);
bool isTopLevelCall = !initializing;
if (isTopLevelCall) {
initializing = true;
initialized = true;
}
_;
if (isTopLevelCall) {
initializing = false;
}
}
/// @dev Returns true if and only if the function is running in the constructor
function isConstructor() private view returns (bool) {
// extcodesize checks the size of the code stored in an address, and
// address returns the current address. Since the code is still not
// deployed when running a constructor, any checks on its code size will
// yield zero, making it an effective way to detect if a contract is
// under construction or not.
uint256 cs;
assembly {
cs := extcodesize(address)
}
return cs == 0;
}
// Reserved storage space to allow for layout changes in the future.
uint256[50] private ______gap;
}
// File: @openzeppelin/contracts-ethereum-package/contracts/token/ERC20/IERC20.sol
pragma solidity 0.5.1;
/**
* @dev Interface of the ERC20 standard as defined in the EIP. Does not include
* the optional functions; to access them see ERC20Detailed.
*/
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.
*
* > 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-ethereum-package/contracts/token/ERC20/ERC20Detailed.sol
pragma solidity 0.5.1;
/**
* @dev Optional functions from the ERC20 standard.
*/
contract ERC20Detailed is Initializable, IERC20 {
string private _name;
string private _symbol;
uint8 private _decimals;
/**
* @dev Sets the values for name, symbol, and decimals. All three of
* these values are immutable: they can only be set once during
* construction.
*/
function initialize(
string memory name,
string memory symbol,
uint8 decimals
) public initializer {
_name = name;
_symbol = symbol;
_decimals = decimals;
}
/**
* @dev Returns the name of the token.
*/
function name() public view returns (string memory) {
return _name;
}
/**
* @dev Returns the symbol of the token, usually a shorter version of the
* name.
*/
function symbol() public view 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.
*
* > Note that 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 returns (uint8) {
return _decimals;
}
uint256[50] private ______gap;
}
// File: @openzeppelin/contracts-ethereum-package/contracts/GSN/Context.sol
pragma solidity 0.5.1;
/*
* @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 not should not be accessed in such a direct
* manner, since when dealing with GSN meta-transactions the account sending and
* paying for execution may not be the actual sender (as far as an application
* is concerned).
*
* This contract is only required for intermediate, library-like contracts.
*/
contract Context {
// Empty internal constructor, to prevent people from mistakenly deploying
// an instance of this contract, with should be used via inheritance.
constructor() internal {}
// solhint-disable-previous-line no-empty-blocks
function _msgSender() internal view returns (address) {
return msg.sender;
}
function _msgData() internal view returns (bytes memory) {
this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691
return msg.data;
}
}
// File: @openzeppelin/contracts-ethereum-package/contracts/math/SafeMath.sol
pragma solidity 0.5.1;
/**
* @dev Wrappers over Solidity's arithmetic operations with added overflow
* checks.
*
* Arithmetic operations in Solidity wrap on overflow. This can easily result
* in bugs, because programmers usually assume that an overflow raises an
* error, which is the standard behavior in high level programming languages.
* SafeMath restores this intuition by reverting the transaction when an
* operation overflows.
*
* Using this library instead of the unchecked operations eliminates an entire
* class of bugs, so it's recommended to use it always.
*/
library SafeMath {
/**
* @dev Returns the addition of two unsigned integers, reverting on
* overflow.
*
* Counterpart to Solidity's + operator.
*
* Requirements:
* - Addition cannot overflow.
*/
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
/**
* @dev Returns the subtraction of two unsigned integers, reverting on
* overflow (when the result is negative).
*
* Counterpart to Solidity's - operator.
*
* Requirements:
* - Subtraction cannot overflow.
*/
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
require(b <= a, "SafeMath: subtraction overflow");
uint256 c = a - b;
return c;
}
/**
* @dev Returns the multiplication of two unsigned integers, reverting on
* overflow.
*
* Counterpart to Solidity's * operator.
*
* Requirements:
* - Multiplication cannot overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
// Gas optimization: this is cheaper than requiring 'a' not being zero, but the
// benefit is lost if 'b' is also tested.
// See: https://github.com/OpenZeppelin/openzeppelin-solidity/pull/522
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
/**
* @dev Returns the integer division of two unsigned integers. Reverts on
* division by zero. The result is rounded towards zero.
*
* Counterpart to Solidity's / operator. Note: this function uses a
* revert opcode (which leaves remaining gas untouched) while Solidity
* uses an invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
* - The divisor cannot be zero.
*/
function div(uint256 a, uint256 b) internal pure returns (uint256) {
// Solidity only automatically asserts when dividing by 0
require(b > 0, "SafeMath: division by zero");
uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return c;
}
/**
* @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
* Reverts when dividing by zero.
*
* Counterpart to Solidity's % operator. This function uses a revert
* opcode (which leaves remaining gas untouched) while Solidity uses an
* invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
* - The divisor cannot be zero.
*/
function mod(uint256 a, uint256 b) internal pure returns (uint256) {
require(b != 0, "SafeMath: modulo by zero");
return a % b;
}
}
// File: @openzeppelin/contracts-ethereum-package/contracts/token/ERC20/ERC20.sol
pragma solidity 0.5.1;
/**
* @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 ERC20Mintable.
*
* *For a detailed writeup see our guide [How to implement supply
* mechanisms](https://forum.zeppelin.solutions/t/how-to-implement-erc20-supply-mechanisms/226).*
*
* 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 Initializable, Context, IERC20 {
using SafeMath for uint256;
mapping(address => uint256) private _balances;
mapping(address => mapping(address => uint256)) private _allowances;
uint256 private _totalSupply;
/**
* @dev See IERC20.totalSupply.
*/
function totalSupply() public view returns (uint256) {
return _totalSupply;
}
/**
* @dev See IERC20.balanceOf.
*/
function balanceOf(address account) public view 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 to, uint256 value) public returns (bool) {
_transfer(_msgSender(), to, value);
return true;
}
/**
* @dev See IERC20.allowance.
*/
function allowance(address owner, address spender)
public
view
returns (uint256)
{
return _allowances[owner][spender];
}
/**
* @dev See IERC20.approve.
*
* Requirements:
*
* - spender cannot be the zero address.
*/
function approve(address spender, uint256 value) public returns (bool) {
_approve(_msgSender(), spender, value);
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 value.
* - the caller must have allowance for sender's tokens of at least
* amount.
*/
function transferFrom(
address from,
address to,
uint256 value
) public returns (bool) {
_transfer(from, to, value);
_approve(
from,
_msgSender(),
_allowances[from][_msgSender()].sub(value)
);
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
returns (bool)
{
_approve(
_msgSender(),
spender,
_allowances[_msgSender()][spender].add(addedValue)
);
return true;
}
/**
* @dev Atomically decreases the allowance granted to spender by the caller.
*
* This is an alternative to approve that can be used as a mitigation for
* problems described in IERC20.approve.
*
* Emits an Approval event indicating the updated allowance.
*
* Requirements:
*
* - spender cannot be the zero address.
* - spender must have allowance for the caller of at least
* subtractedValue.
*/
function decreaseAllowance(address spender, uint256 subtractedValue)
public
returns (bool)
{
_approve(
_msgSender(),
spender,
_allowances[_msgSender()][spender].sub(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 {
require(sender != address(0), "ERC20: transfer from the zero address");
require(recipient != address(0), "ERC20: transfer to the zero address");
_balances[sender] = _balances[sender].sub(amount);
_balances[recipient] = _balances[recipient].add(amount);
emit Transfer(sender, recipient, amount);
}
/** @dev Creates amount tokens and assigns them to account, increasing
* the total supply.
*
* Emits a Transfer event with from set to the zero address.
*
* Requirements
*
* - to cannot be the zero address.
*/
function _mint(address account, uint256 amount) internal {
require(account != address(0), "ERC20: mint to the zero address");
_totalSupply = _totalSupply.add(amount);
_balances[account] = _balances[account].add(amount);
emit Transfer(address(0), account, amount);
}
/**
* @dev Destoys 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 value) internal {
require(account != address(0), "ERC20: burn from the zero address");
_totalSupply = _totalSupply.sub(value);
_balances[account] = _balances[account].sub(value);
emit Transfer(account, address(0), value);
}
/**
* @dev Sets amount as the allowance of spender over the owners tokens.
*
* This is 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 value
) internal {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = value;
emit Approval(owner, spender, value);
}
/**
* @dev Destoys amount tokens from account.amount is then deducted
* from the caller's allowance.
*
* See _burn and _approve.
*/
function _burnFrom(address account, uint256 amount) internal {
_burn(account, amount);
_approve(
account,
_msgSender(),
_allowances[account][_msgSender()].sub(amount)
);
}
uint256[50] private ______gap;
}
// File: @openzeppelin/contracts-ethereum-package/contracts/access/Roles.sol
pragma solidity 0.5.1;
/**
* @title Roles
* @dev Library for managing addresses assigned to a Role.
*/
library Roles {
struct Role {
mapping(address => bool) bearer;
}
/**
* @dev Give an account access to this role.
*/
function add(Role storage role, address account) internal {
require(!has(role, account), "Roles: account already has role");
role.bearer[account] = true;
}
/**
* @dev Remove an account's access to this role.
*/
function remove(Role storage role, address account) internal {
require(has(role, account), "Roles: account does not have role");
role.bearer[account] = false;
}
/**
* @dev Check if an account has this role.
* @return bool
*/
function has(Role storage role, address account)
internal
view
returns (bool)
{
require(account != address(0), "Roles: account is the zero address");
return role.bearer[account];
}
}
// File: @openzeppelin/contracts-ethereum-package/contracts/access/roles/MinterRole.sol
pragma solidity 0.5.1;
contract MinterRole is Initializable, Context {
using Roles for Roles.Role;
event MinterAdded(address indexed account);
event MinterRemoved(address indexed account);
Roles.Role private _minters;
function initialize(address sender) public initializer {
if (!isMinter(sender)) {
_addMinter(sender);
}
}
modifier onlyMinter() {
require(
isMinter(_msgSender()),
"MinterRole: caller does not have the Minter role"
);
_;
}
function isMinter(address account) public view returns (bool) {
return _minters.has(account);
}
function addMinter(address account) public onlyMinter {
_addMinter(account);
}
function renounceMinter() public {
_removeMinter(_msgSender());
}
function _addMinter(address account) internal {
_minters.add(account);
emit MinterAdded(account);
}
function _removeMinter(address account) internal {
_minters.remove(account);
emit MinterRemoved(account);
}
uint256[50] private ______gap;
}
// File: @openzeppelin/contracts-ethereum-package/contracts/token/ERC20/ERC20Mintable.sol
pragma solidity 0.5.1;
/**
* @dev Extension of ERC20 that adds a set of accounts with the MinterRole,
* which have permission to mint (create) new tokens as they see fit.
*
* At construction, the deployer of the contract is the only minter.
*/
contract ERC20Mintable is Initializable, ERC20, MinterRole {
function initialize(address sender) public initializer {
MinterRole.initialize(sender);
}
uint256[50] private ______gap;
}
// File: @openzeppelin/contracts-ethereum-package/contracts/access/roles/PauserRole.sol
pragma solidity 0.5.1;
contract PauserRole is Initializable, Context {
using Roles for Roles.Role;
event PauserAdded(address indexed account);
event PauserRemoved(address indexed account);
Roles.Role private _pausers;
function initialize(address sender) public initializer {
if (!isPauser(sender)) {
_addPauser(sender);
}
}
modifier onlyPauser() {
require(
isPauser(_msgSender()),
"PauserRole: caller does not have the Pauser role"
);
_;
}
function isPauser(address account) public view returns (bool) {
return _pausers.has(account);
}
function addPauser(address account) public onlyPauser {
_addPauser(account);
}
function renouncePauser() public {
_removePauser(_msgSender());
}
function _addPauser(address account) internal {
_pausers.add(account);
emit PauserAdded(account);
}
function _removePauser(address account) internal {
_pausers.remove(account);
emit PauserRemoved(account);
}
uint256[50] private ______gap;
}
// File: @openzeppelin/contracts-ethereum-package/contracts/lifecycle/Pausable.sol
pragma solidity 0.5.1;
/**
* @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.
*/
contract Pausable is Initializable, Context, PauserRole {
/**
* @dev Emitted when the pause is triggered by a pauser (account).
*/
event Paused(address account);
/**
* @dev Emitted when the pause is lifted by a pauser (account).
*/
event Unpaused(address account);
bool private _paused;
/**
* @dev Initializes the contract in unpaused state. Assigns the Pauser role
* to the deployer.
*/
function initialize(address sender) public initializer {
PauserRole.initialize(sender);
_paused = false;
}
/**
* @dev Returns true if the contract is paused, and false otherwise.
*/
function paused() public view returns (bool) {
return _paused;
}
/**
* @dev Modifier to make a function callable only when the contract is not paused.
*/
modifier whenNotPaused() {
require(!_paused, "Pausable: paused");
_;
}
/**
* @dev Modifier to make a function callable only when the contract is paused.
*/
modifier whenPaused() {
require(_paused, "Pausable: not paused");
_;
}
/**
* @dev Called by a pauser to pause, triggers stopped state.
*/
function pause() public onlyPauser whenNotPaused {
_paused = true;
emit Paused(_msgSender());
}
/**
* @dev Called by a pauser to unpause, returns to normal state.
*/
function unpause() public onlyPauser whenPaused {
_paused = false;
emit Unpaused(_msgSender());
}
uint256[50] private ______gap;
}
// File: @openzeppelin/contracts-ethereum-package/contracts/token/ERC20/ERC20Pausable.sol
pragma solidity 0.5.1;
/**
* @title Pausable token
* @dev ERC20 modified with pausable transfers.
*/
contract ERC20Pausable is Initializable, ERC20, Pausable {
function initialize(address sender) public initializer {
Pausable.initialize(sender);
}
function transfer(address to, uint256 value)
public
whenNotPaused
returns (bool)
{
return super.transfer(to, value);
}
function transferFrom(
address from,
address to,
uint256 value
) public whenNotPaused returns (bool) {
return super.transferFrom(from, to, value);
}
function approve(address spender, uint256 value)
public
whenNotPaused
returns (bool)
{
return super.approve(spender, value);
}
function increaseAllowance(address spender, uint256 addedValue)
public
whenNotPaused
returns (bool)
{
return super.increaseAllowance(spender, addedValue);
}
function decreaseAllowance(address spender, uint256 subtractedValue)
public
whenNotPaused
returns (bool)
{
return super.decreaseAllowance(spender, subtractedValue);
}
uint256[50] private ______gap;
}
// File: @openzeppelin/contracts-ethereum-package/contracts/token/ERC20/StandaloneERC20.sol
pragma solidity 0.5.1;
/**
* @title Standard ERC20 token, with minting and pause functionality.
*
*/
contract StandaloneERC20 is
Initializable,
ERC20Detailed,
ERC20Mintable,
ERC20Pausable
{
function initialize(
string memory name,
string memory symbol,
uint8 decimals,
uint256 initialSupply,
address initialHolder,
address[] memory minters,
address[] memory pausers
) public initializer {
ERC20Detailed.initialize(name, symbol, decimals);
// Mint the initial supply
_mint(initialHolder, initialSupply);
// Initialize the minter and pauser roles, and renounce them
ERC20Mintable.initialize(address(this));
_removeMinter(address(this));
ERC20Pausable.initialize(address(this));
_removePauser(address(this));
// Add the requested minters and pausers (this can be done after renouncing since
// these are the internal calls)
for (uint256 i = 0; i < minters.length; ++i) {
_addMinter(minters[i]);
}
for (uint256 i = 0; i < pausers.length; ++i) {
_addPauser(pausers[i]);
}
}
function initialize(
string memory name,
string memory symbol,
uint8 decimals,
address[] memory minters,
address[] memory pausers
) public initializer {
ERC20Detailed.initialize(name, symbol, decimals);
// Initialize the minter and pauser roles, and renounce them
ERC20Mintable.initialize(address(this));
_removeMinter(address(this));
ERC20Pausable.initialize(address(this));
_removePauser(address(this));
// Add the requested minters and pausers (this can be done after renouncing since
// these are the internal calls)
for (uint256 i = 0; i < minters.length; ++i) {
_addMinter(minters[i]);
}
for (uint256 i = 0; i < pausers.length; ++i) {
_addPauser(pausers[i]);
}
}
}
// File: contracts/ArrayListLib.sol
pragma solidity 0.5.1;
library ArrayListLib {
struct ListItem {
uint256 index;
address item;
}
struct StoredList {
mapping(address => ListItem) storageMap;
bool initialized;
address[] storageList;
}
function add(StoredList storage self, address _address) internal {
if (!exists(self, _address)) {
ListItem memory item = ListItem(
self.storageList.length + 1,
_address
);
self.storageList.push(_address);
self.storageMap[_address] = item;
}
}
function exists(StoredList storage self, address _address)
internal
view
returns (bool)
{
return self.storageMap[_address].index > 0;
}
function remove(StoredList storage self, address _address) internal {
if (exists(self, _address)) {
uint256 lastIndex = self.storageList.length;
if (lastIndex != self.storageMap[_address].index) {
self.storageMap[self.storageList[lastIndex - 1]].index = self
.storageMap[_address]
.index;
self.storageList[self.storageMap[_address].index - 1] = self
.storageList[lastIndex - 1];
}
self.storageList.length--;
}
delete self.storageMap[_address];
}
function getItems(StoredList storage self)
internal
view
returns (address[] memory items)
{
return self.storageList;
}
}
// File: contracts/VoteTokenImplementation.sol
pragma solidity 0.5.1;
//import './Survey.sol';
contract Survey {
function updateQuorum(
uint256 _fromNewBalance,
uint256 _fromOldBalance,
uint256 _toNewBalance,
uint256 _toOldBalance
) public;
function adjustTotalWeights(address _owner, bool _exclude) external;
}
contract VoteTokenImplementation is Initializable, StandaloneERC20 {
using ArrayListLib for ArrayListLib.StoredList;
ArrayListLib.StoredList private surveys;
ArrayListLib.StoredList private ownersList;
ArrayListLib.StoredList private exclusionList;
address private owner;
bool private initializedByProxy;
modifier onlyOwner() {
require(msg.sender == owner, "Not allowed to call this method");
_;
}
constructor() public {
initializedByProxy = true;
}
function initialize(
string memory name,
string memory symbol,
uint8 decimals,
uint256 initialSupply,
address initialHolder,
address[] memory minters,
address[] memory pausers
) public initializer {
require(!initializedByProxy, "already initialized");
owner = initialHolder;
exclusionList.add(initialHolder);
StandaloneERC20.initialize(
name,
symbol,
decimals,
initialSupply,
initialHolder,
minters,
pausers
);
}
function transferFrom(
address sender,
address recipient,
uint256 amount
) public returns (bool) {
if (
balanceOf(recipient) > 0 && //has positive balance
!ownersList.exists(recipient) //not added already to owners list
) {
ownersList.add(recipient);
}
//sender's balance is 0, taking it out from owners' list
if (balanceOf(sender) == 0 && ownersList.exists(sender)) {
ownersList.remove(sender);
}
return super.transferFrom(sender, recipient, amount);
}
function transfer(address recipient, uint256 amount) public returns (bool) {
address _from = msg.sender;
if (
balanceOf(recipient) > 0 && //has positive balance
!ownersList.exists(recipient) && //not added already to owners list
recipient != owner //not adding the owner to this list
) {
ownersList.add(recipient);
}
//sender's balance is 0, taking it out from owners' list
if (balanceOf(_from) == 0 && ownersList.exists(_from)) {
ownersList.remove(_from);
}
return super.transfer(recipient, amount);
}
function registerSurvey(address _survey) public {
surveys.add(_survey);
}
function unregisterSurvey(address _survey) public {
surveys.remove(_survey);
}
function isSurveyRegistered(address _survey) public view returns (bool) {
return surveys.exists(_survey);
}
function batchTransfer(
address payable _from,
address[] memory _to,
uint256[] memory _values
) public {
uint256 toLength = _to.length;
require(toLength == _values.length, "Batches counters do not match");
for (uint256 index = 0; index < toLength; index++) {
if (_from == msg.sender) {
transfer(_to[index], _values[index]);
} else {
transferFrom(_from, _to[index], _values[index]);
}
}
}
function getCirculatingSupply(
uint256 offset,
uint256 count,
uint256 cap
) public view returns (uint256) {
uint256 balance;
uint256 circulatingSupply;
uint256 totalCount;
uint256 adjustSupply;
if (offset >= ownersList.storageList.length) {
return 0;
}
totalCount = offset + count > ownersList.storageList.length
? ownersList.storageList.length
: offset + count;
for (uint256 index = offset; index < totalCount; index++) {
balance = balanceOf(ownersList.storageList[index]);
adjustSupply = cap > balance ? balance : cap;
circulatingSupply = circulatingSupply + adjustSupply;
}
return circulatingSupply;
}
function getOwnersCount() external view returns (uint256) {
return ownersList.storageList.length;
}
function getOwner() public view returns (address tokenOwner) {
return owner;
}
function burn(address account, uint256 value) public onlyOwner {
require(account == owner, "Not allowed to burn tokens from non-owner");
super._burn(account, value);
}
function version() public pure returns (uint256) {
return 7;
}
}
Contract ABI
[{"type":"constructor","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"addMinter","inputs":[{"type":"address","name":"account"}],"constant":false},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"addPauser","inputs":[{"type":"address","name":"account"}],"constant":false},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":""}],"name":"allowance","inputs":[{"type":"address","name":"owner"},{"type":"address","name":"spender"}],"constant":true},{"type":"function","stateMutability":"nonpayable","outputs":[{"type":"bool","name":""}],"name":"approve","inputs":[{"type":"address","name":"spender"},{"type":"uint256","name":"value"}],"constant":false},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":""}],"name":"balanceOf","inputs":[{"type":"address","name":"account"}],"constant":true},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"batchTransfer","inputs":[{"type":"address","name":"_from"},{"type":"address[]","name":"_to"},{"type":"uint256[]","name":"_values"}],"constant":false},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"burn","inputs":[{"type":"address","name":"account"},{"type":"uint256","name":"value"}],"constant":false},{"type":"function","stateMutability":"view","outputs":[{"type":"uint8","name":""}],"name":"decimals","inputs":[],"constant":true},{"type":"function","stateMutability":"nonpayable","outputs":[{"type":"bool","name":""}],"name":"decreaseAllowance","inputs":[{"type":"address","name":"spender"},{"type":"uint256","name":"subtractedValue"}],"constant":false},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":""}],"name":"getCirculatingSupply","inputs":[{"type":"uint256","name":"offset"},{"type":"uint256","name":"count"},{"type":"uint256","name":"cap"}],"constant":true},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"tokenOwner"}],"name":"getOwner","inputs":[],"constant":true},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":""}],"name":"getOwnersCount","inputs":[],"constant":true},{"type":"function","stateMutability":"nonpayable","outputs":[{"type":"bool","name":""}],"name":"increaseAllowance","inputs":[{"type":"address","name":"spender"},{"type":"uint256","name":"addedValue"}],"constant":false},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"initialize","inputs":[{"type":"string","name":"name"},{"type":"string","name":"symbol"},{"type":"uint8","name":"decimals"}],"constant":false},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"initialize","inputs":[{"type":"string","name":"name"},{"type":"string","name":"symbol"},{"type":"uint8","name":"decimals"},{"type":"address[]","name":"minters"},{"type":"address[]","name":"pausers"}],"constant":false},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"initialize","inputs":[{"type":"string","name":"name"},{"type":"string","name":"symbol"},{"type":"uint8","name":"decimals"},{"type":"uint256","name":"initialSupply"},{"type":"address","name":"initialHolder"},{"type":"address[]","name":"minters"},{"type":"address[]","name":"pausers"}],"constant":false},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"initialize","inputs":[{"type":"address","name":"sender"}],"constant":false},{"type":"function","stateMutability":"view","outputs":[{"type":"bool","name":""}],"name":"isMinter","inputs":[{"type":"address","name":"account"}],"constant":true},{"type":"function","stateMutability":"view","outputs":[{"type":"bool","name":""}],"name":"isPauser","inputs":[{"type":"address","name":"account"}],"constant":true},{"type":"function","stateMutability":"view","outputs":[{"type":"bool","name":""}],"name":"isSurveyRegistered","inputs":[{"type":"address","name":"_survey"}],"constant":true},{"type":"function","stateMutability":"view","outputs":[{"type":"string","name":""}],"name":"name","inputs":[],"constant":true},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"pause","inputs":[],"constant":false},{"type":"function","stateMutability":"view","outputs":[{"type":"bool","name":""}],"name":"paused","inputs":[],"constant":true},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"registerSurvey","inputs":[{"type":"address","name":"_survey"}],"constant":false},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"renounceMinter","inputs":[],"constant":false},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"renouncePauser","inputs":[],"constant":false},{"type":"function","stateMutability":"view","outputs":[{"type":"string","name":""}],"name":"symbol","inputs":[],"constant":true},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":""}],"name":"totalSupply","inputs":[],"constant":true},{"type":"function","stateMutability":"nonpayable","outputs":[{"type":"bool","name":""}],"name":"transfer","inputs":[{"type":"address","name":"recipient"},{"type":"uint256","name":"amount"}],"constant":false},{"type":"function","stateMutability":"nonpayable","outputs":[{"type":"bool","name":""}],"name":"transferFrom","inputs":[{"type":"address","name":"sender"},{"type":"address","name":"recipient"},{"type":"uint256","name":"amount"}],"constant":false},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"unpause","inputs":[],"constant":false},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"unregisterSurvey","inputs":[{"type":"address","name":"_survey"}],"constant":false},{"type":"function","stateMutability":"pure","outputs":[{"type":"uint256","name":""}],"name":"version","inputs":[],"constant":true},{"type":"event","name":"Approval","inputs":[{"type":"address","name":"owner","indexed":true},{"type":"address","name":"spender","indexed":true},{"type":"uint256","name":"value","indexed":false}],"anonymous":false},{"type":"event","name":"MinterAdded","inputs":[{"type":"address","name":"account","indexed":true}],"anonymous":false},{"type":"event","name":"MinterRemoved","inputs":[{"type":"address","name":"account","indexed":true}],"anonymous":false},{"type":"event","name":"Paused","inputs":[{"type":"address","name":"account","indexed":false}],"anonymous":false},{"type":"event","name":"PauserAdded","inputs":[{"type":"address","name":"account","indexed":true}],"anonymous":false},{"type":"event","name":"PauserRemoved","inputs":[{"type":"address","name":"account","indexed":true}],"anonymous":false},{"type":"event","name":"Transfer","inputs":[{"type":"address","name":"from","indexed":true},{"type":"address","name":"to","indexed":true},{"type":"uint256","name":"value","indexed":false}],"anonymous":false},{"type":"event","name":"Unpaused","inputs":[{"type":"address","name":"account","indexed":false}],"anonymous":false}]
Deployed ByteCode
0x60806040526004361061019b576000357c01000000000000000000000000000000000000000000000000000000009004806306fdde03146101a0578063095ea7b3146102305780631239ec8c146102a35780631624f6c61461041c57806318160ddd1461058857806323b872dd146105b357806331392b4a14610646578063313ce567146108da578063395093511461090b5780633f4ba83a1461097e5780634660259d1461099557806346fbf68e146109e657806348be01c614610a4f5780634b6df33e14610d0d57806354fd4d5014610d705780635c975abb14610d9b5780636ef8d66d14610dca57806370a0823114610de157806373ff81cc14610e4657806374eb8c0114610e7157806382dc1ec414610ec25780638456cb5914610f13578063893d20e814610f2a57806395d89b4114610f81578063983b2d561461101157806398650275146110625780639dc29fac14611079578063a457c2d7146110d4578063a9059cbb14611147578063aa271e1a146111ba578063c12153f114611223578063c4d66de81461128c578063dd62ed3e146112dd575b600080fd5b3480156101ac57600080fd5b506101b5611362565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156101f55780820151818401526020810190506101da565b50505050905090810190601f1680156102225780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561023c57600080fd5b506102896004803603604081101561025357600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611404565b604051808215151515815260200191505060405180910390f35b3480156102af57600080fd5b5061041a600480360360608110156102c657600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019064010000000081111561030357600080fd5b82018360208201111561031557600080fd5b8035906020019184602083028401116401000000008311171561033757600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f8201169050808301925050505050505091929192908035906020019064010000000081111561039757600080fd5b8201836020820111156103a957600080fd5b803590602001918460208302840111640100000000831117156103cb57600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f82011690508083019250505050505050919291929050505061149e565b005b34801561042857600080fd5b506105866004803603606081101561043f57600080fd5b810190808035906020019064010000000081111561045c57600080fd5b82018360208201111561046e57600080fd5b8035906020019184600183028401116401000000008311171561049057600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f820116905080830192505050505050509192919290803590602001906401000000008111156104f357600080fd5b82018360208201111561050557600080fd5b8035906020019184600183028401116401000000008311171561052757600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f820116905080830192505050505050509192919290803560ff1690602001909291905050506115eb565b005b34801561059457600080fd5b5061059d61177b565b6040518082815260200191505060405180910390f35b3480156105bf57600080fd5b5061062c600480360360608110156105d657600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611785565b604051808215151515815260200191505060405180910390f35b34801561065257600080fd5b506108d8600480360360a081101561066957600080fd5b810190808035906020019064010000000081111561068657600080fd5b82018360208201111561069857600080fd5b803590602001918460018302840111640100000000831117156106ba57600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f8201169050808301925050505050505091929192908035906020019064010000000081111561071d57600080fd5b82018360208201111561072f57600080fd5b8035906020019184600183028401116401000000008311171561075157600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f820116905080830192505050505050509192919290803560ff169060200190929190803590602001906401000000008111156107c157600080fd5b8201836020820111156107d357600080fd5b803590602001918460208302840111640100000000831117156107f557600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f8201169050808301925050505050505091929192908035906020019064010000000081111561085557600080fd5b82018360208201111561086757600080fd5b8035906020019184602083028401116401000000008311171561088957600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f820116905080830192505050505050509192919290505050611823565b005b3480156108e657600080fd5b506108ef611a11565b604051808260ff1660ff16815260200191505060405180910390f35b34801561091757600080fd5b506109646004803603604081101561092e57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611a28565b604051808215151515815260200191505060405180910390f35b34801561098a57600080fd5b50610993611ac2565b005b3480156109a157600080fd5b506109e4600480360360208110156109b857600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611c79565b005b3480156109f257600080fd5b50610a3560048036036020811015610a0957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611c91565b604051808215151515815260200191505060405180910390f35b348015610a5b57600080fd5b50610d0b600480360360e0811015610a7257600080fd5b8101908080359060200190640100000000811115610a8f57600080fd5b820183602082011115610aa157600080fd5b80359060200191846001830284011164010000000083111715610ac357600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f82011690508083019250505050505050919291929080359060200190640100000000811115610b2657600080fd5b820183602082011115610b3857600080fd5b80359060200191846001830284011164010000000083111715610b5a57600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f820116905080830192505050505050509192919290803560ff16906020019092919080359060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190640100000000811115610bf457600080fd5b820183602082011115610c0657600080fd5b80359060200191846020830284011164010000000083111715610c2857600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f82011690508083019250505050505050919291929080359060200190640100000000811115610c8857600080fd5b820183602082011115610c9a57600080fd5b80359060200191846020830284011164010000000083111715610cbc57600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f820116905080830192505050505050509192919290505050611caf565b005b348015610d1957600080fd5b50610d5a60048036036060811015610d3057600080fd5b81019080803590602001909291908035906020019092919080359060200190929190505050611ee6565b6040518082815260200191505060405180910390f35b348015610d7c57600080fd5b50610d85611fbd565b6040518082815260200191505060405180910390f35b348015610da757600080fd5b50610db0611fc6565b604051808215151515815260200191505060405180910390f35b348015610dd657600080fd5b50610ddf611fde565b005b348015610ded57600080fd5b50610e3060048036036020811015610e0457600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611ff0565b6040518082815260200191505060405180910390f35b348015610e5257600080fd5b50610e5b612039565b6040518082815260200191505060405180910390f35b348015610e7d57600080fd5b50610ec060048036036020811015610e9457600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061204a565b005b348015610ece57600080fd5b50610f1160048036036020811015610ee557600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050612062565b005b348015610f1f57600080fd5b50610f28612118565b005b348015610f3657600080fd5b50610f3f6122d0565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b348015610f8d57600080fd5b50610f966122fb565b6040518080602001828103825283818151815260200191508051906020019080838360005b83811015610fd6578082015181840152602081019050610fbb565b50505050905090810190601f1680156110035780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561101d57600080fd5b506110606004803603602081101561103457600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061239d565b005b34801561106e57600080fd5b50611077612453565b005b34801561108557600080fd5b506110d26004803603604081101561109c57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050612465565b005b3480156110e057600080fd5b5061112d600480360360408110156110f757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050612625565b604051808215151515815260200191505060405180910390f35b34801561115357600080fd5b506111a06004803603604081101561116a57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506126bf565b604051808215151515815260200191505060405180910390f35b3480156111c657600080fd5b50611209600480360360208110156111dd57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506127bc565b604051808215151515815260200191505060405180910390f35b34801561122f57600080fd5b506112726004803603602081101561124657600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506127d9565b604051808215151515815260200191505060405180910390f35b34801561129857600080fd5b506112db600480360360208110156112af57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506127f7565b005b3480156112e957600080fd5b5061134c6004803603604081101561130057600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050612945565b6040518082815260200191505060405180910390f35b606060338054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156113fa5780601f106113cf576101008083540402835291602001916113fa565b820191906000526020600020905b8154815290600101906020018083116113dd57829003601f168201915b5050505050905090565b600061013560009054906101000a900460ff1615151561148c576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260108152602001807f5061757361626c653a207061757365640000000000000000000000000000000081525060200191505060405180910390fd5b61149683836129cc565b905092915050565b60008251905081518114151561151c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601d8152602001807f4261746368657320636f756e7465727320646f206e6f74206d6174636800000081525060200191505060405180910390fd5b60008090505b818110156115e4573373ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff16141561159c57611596848281518110151561156f57fe5b90602001906020020151848381518110151561158757fe5b906020019060200201516126bf565b506115d7565b6115d58585838151811015156115ae57fe5b9060200190602002015185848151811015156115c657fe5b90602001906020020151611785565b505b8080600101915050611522565b5050505050565b600060019054906101000a900460ff168061160a57506116096129ea565b5b8061162157506000809054906101000a900460ff16155b15156116bb576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602e8152602001807f436f6e747261637420696e7374616e63652068617320616c726561647920626581526020017f656e20696e697469616c697a656400000000000000000000000000000000000081525060400191505060405180910390fd5b60008060019054906101000a900460ff16159050801561170b576001600060016101000a81548160ff02191690831515021790555060016000806101000a81548160ff0219169083151502179055505b8360339080519060200190611721929190614802565b508260349080519060200190611738929190614802565b5081603560006101000a81548160ff021916908360ff16021790555080156117755760008060016101000a81548160ff0219169083151502179055505b50505050565b6000606a54905090565b60008061179184611ff0565b1180156117b057506117ae8361019d6129fb90919063ffffffff16565b155b156117cb576117ca8361019d612a4c90919063ffffffff16565b5b60006117d685611ff0565b1480156117f457506117f38461019d6129fb90919063ffffffff16565b5b1561180f5761180e8461019d612b9f90919063ffffffff16565b5b61181a848484612e43565b90509392505050565b600060019054906101000a900460ff168061184257506118416129ea565b5b8061185957506000809054906101000a900460ff16155b15156118f3576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602e8152602001807f436f6e747261637420696e7374616e63652068617320616c726561647920626581526020017f656e20696e697469616c697a656400000000000000000000000000000000000081525060400191505060405180910390fd5b60008060019054906101000a900460ff161590508015611943576001600060016101000a81548160ff02191690831515021790555060016000806101000a81548160ff0219169083151502179055505b61194e8686866115eb565b61195730612edf565b6119603061302d565b611969306127f7565b61197230613087565b60008090505b83518110156119ac576119a1848281518110151561199257fe5b906020019060200201516130e2565b806001019050611978565b5060008090505b82518110156119e7576119dc83828151811015156119cd57fe5b9060200190602002015161313c565b8060010190506119b3565b508015611a095760008060016101000a81548160ff0219169083151502179055505b505050505050565b6000603560009054906101000a900460ff16905090565b600061013560009054906101000a900460ff16151515611ab0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260108152602001807f5061757361626c653a207061757365640000000000000000000000000000000081525060200191505060405180910390fd5b611aba8383613197565b905092915050565b611ad2611acd61324a565b611c91565b1515611b6c576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260308152602001807f506175736572526f6c653a2063616c6c657220646f6573206e6f74206861766581526020017f207468652050617573657220726f6c650000000000000000000000000000000081525060400191505060405180910390fd5b61013560009054906101000a900460ff161515611bf1576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260148152602001807f5061757361626c653a206e6f742070617573656400000000000000000000000081525060200191505060405180910390fd5b600061013560006101000a81548160ff0219169083151502179055507f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa611c3661324a565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390a1565b611c8e8161019a612b9f90919063ffffffff16565b50565b6000611ca88261010261325290919063ffffffff16565b9050919050565b600060019054906101000a900460ff1680611cce5750611ccd6129ea565b5b80611ce557506000809054906101000a900460ff16155b1515611d7f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602e8152602001807f436f6e747261637420696e7374616e63652068617320616c726561647920626581526020017f656e20696e697469616c697a656400000000000000000000000000000000000081525060400191505060405180910390fd5b60008060019054906101000a900460ff161590508015611dcf576001600060016101000a81548160ff02191690831515021790555060016000806101000a81548160ff0219169083151502179055505b6101a360149054906101000a900460ff16151515611e55576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260138152602001807f616c726561647920696e697469616c697a65640000000000000000000000000081525060200191505060405180910390fd5b836101a360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550611eac846101a0612a4c90919063ffffffff16565b611ebb88888888888888613375565b8015611edc5760008060016101000a81548160ff0219169083151502179055505b5050505050505050565b600080600080600061019d6002018054905088101515611f0d576000945050505050611fb6565b61019d6002018054905087890111611f2757868801611f32565b61019d600201805490505b915060008890505b82811015611fad57611f8861019d60020182815481101515611f5857fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16611ff0565b9450848711611f975786611f99565b845b915081840193508080600101915050611f3a565b50829450505050505b9392505050565b60006007905090565b600061013560009054906101000a900460ff16905090565b611fee611fe961324a565b613087565b565b6000606860008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b600061019d60020180549050905090565b61205f8161019a612a4c90919063ffffffff16565b50565b61207261206d61324a565b611c91565b151561210c576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260308152602001807f506175736572526f6c653a2063616c6c657220646f6573206e6f74206861766581526020017f207468652050617573657220726f6c650000000000000000000000000000000081525060400191505060405180910390fd5b6121158161313c565b50565b61212861212361324a565b611c91565b15156121c2576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260308152602001807f506175736572526f6c653a2063616c6c657220646f6573206e6f74206861766581526020017f207468652050617573657220726f6c650000000000000000000000000000000081525060400191505060405180910390fd5b61013560009054906101000a900460ff16151515612248576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260108152602001807f5061757361626c653a207061757365640000000000000000000000000000000081525060200191505060405180910390fd5b600161013560006101000a81548160ff0219169083151502179055507f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a25861228d61324a565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390a1565b60006101a360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b606060348054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156123935780601f1061236857610100808354040283529160200191612393565b820191906000526020600020905b81548152906001019060200180831161237657829003601f168201915b5050505050905090565b6123ad6123a861324a565b6127bc565b1515612447576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260308152602001807f4d696e746572526f6c653a2063616c6c657220646f6573206e6f74206861766581526020017f20746865204d696e74657220726f6c650000000000000000000000000000000081525060400191505060405180910390fd5b612450816130e2565b50565b61246361245e61324a565b61302d565b565b6101a360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561252b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601f8152602001807f4e6f7420616c6c6f77656420746f2063616c6c2074686973206d6574686f640081525060200191505060405180910390fd5b6101a360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141515612617576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260298152602001807f4e6f7420616c6c6f77656420746f206275726e20746f6b656e732066726f6d2081526020017f6e6f6e2d6f776e6572000000000000000000000000000000000000000000000081525060400191505060405180910390fd5b612621828261356f565b5050565b600061013560009054906101000a900460ff161515156126ad576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260108152602001807f5061757361626c653a207061757365640000000000000000000000000000000081525060200191505060405180910390fd5b6126b78383613754565b905092915050565b60008033905060006126d085611ff0565b1180156126ef57506126ed8461019d6129fb90919063ffffffff16565b155b801561274a57506101a360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b15612765576127648461019d612a4c90919063ffffffff16565b5b600061277082611ff0565b14801561278e575061278d8161019d6129fb90919063ffffffff16565b5b156127a9576127a88161019d612b9f90919063ffffffff16565b5b6127b38484613807565b91505092915050565b60006127d282609d61325290919063ffffffff16565b9050919050565b60006127f08261019a6129fb90919063ffffffff16565b9050919050565b600060019054906101000a900460ff168061281657506128156129ea565b5b8061282d57506000809054906101000a900460ff16155b15156128c7576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602e8152602001807f436f6e747261637420696e7374616e63652068617320616c726561647920626581526020017f656e20696e697469616c697a656400000000000000000000000000000000000081525060400191505060405180910390fd5b60008060019054906101000a900460ff161590508015612917576001600060016101000a81548160ff02191690831515021790555060016000806101000a81548160ff0219169083151502179055505b612920826138a1565b80156129415760008060016101000a81548160ff0219169083151502179055505b5050565b6000606960008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b60006129e06129d961324a565b8484613a0b565b6001905092915050565b600080303b90506000811491505090565b6000808360000160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000015411905092915050565b612a5682826129fb565b1515612b9b57612a64614882565b6040805190810160405280600185600201805490500181526020018373ffffffffffffffffffffffffffffffffffffffff168152509050826002018290806001815401808255809150509060018203906000526020600020016000909192909190916101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050808360000160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000820151816000015560208201518160010160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550905050505b5050565b612ba982826129fb565b15612dcc576000826002018054905090508260000160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000015481141515612db2578260000160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600001548360000160008560020160018503815481101515612c6657fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600001819055508260020160018203815481101515612ce657fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff168360020160018560000160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000015403815481101515612d6957fe5b9060005260206000200160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055505b82600201805480919060019003612dc991906148b2565b50505b8160000160008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000808201600090556001820160006101000a81549073ffffffffffffffffffffffffffffffffffffffff021916905550505050565b600061013560009054906101000a900460ff16151515612ecb576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260108152602001807f5061757361626c653a207061757365640000000000000000000000000000000081525060200191505060405180910390fd5b612ed6848484613c8c565b90509392505050565b600060019054906101000a900460ff1680612efe5750612efd6129ea565b5b80612f1557506000809054906101000a900460ff16155b1515612faf576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602e8152602001807f436f6e747261637420696e7374616e63652068617320616c726561647920626581526020017f656e20696e697469616c697a656400000000000000000000000000000000000081525060400191505060405180910390fd5b60008060019054906101000a900460ff161590508015612fff576001600060016101000a81548160ff02191690831515021790555060016000806101000a81548160ff0219169083151502179055505b61300882613d4b565b80156130295760008060016101000a81548160ff0219169083151502179055505b5050565b61304181609d613ea990919063ffffffff16565b8073ffffffffffffffffffffffffffffffffffffffff167fe94479a9f7e1952cc78f2d6baab678adc1b772d936c6583def489e524cb6669260405160405180910390a250565b61309c81610102613ea990919063ffffffff16565b8073ffffffffffffffffffffffffffffffffffffffff167fcd265ebaf09df2871cc7bd4133404a235ba12eff2041bb89d9c714a2621c7c7e60405160405180910390a250565b6130f681609d613fab90919063ffffffff16565b8073ffffffffffffffffffffffffffffffffffffffff167f6ae172837ea30b801fbfcdd4108aa1d5bf8ff775444fd70256b44e6bf3dfc3f660405160405180910390a250565b61315181610102613fab90919063ffffffff16565b8073ffffffffffffffffffffffffffffffffffffffff167f6719d08c1888103bea251a4ed56406bd0c3e69723c8a1686e017e7bbe159b6f860405160405180910390a250565b60006132406131a461324a565b8461323b85606960006131b561324a565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461408890919063ffffffff16565b613a0b565b6001905092915050565b600033905090565b60008073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415151561331e576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260228152602001807f526f6c65733a206163636f756e7420697320746865207a65726f20616464726581526020017f737300000000000000000000000000000000000000000000000000000000000081525060400191505060405180910390fd5b8260000160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16905092915050565b600060019054906101000a900460ff168061339457506133936129ea565b5b806133ab57506000809054906101000a900460ff16155b1515613445576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602e8152602001807f436f6e747261637420696e7374616e63652068617320616c726561647920626581526020017f656e20696e697469616c697a656400000000000000000000000000000000000081525060400191505060405180910390fd5b60008060019054906101000a900460ff161590508015613495576001600060016101000a81548160ff02191690831515021790555060016000806101000a81548160ff0219169083151502179055505b6134a08888886115eb565b6134aa8486614112565b6134b330612edf565b6134bc3061302d565b6134c5306127f7565b6134ce30613087565b60008090505b8351811015613508576134fd84828151811015156134ee57fe5b906020019060200201516130e2565b8060010190506134d4565b5060008090505b825181101561354357613538838281518110151561352957fe5b9060200190602002015161313c565b80600101905061350f565b5080156135655760008060016101000a81548160ff0219169083151502179055505b5050505050505050565b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415151561363a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260218152602001807f45524332303a206275726e2066726f6d20746865207a65726f2061646472657381526020017f730000000000000000000000000000000000000000000000000000000000000081525060400191505060405180910390fd5b61364f81606a546142d190919063ffffffff16565b606a819055506136a781606860008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546142d190919063ffffffff16565b606860008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a35050565b60006137fd61376161324a565b846137f8856069600061377261324a565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546142d190919063ffffffff16565b613a0b565b6001905092915050565b600061013560009054906101000a900460ff1615151561388f576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260108152602001807f5061757361626c653a207061757365640000000000000000000000000000000081525060200191505060405180910390fd5b613899838361435c565b905092915050565b600060019054906101000a900460ff16806138c057506138bf6129ea565b5b806138d757506000809054906101000a900460ff16155b1515613971576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602e8152602001807f436f6e747261637420696e7374616e63652068617320616c726561647920626581526020017f656e20696e697469616c697a656400000000000000000000000000000000000081525060400191505060405180910390fd5b60008060019054906101000a900460ff1615905080156139c1576001600060016101000a81548160ff02191690831515021790555060016000806101000a81548160ff0219169083151502179055505b6139ca8261437a565b600061013560006101000a81548160ff0219169083151502179055508015613a075760008060016101000a81548160ff0219169083151502179055505b5050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614151515613ad6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260248152602001807f45524332303a20617070726f76652066726f6d20746865207a65726f2061646481526020017f726573730000000000000000000000000000000000000000000000000000000081525060400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614151515613ba1576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260228152602001807f45524332303a20617070726f766520746f20746865207a65726f20616464726581526020017f737300000000000000000000000000000000000000000000000000000000000081525060400191505060405180910390fd5b80606960008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040518082815260200191505060405180910390a3505050565b6000613c998484846144d8565b613d4084613ca561324a565b613d3b85606960008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000613cf261324a565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546142d190919063ffffffff16565b613a0b565b600190509392505050565b600060019054906101000a900460ff1680613d6a5750613d696129ea565b5b80613d8157506000809054906101000a900460ff16155b1515613e1b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602e8152602001807f436f6e747261637420696e7374616e63652068617320616c726561647920626581526020017f656e20696e697469616c697a656400000000000000000000000000000000000081525060400191505060405180910390fd5b60008060019054906101000a900460ff161590508015613e6b576001600060016101000a81548160ff02191690831515021790555060016000806101000a81548160ff0219169083151502179055505b613e74826127bc565b1515613e8457613e83826130e2565b5b8015613ea55760008060016101000a81548160ff0219169083151502179055505b5050565b613eb38282613252565b1515613f4d576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260218152602001807f526f6c65733a206163636f756e7420646f6573206e6f74206861766520726f6c81526020017f650000000000000000000000000000000000000000000000000000000000000081525060400191505060405180910390fd5b60008260000160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055505050565b613fb58282613252565b15151561402a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601f8152602001807f526f6c65733a206163636f756e7420616c72656164792068617320726f6c650081525060200191505060405180910390fd5b60018260000160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055505050565b6000808284019050838110151515614108576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b8091505092915050565b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141515156141b7576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601f8152602001807f45524332303a206d696e7420746f20746865207a65726f20616464726573730081525060200191505060405180910390fd5b6141cc81606a5461408890919063ffffffff16565b606a8190555061422481606860008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461408890919063ffffffff16565b606860008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a35050565b600082821115151561434b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601e8152602001807f536166654d6174683a207375627472616374696f6e206f766572666c6f77000081525060200191505060405180910390fd5b600082840390508091505092915050565b600061437061436961324a565b84846144d8565b6001905092915050565b600060019054906101000a900460ff168061439957506143986129ea565b5b806143b057506000809054906101000a900460ff16155b151561444a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602e8152602001807f436f6e747261637420696e7374616e63652068617320616c726561647920626581526020017f656e20696e697469616c697a656400000000000000000000000000000000000081525060400191505060405180910390fd5b60008060019054906101000a900460ff16159050801561449a576001600060016101000a81548160ff02191690831515021790555060016000806101000a81548160ff0219169083151502179055505b6144a382611c91565b15156144b3576144b28261313c565b5b80156144d45760008060016101000a81548160ff0219169083151502179055505b5050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141515156145a3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260258152602001807f45524332303a207472616e736665722066726f6d20746865207a65726f20616481526020017f647265737300000000000000000000000000000000000000000000000000000081525060400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415151561466e576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260238152602001807f45524332303a207472616e7366657220746f20746865207a65726f206164647281526020017f657373000000000000000000000000000000000000000000000000000000000081525060400191505060405180910390fd5b6146c081606860008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546142d190919063ffffffff16565b606860008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061475581606860008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461408890919063ffffffff16565b606860008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a3505050565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f1061484357805160ff1916838001178555614871565b82800160010185558215614871579182015b82811115614870578251825591602001919060010190614855565b5b50905061487e91906148de565b5090565b604080519081016040528060008152602001600073ffffffffffffffffffffffffffffffffffffffff1681525090565b8154818355818111156148d9578183600052602060002091820191016148d891906148de565b5b505050565b61490091905b808211156148fc5760008160009055506001016148e4565b5090565b9056fea165627a7a72305820ea5df179b8f2b85891f1e316b610ba1466d1e11cf4b34c1531e2616cfbe0dba50029