Overview
ETH Balance
0 ETH
Eth Value
$0.00More Info
Private Name Tags
ContractCreator
Transaction Hash |
Method
|
Block
|
From
|
To
|
|||||
---|---|---|---|---|---|---|---|---|---|
Latest 1 internal transaction
Advanced mode:
Parent Transaction Hash | Block |
From
|
To
|
|||
---|---|---|---|---|---|---|
12841070 | 1311 days ago | Contract Creation | 0 ETH |
Loading...
Loading
Contract Source Code Verified (Exact Match)
Contract Name:
Ticket
Compiler Version
v0.6.12+commit.27d51765
Optimization Enabled:
Yes with 200 runs
Other Settings:
default evmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: GPL-3.0 pragma solidity 0.6.12; import "sortition-sum-tree-factory/contracts/SortitionSumTreeFactory.sol"; import "@pooltogether/uniform-random-number/contracts/UniformRandomNumber.sol"; import "./ControlledToken.sol"; import "./TicketInterface.sol"; contract Ticket is ControlledToken, TicketInterface { using SortitionSumTreeFactory for SortitionSumTreeFactory.SortitionSumTrees; bytes32 constant private TREE_KEY = keccak256("PoolTogether/Ticket"); uint256 constant private MAX_TREE_LEAVES = 5; /// @dev Emitted when an instance is initialized event Initialized( string _name, string _symbol, uint8 _decimals, TokenControllerInterface _controller ); // Ticket-weighted odds SortitionSumTreeFactory.SortitionSumTrees internal sortitionSumTrees; /// @notice Initializes the Controlled Token with Token Details and the Controller /// @param _name The name of the Token /// @param _symbol The symbol for the Token /// @param _decimals The number of decimals for the Token /// @param _controller Address of the Controller contract for minting & burning function initialize( string memory _name, string memory _symbol, uint8 _decimals, TokenControllerInterface _controller ) public virtual override initializer { require(address(_controller) != address(0), "Ticket/controller-not-zero"); ControlledToken.initialize(_name, _symbol, _decimals, _controller); sortitionSumTrees.createTree(TREE_KEY, MAX_TREE_LEAVES); emit Initialized( _name, _symbol, _decimals, _controller ); } /// @notice Returns the user's chance of winning. function chanceOf(address user) external view returns (uint256) { return sortitionSumTrees.stakeOf(TREE_KEY, bytes32(uint256(user))); } /// @notice Selects a user using a random number. The random number will be uniformly bounded to the ticket totalSupply. /// @param randomNumber The random number to use to select a user. /// @return The winner function draw(uint256 randomNumber) external view override returns (address) { uint256 bound = totalSupply(); address selected; if (bound == 0) { selected = address(0); } else { uint256 token = UniformRandomNumber.uniform(randomNumber, bound); selected = address(uint256(sortitionSumTrees.draw(TREE_KEY, token))); } return selected; } /// @dev Controller hook to provide notifications & rule validations on token transfers to the controller. /// This includes minting and burning. /// May be overridden to provide more granular control over operator-burning /// @param from Address of the account sending the tokens (address(0x0) on minting) /// @param to Address of the account receiving the tokens (address(0x0) on burning) /// @param amount Amount of tokens being transferred function _beforeTokenTransfer(address from, address to, uint256 amount) internal virtual override { super._beforeTokenTransfer(from, to, amount); // optimize: ignore transfers to self if (from == to) { return; } if (from != address(0)) { uint256 fromBalance = balanceOf(from).sub(amount); sortitionSumTrees.set(TREE_KEY, fromBalance, bytes32(uint256(from))); } if (to != address(0)) { uint256 toBalance = balanceOf(to).add(amount); sortitionSumTrees.set(TREE_KEY, toBalance, bytes32(uint256(to))); } } }
/** * @reviewers: [@clesaege, @unknownunknown1, @ferittuncer] * @auditors: [] * @bounties: [<14 days 10 ETH max payout>] * @deployments: [] */ pragma solidity ^0.6.0; /** * @title SortitionSumTreeFactory * @author Enrique Piqueras - <[email protected]> * @dev A factory of trees that keep track of staked values for sortition. */ library SortitionSumTreeFactory { /* Structs */ struct SortitionSumTree { uint K; // The maximum number of childs per node. // We use this to keep track of vacant positions in the tree after removing a leaf. This is for keeping the tree as balanced as possible without spending gas on moving nodes around. uint[] stack; uint[] nodes; // Two-way mapping of IDs to node indexes. Note that node index 0 is reserved for the root node, and means the ID does not have a node. mapping(bytes32 => uint) IDsToNodeIndexes; mapping(uint => bytes32) nodeIndexesToIDs; } /* Storage */ struct SortitionSumTrees { mapping(bytes32 => SortitionSumTree) sortitionSumTrees; } /* internal */ /** * @dev Create a sortition sum tree at the specified key. * @param _key The key of the new tree. * @param _K The number of children each node in the tree should have. */ function createTree(SortitionSumTrees storage self, bytes32 _key, uint _K) internal { SortitionSumTree storage tree = self.sortitionSumTrees[_key]; require(tree.K == 0, "Tree already exists."); require(_K > 1, "K must be greater than one."); tree.K = _K; tree.stack = new uint[](0); tree.nodes = new uint[](0); tree.nodes.push(0); } /** * @dev Set a value of a tree. * @param _key The key of the tree. * @param _value The new value. * @param _ID The ID of the value. * `O(log_k(n))` where * `k` is the maximum number of childs per node in the tree, * and `n` is the maximum number of nodes ever appended. */ function set(SortitionSumTrees storage self, bytes32 _key, uint _value, bytes32 _ID) internal { SortitionSumTree storage tree = self.sortitionSumTrees[_key]; uint treeIndex = tree.IDsToNodeIndexes[_ID]; if (treeIndex == 0) { // No existing node. if (_value != 0) { // Non zero value. // Append. // Add node. if (tree.stack.length == 0) { // No vacant spots. // Get the index and append the value. treeIndex = tree.nodes.length; tree.nodes.push(_value); // Potentially append a new node and make the parent a sum node. if (treeIndex != 1 && (treeIndex - 1) % tree.K == 0) { // Is first child. uint parentIndex = treeIndex / tree.K; bytes32 parentID = tree.nodeIndexesToIDs[parentIndex]; uint newIndex = treeIndex + 1; tree.nodes.push(tree.nodes[parentIndex]); delete tree.nodeIndexesToIDs[parentIndex]; tree.IDsToNodeIndexes[parentID] = newIndex; tree.nodeIndexesToIDs[newIndex] = parentID; } } else { // Some vacant spot. // Pop the stack and append the value. treeIndex = tree.stack[tree.stack.length - 1]; tree.stack.pop(); tree.nodes[treeIndex] = _value; } // Add label. tree.IDsToNodeIndexes[_ID] = treeIndex; tree.nodeIndexesToIDs[treeIndex] = _ID; updateParents(self, _key, treeIndex, true, _value); } } else { // Existing node. if (_value == 0) { // Zero value. // Remove. // Remember value and set to 0. uint value = tree.nodes[treeIndex]; tree.nodes[treeIndex] = 0; // Push to stack. tree.stack.push(treeIndex); // Clear label. delete tree.IDsToNodeIndexes[_ID]; delete tree.nodeIndexesToIDs[treeIndex]; updateParents(self, _key, treeIndex, false, value); } else if (_value != tree.nodes[treeIndex]) { // New, non zero value. // Set. bool plusOrMinus = tree.nodes[treeIndex] <= _value; uint plusOrMinusValue = plusOrMinus ? _value - tree.nodes[treeIndex] : tree.nodes[treeIndex] - _value; tree.nodes[treeIndex] = _value; updateParents(self, _key, treeIndex, plusOrMinus, plusOrMinusValue); } } } /* internal Views */ /** * @dev Query the leaves of a tree. Note that if `startIndex == 0`, the tree is empty and the root node will be returned. * @param _key The key of the tree to get the leaves from. * @param _cursor The pagination cursor. * @param _count The number of items to return. * @return startIndex The index at which leaves start * @return values The values of the returned leaves * @return hasMore Whether there are more for pagination. * `O(n)` where * `n` is the maximum number of nodes ever appended. */ function queryLeafs( SortitionSumTrees storage self, bytes32 _key, uint _cursor, uint _count ) internal view returns(uint startIndex, uint[] memory values, bool hasMore) { SortitionSumTree storage tree = self.sortitionSumTrees[_key]; // Find the start index. for (uint i = 0; i < tree.nodes.length; i++) { if ((tree.K * i) + 1 >= tree.nodes.length) { startIndex = i; break; } } // Get the values. uint loopStartIndex = startIndex + _cursor; values = new uint[](loopStartIndex + _count > tree.nodes.length ? tree.nodes.length - loopStartIndex : _count); uint valuesIndex = 0; for (uint j = loopStartIndex; j < tree.nodes.length; j++) { if (valuesIndex < _count) { values[valuesIndex] = tree.nodes[j]; valuesIndex++; } else { hasMore = true; break; } } } /** * @dev Draw an ID from a tree using a number. Note that this function reverts if the sum of all values in the tree is 0. * @param _key The key of the tree. * @param _drawnNumber The drawn number. * @return ID The drawn ID. * `O(k * log_k(n))` where * `k` is the maximum number of childs per node in the tree, * and `n` is the maximum number of nodes ever appended. */ function draw(SortitionSumTrees storage self, bytes32 _key, uint _drawnNumber) internal view returns(bytes32 ID) { SortitionSumTree storage tree = self.sortitionSumTrees[_key]; uint treeIndex = 0; uint currentDrawnNumber = _drawnNumber % tree.nodes[0]; while ((tree.K * treeIndex) + 1 < tree.nodes.length) // While it still has children. for (uint i = 1; i <= tree.K; i++) { // Loop over children. uint nodeIndex = (tree.K * treeIndex) + i; uint nodeValue = tree.nodes[nodeIndex]; if (currentDrawnNumber >= nodeValue) currentDrawnNumber -= nodeValue; // Go to the next child. else { // Pick this child. treeIndex = nodeIndex; break; } } ID = tree.nodeIndexesToIDs[treeIndex]; } /** @dev Gets a specified ID's associated value. * @param _key The key of the tree. * @param _ID The ID of the value. * @return value The associated value. */ function stakeOf(SortitionSumTrees storage self, bytes32 _key, bytes32 _ID) internal view returns(uint value) { SortitionSumTree storage tree = self.sortitionSumTrees[_key]; uint treeIndex = tree.IDsToNodeIndexes[_ID]; if (treeIndex == 0) value = 0; else value = tree.nodes[treeIndex]; } function total(SortitionSumTrees storage self, bytes32 _key) internal view returns (uint) { SortitionSumTree storage tree = self.sortitionSumTrees[_key]; if (tree.nodes.length == 0) { return 0; } else { return tree.nodes[0]; } } /* Private */ /** * @dev Update all the parents of a node. * @param _key The key of the tree to update. * @param _treeIndex The index of the node to start from. * @param _plusOrMinus Wether to add (true) or substract (false). * @param _value The value to add or substract. * `O(log_k(n))` where * `k` is the maximum number of childs per node in the tree, * and `n` is the maximum number of nodes ever appended. */ function updateParents(SortitionSumTrees storage self, bytes32 _key, uint _treeIndex, bool _plusOrMinus, uint _value) private { SortitionSumTree storage tree = self.sortitionSumTrees[_key]; uint parentIndex = _treeIndex; while (parentIndex != 0) { parentIndex = (parentIndex - 1) / tree.K; tree.nodes[parentIndex] = _plusOrMinus ? tree.nodes[parentIndex] + _value : tree.nodes[parentIndex] - _value; } } }
/** Copyright 2019 PoolTogether LLC This file is part of PoolTogether. PoolTogether is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation under version 3 of the License. PoolTogether is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with PoolTogether. If not, see <https://www.gnu.org/licenses/>. */ pragma solidity >=0.6.0 <0.8.0; /** * @author Brendan Asselstine * @notice A library that uses entropy to select a random number within a bound. Compensates for modulo bias. * @dev Thanks to https://medium.com/hownetworks/dont-waste-cycles-with-modulo-bias-35b6fdafcf94 */ library UniformRandomNumber { /// @notice Select a random number without modulo bias using a random seed and upper bound /// @param _entropy The seed for randomness /// @param _upperBound The upper bound of the desired number /// @return A random number less than the _upperBound function uniform(uint256 _entropy, uint256 _upperBound) internal pure returns (uint256) { require(_upperBound > 0, "UniformRand/min-bound"); uint256 min = -_upperBound % _upperBound; uint256 random = _entropy; while (true) { if (random >= min) { break; } random = uint256(keccak256(abi.encodePacked(random))); } return random % _upperBound; } }
// SPDX-License-Identifier: GPL-3.0 pragma solidity 0.6.12; import "@openzeppelin/contracts-upgradeable/drafts/ERC20PermitUpgradeable.sol"; import "./TokenControllerInterface.sol"; import "./ControlledTokenInterface.sol"; /// @title Controlled ERC20 Token /// @notice ERC20 Tokens with a controller for minting & burning contract ControlledToken is ERC20PermitUpgradeable, ControlledTokenInterface { /// @dev Emitted when an instance is initialized event Initialized( string _name, string _symbol, uint8 _decimals, TokenControllerInterface _controller ); /// @notice Interface to the contract responsible for controlling mint/burn TokenControllerInterface public override controller; /// @notice Initializes the Controlled Token with Token Details and the Controller /// @param _name The name of the Token /// @param _symbol The symbol for the Token /// @param _decimals The number of decimals for the Token /// @param _controller Address of the Controller contract for minting & burning function initialize( string memory _name, string memory _symbol, uint8 _decimals, TokenControllerInterface _controller ) public virtual initializer { require(address(_controller) != address(0), "ControlledToken/controller-not-zero"); __ERC20_init(_name, _symbol); __ERC20Permit_init("PoolTogether ControlledToken"); controller = _controller; _setupDecimals(_decimals); emit Initialized( _name, _symbol, _decimals, _controller ); } /// @notice Allows the controller to mint tokens for a user account /// @dev May be overridden to provide more granular control over minting /// @param _user Address of the receiver of the minted tokens /// @param _amount Amount of tokens to mint function controllerMint(address _user, uint256 _amount) external virtual override onlyController { _mint(_user, _amount); } /// @notice Allows the controller to burn tokens from a user account /// @dev May be overridden to provide more granular control over burning /// @param _user Address of the holder account to burn tokens from /// @param _amount Amount of tokens to burn function controllerBurn(address _user, uint256 _amount) external virtual override onlyController { _burn(_user, _amount); } /// @notice Allows an operator via the controller to burn tokens on behalf of a user account /// @dev May be overridden to provide more granular control over operator-burning /// @param _operator Address of the operator performing the burn action via the controller contract /// @param _user Address of the holder account to burn tokens from /// @param _amount Amount of tokens to burn function controllerBurnFrom(address _operator, address _user, uint256 _amount) external virtual override onlyController { if (_operator != _user) { uint256 decreasedAllowance = allowance(_user, _operator).sub(_amount, "ControlledToken/exceeds-allowance"); _approve(_user, _operator, decreasedAllowance); } _burn(_user, _amount); } /// @dev Function modifier to ensure that the caller is the controller contract modifier onlyController { require(_msgSender() == address(controller), "ControlledToken/only-controller"); _; } /// @dev Controller hook to provide notifications & rule validations on token transfers to the controller. /// This includes minting and burning. /// May be overridden to provide more granular control over operator-burning /// @param from Address of the account sending the tokens (address(0x0) on minting) /// @param to Address of the account receiving the tokens (address(0x0) on burning) /// @param amount Amount of tokens being transferred function _beforeTokenTransfer(address from, address to, uint256 amount) internal virtual override { controller.beforeTokenTransfer(from, to, amount); } }
// SPDX-License-Identifier: GPL-3.0 pragma solidity >=0.5.0 <0.7.0; /// @title Interface that allows a user to draw an address using an index interface TicketInterface { /// @notice Selects a user using a random number. The random number will be uniformly bounded to the ticket totalSupply. /// @param randomNumber The random number to use to select a user. /// @return The winner function draw(uint256 randomNumber) external view returns (address); }
// SPDX-License-Identifier: MIT pragma solidity >=0.6.5 <0.8.0; import "../token/ERC20/ERC20Upgradeable.sol"; import "./IERC20PermitUpgradeable.sol"; import "../cryptography/ECDSAUpgradeable.sol"; import "../utils/CountersUpgradeable.sol"; import "./EIP712Upgradeable.sol"; import "../proxy/Initializable.sol"; /** * @dev Implementation of the ERC20 Permit extension allowing approvals to be made via signatures, as defined in * https://eips.ethereum.org/EIPS/eip-2612[EIP-2612]. * * Adds the {permit} method, which can be used to change an account's ERC20 allowance (see {IERC20-allowance}) by * presenting a message signed by the account. By not relying on `{IERC20-approve}`, the token holder account doesn't * need to send a transaction, and thus is not required to hold Ether at all. * * _Available since v3.4._ */ abstract contract ERC20PermitUpgradeable is Initializable, ERC20Upgradeable, IERC20PermitUpgradeable, EIP712Upgradeable { using CountersUpgradeable for CountersUpgradeable.Counter; mapping (address => CountersUpgradeable.Counter) private _nonces; // solhint-disable-next-line var-name-mixedcase bytes32 private _PERMIT_TYPEHASH; /** * @dev Initializes the {EIP712} domain separator using the `name` parameter, and setting `version` to `"1"`. * * It's a good idea to use the same `name` that is defined as the ERC20 token name. */ function __ERC20Permit_init(string memory name) internal initializer { __Context_init_unchained(); __EIP712_init_unchained(name, "1"); __ERC20Permit_init_unchained(name); } function __ERC20Permit_init_unchained(string memory name) internal initializer { _PERMIT_TYPEHASH = keccak256("Permit(address owner,address spender,uint256 value,uint256 nonce,uint256 deadline)"); } /** * @dev See {IERC20Permit-permit}. */ function permit(address owner, address spender, uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s) public virtual override { // solhint-disable-next-line not-rely-on-time require(block.timestamp <= deadline, "ERC20Permit: expired deadline"); bytes32 structHash = keccak256( abi.encode( _PERMIT_TYPEHASH, owner, spender, value, _nonces[owner].current(), deadline ) ); bytes32 hash = _hashTypedDataV4(structHash); address signer = ECDSAUpgradeable.recover(hash, v, r, s); require(signer == owner, "ERC20Permit: invalid signature"); _nonces[owner].increment(); _approve(owner, spender, value); } /** * @dev See {IERC20Permit-nonces}. */ function nonces(address owner) public view override returns (uint256) { return _nonces[owner].current(); } /** * @dev See {IERC20Permit-DOMAIN_SEPARATOR}. */ // solhint-disable-next-line func-name-mixedcase function DOMAIN_SEPARATOR() external view override returns (bytes32) { return _domainSeparatorV4(); } uint256[49] private __gap; }
// SPDX-License-Identifier: GPL-3.0 pragma solidity >=0.5.0 <0.7.0; /// @title Controlled ERC20 Token Interface /// @notice Required interface for Controlled ERC20 Tokens linked to a Prize Pool /// @dev Defines the spec required to be implemented by a Controlled ERC20 Token interface TokenControllerInterface { /// @dev Controller hook to provide notifications & rule validations on token transfers to the controller. /// This includes minting and burning. /// @param from Address of the account sending the tokens (address(0x0) on minting) /// @param to Address of the account receiving the tokens (address(0x0) on burning) /// @param amount Amount of tokens being transferred function beforeTokenTransfer(address from, address to, uint256 amount) external; }
// SPDX-License-Identifier: GPL-3.0 pragma solidity 0.6.12; import "@openzeppelin/contracts-upgradeable/token/ERC20/IERC20Upgradeable.sol"; import "./TokenControllerInterface.sol"; /// @title Controlled ERC20 Token /// @notice ERC20 Tokens with a controller for minting & burning interface ControlledTokenInterface is IERC20Upgradeable { /// @notice Interface to the contract responsible for controlling mint/burn function controller() external view returns (TokenControllerInterface); /// @notice Allows the controller to mint tokens for a user account /// @dev May be overridden to provide more granular control over minting /// @param _user Address of the receiver of the minted tokens /// @param _amount Amount of tokens to mint function controllerMint(address _user, uint256 _amount) external; /// @notice Allows the controller to burn tokens from a user account /// @dev May be overridden to provide more granular control over burning /// @param _user Address of the holder account to burn tokens from /// @param _amount Amount of tokens to burn function controllerBurn(address _user, uint256 _amount) external; /// @notice Allows an operator via the controller to burn tokens on behalf of a user account /// @dev May be overridden to provide more granular control over operator-burning /// @param _operator Address of the operator performing the burn action via the controller contract /// @param _user Address of the holder account to burn tokens from /// @param _amount Amount of tokens to burn function controllerBurnFrom(address _operator, address _user, uint256 _amount) external; }
// SPDX-License-Identifier: MIT pragma solidity >=0.6.0 <0.8.0; import "../../utils/ContextUpgradeable.sol"; import "./IERC20Upgradeable.sol"; import "../../math/SafeMathUpgradeable.sol"; import "../../proxy/Initializable.sol"; /** * @dev Implementation of the {IERC20} interface. * * This implementation is agnostic to the way tokens are created. This means * that a supply mechanism has to be added in a derived contract using {_mint}. * For a generic mechanism see {ERC20PresetMinterPauser}. * * TIP: For a detailed writeup see our guide * https://forum.zeppelin.solutions/t/how-to-implement-erc20-supply-mechanisms/226[How * to implement supply mechanisms]. * * We have followed general OpenZeppelin 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 ERC20Upgradeable is Initializable, ContextUpgradeable, IERC20Upgradeable { using SafeMathUpgradeable for uint256; mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowances; uint256 private _totalSupply; string private _name; string private _symbol; uint8 private _decimals; /** * @dev Sets the values for {name} and {symbol}, initializes {decimals} with * a default value of 18. * * To select a different value for {decimals}, use {_setupDecimals}. * * All three of these values are immutable: they can only be set once during * construction. */ function __ERC20_init(string memory name_, string memory symbol_) internal initializer { __Context_init_unchained(); __ERC20_init_unchained(name_, symbol_); } function __ERC20_init_unchained(string memory name_, string memory symbol_) internal initializer { _name = name_; _symbol = symbol_; _decimals = 18; } /** * @dev Returns the name of the token. */ function name() public view virtual returns (string memory) { return _name; } /** * @dev Returns the symbol of the token, usually a shorter version of the * name. */ function symbol() public view virtual returns (string memory) { return _symbol; } /** * @dev Returns the number of decimals used to get its user representation. * For example, if `decimals` equals `2`, a balance of `505` tokens should * be displayed to a user as `5,05` (`505 / 10 ** 2`). * * Tokens usually opt for a value of 18, imitating the relationship between * Ether and Wei. This is the value {ERC20} uses, unless {_setupDecimals} is * called. * * NOTE: This information is only used for _display_ purposes: it in * no way affects any of the arithmetic of the contract, including * {IERC20-balanceOf} and {IERC20-transfer}. */ function decimals() public view virtual returns (uint8) { return _decimals; } /** * @dev See {IERC20-totalSupply}. */ function totalSupply() public view virtual override returns (uint256) { return _totalSupply; } /** * @dev See {IERC20-balanceOf}. */ function balanceOf(address account) public view virtual override returns (uint256) { return _balances[account]; } /** * @dev See {IERC20-transfer}. * * Requirements: * * - `recipient` cannot be the zero address. * - the caller must have a balance of at least `amount`. */ function transfer(address recipient, uint256 amount) public virtual override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } /** * @dev See {IERC20-allowance}. */ function allowance(address owner, address spender) public view virtual override returns (uint256) { return _allowances[owner][spender]; } /** * @dev See {IERC20-approve}. * * Requirements: * * - `spender` cannot be the zero address. */ function approve(address spender, uint256 amount) public virtual override returns (bool) { _approve(_msgSender(), spender, amount); return true; } /** * @dev See {IERC20-transferFrom}. * * Emits an {Approval} event indicating the updated allowance. This is not * required by the EIP. See the note at the beginning of {ERC20}. * * Requirements: * * - `sender` and `recipient` cannot be the zero address. * - `sender` must have a balance of at least `amount`. * - the caller must have allowance for ``sender``'s tokens of at least * `amount`. */ function transferFrom(address sender, address recipient, uint256 amount) public virtual override returns (bool) { _transfer(sender, recipient, amount); _approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance")); return true; } /** * @dev Atomically increases the allowance granted to `spender` by the caller. * * This is an alternative to {approve} that can be used as a mitigation for * problems described in {IERC20-approve}. * * Emits an {Approval} event indicating the updated allowance. * * Requirements: * * - `spender` cannot be the zero address. */ function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) { _approve(_msgSender(), spender, _allowances[_msgSender()][spender].add(addedValue)); return true; } /** * @dev Atomically decreases the allowance granted to `spender` by the caller. * * This is an alternative to {approve} that can be used as a mitigation for * problems described in {IERC20-approve}. * * Emits an {Approval} event indicating the updated allowance. * * Requirements: * * - `spender` cannot be the zero address. * - `spender` must have allowance for the caller of at least * `subtractedValue`. */ function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) { _approve(_msgSender(), spender, _allowances[_msgSender()][spender].sub(subtractedValue, "ERC20: decreased allowance below zero")); return true; } /** * @dev Moves tokens `amount` from `sender` to `recipient`. * * This is internal function is equivalent to {transfer}, and can be used to * e.g. implement automatic token fees, slashing mechanisms, etc. * * Emits a {Transfer} event. * * Requirements: * * - `sender` cannot be the zero address. * - `recipient` cannot be the zero address. * - `sender` must have a balance of at least `amount`. */ function _transfer(address sender, address recipient, uint256 amount) internal virtual { require(sender != address(0), "ERC20: transfer from the zero address"); require(recipient != address(0), "ERC20: transfer to the zero address"); _beforeTokenTransfer(sender, recipient, amount); _balances[sender] = _balances[sender].sub(amount, "ERC20: transfer amount exceeds balance"); _balances[recipient] = _balances[recipient].add(amount); emit Transfer(sender, recipient, amount); } /** @dev Creates `amount` tokens and assigns them to `account`, increasing * the total supply. * * Emits a {Transfer} event with `from` set to the zero address. * * Requirements: * * - `to` cannot be the zero address. */ function _mint(address account, uint256 amount) internal virtual { require(account != address(0), "ERC20: mint to the zero address"); _beforeTokenTransfer(address(0), account, amount); _totalSupply = _totalSupply.add(amount); _balances[account] = _balances[account].add(amount); emit Transfer(address(0), account, amount); } /** * @dev Destroys `amount` tokens from `account`, reducing the * total supply. * * Emits a {Transfer} event with `to` set to the zero address. * * Requirements: * * - `account` cannot be the zero address. * - `account` must have at least `amount` tokens. */ function _burn(address account, uint256 amount) internal virtual { require(account != address(0), "ERC20: burn from the zero address"); _beforeTokenTransfer(account, address(0), amount); _balances[account] = _balances[account].sub(amount, "ERC20: burn amount exceeds balance"); _totalSupply = _totalSupply.sub(amount); emit Transfer(account, address(0), amount); } /** * @dev Sets `amount` as the allowance of `spender` over the `owner` s tokens. * * This internal function is equivalent to `approve`, and can be used to * e.g. set automatic allowances for certain subsystems, etc. * * Emits an {Approval} event. * * Requirements: * * - `owner` cannot be the zero address. * - `spender` cannot be the zero address. */ function _approve(address owner, address spender, uint256 amount) internal virtual { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } /** * @dev Sets {decimals} to a value other than the default one of 18. * * WARNING: This function should only be called from the constructor. Most * applications that interact with token contracts will not expect * {decimals} to ever change, and may work incorrectly if it does. */ function _setupDecimals(uint8 decimals_) internal virtual { _decimals = decimals_; } /** * @dev Hook that is called before any transfer of tokens. This includes * minting and burning. * * Calling conditions: * * - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens * will be to transferred to `to`. * - when `from` is zero, `amount` tokens will be minted for `to`. * - when `to` is zero, `amount` of ``from``'s tokens will be burned. * - `from` and `to` are never both zero. * * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks]. */ function _beforeTokenTransfer(address from, address to, uint256 amount) internal virtual { } uint256[44] private __gap; }
// SPDX-License-Identifier: MIT pragma solidity >=0.6.0 <0.8.0; /** * @dev Interface of the ERC20 Permit extension allowing approvals to be made via signatures, as defined in * https://eips.ethereum.org/EIPS/eip-2612[EIP-2612]. * * Adds the {permit} method, which can be used to change an account's ERC20 allowance (see {IERC20-allowance}) by * presenting a message signed by the account. By not relying on `{IERC20-approve}`, the token holder account doesn't * need to send a transaction, and thus is not required to hold Ether at all. */ interface IERC20PermitUpgradeable { /** * @dev Sets `value` as the allowance of `spender` over `owner`'s tokens, * given `owner`'s signed approval. * * IMPORTANT: The same issues {IERC20-approve} has related to transaction * ordering also apply here. * * Emits an {Approval} event. * * Requirements: * * - `spender` cannot be the zero address. * - `deadline` must be a timestamp in the future. * - `v`, `r` and `s` must be a valid `secp256k1` signature from `owner` * over the EIP712-formatted function arguments. * - the signature must use ``owner``'s current nonce (see {nonces}). * * For more information on the signature format, see the * https://eips.ethereum.org/EIPS/eip-2612#specification[relevant EIP * section]. */ function permit(address owner, address spender, uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s) external; /** * @dev Returns the current nonce for `owner`. This value must be * included whenever a signature is generated for {permit}. * * Every successful call to {permit} increases ``owner``'s nonce by one. This * prevents a signature from being used multiple times. */ function nonces(address owner) external view returns (uint256); /** * @dev Returns the domain separator used in the encoding of the signature for `permit`, as defined by {EIP712}. */ // solhint-disable-next-line func-name-mixedcase function DOMAIN_SEPARATOR() external view returns (bytes32); }
// SPDX-License-Identifier: MIT pragma solidity >=0.6.0 <0.8.0; /** * @dev Elliptic Curve Digital Signature Algorithm (ECDSA) operations. * * These functions can be used to verify that a message was signed by the holder * of the private keys of a given address. */ library ECDSAUpgradeable { /** * @dev Returns the address that signed a hashed message (`hash`) with * `signature`. This address can then be used for verification purposes. * * The `ecrecover` EVM opcode allows for malleable (non-unique) signatures: * this function rejects them by requiring the `s` value to be in the lower * half order, and the `v` value to be either 27 or 28. * * IMPORTANT: `hash` _must_ be the result of a hash operation for the * verification to be secure: it is possible to craft signatures that * recover to arbitrary addresses for non-hashed data. A safe way to ensure * this is by receiving a hash of the original message (which may otherwise * be too long), and then calling {toEthSignedMessageHash} on it. */ function recover(bytes32 hash, bytes memory signature) internal pure returns (address) { // Check the signature length if (signature.length != 65) { revert("ECDSA: invalid signature length"); } // Divide the signature in r, s and v variables bytes32 r; bytes32 s; uint8 v; // ecrecover takes the signature parameters, and the only way to get them // currently is to use assembly. // solhint-disable-next-line no-inline-assembly assembly { r := mload(add(signature, 0x20)) s := mload(add(signature, 0x40)) v := byte(0, mload(add(signature, 0x60))) } return recover(hash, v, r, s); } /** * @dev Overload of {ECDSA-recover-bytes32-bytes-} that receives the `v`, * `r` and `s` signature fields separately. */ function recover(bytes32 hash, uint8 v, bytes32 r, bytes32 s) internal pure returns (address) { // EIP-2 still allows signature malleability for ecrecover(). Remove this possibility and make the signature // unique. Appendix F in the Ethereum Yellow paper (https://ethereum.github.io/yellowpaper/paper.pdf), defines // the valid range for s in (281): 0 < s < secp256k1n ÷ 2 + 1, and for v in (282): v ∈ {27, 28}. Most // signatures from current libraries generate a unique signature with an s-value in the lower half order. // // If your library generates malleable signatures, such as s-values in the upper range, calculate a new s-value // with 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEBAAEDCE6AF48A03BBFD25E8CD0364141 - s1 and flip v from 27 to 28 or // vice versa. If your library also generates signatures with 0/1 for v instead 27/28, add 27 to v to accept // these malleable signatures as well. require(uint256(s) <= 0x7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF5D576E7357A4501DDFE92F46681B20A0, "ECDSA: invalid signature 's' value"); require(v == 27 || v == 28, "ECDSA: invalid signature 'v' value"); // If the signature is valid (and not malleable), return the signer address address signer = ecrecover(hash, v, r, s); require(signer != address(0), "ECDSA: invalid signature"); return signer; } /** * @dev Returns an Ethereum Signed Message, created from a `hash`. This * replicates the behavior of the * https://github.com/ethereum/wiki/wiki/JSON-RPC#eth_sign[`eth_sign`] * JSON-RPC method. * * See {recover}. */ function toEthSignedMessageHash(bytes32 hash) internal pure returns (bytes32) { // 32 is the length in bytes of hash, // enforced by the type signature above return keccak256(abi.encodePacked("\x19Ethereum Signed Message:\n32", hash)); } }
// SPDX-License-Identifier: MIT pragma solidity >=0.6.0 <0.8.0; import "../math/SafeMathUpgradeable.sol"; /** * @title Counters * @author Matt Condon (@shrugs) * @dev Provides counters that can only be incremented or decremented by one. This can be used e.g. to track the number * of elements in a mapping, issuing ERC721 ids, or counting request ids. * * Include with `using Counters for Counters.Counter;` * Since it is not possible to overflow a 256 bit integer with increments of one, `increment` can skip the {SafeMath} * overflow check, thereby saving gas. This does assume however correct usage, in that the underlying `_value` is never * directly accessed. */ library CountersUpgradeable { using SafeMathUpgradeable for uint256; struct Counter { // This variable should never be directly accessed by users of the library: interactions must be restricted to // the library's function. As of Solidity v0.5.2, this cannot be enforced, though there is a proposal to add // this feature: see https://github.com/ethereum/solidity/issues/4637 uint256 _value; // default: 0 } function current(Counter storage counter) internal view returns (uint256) { return counter._value; } function increment(Counter storage counter) internal { // The {SafeMath} overflow check can be skipped here, see the comment at the top counter._value += 1; } function decrement(Counter storage counter) internal { counter._value = counter._value.sub(1); } }
// SPDX-License-Identifier: MIT pragma solidity >=0.6.0 <0.8.0; import "../proxy/Initializable.sol"; /** * @dev https://eips.ethereum.org/EIPS/eip-712[EIP 712] is a standard for hashing and signing of typed structured data. * * The encoding specified in the EIP is very generic, and such a generic implementation in Solidity is not feasible, * thus this contract does not implement the encoding itself. Protocols need to implement the type-specific encoding * they need in their contracts using a combination of `abi.encode` and `keccak256`. * * This contract implements the EIP 712 domain separator ({_domainSeparatorV4}) that is used as part of the encoding * scheme, and the final step of the encoding to obtain the message digest that is then signed via ECDSA * ({_hashTypedDataV4}). * * The implementation of the domain separator was designed to be as efficient as possible while still properly updating * the chain id to protect against replay attacks on an eventual fork of the chain. * * NOTE: This contract implements the version of the encoding known as "v4", as implemented by the JSON RPC method * https://docs.metamask.io/guide/signing-data.html[`eth_signTypedDataV4` in MetaMask]. * * _Available since v3.4._ */ abstract contract EIP712Upgradeable is Initializable { /* solhint-disable var-name-mixedcase */ bytes32 private _HASHED_NAME; bytes32 private _HASHED_VERSION; bytes32 private constant _TYPE_HASH = keccak256("EIP712Domain(string name,string version,uint256 chainId,address verifyingContract)"); /* solhint-enable var-name-mixedcase */ /** * @dev Initializes the domain separator and parameter caches. * * The meaning of `name` and `version` is specified in * https://eips.ethereum.org/EIPS/eip-712#definition-of-domainseparator[EIP 712]: * * - `name`: the user readable name of the signing domain, i.e. the name of the DApp or the protocol. * - `version`: the current major version of the signing domain. * * NOTE: These parameters cannot be changed except through a xref:learn::upgrading-smart-contracts.adoc[smart * contract upgrade]. */ function __EIP712_init(string memory name, string memory version) internal initializer { __EIP712_init_unchained(name, version); } function __EIP712_init_unchained(string memory name, string memory version) internal initializer { bytes32 hashedName = keccak256(bytes(name)); bytes32 hashedVersion = keccak256(bytes(version)); _HASHED_NAME = hashedName; _HASHED_VERSION = hashedVersion; } /** * @dev Returns the domain separator for the current chain. */ function _domainSeparatorV4() internal view returns (bytes32) { return _buildDomainSeparator(_TYPE_HASH, _EIP712NameHash(), _EIP712VersionHash()); } function _buildDomainSeparator(bytes32 typeHash, bytes32 name, bytes32 version) private view returns (bytes32) { return keccak256( abi.encode( typeHash, name, version, _getChainId(), address(this) ) ); } /** * @dev Given an already https://eips.ethereum.org/EIPS/eip-712#definition-of-hashstruct[hashed struct], this * function returns the hash of the fully encoded EIP712 message for this domain. * * This hash can be used together with {ECDSA-recover} to obtain the signer of a message. For example: * * ```solidity * bytes32 digest = _hashTypedDataV4(keccak256(abi.encode( * keccak256("Mail(address to,string contents)"), * mailTo, * keccak256(bytes(mailContents)) * ))); * address signer = ECDSA.recover(digest, signature); * ``` */ function _hashTypedDataV4(bytes32 structHash) internal view virtual returns (bytes32) { return keccak256(abi.encodePacked("\x19\x01", _domainSeparatorV4(), structHash)); } function _getChainId() private view returns (uint256 chainId) { this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691 // solhint-disable-next-line no-inline-assembly assembly { chainId := chainid() } } /** * @dev The hash of the name parameter for the EIP712 domain. * * NOTE: This function reads from storage by default, but can be redefined to return a constant value if gas costs * are a concern. */ function _EIP712NameHash() internal virtual view returns (bytes32) { return _HASHED_NAME; } /** * @dev The hash of the version parameter for the EIP712 domain. * * NOTE: This function reads from storage by default, but can be redefined to return a constant value if gas costs * are a concern. */ function _EIP712VersionHash() internal virtual view returns (bytes32) { return _HASHED_VERSION; } uint256[50] private __gap; }
// SPDX-License-Identifier: MIT // solhint-disable-next-line compiler-version pragma solidity >=0.4.24 <0.8.0; import "../utils/AddressUpgradeable.sol"; /** * @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed * behind a proxy. Since a proxied contract can't have a constructor, it's common to move constructor logic to an * external initializer function, usually called `initialize`. It then becomes necessary to protect this initializer * function so it can only be called once. The {initializer} modifier provided by this contract will have this effect. * * TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as * possible by providing the encoded function call as the `_data` argument to {UpgradeableProxy-constructor}. * * CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure * that all initializers are idempotent. This is not verified automatically as constructors are by Solidity. */ abstract 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 protect an initializer function from being invoked twice. */ modifier initializer() { require(_initializing || _isConstructor() || !_initialized, "Initializable: contract is already 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) { return !AddressUpgradeable.isContract(address(this)); } }
// SPDX-License-Identifier: MIT pragma solidity >=0.6.0 <0.8.0; import "../proxy/Initializable.sol"; /* * @dev Provides information about the current execution context, including the * sender of the transaction and its data. While these are generally available * via msg.sender and msg.data, they should not be accessed in such a direct * manner, since when dealing with GSN meta-transactions the account sending and * paying for execution may not be the actual sender (as far as an application * is concerned). * * This contract is only required for intermediate, library-like contracts. */ abstract contract ContextUpgradeable is Initializable { function __Context_init() internal initializer { __Context_init_unchained(); } function __Context_init_unchained() internal initializer { } function _msgSender() internal view virtual returns (address payable) { return msg.sender; } function _msgData() internal view virtual returns (bytes memory) { this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691 return msg.data; } uint256[50] private __gap; }
// SPDX-License-Identifier: MIT pragma solidity >=0.6.0 <0.8.0; /** * @dev Interface of the ERC20 standard as defined in the EIP. */ interface IERC20Upgradeable { /** * @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); }
// SPDX-License-Identifier: MIT pragma solidity >=0.6.0 <0.8.0; /** * @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 SafeMathUpgradeable { /** * @dev Returns the addition of two unsigned integers, with an overflow flag. * * _Available since v3.4._ */ function tryAdd(uint256 a, uint256 b) internal pure returns (bool, uint256) { uint256 c = a + b; if (c < a) return (false, 0); return (true, c); } /** * @dev Returns the substraction of two unsigned integers, with an overflow flag. * * _Available since v3.4._ */ function trySub(uint256 a, uint256 b) internal pure returns (bool, uint256) { if (b > a) return (false, 0); return (true, a - b); } /** * @dev Returns the multiplication of two unsigned integers, with an overflow flag. * * _Available since v3.4._ */ function tryMul(uint256 a, uint256 b) internal pure returns (bool, uint256) { // Gas optimization: this is cheaper than requiring 'a' not being zero, but the // benefit is lost if 'b' is also tested. // See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522 if (a == 0) return (true, 0); uint256 c = a * b; if (c / a != b) return (false, 0); return (true, c); } /** * @dev Returns the division of two unsigned integers, with a division by zero flag. * * _Available since v3.4._ */ function tryDiv(uint256 a, uint256 b) internal pure returns (bool, uint256) { if (b == 0) return (false, 0); return (true, a / b); } /** * @dev Returns the remainder of dividing two unsigned integers, with a division by zero flag. * * _Available since v3.4._ */ function tryMod(uint256 a, uint256 b) internal pure returns (bool, uint256) { if (b == 0) return (false, 0); return (true, a % b); } /** * @dev Returns the addition of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `+` operator. * * Requirements: * * - Addition cannot overflow. */ function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } /** * @dev Returns the subtraction of two unsigned integers, reverting on * overflow (when the result is negative). * * Counterpart to Solidity's `-` operator. * * Requirements: * * - Subtraction cannot overflow. */ function sub(uint256 a, uint256 b) internal pure returns (uint256) { require(b <= a, "SafeMath: subtraction overflow"); return a - b; } /** * @dev Returns the multiplication of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `*` operator. * * Requirements: * * - Multiplication cannot overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) return 0; uint256 c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } /** * @dev Returns the integer division of two unsigned integers, reverting on * division by zero. The result is rounded towards zero. * * Counterpart to Solidity's `/` operator. Note: this function uses a * `revert` opcode (which leaves remaining gas untouched) while Solidity * uses an invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function div(uint256 a, uint256 b) internal pure returns (uint256) { require(b > 0, "SafeMath: division by zero"); return a / b; } /** * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo), * reverting when dividing by zero. * * Counterpart to Solidity's `%` operator. This function uses a `revert` * opcode (which leaves remaining gas untouched) while Solidity uses an * invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function mod(uint256 a, uint256 b) internal pure returns (uint256) { require(b > 0, "SafeMath: modulo by zero"); return a % b; } /** * @dev Returns the subtraction of two unsigned integers, reverting with custom message on * overflow (when the result is negative). * * CAUTION: This function is deprecated because it requires allocating memory for the error * message unnecessarily. For custom revert reasons use {trySub}. * * Counterpart to Solidity's `-` operator. * * Requirements: * * - Subtraction cannot overflow. */ function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b <= a, errorMessage); return a - b; } /** * @dev Returns the integer division of two unsigned integers, reverting with custom message on * division by zero. The result is rounded towards zero. * * CAUTION: This function is deprecated because it requires allocating memory for the error * message unnecessarily. For custom revert reasons use {tryDiv}. * * Counterpart to Solidity's `/` operator. Note: this function uses a * `revert` opcode (which leaves remaining gas untouched) while Solidity * uses an invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b > 0, errorMessage); return a / b; } /** * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo), * reverting with custom message when dividing by zero. * * CAUTION: This function is deprecated because it requires allocating memory for the error * message unnecessarily. For custom revert reasons use {tryMod}. * * Counterpart to Solidity's `%` operator. This function uses a `revert` * opcode (which leaves remaining gas untouched) while Solidity uses an * invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b > 0, errorMessage); return a % b; } }
// SPDX-License-Identifier: MIT pragma solidity >=0.6.2 <0.8.0; /** * @dev Collection of functions related to the address type */ library AddressUpgradeable { /** * @dev Returns true if `account` is a contract. * * [IMPORTANT] * ==== * It is unsafe to assume that an address for which this function returns * false is an externally-owned account (EOA) and not a contract. * * Among others, `isContract` will return false for the following * types of addresses: * * - an externally-owned account * - a contract in construction * - an address where a contract will be created * - an address where a contract lived, but was destroyed * ==== */ function isContract(address account) internal view returns (bool) { // This method relies on extcodesize, which returns 0 for contracts in // construction, since the code is only stored at the end of the // constructor execution. uint256 size; // solhint-disable-next-line no-inline-assembly assembly { size := extcodesize(account) } return size > 0; } /** * @dev Replacement for Solidity's `transfer`: sends `amount` wei to * `recipient`, forwarding all available gas and reverting on errors. * * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost * of certain opcodes, possibly making contracts go over the 2300 gas limit * imposed by `transfer`, making them unable to receive funds via * `transfer`. {sendValue} removes this limitation. * * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more]. * * IMPORTANT: because control is transferred to `recipient`, care must be * taken to not create reentrancy vulnerabilities. Consider using * {ReentrancyGuard} or the * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern]. */ function sendValue(address payable recipient, uint256 amount) internal { require(address(this).balance >= amount, "Address: insufficient balance"); // solhint-disable-next-line avoid-low-level-calls, avoid-call-value (bool success, ) = recipient.call{ value: amount }(""); require(success, "Address: unable to send value, recipient may have reverted"); } /** * @dev Performs a Solidity function call using a low level `call`. A * plain`call` is an unsafe replacement for a function call: use this * function instead. * * If `target` reverts with a revert reason, it is bubbled up by this * function (like regular Solidity function calls). * * Returns the raw returned data. To convert to the expected return value, * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`]. * * Requirements: * * - `target` must be a contract. * - calling `target` with `data` must not revert. * * _Available since v3.1._ */ function functionCall(address target, bytes memory data) internal returns (bytes memory) { return functionCall(target, data, "Address: low-level call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with * `errorMessage` as a fallback revert reason when `target` reverts. * * _Available since v3.1._ */ function functionCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) { return functionCallWithValue(target, data, 0, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but also transferring `value` wei to `target`. * * Requirements: * * - the calling contract must have an ETH balance of at least `value`. * - the called Solidity function must be `payable`. * * _Available since v3.1._ */ function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) { return functionCallWithValue(target, data, value, "Address: low-level call with value failed"); } /** * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but * with `errorMessage` as a fallback revert reason when `target` reverts. * * _Available since v3.1._ */ function functionCallWithValue(address target, bytes memory data, uint256 value, string memory errorMessage) internal returns (bytes memory) { require(address(this).balance >= value, "Address: insufficient balance for call"); require(isContract(target), "Address: call to non-contract"); // solhint-disable-next-line avoid-low-level-calls (bool success, bytes memory returndata) = target.call{ value: value }(data); return _verifyCallResult(success, returndata, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but performing a static call. * * _Available since v3.3._ */ function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) { return functionStaticCall(target, data, "Address: low-level static call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`], * but performing a static call. * * _Available since v3.3._ */ function functionStaticCall(address target, bytes memory data, string memory errorMessage) internal view returns (bytes memory) { require(isContract(target), "Address: static call to non-contract"); // solhint-disable-next-line avoid-low-level-calls (bool success, bytes memory returndata) = target.staticcall(data); return _verifyCallResult(success, returndata, errorMessage); } function _verifyCallResult(bool success, bytes memory returndata, string memory errorMessage) private pure returns(bytes memory) { if (success) { return returndata; } else { // Look for revert reason and bubble it up if present if (returndata.length > 0) { // The easiest way to bubble the revert reason is using memory via assembly // solhint-disable-next-line no-inline-assembly assembly { let returndata_size := mload(returndata) revert(add(32, returndata), returndata_size) } } else { revert(errorMessage); } } } }
{ "optimizer": { "enabled": true, "runs": 200 }, "evmVersion": "istanbul", "outputSelection": { "*": { "*": [ "evm.bytecode", "evm.deployedBytecode", "abi" ] } }, "metadata": { "useLiteralContent": true }, "libraries": {} }
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
[{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"spender","type":"address"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"}],"name":"Approval","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"string","name":"_name","type":"string"},{"indexed":false,"internalType":"string","name":"_symbol","type":"string"},{"indexed":false,"internalType":"uint8","name":"_decimals","type":"uint8"},{"indexed":false,"internalType":"contract TokenControllerInterface","name":"_controller","type":"address"}],"name":"Initialized","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"}],"name":"Transfer","type":"event"},{"inputs":[],"name":"DOMAIN_SEPARATOR","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"spender","type":"address"}],"name":"allowance","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"approve","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"user","type":"address"}],"name":"chanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"controller","outputs":[{"internalType":"contract TokenControllerInterface","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_user","type":"address"},{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"controllerBurn","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_operator","type":"address"},{"internalType":"address","name":"_user","type":"address"},{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"controllerBurnFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_user","type":"address"},{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"controllerMint","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"decimals","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"subtractedValue","type":"uint256"}],"name":"decreaseAllowance","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"randomNumber","type":"uint256"}],"name":"draw","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"addedValue","type":"uint256"}],"name":"increaseAllowance","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"_name","type":"string"},{"internalType":"string","name":"_symbol","type":"string"},{"internalType":"uint8","name":"_decimals","type":"uint8"},{"internalType":"contract TokenControllerInterface","name":"_controller","type":"address"}],"name":"initialize","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"nonces","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"value","type":"uint256"},{"internalType":"uint256","name":"deadline","type":"uint256"},{"internalType":"uint8","name":"v","type":"uint8"},{"internalType":"bytes32","name":"r","type":"bytes32"},{"internalType":"bytes32","name":"s","type":"bytes32"}],"name":"permit","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"symbol","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"recipient","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"transfer","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"sender","type":"address"},{"internalType":"address","name":"recipient","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"transferFrom","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"}]
Contract Creation Code
608060405234801561001057600080fd5b506127b4806100206000396000f3fe608060405234801561001057600080fd5b50600436106101375760003560e01c806370a08231116100b8578063a457c2d71161007c578063a457c2d7146103de578063a9059cbb1461040a578063d505accf14610436578063dd62ed3e14610487578063de7ea79d146104b5578063f77c4791146105f357610137565b806370a08231146103385780637ecebe001461035e578063885d194d1461038457806390596dd1146103aa57806395d89b41146103d657610137565b80633644e515116100ff5780633644e51514610267578063395093511461026f5780633b3041471461029b5780635d7b0758146102d4578063631b5dfb1461030257610137565b806306fdde031461013c578063095ea7b3146101b957806318160ddd146101f957806323b872dd14610213578063313ce56714610249575b600080fd5b6101446105fb565b6040805160208082528351818301528351919283929083019185019080838360005b8381101561017e578181015183820152602001610166565b50505050905090810190601f1680156101ab5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6101e5600480360360408110156101cf57600080fd5b506001600160a01b038135169060200135610691565b604080519115158252519081900360200190f35b6102016106ae565b60408051918252519081900360200190f35b6101e56004803603606081101561022957600080fd5b506001600160a01b038135811691602081013590911690604001356106b4565b61025161073b565b6040805160ff9092168252519081900360200190f35b610201610744565b6101e56004803603604081101561028557600080fd5b506001600160a01b038135169060200135610753565b6102b8600480360360208110156102b157600080fd5b50356107a1565b604080516001600160a01b039092168252519081900360200190f35b610300600480360360408110156102ea57600080fd5b506001600160a01b0381351690602001356107f0565b005b6103006004803603606081101561031857600080fd5b506001600160a01b0381358116916020810135909116906040013561086d565b6102016004803603602081101561034e57600080fd5b50356001600160a01b0316610943565b6102016004803603602081101561037457600080fd5b50356001600160a01b031661095e565b6102016004803603602081101561039a57600080fd5b50356001600160a01b0316610985565b610300600480360360408110156103c057600080fd5b506001600160a01b0381351690602001356109aa565b610144610a23565b6101e5600480360360408110156103f457600080fd5b506001600160a01b038135169060200135610a84565b6101e56004803603604081101561042057600080fd5b506001600160a01b038135169060200135610aec565b610300600480360360e081101561044c57600080fd5b506001600160a01b03813581169160208101359091169060408101359060608101359060ff6080820135169060a08101359060c00135610b00565b6102016004803603604081101561049d57600080fd5b506001600160a01b0381358116916020013516610ca3565b610300600480360360808110156104cb57600080fd5b8101906020810181356401000000008111156104e657600080fd5b8201836020820111156104f857600080fd5b8035906020019184600183028401116401000000008311171561051a57600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250929594936020810193503591505064010000000081111561056d57600080fd5b82018360208201111561057f57600080fd5b803590602001918460018302840111640100000000831117156105a157600080fd5b91908080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152509295505050813560ff16925050602001356001600160a01b0316610cce565b6102b8610f12565b60368054604080516020601f60026000196101006001881615020190951694909404938401819004810282018101909252828152606093909290918301828280156106875780601f1061065c57610100808354040283529160200191610687565b820191906000526020600020905b81548152906001019060200180831161066a57829003601f168201915b5050505050905090565b60006106a561069e610f21565b8484610f25565b50600192915050565b60355490565b60006106c1848484611011565b610731846106cd610f21565b61072c85604051806060016040528060288152602001612684602891396001600160a01b038a1660009081526034602052604081209061070b610f21565b6001600160a01b03168152602081019190915260400160002054919061116e565b610f25565b5060019392505050565b60385460ff1690565b600061074e611205565b905090565b60006106a5610760610f21565b8461072c8560346000610771610f21565b6001600160a01b03908116825260208083019390935260409182016000908120918c168152925290205490611240565b6000806107ac6106ae565b90506000816107bd575060006107e9565b60006107c9858461129a565b90506107e560cd60008051602061266483398151915283611340565b9150505b9392505050565b60cc546001600160a01b0316610804610f21565b6001600160a01b03161461085f576040805162461bcd60e51b815260206004820152601f60248201527f436f6e74726f6c6c6564546f6b656e2f6f6e6c792d636f6e74726f6c6c657200604482015290519081900360640190fd5b6108698282611403565b5050565b60cc546001600160a01b0316610881610f21565b6001600160a01b0316146108dc576040805162461bcd60e51b815260206004820152601f60248201527f436f6e74726f6c6c6564546f6b656e2f6f6e6c792d636f6e74726f6c6c657200604482015290519081900360640190fd5b816001600160a01b0316836001600160a01b031614610934576000610925826040518060600160405280602181526020016126ac6021913961091e8688610ca3565b919061116e565b9050610932838583610f25565b505b61093e82826114f5565b505050565b6001600160a01b031660009081526033602052604090205490565b6001600160a01b038116600090815260996020526040812061097f906115f1565b92915050565b600061097f60cd6000805160206126648339815191526001600160a01b0385166115f5565b60cc546001600160a01b03166109be610f21565b6001600160a01b031614610a19576040805162461bcd60e51b815260206004820152601f60248201527f436f6e74726f6c6c6564546f6b656e2f6f6e6c792d636f6e74726f6c6c657200604482015290519081900360640190fd5b61086982826114f5565b60378054604080516020601f60026000196101006001881615020190951694909404938401819004810282018101909252828152606093909290918301828280156106875780601f1061065c57610100808354040283529160200191610687565b60006106a5610a91610f21565b8461072c8560405180606001604052806025815260200161275a6025913960346000610abb610f21565b6001600160a01b03908116825260208083019390935260409182016000908120918d1681529252902054919061116e565b60006106a5610af9610f21565b8484611011565b83421115610b55576040805162461bcd60e51b815260206004820152601d60248201527f45524332305065726d69743a206578706972656420646561646c696e65000000604482015290519081900360640190fd5b6000609a54888888610b8a609960008e6001600160a01b03166001600160a01b031681526020019081526020016000206115f1565b8960405160200180878152602001866001600160a01b03168152602001856001600160a01b0316815260200184815260200183815260200182815260200196505050505050506040516020818303038152906040528051906020012090506000610bf382611645565b90506000610c0382878787611691565b9050896001600160a01b0316816001600160a01b031614610c6b576040805162461bcd60e51b815260206004820152601e60248201527f45524332305065726d69743a20696e76616c6964207369676e61747572650000604482015290519081900360640190fd5b6001600160a01b038a166000908152609960205260409020610c8c9061180f565b610c978a8a8a610f25565b50505050505050505050565b6001600160a01b03918216600090815260346020908152604080832093909416825291909152205490565b600054610100900460ff1680610ce75750610ce7611818565b80610cf5575060005460ff16155b610d305760405162461bcd60e51b815260040180806020018281038252602e815260200180612614602e913960400191505060405180910390fd5b600054610100900460ff16158015610d5b576000805460ff1961ff0019909116610100171660011790555b6001600160a01b038216610db6576040805162461bcd60e51b815260206004820152601a60248201527f5469636b65742f636f6e74726f6c6c65722d6e6f742d7a65726f000000000000604482015290519081900360640190fd5b610dc285858585611829565b610ddd60cd6000805160206126648339815191526005611967565b7f41bc1176d7b9b7bc036f385a7e5b08b0662a7afa0844af8a599ad431150227e1858585856040518080602001806020018560ff168152602001846001600160a01b03168152602001838103835287818151815260200191508051906020019080838360005b83811015610e5b578181015183820152602001610e43565b50505050905090810190601f168015610e885780820380516001836020036101000a031916815260200191505b50838103825286518152865160209182019188019080838360005b83811015610ebb578181015183820152602001610ea3565b50505050905090810190601f168015610ee85780820380516001836020036101000a031916815260200191505b50965050505050505060405180910390a18015610f0b576000805461ff00191690555b5050505050565b60cc546001600160a01b031681565b3390565b6001600160a01b038316610f6a5760405162461bcd60e51b81526004018080602001828103825260248152602001806127136024913960400191505060405180910390fd5b6001600160a01b038216610faf5760405162461bcd60e51b81526004018080602001828103825260228152602001806125aa6022913960400191505060405180910390fd5b6001600160a01b03808416600081815260346020908152604080832094871680845294825291829020859055815185815291517f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259281900390910190a3505050565b6001600160a01b0383166110565760405162461bcd60e51b81526004018080602001828103825260258152602001806126ee6025913960400191505060405180910390fd5b6001600160a01b03821661109b5760405162461bcd60e51b81526004018080602001828103825260238152602001806125656023913960400191505060405180910390fd5b6110a6838383611a73565b6110e3816040518060600160405280602681526020016125cc602691396001600160a01b038616600090815260336020526040902054919061116e565b6001600160a01b0380851660009081526033602052604080822093909355908416815220546111129082611240565b6001600160a01b0380841660008181526033602090815260409182902094909455805185815290519193928716927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef92918290030190a3505050565b600081848411156111fd5760405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b838110156111c25781810151838201526020016111aa565b50505050905090810190601f1680156111ef5780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b505050900390565b600061074e7f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f611233611b39565b61123b611b3f565b611b45565b6000828201838110156107e9576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b60008082116112e8576040805162461bcd60e51b8152602060048201526015602482015274155b9a599bdc9b54985b990bdb5a5b8b589bdd5b99605a1b604482015290519081900360640190fd5b60008283600003816112f657fe5b069050835b8181106113075761132d565b6040805160208082019390935281518082038401815290820190915280519101206112fb565b83818161133657fe5b0695945050505050565b600082815260208490526040812060028101805483918291829061136057fe5b9060005260206000200154858161137357fe5b0690505b60028301548354830260010110156113e85760015b835481116113e2576000818486600001540201905060008560020182815481106113b257fe5b906000526020600020015490508084106113d05780840393506113d8565b5092506113e2565b505060010161138c565b50611377565b50600090815260049091016020526040902054949350505050565b6001600160a01b03821661145e576040805162461bcd60e51b815260206004820152601f60248201527f45524332303a206d696e7420746f20746865207a65726f206164647265737300604482015290519081900360640190fd5b61146a60008383611a73565b6035546114779082611240565b6035556001600160a01b03821660009081526033602052604090205461149d9082611240565b6001600160a01b03831660008181526033602090815260408083209490945583518581529351929391927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9281900390910190a35050565b6001600160a01b03821661153a5760405162461bcd60e51b81526004018080602001828103825260218152602001806126cd6021913960400191505060405180910390fd5b61154682600083611a73565b61158381604051806060016040528060228152602001612588602291396001600160a01b038516600090815260336020526040902054919061116e565b6001600160a01b0383166000908152603360205260409020556035546115a99082611ba7565b6035556040805182815290516000916001600160a01b038516917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9181900360200190a35050565b5490565b600082815260208481526040808320848452600381019092528220548061161f576000925061163c565b81600201818154811061162e57fe5b906000526020600020015492505b50509392505050565b600061164f611205565b82604051602001808061190160f01b81525060020183815260200182815260200192505050604051602081830303815290604052805190602001209050919050565b60007f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a08211156116f25760405162461bcd60e51b81526004018080602001828103825260228152602001806125f26022913960400191505060405180910390fd5b8360ff16601b148061170757508360ff16601c145b6117425760405162461bcd60e51b81526004018080602001828103825260228152602001806126426022913960400191505060405180910390fd5b600060018686868660405160008152602001604052604051808581526020018460ff1681526020018381526020018281526020019450505050506020604051602081039080840390855afa15801561179e573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b038116611806576040805162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e61747572650000000000000000604482015290519081900360640190fd5b95945050505050565b80546001019055565b600061182330611c04565b15905090565b600054610100900460ff16806118425750611842611818565b80611850575060005460ff16155b61188b5760405162461bcd60e51b815260040180806020018281038252602e815260200180612614602e913960400191505060405180910390fd5b600054610100900460ff161580156118b6576000805460ff1961ff0019909116610100171660011790555b6001600160a01b0382166118fb5760405162461bcd60e51b81526004018080602001828103825260238152602001806127376023913960400191505060405180910390fd5b6119058585611c0a565b6119436040518060400160405280601c81526020017f506f6f6c546f67657468657220436f6e74726f6c6c6564546f6b656e00000000815250611cbf565b60cc80546001600160a01b0319166001600160a01b038416179055610ddd83611d95565b60008281526020849052604090208054156119c0576040805162461bcd60e51b81526020600482015260146024820152732a3932b29030b63932b0b23c9032bc34b9ba399760611b604482015290519081900360640190fd5b60018211611a15576040805162461bcd60e51b815260206004820152601b60248201527f4b206d7573742062652067726561746572207468616e206f6e652e0000000000604482015290519081900360640190fd5b8181556040805160008152602081019182905251611a37916001840191612497565b506040805160008152602081019182905251611a57916002840191612497565b5060020180546001810182556000918252602082200155505050565b611a7e838383611dab565b816001600160a01b0316836001600160a01b03161415611a9d5761093e565b6001600160a01b03831615611ae9576000611ac182611abb86610943565b90611ba7565b9050611ae760cd600080516020612664833981519152836001600160a01b038816611e25565b505b6001600160a01b0382161561093e576000611b0d82611b0785610943565b90611240565b9050611b3360cd600080516020612664833981519152836001600160a01b038716611e25565b50505050565b60655490565b60665490565b6000838383611b52612109565b3060405160200180868152602001858152602001848152602001838152602001826001600160a01b03168152602001955050505050506040516020818303038152906040528051906020012090509392505050565b600082821115611bfe576040805162461bcd60e51b815260206004820152601e60248201527f536166654d6174683a207375627472616374696f6e206f766572666c6f770000604482015290519081900360640190fd5b50900390565b3b151590565b600054610100900460ff1680611c235750611c23611818565b80611c31575060005460ff16155b611c6c5760405162461bcd60e51b815260040180806020018281038252602e815260200180612614602e913960400191505060405180910390fd5b600054610100900460ff16158015611c97576000805460ff1961ff0019909116610100171660011790555b611c9f61210d565b611ca983836121af565b801561093e576000805461ff0019169055505050565b600054610100900460ff1680611cd85750611cd8611818565b80611ce6575060005460ff16155b611d215760405162461bcd60e51b815260040180806020018281038252602e815260200180612614602e913960400191505060405180910390fd5b600054610100900460ff16158015611d4c576000805460ff1961ff0019909116610100171660011790555b611d5461210d565b611d7782604051806040016040528060018152602001603160f81b815250612287565b611d8082612347565b8015610869576000805461ff00191690555050565b6038805460ff191660ff92909216919091179055565b60cc5460408051637cbab1c760e01b81526001600160a01b03868116600483015285811660248301526044820185905291519190921691637cbab1c791606480830192600092919082900301818387803b158015611e0857600080fd5b505af1158015611e1c573d6000803e3d6000fd5b50505050505050565b600083815260208581526040808320848452600381019092529091205480611fbc578315611fb7576001820154611f23575060028101805460018082018355600092835260209092208101859055908114801590611e8f57508154600019820181611e8c57fe5b06155b15611f1e5781546000908281611ea157fe5b0460008181526004850160205260409020546002850180549293509091600185019190819085908110611ed057fe5b60009182526020808320909101548354600181018555938352818320909301929092559384526004860180825260408086208690558486526003880183528086208490559285529052909120555b611f84565b6001820180546000198101908110611f3757fe5b9060005260206000200154905081600101805480611f5157fe5b6001900381819060005260206000200160009055905583826002018281548110611f7757fe5b6000918252602090912001555b60008381526003830160209081526040808320849055838352600485019091529020839055611fb786868360018861240d565b612101565b8361204d576000826002018281548110611fd257fe5b906000526020600020015490506000836002018381548110611ff057fe5b6000918252602080832090910192909255600180860180549182018155825282822001849055858152600385018252604080822082905584825260048601909252908120819055612047908890889085908561240d565b50612101565b81600201818154811061205c57fe5b906000526020600020015484146121015760008483600201838154811061207f57fe5b9060005260206000200154111590506000816120b657858460020184815481106120a557fe5b9060005260206000200154036120d3565b8360020183815481106120c557fe5b906000526020600020015486035b9050858460020184815481106120e557fe5b6000918252602090912001556120fe888885858561240d565b50505b505050505050565b4690565b600054610100900460ff16806121265750612126611818565b80612134575060005460ff16155b61216f5760405162461bcd60e51b815260040180806020018281038252602e815260200180612614602e913960400191505060405180910390fd5b600054610100900460ff1615801561219a576000805460ff1961ff0019909116610100171660011790555b80156121ac576000805461ff00191690555b50565b600054610100900460ff16806121c857506121c8611818565b806121d6575060005460ff16155b6122115760405162461bcd60e51b815260040180806020018281038252602e815260200180612614602e913960400191505060405180910390fd5b600054610100900460ff1615801561223c576000805460ff1961ff0019909116610100171660011790555b825161224f9060369060208601906124e2565b5081516122639060379060208501906124e2565b506038805460ff19166012179055801561093e576000805461ff0019169055505050565b600054610100900460ff16806122a057506122a0611818565b806122ae575060005460ff16155b6122e95760405162461bcd60e51b815260040180806020018281038252602e815260200180612614602e913960400191505060405180910390fd5b600054610100900460ff16158015612314576000805460ff1961ff0019909116610100171660011790555b8251602080850191909120835191840191909120606591909155606655801561093e576000805461ff0019169055505050565b600054610100900460ff16806123605750612360611818565b8061236e575060005460ff16155b6123a95760405162461bcd60e51b815260040180806020018281038252602e815260200180612614602e913960400191505060405180910390fd5b600054610100900460ff161580156123d4576000805460ff1961ff0019909116610100171660011790555b7f6e71edae12b1b97f4d1f60370fef10105fa2faae0126114a169c64845d6126c9609a558015610869576000805461ff00191690555050565b6000848152602086905260409020835b8015611e1c57815460001982018161243157fe5b0490508361245a578282600201828154811061244957fe5b906000526020600020015403612477565b8282600201828154811061246a57fe5b9060005260206000200154015b82600201828154811061248657fe5b60009182526020909120015561241d565b8280548282559060005260206000209081019282156124d2579160200282015b828111156124d25782518255916020019190600101906124b7565b506124de92915061254f565b5090565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f1061252357805160ff19168380011785556124d2565b828001600101855582156124d257918201828111156124d25782518255916020019190600101906124b7565b5b808211156124de576000815560010161255056fe45524332303a207472616e7366657220746f20746865207a65726f206164647265737345524332303a206275726e20616d6f756e7420657863656564732062616c616e636545524332303a20617070726f766520746f20746865207a65726f206164647265737345524332303a207472616e7366657220616d6f756e7420657863656564732062616c616e636545434453413a20696e76616c6964207369676e6174757265202773272076616c7565496e697469616c697a61626c653a20636f6e747261637420697320616c726561647920696e697469616c697a656445434453413a20696e76616c6964207369676e6174757265202776272076616c7565af45c4fb9ef70911e5444b8eedce607366e494224d52e6feab07fbd62a53b26f45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365436f6e74726f6c6c6564546f6b656e2f657863656564732d616c6c6f77616e636545524332303a206275726e2066726f6d20746865207a65726f206164647265737345524332303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f2061646472657373436f6e74726f6c6c6564546f6b656e2f636f6e74726f6c6c65722d6e6f742d7a65726f45524332303a2064656372656173656420616c6c6f77616e63652062656c6f77207a65726fa2646970667358221220249ea71f3d53c945962821ae2787942e0997b146abdb205938e3ea4d4543472864736f6c634300060c0033
Deployed Bytecode
0x608060405234801561001057600080fd5b50600436106101375760003560e01c806370a08231116100b8578063a457c2d71161007c578063a457c2d7146103de578063a9059cbb1461040a578063d505accf14610436578063dd62ed3e14610487578063de7ea79d146104b5578063f77c4791146105f357610137565b806370a08231146103385780637ecebe001461035e578063885d194d1461038457806390596dd1146103aa57806395d89b41146103d657610137565b80633644e515116100ff5780633644e51514610267578063395093511461026f5780633b3041471461029b5780635d7b0758146102d4578063631b5dfb1461030257610137565b806306fdde031461013c578063095ea7b3146101b957806318160ddd146101f957806323b872dd14610213578063313ce56714610249575b600080fd5b6101446105fb565b6040805160208082528351818301528351919283929083019185019080838360005b8381101561017e578181015183820152602001610166565b50505050905090810190601f1680156101ab5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6101e5600480360360408110156101cf57600080fd5b506001600160a01b038135169060200135610691565b604080519115158252519081900360200190f35b6102016106ae565b60408051918252519081900360200190f35b6101e56004803603606081101561022957600080fd5b506001600160a01b038135811691602081013590911690604001356106b4565b61025161073b565b6040805160ff9092168252519081900360200190f35b610201610744565b6101e56004803603604081101561028557600080fd5b506001600160a01b038135169060200135610753565b6102b8600480360360208110156102b157600080fd5b50356107a1565b604080516001600160a01b039092168252519081900360200190f35b610300600480360360408110156102ea57600080fd5b506001600160a01b0381351690602001356107f0565b005b6103006004803603606081101561031857600080fd5b506001600160a01b0381358116916020810135909116906040013561086d565b6102016004803603602081101561034e57600080fd5b50356001600160a01b0316610943565b6102016004803603602081101561037457600080fd5b50356001600160a01b031661095e565b6102016004803603602081101561039a57600080fd5b50356001600160a01b0316610985565b610300600480360360408110156103c057600080fd5b506001600160a01b0381351690602001356109aa565b610144610a23565b6101e5600480360360408110156103f457600080fd5b506001600160a01b038135169060200135610a84565b6101e56004803603604081101561042057600080fd5b506001600160a01b038135169060200135610aec565b610300600480360360e081101561044c57600080fd5b506001600160a01b03813581169160208101359091169060408101359060608101359060ff6080820135169060a08101359060c00135610b00565b6102016004803603604081101561049d57600080fd5b506001600160a01b0381358116916020013516610ca3565b610300600480360360808110156104cb57600080fd5b8101906020810181356401000000008111156104e657600080fd5b8201836020820111156104f857600080fd5b8035906020019184600183028401116401000000008311171561051a57600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250929594936020810193503591505064010000000081111561056d57600080fd5b82018360208201111561057f57600080fd5b803590602001918460018302840111640100000000831117156105a157600080fd5b91908080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152509295505050813560ff16925050602001356001600160a01b0316610cce565b6102b8610f12565b60368054604080516020601f60026000196101006001881615020190951694909404938401819004810282018101909252828152606093909290918301828280156106875780601f1061065c57610100808354040283529160200191610687565b820191906000526020600020905b81548152906001019060200180831161066a57829003601f168201915b5050505050905090565b60006106a561069e610f21565b8484610f25565b50600192915050565b60355490565b60006106c1848484611011565b610731846106cd610f21565b61072c85604051806060016040528060288152602001612684602891396001600160a01b038a1660009081526034602052604081209061070b610f21565b6001600160a01b03168152602081019190915260400160002054919061116e565b610f25565b5060019392505050565b60385460ff1690565b600061074e611205565b905090565b60006106a5610760610f21565b8461072c8560346000610771610f21565b6001600160a01b03908116825260208083019390935260409182016000908120918c168152925290205490611240565b6000806107ac6106ae565b90506000816107bd575060006107e9565b60006107c9858461129a565b90506107e560cd60008051602061266483398151915283611340565b9150505b9392505050565b60cc546001600160a01b0316610804610f21565b6001600160a01b03161461085f576040805162461bcd60e51b815260206004820152601f60248201527f436f6e74726f6c6c6564546f6b656e2f6f6e6c792d636f6e74726f6c6c657200604482015290519081900360640190fd5b6108698282611403565b5050565b60cc546001600160a01b0316610881610f21565b6001600160a01b0316146108dc576040805162461bcd60e51b815260206004820152601f60248201527f436f6e74726f6c6c6564546f6b656e2f6f6e6c792d636f6e74726f6c6c657200604482015290519081900360640190fd5b816001600160a01b0316836001600160a01b031614610934576000610925826040518060600160405280602181526020016126ac6021913961091e8688610ca3565b919061116e565b9050610932838583610f25565b505b61093e82826114f5565b505050565b6001600160a01b031660009081526033602052604090205490565b6001600160a01b038116600090815260996020526040812061097f906115f1565b92915050565b600061097f60cd6000805160206126648339815191526001600160a01b0385166115f5565b60cc546001600160a01b03166109be610f21565b6001600160a01b031614610a19576040805162461bcd60e51b815260206004820152601f60248201527f436f6e74726f6c6c6564546f6b656e2f6f6e6c792d636f6e74726f6c6c657200604482015290519081900360640190fd5b61086982826114f5565b60378054604080516020601f60026000196101006001881615020190951694909404938401819004810282018101909252828152606093909290918301828280156106875780601f1061065c57610100808354040283529160200191610687565b60006106a5610a91610f21565b8461072c8560405180606001604052806025815260200161275a6025913960346000610abb610f21565b6001600160a01b03908116825260208083019390935260409182016000908120918d1681529252902054919061116e565b60006106a5610af9610f21565b8484611011565b83421115610b55576040805162461bcd60e51b815260206004820152601d60248201527f45524332305065726d69743a206578706972656420646561646c696e65000000604482015290519081900360640190fd5b6000609a54888888610b8a609960008e6001600160a01b03166001600160a01b031681526020019081526020016000206115f1565b8960405160200180878152602001866001600160a01b03168152602001856001600160a01b0316815260200184815260200183815260200182815260200196505050505050506040516020818303038152906040528051906020012090506000610bf382611645565b90506000610c0382878787611691565b9050896001600160a01b0316816001600160a01b031614610c6b576040805162461bcd60e51b815260206004820152601e60248201527f45524332305065726d69743a20696e76616c6964207369676e61747572650000604482015290519081900360640190fd5b6001600160a01b038a166000908152609960205260409020610c8c9061180f565b610c978a8a8a610f25565b50505050505050505050565b6001600160a01b03918216600090815260346020908152604080832093909416825291909152205490565b600054610100900460ff1680610ce75750610ce7611818565b80610cf5575060005460ff16155b610d305760405162461bcd60e51b815260040180806020018281038252602e815260200180612614602e913960400191505060405180910390fd5b600054610100900460ff16158015610d5b576000805460ff1961ff0019909116610100171660011790555b6001600160a01b038216610db6576040805162461bcd60e51b815260206004820152601a60248201527f5469636b65742f636f6e74726f6c6c65722d6e6f742d7a65726f000000000000604482015290519081900360640190fd5b610dc285858585611829565b610ddd60cd6000805160206126648339815191526005611967565b7f41bc1176d7b9b7bc036f385a7e5b08b0662a7afa0844af8a599ad431150227e1858585856040518080602001806020018560ff168152602001846001600160a01b03168152602001838103835287818151815260200191508051906020019080838360005b83811015610e5b578181015183820152602001610e43565b50505050905090810190601f168015610e885780820380516001836020036101000a031916815260200191505b50838103825286518152865160209182019188019080838360005b83811015610ebb578181015183820152602001610ea3565b50505050905090810190601f168015610ee85780820380516001836020036101000a031916815260200191505b50965050505050505060405180910390a18015610f0b576000805461ff00191690555b5050505050565b60cc546001600160a01b031681565b3390565b6001600160a01b038316610f6a5760405162461bcd60e51b81526004018080602001828103825260248152602001806127136024913960400191505060405180910390fd5b6001600160a01b038216610faf5760405162461bcd60e51b81526004018080602001828103825260228152602001806125aa6022913960400191505060405180910390fd5b6001600160a01b03808416600081815260346020908152604080832094871680845294825291829020859055815185815291517f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259281900390910190a3505050565b6001600160a01b0383166110565760405162461bcd60e51b81526004018080602001828103825260258152602001806126ee6025913960400191505060405180910390fd5b6001600160a01b03821661109b5760405162461bcd60e51b81526004018080602001828103825260238152602001806125656023913960400191505060405180910390fd5b6110a6838383611a73565b6110e3816040518060600160405280602681526020016125cc602691396001600160a01b038616600090815260336020526040902054919061116e565b6001600160a01b0380851660009081526033602052604080822093909355908416815220546111129082611240565b6001600160a01b0380841660008181526033602090815260409182902094909455805185815290519193928716927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef92918290030190a3505050565b600081848411156111fd5760405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b838110156111c25781810151838201526020016111aa565b50505050905090810190601f1680156111ef5780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b505050900390565b600061074e7f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f611233611b39565b61123b611b3f565b611b45565b6000828201838110156107e9576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b60008082116112e8576040805162461bcd60e51b8152602060048201526015602482015274155b9a599bdc9b54985b990bdb5a5b8b589bdd5b99605a1b604482015290519081900360640190fd5b60008283600003816112f657fe5b069050835b8181106113075761132d565b6040805160208082019390935281518082038401815290820190915280519101206112fb565b83818161133657fe5b0695945050505050565b600082815260208490526040812060028101805483918291829061136057fe5b9060005260206000200154858161137357fe5b0690505b60028301548354830260010110156113e85760015b835481116113e2576000818486600001540201905060008560020182815481106113b257fe5b906000526020600020015490508084106113d05780840393506113d8565b5092506113e2565b505060010161138c565b50611377565b50600090815260049091016020526040902054949350505050565b6001600160a01b03821661145e576040805162461bcd60e51b815260206004820152601f60248201527f45524332303a206d696e7420746f20746865207a65726f206164647265737300604482015290519081900360640190fd5b61146a60008383611a73565b6035546114779082611240565b6035556001600160a01b03821660009081526033602052604090205461149d9082611240565b6001600160a01b03831660008181526033602090815260408083209490945583518581529351929391927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9281900390910190a35050565b6001600160a01b03821661153a5760405162461bcd60e51b81526004018080602001828103825260218152602001806126cd6021913960400191505060405180910390fd5b61154682600083611a73565b61158381604051806060016040528060228152602001612588602291396001600160a01b038516600090815260336020526040902054919061116e565b6001600160a01b0383166000908152603360205260409020556035546115a99082611ba7565b6035556040805182815290516000916001600160a01b038516917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9181900360200190a35050565b5490565b600082815260208481526040808320848452600381019092528220548061161f576000925061163c565b81600201818154811061162e57fe5b906000526020600020015492505b50509392505050565b600061164f611205565b82604051602001808061190160f01b81525060020183815260200182815260200192505050604051602081830303815290604052805190602001209050919050565b60007f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a08211156116f25760405162461bcd60e51b81526004018080602001828103825260228152602001806125f26022913960400191505060405180910390fd5b8360ff16601b148061170757508360ff16601c145b6117425760405162461bcd60e51b81526004018080602001828103825260228152602001806126426022913960400191505060405180910390fd5b600060018686868660405160008152602001604052604051808581526020018460ff1681526020018381526020018281526020019450505050506020604051602081039080840390855afa15801561179e573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b038116611806576040805162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e61747572650000000000000000604482015290519081900360640190fd5b95945050505050565b80546001019055565b600061182330611c04565b15905090565b600054610100900460ff16806118425750611842611818565b80611850575060005460ff16155b61188b5760405162461bcd60e51b815260040180806020018281038252602e815260200180612614602e913960400191505060405180910390fd5b600054610100900460ff161580156118b6576000805460ff1961ff0019909116610100171660011790555b6001600160a01b0382166118fb5760405162461bcd60e51b81526004018080602001828103825260238152602001806127376023913960400191505060405180910390fd5b6119058585611c0a565b6119436040518060400160405280601c81526020017f506f6f6c546f67657468657220436f6e74726f6c6c6564546f6b656e00000000815250611cbf565b60cc80546001600160a01b0319166001600160a01b038416179055610ddd83611d95565b60008281526020849052604090208054156119c0576040805162461bcd60e51b81526020600482015260146024820152732a3932b29030b63932b0b23c9032bc34b9ba399760611b604482015290519081900360640190fd5b60018211611a15576040805162461bcd60e51b815260206004820152601b60248201527f4b206d7573742062652067726561746572207468616e206f6e652e0000000000604482015290519081900360640190fd5b8181556040805160008152602081019182905251611a37916001840191612497565b506040805160008152602081019182905251611a57916002840191612497565b5060020180546001810182556000918252602082200155505050565b611a7e838383611dab565b816001600160a01b0316836001600160a01b03161415611a9d5761093e565b6001600160a01b03831615611ae9576000611ac182611abb86610943565b90611ba7565b9050611ae760cd600080516020612664833981519152836001600160a01b038816611e25565b505b6001600160a01b0382161561093e576000611b0d82611b0785610943565b90611240565b9050611b3360cd600080516020612664833981519152836001600160a01b038716611e25565b50505050565b60655490565b60665490565b6000838383611b52612109565b3060405160200180868152602001858152602001848152602001838152602001826001600160a01b03168152602001955050505050506040516020818303038152906040528051906020012090509392505050565b600082821115611bfe576040805162461bcd60e51b815260206004820152601e60248201527f536166654d6174683a207375627472616374696f6e206f766572666c6f770000604482015290519081900360640190fd5b50900390565b3b151590565b600054610100900460ff1680611c235750611c23611818565b80611c31575060005460ff16155b611c6c5760405162461bcd60e51b815260040180806020018281038252602e815260200180612614602e913960400191505060405180910390fd5b600054610100900460ff16158015611c97576000805460ff1961ff0019909116610100171660011790555b611c9f61210d565b611ca983836121af565b801561093e576000805461ff0019169055505050565b600054610100900460ff1680611cd85750611cd8611818565b80611ce6575060005460ff16155b611d215760405162461bcd60e51b815260040180806020018281038252602e815260200180612614602e913960400191505060405180910390fd5b600054610100900460ff16158015611d4c576000805460ff1961ff0019909116610100171660011790555b611d5461210d565b611d7782604051806040016040528060018152602001603160f81b815250612287565b611d8082612347565b8015610869576000805461ff00191690555050565b6038805460ff191660ff92909216919091179055565b60cc5460408051637cbab1c760e01b81526001600160a01b03868116600483015285811660248301526044820185905291519190921691637cbab1c791606480830192600092919082900301818387803b158015611e0857600080fd5b505af1158015611e1c573d6000803e3d6000fd5b50505050505050565b600083815260208581526040808320848452600381019092529091205480611fbc578315611fb7576001820154611f23575060028101805460018082018355600092835260209092208101859055908114801590611e8f57508154600019820181611e8c57fe5b06155b15611f1e5781546000908281611ea157fe5b0460008181526004850160205260409020546002850180549293509091600185019190819085908110611ed057fe5b60009182526020808320909101548354600181018555938352818320909301929092559384526004860180825260408086208690558486526003880183528086208490559285529052909120555b611f84565b6001820180546000198101908110611f3757fe5b9060005260206000200154905081600101805480611f5157fe5b6001900381819060005260206000200160009055905583826002018281548110611f7757fe5b6000918252602090912001555b60008381526003830160209081526040808320849055838352600485019091529020839055611fb786868360018861240d565b612101565b8361204d576000826002018281548110611fd257fe5b906000526020600020015490506000836002018381548110611ff057fe5b6000918252602080832090910192909255600180860180549182018155825282822001849055858152600385018252604080822082905584825260048601909252908120819055612047908890889085908561240d565b50612101565b81600201818154811061205c57fe5b906000526020600020015484146121015760008483600201838154811061207f57fe5b9060005260206000200154111590506000816120b657858460020184815481106120a557fe5b9060005260206000200154036120d3565b8360020183815481106120c557fe5b906000526020600020015486035b9050858460020184815481106120e557fe5b6000918252602090912001556120fe888885858561240d565b50505b505050505050565b4690565b600054610100900460ff16806121265750612126611818565b80612134575060005460ff16155b61216f5760405162461bcd60e51b815260040180806020018281038252602e815260200180612614602e913960400191505060405180910390fd5b600054610100900460ff1615801561219a576000805460ff1961ff0019909116610100171660011790555b80156121ac576000805461ff00191690555b50565b600054610100900460ff16806121c857506121c8611818565b806121d6575060005460ff16155b6122115760405162461bcd60e51b815260040180806020018281038252602e815260200180612614602e913960400191505060405180910390fd5b600054610100900460ff1615801561223c576000805460ff1961ff0019909116610100171660011790555b825161224f9060369060208601906124e2565b5081516122639060379060208501906124e2565b506038805460ff19166012179055801561093e576000805461ff0019169055505050565b600054610100900460ff16806122a057506122a0611818565b806122ae575060005460ff16155b6122e95760405162461bcd60e51b815260040180806020018281038252602e815260200180612614602e913960400191505060405180910390fd5b600054610100900460ff16158015612314576000805460ff1961ff0019909116610100171660011790555b8251602080850191909120835191840191909120606591909155606655801561093e576000805461ff0019169055505050565b600054610100900460ff16806123605750612360611818565b8061236e575060005460ff16155b6123a95760405162461bcd60e51b815260040180806020018281038252602e815260200180612614602e913960400191505060405180910390fd5b600054610100900460ff161580156123d4576000805460ff1961ff0019909116610100171660011790555b7f6e71edae12b1b97f4d1f60370fef10105fa2faae0126114a169c64845d6126c9609a558015610869576000805461ff00191690555050565b6000848152602086905260409020835b8015611e1c57815460001982018161243157fe5b0490508361245a578282600201828154811061244957fe5b906000526020600020015403612477565b8282600201828154811061246a57fe5b9060005260206000200154015b82600201828154811061248657fe5b60009182526020909120015561241d565b8280548282559060005260206000209081019282156124d2579160200282015b828111156124d25782518255916020019190600101906124b7565b506124de92915061254f565b5090565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f1061252357805160ff19168380011785556124d2565b828001600101855582156124d257918201828111156124d25782518255916020019190600101906124b7565b5b808211156124de576000815560010161255056fe45524332303a207472616e7366657220746f20746865207a65726f206164647265737345524332303a206275726e20616d6f756e7420657863656564732062616c616e636545524332303a20617070726f766520746f20746865207a65726f206164647265737345524332303a207472616e7366657220616d6f756e7420657863656564732062616c616e636545434453413a20696e76616c6964207369676e6174757265202773272076616c7565496e697469616c697a61626c653a20636f6e747261637420697320616c726561647920696e697469616c697a656445434453413a20696e76616c6964207369676e6174757265202776272076616c7565af45c4fb9ef70911e5444b8eedce607366e494224d52e6feab07fbd62a53b26f45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365436f6e74726f6c6c6564546f6b656e2f657863656564732d616c6c6f77616e636545524332303a206275726e2066726f6d20746865207a65726f206164647265737345524332303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f2061646472657373436f6e74726f6c6c6564546f6b656e2f636f6e74726f6c6c65722d6e6f742d7a65726f45524332303a2064656372656173656420616c6c6f77616e63652062656c6f77207a65726fa2646970667358221220249ea71f3d53c945962821ae2787942e0997b146abdb205938e3ea4d4543472864736f6c634300060c0033
Loading...
Loading
Loading...
Loading
Multichain Portfolio | 31 Chains
Chain | Token | Portfolio % | Price | Amount | Value |
---|
Loading...
Loading
[ Download: CSV Export ]
A contract address hosts a smart contract, which is a set of code stored on the blockchain that runs when predetermined conditions are met. Learn more about addresses in our Knowledge Base.