Feature Tip: Add private address tag to any address under My Name Tag !
Overview
ETH Balance
0 ETH
Eth Value
$0.00More Info
Private Name Tags
ContractCreator
View more zero value Internal Transactions in Advanced View mode
Advanced mode:
Loading...
Loading
Contract Source Code Verified (Exact Match)
Contract Name:
StakedEthToken
Compiler Version
v0.7.5+commit.eb77ed08
Optimization Enabled:
Yes with 1000000 runs
Other Settings:
default evmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: AGPL-3.0-only pragma solidity 0.7.5; import "@openzeppelin/contracts-upgradeable/math/SafeMathUpgradeable.sol"; import "../presets/OwnablePausableUpgradeable.sol"; import "../interfaces/IStakedEthToken.sol"; import "../interfaces/IRewardEthToken.sol"; import "./ERC20PermitUpgradeable.sol"; /** * @title StakedEthToken * * @dev StakedEthToken contract stores pool staked tokens. */ contract StakedEthToken is IStakedEthToken, OwnablePausableUpgradeable, ERC20PermitUpgradeable { using SafeMathUpgradeable for uint256; // @dev Total amount of deposits. uint256 public override totalDeposits; // @dev Maps account address to its deposit amount. mapping(address => uint256) private deposits; // @dev Address of the Pool contract. address private pool; // @dev Address of the RewardEthToken contract. IRewardEthToken private rewardEthToken; // @dev The principal amount of the distributor. uint256 public override distributorPrincipal; /** * @dev See {IERC20-totalSupply}. */ function totalSupply() public view override returns (uint256) { return totalDeposits; } /** * @dev See {IERC20-balanceOf}. */ function balanceOf(address account) external view override returns (uint256) { return deposits[account]; } /** * @dev See {IStakedEthToken-toggleRewards}. */ function toggleRewards(address account, bool isDisabled) external override onlyAdmin { require(account != address(0), "StakedEthToken: invalid account"); // toggle rewards rewardEthToken.setRewardsDisabled(account, isDisabled); // update distributor principal uint256 accountBalance = deposits[account]; if (isDisabled) { distributorPrincipal = distributorPrincipal.add(accountBalance); } else { distributorPrincipal = distributorPrincipal.sub(accountBalance); } } /** * @dev See {ERC20-_transfer}. */ function _transfer(address sender, address recipient, uint256 amount) internal override whenNotPaused { require(sender != address(0), "StakedEthToken: invalid sender"); require(recipient != address(0), "StakedEthToken: invalid receiver"); require(block.number > rewardEthToken.lastUpdateBlockNumber(), "StakedEthToken: cannot transfer during rewards update"); // start calculating sender and recipient rewards with updated deposit amounts (bool senderRewardsDisabled, bool recipientRewardsDisabled) = rewardEthToken.updateRewardCheckpoints(sender, recipient); if ((senderRewardsDisabled || recipientRewardsDisabled) && !(senderRewardsDisabled && recipientRewardsDisabled)) { // update merkle distributor principal if any of the addresses has disabled rewards uint256 _distributorPrincipal = distributorPrincipal; // gas savings if (senderRewardsDisabled) { _distributorPrincipal = _distributorPrincipal.sub(amount); } else { _distributorPrincipal = _distributorPrincipal.add(amount); } distributorPrincipal = _distributorPrincipal; } deposits[sender] = deposits[sender].sub(amount); deposits[recipient] = deposits[recipient].add(amount); emit Transfer(sender, recipient, amount); } /** * @dev See {IStakedEthToken-mint}. */ function mint(address account, uint256 amount) external override { require(msg.sender == pool, "StakedEthToken: access denied"); // start calculating account rewards with updated deposit amount bool rewardsDisabled = rewardEthToken.updateRewardCheckpoint(account); if (rewardsDisabled) { // update merkle distributor principal if account has disabled rewards distributorPrincipal = distributorPrincipal.add(amount); } totalDeposits = totalDeposits.add(amount); deposits[account] = deposits[account].add(amount); emit Transfer(address(0), account, amount); } }
// 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: AGPL-3.0-only pragma solidity 0.7.5; import "@openzeppelin/contracts-upgradeable/access/AccessControlUpgradeable.sol"; import "@openzeppelin/contracts-upgradeable/utils/PausableUpgradeable.sol"; import "../interfaces/IOwnablePausable.sol"; /** * @title OwnablePausableUpgradeable * * @dev Bundles Access Control, Pausable and Upgradeable contracts in one. * */ abstract contract OwnablePausableUpgradeable is IOwnablePausable, PausableUpgradeable, AccessControlUpgradeable { bytes32 public constant PAUSER_ROLE = keccak256("PAUSER_ROLE"); /** * @dev Modifier for checking whether the caller is an admin. */ modifier onlyAdmin() { require(hasRole(DEFAULT_ADMIN_ROLE, msg.sender), "OwnablePausable: access denied"); _; } /** * @dev Modifier for checking whether the caller is a pauser. */ modifier onlyPauser() { require(hasRole(PAUSER_ROLE, msg.sender), "OwnablePausable: access denied"); _; } // solhint-disable-next-line func-name-mixedcase function __OwnablePausableUpgradeable_init(address _admin) internal initializer { __Context_init_unchained(); __AccessControl_init_unchained(); __Pausable_init_unchained(); __OwnablePausableUpgradeable_init_unchained(_admin); } /** * @dev Grants `DEFAULT_ADMIN_ROLE`, `PAUSER_ROLE` to the admin account. */ // solhint-disable-next-line func-name-mixedcase function __OwnablePausableUpgradeable_init_unchained(address _admin) internal initializer { _setupRole(DEFAULT_ADMIN_ROLE, _admin); _setupRole(PAUSER_ROLE, _admin); } /** * @dev See {IOwnablePausable-isAdmin}. */ function isAdmin(address _account) external override view returns (bool) { return hasRole(DEFAULT_ADMIN_ROLE, _account); } /** * @dev See {IOwnablePausable-addAdmin}. */ function addAdmin(address _account) external override { grantRole(DEFAULT_ADMIN_ROLE, _account); } /** * @dev See {IOwnablePausable-removeAdmin}. */ function removeAdmin(address _account) external override { revokeRole(DEFAULT_ADMIN_ROLE, _account); } /** * @dev See {IOwnablePausable-isPauser}. */ function isPauser(address _account) external override view returns (bool) { return hasRole(PAUSER_ROLE, _account); } /** * @dev See {IOwnablePausable-addPauser}. */ function addPauser(address _account) external override { grantRole(PAUSER_ROLE, _account); } /** * @dev See {IOwnablePausable-removePauser}. */ function removePauser(address _account) external override { revokeRole(PAUSER_ROLE, _account); } /** * @dev See {IOwnablePausable-pause}. */ function pause() external override onlyPauser { _pause(); } /** * @dev See {IOwnablePausable-unpause}. */ function unpause() external override onlyPauser { _unpause(); } }
// SPDX-License-Identifier: AGPL-3.0-only pragma solidity 0.7.5; import "@openzeppelin/contracts-upgradeable/token/ERC20/IERC20Upgradeable.sol"; /** * @dev Interface of the StakedEthToken contract. */ interface IStakedEthToken is IERC20Upgradeable { /** * @dev Function for retrieving the total deposits amount. */ function totalDeposits() external view returns (uint256); /** * @dev Function for retrieving the principal amount of the distributor. */ function distributorPrincipal() external view returns (uint256); /** * @dev Function for toggling rewards for the account. * @param account - address of the account. * @param isDisabled - whether to disable account's rewards distribution. */ function toggleRewards(address account, bool isDisabled) external; /** * @dev Function for creating `amount` tokens and assigning them to `account`. * Can only be called by Pool contract. * @param account - address of the account to assign tokens to. * @param amount - amount of tokens to assign. */ function mint(address account, uint256 amount) external; }
// SPDX-License-Identifier: AGPL-3.0-only pragma solidity 0.7.5; import "@openzeppelin/contracts-upgradeable/token/ERC20/IERC20Upgradeable.sol"; /** * @dev Interface of the RewardEthToken contract. */ interface IRewardEthToken is IERC20Upgradeable { /** * @dev Event for tracking updated maintainer. * @param maintainer - address of the new maintainer, where the fee will be paid. */ event MaintainerUpdated(address maintainer); /** * @dev Event for tracking updated maintainer fee. * @param maintainerFee - new maintainer fee. */ event MaintainerFeeUpdated(uint256 maintainerFee); /** * @dev Event for tracking whether rewards distribution through merkle distributor is enabled/disabled. * @param account - address of the account. * @param isDisabled - whether rewards distribution is disabled. */ event RewardsToggled(address indexed account, bool isDisabled); /** * @dev Structure for storing information about user reward checkpoint. * @param rewardPerToken - user reward per token. * @param reward - user reward checkpoint. */ struct Checkpoint { uint128 reward; uint128 rewardPerToken; } /** * @dev Event for tracking rewards update by oracles. * @param periodRewards - rewards since the last update. * @param totalRewards - total amount of rewards. * @param rewardPerToken - calculated reward per token for account reward calculation. */ event RewardsUpdated( uint256 periodRewards, uint256 totalRewards, uint256 rewardPerToken ); /** * @dev Function for upgrading the RewardEthToken contract. * If deploying contract for the first time, the upgrade function should be replaced with `initialize` and * contain initializations from the previous versions. * @param _merkleDistributor - address of the MerkleDistributor contract. * @param _lastUpdateBlockNumber - block number of the last rewards update. */ function upgrade(address _merkleDistributor, uint256 _lastUpdateBlockNumber) external; /** * @dev Function for getting the address of the merkle distributor. */ function merkleDistributor() external view returns (address); /** * @dev Function for getting the address of the maintainer, where the fee will be paid. */ function maintainer() external view returns (address); /** * @dev Function for changing the maintainer's address. * @param _newMaintainer - new maintainer's address. */ function setMaintainer(address _newMaintainer) external; /** * @dev Function for getting maintainer fee. The percentage fee users pay from their reward for using the pool service. */ function maintainerFee() external view returns (uint256); /** * @dev Function for changing the maintainer's fee. * @param _newMaintainerFee - new maintainer's fee. Must be less than 10000 (100.00%). */ function setMaintainerFee(uint256 _newMaintainerFee) external; /** * @dev Function for retrieving the total rewards amount. */ function totalRewards() external view returns (uint128); /** * @dev Function for retrieving the last total rewards update block number. */ function lastUpdateBlockNumber() external view returns (uint256); /** * @dev Function for retrieving current reward per token used for account reward calculation. */ function rewardPerToken() external view returns (uint128); /** * @dev Function for setting whether rewards are disabled for the account. * Can only be called by the `StakedEthToken` contract. * @param account - address of the account to disable rewards for. * @param isDisabled - whether the rewards will be disabled. */ function setRewardsDisabled(address account, bool isDisabled) external; /** * @dev Function for retrieving account's current checkpoint. * @param account - address of the account to retrieve the checkpoint for. */ function checkpoints(address account) external view returns (uint128, uint128); /** * @dev Function for checking whether account's reward will be distributed through the merkle distributor. * @param account - address of the account. */ function rewardsDisabled(address account) external view returns (bool); /** * @dev Function for updating account's reward checkpoint. * @param account - address of the account to update the reward checkpoint for. */ function updateRewardCheckpoint(address account) external returns (bool); /** * @dev Function for updating reward checkpoints for two accounts simultaneously (for gas savings). * @param account1 - address of the first account to update the reward checkpoint for. * @param account2 - address of the second account to update the reward checkpoint for. */ function updateRewardCheckpoints(address account1, address account2) external returns (bool, bool); /** * @dev Function for updating validators total rewards. * Can only be called by Oracles contract. * @param newTotalRewards - new total rewards. */ function updateTotalRewards(uint256 newTotalRewards) external; /** * @dev Function for claiming rETH2 from the merkle distribution. * Can only be called by MerkleDistributor contract. * @param account - address of the account the tokens will be assigned to. * @param amount - amount of tokens to assign to the account. */ function claim(address account, uint256 amount) external; }
// SPDX-License-Identifier: MIT // Adopted from https://github.com/OpenZeppelin/openzeppelin-contracts-upgradeable/blob/v3.4.0/contracts/drafts/ERC20PermitUpgradeable.sol pragma solidity 0.7.5; import "@openzeppelin/contracts-upgradeable/proxy/Initializable.sol"; import "@openzeppelin/contracts-upgradeable/utils/CountersUpgradeable.sol"; import "@openzeppelin/contracts-upgradeable/drafts/IERC20PermitUpgradeable.sol"; import "@openzeppelin/contracts-upgradeable/drafts/EIP712Upgradeable.sol"; import "@openzeppelin/contracts-upgradeable/cryptography/ECDSAUpgradeable.sol"; import "./ERC20Upgradeable.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. */ // solhint-disable-next-line func-name-mixedcase function __ERC20Permit_init(string memory name) internal initializer { __EIP712_init_unchained(name, "1"); __ERC20Permit_init_unchained(); } // solhint-disable-next-line func-name-mixedcase function __ERC20Permit_init_unchained() 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: MIT pragma solidity >=0.6.0 <0.8.0; import "../utils/EnumerableSetUpgradeable.sol"; import "../utils/AddressUpgradeable.sol"; import "../utils/ContextUpgradeable.sol"; import "../proxy/Initializable.sol"; /** * @dev Contract module that allows children to implement role-based access * control mechanisms. * * Roles are referred to by their `bytes32` identifier. These should be exposed * in the external API and be unique. The best way to achieve this is by * using `public constant` hash digests: * * ``` * bytes32 public constant MY_ROLE = keccak256("MY_ROLE"); * ``` * * Roles can be used to represent a set of permissions. To restrict access to a * function call, use {hasRole}: * * ``` * function foo() public { * require(hasRole(MY_ROLE, msg.sender)); * ... * } * ``` * * Roles can be granted and revoked dynamically via the {grantRole} and * {revokeRole} functions. Each role has an associated admin role, and only * accounts that have a role's admin role can call {grantRole} and {revokeRole}. * * By default, the admin role for all roles is `DEFAULT_ADMIN_ROLE`, which means * that only accounts with this role will be able to grant or revoke other * roles. More complex role relationships can be created by using * {_setRoleAdmin}. * * WARNING: The `DEFAULT_ADMIN_ROLE` is also its own admin: it has permission to * grant and revoke this role. Extra precautions should be taken to secure * accounts that have been granted it. */ abstract contract AccessControlUpgradeable is Initializable, ContextUpgradeable { function __AccessControl_init() internal initializer { __Context_init_unchained(); __AccessControl_init_unchained(); } function __AccessControl_init_unchained() internal initializer { } using EnumerableSetUpgradeable for EnumerableSetUpgradeable.AddressSet; using AddressUpgradeable for address; struct RoleData { EnumerableSetUpgradeable.AddressSet members; bytes32 adminRole; } mapping (bytes32 => RoleData) private _roles; bytes32 public constant DEFAULT_ADMIN_ROLE = 0x00; /** * @dev Emitted when `newAdminRole` is set as ``role``'s admin role, replacing `previousAdminRole` * * `DEFAULT_ADMIN_ROLE` is the starting admin for all roles, despite * {RoleAdminChanged} not being emitted signaling this. * * _Available since v3.1._ */ event RoleAdminChanged(bytes32 indexed role, bytes32 indexed previousAdminRole, bytes32 indexed newAdminRole); /** * @dev Emitted when `account` is granted `role`. * * `sender` is the account that originated the contract call, an admin role * bearer except when using {_setupRole}. */ event RoleGranted(bytes32 indexed role, address indexed account, address indexed sender); /** * @dev Emitted when `account` is revoked `role`. * * `sender` is the account that originated the contract call: * - if using `revokeRole`, it is the admin role bearer * - if using `renounceRole`, it is the role bearer (i.e. `account`) */ event RoleRevoked(bytes32 indexed role, address indexed account, address indexed sender); /** * @dev Returns `true` if `account` has been granted `role`. */ function hasRole(bytes32 role, address account) public view returns (bool) { return _roles[role].members.contains(account); } /** * @dev Returns the number of accounts that have `role`. Can be used * together with {getRoleMember} to enumerate all bearers of a role. */ function getRoleMemberCount(bytes32 role) public view returns (uint256) { return _roles[role].members.length(); } /** * @dev Returns one of the accounts that have `role`. `index` must be a * value between 0 and {getRoleMemberCount}, non-inclusive. * * Role bearers are not sorted in any particular way, and their ordering may * change at any point. * * WARNING: When using {getRoleMember} and {getRoleMemberCount}, make sure * you perform all queries on the same block. See the following * https://forum.openzeppelin.com/t/iterating-over-elements-on-enumerableset-in-openzeppelin-contracts/2296[forum post] * for more information. */ function getRoleMember(bytes32 role, uint256 index) public view returns (address) { return _roles[role].members.at(index); } /** * @dev Returns the admin role that controls `role`. See {grantRole} and * {revokeRole}. * * To change a role's admin, use {_setRoleAdmin}. */ function getRoleAdmin(bytes32 role) public view returns (bytes32) { return _roles[role].adminRole; } /** * @dev Grants `role` to `account`. * * If `account` had not been already granted `role`, emits a {RoleGranted} * event. * * Requirements: * * - the caller must have ``role``'s admin role. */ function grantRole(bytes32 role, address account) public virtual { require(hasRole(_roles[role].adminRole, _msgSender()), "AccessControl: sender must be an admin to grant"); _grantRole(role, account); } /** * @dev Revokes `role` from `account`. * * If `account` had been granted `role`, emits a {RoleRevoked} event. * * Requirements: * * - the caller must have ``role``'s admin role. */ function revokeRole(bytes32 role, address account) public virtual { require(hasRole(_roles[role].adminRole, _msgSender()), "AccessControl: sender must be an admin to revoke"); _revokeRole(role, account); } /** * @dev Revokes `role` from the calling account. * * Roles are often managed via {grantRole} and {revokeRole}: this function's * purpose is to provide a mechanism for accounts to lose their privileges * if they are compromised (such as when a trusted device is misplaced). * * If the calling account had been granted `role`, emits a {RoleRevoked} * event. * * Requirements: * * - the caller must be `account`. */ function renounceRole(bytes32 role, address account) public virtual { require(account == _msgSender(), "AccessControl: can only renounce roles for self"); _revokeRole(role, account); } /** * @dev Grants `role` to `account`. * * If `account` had not been already granted `role`, emits a {RoleGranted} * event. Note that unlike {grantRole}, this function doesn't perform any * checks on the calling account. * * [WARNING] * ==== * This function should only be called from the constructor when setting * up the initial roles for the system. * * Using this function in any other way is effectively circumventing the admin * system imposed by {AccessControl}. * ==== */ function _setupRole(bytes32 role, address account) internal virtual { _grantRole(role, account); } /** * @dev Sets `adminRole` as ``role``'s admin role. * * Emits a {RoleAdminChanged} event. */ function _setRoleAdmin(bytes32 role, bytes32 adminRole) internal virtual { emit RoleAdminChanged(role, _roles[role].adminRole, adminRole); _roles[role].adminRole = adminRole; } function _grantRole(bytes32 role, address account) private { if (_roles[role].members.add(account)) { emit RoleGranted(role, account, _msgSender()); } } function _revokeRole(bytes32 role, address account) private { if (_roles[role].members.remove(account)) { emit RoleRevoked(role, account, _msgSender()); } } uint256[49] private __gap; }
// SPDX-License-Identifier: MIT pragma solidity >=0.6.0 <0.8.0; import "./ContextUpgradeable.sol"; import "../proxy/Initializable.sol"; /** * @dev Contract module which allows children to implement an emergency stop * mechanism that can be triggered by an authorized account. * * This module is used through inheritance. It will make available the * modifiers `whenNotPaused` and `whenPaused`, which can be applied to * the functions of your contract. Note that they will not be pausable by * simply including this module, only once the modifiers are put in place. */ abstract contract PausableUpgradeable is Initializable, ContextUpgradeable { /** * @dev Emitted when the pause is triggered by `account`. */ event Paused(address account); /** * @dev Emitted when the pause is lifted by `account`. */ event Unpaused(address account); bool private _paused; /** * @dev Initializes the contract in unpaused state. */ function __Pausable_init() internal initializer { __Context_init_unchained(); __Pausable_init_unchained(); } function __Pausable_init_unchained() internal initializer { _paused = false; } /** * @dev Returns true if the contract is paused, and false otherwise. */ function paused() public view virtual returns (bool) { return _paused; } /** * @dev Modifier to make a function callable only when the contract is not paused. * * Requirements: * * - The contract must not be paused. */ modifier whenNotPaused() { require(!paused(), "Pausable: paused"); _; } /** * @dev Modifier to make a function callable only when the contract is paused. * * Requirements: * * - The contract must be paused. */ modifier whenPaused() { require(paused(), "Pausable: not paused"); _; } /** * @dev Triggers stopped state. * * Requirements: * * - The contract must not be paused. */ function _pause() internal virtual whenNotPaused { _paused = true; emit Paused(_msgSender()); } /** * @dev Returns to normal state. * * Requirements: * * - The contract must be paused. */ function _unpause() internal virtual whenPaused { _paused = false; emit Unpaused(_msgSender()); } uint256[49] private __gap; }
// SPDX-License-Identifier: AGPL-3.0-only pragma solidity 0.7.5; /** * @dev Interface of the OwnablePausableUpgradeable and OwnablePausable contracts. */ interface IOwnablePausable { /** * @dev Function for checking whether an account has an admin role. * @param _account - account to check. */ function isAdmin(address _account) external view returns (bool); /** * @dev Function for assigning an admin role to the account. * Can only be called by an account with an admin role. * @param _account - account to assign an admin role to. */ function addAdmin(address _account) external; /** * @dev Function for removing an admin role from the account. * Can only be called by an account with an admin role. * @param _account - account to remove an admin role from. */ function removeAdmin(address _account) external; /** * @dev Function for checking whether an account has a pauser role. * @param _account - account to check. */ function isPauser(address _account) external view returns (bool); /** * @dev Function for adding a pauser role to the account. * Can only be called by an account with an admin role. * @param _account - account to assign a pauser role to. */ function addPauser(address _account) external; /** * @dev Function for removing a pauser role from the account. * Can only be called by an account with an admin role. * @param _account - account to remove a pauser role from. */ function removePauser(address _account) external; /** * @dev Function for pausing the contract. */ function pause() external; /** * @dev Function for unpausing the contract. */ function unpause() external; }
// SPDX-License-Identifier: MIT pragma solidity >=0.6.0 <0.8.0; /** * @dev Library for managing * https://en.wikipedia.org/wiki/Set_(abstract_data_type)[sets] of primitive * types. * * Sets have the following properties: * * - Elements are added, removed, and checked for existence in constant time * (O(1)). * - Elements are enumerated in O(n). No guarantees are made on the ordering. * * ``` * contract Example { * // Add the library methods * using EnumerableSet for EnumerableSet.AddressSet; * * // Declare a set state variable * EnumerableSet.AddressSet private mySet; * } * ``` * * As of v3.3.0, sets of type `bytes32` (`Bytes32Set`), `address` (`AddressSet`) * and `uint256` (`UintSet`) are supported. */ library EnumerableSetUpgradeable { // To implement this library for multiple types with as little code // repetition as possible, we write it in terms of a generic Set type with // bytes32 values. // The Set implementation uses private functions, and user-facing // implementations (such as AddressSet) are just wrappers around the // underlying Set. // This means that we can only create new EnumerableSets for types that fit // in bytes32. struct Set { // Storage of set values bytes32[] _values; // Position of the value in the `values` array, plus 1 because index 0 // means a value is not in the set. mapping (bytes32 => uint256) _indexes; } /** * @dev Add a value to a set. O(1). * * Returns true if the value was added to the set, that is if it was not * already present. */ function _add(Set storage set, bytes32 value) private returns (bool) { if (!_contains(set, value)) { set._values.push(value); // The value is stored at length-1, but we add 1 to all indexes // and use 0 as a sentinel value set._indexes[value] = set._values.length; return true; } else { return false; } } /** * @dev Removes a value from a set. O(1). * * Returns true if the value was removed from the set, that is if it was * present. */ function _remove(Set storage set, bytes32 value) private returns (bool) { // We read and store the value's index to prevent multiple reads from the same storage slot uint256 valueIndex = set._indexes[value]; if (valueIndex != 0) { // Equivalent to contains(set, value) // To delete an element from the _values array in O(1), we swap the element to delete with the last one in // the array, and then remove the last element (sometimes called as 'swap and pop'). // This modifies the order of the array, as noted in {at}. uint256 toDeleteIndex = valueIndex - 1; uint256 lastIndex = set._values.length - 1; // When the value to delete is the last one, the swap operation is unnecessary. However, since this occurs // so rarely, we still do the swap anyway to avoid the gas cost of adding an 'if' statement. bytes32 lastvalue = set._values[lastIndex]; // Move the last value to the index where the value to delete is set._values[toDeleteIndex] = lastvalue; // Update the index for the moved value set._indexes[lastvalue] = toDeleteIndex + 1; // All indexes are 1-based // Delete the slot where the moved value was stored set._values.pop(); // Delete the index for the deleted slot delete set._indexes[value]; return true; } else { return false; } } /** * @dev Returns true if the value is in the set. O(1). */ function _contains(Set storage set, bytes32 value) private view returns (bool) { return set._indexes[value] != 0; } /** * @dev Returns the number of values on the set. O(1). */ function _length(Set storage set) private view returns (uint256) { return set._values.length; } /** * @dev Returns the value stored at position `index` in the set. O(1). * * Note that there are no guarantees on the ordering of values inside the * array, and it may change when more values are added or removed. * * Requirements: * * - `index` must be strictly less than {length}. */ function _at(Set storage set, uint256 index) private view returns (bytes32) { require(set._values.length > index, "EnumerableSet: index out of bounds"); return set._values[index]; } // Bytes32Set struct Bytes32Set { Set _inner; } /** * @dev Add a value to a set. O(1). * * Returns true if the value was added to the set, that is if it was not * already present. */ function add(Bytes32Set storage set, bytes32 value) internal returns (bool) { return _add(set._inner, value); } /** * @dev Removes a value from a set. O(1). * * Returns true if the value was removed from the set, that is if it was * present. */ function remove(Bytes32Set storage set, bytes32 value) internal returns (bool) { return _remove(set._inner, value); } /** * @dev Returns true if the value is in the set. O(1). */ function contains(Bytes32Set storage set, bytes32 value) internal view returns (bool) { return _contains(set._inner, value); } /** * @dev Returns the number of values in the set. O(1). */ function length(Bytes32Set storage set) internal view returns (uint256) { return _length(set._inner); } /** * @dev Returns the value stored at position `index` in the set. O(1). * * Note that there are no guarantees on the ordering of values inside the * array, and it may change when more values are added or removed. * * Requirements: * * - `index` must be strictly less than {length}. */ function at(Bytes32Set storage set, uint256 index) internal view returns (bytes32) { return _at(set._inner, index); } // AddressSet struct AddressSet { Set _inner; } /** * @dev Add a value to a set. O(1). * * Returns true if the value was added to the set, that is if it was not * already present. */ function add(AddressSet storage set, address value) internal returns (bool) { return _add(set._inner, bytes32(uint256(uint160(value)))); } /** * @dev Removes a value from a set. O(1). * * Returns true if the value was removed from the set, that is if it was * present. */ function remove(AddressSet storage set, address value) internal returns (bool) { return _remove(set._inner, bytes32(uint256(uint160(value)))); } /** * @dev Returns true if the value is in the set. O(1). */ function contains(AddressSet storage set, address value) internal view returns (bool) { return _contains(set._inner, bytes32(uint256(uint160(value)))); } /** * @dev Returns the number of values in the set. O(1). */ function length(AddressSet storage set) internal view returns (uint256) { return _length(set._inner); } /** * @dev Returns the value stored at position `index` in the set. O(1). * * Note that there are no guarantees on the ordering of values inside the * array, and it may change when more values are added or removed. * * Requirements: * * - `index` must be strictly less than {length}. */ function at(AddressSet storage set, uint256 index) internal view returns (address) { return address(uint160(uint256(_at(set._inner, index)))); } // UintSet struct UintSet { Set _inner; } /** * @dev Add a value to a set. O(1). * * Returns true if the value was added to the set, that is if it was not * already present. */ function add(UintSet storage set, uint256 value) internal returns (bool) { return _add(set._inner, bytes32(value)); } /** * @dev Removes a value from a set. O(1). * * Returns true if the value was removed from the set, that is if it was * present. */ function remove(UintSet storage set, uint256 value) internal returns (bool) { return _remove(set._inner, bytes32(value)); } /** * @dev Returns true if the value is in the set. O(1). */ function contains(UintSet storage set, uint256 value) internal view returns (bool) { return _contains(set._inner, bytes32(value)); } /** * @dev Returns the number of values on the set. O(1). */ function length(UintSet storage set) internal view returns (uint256) { return _length(set._inner); } /** * @dev Returns the value stored at position `index` in the set. O(1). * * Note that there are no guarantees on the ordering of values inside the * array, and it may change when more values are added or removed. * * Requirements: * * - `index` must be strictly less than {length}. */ function at(UintSet storage set, uint256 index) internal view returns (uint256) { return uint256(_at(set._inner, index)); } }
// 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); } } } }
// 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 // 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; /** * @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; 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; /** * @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; 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 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 // Adopted from https://github.com/OpenZeppelin/openzeppelin-contracts-upgradeable/blob/v3.4.0/contracts/token/ERC20/ERC20Upgradeable.sol pragma solidity 0.7.5; import "@openzeppelin/contracts-upgradeable/token/ERC20/IERC20Upgradeable.sol"; import "@openzeppelin/contracts-upgradeable/math/SafeMathUpgradeable.sol"; import "@openzeppelin/contracts-upgradeable/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}. */ abstract contract ERC20Upgradeable is Initializable, IERC20Upgradeable { using SafeMathUpgradeable for uint256; mapping (address => mapping (address => uint256)) private _allowances; 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. */ // solhint-disable-next-line func-name-mixedcase function __ERC20_init(string memory name_, string memory symbol_) internal initializer { __ERC20_init_unchained(name_, symbol_); } // solhint-disable-next-line func-name-mixedcase 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-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(msg.sender, 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(msg.sender, spender, amount); return true; } /** * @dev See {IERC20-transferFrom}. * * Emits an {Approval} event indicating the updated allowance. This is not * required by the EIP. See the note at the beginning of {ERC20}. * * Requirements: * * - `sender` and `recipient` cannot be the zero address. * - `sender` must have a balance of at least `amount`. * - the caller must have allowance for ``sender``'s tokens of at least * `amount`. */ function transferFrom(address sender, address recipient, uint256 amount) public virtual override returns (bool) { _transfer(sender, recipient, amount); uint256 currentAllowance = _allowances[sender][msg.sender]; if (sender != msg.sender && currentAllowance != uint256(-1)) { _approve(sender, msg.sender, currentAllowance.sub(amount)); } return true; } /** * @dev Atomically increases the allowance granted to `spender` by the caller. * * This is an alternative to {approve} that can be used as a mitigation for * problems described in {IERC20-approve}. * * Emits an {Approval} event indicating the updated allowance. * * Requirements: * * - `spender` cannot be the zero address. */ function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) { _approve(msg.sender, spender, _allowances[msg.sender][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(msg.sender, spender, _allowances[msg.sender][spender].sub(subtractedValue)); return true; } /** * @dev Moves tokens `amount` from `sender` to `recipient`. * * This is internal function is equivalent to {transfer}, and can be used to * e.g. implement automatic token fees, slashing mechanisms, etc. * * Emits a {Transfer} event. * * Requirements: * * - `sender` cannot be the zero address. * - `recipient` cannot be the zero address. * - `sender` must have a balance of at least `amount`. */ function _transfer(address sender, address recipient, uint256 amount) internal virtual { } /** * @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); } uint256[44] private __gap; }
{ "optimizer": { "enabled": true, "runs": 1000000 }, "outputSelection": { "*": { "*": [ "evm.bytecode", "evm.deployedBytecode", "abi" ] } }, "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":"address","name":"account","type":"address"}],"name":"Paused","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"bytes32","name":"previousAdminRole","type":"bytes32"},{"indexed":true,"internalType":"bytes32","name":"newAdminRole","type":"bytes32"}],"name":"RoleAdminChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"sender","type":"address"}],"name":"RoleGranted","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"sender","type":"address"}],"name":"RoleRevoked","type":"event"},{"anonymous":false,"inputs":[{"indexed":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"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"account","type":"address"}],"name":"Unpaused","type":"event"},{"inputs":[],"name":"DEFAULT_ADMIN_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"DOMAIN_SEPARATOR","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"PAUSER_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_account","type":"address"}],"name":"addAdmin","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_account","type":"address"}],"name":"addPauser","outputs":[],"stateMutability":"nonpayable","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":[],"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":[],"name":"distributorPrincipal","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"}],"name":"getRoleAdmin","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"uint256","name":"index","type":"uint256"}],"name":"getRoleMember","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"}],"name":"getRoleMemberCount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"grantRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"hasRole","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"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":"address","name":"_account","type":"address"}],"name":"isAdmin","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_account","type":"address"}],"name":"isPauser","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"mint","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":[],"name":"pause","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"paused","outputs":[{"internalType":"bool","name":"","type":"bool"}],"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":[{"internalType":"address","name":"_account","type":"address"}],"name":"removeAdmin","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_account","type":"address"}],"name":"removePauser","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"renounceRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"revokeRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"symbol","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"},{"internalType":"bool","name":"isDisabled","type":"bool"}],"name":"toggleRewards","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"totalDeposits","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"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"},{"inputs":[],"name":"unpause","outputs":[],"stateMutability":"nonpayable","type":"function"}]
Contract Creation Code
608060405234801561001057600080fd5b50612623806100206000396000f3fe608060405234801561001057600080fd5b506004361061025c5760003560e01c80637048027511610145578063a217fddf116100bd578063ca15c8731161008c578063d547741f11610071578063d547741f1461082e578063dd62ed3e14610867578063e63ab1e9146108a25761025c565b8063ca15c873146107b3578063d505accf146107d05761025c565b8063a217fddf14610731578063a457c2d714610739578063a9059cbb14610772578063ae5e0f7a146107ab5761025c565b806382dc1ec4116101145780639010d07c116100f95780639010d07c146106a457806391d14854146106f057806395d89b41146107295761025c565b806382dc1ec4146106695780638456cb591461069c5761025c565b806370480275146105c857806370a08231146105fb5780637d8820971461062e5780637ecebe00146106365761025c565b8063313ce567116101d85780633f4ba83a116101a757806346fbf68e1161018c57806346fbf68e1461055a5780635c975abb1461058d5780636b2c0f55146105955761025c565b80633f4ba83a1461051957806340c10f19146105215761025c565b8063313ce567146104815780633644e5151461049f57806336568abe146104a757806339509351146104e05761025c565b806318dab53b1161022f578063248a9ca311610214578063248a9ca3146103f857806324d7806c146104155780632f2ff15d146104485761025c565b806318dab53b1461037a57806323b872dd146103b55761025c565b806306fdde0314610261578063095ea7b3146102de5780631785f53c1461032b57806318160ddd14610360575b600080fd5b6102696108aa565b6040805160208082528351818301528351919283929083019185019080838360005b838110156102a357818101518382015260200161028b565b50505050905090810190601f1680156102d05780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b610317600480360360408110156102f457600080fd5b5073ffffffffffffffffffffffffffffffffffffffff813516906020013561095e565b604080519115158252519081900360200190f35b61035e6004803603602081101561034157600080fd5b503573ffffffffffffffffffffffffffffffffffffffff16610975565b005b610368610983565b60408051918252519081900360200190f35b61035e6004803603604081101561039057600080fd5b5073ffffffffffffffffffffffffffffffffffffffff8135169060200135151561098a565b610317600480360360608110156103cb57600080fd5b5073ffffffffffffffffffffffffffffffffffffffff813581169160208101359091169060400135610b73565b6103686004803603602081101561040e57600080fd5b5035610c05565b6103176004803603602081101561042b57600080fd5b503573ffffffffffffffffffffffffffffffffffffffff16610c1a565b61035e6004803603604081101561045e57600080fd5b508035906020013573ffffffffffffffffffffffffffffffffffffffff16610c26565b610489610cac565b6040805160ff9092168252519081900360200190f35b610368610cb5565b61035e600480360360408110156104bd57600080fd5b508035906020013573ffffffffffffffffffffffffffffffffffffffff16610cc4565b610317600480360360408110156104f657600080fd5b5073ffffffffffffffffffffffffffffffffffffffff8135169060200135610d59565b61035e610d9c565b61035e6004803603604081101561053757600080fd5b5073ffffffffffffffffffffffffffffffffffffffff8135169060200135610e3b565b6103176004803603602081101561057057600080fd5b503573ffffffffffffffffffffffffffffffffffffffff1661102c565b610317611058565b61035e600480360360208110156105ab57600080fd5b503573ffffffffffffffffffffffffffffffffffffffff16611061565b61035e600480360360208110156105de57600080fd5b503573ffffffffffffffffffffffffffffffffffffffff1661108b565b6103686004803603602081101561061157600080fd5b503573ffffffffffffffffffffffffffffffffffffffff16611096565b6103686110bf565b6103686004803603602081101561064c57600080fd5b503573ffffffffffffffffffffffffffffffffffffffff166110c6565b61035e6004803603602081101561067f57600080fd5b503573ffffffffffffffffffffffffffffffffffffffff166110f4565b61035e61111e565b6106c7600480360360408110156106ba57600080fd5b50803590602001356111bb565b6040805173ffffffffffffffffffffffffffffffffffffffff9092168252519081900360200190f35b6103176004803603604081101561070657600080fd5b508035906020013573ffffffffffffffffffffffffffffffffffffffff166111da565b6102696111f2565b610368611271565b6103176004803603604081101561074f57600080fd5b5073ffffffffffffffffffffffffffffffffffffffff8135169060200135611276565b6103176004803603604081101561078857600080fd5b5073ffffffffffffffffffffffffffffffffffffffff81351690602001356112b9565b6103686112c6565b610368600480360360208110156107c957600080fd5b50356112cd565b61035e600480360360e08110156107e657600080fd5b5073ffffffffffffffffffffffffffffffffffffffff813581169160208101359091169060408101359060608101359060ff6080820135169060a08101359060c001356112e4565b61035e6004803603604081101561084457600080fd5b508035906020013573ffffffffffffffffffffffffffffffffffffffff16611516565b6103686004803603604081101561087d57600080fd5b5073ffffffffffffffffffffffffffffffffffffffff81358116916020013516611589565b6103686115c1565b60988054604080516020601f60027fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6101006001881615020190951694909404938401819004810282018101909252828152606093909290918301828280156109545780601f1061092957610100808354040283529160200191610954565b820191906000526020600020905b81548152906001019060200180831161093757829003601f168201915b5050505050905090565b600061096b3384846115e5565b5060015b92915050565b610980600082611516565b50565b61012e5490565b6109956000336111da565b610a0057604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601e60248201527f4f776e61626c655061757361626c653a206163636573732064656e6965640000604482015290519081900360640190fd5b73ffffffffffffffffffffffffffffffffffffffff8216610a8257604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601f60248201527f5374616b6564457468546f6b656e3a20696e76616c6964206163636f756e7400604482015290519081900360640190fd5b61013154604080517f6a9ecedb00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff8581166004830152841515602483015291519190921691636a9ecedb91604480830192600092919082900301818387803b158015610aff57600080fd5b505af1158015610b13573d6000803e3d6000fd5b5050505073ffffffffffffffffffffffffffffffffffffffff8216600090815261012f60205260409020548115610b5b5761013254610b52908261172c565b61013255610b6e565b61013254610b6990826117a0565b610132555b505050565b6000610b80848484611817565b73ffffffffffffffffffffffffffffffffffffffff84166000818152609760209081526040808320338085529252909120549114801590610be157507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8114155b15610bfa57610bfa8533610bf584876117a0565b6115e5565b506001949350505050565b60009081526065602052604090206002015490565b600061096f81836111da565b600082815260656020526040902060020154610c4990610c44611c58565b6111da565b610c9e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602f8152602001806124a1602f913960400191505060405180910390fd5b610ca88282611c5c565b5050565b609a5460ff1690565b6000610cbf611cdf565b905090565b610ccc611c58565b73ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614610d4f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602f8152602001806125bf602f913960400191505060405180910390fd5b610ca88282611d1a565b33600081815260976020908152604080832073ffffffffffffffffffffffffffffffffffffffff87168452909152812054909161096b918590610bf5908661172c565b610dc67f65d7a28e3265b37a6474929f336521b332c1681b933f6cb9f3376673440d862a336111da565b610e3157604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601e60248201527f4f776e61626c655061757361626c653a206163636573732064656e6965640000604482015290519081900360640190fd5b610e39611d9d565b565b6101305473ffffffffffffffffffffffffffffffffffffffff163314610ec257604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601d60248201527f5374616b6564457468546f6b656e3a206163636573732064656e696564000000604482015290519081900360640190fd5b61013154604080517f01ba793b00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff8581166004830152915160009392909216916301ba793b9160248082019260209290919082900301818787803b158015610f3b57600080fd5b505af1158015610f4f573d6000803e3d6000fd5b505050506040513d6020811015610f6557600080fd5b505190508015610f825761013254610f7d908361172c565b610132555b61012e54610f90908361172c565b61012e5573ffffffffffffffffffffffffffffffffffffffff8316600090815261012f6020526040902054610fc5908361172c565b73ffffffffffffffffffffffffffffffffffffffff8416600081815261012f602090815260408083209490945583518681529351929391927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9281900390910190a3505050565b600061096f7f65d7a28e3265b37a6474929f336521b332c1681b933f6cb9f3376673440d862a836111da565b60335460ff1690565b6109807f65d7a28e3265b37a6474929f336521b332c1681b933f6cb9f3376673440d862a82611516565b610980600082610c26565b73ffffffffffffffffffffffffffffffffffffffff16600090815261012f602052604090205490565b61012e5481565b73ffffffffffffffffffffffffffffffffffffffff8116600090815260fb6020526040812061096f90611e8b565b6109807f65d7a28e3265b37a6474929f336521b332c1681b933f6cb9f3376673440d862a82610c26565b6111487f65d7a28e3265b37a6474929f336521b332c1681b933f6cb9f3376673440d862a336111da565b6111b357604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601e60248201527f4f776e61626c655061757361626c653a206163636573732064656e6965640000604482015290519081900360640190fd5b610e39611e8f565b60008281526065602052604081206111d39083611f57565b9392505050565b60008281526065602052604081206111d39083611f63565b60998054604080516020601f60027fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6101006001881615020190951694909404938401819004810282018101909252828152606093909290918301828280156109545780601f1061092957610100808354040283529160200191610954565b600081565b33600081815260976020908152604080832073ffffffffffffffffffffffffffffffffffffffff87168452909152812054909161096b918590610bf590866117a0565b600061096b338484611817565b6101325481565b600081815260656020526040812061096f90611f85565b8342111561135357604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601d60248201527f45524332305065726d69743a206578706972656420646561646c696e65000000604482015290519081900360640190fd5b600060fc548888886113a260fb60008e73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020611e8b565b89604051602001808781526020018673ffffffffffffffffffffffffffffffffffffffff1681526020018573ffffffffffffffffffffffffffffffffffffffff1681526020018481526020018381526020018281526020019650505050505050604051602081830303815290604052805190602001209050600061142582611f90565b9050600061143582878787611ff7565b90508973ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16146114d157604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601e60248201527f45524332305065726d69743a20696e76616c6964207369676e61747572650000604482015290519081900360640190fd5b73ffffffffffffffffffffffffffffffffffffffff8a16600090815260fb602052604090206114ff906121ee565b61150a8a8a8a6115e5565b50505050505050505050565b60008281526065602052604090206002015461153490610c44611c58565b610d4f576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260308152602001806125496030913960400191505060405180910390fd5b73ffffffffffffffffffffffffffffffffffffffff918216600090815260976020908152604080832093909416825291909152205490565b7f65d7a28e3265b37a6474929f336521b332c1681b933f6cb9f3376673440d862a81565b73ffffffffffffffffffffffffffffffffffffffff8316611651576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602481526020018061259b6024913960400191505060405180910390fd5b73ffffffffffffffffffffffffffffffffffffffff82166116bd576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260228152602001806125056022913960400191505060405180910390fd5b73ffffffffffffffffffffffffffffffffffffffff808416600081815260976020908152604080832094871680845294825291829020859055815185815291517f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259281900390910190a3505050565b6000828201838110156111d357604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b60008282111561181157604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601e60248201527f536166654d6174683a207375627472616374696f6e206f766572666c6f770000604482015290519081900360640190fd5b50900390565b61181f611058565b1561188b57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601060248201527f5061757361626c653a2070617573656400000000000000000000000000000000604482015290519081900360640190fd5b73ffffffffffffffffffffffffffffffffffffffff831661190d57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601e60248201527f5374616b6564457468546f6b656e3a20696e76616c69642073656e6465720000604482015290519081900360640190fd5b73ffffffffffffffffffffffffffffffffffffffff821661198f57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f5374616b6564457468546f6b656e3a20696e76616c6964207265636569766572604482015290519081900360640190fd5b61013160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663b4c6e4166040518163ffffffff1660e01b815260040160206040518083038186803b1580156119f857600080fd5b505afa158015611a0c573d6000803e3d6000fd5b505050506040513d6020811015611a2257600080fd5b50514311611a7b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260358152602001806124d06035913960400191505060405180910390fd5b61013154604080517f3b0c9d9000000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff8681166004830152858116602483015282516000948594921692633b0c9d9092604480830193919282900301818787803b158015611af857600080fd5b505af1158015611b0c573d6000803e3d6000fd5b505050506040513d6040811015611b2257600080fd5b50805160209091015190925090508180611b395750805b8015611b4c5750818015611b4a5750805b155b15611b7e57610132548215611b6c57611b6581856117a0565b9050611b79565b611b76818561172c565b90505b610132555b73ffffffffffffffffffffffffffffffffffffffff8516600090815261012f6020526040902054611baf90846117a0565b73ffffffffffffffffffffffffffffffffffffffff808716600090815261012f60205260408082209390935590861681522054611bec908461172c565b73ffffffffffffffffffffffffffffffffffffffff808616600081815261012f602090815260409182902094909455805187815290519193928916927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef92918290030190a35050505050565b3390565b6000828152606560205260409020611c7490826121f7565b15610ca857611c81611c58565b73ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b6000610cbf7f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f611d0d612219565b611d1561221f565b612225565b6000828152606560205260409020611d329082612294565b15610ca857611d3f611c58565b73ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16837ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b60405160405180910390a45050565b611da5611058565b611e1057604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601460248201527f5061757361626c653a206e6f7420706175736564000000000000000000000000604482015290519081900360640190fd5b603380547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001690557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa611e61611c58565b6040805173ffffffffffffffffffffffffffffffffffffffff9092168252519081900360200190a1565b5490565b611e97611058565b15611f0357604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601060248201527f5061757361626c653a2070617573656400000000000000000000000000000000604482015290519081900360640190fd5b603380547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001660011790557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a258611e61611c58565b60006111d383836122b6565b60006111d38373ffffffffffffffffffffffffffffffffffffffff8416612334565b600061096f82611e8b565b6000611f9a611cdf565b8260405160200180807f190100000000000000000000000000000000000000000000000000000000000081525060020183815260200182815260200192505050604051602081830303815290604052805190602001209050919050565b60007f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a0821115612072576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260228152602001806125276022913960400191505060405180910390fd5b8360ff16601b148061208757508360ff16601c145b6120dc576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260228152602001806125796022913960400191505060405180910390fd5b600060018686868660405160008152602001604052604051808581526020018460ff1681526020018381526020018281526020019450505050506020604051602081039080840390855afa158015612138573d6000803e3d6000fd5b50506040517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0015191505073ffffffffffffffffffffffffffffffffffffffff81166121e557604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601860248201527f45434453413a20696e76616c6964207369676e61747572650000000000000000604482015290519081900360640190fd5b95945050505050565b80546001019055565b60006111d38373ffffffffffffffffffffffffffffffffffffffff841661234c565b60c75490565b60c85490565b6000838383612232612396565b30604051602001808681526020018581526020018481526020018381526020018273ffffffffffffffffffffffffffffffffffffffff168152602001955050505050506040516020818303038152906040528051906020012090509392505050565b60006111d38373ffffffffffffffffffffffffffffffffffffffff841661239a565b81546000908210612312576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602281526020018061247f6022913960400191505060405180910390fd5b82600001828154811061232157fe5b9060005260206000200154905092915050565b60009081526001919091016020526040902054151590565b60006123588383612334565b61238e5750815460018181018455600084815260208082209093018490558454848252828601909352604090209190915561096f565b50600061096f565b4690565b600081815260018301602052604081205480156124745783547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff80830191908101906000908790839081106123eb57fe5b906000526020600020015490508087600001848154811061240857fe5b60009182526020808320909101929092558281526001898101909252604090209084019055865487908061243857fe5b6001900381819060005260206000200160009055905586600101600087815260200190815260200160002060009055600194505050505061096f565b600091505061096f56fe456e756d657261626c655365743a20696e646578206f7574206f6620626f756e6473416363657373436f6e74726f6c3a2073656e646572206d75737420626520616e2061646d696e20746f206772616e745374616b6564457468546f6b656e3a2063616e6e6f74207472616e7366657220647572696e6720726577617264732075706461746545524332303a20617070726f766520746f20746865207a65726f206164647265737345434453413a20696e76616c6964207369676e6174757265202773272076616c7565416363657373436f6e74726f6c3a2073656e646572206d75737420626520616e2061646d696e20746f207265766f6b6545434453413a20696e76616c6964207369676e6174757265202776272076616c756545524332303a20617070726f76652066726f6d20746865207a65726f2061646472657373416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636520726f6c657320666f722073656c66a264697066735822122089bb7006732d1b05c1a2ee5d9a9647568bc26bd2b5aad79045f00da5b487125264736f6c63430007050033
Deployed Bytecode
0x608060405234801561001057600080fd5b506004361061025c5760003560e01c80637048027511610145578063a217fddf116100bd578063ca15c8731161008c578063d547741f11610071578063d547741f1461082e578063dd62ed3e14610867578063e63ab1e9146108a25761025c565b8063ca15c873146107b3578063d505accf146107d05761025c565b8063a217fddf14610731578063a457c2d714610739578063a9059cbb14610772578063ae5e0f7a146107ab5761025c565b806382dc1ec4116101145780639010d07c116100f95780639010d07c146106a457806391d14854146106f057806395d89b41146107295761025c565b806382dc1ec4146106695780638456cb591461069c5761025c565b806370480275146105c857806370a08231146105fb5780637d8820971461062e5780637ecebe00146106365761025c565b8063313ce567116101d85780633f4ba83a116101a757806346fbf68e1161018c57806346fbf68e1461055a5780635c975abb1461058d5780636b2c0f55146105955761025c565b80633f4ba83a1461051957806340c10f19146105215761025c565b8063313ce567146104815780633644e5151461049f57806336568abe146104a757806339509351146104e05761025c565b806318dab53b1161022f578063248a9ca311610214578063248a9ca3146103f857806324d7806c146104155780632f2ff15d146104485761025c565b806318dab53b1461037a57806323b872dd146103b55761025c565b806306fdde0314610261578063095ea7b3146102de5780631785f53c1461032b57806318160ddd14610360575b600080fd5b6102696108aa565b6040805160208082528351818301528351919283929083019185019080838360005b838110156102a357818101518382015260200161028b565b50505050905090810190601f1680156102d05780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b610317600480360360408110156102f457600080fd5b5073ffffffffffffffffffffffffffffffffffffffff813516906020013561095e565b604080519115158252519081900360200190f35b61035e6004803603602081101561034157600080fd5b503573ffffffffffffffffffffffffffffffffffffffff16610975565b005b610368610983565b60408051918252519081900360200190f35b61035e6004803603604081101561039057600080fd5b5073ffffffffffffffffffffffffffffffffffffffff8135169060200135151561098a565b610317600480360360608110156103cb57600080fd5b5073ffffffffffffffffffffffffffffffffffffffff813581169160208101359091169060400135610b73565b6103686004803603602081101561040e57600080fd5b5035610c05565b6103176004803603602081101561042b57600080fd5b503573ffffffffffffffffffffffffffffffffffffffff16610c1a565b61035e6004803603604081101561045e57600080fd5b508035906020013573ffffffffffffffffffffffffffffffffffffffff16610c26565b610489610cac565b6040805160ff9092168252519081900360200190f35b610368610cb5565b61035e600480360360408110156104bd57600080fd5b508035906020013573ffffffffffffffffffffffffffffffffffffffff16610cc4565b610317600480360360408110156104f657600080fd5b5073ffffffffffffffffffffffffffffffffffffffff8135169060200135610d59565b61035e610d9c565b61035e6004803603604081101561053757600080fd5b5073ffffffffffffffffffffffffffffffffffffffff8135169060200135610e3b565b6103176004803603602081101561057057600080fd5b503573ffffffffffffffffffffffffffffffffffffffff1661102c565b610317611058565b61035e600480360360208110156105ab57600080fd5b503573ffffffffffffffffffffffffffffffffffffffff16611061565b61035e600480360360208110156105de57600080fd5b503573ffffffffffffffffffffffffffffffffffffffff1661108b565b6103686004803603602081101561061157600080fd5b503573ffffffffffffffffffffffffffffffffffffffff16611096565b6103686110bf565b6103686004803603602081101561064c57600080fd5b503573ffffffffffffffffffffffffffffffffffffffff166110c6565b61035e6004803603602081101561067f57600080fd5b503573ffffffffffffffffffffffffffffffffffffffff166110f4565b61035e61111e565b6106c7600480360360408110156106ba57600080fd5b50803590602001356111bb565b6040805173ffffffffffffffffffffffffffffffffffffffff9092168252519081900360200190f35b6103176004803603604081101561070657600080fd5b508035906020013573ffffffffffffffffffffffffffffffffffffffff166111da565b6102696111f2565b610368611271565b6103176004803603604081101561074f57600080fd5b5073ffffffffffffffffffffffffffffffffffffffff8135169060200135611276565b6103176004803603604081101561078857600080fd5b5073ffffffffffffffffffffffffffffffffffffffff81351690602001356112b9565b6103686112c6565b610368600480360360208110156107c957600080fd5b50356112cd565b61035e600480360360e08110156107e657600080fd5b5073ffffffffffffffffffffffffffffffffffffffff813581169160208101359091169060408101359060608101359060ff6080820135169060a08101359060c001356112e4565b61035e6004803603604081101561084457600080fd5b508035906020013573ffffffffffffffffffffffffffffffffffffffff16611516565b6103686004803603604081101561087d57600080fd5b5073ffffffffffffffffffffffffffffffffffffffff81358116916020013516611589565b6103686115c1565b60988054604080516020601f60027fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6101006001881615020190951694909404938401819004810282018101909252828152606093909290918301828280156109545780601f1061092957610100808354040283529160200191610954565b820191906000526020600020905b81548152906001019060200180831161093757829003601f168201915b5050505050905090565b600061096b3384846115e5565b5060015b92915050565b610980600082611516565b50565b61012e5490565b6109956000336111da565b610a0057604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601e60248201527f4f776e61626c655061757361626c653a206163636573732064656e6965640000604482015290519081900360640190fd5b73ffffffffffffffffffffffffffffffffffffffff8216610a8257604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601f60248201527f5374616b6564457468546f6b656e3a20696e76616c6964206163636f756e7400604482015290519081900360640190fd5b61013154604080517f6a9ecedb00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff8581166004830152841515602483015291519190921691636a9ecedb91604480830192600092919082900301818387803b158015610aff57600080fd5b505af1158015610b13573d6000803e3d6000fd5b5050505073ffffffffffffffffffffffffffffffffffffffff8216600090815261012f60205260409020548115610b5b5761013254610b52908261172c565b61013255610b6e565b61013254610b6990826117a0565b610132555b505050565b6000610b80848484611817565b73ffffffffffffffffffffffffffffffffffffffff84166000818152609760209081526040808320338085529252909120549114801590610be157507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8114155b15610bfa57610bfa8533610bf584876117a0565b6115e5565b506001949350505050565b60009081526065602052604090206002015490565b600061096f81836111da565b600082815260656020526040902060020154610c4990610c44611c58565b6111da565b610c9e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602f8152602001806124a1602f913960400191505060405180910390fd5b610ca88282611c5c565b5050565b609a5460ff1690565b6000610cbf611cdf565b905090565b610ccc611c58565b73ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614610d4f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602f8152602001806125bf602f913960400191505060405180910390fd5b610ca88282611d1a565b33600081815260976020908152604080832073ffffffffffffffffffffffffffffffffffffffff87168452909152812054909161096b918590610bf5908661172c565b610dc67f65d7a28e3265b37a6474929f336521b332c1681b933f6cb9f3376673440d862a336111da565b610e3157604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601e60248201527f4f776e61626c655061757361626c653a206163636573732064656e6965640000604482015290519081900360640190fd5b610e39611d9d565b565b6101305473ffffffffffffffffffffffffffffffffffffffff163314610ec257604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601d60248201527f5374616b6564457468546f6b656e3a206163636573732064656e696564000000604482015290519081900360640190fd5b61013154604080517f01ba793b00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff8581166004830152915160009392909216916301ba793b9160248082019260209290919082900301818787803b158015610f3b57600080fd5b505af1158015610f4f573d6000803e3d6000fd5b505050506040513d6020811015610f6557600080fd5b505190508015610f825761013254610f7d908361172c565b610132555b61012e54610f90908361172c565b61012e5573ffffffffffffffffffffffffffffffffffffffff8316600090815261012f6020526040902054610fc5908361172c565b73ffffffffffffffffffffffffffffffffffffffff8416600081815261012f602090815260408083209490945583518681529351929391927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9281900390910190a3505050565b600061096f7f65d7a28e3265b37a6474929f336521b332c1681b933f6cb9f3376673440d862a836111da565b60335460ff1690565b6109807f65d7a28e3265b37a6474929f336521b332c1681b933f6cb9f3376673440d862a82611516565b610980600082610c26565b73ffffffffffffffffffffffffffffffffffffffff16600090815261012f602052604090205490565b61012e5481565b73ffffffffffffffffffffffffffffffffffffffff8116600090815260fb6020526040812061096f90611e8b565b6109807f65d7a28e3265b37a6474929f336521b332c1681b933f6cb9f3376673440d862a82610c26565b6111487f65d7a28e3265b37a6474929f336521b332c1681b933f6cb9f3376673440d862a336111da565b6111b357604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601e60248201527f4f776e61626c655061757361626c653a206163636573732064656e6965640000604482015290519081900360640190fd5b610e39611e8f565b60008281526065602052604081206111d39083611f57565b9392505050565b60008281526065602052604081206111d39083611f63565b60998054604080516020601f60027fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6101006001881615020190951694909404938401819004810282018101909252828152606093909290918301828280156109545780601f1061092957610100808354040283529160200191610954565b600081565b33600081815260976020908152604080832073ffffffffffffffffffffffffffffffffffffffff87168452909152812054909161096b918590610bf590866117a0565b600061096b338484611817565b6101325481565b600081815260656020526040812061096f90611f85565b8342111561135357604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601d60248201527f45524332305065726d69743a206578706972656420646561646c696e65000000604482015290519081900360640190fd5b600060fc548888886113a260fb60008e73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020611e8b565b89604051602001808781526020018673ffffffffffffffffffffffffffffffffffffffff1681526020018573ffffffffffffffffffffffffffffffffffffffff1681526020018481526020018381526020018281526020019650505050505050604051602081830303815290604052805190602001209050600061142582611f90565b9050600061143582878787611ff7565b90508973ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16146114d157604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601e60248201527f45524332305065726d69743a20696e76616c6964207369676e61747572650000604482015290519081900360640190fd5b73ffffffffffffffffffffffffffffffffffffffff8a16600090815260fb602052604090206114ff906121ee565b61150a8a8a8a6115e5565b50505050505050505050565b60008281526065602052604090206002015461153490610c44611c58565b610d4f576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260308152602001806125496030913960400191505060405180910390fd5b73ffffffffffffffffffffffffffffffffffffffff918216600090815260976020908152604080832093909416825291909152205490565b7f65d7a28e3265b37a6474929f336521b332c1681b933f6cb9f3376673440d862a81565b73ffffffffffffffffffffffffffffffffffffffff8316611651576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602481526020018061259b6024913960400191505060405180910390fd5b73ffffffffffffffffffffffffffffffffffffffff82166116bd576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260228152602001806125056022913960400191505060405180910390fd5b73ffffffffffffffffffffffffffffffffffffffff808416600081815260976020908152604080832094871680845294825291829020859055815185815291517f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259281900390910190a3505050565b6000828201838110156111d357604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b60008282111561181157604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601e60248201527f536166654d6174683a207375627472616374696f6e206f766572666c6f770000604482015290519081900360640190fd5b50900390565b61181f611058565b1561188b57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601060248201527f5061757361626c653a2070617573656400000000000000000000000000000000604482015290519081900360640190fd5b73ffffffffffffffffffffffffffffffffffffffff831661190d57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601e60248201527f5374616b6564457468546f6b656e3a20696e76616c69642073656e6465720000604482015290519081900360640190fd5b73ffffffffffffffffffffffffffffffffffffffff821661198f57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f5374616b6564457468546f6b656e3a20696e76616c6964207265636569766572604482015290519081900360640190fd5b61013160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663b4c6e4166040518163ffffffff1660e01b815260040160206040518083038186803b1580156119f857600080fd5b505afa158015611a0c573d6000803e3d6000fd5b505050506040513d6020811015611a2257600080fd5b50514311611a7b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260358152602001806124d06035913960400191505060405180910390fd5b61013154604080517f3b0c9d9000000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff8681166004830152858116602483015282516000948594921692633b0c9d9092604480830193919282900301818787803b158015611af857600080fd5b505af1158015611b0c573d6000803e3d6000fd5b505050506040513d6040811015611b2257600080fd5b50805160209091015190925090508180611b395750805b8015611b4c5750818015611b4a5750805b155b15611b7e57610132548215611b6c57611b6581856117a0565b9050611b79565b611b76818561172c565b90505b610132555b73ffffffffffffffffffffffffffffffffffffffff8516600090815261012f6020526040902054611baf90846117a0565b73ffffffffffffffffffffffffffffffffffffffff808716600090815261012f60205260408082209390935590861681522054611bec908461172c565b73ffffffffffffffffffffffffffffffffffffffff808616600081815261012f602090815260409182902094909455805187815290519193928916927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef92918290030190a35050505050565b3390565b6000828152606560205260409020611c7490826121f7565b15610ca857611c81611c58565b73ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b6000610cbf7f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f611d0d612219565b611d1561221f565b612225565b6000828152606560205260409020611d329082612294565b15610ca857611d3f611c58565b73ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16837ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b60405160405180910390a45050565b611da5611058565b611e1057604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601460248201527f5061757361626c653a206e6f7420706175736564000000000000000000000000604482015290519081900360640190fd5b603380547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001690557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa611e61611c58565b6040805173ffffffffffffffffffffffffffffffffffffffff9092168252519081900360200190a1565b5490565b611e97611058565b15611f0357604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601060248201527f5061757361626c653a2070617573656400000000000000000000000000000000604482015290519081900360640190fd5b603380547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001660011790557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a258611e61611c58565b60006111d383836122b6565b60006111d38373ffffffffffffffffffffffffffffffffffffffff8416612334565b600061096f82611e8b565b6000611f9a611cdf565b8260405160200180807f190100000000000000000000000000000000000000000000000000000000000081525060020183815260200182815260200192505050604051602081830303815290604052805190602001209050919050565b60007f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a0821115612072576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260228152602001806125276022913960400191505060405180910390fd5b8360ff16601b148061208757508360ff16601c145b6120dc576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260228152602001806125796022913960400191505060405180910390fd5b600060018686868660405160008152602001604052604051808581526020018460ff1681526020018381526020018281526020019450505050506020604051602081039080840390855afa158015612138573d6000803e3d6000fd5b50506040517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0015191505073ffffffffffffffffffffffffffffffffffffffff81166121e557604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601860248201527f45434453413a20696e76616c6964207369676e61747572650000000000000000604482015290519081900360640190fd5b95945050505050565b80546001019055565b60006111d38373ffffffffffffffffffffffffffffffffffffffff841661234c565b60c75490565b60c85490565b6000838383612232612396565b30604051602001808681526020018581526020018481526020018381526020018273ffffffffffffffffffffffffffffffffffffffff168152602001955050505050506040516020818303038152906040528051906020012090509392505050565b60006111d38373ffffffffffffffffffffffffffffffffffffffff841661239a565b81546000908210612312576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602281526020018061247f6022913960400191505060405180910390fd5b82600001828154811061232157fe5b9060005260206000200154905092915050565b60009081526001919091016020526040902054151590565b60006123588383612334565b61238e5750815460018181018455600084815260208082209093018490558454848252828601909352604090209190915561096f565b50600061096f565b4690565b600081815260018301602052604081205480156124745783547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff80830191908101906000908790839081106123eb57fe5b906000526020600020015490508087600001848154811061240857fe5b60009182526020808320909101929092558281526001898101909252604090209084019055865487908061243857fe5b6001900381819060005260206000200160009055905586600101600087815260200190815260200160002060009055600194505050505061096f565b600091505061096f56fe456e756d657261626c655365743a20696e646578206f7574206f6620626f756e6473416363657373436f6e74726f6c3a2073656e646572206d75737420626520616e2061646d696e20746f206772616e745374616b6564457468546f6b656e3a2063616e6e6f74207472616e7366657220647572696e6720726577617264732075706461746545524332303a20617070726f766520746f20746865207a65726f206164647265737345434453413a20696e76616c6964207369676e6174757265202773272076616c7565416363657373436f6e74726f6c3a2073656e646572206d75737420626520616e2061646d696e20746f207265766f6b6545434453413a20696e76616c6964207369676e6174757265202776272076616c756545524332303a20617070726f76652066726f6d20746865207a65726f2061646472657373416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636520726f6c657320666f722073656c66a264697066735822122089bb7006732d1b05c1a2ee5d9a9647568bc26bd2b5aad79045f00da5b487125264736f6c63430007050033
Loading...
Loading
Loading...
Loading
Multichain Portfolio | 30 Chains
Chain | Token | Portfolio % | Price | Amount | Value |
---|
Loading...
Loading
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.