Source Code
Latest 25 from a total of 76,308 transactions
| Transaction Hash |
|
Block
|
From
|
To
|
|||||
|---|---|---|---|---|---|---|---|---|---|
| Claim Token | 94345121 | 3 days ago | IN | 0 BNB | 0.00000859 | ||||
| Claim Token | 94345101 | 3 days ago | IN | 0 BNB | 0.00000859 | ||||
| Claim Token | 94345080 | 3 days ago | IN | 0 BNB | 0.00000429 | ||||
| Claim Token | 94345047 | 3 days ago | IN | 0 BNB | 0.00000429 | ||||
| Claim Token | 94345023 | 3 days ago | IN | 0 BNB | 0.00000859 | ||||
| Claim Token | 94345000 | 3 days ago | IN | 0 BNB | 0.00000429 | ||||
| Claim Token | 94344978 | 3 days ago | IN | 0 BNB | 0.00000859 | ||||
| Claim Token | 94344955 | 3 days ago | IN | 0 BNB | 0.00000429 | ||||
| Claim Token | 94344932 | 3 days ago | IN | 0 BNB | 0.00000429 | ||||
| Claim Token | 94344912 | 3 days ago | IN | 0 BNB | 0.00000859 | ||||
| Claim Token | 94344888 | 3 days ago | IN | 0 BNB | 0.00000859 | ||||
| Claim Token | 94344863 | 3 days ago | IN | 0 BNB | 0.00000429 | ||||
| Claim Token | 94344845 | 3 days ago | IN | 0 BNB | 0.00000859 | ||||
| Claim Token | 94344808 | 3 days ago | IN | 0 BNB | 0.00000859 | ||||
| Claim Token | 94344776 | 3 days ago | IN | 0 BNB | 0.00000429 | ||||
| Claim Token | 94344758 | 3 days ago | IN | 0 BNB | 0.00000859 | ||||
| Claim Token | 94344741 | 3 days ago | IN | 0 BNB | 0.00000859 | ||||
| Claim Token | 94344723 | 3 days ago | IN | 0 BNB | 0.00000859 | ||||
| Claim Token | 94344704 | 3 days ago | IN | 0 BNB | 0.00000429 | ||||
| Claim Token | 94344686 | 3 days ago | IN | 0 BNB | 0.00000429 | ||||
| Claim Token | 94344670 | 3 days ago | IN | 0 BNB | 0.00000859 | ||||
| Claim Token | 94344650 | 3 days ago | IN | 0 BNB | 0.00000859 | ||||
| Claim Token | 94344635 | 3 days ago | IN | 0 BNB | 0.00000859 | ||||
| Claim Token | 94343615 | 3 days ago | IN | 0 BNB | 0.00000859 | ||||
| Claim Token | 94343592 | 3 days ago | IN | 0 BNB | 0.00000859 |
Cross-Chain Transactions
Loading...
Loading
Contract Name:
ClaimSale
Compiler Version
v0.8.24+commit.e11b9ed9
Optimization Enabled:
Yes with 200 runs
Other Settings:
paris EvmVersion
Contract Source Code (Solidity Standard Json-Input format)
pragma solidity ^0.8.0;
import "@openzeppelin/contracts/utils/math/SafeMath.sol";
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import "@openzeppelin/contracts/security/Pausable.sol";
import "@openzeppelin/contracts/access/AccessControl.sol";
import "@openzeppelin/contracts/security/ReentrancyGuard.sol";
import {IUser} from "./interfaces/IUser.sol";
contract ClaimSale is AccessControl, Pausable, ReentrancyGuard {
using SafeMath for uint256;
struct UserRound {
uint256 amountToken;
uint256 amountPayment;
uint256 amountClaimed;
uint256 userNextClaim;
}
struct UserStatistic {
uint256 amountToken;
uint256 amountPayment;
uint256 amountClaimed;
}
struct RoundDetail {
uint256 startClaimTime;
uint256 roundPrice;
uint256 totalClaim;
uint256 totalClaimed;
uint256 vestingPercent;
uint256 divPercent;
bool enableClaim;
}
struct UserHistory {
uint256 round;
uint256 amountPayment;
uint256 amountToken;
uint256 typeUpdate;
}
bytes32 public constant MODERATOR = keccak256("MODERATOR");
mapping(address => mapping(uint256 => UserRound)) public userRoundDetail;
mapping(address => UserHistory[]) public userUpdateHistory;
mapping(address => UserStatistic) public userStatistic;
mapping(uint256 => RoundDetail) public roundDetail;
address private TOKEN_CLAIM = 0x045C2767A6CAE0a4551f40E4e8d250af94FE056B;
string public productName = "toncapy";
uint256 public lockTime = 86400; // days
event ADMIN_UPDATE_BUY_EVENT(uint256 round, uint256 amount_token, string productName);
event Claim(uint256 round, uint256 amount, string productName, uint256 timestamp);
constructor() {
_grantRole(MODERATOR, msg.sender);
_grantRole(DEFAULT_ADMIN_ROLE, msg.sender);
// first round
roundDetail[0] = RoundDetail(1747314000, 80000000000000, 0, 0, 1, 1000, true);
roundDetail[1] = RoundDetail(1747314000, 120000000000000, 0, 0, 1, 1000, false);
roundDetail[2] = RoundDetail(1747314000, 160000000000000, 0, 0, 1, 1000, false);
}
function claimToken(uint256 _round) public whenNotPaused nonReentrant {
RoundDetail memory rd = roundDetail[_round];
UserRound storage uRound = userRoundDetail[msg.sender][_round];
UserStatistic storage uStatistic = userStatistic[msg.sender];
require(rd.enableClaim, "Claim not enable");
require(block.timestamp >= rd.startClaimTime, "Claim not ready");
require(rd.startClaimTime != 0, "Claim time not set");
if (uRound.userNextClaim == 0) {
require(rd.startClaimTime <= block.timestamp, "Claim not ready");
} else {
require(uRound.userNextClaim <= block.timestamp, "Claim not ready");
}
uint256 totalBuyToken = uRound.amountToken;
uint256 claimAmount = totalBuyToken.mul(rd.vestingPercent).div(rd.divPercent);
require(IERC20(TOKEN_CLAIM).balanceOf(address(this)) >= claimAmount, "Contract not enough balance");
require(uRound.amountClaimed < totalBuyToken, "You have claimed all");
if (uRound.amountClaimed + claimAmount > totalBuyToken) {
// claim remains
claimAmount = totalBuyToken.sub(uRound.amountClaimed);
}
uRound.amountClaimed = uRound.amountClaimed.add(claimAmount);
IERC20(TOKEN_CLAIM).transfer(msg.sender, claimAmount);
emit Claim(_round, claimAmount, productName, uRound.userNextClaim == 0 ? rd.startClaimTime : uRound.userNextClaim);
// statistic
uStatistic.amountClaimed = uStatistic.amountClaimed.add(claimAmount);
if (uRound.userNextClaim == 0) {
uRound.userNextClaim = rd.startClaimTime + lockTime;
} else {
uRound.userNextClaim += lockTime;
}
}
function pause() public onlyRole(DEFAULT_ADMIN_ROLE) {
_pause();
}
function unpause() public onlyRole(DEFAULT_ADMIN_ROLE) {
_unpause();
}
function setRound(
uint256 _round,
uint256 _startClaimTime,
uint256 _roundPrice,
uint256 _totalClaim,
uint256 _totalClaimed,
uint256 _vestingPercent,
uint256 _divPercent,
bool _enableClaim
) public onlyRole(DEFAULT_ADMIN_ROLE) {
roundDetail[_round] = RoundDetail(
_startClaimTime,
_roundPrice,
_totalClaim,
_totalClaimed,
_vestingPercent,
_divPercent,
_enableClaim
);
}
function setRoundClaim(uint256 _round, uint256 _vestingPercent, uint256 _divPercent) public onlyRole(DEFAULT_ADMIN_ROLE) {
roundDetail[_round].vestingPercent = _vestingPercent;
roundDetail[_round].divPercent = _divPercent;
}
function setRoundClaimTime(uint256 _round, uint256 _startClaimTime) public onlyRole(DEFAULT_ADMIN_ROLE) {
roundDetail[_round].startClaimTime = _startClaimTime;
}
function enableRound(uint256 _round) public onlyRole(DEFAULT_ADMIN_ROLE) {
roundDetail[_round].enableClaim = true;
}
function disableRound(uint256 _round) public onlyRole(DEFAULT_ADMIN_ROLE) {
roundDetail[_round].enableClaim = false;
}
function setToken(address _token) public onlyRole(DEFAULT_ADMIN_ROLE) {
TOKEN_CLAIM = _token;
}
function setLockTime(uint256 _lockTime) public onlyRole(DEFAULT_ADMIN_ROLE) {
lockTime = _lockTime;
}
function setUserRoundDetail(uint256 _round, address _wallet, uint256 _amountPayment, uint256 _amountToken, uint256 _amountClaimed, uint256 _userNextClaim, uint256 _typeUpdate) public onlyRole(DEFAULT_ADMIN_ROLE) {
UserRound storage uRound = userRoundDetail[_wallet][_round];
uRound.amountToken = _amountToken;
uRound.amountPayment = _amountPayment;
uRound.amountClaimed = _amountClaimed;
uRound.userNextClaim = _userNextClaim;
UserStatistic storage uStatistic = userStatistic[_wallet];
uStatistic.amountToken += _amountToken;
uStatistic.amountPayment += _amountToken;
userUpdateHistory[_wallet].push(
UserHistory(_round, _amountPayment, _amountToken, _typeUpdate)
);
emit ADMIN_UPDATE_BUY_EVENT(_round, _amountToken, productName);
}
function setUsersRoundDetail(
uint256 _round,
address[] memory _wallets,
uint256[] memory _amountTokens,
uint256[] memory _amountPaymentToken,
uint256[] memory _amountClaimed,
uint256[] memory _userNextClaim,
uint256 _typeUpdate
) public onlyRole(DEFAULT_ADMIN_ROLE) {
require(_wallets.length <= 50, "Limit 50 items");
require(
_wallets.length == _amountTokens.length &&
_wallets.length == _amountPaymentToken.length &&
_wallets.length == _amountClaimed.length &&
_wallets.length == _userNextClaim.length, "Input not valid");
for (uint256 i = 0; i < _wallets.length; i++) {
UserRound storage uRound = userRoundDetail[_wallets[i]][_round];
uRound.amountToken = _amountTokens[i];
uRound.amountPayment = _amountPaymentToken[i];
uRound.amountClaimed = _amountClaimed[i];
uRound.userNextClaim = _userNextClaim[i];
UserStatistic storage uStatistic = userStatistic[_wallets[i]];
uStatistic.amountToken += _amountTokens[i];
uStatistic.amountPayment += _amountPaymentToken[i];
userUpdateHistory[_wallets[i]].push(
UserHistory(_round, _amountPaymentToken[i], _amountTokens[i], _typeUpdate)
);
emit ADMIN_UPDATE_BUY_EVENT(_round, _amountTokens[i], productName);
}
}
function setUserStatistic(address _wallet, uint256 _amountToken, uint256 _amountPayment, uint256 _amountClaimed) public onlyRole(DEFAULT_ADMIN_ROLE) {
UserStatistic storage uStatistic = userStatistic[_wallet];
uStatistic.amountToken = _amountToken;
uStatistic.amountPayment = _amountPayment;
uStatistic.amountClaimed = _amountClaimed;
}
function getTokenSale() public view returns (address) {
return TOKEN_CLAIM;
}
function getLockTime() public view returns (uint256) {
return lockTime;
}
function getUserRoundDetail(uint256 _round, address _account) public view returns (UserRound memory) {
return userRoundDetail[_account][_round];
}
function getRoundDetail(uint256 _round) public view returns (RoundDetail memory) {
return roundDetail[_round];
}
function getUserStatistic(address _account) public view returns (UserStatistic memory) {
return userStatistic[_account];
}
function getUserHistoryLength(address _account) public view returns (uint256) {
return userUpdateHistory[_account].length;
}
function getUserHistory(address _account, uint256 _index) public view returns (UserHistory memory) {
return userUpdateHistory[_account][_index];
}
function clearUnknownToken(address _tokenAddress) public onlyRole(DEFAULT_ADMIN_ROLE) {
uint256 contractBalance = IERC20(_tokenAddress).balanceOf(address(this));
IERC20(_tokenAddress).transfer(address(msg.sender), contractBalance);
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (access/AccessControl.sol)
pragma solidity ^0.8.0;
import "./IAccessControl.sol";
import "../utils/Context.sol";
import "../utils/Strings.sol";
import "../utils/introspection/ERC165.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:
*
* ```solidity
* 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}:
*
* ```solidity
* 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. We recommend using {AccessControlDefaultAdminRules}
* to enforce additional security measures for this role.
*/
abstract contract AccessControl is Context, IAccessControl, ERC165 {
struct RoleData {
mapping(address => bool) members;
bytes32 adminRole;
}
mapping(bytes32 => RoleData) private _roles;
bytes32 public constant DEFAULT_ADMIN_ROLE = 0x00;
/**
* @dev 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(IAccessControl).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 ",
Strings.toHexString(account),
" is missing role ",
Strings.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());
}
}
}// 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 IAccessControl {
/**
* @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 (last updated v4.7.0) (security/Pausable.sol)
pragma solidity ^0.8.0;
import "../utils/Context.sol";
/**
* @dev Contract module which allows children to implement an emergency stop
* mechanism that can be triggered by an authorized account.
*
* This module is used through inheritance. It will make available the
* modifiers `whenNotPaused` and `whenPaused`, which can be applied to
* the functions of your contract. Note that they will not be pausable by
* simply including this module, only once the modifiers are put in place.
*/
abstract contract Pausable is Context {
/**
* @dev Emitted when the pause is triggered by `account`.
*/
event Paused(address account);
/**
* @dev Emitted when the pause is lifted by `account`.
*/
event Unpaused(address account);
bool private _paused;
/**
* @dev Initializes the contract in unpaused state.
*/
constructor() {
_paused = false;
}
/**
* @dev Modifier to make a function callable only when the contract is not paused.
*
* Requirements:
*
* - The contract must not be paused.
*/
modifier whenNotPaused() {
_requireNotPaused();
_;
}
/**
* @dev Modifier to make a function callable only when the contract is paused.
*
* Requirements:
*
* - The contract must be paused.
*/
modifier whenPaused() {
_requirePaused();
_;
}
/**
* @dev Returns true if the contract is paused, and false otherwise.
*/
function paused() public view virtual returns (bool) {
return _paused;
}
/**
* @dev Throws if the contract is paused.
*/
function _requireNotPaused() internal view virtual {
require(!paused(), "Pausable: paused");
}
/**
* @dev Throws if the contract is not paused.
*/
function _requirePaused() internal view virtual {
require(paused(), "Pausable: not paused");
}
/**
* @dev Triggers stopped state.
*
* Requirements:
*
* - The contract must not be paused.
*/
function _pause() internal virtual whenNotPaused {
_paused = true;
emit Paused(_msgSender());
}
/**
* @dev Returns to normal state.
*
* Requirements:
*
* - The contract must be paused.
*/
function _unpause() internal virtual whenPaused {
_paused = false;
emit Unpaused(_msgSender());
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (security/ReentrancyGuard.sol)
pragma solidity ^0.8.0;
/**
* @dev Contract module that helps prevent reentrant calls to a function.
*
* Inheriting from `ReentrancyGuard` will make the {nonReentrant} modifier
* available, which can be applied to functions to make sure there are no nested
* (reentrant) calls to them.
*
* Note that because there is a single `nonReentrant` guard, functions marked as
* `nonReentrant` may not call one another. This can be worked around by making
* those functions `private`, and then adding `external` `nonReentrant` entry
* points to them.
*
* TIP: If you would like to learn more about reentrancy and alternative ways
* to protect against it, check out our blog post
* https://blog.openzeppelin.com/reentrancy-after-istanbul/[Reentrancy After Istanbul].
*/
abstract contract ReentrancyGuard {
// Booleans are more expensive than uint256 or any type that takes up a full
// word because each write operation emits an extra SLOAD to first read the
// slot's contents, replace the bits taken up by the boolean, and then write
// back. This is the compiler's defense against contract upgrades and
// pointer aliasing, and it cannot be disabled.
// The values being non-zero value makes deployment a bit more expensive,
// but in exchange the refund on every call to nonReentrant will be lower in
// amount. Since refunds are capped to a percentage of the total
// transaction's gas, it is best to keep them low in cases like this one, to
// increase the likelihood of the full refund coming into effect.
uint256 private constant _NOT_ENTERED = 1;
uint256 private constant _ENTERED = 2;
uint256 private _status;
constructor() {
_status = _NOT_ENTERED;
}
/**
* @dev Prevents a contract from calling itself, directly or indirectly.
* Calling a `nonReentrant` function from another `nonReentrant`
* function is not supported. It is possible to prevent this from happening
* by making the `nonReentrant` function external, and making it call a
* `private` function that does the actual work.
*/
modifier nonReentrant() {
_nonReentrantBefore();
_;
_nonReentrantAfter();
}
function _nonReentrantBefore() private {
// On the first call to nonReentrant, _status will be _NOT_ENTERED
require(_status != _ENTERED, "ReentrancyGuard: reentrant call");
// Any calls to nonReentrant after this point will fail
_status = _ENTERED;
}
function _nonReentrantAfter() private {
// By storing the original value once again, a refund is triggered (see
// https://eips.ethereum.org/EIPS/eip-2200)
_status = _NOT_ENTERED;
}
/**
* @dev Returns true if the reentrancy guard is currently set to "entered", which indicates there is a
* `nonReentrant` function in the call stack.
*/
function _reentrancyGuardEntered() internal view returns (bool) {
return _status == _ENTERED;
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (token/ERC20/IERC20.sol)
pragma solidity ^0.8.0;
/**
* @dev Interface of the ERC20 standard as defined in the EIP.
*/
interface IERC20 {
/**
* @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.9.4) (utils/Context.sol)
pragma solidity ^0.8.0;
/**
* @dev Provides information about the current execution context, including the
* sender of the transaction and its data. While these are generally available
* via msg.sender and msg.data, they should not be accessed in such a direct
* manner, since when dealing with meta-transactions the account sending and
* paying for execution may not be the actual sender (as far as an application
* is concerned).
*
* This contract is only required for intermediate, library-like contracts.
*/
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
function _msgData() internal view virtual returns (bytes calldata) {
return msg.data;
}
function _contextSuffixLength() internal view virtual returns (uint256) {
return 0;
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/introspection/ERC165.sol)
pragma solidity ^0.8.0;
import "./IERC165.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 ERC165 is IERC165 {
/**
* @dev See {IERC165-supportsInterface}.
*/
function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
return interfaceId == type(IERC165).interfaceId;
}
}// 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 IERC165 {
/**
* @dev Returns true if this contract implements the interface defined by
* `interfaceId`. See the corresponding
* https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section]
* to learn more about how these ids are created.
*
* This function call must use less than 30 000 gas.
*/
function supportsInterface(bytes4 interfaceId) external view returns (bool);
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (utils/math/Math.sol)
pragma solidity ^0.8.0;
/**
* @dev Standard math utilities missing in the Solidity language.
*/
library Math {
enum Rounding {
Down, // Toward negative infinity
Up, // Toward infinity
Zero // Toward zero
}
/**
* @dev Returns the largest of two numbers.
*/
function max(uint256 a, uint256 b) internal pure returns (uint256) {
return a > b ? a : b;
}
/**
* @dev Returns the smallest of two numbers.
*/
function min(uint256 a, uint256 b) internal pure returns (uint256) {
return a < b ? a : b;
}
/**
* @dev Returns the average of two numbers. The result is rounded towards
* zero.
*/
function average(uint256 a, uint256 b) internal pure returns (uint256) {
// (a + b) / 2 can overflow.
return (a & b) + (a ^ b) / 2;
}
/**
* @dev Returns the ceiling of the division of two numbers.
*
* This differs from standard division with `/` in that it rounds up instead
* of rounding down.
*/
function ceilDiv(uint256 a, uint256 b) internal pure returns (uint256) {
// (a + b - 1) / b can overflow on addition, so we distribute.
return a == 0 ? 0 : (a - 1) / b + 1;
}
/**
* @notice Calculates floor(x * y / denominator) with full precision. Throws if result overflows a uint256 or denominator == 0
* @dev Original credit to Remco Bloemen under MIT license (https://xn--2-umb.com/21/muldiv)
* with further edits by Uniswap Labs also under MIT license.
*/
function mulDiv(uint256 x, uint256 y, uint256 denominator) internal pure returns (uint256 result) {
unchecked {
// 512-bit multiply [prod1 prod0] = x * y. Compute the product mod 2^256 and mod 2^256 - 1, then use
// use the Chinese Remainder Theorem to reconstruct the 512 bit result. The result is stored in two 256
// variables such that product = prod1 * 2^256 + prod0.
uint256 prod0; // Least significant 256 bits of the product
uint256 prod1; // Most significant 256 bits of the product
assembly {
let mm := mulmod(x, y, not(0))
prod0 := mul(x, y)
prod1 := sub(sub(mm, prod0), lt(mm, prod0))
}
// Handle non-overflow cases, 256 by 256 division.
if (prod1 == 0) {
// Solidity will revert if denominator == 0, unlike the div opcode on its own.
// The surrounding unchecked block does not change this fact.
// See https://docs.soliditylang.org/en/latest/control-structures.html#checked-or-unchecked-arithmetic.
return prod0 / denominator;
}
// Make sure the result is less than 2^256. Also prevents denominator == 0.
require(denominator > prod1, "Math: mulDiv overflow");
///////////////////////////////////////////////
// 512 by 256 division.
///////////////////////////////////////////////
// Make division exact by subtracting the remainder from [prod1 prod0].
uint256 remainder;
assembly {
// Compute remainder using mulmod.
remainder := mulmod(x, y, denominator)
// Subtract 256 bit number from 512 bit number.
prod1 := sub(prod1, gt(remainder, prod0))
prod0 := sub(prod0, remainder)
}
// Factor powers of two out of denominator and compute largest power of two divisor of denominator. Always >= 1.
// See https://cs.stackexchange.com/q/138556/92363.
// Does not overflow because the denominator cannot be zero at this stage in the function.
uint256 twos = denominator & (~denominator + 1);
assembly {
// Divide denominator by twos.
denominator := div(denominator, twos)
// Divide [prod1 prod0] by twos.
prod0 := div(prod0, twos)
// Flip twos such that it is 2^256 / twos. If twos is zero, then it becomes one.
twos := add(div(sub(0, twos), twos), 1)
}
// Shift in bits from prod1 into prod0.
prod0 |= prod1 * twos;
// Invert denominator mod 2^256. Now that denominator is an odd number, it has an inverse modulo 2^256 such
// that denominator * inv = 1 mod 2^256. Compute the inverse by starting with a seed that is correct for
// four bits. That is, denominator * inv = 1 mod 2^4.
uint256 inverse = (3 * denominator) ^ 2;
// Use the Newton-Raphson iteration to improve the precision. Thanks to Hensel's lifting lemma, this also works
// in modular arithmetic, doubling the correct bits in each step.
inverse *= 2 - denominator * inverse; // inverse mod 2^8
inverse *= 2 - denominator * inverse; // inverse mod 2^16
inverse *= 2 - denominator * inverse; // inverse mod 2^32
inverse *= 2 - denominator * inverse; // inverse mod 2^64
inverse *= 2 - denominator * inverse; // inverse mod 2^128
inverse *= 2 - denominator * inverse; // inverse mod 2^256
// Because the division is now exact we can divide by multiplying with the modular inverse of denominator.
// This will give us the correct result modulo 2^256. Since the preconditions guarantee that the outcome is
// less than 2^256, this is the final result. We don't need to compute the high bits of the result and prod1
// is no longer required.
result = prod0 * inverse;
return result;
}
}
/**
* @notice Calculates x * y / denominator with full precision, following the selected rounding direction.
*/
function mulDiv(uint256 x, uint256 y, uint256 denominator, Rounding rounding) internal pure returns (uint256) {
uint256 result = mulDiv(x, y, denominator);
if (rounding == Rounding.Up && mulmod(x, y, denominator) > 0) {
result += 1;
}
return result;
}
/**
* @dev Returns the square root of a number. If the number is not a perfect square, the value is rounded down.
*
* Inspired by Henry S. Warren, Jr.'s "Hacker's Delight" (Chapter 11).
*/
function sqrt(uint256 a) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
// For our first guess, we get the biggest power of 2 which is smaller than the square root of the target.
//
// We know that the "msb" (most significant bit) of our target number `a` is a power of 2 such that we have
// `msb(a) <= a < 2*msb(a)`. This value can be written `msb(a)=2**k` with `k=log2(a)`.
//
// This can be rewritten `2**log2(a) <= a < 2**(log2(a) + 1)`
// → `sqrt(2**k) <= sqrt(a) < sqrt(2**(k+1))`
// → `2**(k/2) <= sqrt(a) < 2**((k+1)/2) <= 2**(k/2 + 1)`
//
// Consequently, `2**(log2(a) / 2)` is a good first approximation of `sqrt(a)` with at least 1 correct bit.
uint256 result = 1 << (log2(a) >> 1);
// At this point `result` is an estimation with one bit of precision. We know the true value is a uint128,
// since it is the square root of a uint256. Newton's method converges quadratically (precision doubles at
// every iteration). We thus need at most 7 iteration to turn our partial result with one bit of precision
// into the expected uint128 result.
unchecked {
result = (result + a / result) >> 1;
result = (result + a / result) >> 1;
result = (result + a / result) >> 1;
result = (result + a / result) >> 1;
result = (result + a / result) >> 1;
result = (result + a / result) >> 1;
result = (result + a / result) >> 1;
return min(result, a / result);
}
}
/**
* @notice Calculates sqrt(a), following the selected rounding direction.
*/
function sqrt(uint256 a, Rounding rounding) internal pure returns (uint256) {
unchecked {
uint256 result = sqrt(a);
return result + (rounding == Rounding.Up && result * result < a ? 1 : 0);
}
}
/**
* @dev Return the log in base 2, rounded down, of a positive value.
* Returns 0 if given 0.
*/
function log2(uint256 value) internal pure returns (uint256) {
uint256 result = 0;
unchecked {
if (value >> 128 > 0) {
value >>= 128;
result += 128;
}
if (value >> 64 > 0) {
value >>= 64;
result += 64;
}
if (value >> 32 > 0) {
value >>= 32;
result += 32;
}
if (value >> 16 > 0) {
value >>= 16;
result += 16;
}
if (value >> 8 > 0) {
value >>= 8;
result += 8;
}
if (value >> 4 > 0) {
value >>= 4;
result += 4;
}
if (value >> 2 > 0) {
value >>= 2;
result += 2;
}
if (value >> 1 > 0) {
result += 1;
}
}
return result;
}
/**
* @dev Return the log in base 2, following the selected rounding direction, of a positive value.
* Returns 0 if given 0.
*/
function log2(uint256 value, Rounding rounding) internal pure returns (uint256) {
unchecked {
uint256 result = log2(value);
return result + (rounding == Rounding.Up && 1 << result < value ? 1 : 0);
}
}
/**
* @dev Return the log in base 10, rounded down, of a positive value.
* Returns 0 if given 0.
*/
function log10(uint256 value) internal pure returns (uint256) {
uint256 result = 0;
unchecked {
if (value >= 10 ** 64) {
value /= 10 ** 64;
result += 64;
}
if (value >= 10 ** 32) {
value /= 10 ** 32;
result += 32;
}
if (value >= 10 ** 16) {
value /= 10 ** 16;
result += 16;
}
if (value >= 10 ** 8) {
value /= 10 ** 8;
result += 8;
}
if (value >= 10 ** 4) {
value /= 10 ** 4;
result += 4;
}
if (value >= 10 ** 2) {
value /= 10 ** 2;
result += 2;
}
if (value >= 10 ** 1) {
result += 1;
}
}
return result;
}
/**
* @dev Return the log in base 10, following the selected rounding direction, of a positive value.
* Returns 0 if given 0.
*/
function log10(uint256 value, Rounding rounding) internal pure returns (uint256) {
unchecked {
uint256 result = log10(value);
return result + (rounding == Rounding.Up && 10 ** result < value ? 1 : 0);
}
}
/**
* @dev Return the log in base 256, rounded down, of a positive value.
* Returns 0 if given 0.
*
* Adding one to the result gives the number of pairs of hex symbols needed to represent `value` as a hex string.
*/
function log256(uint256 value) internal pure returns (uint256) {
uint256 result = 0;
unchecked {
if (value >> 128 > 0) {
value >>= 128;
result += 16;
}
if (value >> 64 > 0) {
value >>= 64;
result += 8;
}
if (value >> 32 > 0) {
value >>= 32;
result += 4;
}
if (value >> 16 > 0) {
value >>= 16;
result += 2;
}
if (value >> 8 > 0) {
result += 1;
}
}
return result;
}
/**
* @dev Return the log in base 256, following the selected rounding direction, of a positive value.
* Returns 0 if given 0.
*/
function log256(uint256 value, Rounding rounding) internal pure returns (uint256) {
unchecked {
uint256 result = log256(value);
return result + (rounding == Rounding.Up && 1 << (result << 3) < value ? 1 : 0);
}
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.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 SafeMath {
/**
* @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 (last updated v4.8.0) (utils/math/SignedMath.sol)
pragma solidity ^0.8.0;
/**
* @dev Standard signed math utilities missing in the Solidity language.
*/
library SignedMath {
/**
* @dev Returns the largest of two signed numbers.
*/
function max(int256 a, int256 b) internal pure returns (int256) {
return a > b ? a : b;
}
/**
* @dev Returns the smallest of two signed numbers.
*/
function min(int256 a, int256 b) internal pure returns (int256) {
return a < b ? a : b;
}
/**
* @dev Returns the average of two signed numbers without overflow.
* The result is rounded towards zero.
*/
function average(int256 a, int256 b) internal pure returns (int256) {
// Formula from the book "Hacker's Delight"
int256 x = (a & b) + ((a ^ b) >> 1);
return x + (int256(uint256(x) >> 255) & (a ^ b));
}
/**
* @dev Returns the absolute unsigned value of a signed value.
*/
function abs(int256 n) internal pure returns (uint256) {
unchecked {
// must be unchecked in order to support `n = type(int256).min`
return uint256(n >= 0 ? n : -n);
}
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (utils/Strings.sol)
pragma solidity ^0.8.0;
import "./math/Math.sol";
import "./math/SignedMath.sol";
/**
* @dev String operations.
*/
library Strings {
bytes16 private constant _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) {
unchecked {
uint256 length = Math.log10(value) + 1;
string memory buffer = new string(length);
uint256 ptr;
/// @solidity memory-safe-assembly
assembly {
ptr := add(buffer, add(32, length))
}
while (true) {
ptr--;
/// @solidity memory-safe-assembly
assembly {
mstore8(ptr, byte(mod(value, 10), _SYMBOLS))
}
value /= 10;
if (value == 0) break;
}
return buffer;
}
}
/**
* @dev Converts a `int256` to its ASCII `string` decimal representation.
*/
function toString(int256 value) internal pure returns (string memory) {
return string(abi.encodePacked(value < 0 ? "-" : "", toString(SignedMath.abs(value))));
}
/**
* @dev Converts a `uint256` to its ASCII `string` hexadecimal representation.
*/
function toHexString(uint256 value) internal pure returns (string memory) {
unchecked {
return toHexString(value, Math.log256(value) + 1);
}
}
/**
* @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] = _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);
}
/**
* @dev Returns true if the two strings are equal.
*/
function equal(string memory a, string memory b) internal pure returns (bool) {
return keccak256(bytes(a)) == keccak256(bytes(b));
}
}// SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.0;
interface IUser {
function getRef(address account) external view returns (address);
}{
"optimizer": {
"enabled": true,
"runs": 200
},
"evmVersion": "paris",
"outputSelection": {
"*": {
"*": [
"evm.bytecode",
"evm.deployedBytecode",
"devdoc",
"userdoc",
"metadata",
"abi"
]
}
},
"libraries": {}
}Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
Contract ABI
API[{"inputs":[],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"round","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"amount_token","type":"uint256"},{"indexed":false,"internalType":"string","name":"productName","type":"string"}],"name":"ADMIN_UPDATE_BUY_EVENT","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"round","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"},{"indexed":false,"internalType":"string","name":"productName","type":"string"},{"indexed":false,"internalType":"uint256","name":"timestamp","type":"uint256"}],"name":"Claim","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"account","type":"address"}],"name":"Paused","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"bytes32","name":"previousAdminRole","type":"bytes32"},{"indexed":true,"internalType":"bytes32","name":"newAdminRole","type":"bytes32"}],"name":"RoleAdminChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"sender","type":"address"}],"name":"RoleGranted","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"sender","type":"address"}],"name":"RoleRevoked","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"account","type":"address"}],"name":"Unpaused","type":"event"},{"inputs":[],"name":"DEFAULT_ADMIN_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"MODERATOR","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_round","type":"uint256"}],"name":"claimToken","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_tokenAddress","type":"address"}],"name":"clearUnknownToken","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_round","type":"uint256"}],"name":"disableRound","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_round","type":"uint256"}],"name":"enableRound","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"getLockTime","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"}],"name":"getRoleAdmin","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_round","type":"uint256"}],"name":"getRoundDetail","outputs":[{"components":[{"internalType":"uint256","name":"startClaimTime","type":"uint256"},{"internalType":"uint256","name":"roundPrice","type":"uint256"},{"internalType":"uint256","name":"totalClaim","type":"uint256"},{"internalType":"uint256","name":"totalClaimed","type":"uint256"},{"internalType":"uint256","name":"vestingPercent","type":"uint256"},{"internalType":"uint256","name":"divPercent","type":"uint256"},{"internalType":"bool","name":"enableClaim","type":"bool"}],"internalType":"struct ClaimSale.RoundDetail","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getTokenSale","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_account","type":"address"},{"internalType":"uint256","name":"_index","type":"uint256"}],"name":"getUserHistory","outputs":[{"components":[{"internalType":"uint256","name":"round","type":"uint256"},{"internalType":"uint256","name":"amountPayment","type":"uint256"},{"internalType":"uint256","name":"amountToken","type":"uint256"},{"internalType":"uint256","name":"typeUpdate","type":"uint256"}],"internalType":"struct ClaimSale.UserHistory","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_account","type":"address"}],"name":"getUserHistoryLength","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_round","type":"uint256"},{"internalType":"address","name":"_account","type":"address"}],"name":"getUserRoundDetail","outputs":[{"components":[{"internalType":"uint256","name":"amountToken","type":"uint256"},{"internalType":"uint256","name":"amountPayment","type":"uint256"},{"internalType":"uint256","name":"amountClaimed","type":"uint256"},{"internalType":"uint256","name":"userNextClaim","type":"uint256"}],"internalType":"struct ClaimSale.UserRound","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_account","type":"address"}],"name":"getUserStatistic","outputs":[{"components":[{"internalType":"uint256","name":"amountToken","type":"uint256"},{"internalType":"uint256","name":"amountPayment","type":"uint256"},{"internalType":"uint256","name":"amountClaimed","type":"uint256"}],"internalType":"struct ClaimSale.UserStatistic","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"grantRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"hasRole","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"lockTime","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pause","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"paused","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"productName","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"renounceRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"revokeRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"roundDetail","outputs":[{"internalType":"uint256","name":"startClaimTime","type":"uint256"},{"internalType":"uint256","name":"roundPrice","type":"uint256"},{"internalType":"uint256","name":"totalClaim","type":"uint256"},{"internalType":"uint256","name":"totalClaimed","type":"uint256"},{"internalType":"uint256","name":"vestingPercent","type":"uint256"},{"internalType":"uint256","name":"divPercent","type":"uint256"},{"internalType":"bool","name":"enableClaim","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_lockTime","type":"uint256"}],"name":"setLockTime","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_round","type":"uint256"},{"internalType":"uint256","name":"_startClaimTime","type":"uint256"},{"internalType":"uint256","name":"_roundPrice","type":"uint256"},{"internalType":"uint256","name":"_totalClaim","type":"uint256"},{"internalType":"uint256","name":"_totalClaimed","type":"uint256"},{"internalType":"uint256","name":"_vestingPercent","type":"uint256"},{"internalType":"uint256","name":"_divPercent","type":"uint256"},{"internalType":"bool","name":"_enableClaim","type":"bool"}],"name":"setRound","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_round","type":"uint256"},{"internalType":"uint256","name":"_vestingPercent","type":"uint256"},{"internalType":"uint256","name":"_divPercent","type":"uint256"}],"name":"setRoundClaim","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_round","type":"uint256"},{"internalType":"uint256","name":"_startClaimTime","type":"uint256"}],"name":"setRoundClaimTime","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_token","type":"address"}],"name":"setToken","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_round","type":"uint256"},{"internalType":"address","name":"_wallet","type":"address"},{"internalType":"uint256","name":"_amountPayment","type":"uint256"},{"internalType":"uint256","name":"_amountToken","type":"uint256"},{"internalType":"uint256","name":"_amountClaimed","type":"uint256"},{"internalType":"uint256","name":"_userNextClaim","type":"uint256"},{"internalType":"uint256","name":"_typeUpdate","type":"uint256"}],"name":"setUserRoundDetail","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_wallet","type":"address"},{"internalType":"uint256","name":"_amountToken","type":"uint256"},{"internalType":"uint256","name":"_amountPayment","type":"uint256"},{"internalType":"uint256","name":"_amountClaimed","type":"uint256"}],"name":"setUserStatistic","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_round","type":"uint256"},{"internalType":"address[]","name":"_wallets","type":"address[]"},{"internalType":"uint256[]","name":"_amountTokens","type":"uint256[]"},{"internalType":"uint256[]","name":"_amountPaymentToken","type":"uint256[]"},{"internalType":"uint256[]","name":"_amountClaimed","type":"uint256[]"},{"internalType":"uint256[]","name":"_userNextClaim","type":"uint256[]"},{"internalType":"uint256","name":"_typeUpdate","type":"uint256"}],"name":"setUsersRoundDetail","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":[],"name":"unpause","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"uint256","name":"","type":"uint256"}],"name":"userRoundDetail","outputs":[{"internalType":"uint256","name":"amountToken","type":"uint256"},{"internalType":"uint256","name":"amountPayment","type":"uint256"},{"internalType":"uint256","name":"amountClaimed","type":"uint256"},{"internalType":"uint256","name":"userNextClaim","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"userStatistic","outputs":[{"internalType":"uint256","name":"amountToken","type":"uint256"},{"internalType":"uint256","name":"amountPayment","type":"uint256"},{"internalType":"uint256","name":"amountClaimed","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"uint256","name":"","type":"uint256"}],"name":"userUpdateHistory","outputs":[{"internalType":"uint256","name":"round","type":"uint256"},{"internalType":"uint256","name":"amountPayment","type":"uint256"},{"internalType":"uint256","name":"amountToken","type":"uint256"},{"internalType":"uint256","name":"typeUpdate","type":"uint256"}],"stateMutability":"view","type":"function"}]Contract Creation Code
600780546001600160a01b03191673045c2767a6cae0a4551f40e4e8d250af94fe056b17815560c0604052608090815266746f6e6361707960c81b60a0526008906200004c90826200041d565b50620151806009553480156200006157600080fd5b506001805460ff191681556002556200009b7f58c8e11deab7910e89bf18a1168c6e6ef28748f00fd3094549459f01cec5e0aa33620002d5565b620000a8600033620002d5565b6040518060e00160405280636825e55081526020016548c27395000081526020016000815260200160008152602001600181526020016103e881526020016001151581525060066000808152602001908152602001600020600082015181600001556020820151816001015560408201518160020155606082015181600301556080820151816004015560a0820151816005015560c08201518160060160006101000a81548160ff0219169083151502179055509050506040518060e00160405280636825e5508152602001656d23ad5f800081526020016000815260200160008152602001600181526020016103e88152602001600015158152506006600060018152602001908152602001600020600082015181600001556020820151816001015560408201518160020155606082015181600301556080820151816004015560a0820151816005015560c08201518160060160006101000a81548160ff0219169083151502179055509050506040518060e00160405280636825e5508152602001659184e72a000081526020016000815260200160008152602001600181526020016103e88152602001600015158152506006600060028152602001908152602001600020600082015181600001556020820151816001015560408201518160020155606082015181600301556080820151816004015560a0820151816005015560c08201518160060160006101000a81548160ff021916908315150217905550905050620004e9565b6000828152602081815260408083206001600160a01b038516845290915290205460ff1662000372576000828152602081815260408083206001600160a01b03851684529091529020805460ff19166001179055620003313390565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45b5050565b634e487b7160e01b600052604160045260246000fd5b600181811c90821680620003a157607f821691505b602082108103620003c257634e487b7160e01b600052602260045260246000fd5b50919050565b601f82111562000418576000816000526020600020601f850160051c81016020861015620003f35750805b601f850160051c820191505b818110156200041457828155600101620003ff565b5050505b505050565b81516001600160401b0381111562000439576200043962000376565b62000451816200044a84546200038c565b84620003c8565b602080601f831160018114620004895760008415620004705750858301515b600019600386901b1c1916600185901b17855562000414565b600085815260208120601f198616915b82811015620004ba5788860151825594840194600190910190840162000499565b5085821015620004d95787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b61229280620004f96000396000f3fe608060405234801561001057600080fd5b506004361061021c5760003560e01c80638dfbb4bb11610125578063c13d4c46116100ad578063e33120b31161007c578063e33120b3146105d1578063ee8e3144146105e4578063f1516f8714610604578063fc367c6114610639578063fdd962281461066257600080fd5b8063c13d4c4614610512578063d2d55c7414610525578063d4679e7314610538578063d547741f146105be57600080fd5b8063a9896b56116100f4578063a9896b56146104b6578063a9e7c2e5146104d1578063ae04d45d146104e4578063b18e0193146104f7578063c0a4d64d1461050a57600080fd5b80638dfbb4bb1461041d57806391d1485414610430578063a217fddf14610443578063a8504c8f1461044b57600080fd5b80633b10ad07116101a857806376b8a31d1161017757806376b8a31d1461037b57806379621b2a1461038e5780637f7650eb146103ed5780638456cb591461040257806389aea0041461040a57600080fd5b80633b10ad071461030b5780633f4ba83a1461031e5780635c975abb146103265780636b9c71ea1461033157600080fd5b8063248a9ca3116101ef578063248a9ca3146102885780632f2ff15d146102ab57806334b4e625146102be57806336568abe146102e557806337e429be146102f857600080fd5b806301ffc9a7146102215780630d66808714610249578063144fa6d7146102605780631c584ebd14610275575b600080fd5b61023461022f366004611ae3565b610675565b60405190151581526020015b60405180910390f35b61025260095481565b604051908152602001610240565b61027361026e366004611b29565b6106ac565b005b610273610283366004611b44565b6106da565b610252610296366004611b9b565b60009081526020819052604090206001015490565b6102736102b9366004611bb4565b610810565b6102527f58c8e11deab7910e89bf18a1168c6e6ef28748f00fd3094549459f01cec5e0aa81565b6102736102f3366004611bb4565b61083a565b610273610306366004611b29565b6108bd565b610273610319366004611bee565b6109ad565b610273610a3a565b60015460ff16610234565b61036061033f366004611b29565b60056020526000908152604090208054600182015460029092015490919083565b60408051938452602084019290925290820152606001610240565b610273610389366004611b9b565b610a50565b6103cd61039c366004611c58565b6003602081815260009384526040808520909152918352912080546001820154600283015492909301549092919084565b604080519485526020850193909352918301526060820152608001610240565b6103f5610a7b565b6040516102409190611ca6565b610273610b09565b610273610418366004611e19565b610b1c565b61027361042b366004611efe565b610ea3565b61023461043e366004611bb4565b610ecc565b610252600081565b61045e610459366004611b9b565b610ef5565b6040516102409190600060e082019050825182526020830151602083015260408301516040830152606083015160608301526080830151608083015260a083015160a083015260c0830151151560c083015292915050565b6007546040516001600160a01b039091168152602001610240565b6102736104df366004611b9b565b610f9c565b6102736104f2366004611b9b565b6113c3565b610273610505366004611f2a565b6113d4565b600954610252565b6103cd610520366004611c58565b6113f2565b610273610533366004611f4c565b611438565b610587610546366004611b9b565b600660208190526000918252604090912080546001820154600283015460038401546004850154600586015495909601549395929491939092919060ff1687565b604080519788526020880196909652948601939093526060850191909152608084015260a0830152151560c082015260e001610240565b6102736105cc366004611bb4565b61146b565b6102736105df366004611b9b565b611490565b6105f76105f2366004611bb4565b6114b8565b6040516102409190611f85565b610617610612366004611b29565b611539565b6040805182518152602080840151908201529181015190820152606001610240565b610252610647366004611b29565b6001600160a01b031660009081526004602052604090205490565b6105f7610670366004611c58565b61159f565b60006001600160e01b03198216637965db0b60e01b14806106a657506301ffc9a760e01b6001600160e01b03198316145b92915050565b60006106b78161163d565b50600780546001600160a01b0319166001600160a01b0392909216919091179055565b60006106e58161163d565b6001600160a01b03871660008181526003602081815260408084208d855282528084208a8155600181018c9055600281018a90559283018890559383526005905291812080549091889183919061073d908490611fc6565b92505081905550868160010160008282546107589190611fc6565b90915550506001600160a01b038916600090815260046020818152604080842081516080810183528f81528084018e81528184018e8152606083018c8152845460018181018755958a52969098209251959096029091019384555190830155915160028201559151600390920191909155517fa4059eb81d846d5955e857b676a3287bfefc6aed86a650d4fe35203912d93071906107fc908c908a906008906120b7565b60405180910390a150505050505050505050565b60008281526020819052604090206001015461082b8161163d565b6108358383611647565b505050565b6001600160a01b03811633146108af5760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201526e103937b632b9903337b91039b2b63360891b60648201526084015b60405180910390fd5b6108b982826116cb565b5050565b60006108c88161163d565b6040516370a0823160e01b81523060048201526000906001600160a01b038416906370a0823190602401602060405180830381865afa15801561090f573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061093391906120df565b60405163a9059cbb60e01b8152336004820152602481018290529091506001600160a01b0384169063a9059cbb906044016020604051808303816000875af1158015610983573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109a791906120f8565b50505050565b60006109b88161163d565b506040805160e0810182529788526020808901978852888201968752606089019586526080890194855260a0890193845291151560c089019081526000998a5260069283905298209651875594516001870155925160028601559051600385015551600484015551600583015591519101805460ff1916911515919091179055565b6000610a458161163d565b610a4d611730565b50565b6000610a5b8161163d565b50600090815260066020819052604090912001805460ff19166001179055565b60088054610a8890611fd9565b80601f0160208091040260200160405190810160405280929190818152602001828054610ab490611fd9565b8015610b015780601f10610ad657610100808354040283529160200191610b01565b820191906000526020600020905b815481529060010190602001808311610ae457829003601f168201915b505050505081565b6000610b148161163d565b610a4d611782565b6000610b278161163d565b603287511115610b6a5760405162461bcd60e51b815260206004820152600e60248201526d4c696d6974203530206974656d7360901b60448201526064016108a6565b85518751148015610b7c575084518751145b8015610b89575083518751145b8015610b96575082518751145b610bd45760405162461bcd60e51b815260206004820152600f60248201526e125b9c1d5d081b9bdd081d985b1a59608a1b60448201526064016108a6565b60005b8751811015610e98576000600360008a8481518110610bf857610bf8612115565b60200260200101516001600160a01b03166001600160a01b0316815260200190815260200160002060008b81526020019081526020016000209050878281518110610c4557610c45612115565b60200260200101518160000181905550868281518110610c6757610c67612115565b60200260200101518160010181905550858281518110610c8957610c89612115565b60200260200101518160020181905550848281518110610cab57610cab612115565b602002602001015181600301819055506000600560008b8581518110610cd357610cd3612115565b60200260200101516001600160a01b03166001600160a01b031681526020019081526020016000209050888381518110610d0f57610d0f612115565b6020026020010151816000016000828254610d2a9190611fc6565b92505081905550878381518110610d4357610d43612115565b6020026020010151816001016000828254610d5e9190611fc6565b92505081905550600460008b8581518110610d7b57610d7b612115565b60200260200101516001600160a01b03166001600160a01b0316815260200190815260200160002060405180608001604052808d81526020018a8681518110610dc657610dc6612115565b602002602001015181526020018b8681518110610de557610de5612115565b602090810291909101810151825290810188905282546001818101855560009485529382902083516004909202019081559082015192810192909255604081015160028301556060015160039091015588517fa4059eb81d846d5955e857b676a3287bfefc6aed86a650d4fe35203912d93071908c908b9086908110610e6d57610e6d612115565b60200260200101516008604051610e86939291906120b7565b60405180910390a15050600101610bd7565b505050505050505050565b6000610eae8161163d565b50600092835260066020526040909220600481019190915560050155565b6000918252602082815260408084206001600160a01b0393909316845291905290205460ff1690565b610f376040518060e001604052806000815260200160008152602001600081526020016000815260200160008152602001600081526020016000151581525090565b50600090815260066020818152604092839020835160e081018552815481526001820154928101929092526002810154938201939093526003830154606082015260048301546080820152600583015460a082015291015460ff16151560c082015290565b610fa46117bd565b610fac611805565b6000818152600660208181526040808420815160e0810183528154815260018201548185015260028201548184015260038083015460608301526004830154608083015260058084015460a0840152929095015460ff16151560c08201908152338088529585528387208888528552838720958752919093529320925190929061106b5760405162461bcd60e51b815260206004820152601060248201526f436c61696d206e6f7420656e61626c6560801b60448201526064016108a6565b825142101561108c5760405162461bcd60e51b81526004016108a69061212b565b82516000036110d25760405162461bcd60e51b815260206004820152601260248201527110db185a5b481d1a5b59481b9bdd081cd95d60721b60448201526064016108a6565b81600301546000036111045782514210156110ff5760405162461bcd60e51b81526004016108a69061212b565b611128565b42826003015411156111285760405162461bcd60e51b81526004016108a69061212b565b815460a0840151608085015160009161114c9161114690859061185c565b9061186f565b6007546040516370a0823160e01b815230600482015291925082916001600160a01b03909116906370a0823190602401602060405180830381865afa158015611199573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906111bd91906120df565b101561120b5760405162461bcd60e51b815260206004820152601b60248201527f436f6e7472616374206e6f7420656e6f7567682062616c616e6365000000000060448201526064016108a6565b818460020154106112555760405162461bcd60e51b8152602060048201526014602482015273165bdd481a185d994818db185a5b595908185b1b60621b60448201526064016108a6565b818185600201546112669190611fc6565b111561127f57600284015461127c90839061187b565b90505b600284015461128e9082611887565b600285015560075460405163a9059cbb60e01b8152336004820152602481018390526001600160a01b039091169063a9059cbb906044016020604051808303816000875af11580156112e4573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061130891906120f8565b507f4d59db684deef28a8886e4b807cab82ce5b7ad09c4b6870800ce593eb284b1f7868260088760030154600014611344578760030154611347565b88515b6040516113579493929190612154565b60405180910390a1600283015461136e9082611887565b6002840155600384015460000361139857600954855161138e9190611fc6565b60038501556113b4565b6009548460030160008282546113ae9190611fc6565b90915550505b5050505050610a4d6001600255565b60006113ce8161163d565b50600955565b60006113df8161163d565b5060009182526006602052604090912055565b6004602052816000526040600020818154811061140e57600080fd5b60009182526020909120600490910201805460018201546002830154600390930154919450925084565b60006114438161163d565b506001600160a01b039093166000908152600560205260409020918255600182015560020155565b6000828152602081905260409020600101546114868161163d565b61083583836116cb565b600061149b8161163d565b50600090815260066020819052604090912001805460ff19169055565b6114e36040518060800160405280600081526020016000815260200160008152602001600081525090565b506001600160a01b03166000908152600360208181526040808420948452938152918390208351608081018552815481526001820154938101939093526002810154938301939093529190910154606082015290565b61155d60405180606001604052806000815260200160008152602001600081525090565b506001600160a01b0316600090815260056020908152604091829020825160608101845281548152600182015492810192909252600201549181019190915290565b6115ca6040518060800160405280600081526020016000815260200160008152602001600081525090565b6001600160a01b03831660009081526004602052604090208054839081106115f4576115f4612115565b9060005260206000209060040201604051806080016040529081600082015481526020016001820154815260200160028201548152602001600382015481525050905092915050565b610a4d8133611893565b6116518282610ecc565b6108b9576000828152602081815260408083206001600160a01b03851684529091529020805460ff191660011790556116873390565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b6116d58282610ecc565b156108b9576000828152602081815260408083206001600160a01b0385168085529252808320805460ff1916905551339285917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a45050565b6117386118ec565b6001805460ff191690557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa335b6040516001600160a01b03909116815260200160405180910390a1565b61178a6117bd565b6001805460ff1916811790557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a25833611765565b60015460ff16156118035760405162461bcd60e51b815260206004820152601060248201526f14185d5cd8589b194e881c185d5cd95960821b60448201526064016108a6565b565b60028054036118565760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c0060448201526064016108a6565b60028055565b60006118688284612184565b9392505050565b6000611868828461219b565b600061186882846121bd565b60006118688284611fc6565b61189d8282610ecc565b6108b9576118aa81611935565b6118b5836020611947565b6040516020016118c69291906121d0565b60408051601f198184030181529082905262461bcd60e51b82526108a691600401611ca6565b60015460ff166118035760405162461bcd60e51b815260206004820152601460248201527314185d5cd8589b194e881b9bdd081c185d5cd95960621b60448201526064016108a6565b60606106a66001600160a01b03831660145b60606000611956836002612184565b611961906002611fc6565b67ffffffffffffffff81111561197957611979611cd9565b6040519080825280601f01601f1916602001820160405280156119a3576020820181803683370190505b509050600360fc1b816000815181106119be576119be612115565b60200101906001600160f81b031916908160001a905350600f60fb1b816001815181106119ed576119ed612115565b60200101906001600160f81b031916908160001a9053506000611a11846002612184565b611a1c906001611fc6565b90505b6001811115611a94576f181899199a1a9b1b9c1cb0b131b232b360811b85600f1660108110611a5057611a50612115565b1a60f81b828281518110611a6657611a66612115565b60200101906001600160f81b031916908160001a90535060049490941c93611a8d81612245565b9050611a1f565b5083156118685760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e7460448201526064016108a6565b600060208284031215611af557600080fd5b81356001600160e01b03198116811461186857600080fd5b80356001600160a01b0381168114611b2457600080fd5b919050565b600060208284031215611b3b57600080fd5b61186882611b0d565b600080600080600080600060e0888a031215611b5f57600080fd5b87359650611b6f60208901611b0d565b96999698505050506040850135946060810135946080820135945060a0820135935060c0909101359150565b600060208284031215611bad57600080fd5b5035919050565b60008060408385031215611bc757600080fd5b82359150611bd760208401611b0d565b90509250929050565b8015158114610a4d57600080fd5b600080600080600080600080610100898b031215611c0b57600080fd5b883597506020890135965060408901359550606089013594506080890135935060a0890135925060c0890135915060e0890135611c4781611be0565b809150509295985092959890939650565b60008060408385031215611c6b57600080fd5b611c7483611b0d565b946020939093013593505050565b60005b83811015611c9d578181015183820152602001611c85565b50506000910152565b6020815260008251806020840152611cc5816040850160208701611c82565b601f01601f19169190910160400192915050565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f1916810167ffffffffffffffff81118282101715611d1857611d18611cd9565b604052919050565b600067ffffffffffffffff821115611d3a57611d3a611cd9565b5060051b60200190565b600082601f830112611d5557600080fd5b81356020611d6a611d6583611d20565b611cef565b8083825260208201915060208460051b870101935086841115611d8c57600080fd5b602086015b84811015611daf57611da281611b0d565b8352918301918301611d91565b509695505050505050565b600082601f830112611dcb57600080fd5b81356020611ddb611d6583611d20565b8083825260208201915060208460051b870101935086841115611dfd57600080fd5b602086015b84811015611daf5780358352918301918301611e02565b600080600080600080600060e0888a031215611e3457600080fd5b87359650602088013567ffffffffffffffff80821115611e5357600080fd5b611e5f8b838c01611d44565b975060408a0135915080821115611e7557600080fd5b611e818b838c01611dba565b965060608a0135915080821115611e9757600080fd5b611ea38b838c01611dba565b955060808a0135915080821115611eb957600080fd5b611ec58b838c01611dba565b945060a08a0135915080821115611edb57600080fd5b50611ee88a828b01611dba565b92505060c0880135905092959891949750929550565b600080600060608486031215611f1357600080fd5b505081359360208301359350604090920135919050565b60008060408385031215611f3d57600080fd5b50508035926020909101359150565b60008060008060808587031215611f6257600080fd5b611f6b85611b0d565b966020860135965060408601359560600135945092505050565b81518152602080830151908201526040808301519082015260608083015190820152608081016106a6565b634e487b7160e01b600052601160045260246000fd5b808201808211156106a6576106a6611fb0565b600181811c90821680611fed57607f821691505b60208210810361200d57634e487b7160e01b600052602260045260246000fd5b50919050565b8054600090600181811c908083168061202d57607f831692505b6020808410820361204e57634e487b7160e01b600052602260045260246000fd5b83885260208801828015612069576001811461207f576120aa565b60ff198716825285151560051b820197506120aa565b60008981526020902060005b878110156120a45781548482015290860190840161208b565b83019850505b5050505050505092915050565b8381528260208201526060604082015260006120d66060830184612013565b95945050505050565b6000602082840312156120f157600080fd5b5051919050565b60006020828403121561210a57600080fd5b815161186881611be0565b634e487b7160e01b600052603260045260246000fd5b6020808252600f908201526e436c61696d206e6f7420726561647960881b604082015260600190565b8481528360208201526080604082015260006121736080830185612013565b905082606083015295945050505050565b80820281158282048414176106a6576106a6611fb0565b6000826121b857634e487b7160e01b600052601260045260246000fd5b500490565b818103818111156106a6576106a6611fb0565b7f416363657373436f6e74726f6c3a206163636f756e7420000000000000000000815260008351612208816017850160208801611c82565b7001034b99036b4b9b9b4b733903937b6329607d1b6017918401918201528351612239816028840160208801611c82565b01602801949350505050565b60008161225457612254611fb0565b50600019019056fea2646970667358221220cc382eea18a90211c1d66990de9dadad97f43554b0e85e2d0d7de23d9bcd262764736f6c63430008180033
Deployed Bytecode
0x608060405234801561001057600080fd5b506004361061021c5760003560e01c80638dfbb4bb11610125578063c13d4c46116100ad578063e33120b31161007c578063e33120b3146105d1578063ee8e3144146105e4578063f1516f8714610604578063fc367c6114610639578063fdd962281461066257600080fd5b8063c13d4c4614610512578063d2d55c7414610525578063d4679e7314610538578063d547741f146105be57600080fd5b8063a9896b56116100f4578063a9896b56146104b6578063a9e7c2e5146104d1578063ae04d45d146104e4578063b18e0193146104f7578063c0a4d64d1461050a57600080fd5b80638dfbb4bb1461041d57806391d1485414610430578063a217fddf14610443578063a8504c8f1461044b57600080fd5b80633b10ad07116101a857806376b8a31d1161017757806376b8a31d1461037b57806379621b2a1461038e5780637f7650eb146103ed5780638456cb591461040257806389aea0041461040a57600080fd5b80633b10ad071461030b5780633f4ba83a1461031e5780635c975abb146103265780636b9c71ea1461033157600080fd5b8063248a9ca3116101ef578063248a9ca3146102885780632f2ff15d146102ab57806334b4e625146102be57806336568abe146102e557806337e429be146102f857600080fd5b806301ffc9a7146102215780630d66808714610249578063144fa6d7146102605780631c584ebd14610275575b600080fd5b61023461022f366004611ae3565b610675565b60405190151581526020015b60405180910390f35b61025260095481565b604051908152602001610240565b61027361026e366004611b29565b6106ac565b005b610273610283366004611b44565b6106da565b610252610296366004611b9b565b60009081526020819052604090206001015490565b6102736102b9366004611bb4565b610810565b6102527f58c8e11deab7910e89bf18a1168c6e6ef28748f00fd3094549459f01cec5e0aa81565b6102736102f3366004611bb4565b61083a565b610273610306366004611b29565b6108bd565b610273610319366004611bee565b6109ad565b610273610a3a565b60015460ff16610234565b61036061033f366004611b29565b60056020526000908152604090208054600182015460029092015490919083565b60408051938452602084019290925290820152606001610240565b610273610389366004611b9b565b610a50565b6103cd61039c366004611c58565b6003602081815260009384526040808520909152918352912080546001820154600283015492909301549092919084565b604080519485526020850193909352918301526060820152608001610240565b6103f5610a7b565b6040516102409190611ca6565b610273610b09565b610273610418366004611e19565b610b1c565b61027361042b366004611efe565b610ea3565b61023461043e366004611bb4565b610ecc565b610252600081565b61045e610459366004611b9b565b610ef5565b6040516102409190600060e082019050825182526020830151602083015260408301516040830152606083015160608301526080830151608083015260a083015160a083015260c0830151151560c083015292915050565b6007546040516001600160a01b039091168152602001610240565b6102736104df366004611b9b565b610f9c565b6102736104f2366004611b9b565b6113c3565b610273610505366004611f2a565b6113d4565b600954610252565b6103cd610520366004611c58565b6113f2565b610273610533366004611f4c565b611438565b610587610546366004611b9b565b600660208190526000918252604090912080546001820154600283015460038401546004850154600586015495909601549395929491939092919060ff1687565b604080519788526020880196909652948601939093526060850191909152608084015260a0830152151560c082015260e001610240565b6102736105cc366004611bb4565b61146b565b6102736105df366004611b9b565b611490565b6105f76105f2366004611bb4565b6114b8565b6040516102409190611f85565b610617610612366004611b29565b611539565b6040805182518152602080840151908201529181015190820152606001610240565b610252610647366004611b29565b6001600160a01b031660009081526004602052604090205490565b6105f7610670366004611c58565b61159f565b60006001600160e01b03198216637965db0b60e01b14806106a657506301ffc9a760e01b6001600160e01b03198316145b92915050565b60006106b78161163d565b50600780546001600160a01b0319166001600160a01b0392909216919091179055565b60006106e58161163d565b6001600160a01b03871660008181526003602081815260408084208d855282528084208a8155600181018c9055600281018a90559283018890559383526005905291812080549091889183919061073d908490611fc6565b92505081905550868160010160008282546107589190611fc6565b90915550506001600160a01b038916600090815260046020818152604080842081516080810183528f81528084018e81528184018e8152606083018c8152845460018181018755958a52969098209251959096029091019384555190830155915160028201559151600390920191909155517fa4059eb81d846d5955e857b676a3287bfefc6aed86a650d4fe35203912d93071906107fc908c908a906008906120b7565b60405180910390a150505050505050505050565b60008281526020819052604090206001015461082b8161163d565b6108358383611647565b505050565b6001600160a01b03811633146108af5760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201526e103937b632b9903337b91039b2b63360891b60648201526084015b60405180910390fd5b6108b982826116cb565b5050565b60006108c88161163d565b6040516370a0823160e01b81523060048201526000906001600160a01b038416906370a0823190602401602060405180830381865afa15801561090f573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061093391906120df565b60405163a9059cbb60e01b8152336004820152602481018290529091506001600160a01b0384169063a9059cbb906044016020604051808303816000875af1158015610983573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109a791906120f8565b50505050565b60006109b88161163d565b506040805160e0810182529788526020808901978852888201968752606089019586526080890194855260a0890193845291151560c089019081526000998a5260069283905298209651875594516001870155925160028601559051600385015551600484015551600583015591519101805460ff1916911515919091179055565b6000610a458161163d565b610a4d611730565b50565b6000610a5b8161163d565b50600090815260066020819052604090912001805460ff19166001179055565b60088054610a8890611fd9565b80601f0160208091040260200160405190810160405280929190818152602001828054610ab490611fd9565b8015610b015780601f10610ad657610100808354040283529160200191610b01565b820191906000526020600020905b815481529060010190602001808311610ae457829003601f168201915b505050505081565b6000610b148161163d565b610a4d611782565b6000610b278161163d565b603287511115610b6a5760405162461bcd60e51b815260206004820152600e60248201526d4c696d6974203530206974656d7360901b60448201526064016108a6565b85518751148015610b7c575084518751145b8015610b89575083518751145b8015610b96575082518751145b610bd45760405162461bcd60e51b815260206004820152600f60248201526e125b9c1d5d081b9bdd081d985b1a59608a1b60448201526064016108a6565b60005b8751811015610e98576000600360008a8481518110610bf857610bf8612115565b60200260200101516001600160a01b03166001600160a01b0316815260200190815260200160002060008b81526020019081526020016000209050878281518110610c4557610c45612115565b60200260200101518160000181905550868281518110610c6757610c67612115565b60200260200101518160010181905550858281518110610c8957610c89612115565b60200260200101518160020181905550848281518110610cab57610cab612115565b602002602001015181600301819055506000600560008b8581518110610cd357610cd3612115565b60200260200101516001600160a01b03166001600160a01b031681526020019081526020016000209050888381518110610d0f57610d0f612115565b6020026020010151816000016000828254610d2a9190611fc6565b92505081905550878381518110610d4357610d43612115565b6020026020010151816001016000828254610d5e9190611fc6565b92505081905550600460008b8581518110610d7b57610d7b612115565b60200260200101516001600160a01b03166001600160a01b0316815260200190815260200160002060405180608001604052808d81526020018a8681518110610dc657610dc6612115565b602002602001015181526020018b8681518110610de557610de5612115565b602090810291909101810151825290810188905282546001818101855560009485529382902083516004909202019081559082015192810192909255604081015160028301556060015160039091015588517fa4059eb81d846d5955e857b676a3287bfefc6aed86a650d4fe35203912d93071908c908b9086908110610e6d57610e6d612115565b60200260200101516008604051610e86939291906120b7565b60405180910390a15050600101610bd7565b505050505050505050565b6000610eae8161163d565b50600092835260066020526040909220600481019190915560050155565b6000918252602082815260408084206001600160a01b0393909316845291905290205460ff1690565b610f376040518060e001604052806000815260200160008152602001600081526020016000815260200160008152602001600081526020016000151581525090565b50600090815260066020818152604092839020835160e081018552815481526001820154928101929092526002810154938201939093526003830154606082015260048301546080820152600583015460a082015291015460ff16151560c082015290565b610fa46117bd565b610fac611805565b6000818152600660208181526040808420815160e0810183528154815260018201548185015260028201548184015260038083015460608301526004830154608083015260058084015460a0840152929095015460ff16151560c08201908152338088529585528387208888528552838720958752919093529320925190929061106b5760405162461bcd60e51b815260206004820152601060248201526f436c61696d206e6f7420656e61626c6560801b60448201526064016108a6565b825142101561108c5760405162461bcd60e51b81526004016108a69061212b565b82516000036110d25760405162461bcd60e51b815260206004820152601260248201527110db185a5b481d1a5b59481b9bdd081cd95d60721b60448201526064016108a6565b81600301546000036111045782514210156110ff5760405162461bcd60e51b81526004016108a69061212b565b611128565b42826003015411156111285760405162461bcd60e51b81526004016108a69061212b565b815460a0840151608085015160009161114c9161114690859061185c565b9061186f565b6007546040516370a0823160e01b815230600482015291925082916001600160a01b03909116906370a0823190602401602060405180830381865afa158015611199573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906111bd91906120df565b101561120b5760405162461bcd60e51b815260206004820152601b60248201527f436f6e7472616374206e6f7420656e6f7567682062616c616e6365000000000060448201526064016108a6565b818460020154106112555760405162461bcd60e51b8152602060048201526014602482015273165bdd481a185d994818db185a5b595908185b1b60621b60448201526064016108a6565b818185600201546112669190611fc6565b111561127f57600284015461127c90839061187b565b90505b600284015461128e9082611887565b600285015560075460405163a9059cbb60e01b8152336004820152602481018390526001600160a01b039091169063a9059cbb906044016020604051808303816000875af11580156112e4573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061130891906120f8565b507f4d59db684deef28a8886e4b807cab82ce5b7ad09c4b6870800ce593eb284b1f7868260088760030154600014611344578760030154611347565b88515b6040516113579493929190612154565b60405180910390a1600283015461136e9082611887565b6002840155600384015460000361139857600954855161138e9190611fc6565b60038501556113b4565b6009548460030160008282546113ae9190611fc6565b90915550505b5050505050610a4d6001600255565b60006113ce8161163d565b50600955565b60006113df8161163d565b5060009182526006602052604090912055565b6004602052816000526040600020818154811061140e57600080fd5b60009182526020909120600490910201805460018201546002830154600390930154919450925084565b60006114438161163d565b506001600160a01b039093166000908152600560205260409020918255600182015560020155565b6000828152602081905260409020600101546114868161163d565b61083583836116cb565b600061149b8161163d565b50600090815260066020819052604090912001805460ff19169055565b6114e36040518060800160405280600081526020016000815260200160008152602001600081525090565b506001600160a01b03166000908152600360208181526040808420948452938152918390208351608081018552815481526001820154938101939093526002810154938301939093529190910154606082015290565b61155d60405180606001604052806000815260200160008152602001600081525090565b506001600160a01b0316600090815260056020908152604091829020825160608101845281548152600182015492810192909252600201549181019190915290565b6115ca6040518060800160405280600081526020016000815260200160008152602001600081525090565b6001600160a01b03831660009081526004602052604090208054839081106115f4576115f4612115565b9060005260206000209060040201604051806080016040529081600082015481526020016001820154815260200160028201548152602001600382015481525050905092915050565b610a4d8133611893565b6116518282610ecc565b6108b9576000828152602081815260408083206001600160a01b03851684529091529020805460ff191660011790556116873390565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b6116d58282610ecc565b156108b9576000828152602081815260408083206001600160a01b0385168085529252808320805460ff1916905551339285917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a45050565b6117386118ec565b6001805460ff191690557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa335b6040516001600160a01b03909116815260200160405180910390a1565b61178a6117bd565b6001805460ff1916811790557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a25833611765565b60015460ff16156118035760405162461bcd60e51b815260206004820152601060248201526f14185d5cd8589b194e881c185d5cd95960821b60448201526064016108a6565b565b60028054036118565760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c0060448201526064016108a6565b60028055565b60006118688284612184565b9392505050565b6000611868828461219b565b600061186882846121bd565b60006118688284611fc6565b61189d8282610ecc565b6108b9576118aa81611935565b6118b5836020611947565b6040516020016118c69291906121d0565b60408051601f198184030181529082905262461bcd60e51b82526108a691600401611ca6565b60015460ff166118035760405162461bcd60e51b815260206004820152601460248201527314185d5cd8589b194e881b9bdd081c185d5cd95960621b60448201526064016108a6565b60606106a66001600160a01b03831660145b60606000611956836002612184565b611961906002611fc6565b67ffffffffffffffff81111561197957611979611cd9565b6040519080825280601f01601f1916602001820160405280156119a3576020820181803683370190505b509050600360fc1b816000815181106119be576119be612115565b60200101906001600160f81b031916908160001a905350600f60fb1b816001815181106119ed576119ed612115565b60200101906001600160f81b031916908160001a9053506000611a11846002612184565b611a1c906001611fc6565b90505b6001811115611a94576f181899199a1a9b1b9c1cb0b131b232b360811b85600f1660108110611a5057611a50612115565b1a60f81b828281518110611a6657611a66612115565b60200101906001600160f81b031916908160001a90535060049490941c93611a8d81612245565b9050611a1f565b5083156118685760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e7460448201526064016108a6565b600060208284031215611af557600080fd5b81356001600160e01b03198116811461186857600080fd5b80356001600160a01b0381168114611b2457600080fd5b919050565b600060208284031215611b3b57600080fd5b61186882611b0d565b600080600080600080600060e0888a031215611b5f57600080fd5b87359650611b6f60208901611b0d565b96999698505050506040850135946060810135946080820135945060a0820135935060c0909101359150565b600060208284031215611bad57600080fd5b5035919050565b60008060408385031215611bc757600080fd5b82359150611bd760208401611b0d565b90509250929050565b8015158114610a4d57600080fd5b600080600080600080600080610100898b031215611c0b57600080fd5b883597506020890135965060408901359550606089013594506080890135935060a0890135925060c0890135915060e0890135611c4781611be0565b809150509295985092959890939650565b60008060408385031215611c6b57600080fd5b611c7483611b0d565b946020939093013593505050565b60005b83811015611c9d578181015183820152602001611c85565b50506000910152565b6020815260008251806020840152611cc5816040850160208701611c82565b601f01601f19169190910160400192915050565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f1916810167ffffffffffffffff81118282101715611d1857611d18611cd9565b604052919050565b600067ffffffffffffffff821115611d3a57611d3a611cd9565b5060051b60200190565b600082601f830112611d5557600080fd5b81356020611d6a611d6583611d20565b611cef565b8083825260208201915060208460051b870101935086841115611d8c57600080fd5b602086015b84811015611daf57611da281611b0d565b8352918301918301611d91565b509695505050505050565b600082601f830112611dcb57600080fd5b81356020611ddb611d6583611d20565b8083825260208201915060208460051b870101935086841115611dfd57600080fd5b602086015b84811015611daf5780358352918301918301611e02565b600080600080600080600060e0888a031215611e3457600080fd5b87359650602088013567ffffffffffffffff80821115611e5357600080fd5b611e5f8b838c01611d44565b975060408a0135915080821115611e7557600080fd5b611e818b838c01611dba565b965060608a0135915080821115611e9757600080fd5b611ea38b838c01611dba565b955060808a0135915080821115611eb957600080fd5b611ec58b838c01611dba565b945060a08a0135915080821115611edb57600080fd5b50611ee88a828b01611dba565b92505060c0880135905092959891949750929550565b600080600060608486031215611f1357600080fd5b505081359360208301359350604090920135919050565b60008060408385031215611f3d57600080fd5b50508035926020909101359150565b60008060008060808587031215611f6257600080fd5b611f6b85611b0d565b966020860135965060408601359560600135945092505050565b81518152602080830151908201526040808301519082015260608083015190820152608081016106a6565b634e487b7160e01b600052601160045260246000fd5b808201808211156106a6576106a6611fb0565b600181811c90821680611fed57607f821691505b60208210810361200d57634e487b7160e01b600052602260045260246000fd5b50919050565b8054600090600181811c908083168061202d57607f831692505b6020808410820361204e57634e487b7160e01b600052602260045260246000fd5b83885260208801828015612069576001811461207f576120aa565b60ff198716825285151560051b820197506120aa565b60008981526020902060005b878110156120a45781548482015290860190840161208b565b83019850505b5050505050505092915050565b8381528260208201526060604082015260006120d66060830184612013565b95945050505050565b6000602082840312156120f157600080fd5b5051919050565b60006020828403121561210a57600080fd5b815161186881611be0565b634e487b7160e01b600052603260045260246000fd5b6020808252600f908201526e436c61696d206e6f7420726561647960881b604082015260600190565b8481528360208201526080604082015260006121736080830185612013565b905082606083015295945050505050565b80820281158282048414176106a6576106a6611fb0565b6000826121b857634e487b7160e01b600052601260045260246000fd5b500490565b818103818111156106a6576106a6611fb0565b7f416363657373436f6e74726f6c3a206163636f756e7420000000000000000000815260008351612208816017850160208801611c82565b7001034b99036b4b9b9b4b733903937b6329607d1b6017918401918201528351612239816028840160208801611c82565b01602801949350505050565b60008161225457612254611fb0565b50600019019056fea2646970667358221220cc382eea18a90211c1d66990de9dadad97f43554b0e85e2d0d7de23d9bcd262764736f6c63430008180033
Loading...
Loading
Loading...
Loading
Loading...
Loading
[ Download: CSV Export ]
A contract address hosts a smart contract, which is a set of code stored on the blockchain that runs when predetermined conditions are met. Learn more about addresses in our Knowledge Base.