Overview
APE Balance
0 APE
APE Value
$0.00More Info
Private Name Tags
ContractCreator
Loading...
Loading
Contract Name:
Cryptosender
Compiler Version
v0.8.9+commit.e5eed63a
Optimization Enabled:
Yes with 200 runs
Other Settings:
london EvmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: MIT pragma solidity 0.8.9; import "../../node_modules/@openzeppelin/contracts-upgradeable/utils/math/SafeMathUpgradeable.sol"; import "../../node_modules/@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol"; import "../../node_modules/@openzeppelin/contracts-upgradeable/access/AccessControlEnumerableUpgradeable.sol"; import "../../node_modules/@openzeppelin/contracts-upgradeable/token/ERC721/IERC721Upgradeable.sol"; import "../../node_modules/@openzeppelin/contracts-upgradeable/token/ERC20/IERC20Upgradeable.sol"; import "../../node_modules/@openzeppelin/contracts-upgradeable/utils/cryptography/ECDSAUpgradeable.sol"; // Use ECDSA for signature verification /** _ _ _ | | | | (_) ___ _ __ _ _ _ __ | |_ ___ ___ ___ _ __ __| | ___ _ __ _ ___ / __| '__| | | | '_ \| __/ _ \/ __|/ _ \ '_ \ / _` |/ _ \ '__| |/ _ \ | (__| | | |_| | |_) | || (_) \__ \ __/ | | | (_| | __/ |_ | | (_) | \___|_| \__, | .__/ \__\___/|___/\___|_| |_|\__,_|\___|_(_)|_|\___/ __/ | | |___/|_| https://cryptosender.io Send tokens to multiple addresses at once with a reduced */ contract Cryptosender is Initializable, ContextUpgradeable, AccessControlEnumerableUpgradeable { struct VipLevel{ uint256 level; uint256 fee; uint256 price; uint256 vipTime; } // Relation between user address and purchased vip level mapping(address => uint256) _purchasedVipLevel; // Relation between user address and purchased vip level date mapping(address => uint256) _purchasedOn; // Vip level settings mapping(uint256 => VipLevel) _vipLevels; // Team wallet ( developer ) address team; mapping(address => uint256) _referral; function initialize() public initializer { __AccessControl_init(); __AccessControlEnumerable_init(); __Context_init(); __ERC165_init(); _setupRole(DEFAULT_ADMIN_ROLE, _msgSender()); team = _msgSender(); addVipLevel(0, 0.02 ether, 0 ether, 0 days); addVipLevel(1, 0 ether, 1 ether, 1 days); addVipLevel(2, 0 ether, 3 ether, 7 days); addVipLevel(3, 0 ether, 5 ether, 30 days); addVipLevel(4, 0 ether, 10 ether, 90 days); } /** * Add new vip level to the system. * This is used on creation of contract to configure the vip levels of system. */ function addVipLevel(uint256 level, uint256 fee, uint256 price, uint256 vipTime) public { require(hasRole(DEFAULT_ADMIN_ROLE, msg.sender)); _vipLevels[level] = VipLevel(level, fee, price, vipTime); } function addVipsLevel(uint256[] memory level, uint256[] memory fee, uint256[] memory price, uint256[] memory vipTime) public { require(hasRole(DEFAULT_ADMIN_ROLE, msg.sender)); uint length = level.length; for(uint i = 0; i < length; i++){ _vipLevels[level[i]] = VipLevel(level[i], fee[i], price[i], vipTime[i]); } } /** * Utility method to sum array of uints */ function _sumAmounts(uint256[] memory amounts) internal pure returns(uint256){ uint sum = 0; uint length = amounts.length; for(uint i = 0; i < length; i++){ sum += amounts[i]; } return sum; } /** * Returns the current purchased vip level of user */ function currentLevel(address user) public view returns(VipLevel memory){ uint256 _pOn = _purchasedOn[user]; uint256 _endDate = _pOn + _vipLevels[_purchasedVipLevel[user]].vipTime; if(block.timestamp > _endDate){ return _vipLevels[0]; } return _vipLevels[_purchasedVipLevel[user]]; } /** * Process a purchase vip level */ function purchaseVip(uint256 level) public payable { _purchaseVip(level); _distributeFee(msg.value, address(0), 0); } function purchaseVipReferral(uint256 level, address referral, uint256 referralPercentage, bytes memory signature) public payable { require(referralPercentage <= 25, "Invalid fee"); _purchaseVip(level); uint256 received = msg.value; bool validSignature = _checkReferralSignature(referral, referralPercentage, signature); if(!validSignature){ referralPercentage = 0; } _distributeFee(received, referral, referralPercentage); } function _checkReferralSignature(address referral, uint256 fee, bytes memory signature) internal pure returns(bool){ bytes32 messageHash = getMessageHash(referral, fee); address signer = verifySignature(messageHash, signature); return signer == 0xD56E3f542bfd2d0AeAd54C7FdD7e6D2b784dd819; } function _purchaseVip(uint256 level) internal { VipLevel memory vipLevel = _vipLevels[level]; uint256 _price = vipLevel.price; require(currentLevel(msg.sender).level < level, "No level"); require(msg.value >= _price, "Insufficient balance"); _purchasedVipLevel[msg.sender] = level; _purchasedOn[msg.sender] = block.timestamp; } function _distributeFee(uint256 fee, address referral, uint256 referralPercentage) internal{ uint256 referralFee = (fee * referralPercentage) / 100; uint256 teamFee = fee - referralFee; if (referralFee > 0) { _sendEther(referral, referralFee); } _sendEther(team, teamFee); } function _distribute(uint256 _fee, address token, address[] memory destiny, uint256[] memory amounts) internal { uint length = destiny.length; _checkDistribution(_fee, destiny.length, amounts.length); for(uint i = 0; i < length; i++){ IERC20Upgradeable(token).transferFrom(msg.sender, destiny[i], amounts[i]); } } /** * Distribute ERC-20 tokens */ function distribute( address token, address[] memory destiny, uint256[] memory amounts ) public payable{ uint256 _fee = currentLevel(msg.sender).fee; _distribute(_fee, token, destiny, amounts); _distributeFee(_fee, address(0), 0); } function distributeReferral( address token, address[] memory destiny, uint256[] memory amounts, address referral, uint256 referralPercentage, bytes memory signature ) public payable{ uint256 _fee = currentLevel(msg.sender).fee; _distribute(_fee, token, destiny, amounts); bool validSignature = _checkReferralSignature(referral, referralPercentage, signature); if(!validSignature){ referralPercentage = 0; } _distributeFee(_fee, referral, referralPercentage); } function _distributeEther(uint256 fee, address[] memory destiny, uint256[] memory amounts) internal { _checkDistribution(fee + _sumAmounts(amounts) , destiny.length, amounts.length); uint length = destiny.length; for(uint i = 0; i < length; i++){ _sendEther(destiny[i], amounts[i]); } } /** * Distribute Native chain tokens */ function distributeEther( address[] memory destiny, uint256[] memory amounts ) public payable{ uint256 _fee = currentLevel(msg.sender).fee; _distributeEther(_fee, destiny, amounts); // _sendEther(team, _fee); _distributeFee(_fee, address(0), 0); } function distributeEtherReferral( address[] memory destiny, uint256[] memory amounts, address referral, uint256 referralPercentage, bytes memory signature ) public payable{ uint256 _fee = currentLevel(msg.sender).fee; _distributeEther(_fee, destiny, amounts); bool validSignature = _checkReferralSignature(referral, referralPercentage, signature); if(!validSignature){ referralPercentage = 0; } _distributeFee(_fee, referral, referralPercentage); } /** * Returns the current fee of user */ function distributionFee(address from) public view returns(uint256){ return _vipLevels[_purchasedVipLevel[from]].fee; } /** * Returns vip price of level */ function vipPrice(uint256 level) public view returns(uint256){ return _vipLevels[level].price; } /** * Assertions for fistribution */ function _checkDistribution( uint256 _fee, uint256 _destiny, uint256 _amounts ) internal{ require(_destiny == _amounts, "invalid lengths"); require(msg.value >= _fee, "insufficient fee"); } /** * Utility method for send native chain token */ function _sendEther(address to, uint256 amount) internal { (bool sended,) = payable(to).call{value: amount}(""); require(sended == true); } function changeFreePlanFee(uint256 amount) public{ require(hasRole(DEFAULT_ADMIN_ROLE, msg.sender)); _vipLevels[0] = VipLevel(0, amount, 0 ether, 0 days); } function getURL() public pure returns(string memory){ return "https://cryptosender.io"; } function getMessageHash( address referral, uint256 fee ) public pure returns (bytes32) { return keccak256(abi.encodePacked(referral, fee)); } function verifySignature(bytes32 messageHash, bytes memory signature) public pure returns (address) { // Use OpenZeppelin's ECDSA to recover the signer return ECDSAUpgradeable.recover(getEthSignedMessageHash(messageHash), signature); } function getEthSignedMessageHash(bytes32 _messageHash ) public pure returns (bytes32) { return keccak256(abi.encodePacked("\x19Ethereum Signed Message:\n32", _messageHash)); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.7.0) (utils/structs/EnumerableSet.sol) pragma solidity ^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. * * [WARNING] * ==== * Trying to delete such a structure from storage will likely result in data corruption, rendering the structure unusable. * See https://github.com/ethereum/solidity/pull/11843[ethereum/solidity#11843] for more info. * * In order to clean an EnumerableSet, you can either remove all elements one by one or create a fresh instance using an array of EnumerableSet. * ==== */ 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; if (lastIndex != toDeleteIndex) { 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] = valueIndex; // Replace lastValue's index to valueIndex } // 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) { return set._values[index]; } /** * @dev Return the entire set in an array * * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that * this function has an unbounded cost, and using it as part of a state-changing function may render the function * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block. */ function _values(Set storage set) private view returns (bytes32[] memory) { return set._values; } // 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); } /** * @dev Return the entire set in an array * * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that * this function has an unbounded cost, and using it as part of a state-changing function may render the function * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block. */ function values(Bytes32Set storage set) internal view returns (bytes32[] memory) { return _values(set._inner); } // 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)))); } /** * @dev Return the entire set in an array * * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that * this function has an unbounded cost, and using it as part of a state-changing function may render the function * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block. */ function values(AddressSet storage set) internal view returns (address[] memory) { bytes32[] memory store = _values(set._inner); address[] memory result; /// @solidity memory-safe-assembly assembly { result := store } return result; } // 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)); } /** * @dev Return the entire set in an array * * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that * this function has an unbounded cost, and using it as part of a state-changing function may render the function * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block. */ function values(UintSet storage set) internal view returns (uint256[] memory) { bytes32[] memory store = _values(set._inner); uint256[] memory result; /// @solidity memory-safe-assembly assembly { result := store } return result; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.6.0) (utils/math/SafeMath.sol) pragma solidity ^0.8.0; // CAUTION // This version of SafeMath should only be used with Solidity 0.8 or later, // because it relies on the compiler's built in overflow checks. /** * @dev Wrappers over Solidity's arithmetic operations. * * NOTE: `SafeMath` is generally not needed starting with Solidity 0.8, since the compiler * now has built in overflow checking. */ 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) { unchecked { uint256 c = a + b; if (c < a) return (false, 0); return (true, c); } } /** * @dev Returns the subtraction of two unsigned integers, with an overflow flag. * * _Available since v3.4._ */ function trySub(uint256 a, uint256 b) internal pure returns (bool, uint256) { unchecked { 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) { unchecked { // 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) { unchecked { 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) { unchecked { 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) { return a + b; } /** * @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) { 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) { return a * b; } /** * @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. * * Requirements: * * - The divisor cannot be zero. */ function div(uint256 a, uint256 b) internal pure returns (uint256) { 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) { 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) { unchecked { 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. * * 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) { unchecked { 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) { unchecked { require(b > 0, errorMessage); return a % b; } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (utils/introspection/IERC165.sol) pragma solidity ^0.8.0; /** * @dev Interface of the ERC165 standard, as defined in the * https://eips.ethereum.org/EIPS/eip-165[EIP]. * * Implementers can declare support of contract interfaces, which can then be * queried by others ({ERC165Checker}). * * For an implementation, see {ERC165}. */ interface IERC165Upgradeable { /** * @dev Returns true if this contract implements the interface defined by * `interfaceId`. See the corresponding * https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section] * to learn more about how these ids are created. * * This function call must use less than 30 000 gas. */ function supportsInterface(bytes4 interfaceId) external view returns (bool); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (utils/introspection/ERC165.sol) pragma solidity ^0.8.0; import "./IERC165Upgradeable.sol"; import "../../proxy/utils/Initializable.sol"; /** * @dev Implementation of the {IERC165} interface. * * Contracts that want to implement ERC165 should inherit from this contract and override {supportsInterface} to check * for the additional interface id that will be supported. For example: * * ```solidity * function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) { * return interfaceId == type(MyInterface).interfaceId || super.supportsInterface(interfaceId); * } * ``` * * Alternatively, {ERC165Storage} provides an easier to use but more expensive implementation. */ abstract contract ERC165Upgradeable is Initializable, IERC165Upgradeable { function __ERC165_init() internal onlyInitializing { } function __ERC165_init_unchained() internal onlyInitializing { } /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) { return interfaceId == type(IERC165Upgradeable).interfaceId; } /** * @dev This empty reserved space is put in place to allow future versions to add new * variables without shifting down storage in the inheritance chain. * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps */ uint256[50] private __gap; }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.7.0) (utils/cryptography/ECDSA.sol) pragma solidity ^0.8.0; import "../StringsUpgradeable.sol"; /** * @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 { enum RecoverError { NoError, InvalidSignature, InvalidSignatureLength, InvalidSignatureS, InvalidSignatureV } function _throwError(RecoverError error) private pure { if (error == RecoverError.NoError) { return; // no error: do nothing } else if (error == RecoverError.InvalidSignature) { revert("ECDSA: invalid signature"); } else if (error == RecoverError.InvalidSignatureLength) { revert("ECDSA: invalid signature length"); } else if (error == RecoverError.InvalidSignatureS) { revert("ECDSA: invalid signature 's' value"); } else if (error == RecoverError.InvalidSignatureV) { revert("ECDSA: invalid signature 'v' value"); } } /** * @dev Returns the address that signed a hashed message (`hash`) with * `signature` or error string. This address can then be used for verification purposes. * * The `ecrecover` EVM opcode allows for malleable (non-unique) signatures: * this function rejects them by requiring the `s` value to be in the lower * half order, and the `v` value to be either 27 or 28. * * IMPORTANT: `hash` _must_ be the result of a hash operation for the * verification to be secure: it is possible to craft signatures that * recover to arbitrary addresses for non-hashed data. A safe way to ensure * this is by receiving a hash of the original message (which may otherwise * be too long), and then calling {toEthSignedMessageHash} on it. * * Documentation for signature generation: * - with https://web3js.readthedocs.io/en/v1.3.4/web3-eth-accounts.html#sign[Web3.js] * - with https://docs.ethers.io/v5/api/signer/#Signer-signMessage[ethers] * * _Available since v4.3._ */ function tryRecover(bytes32 hash, bytes memory signature) internal pure returns (address, RecoverError) { // Check the signature length // - case 65: r,s,v signature (standard) // - case 64: r,vs signature (cf https://eips.ethereum.org/EIPS/eip-2098) _Available since v4.1._ if (signature.length == 65) { bytes32 r; bytes32 s; uint8 v; // ecrecover takes the signature parameters, and the only way to get them // currently is to use assembly. /// @solidity memory-safe-assembly assembly { r := mload(add(signature, 0x20)) s := mload(add(signature, 0x40)) v := byte(0, mload(add(signature, 0x60))) } return tryRecover(hash, v, r, s); } else if (signature.length == 64) { bytes32 r; bytes32 vs; // ecrecover takes the signature parameters, and the only way to get them // currently is to use assembly. /// @solidity memory-safe-assembly assembly { r := mload(add(signature, 0x20)) vs := mload(add(signature, 0x40)) } return tryRecover(hash, r, vs); } else { return (address(0), RecoverError.InvalidSignatureLength); } } /** * @dev Returns the address that signed a hashed message (`hash`) with * `signature`. This address can then be used for verification purposes. * * The `ecrecover` EVM opcode allows for malleable (non-unique) signatures: * this function rejects them by requiring the `s` value to be in the lower * half order, and the `v` value to be either 27 or 28. * * IMPORTANT: `hash` _must_ be the result of a hash operation for the * verification to be secure: it is possible to craft signatures that * recover to arbitrary addresses for non-hashed data. A safe way to ensure * this is by receiving a hash of the original message (which may otherwise * be too long), and then calling {toEthSignedMessageHash} on it. */ function recover(bytes32 hash, bytes memory signature) internal pure returns (address) { (address recovered, RecoverError error) = tryRecover(hash, signature); _throwError(error); return recovered; } /** * @dev Overload of {ECDSA-tryRecover} that receives the `r` and `vs` short-signature fields separately. * * See https://eips.ethereum.org/EIPS/eip-2098[EIP-2098 short signatures] * * _Available since v4.3._ */ function tryRecover( bytes32 hash, bytes32 r, bytes32 vs ) internal pure returns (address, RecoverError) { bytes32 s = vs & bytes32(0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff); uint8 v = uint8((uint256(vs) >> 255) + 27); return tryRecover(hash, v, r, s); } /** * @dev Overload of {ECDSA-recover} that receives the `r and `vs` short-signature fields separately. * * _Available since v4.2._ */ function recover( bytes32 hash, bytes32 r, bytes32 vs ) internal pure returns (address) { (address recovered, RecoverError error) = tryRecover(hash, r, vs); _throwError(error); return recovered; } /** * @dev Overload of {ECDSA-tryRecover} that receives the `v`, * `r` and `s` signature fields separately. * * _Available since v4.3._ */ function tryRecover( bytes32 hash, uint8 v, bytes32 r, bytes32 s ) internal pure returns (address, RecoverError) { // EIP-2 still allows signature malleability for ecrecover(). Remove this possibility and make the signature // unique. Appendix F in the Ethereum Yellow paper (https://ethereum.github.io/yellowpaper/paper.pdf), defines // the valid range for s in (301): 0 < s < secp256k1n ÷ 2 + 1, and for v in (302): v ∈ {27, 28}. Most // signatures from current libraries generate a unique signature with an s-value in the lower half order. // // If your library generates malleable signatures, such as s-values in the upper range, calculate a new s-value // with 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEBAAEDCE6AF48A03BBFD25E8CD0364141 - s1 and flip v from 27 to 28 or // vice versa. If your library also generates signatures with 0/1 for v instead 27/28, add 27 to v to accept // these malleable signatures as well. if (uint256(s) > 0x7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF5D576E7357A4501DDFE92F46681B20A0) { return (address(0), RecoverError.InvalidSignatureS); } if (v != 27 && v != 28) { return (address(0), RecoverError.InvalidSignatureV); } // If the signature is valid (and not malleable), return the signer address address signer = ecrecover(hash, v, r, s); if (signer == address(0)) { return (address(0), RecoverError.InvalidSignature); } return (signer, RecoverError.NoError); } /** * @dev Overload of {ECDSA-recover} that receives the `v`, * `r` and `s` signature fields separately. */ function recover( bytes32 hash, uint8 v, bytes32 r, bytes32 s ) internal pure returns (address) { (address recovered, RecoverError error) = tryRecover(hash, v, r, s); _throwError(error); return recovered; } /** * @dev Returns an Ethereum Signed Message, created from a `hash`. This * produces hash corresponding to the one signed with the * https://eth.wiki/json-rpc/API#eth_sign[`eth_sign`] * JSON-RPC method as part of EIP-191. * * See {recover}. */ function toEthSignedMessageHash(bytes32 hash) internal pure returns (bytes32) { // 32 is the length in bytes of hash, // enforced by the type signature above return keccak256(abi.encodePacked("\x19Ethereum Signed Message:\n32", hash)); } /** * @dev Returns an Ethereum Signed Message, created from `s`. This * produces hash corresponding to the one signed with the * https://eth.wiki/json-rpc/API#eth_sign[`eth_sign`] * JSON-RPC method as part of EIP-191. * * See {recover}. */ function toEthSignedMessageHash(bytes memory s) internal pure returns (bytes32) { return keccak256(abi.encodePacked("\x19Ethereum Signed Message:\n", StringsUpgradeable.toString(s.length), s)); } /** * @dev Returns an Ethereum Signed Typed Data, created from a * `domainSeparator` and a `structHash`. This produces hash corresponding * to the one signed with the * https://eips.ethereum.org/EIPS/eip-712[`eth_signTypedData`] * JSON-RPC method as part of EIP-712. * * See {recover}. */ function toTypedDataHash(bytes32 domainSeparator, bytes32 structHash) internal pure returns (bytes32) { return keccak256(abi.encodePacked("\x19\x01", domainSeparator, structHash)); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.7.0) (utils/Strings.sol) pragma solidity ^0.8.0; /** * @dev String operations. */ library StringsUpgradeable { bytes16 private constant _HEX_SYMBOLS = "0123456789abcdef"; uint8 private constant _ADDRESS_LENGTH = 20; /** * @dev Converts a `uint256` to its ASCII `string` decimal representation. */ function toString(uint256 value) internal pure returns (string memory) { // Inspired by OraclizeAPI's implementation - MIT licence // https://github.com/oraclize/ethereum-api/blob/b42146b063c7d6ee1358846c198246239e9360e8/oraclizeAPI_0.4.25.sol if (value == 0) { return "0"; } uint256 temp = value; uint256 digits; while (temp != 0) { digits++; temp /= 10; } bytes memory buffer = new bytes(digits); while (value != 0) { digits -= 1; buffer[digits] = bytes1(uint8(48 + uint256(value % 10))); value /= 10; } return string(buffer); } /** * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation. */ function toHexString(uint256 value) internal pure returns (string memory) { if (value == 0) { return "0x00"; } uint256 temp = value; uint256 length = 0; while (temp != 0) { length++; temp >>= 8; } return toHexString(value, length); } /** * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation with fixed length. */ function toHexString(uint256 value, uint256 length) internal pure returns (string memory) { bytes memory buffer = new bytes(2 * length + 2); buffer[0] = "0"; buffer[1] = "x"; for (uint256 i = 2 * length + 1; i > 1; --i) { buffer[i] = _HEX_SYMBOLS[value & 0xf]; value >>= 4; } require(value == 0, "Strings: hex length insufficient"); return string(buffer); } /** * @dev Converts an `address` with fixed length of 20 bytes to its not checksummed ASCII `string` hexadecimal representation. */ function toHexString(address addr) internal pure returns (string memory) { return toHexString(uint256(uint160(addr)), _ADDRESS_LENGTH); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (utils/Context.sol) pragma solidity ^0.8.0; import "../proxy/utils/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 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 onlyInitializing { } function __Context_init_unchained() internal onlyInitializing { } function _msgSender() internal view virtual returns (address) { return msg.sender; } function _msgData() internal view virtual returns (bytes calldata) { return msg.data; } /** * @dev This empty reserved space is put in place to allow future versions to add new * variables without shifting down storage in the inheritance chain. * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps */ uint256[50] private __gap; }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.7.0) (utils/Address.sol) pragma solidity ^0.8.1; /** * @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 * ==== * * [IMPORTANT] * ==== * You shouldn't rely on `isContract` to protect against flash loan attacks! * * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract * constructor. * ==== */ function isContract(address account) internal view returns (bool) { // This method relies on extcodesize/address.code.length, which returns 0 // for contracts in construction, since the code is only stored at the end // of the constructor execution. return account.code.length > 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"); (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"); (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"); (bool success, bytes memory returndata) = target.staticcall(data); return verifyCallResult(success, returndata, errorMessage); } /** * @dev Tool to verifies that a low level call was successful, and revert if it wasn't, either by bubbling the * revert reason using the provided one. * * _Available since v4.3._ */ function verifyCallResult( bool success, bytes memory returndata, string memory errorMessage ) internal 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 /// @solidity memory-safe-assembly assembly { let returndata_size := mload(returndata) revert(add(32, returndata), returndata_size) } } else { revert(errorMessage); } } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.7.0) (token/ERC721/IERC721.sol) pragma solidity ^0.8.0; import "../../utils/introspection/IERC165Upgradeable.sol"; /** * @dev Required interface of an ERC721 compliant contract. */ interface IERC721Upgradeable is IERC165Upgradeable { /** * @dev Emitted when `tokenId` token is transferred from `from` to `to`. */ event Transfer(address indexed from, address indexed to, uint256 indexed tokenId); /** * @dev Emitted when `owner` enables `approved` to manage the `tokenId` token. */ event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId); /** * @dev Emitted when `owner` enables or disables (`approved`) `operator` to manage all of its assets. */ event ApprovalForAll(address indexed owner, address indexed operator, bool approved); /** * @dev Returns the number of tokens in ``owner``'s account. */ function balanceOf(address owner) external view returns (uint256 balance); /** * @dev Returns the owner of the `tokenId` token. * * Requirements: * * - `tokenId` must exist. */ function ownerOf(uint256 tokenId) external view returns (address owner); /** * @dev Safely transfers `tokenId` token from `from` to `to`. * * Requirements: * * - `from` cannot be the zero address. * - `to` cannot be the zero address. * - `tokenId` token must exist and be owned by `from`. * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}. * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer. * * Emits a {Transfer} event. */ function safeTransferFrom( address from, address to, uint256 tokenId, bytes calldata data ) external; /** * @dev Safely transfers `tokenId` token from `from` to `to`, checking first that contract recipients * are aware of the ERC721 protocol to prevent tokens from being forever locked. * * Requirements: * * - `from` cannot be the zero address. * - `to` cannot be the zero address. * - `tokenId` token must exist and be owned by `from`. * - If the caller is not `from`, it must have been allowed to move this token by either {approve} or {setApprovalForAll}. * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer. * * Emits a {Transfer} event. */ function safeTransferFrom( address from, address to, uint256 tokenId ) external; /** * @dev Transfers `tokenId` token from `from` to `to`. * * WARNING: Usage of this method is discouraged, use {safeTransferFrom} whenever possible. * * Requirements: * * - `from` cannot be the zero address. * - `to` cannot be the zero address. * - `tokenId` token must be owned by `from`. * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}. * * Emits a {Transfer} event. */ function transferFrom( address from, address to, uint256 tokenId ) external; /** * @dev Gives permission to `to` to transfer `tokenId` token to another account. * The approval is cleared when the token is transferred. * * Only a single account can be approved at a time, so approving the zero address clears previous approvals. * * Requirements: * * - The caller must own the token or be an approved operator. * - `tokenId` must exist. * * Emits an {Approval} event. */ function approve(address to, uint256 tokenId) external; /** * @dev Approve or remove `operator` as an operator for the caller. * Operators can call {transferFrom} or {safeTransferFrom} for any token owned by the caller. * * Requirements: * * - The `operator` cannot be the caller. * * Emits an {ApprovalForAll} event. */ function setApprovalForAll(address operator, bool _approved) external; /** * @dev Returns the account approved for `tokenId` token. * * Requirements: * * - `tokenId` must exist. */ function getApproved(uint256 tokenId) external view returns (address operator); /** * @dev Returns if the `operator` is allowed to manage all of the assets of `owner`. * * See {setApprovalForAll} */ function isApprovedForAll(address owner, address operator) external view returns (bool); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.6.0) (token/ERC20/IERC20.sol) pragma solidity ^0.8.0; /** * @dev Interface of the ERC20 standard as defined in the EIP. */ interface IERC20Upgradeable { /** * @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); /** * @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 `to`. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transfer(address to, 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 `from` to `to` 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 from, address to, uint256 amount ) external returns (bool); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.7.0) (proxy/utils/Initializable.sol) pragma solidity ^0.8.2; 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 proxied contracts do not make use of 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. * * The initialization functions use a version number. Once a version number is used, it is consumed and cannot be * reused. This mechanism prevents re-execution of each "step" but allows the creation of new initialization steps in * case an upgrade adds a module that needs to be initialized. * * For example: * * [.hljs-theme-light.nopadding] * ``` * contract MyToken is ERC20Upgradeable { * function initialize() initializer public { * __ERC20_init("MyToken", "MTK"); * } * } * contract MyTokenV2 is MyToken, ERC20PermitUpgradeable { * function initializeV2() reinitializer(2) public { * __ERC20Permit_init("MyToken"); * } * } * ``` * * 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 {ERC1967Proxy-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. * * [CAUTION] * ==== * Avoid leaving a contract uninitialized. * * An uninitialized contract can be taken over by an attacker. This applies to both a proxy and its implementation * contract, which may impact the proxy. To prevent the implementation contract from being used, you should invoke * the {_disableInitializers} function in the constructor to automatically lock it when it is deployed: * * [.hljs-theme-light.nopadding] * ``` * /// @custom:oz-upgrades-unsafe-allow constructor * constructor() { * _disableInitializers(); * } * ``` * ==== */ abstract contract Initializable { /** * @dev Indicates that the contract has been initialized. * @custom:oz-retyped-from bool */ uint8 private _initialized; /** * @dev Indicates that the contract is in the process of being initialized. */ bool private _initializing; /** * @dev Triggered when the contract has been initialized or reinitialized. */ event Initialized(uint8 version); /** * @dev A modifier that defines a protected initializer function that can be invoked at most once. In its scope, * `onlyInitializing` functions can be used to initialize parent contracts. Equivalent to `reinitializer(1)`. */ modifier initializer() { bool isTopLevelCall = !_initializing; require( (isTopLevelCall && _initialized < 1) || (!AddressUpgradeable.isContract(address(this)) && _initialized == 1), "Initializable: contract is already initialized" ); _initialized = 1; if (isTopLevelCall) { _initializing = true; } _; if (isTopLevelCall) { _initializing = false; emit Initialized(1); } } /** * @dev A modifier that defines a protected reinitializer function that can be invoked at most once, and only if the * contract hasn't been initialized to a greater version before. In its scope, `onlyInitializing` functions can be * used to initialize parent contracts. * * `initializer` is equivalent to `reinitializer(1)`, so a reinitializer may be used after the original * initialization step. This is essential to configure modules that are added through upgrades and that require * initialization. * * Note that versions can jump in increments greater than 1; this implies that if multiple reinitializers coexist in * a contract, executing them in the right order is up to the developer or operator. */ modifier reinitializer(uint8 version) { require(!_initializing && _initialized < version, "Initializable: contract is already initialized"); _initialized = version; _initializing = true; _; _initializing = false; emit Initialized(version); } /** * @dev Modifier to protect an initialization function so that it can only be invoked by functions with the * {initializer} and {reinitializer} modifiers, directly or indirectly. */ modifier onlyInitializing() { require(_initializing, "Initializable: contract is not initializing"); _; } /** * @dev Locks the contract, preventing any future reinitialization. This cannot be part of an initializer call. * Calling this in the constructor of a contract will prevent that contract from being initialized or reinitialized * to any version. It is recommended to use this to lock implementation contracts that are designed to be called * through proxies. */ function _disableInitializers() internal virtual { require(!_initializing, "Initializable: contract is initializing"); if (_initialized < type(uint8).max) { _initialized = type(uint8).max; emit Initialized(type(uint8).max); } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (access/IAccessControl.sol) pragma solidity ^0.8.0; /** * @dev External interface of AccessControl declared to support ERC165 detection. */ interface IAccessControlUpgradeable { /** * @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 {AccessControl-_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) external view returns (bool); /** * @dev Returns the admin role that controls `role`. See {grantRole} and * {revokeRole}. * * To change a role's admin, use {AccessControl-_setRoleAdmin}. */ function getRoleAdmin(bytes32 role) external view returns (bytes32); /** * @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) external; /** * @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) external; /** * @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) external; }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (access/IAccessControlEnumerable.sol) pragma solidity ^0.8.0; import "./IAccessControlUpgradeable.sol"; /** * @dev External interface of AccessControlEnumerable declared to support ERC165 detection. */ interface IAccessControlEnumerableUpgradeable is IAccessControlUpgradeable { /** * @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) external view returns (address); /** * @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) external view returns (uint256); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.7.0) (access/AccessControl.sol) pragma solidity ^0.8.0; import "./IAccessControlUpgradeable.sol"; import "../utils/ContextUpgradeable.sol"; import "../utils/StringsUpgradeable.sol"; import "../utils/introspection/ERC165Upgradeable.sol"; import "../proxy/utils/Initializable.sol"; /** * @dev Contract module that allows children to implement role-based access * control mechanisms. This is a lightweight version that doesn't allow enumerating role * members except through off-chain means by accessing the contract event logs. Some * applications may benefit from on-chain enumerability, for those cases see * {AccessControlEnumerable}. * * Roles are referred to by their `bytes32` identifier. These should be exposed * in the external API and be unique. The best way to achieve this is by * using `public constant` hash digests: * * ``` * bytes32 public constant MY_ROLE = keccak256("MY_ROLE"); * ``` * * Roles can be used to represent a set of permissions. To restrict access to a * function call, use {hasRole}: * * ``` * function foo() public { * require(hasRole(MY_ROLE, msg.sender)); * ... * } * ``` * * Roles can be granted and revoked dynamically via the {grantRole} and * {revokeRole} functions. Each role has an associated admin role, and only * accounts that have a role's admin role can call {grantRole} and {revokeRole}. * * By default, the admin role for all roles is `DEFAULT_ADMIN_ROLE`, which means * that only accounts with this role will be able to grant or revoke other * roles. More complex role relationships can be created by using * {_setRoleAdmin}. * * WARNING: The `DEFAULT_ADMIN_ROLE` is also its own admin: it has permission to * grant and revoke this role. Extra precautions should be taken to secure * accounts that have been granted it. */ abstract contract AccessControlUpgradeable is Initializable, ContextUpgradeable, IAccessControlUpgradeable, ERC165Upgradeable { function __AccessControl_init() internal onlyInitializing { } function __AccessControl_init_unchained() internal onlyInitializing { } struct RoleData { mapping(address => bool) members; bytes32 adminRole; } mapping(bytes32 => RoleData) private _roles; bytes32 public constant DEFAULT_ADMIN_ROLE = 0x00; /** * @dev Modifier that checks that an account has a specific role. Reverts * with a standardized message including the required role. * * The format of the revert reason is given by the following regular expression: * * /^AccessControl: account (0x[0-9a-f]{40}) is missing role (0x[0-9a-f]{64})$/ * * _Available since v4.1._ */ modifier onlyRole(bytes32 role) { _checkRole(role); _; } /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) { return interfaceId == type(IAccessControlUpgradeable).interfaceId || super.supportsInterface(interfaceId); } /** * @dev Returns `true` if `account` has been granted `role`. */ function hasRole(bytes32 role, address account) public view virtual override returns (bool) { return _roles[role].members[account]; } /** * @dev Revert with a standard message if `_msgSender()` is missing `role`. * Overriding this function changes the behavior of the {onlyRole} modifier. * * Format of the revert message is described in {_checkRole}. * * _Available since v4.6._ */ function _checkRole(bytes32 role) internal view virtual { _checkRole(role, _msgSender()); } /** * @dev Revert with a standard message if `account` is missing `role`. * * The format of the revert reason is given by the following regular expression: * * /^AccessControl: account (0x[0-9a-f]{40}) is missing role (0x[0-9a-f]{64})$/ */ function _checkRole(bytes32 role, address account) internal view virtual { if (!hasRole(role, account)) { revert( string( abi.encodePacked( "AccessControl: account ", StringsUpgradeable.toHexString(uint160(account), 20), " is missing role ", StringsUpgradeable.toHexString(uint256(role), 32) ) ) ); } } /** * @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 virtual override returns (bytes32) { return _roles[role].adminRole; } /** * @dev Grants `role` to `account`. * * If `account` had not been already granted `role`, emits a {RoleGranted} * event. * * Requirements: * * - the caller must have ``role``'s admin role. * * May emit a {RoleGranted} event. */ function grantRole(bytes32 role, address account) public virtual override onlyRole(getRoleAdmin(role)) { _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. * * May emit a {RoleRevoked} event. */ function revokeRole(bytes32 role, address account) public virtual override onlyRole(getRoleAdmin(role)) { _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 revoked `role`, emits a {RoleRevoked} * event. * * Requirements: * * - the caller must be `account`. * * May emit a {RoleRevoked} event. */ function renounceRole(bytes32 role, address account) public virtual override { require(account == _msgSender(), "AccessControl: can only renounce roles for self"); _revokeRole(role, account); } /** * @dev Grants `role` to `account`. * * If `account` had not been already granted `role`, emits a {RoleGranted} * event. Note that unlike {grantRole}, this function doesn't perform any * checks on the calling account. * * May emit a {RoleGranted} event. * * [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}. * ==== * * NOTE: This function is deprecated in favor of {_grantRole}. */ 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 { bytes32 previousAdminRole = getRoleAdmin(role); _roles[role].adminRole = adminRole; emit RoleAdminChanged(role, previousAdminRole, adminRole); } /** * @dev Grants `role` to `account`. * * Internal function without access restriction. * * May emit a {RoleGranted} event. */ function _grantRole(bytes32 role, address account) internal virtual { if (!hasRole(role, account)) { _roles[role].members[account] = true; emit RoleGranted(role, account, _msgSender()); } } /** * @dev Revokes `role` from `account`. * * Internal function without access restriction. * * May emit a {RoleRevoked} event. */ function _revokeRole(bytes32 role, address account) internal virtual { if (hasRole(role, account)) { _roles[role].members[account] = false; emit RoleRevoked(role, account, _msgSender()); } } /** * @dev This empty reserved space is put in place to allow future versions to add new * variables without shifting down storage in the inheritance chain. * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps */ uint256[49] private __gap; }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.5.0) (access/AccessControlEnumerable.sol) pragma solidity ^0.8.0; import "./IAccessControlEnumerableUpgradeable.sol"; import "./AccessControlUpgradeable.sol"; import "../utils/structs/EnumerableSetUpgradeable.sol"; import "../proxy/utils/Initializable.sol"; /** * @dev Extension of {AccessControl} that allows enumerating the members of each role. */ abstract contract AccessControlEnumerableUpgradeable is Initializable, IAccessControlEnumerableUpgradeable, AccessControlUpgradeable { function __AccessControlEnumerable_init() internal onlyInitializing { } function __AccessControlEnumerable_init_unchained() internal onlyInitializing { } using EnumerableSetUpgradeable for EnumerableSetUpgradeable.AddressSet; mapping(bytes32 => EnumerableSetUpgradeable.AddressSet) private _roleMembers; /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) { return interfaceId == type(IAccessControlEnumerableUpgradeable).interfaceId || super.supportsInterface(interfaceId); } /** * @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 virtual override returns (address) { return _roleMembers[role].at(index); } /** * @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 virtual override returns (uint256) { return _roleMembers[role].length(); } /** * @dev Overload {_grantRole} to track enumerable memberships */ function _grantRole(bytes32 role, address account) internal virtual override { super._grantRole(role, account); _roleMembers[role].add(account); } /** * @dev Overload {_revokeRole} to track enumerable memberships */ function _revokeRole(bytes32 role, address account) internal virtual override { super._revokeRole(role, account); _roleMembers[role].remove(account); } /** * @dev This empty reserved space is put in place to allow future versions to add new * variables without shifting down storage in the inheritance chain. * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps */ uint256[49] private __gap; }
{ "remappings": [], "optimizer": { "enabled": true, "runs": 200 }, "evmVersion": "london", "libraries": {}, "outputSelection": { "*": { "*": [ "evm.bytecode", "evm.deployedBytecode", "devdoc", "userdoc", "metadata", "abi" ] } } }
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
[{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint8","name":"version","type":"uint8"}],"name":"Initialized","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"},{"inputs":[],"name":"DEFAULT_ADMIN_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"level","type":"uint256"},{"internalType":"uint256","name":"fee","type":"uint256"},{"internalType":"uint256","name":"price","type":"uint256"},{"internalType":"uint256","name":"vipTime","type":"uint256"}],"name":"addVipLevel","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256[]","name":"level","type":"uint256[]"},{"internalType":"uint256[]","name":"fee","type":"uint256[]"},{"internalType":"uint256[]","name":"price","type":"uint256[]"},{"internalType":"uint256[]","name":"vipTime","type":"uint256[]"}],"name":"addVipsLevel","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"changeFreePlanFee","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"user","type":"address"}],"name":"currentLevel","outputs":[{"components":[{"internalType":"uint256","name":"level","type":"uint256"},{"internalType":"uint256","name":"fee","type":"uint256"},{"internalType":"uint256","name":"price","type":"uint256"},{"internalType":"uint256","name":"vipTime","type":"uint256"}],"internalType":"struct Cryptosender.VipLevel","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"token","type":"address"},{"internalType":"address[]","name":"destiny","type":"address[]"},{"internalType":"uint256[]","name":"amounts","type":"uint256[]"}],"name":"distribute","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address[]","name":"destiny","type":"address[]"},{"internalType":"uint256[]","name":"amounts","type":"uint256[]"}],"name":"distributeEther","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address[]","name":"destiny","type":"address[]"},{"internalType":"uint256[]","name":"amounts","type":"uint256[]"},{"internalType":"address","name":"referral","type":"address"},{"internalType":"uint256","name":"referralPercentage","type":"uint256"},{"internalType":"bytes","name":"signature","type":"bytes"}],"name":"distributeEtherReferral","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"token","type":"address"},{"internalType":"address[]","name":"destiny","type":"address[]"},{"internalType":"uint256[]","name":"amounts","type":"uint256[]"},{"internalType":"address","name":"referral","type":"address"},{"internalType":"uint256","name":"referralPercentage","type":"uint256"},{"internalType":"bytes","name":"signature","type":"bytes"}],"name":"distributeReferral","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"}],"name":"distributionFee","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"_messageHash","type":"bytes32"}],"name":"getEthSignedMessageHash","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"pure","type":"function"},{"inputs":[{"internalType":"address","name":"referral","type":"address"},{"internalType":"uint256","name":"fee","type":"uint256"}],"name":"getMessageHash","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"pure","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":[],"name":"getURL","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"pure","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":[],"name":"initialize","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"level","type":"uint256"}],"name":"purchaseVip","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"uint256","name":"level","type":"uint256"},{"internalType":"address","name":"referral","type":"address"},{"internalType":"uint256","name":"referralPercentage","type":"uint256"},{"internalType":"bytes","name":"signature","type":"bytes"}],"name":"purchaseVipReferral","outputs":[],"stateMutability":"payable","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":[{"internalType":"bytes4","name":"interfaceId","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"messageHash","type":"bytes32"},{"internalType":"bytes","name":"signature","type":"bytes"}],"name":"verifySignature","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"pure","type":"function"},{"inputs":[{"internalType":"uint256","name":"level","type":"uint256"}],"name":"vipPrice","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"}]
Contract Creation Code
608060405234801561001057600080fd5b506123e1806100206000396000f3fe6080604052600436106101815760003560e01c80638129fc1c116100d1578063a217fddf1161008a578063ca15c87311610064578063ca15c873146104c4578063d547741f146104e4578063daca6f7814610504578063fa5408011461052457600080fd5b8063a217fddf14610456578063b92038811461046b578063c3185e98146104b157600080fd5b80638129fc1c146103b05780639010d07c146103c557806391d14854146103fd578063938afad91461041d5780639c67fab6146104305780639e7934db1461044357600080fd5b806338bcdc1c1161013e5780635581ed26116101185780635581ed26146102fd578063691a037a1461031d57806375bb19711461037057806378a5f67f1461039057600080fd5b806338bcdc1c1461027e5780634cab824c146102ca578063512c91df146102dd57600080fd5b806301ffc9a7146101865780630b75360c146101bb57806315270ace146101f9578063248a9ca31461020e5780632f2ff15d1461023e57806336568abe1461025e575b600080fd5b34801561019257600080fd5b506101a66101a1366004611b83565b610544565b60405190151581526020015b60405180910390f35b3480156101c757600080fd5b506101eb6101d6366004611bad565b600090815260cb602052604090206002015490565b6040519081526020016101b2565b61020c610207366004611d1a565b61056f565b005b34801561021a57600080fd5b506101eb610229366004611bad565b60009081526065602052604090206001015490565b34801561024a57600080fd5b5061020c610259366004611d8e565b61059e565b34801561026a57600080fd5b5061020c610279366004611d8e565b6105c8565b34801561028a57600080fd5b50604080518082018252601781527f68747470733a2f2f63727970746f73656e6465722e696f000000000000000000602082015290516101b29190611de6565b61020c6102d8366004611bad565b61064b565b3480156102e957600080fd5b506101eb6102f8366004611e19565b610663565b34801561030957600080fd5b5061020c610318366004611e43565b6106aa565b34801561032957600080fd5b5061033d610338366004611e75565b610705565b6040516101b291908151815260208083015190820152604080830151908201526060918201519181019190915260800190565b34801561037c57600080fd5b5061020c61038b366004611bad565b610888565b34801561039c57600080fd5b5061020c6103ab366004611e90565b610958565b3480156103bc57600080fd5b5061020c610a70565b3480156103d157600080fd5b506103e56103e0366004611f3d565b610c2d565b6040516001600160a01b0390911681526020016101b2565b34801561040957600080fd5b506101a6610418366004611d8e565b610c4c565b61020c61042b366004611fcf565b610c77565b61020c61043e366004612081565b610cc2565b61020c610451366004612124565b610d0b565b34801561046257600080fd5b506101eb600081565b34801561047757600080fd5b506101eb610486366004611e75565b6001600160a01b0316600090815260c96020908152604080832054835260cb90915290206001015490565b61020c6104bf366004612188565b610d33565b3480156104d057600080fd5b506101eb6104df366004611bad565b610da0565b3480156104f057600080fd5b5061020c6104ff366004611d8e565b610db7565b34801561051057600080fd5b506103e561051f3660046121dd565b610ddc565b34801561053057600080fd5b506101eb61053f366004611bad565b610df0565b60006001600160e01b03198216635a05180f60e01b1480610569575061056982610e43565b92915050565b600061057a33610705565b60200151905061058c81858585610e78565b61059881600080610f75565b50505050565b6000828152606560205260409020600101546105b981610fca565b6105c38383610fd4565b505050565b6001600160a01b038116331461063d5760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201526e103937b632b9903337b91039b2b63360891b60648201526084015b60405180910390fd5b6106478282610ff6565b5050565b61065481611018565b61066034600080610f75565b50565b6040516bffffffffffffffffffffffff19606084901b1660208201526034810182905260009060540160405160208183030381529060405280519060200120905092915050565b6106b5600033610c4c565b6106be57600080fd5b60408051608081018252858152602080820195865281830194855260608201938452600096875260cb90529420935184559151600184015551600283015551600390910155565b6107306040518060800160405280600081526020016000815260200160008152602001600081525090565b6001600160a01b038216600090815260ca602090815260408083205460c9835281842054845260cb90925282206003015490919061076e9083612230565b90508042111561082e57505060008052505060cb6020908152604080516080810182527f4239c2c8c3d9b94feb214b0f54d7c869ce1ceb63517be57644336cda4967a4685481527f4239c2c8c3d9b94feb214b0f54d7c869ce1ceb63517be57644336cda4967a46954928101929092527f4239c2c8c3d9b94feb214b0f54d7c869ce1ceb63517be57644336cda4967a46a54908201527f4239c2c8c3d9b94feb214b0f54d7c869ce1ceb63517be57644336cda4967a46b54606082015290565b5050506001600160a01b0316600090815260c96020908152604080832054835260cb825291829020825160808101845281548152600182015492810192909252600281015492820192909252600390910154606082015290565b610893600033610c4c565b61089c57600080fd5b60408051608081018252600080825260208083019485529282018181526060830182815291805260cb90935290517f4239c2c8c3d9b94feb214b0f54d7c869ce1ceb63517be57644336cda4967a4685591517f4239c2c8c3d9b94feb214b0f54d7c869ce1ceb63517be57644336cda4967a46955517f4239c2c8c3d9b94feb214b0f54d7c869ce1ceb63517be57644336cda4967a46a55517f4239c2c8c3d9b94feb214b0f54d7c869ce1ceb63517be57644336cda4967a46b55565b610963600033610c4c565b61096c57600080fd5b835160005b81811015610a6857604051806080016040528087838151811061099657610996612248565b602002602001015181526020018683815181106109b5576109b5612248565b602002602001015181526020018583815181106109d4576109d4612248565b602002602001015181526020018483815181106109f3576109f3612248565b602002602001015181525060cb6000888481518110610a1457610a14612248565b60200260200101518152602001908152602001600020600082015181600001556020820151816001015560408201518160020155606082015181600301559050508080610a609061225e565b915050610971565b505050505050565b600054610100900460ff1615808015610a905750600054600160ff909116105b80610aaa5750303b158015610aaa575060005460ff166001145b610b0d5760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b6064820152608401610634565b6000805460ff191660011790558015610b30576000805461ff0019166101001790555b610b38611103565b610b40611103565b610b48611103565b610b50611103565b610b5b600033611170565b60cc80546001600160a01b03191633179055610b81600066470de4df82000081806106aa565b610b9a60016000670de0b6b3a7640000620151806106aa565b610bb3600260006729a2241af62c000062093a806106aa565b610bcc60036000674563918244f4000062278d006106aa565b610be560046000678ac7230489e800006276a7006106aa565b8015610660576000805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a150565b6000828152609760205260408120610c45908361117a565b9392505050565b60009182526065602090815260408084206001600160a01b0393909316845291905290205460ff1690565b6000610c8233610705565b602001519050610c9481888888610e78565b6000610ca1858585611186565b905080610cad57600093505b610cb8828686610f75565b5050505050505050565b6000610ccd33610705565b602001519050610cde8187876111ca565b6000610ceb858585611186565b905080610cf757600093505b610d02828686610f75565b50505050505050565b6000610d1633610705565b602001519050610d278184846111ca565b6105c381600080610f75565b6019821115610d725760405162461bcd60e51b815260206004820152600b60248201526a496e76616c69642066656560a81b6044820152606401610634565b610d7b84611018565b346000610d89858585611186565b905080610d9557600093505b610a68828686610f75565b600081815260976020526040812061056990611244565b600082815260656020526040902060010154610dd281610fca565b6105c38383610ff6565b6000610c45610dea84610df0565b8361124e565b6040517f19457468657265756d205369676e6564204d6573736167653a0a3332000000006020820152603c8101829052600090605c01604051602081830303815290604052805190602001209050919050565b60006001600160e01b03198216637965db0b60e01b148061056957506301ffc9a760e01b6001600160e01b0319831614610569565b81518151610e899086908390611272565b60005b81811015610a6857846001600160a01b03166323b872dd33868481518110610eb657610eb6612248565b6020026020010151868581518110610ed057610ed0612248565b60209081029190910101516040516001600160e01b031960e086901b1681526001600160a01b0393841660048201529290911660248301526044820152606401602060405180830381600087803b158015610f2a57600080fd5b505af1158015610f3e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f629190612279565b5080610f6d8161225e565b915050610e8c565b60006064610f83838661229b565b610f8d91906122ba565b90506000610f9b82866122dc565b90508115610fad57610fad84836112f6565b60cc54610fc3906001600160a01b0316826112f6565b5050505050565b610660813361135c565b610fde82826113c0565b60008281526097602052604090206105c39082611446565b611000828261145b565b60008281526097602052604090206105c390826114c2565b600081815260cb60209081526040918290208251608081018452815481526001820154928101929092526002810154928201839052600301546060820152908261106133610705565b511061109a5760405162461bcd60e51b8152602060048201526008602482015267139bc81b195d995b60c21b6044820152606401610634565b803410156110e15760405162461bcd60e51b8152602060048201526014602482015273496e73756666696369656e742062616c616e636560601b6044820152606401610634565b505033600090815260c9602090815260408083209390935560ca905220429055565b600054610100900460ff1661116e5760405162461bcd60e51b815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201526a6e697469616c697a696e6760a81b6064820152608401610634565b565b6106478282610fd4565b6000610c4583836114d7565b6000806111938585610663565b905060006111a18285610ddc565b6001600160a01b031673d56e3f542bfd2d0aead54c7fdd7e6d2b784dd819149695505050505050565b6111e96111d682611501565b6111e09085612230565b83518351611272565b815160005b81811015610fc35761123284828151811061120b5761120b612248565b602002602001015184838151811061122557611225612248565b60200260200101516112f6565b8061123c8161225e565b9150506111ee565b6000610569825490565b600080600061125d8585611554565b9150915061126a816115c4565b509392505050565b8082146112b35760405162461bcd60e51b815260206004820152600f60248201526e696e76616c6964206c656e6774687360881b6044820152606401610634565b823410156105c35760405162461bcd60e51b815260206004820152601060248201526f696e73756666696369656e742066656560801b6044820152606401610634565b6000826001600160a01b03168260405160006040518083038185875af1925050503d8060008114611343576040519150601f19603f3d011682016040523d82523d6000602084013e611348565b606091505b50909150506001811515146105c357600080fd5b6113668282610c4c565b6106475761137e816001600160a01b0316601461177f565b61138983602061177f565b60405160200161139a9291906122f3565b60408051601f198184030181529082905262461bcd60e51b825261063491600401611de6565b6113ca8282610c4c565b6106475760008281526065602090815260408083206001600160a01b03851684529091529020805460ff191660011790556114023390565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b6000610c45836001600160a01b03841661191b565b6114658282610c4c565b156106475760008281526065602090815260408083206001600160a01b0385168085529252808320805460ff1916905551339285917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a45050565b6000610c45836001600160a01b03841661196a565b60008260000182815481106114ee576114ee612248565b9060005260206000200154905092915050565b80516000908190815b8181101561154b5784818151811061152457611524612248565b6020026020010151836115379190612230565b9250806115438161225e565b91505061150a565b50909392505050565b60008082516041141561158b5760208301516040840151606085015160001a61157f87828585611a5d565b945094505050506115bd565b8251604014156115b557602083015160408401516115aa868383611b4a565b9350935050506115bd565b506000905060025b9250929050565b60008160048111156115d8576115d8612368565b14156115e15750565b60018160048111156115f5576115f5612368565b14156116435760405162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e617475726500000000000000006044820152606401610634565b600281600481111561165757611657612368565b14156116a55760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e677468006044820152606401610634565b60038160048111156116b9576116b9612368565b14156117125760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c604482015261756560f01b6064820152608401610634565b600481600481111561172657611726612368565b14156106605760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202776272076616c604482015261756560f01b6064820152608401610634565b6060600061178e83600261229b565b611799906002612230565b67ffffffffffffffff8111156117b1576117b1611be2565b6040519080825280601f01601f1916602001820160405280156117db576020820181803683370190505b509050600360fc1b816000815181106117f6576117f6612248565b60200101906001600160f81b031916908160001a905350600f60fb1b8160018151811061182557611825612248565b60200101906001600160f81b031916908160001a905350600061184984600261229b565b611854906001612230565b90505b60018111156118cc576f181899199a1a9b1b9c1cb0b131b232b360811b85600f166010811061188857611888612248565b1a60f81b82828151811061189e5761189e612248565b60200101906001600160f81b031916908160001a90535060049490941c936118c58161237e565b9050611857565b508315610c455760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e746044820152606401610634565b600081815260018301602052604081205461196257508154600181810184556000848152602080822090930184905584548482528286019093526040902091909155610569565b506000610569565b60008181526001830160205260408120548015611a5357600061198e6001836122dc565b85549091506000906119a2906001906122dc565b9050818114611a075760008660000182815481106119c2576119c2612248565b90600052602060002001549050808760000184815481106119e5576119e5612248565b6000918252602080832090910192909255918252600188019052604090208390555b8554869080611a1857611a18612395565b600190038181906000526020600020016000905590558560010160008681526020019081526020016000206000905560019350505050610569565b6000915050610569565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a0831115611a945750600090506003611b41565b8460ff16601b14158015611aac57508460ff16601c14155b15611abd5750600090506004611b41565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa158015611b11573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b038116611b3a57600060019250925050611b41565b9150600090505b94509492505050565b6000806001600160ff1b03831681611b6760ff86901c601b612230565b9050611b7587828885611a5d565b935093505050935093915050565b600060208284031215611b9557600080fd5b81356001600160e01b031981168114610c4557600080fd5b600060208284031215611bbf57600080fd5b5035919050565b80356001600160a01b0381168114611bdd57600080fd5b919050565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f1916810167ffffffffffffffff81118282101715611c2157611c21611be2565b604052919050565b600067ffffffffffffffff821115611c4357611c43611be2565b5060051b60200190565b600082601f830112611c5e57600080fd5b81356020611c73611c6e83611c29565b611bf8565b82815260059290921b84018101918181019086841115611c9257600080fd5b8286015b84811015611cb457611ca781611bc6565b8352918301918301611c96565b509695505050505050565b600082601f830112611cd057600080fd5b81356020611ce0611c6e83611c29565b82815260059290921b84018101918181019086841115611cff57600080fd5b8286015b84811015611cb45780358352918301918301611d03565b600080600060608486031215611d2f57600080fd5b611d3884611bc6565b9250602084013567ffffffffffffffff80821115611d5557600080fd5b611d6187838801611c4d565b93506040860135915080821115611d7757600080fd5b50611d8486828701611cbf565b9150509250925092565b60008060408385031215611da157600080fd5b82359150611db160208401611bc6565b90509250929050565b60005b83811015611dd5578181015183820152602001611dbd565b838111156105985750506000910152565b6020815260008251806020840152611e05816040850160208701611dba565b601f01601f19169190910160400192915050565b60008060408385031215611e2c57600080fd5b611e3583611bc6565b946020939093013593505050565b60008060008060808587031215611e5957600080fd5b5050823594602084013594506040840135936060013592509050565b600060208284031215611e8757600080fd5b610c4582611bc6565b60008060008060808587031215611ea657600080fd5b843567ffffffffffffffff80821115611ebe57600080fd5b611eca88838901611cbf565b95506020870135915080821115611ee057600080fd5b611eec88838901611cbf565b94506040870135915080821115611f0257600080fd5b611f0e88838901611cbf565b93506060870135915080821115611f2457600080fd5b50611f3187828801611cbf565b91505092959194509250565b60008060408385031215611f5057600080fd5b50508035926020909101359150565b600082601f830112611f7057600080fd5b813567ffffffffffffffff811115611f8a57611f8a611be2565b611f9d601f8201601f1916602001611bf8565b818152846020838601011115611fb257600080fd5b816020850160208301376000918101602001919091529392505050565b60008060008060008060c08789031215611fe857600080fd5b611ff187611bc6565b9550602087013567ffffffffffffffff8082111561200e57600080fd5b61201a8a838b01611c4d565b9650604089013591508082111561203057600080fd5b61203c8a838b01611cbf565b955061204a60608a01611bc6565b94506080890135935060a089013591508082111561206757600080fd5b5061207489828a01611f5f565b9150509295509295509295565b600080600080600060a0868803121561209957600080fd5b853567ffffffffffffffff808211156120b157600080fd5b6120bd89838a01611c4d565b965060208801359150808211156120d357600080fd5b6120df89838a01611cbf565b95506120ed60408901611bc6565b945060608801359350608088013591508082111561210a57600080fd5b5061211788828901611f5f565b9150509295509295909350565b6000806040838503121561213757600080fd5b823567ffffffffffffffff8082111561214f57600080fd5b61215b86838701611c4d565b9350602085013591508082111561217157600080fd5b5061217e85828601611cbf565b9150509250929050565b6000806000806080858703121561219e57600080fd5b843593506121ae60208601611bc6565b925060408501359150606085013567ffffffffffffffff8111156121d157600080fd5b611f3187828801611f5f565b600080604083850312156121f057600080fd5b82359150602083013567ffffffffffffffff81111561220e57600080fd5b61217e85828601611f5f565b634e487b7160e01b600052601160045260246000fd5b600082198211156122435761224361221a565b500190565b634e487b7160e01b600052603260045260246000fd5b60006000198214156122725761227261221a565b5060010190565b60006020828403121561228b57600080fd5b81518015158114610c4557600080fd5b60008160001904831182151516156122b5576122b561221a565b500290565b6000826122d757634e487b7160e01b600052601260045260246000fd5b500490565b6000828210156122ee576122ee61221a565b500390565b7f416363657373436f6e74726f6c3a206163636f756e742000000000000000000081526000835161232b816017850160208801611dba565b7001034b99036b4b9b9b4b733903937b6329607d1b601791840191820152835161235c816028840160208801611dba565b01602801949350505050565b634e487b7160e01b600052602160045260246000fd5b60008161238d5761238d61221a565b506000190190565b634e487b7160e01b600052603160045260246000fdfea26469706673582212209b709e24026dba94b3bec49d7190483e021d91c988fcef4047226dd80284bc9664736f6c63430008090033
Deployed Bytecode
0x6080604052600436106101815760003560e01c80638129fc1c116100d1578063a217fddf1161008a578063ca15c87311610064578063ca15c873146104c4578063d547741f146104e4578063daca6f7814610504578063fa5408011461052457600080fd5b8063a217fddf14610456578063b92038811461046b578063c3185e98146104b157600080fd5b80638129fc1c146103b05780639010d07c146103c557806391d14854146103fd578063938afad91461041d5780639c67fab6146104305780639e7934db1461044357600080fd5b806338bcdc1c1161013e5780635581ed26116101185780635581ed26146102fd578063691a037a1461031d57806375bb19711461037057806378a5f67f1461039057600080fd5b806338bcdc1c1461027e5780634cab824c146102ca578063512c91df146102dd57600080fd5b806301ffc9a7146101865780630b75360c146101bb57806315270ace146101f9578063248a9ca31461020e5780632f2ff15d1461023e57806336568abe1461025e575b600080fd5b34801561019257600080fd5b506101a66101a1366004611b83565b610544565b60405190151581526020015b60405180910390f35b3480156101c757600080fd5b506101eb6101d6366004611bad565b600090815260cb602052604090206002015490565b6040519081526020016101b2565b61020c610207366004611d1a565b61056f565b005b34801561021a57600080fd5b506101eb610229366004611bad565b60009081526065602052604090206001015490565b34801561024a57600080fd5b5061020c610259366004611d8e565b61059e565b34801561026a57600080fd5b5061020c610279366004611d8e565b6105c8565b34801561028a57600080fd5b50604080518082018252601781527f68747470733a2f2f63727970746f73656e6465722e696f000000000000000000602082015290516101b29190611de6565b61020c6102d8366004611bad565b61064b565b3480156102e957600080fd5b506101eb6102f8366004611e19565b610663565b34801561030957600080fd5b5061020c610318366004611e43565b6106aa565b34801561032957600080fd5b5061033d610338366004611e75565b610705565b6040516101b291908151815260208083015190820152604080830151908201526060918201519181019190915260800190565b34801561037c57600080fd5b5061020c61038b366004611bad565b610888565b34801561039c57600080fd5b5061020c6103ab366004611e90565b610958565b3480156103bc57600080fd5b5061020c610a70565b3480156103d157600080fd5b506103e56103e0366004611f3d565b610c2d565b6040516001600160a01b0390911681526020016101b2565b34801561040957600080fd5b506101a6610418366004611d8e565b610c4c565b61020c61042b366004611fcf565b610c77565b61020c61043e366004612081565b610cc2565b61020c610451366004612124565b610d0b565b34801561046257600080fd5b506101eb600081565b34801561047757600080fd5b506101eb610486366004611e75565b6001600160a01b0316600090815260c96020908152604080832054835260cb90915290206001015490565b61020c6104bf366004612188565b610d33565b3480156104d057600080fd5b506101eb6104df366004611bad565b610da0565b3480156104f057600080fd5b5061020c6104ff366004611d8e565b610db7565b34801561051057600080fd5b506103e561051f3660046121dd565b610ddc565b34801561053057600080fd5b506101eb61053f366004611bad565b610df0565b60006001600160e01b03198216635a05180f60e01b1480610569575061056982610e43565b92915050565b600061057a33610705565b60200151905061058c81858585610e78565b61059881600080610f75565b50505050565b6000828152606560205260409020600101546105b981610fca565b6105c38383610fd4565b505050565b6001600160a01b038116331461063d5760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201526e103937b632b9903337b91039b2b63360891b60648201526084015b60405180910390fd5b6106478282610ff6565b5050565b61065481611018565b61066034600080610f75565b50565b6040516bffffffffffffffffffffffff19606084901b1660208201526034810182905260009060540160405160208183030381529060405280519060200120905092915050565b6106b5600033610c4c565b6106be57600080fd5b60408051608081018252858152602080820195865281830194855260608201938452600096875260cb90529420935184559151600184015551600283015551600390910155565b6107306040518060800160405280600081526020016000815260200160008152602001600081525090565b6001600160a01b038216600090815260ca602090815260408083205460c9835281842054845260cb90925282206003015490919061076e9083612230565b90508042111561082e57505060008052505060cb6020908152604080516080810182527f4239c2c8c3d9b94feb214b0f54d7c869ce1ceb63517be57644336cda4967a4685481527f4239c2c8c3d9b94feb214b0f54d7c869ce1ceb63517be57644336cda4967a46954928101929092527f4239c2c8c3d9b94feb214b0f54d7c869ce1ceb63517be57644336cda4967a46a54908201527f4239c2c8c3d9b94feb214b0f54d7c869ce1ceb63517be57644336cda4967a46b54606082015290565b5050506001600160a01b0316600090815260c96020908152604080832054835260cb825291829020825160808101845281548152600182015492810192909252600281015492820192909252600390910154606082015290565b610893600033610c4c565b61089c57600080fd5b60408051608081018252600080825260208083019485529282018181526060830182815291805260cb90935290517f4239c2c8c3d9b94feb214b0f54d7c869ce1ceb63517be57644336cda4967a4685591517f4239c2c8c3d9b94feb214b0f54d7c869ce1ceb63517be57644336cda4967a46955517f4239c2c8c3d9b94feb214b0f54d7c869ce1ceb63517be57644336cda4967a46a55517f4239c2c8c3d9b94feb214b0f54d7c869ce1ceb63517be57644336cda4967a46b55565b610963600033610c4c565b61096c57600080fd5b835160005b81811015610a6857604051806080016040528087838151811061099657610996612248565b602002602001015181526020018683815181106109b5576109b5612248565b602002602001015181526020018583815181106109d4576109d4612248565b602002602001015181526020018483815181106109f3576109f3612248565b602002602001015181525060cb6000888481518110610a1457610a14612248565b60200260200101518152602001908152602001600020600082015181600001556020820151816001015560408201518160020155606082015181600301559050508080610a609061225e565b915050610971565b505050505050565b600054610100900460ff1615808015610a905750600054600160ff909116105b80610aaa5750303b158015610aaa575060005460ff166001145b610b0d5760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b6064820152608401610634565b6000805460ff191660011790558015610b30576000805461ff0019166101001790555b610b38611103565b610b40611103565b610b48611103565b610b50611103565b610b5b600033611170565b60cc80546001600160a01b03191633179055610b81600066470de4df82000081806106aa565b610b9a60016000670de0b6b3a7640000620151806106aa565b610bb3600260006729a2241af62c000062093a806106aa565b610bcc60036000674563918244f4000062278d006106aa565b610be560046000678ac7230489e800006276a7006106aa565b8015610660576000805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a150565b6000828152609760205260408120610c45908361117a565b9392505050565b60009182526065602090815260408084206001600160a01b0393909316845291905290205460ff1690565b6000610c8233610705565b602001519050610c9481888888610e78565b6000610ca1858585611186565b905080610cad57600093505b610cb8828686610f75565b5050505050505050565b6000610ccd33610705565b602001519050610cde8187876111ca565b6000610ceb858585611186565b905080610cf757600093505b610d02828686610f75565b50505050505050565b6000610d1633610705565b602001519050610d278184846111ca565b6105c381600080610f75565b6019821115610d725760405162461bcd60e51b815260206004820152600b60248201526a496e76616c69642066656560a81b6044820152606401610634565b610d7b84611018565b346000610d89858585611186565b905080610d9557600093505b610a68828686610f75565b600081815260976020526040812061056990611244565b600082815260656020526040902060010154610dd281610fca565b6105c38383610ff6565b6000610c45610dea84610df0565b8361124e565b6040517f19457468657265756d205369676e6564204d6573736167653a0a3332000000006020820152603c8101829052600090605c01604051602081830303815290604052805190602001209050919050565b60006001600160e01b03198216637965db0b60e01b148061056957506301ffc9a760e01b6001600160e01b0319831614610569565b81518151610e899086908390611272565b60005b81811015610a6857846001600160a01b03166323b872dd33868481518110610eb657610eb6612248565b6020026020010151868581518110610ed057610ed0612248565b60209081029190910101516040516001600160e01b031960e086901b1681526001600160a01b0393841660048201529290911660248301526044820152606401602060405180830381600087803b158015610f2a57600080fd5b505af1158015610f3e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f629190612279565b5080610f6d8161225e565b915050610e8c565b60006064610f83838661229b565b610f8d91906122ba565b90506000610f9b82866122dc565b90508115610fad57610fad84836112f6565b60cc54610fc3906001600160a01b0316826112f6565b5050505050565b610660813361135c565b610fde82826113c0565b60008281526097602052604090206105c39082611446565b611000828261145b565b60008281526097602052604090206105c390826114c2565b600081815260cb60209081526040918290208251608081018452815481526001820154928101929092526002810154928201839052600301546060820152908261106133610705565b511061109a5760405162461bcd60e51b8152602060048201526008602482015267139bc81b195d995b60c21b6044820152606401610634565b803410156110e15760405162461bcd60e51b8152602060048201526014602482015273496e73756666696369656e742062616c616e636560601b6044820152606401610634565b505033600090815260c9602090815260408083209390935560ca905220429055565b600054610100900460ff1661116e5760405162461bcd60e51b815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201526a6e697469616c697a696e6760a81b6064820152608401610634565b565b6106478282610fd4565b6000610c4583836114d7565b6000806111938585610663565b905060006111a18285610ddc565b6001600160a01b031673d56e3f542bfd2d0aead54c7fdd7e6d2b784dd819149695505050505050565b6111e96111d682611501565b6111e09085612230565b83518351611272565b815160005b81811015610fc35761123284828151811061120b5761120b612248565b602002602001015184838151811061122557611225612248565b60200260200101516112f6565b8061123c8161225e565b9150506111ee565b6000610569825490565b600080600061125d8585611554565b9150915061126a816115c4565b509392505050565b8082146112b35760405162461bcd60e51b815260206004820152600f60248201526e696e76616c6964206c656e6774687360881b6044820152606401610634565b823410156105c35760405162461bcd60e51b815260206004820152601060248201526f696e73756666696369656e742066656560801b6044820152606401610634565b6000826001600160a01b03168260405160006040518083038185875af1925050503d8060008114611343576040519150601f19603f3d011682016040523d82523d6000602084013e611348565b606091505b50909150506001811515146105c357600080fd5b6113668282610c4c565b6106475761137e816001600160a01b0316601461177f565b61138983602061177f565b60405160200161139a9291906122f3565b60408051601f198184030181529082905262461bcd60e51b825261063491600401611de6565b6113ca8282610c4c565b6106475760008281526065602090815260408083206001600160a01b03851684529091529020805460ff191660011790556114023390565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b6000610c45836001600160a01b03841661191b565b6114658282610c4c565b156106475760008281526065602090815260408083206001600160a01b0385168085529252808320805460ff1916905551339285917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a45050565b6000610c45836001600160a01b03841661196a565b60008260000182815481106114ee576114ee612248565b9060005260206000200154905092915050565b80516000908190815b8181101561154b5784818151811061152457611524612248565b6020026020010151836115379190612230565b9250806115438161225e565b91505061150a565b50909392505050565b60008082516041141561158b5760208301516040840151606085015160001a61157f87828585611a5d565b945094505050506115bd565b8251604014156115b557602083015160408401516115aa868383611b4a565b9350935050506115bd565b506000905060025b9250929050565b60008160048111156115d8576115d8612368565b14156115e15750565b60018160048111156115f5576115f5612368565b14156116435760405162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e617475726500000000000000006044820152606401610634565b600281600481111561165757611657612368565b14156116a55760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e677468006044820152606401610634565b60038160048111156116b9576116b9612368565b14156117125760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c604482015261756560f01b6064820152608401610634565b600481600481111561172657611726612368565b14156106605760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202776272076616c604482015261756560f01b6064820152608401610634565b6060600061178e83600261229b565b611799906002612230565b67ffffffffffffffff8111156117b1576117b1611be2565b6040519080825280601f01601f1916602001820160405280156117db576020820181803683370190505b509050600360fc1b816000815181106117f6576117f6612248565b60200101906001600160f81b031916908160001a905350600f60fb1b8160018151811061182557611825612248565b60200101906001600160f81b031916908160001a905350600061184984600261229b565b611854906001612230565b90505b60018111156118cc576f181899199a1a9b1b9c1cb0b131b232b360811b85600f166010811061188857611888612248565b1a60f81b82828151811061189e5761189e612248565b60200101906001600160f81b031916908160001a90535060049490941c936118c58161237e565b9050611857565b508315610c455760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e746044820152606401610634565b600081815260018301602052604081205461196257508154600181810184556000848152602080822090930184905584548482528286019093526040902091909155610569565b506000610569565b60008181526001830160205260408120548015611a5357600061198e6001836122dc565b85549091506000906119a2906001906122dc565b9050818114611a075760008660000182815481106119c2576119c2612248565b90600052602060002001549050808760000184815481106119e5576119e5612248565b6000918252602080832090910192909255918252600188019052604090208390555b8554869080611a1857611a18612395565b600190038181906000526020600020016000905590558560010160008681526020019081526020016000206000905560019350505050610569565b6000915050610569565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a0831115611a945750600090506003611b41565b8460ff16601b14158015611aac57508460ff16601c14155b15611abd5750600090506004611b41565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa158015611b11573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b038116611b3a57600060019250925050611b41565b9150600090505b94509492505050565b6000806001600160ff1b03831681611b6760ff86901c601b612230565b9050611b7587828885611a5d565b935093505050935093915050565b600060208284031215611b9557600080fd5b81356001600160e01b031981168114610c4557600080fd5b600060208284031215611bbf57600080fd5b5035919050565b80356001600160a01b0381168114611bdd57600080fd5b919050565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f1916810167ffffffffffffffff81118282101715611c2157611c21611be2565b604052919050565b600067ffffffffffffffff821115611c4357611c43611be2565b5060051b60200190565b600082601f830112611c5e57600080fd5b81356020611c73611c6e83611c29565b611bf8565b82815260059290921b84018101918181019086841115611c9257600080fd5b8286015b84811015611cb457611ca781611bc6565b8352918301918301611c96565b509695505050505050565b600082601f830112611cd057600080fd5b81356020611ce0611c6e83611c29565b82815260059290921b84018101918181019086841115611cff57600080fd5b8286015b84811015611cb45780358352918301918301611d03565b600080600060608486031215611d2f57600080fd5b611d3884611bc6565b9250602084013567ffffffffffffffff80821115611d5557600080fd5b611d6187838801611c4d565b93506040860135915080821115611d7757600080fd5b50611d8486828701611cbf565b9150509250925092565b60008060408385031215611da157600080fd5b82359150611db160208401611bc6565b90509250929050565b60005b83811015611dd5578181015183820152602001611dbd565b838111156105985750506000910152565b6020815260008251806020840152611e05816040850160208701611dba565b601f01601f19169190910160400192915050565b60008060408385031215611e2c57600080fd5b611e3583611bc6565b946020939093013593505050565b60008060008060808587031215611e5957600080fd5b5050823594602084013594506040840135936060013592509050565b600060208284031215611e8757600080fd5b610c4582611bc6565b60008060008060808587031215611ea657600080fd5b843567ffffffffffffffff80821115611ebe57600080fd5b611eca88838901611cbf565b95506020870135915080821115611ee057600080fd5b611eec88838901611cbf565b94506040870135915080821115611f0257600080fd5b611f0e88838901611cbf565b93506060870135915080821115611f2457600080fd5b50611f3187828801611cbf565b91505092959194509250565b60008060408385031215611f5057600080fd5b50508035926020909101359150565b600082601f830112611f7057600080fd5b813567ffffffffffffffff811115611f8a57611f8a611be2565b611f9d601f8201601f1916602001611bf8565b818152846020838601011115611fb257600080fd5b816020850160208301376000918101602001919091529392505050565b60008060008060008060c08789031215611fe857600080fd5b611ff187611bc6565b9550602087013567ffffffffffffffff8082111561200e57600080fd5b61201a8a838b01611c4d565b9650604089013591508082111561203057600080fd5b61203c8a838b01611cbf565b955061204a60608a01611bc6565b94506080890135935060a089013591508082111561206757600080fd5b5061207489828a01611f5f565b9150509295509295509295565b600080600080600060a0868803121561209957600080fd5b853567ffffffffffffffff808211156120b157600080fd5b6120bd89838a01611c4d565b965060208801359150808211156120d357600080fd5b6120df89838a01611cbf565b95506120ed60408901611bc6565b945060608801359350608088013591508082111561210a57600080fd5b5061211788828901611f5f565b9150509295509295909350565b6000806040838503121561213757600080fd5b823567ffffffffffffffff8082111561214f57600080fd5b61215b86838701611c4d565b9350602085013591508082111561217157600080fd5b5061217e85828601611cbf565b9150509250929050565b6000806000806080858703121561219e57600080fd5b843593506121ae60208601611bc6565b925060408501359150606085013567ffffffffffffffff8111156121d157600080fd5b611f3187828801611f5f565b600080604083850312156121f057600080fd5b82359150602083013567ffffffffffffffff81111561220e57600080fd5b61217e85828601611f5f565b634e487b7160e01b600052601160045260246000fd5b600082198211156122435761224361221a565b500190565b634e487b7160e01b600052603260045260246000fd5b60006000198214156122725761227261221a565b5060010190565b60006020828403121561228b57600080fd5b81518015158114610c4557600080fd5b60008160001904831182151516156122b5576122b561221a565b500290565b6000826122d757634e487b7160e01b600052601260045260246000fd5b500490565b6000828210156122ee576122ee61221a565b500390565b7f416363657373436f6e74726f6c3a206163636f756e742000000000000000000081526000835161232b816017850160208801611dba565b7001034b99036b4b9b9b4b733903937b6329607d1b601791840191820152835161235c816028840160208801611dba565b01602801949350505050565b634e487b7160e01b600052602160045260246000fd5b60008161238d5761238d61221a565b506000190190565b634e487b7160e01b600052603160045260246000fdfea26469706673582212209b709e24026dba94b3bec49d7190483e021d91c988fcef4047226dd80284bc9664736f6c63430008090033
Loading...
Loading
Loading...
Loading
Multichain Portfolio | 30 Chains
Chain | Token | Portfolio % | Price | Amount | Value |
---|---|---|---|---|---|
BASE | 100.00% | $2,773.89 | 0.0161 | $44.59 |
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.