Source Code
Overview
ETH Balance
0 ETH
Eth Value
$0.00Latest 12 from a total of 12 transactions
| Transaction Hash |
Method
|
Block
|
From
|
|
To
|
||||
|---|---|---|---|---|---|---|---|---|---|
| Grant Role | 23233696 | 173 days ago | IN | 0 ETH | 0.00032082 | ||||
| Grant Role | 23233696 | 173 days ago | IN | 0 ETH | 0.00032082 | ||||
| Grant Role | 23233696 | 173 days ago | IN | 0 ETH | 0.00032082 | ||||
| Grant Role | 23233692 | 173 days ago | IN | 0 ETH | 0.00034192 | ||||
| Grant Role | 23233690 | 173 days ago | IN | 0 ETH | 0.00035102 | ||||
| Grant Role | 23233689 | 173 days ago | IN | 0 ETH | 0.00035319 | ||||
| Grant Role | 23233687 | 173 days ago | IN | 0 ETH | 0.0003322 | ||||
| Grant Role | 23233686 | 173 days ago | IN | 0 ETH | 0.00033569 | ||||
| Grant Role | 23233685 | 173 days ago | IN | 0 ETH | 0.00034569 | ||||
| Grant Role | 23233682 | 173 days ago | IN | 0 ETH | 0.00032118 | ||||
| Update Default B... | 23233670 | 173 days ago | IN | 0 ETH | 0.00016206 | ||||
| Update Default T... | 23233664 | 173 days ago | IN | 0 ETH | 0.0001583 |
Latest 1 internal transaction
Advanced mode:
| Parent Transaction Hash | Method | Block |
From
|
|
To
|
||
|---|---|---|---|---|---|---|---|
| 0x60806040 | 23233625 | 173 days ago | Contract Creation | 0 ETH |
Loading...
Loading
Loading...
Loading
Cross-Chain Transactions
Loading...
Loading
This contract may be a proxy contract. Click on More Options and select Is this a proxy? to confirm and enable the "Read as Proxy" & "Write as Proxy" tabs.
Contract Name:
BondingCurveFactory
Compiler Version
v0.8.23+commit.f704f362
Optimization Enabled:
Yes with 200 runs
Other Settings:
paris EvmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: UNLICENSED
pragma solidity 0.8.23;
import {AccessControlEnumerable} from "@openzeppelin/contracts/access/AccessControlEnumerable.sol";
import {Clones} from "@openzeppelin/contracts/proxy/Clones.sol";
import {ReentrancyGuard} from "@openzeppelin/contracts/security/ReentrancyGuard.sol";
import {IBondingCurveFactory} from "./IBondingCurveFactory.sol";
import {BondingCurveTypes} from "../bondingcurve/BondingCurveTypes.sol";
import {IBondingCurveFactoryInternal} from "./IBondingCurveFactoryInternal.sol";
import {IBondingCurveWritableRestricted} from "../bondingcurve/writable/restricted/IBondingCurveWritableRestricted.sol";
import {IMyToken} from "../Token/IMyToken.sol";
contract BondingCurveFactory is
IBondingCurveFactory,
AccessControlEnumerable,
ReentrancyGuard,
IBondingCurveFactoryInternal
{
// Mutable state variables
uint256 private _maxLoop = 100;
address private _defaultBondingCurve;
address private _defaultToken;
BondingCurveDetail[] private _curveDetails;
mapping(string => BondingCurveDetail) private _curveDetail;
constructor(address adminAddress) {
if (adminAddress == address(0))
revert BondingCurveFactory_Admin_ZeroAddr();
_grantRole(DEFAULT_ADMIN_ROLE, adminAddress);
}
function createBondingCurve(
string calldata curveName,
BondingCurveTypes.SetUp calldata setUp,
TokenDetails calldata tokenDetails,
address[] memory adminAddresses
)
external
nonReentrant
onlyRole(DEFAULT_ADMIN_ROLE)
returns (address curve)
{
if (bytes(curveName).length == 0)
revert BondingCurveFactory_CurveName_Zero();
curve = _createBondingCurve(
curveName,
setUp,
tokenDetails,
adminAddresses
);
}
function updateDefaultBondingCurve(
address newDefaultBondingCurve
) external override onlyRole(DEFAULT_ADMIN_ROLE) {
if (newDefaultBondingCurve == address(0)) {
revert BondingCurveFactory_DefaultCurve_ZeroAddr();
}
emit DefaultBondingCurveUpdated(
_defaultBondingCurve,
newDefaultBondingCurve
);
_defaultBondingCurve = newDefaultBondingCurve;
}
function updateDefaultToken(
address newDefaultToken
) external override onlyRole(DEFAULT_ADMIN_ROLE) {
if (newDefaultToken == address(0)) {
revert BondingCurveFactory_DefaultToken_ZeroAddr();
}
emit DefaultTokenUpdated(_defaultToken, newDefaultToken);
_defaultToken = newDefaultToken;
}
function setMaxLoop(
uint256 newMaxLoop
) external override onlyRole(DEFAULT_ADMIN_ROLE) {
if (newMaxLoop == 0) revert BondingCurveFactory_MaxLoop_Zero();
_maxLoop = newMaxLoop;
emit maxLoopUpdated(newMaxLoop);
}
function getBondingCurvesDetails(
uint256 from,
uint256 to
)
external
view
override
returns (
BondingCurveDetail[] memory curves,
uint256 lastEvaluatedIndex,
uint256 totalItems
)
{
if (from > to) revert BondingCurveFactory_IndexesReversed();
unchecked {
if ((to - from) > _maxLoop) to = from + _maxLoop;
if (to > _curveDetails.length) to = _curveDetails.length;
curves = new BondingCurveDetail[](to - from);
for (uint256 i = from; i < to; ++i) {
curves[i - from] = _curveDetails[i];
}
lastEvaluatedIndex = --to;
}
totalItems = _curveDetails.length;
}
// View functions
function maxLoop() external view override returns (uint256) {
return _maxLoop;
}
function defaultBondingCurve() external view override returns (address) {
return _defaultBondingCurve;
}
function _createBondingCurve(
string calldata curveName,
BondingCurveTypes.SetUp memory setUp,
TokenDetails calldata tokenDetails,
address[] memory adminAddresses
) private returns (address) {
if (_curveDetail[curveName].bondingCurve != address(0)) {
revert BondingCurveFactory_CurveNameExists(curveName);
}
if (_defaultBondingCurve == address(0)) {
revert BondingCurveFactory_DefaultCurve_NotSet();
}
bytes32 salt = keccak256(abi.encode(_msgSender(), curveName));
address curve = Clones.cloneDeterministic(_defaultBondingCurve, salt);
address token = Clones.cloneDeterministic(_defaultToken, salt);
IMyToken(token).initialize(
tokenDetails.name,
tokenDetails.symbol,
curve,
tokenDetails.totalSupply
);
setUp.projectTokenDetails.token = token;
BondingCurveDetail memory detail = BondingCurveDetail(
curveName,
curve,
token
);
_curveDetails.push(detail);
_curveDetail[curveName] = detail;
IBondingCurveWritableRestricted(curve).initialize(
setUp,
tokenDetails.totalSupply,
adminAddresses
);
emit BondingCurveCreated(curveName, curve);
return curve;
}
}// 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 (last updated v4.5.0) (access/AccessControlEnumerable.sol)
pragma solidity ^0.8.0;
import "./IAccessControlEnumerable.sol";
import "./AccessControl.sol";
import "../utils/structs/EnumerableSet.sol";
/**
* @dev Extension of {AccessControl} that allows enumerating the members of each role.
*/
abstract contract AccessControlEnumerable is IAccessControlEnumerable, AccessControl {
using EnumerableSet for EnumerableSet.AddressSet;
mapping(bytes32 => EnumerableSet.AddressSet) private _roleMembers;
/**
* @dev See {IERC165-supportsInterface}.
*/
function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
return interfaceId == type(IAccessControlEnumerable).interfaceId || super.supportsInterface(interfaceId);
}
/**
* @dev Returns one of the accounts that have `role`. `index` must be a
* value between 0 and {getRoleMemberCount}, non-inclusive.
*
* Role bearers are not sorted in any particular way, and their ordering may
* change at any point.
*
* WARNING: When using {getRoleMember} and {getRoleMemberCount}, make sure
* you perform all queries on the same block. See the following
* https://forum.openzeppelin.com/t/iterating-over-elements-on-enumerableset-in-openzeppelin-contracts/2296[forum post]
* for more information.
*/
function getRoleMember(bytes32 role, uint256 index) public view virtual override returns (address) {
return _roleMembers[role].at(index);
}
/**
* @dev Returns the number of accounts that have `role`. Can be used
* together with {getRoleMember} to enumerate all bearers of a role.
*/
function getRoleMemberCount(bytes32 role) public view virtual override returns (uint256) {
return _roleMembers[role].length();
}
/**
* @dev Overload {_grantRole} to track enumerable memberships
*/
function _grantRole(bytes32 role, address account) internal virtual override {
super._grantRole(role, account);
_roleMembers[role].add(account);
}
/**
* @dev Overload {_revokeRole} to track enumerable memberships
*/
function _revokeRole(bytes32 role, address account) internal virtual override {
super._revokeRole(role, account);
_roleMembers[role].remove(account);
}
}// 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 v4.4.1 (access/IAccessControlEnumerable.sol)
pragma solidity ^0.8.0;
import "./IAccessControl.sol";
/**
* @dev External interface of AccessControlEnumerable declared to support ERC165 detection.
*/
interface IAccessControlEnumerable is IAccessControl {
/**
* @dev Returns one of the accounts that have `role`. `index` must be a
* value between 0 and {getRoleMemberCount}, non-inclusive.
*
* Role bearers are not sorted in any particular way, and their ordering may
* change at any point.
*
* WARNING: When using {getRoleMember} and {getRoleMemberCount}, make sure
* you perform all queries on the same block. See the following
* https://forum.openzeppelin.com/t/iterating-over-elements-on-enumerableset-in-openzeppelin-contracts/2296[forum post]
* for more information.
*/
function getRoleMember(bytes32 role, uint256 index) external view returns (address);
/**
* @dev Returns the number of accounts that have `role`. Can be used
* together with {getRoleMember} to enumerate all bearers of a role.
*/
function getRoleMemberCount(bytes32 role) external view returns (uint256);
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (proxy/Clones.sol)
pragma solidity ^0.8.0;
/**
* @dev https://eips.ethereum.org/EIPS/eip-1167[EIP 1167] is a standard for
* deploying minimal proxy contracts, also known as "clones".
*
* > To simply and cheaply clone contract functionality in an immutable way, this standard specifies
* > a minimal bytecode implementation that delegates all calls to a known, fixed address.
*
* The library includes functions to deploy a proxy using either `create` (traditional deployment) or `create2`
* (salted deterministic deployment). It also includes functions to predict the addresses of clones deployed using the
* deterministic method.
*
* _Available since v3.4._
*/
library Clones {
/**
* @dev Deploys and returns the address of a clone that mimics the behaviour of `implementation`.
*
* This function uses the create opcode, which should never revert.
*/
function clone(address implementation) internal returns (address instance) {
/// @solidity memory-safe-assembly
assembly {
// Cleans the upper 96 bits of the `implementation` word, then packs the first 3 bytes
// of the `implementation` address with the bytecode before the address.
mstore(0x00, or(shr(0xe8, shl(0x60, implementation)), 0x3d602d80600a3d3981f3363d3d373d3d3d363d73000000))
// Packs the remaining 17 bytes of `implementation` with the bytecode after the address.
mstore(0x20, or(shl(0x78, implementation), 0x5af43d82803e903d91602b57fd5bf3))
instance := create(0, 0x09, 0x37)
}
require(instance != address(0), "ERC1167: create failed");
}
/**
* @dev Deploys and returns the address of a clone that mimics the behaviour of `implementation`.
*
* This function uses the create2 opcode and a `salt` to deterministically deploy
* the clone. Using the same `implementation` and `salt` multiple time will revert, since
* the clones cannot be deployed twice at the same address.
*/
function cloneDeterministic(address implementation, bytes32 salt) internal returns (address instance) {
/// @solidity memory-safe-assembly
assembly {
// Cleans the upper 96 bits of the `implementation` word, then packs the first 3 bytes
// of the `implementation` address with the bytecode before the address.
mstore(0x00, or(shr(0xe8, shl(0x60, implementation)), 0x3d602d80600a3d3981f3363d3d373d3d3d363d73000000))
// Packs the remaining 17 bytes of `implementation` with the bytecode after the address.
mstore(0x20, or(shl(0x78, implementation), 0x5af43d82803e903d91602b57fd5bf3))
instance := create2(0, 0x09, 0x37, salt)
}
require(instance != address(0), "ERC1167: create2 failed");
}
/**
* @dev Computes the address of a clone deployed using {Clones-cloneDeterministic}.
*/
function predictDeterministicAddress(
address implementation,
bytes32 salt,
address deployer
) internal pure returns (address predicted) {
/// @solidity memory-safe-assembly
assembly {
let ptr := mload(0x40)
mstore(add(ptr, 0x38), deployer)
mstore(add(ptr, 0x24), 0x5af43d82803e903d91602b57fd5bf3ff)
mstore(add(ptr, 0x14), implementation)
mstore(ptr, 0x3d602d80600a3d3981f3363d3d373d3d3d363d73)
mstore(add(ptr, 0x58), salt)
mstore(add(ptr, 0x78), keccak256(add(ptr, 0x0c), 0x37))
predicted := keccak256(add(ptr, 0x43), 0x55)
}
}
/**
* @dev Computes the address of a clone deployed using {Clones-cloneDeterministic}.
*/
function predictDeterministicAddress(
address implementation,
bytes32 salt
) internal view returns (address predicted) {
return predictDeterministicAddress(implementation, salt, address(this));
}
}// 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.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.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: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (utils/structs/EnumerableSet.sol)
// This file was procedurally generated from scripts/generate/templates/EnumerableSet.js.
pragma solidity ^0.8.0;
/**
* @dev Library for managing
* https://en.wikipedia.org/wiki/Set_(abstract_data_type)[sets] of primitive
* types.
*
* Sets have the following properties:
*
* - Elements are added, removed, and checked for existence in constant time
* (O(1)).
* - Elements are enumerated in O(n). No guarantees are made on the ordering.
*
* ```solidity
* contract Example {
* // Add the library methods
* using EnumerableSet for EnumerableSet.AddressSet;
*
* // Declare a set state variable
* EnumerableSet.AddressSet private mySet;
* }
* ```
*
* As of v3.3.0, sets of type `bytes32` (`Bytes32Set`), `address` (`AddressSet`)
* and `uint256` (`UintSet`) are supported.
*
* [WARNING]
* ====
* Trying to delete such a structure from storage will likely result in data corruption, rendering the structure
* unusable.
* See https://github.com/ethereum/solidity/pull/11843[ethereum/solidity#11843] for more info.
*
* In order to clean an EnumerableSet, you can either remove all elements one by one or create a fresh instance using an
* array of EnumerableSet.
* ====
*/
library EnumerableSet {
// To implement this library for multiple types with as little code
// repetition as possible, we write it in terms of a generic Set type with
// bytes32 values.
// The Set implementation uses private functions, and user-facing
// implementations (such as AddressSet) are just wrappers around the
// underlying Set.
// This means that we can only create new EnumerableSets for types that fit
// in bytes32.
struct Set {
// Storage of set values
bytes32[] _values;
// Position of the value in the `values` array, plus 1 because index 0
// means a value is not in the set.
mapping(bytes32 => uint256) _indexes;
}
/**
* @dev Add a value to a set. O(1).
*
* Returns true if the value was added to the set, that is if it was not
* already present.
*/
function _add(Set storage set, bytes32 value) private returns (bool) {
if (!_contains(set, value)) {
set._values.push(value);
// The value is stored at length-1, but we add 1 to all indexes
// and use 0 as a sentinel value
set._indexes[value] = set._values.length;
return true;
} else {
return false;
}
}
/**
* @dev Removes a value from a set. O(1).
*
* Returns true if the value was removed from the set, that is if it was
* present.
*/
function _remove(Set storage set, bytes32 value) private returns (bool) {
// We read and store the value's index to prevent multiple reads from the same storage slot
uint256 valueIndex = set._indexes[value];
if (valueIndex != 0) {
// Equivalent to contains(set, value)
// To delete an element from the _values array in O(1), we swap the element to delete with the last one in
// the array, and then remove the last element (sometimes called as 'swap and pop').
// This modifies the order of the array, as noted in {at}.
uint256 toDeleteIndex = valueIndex - 1;
uint256 lastIndex = set._values.length - 1;
if (lastIndex != toDeleteIndex) {
bytes32 lastValue = set._values[lastIndex];
// Move the last value to the index where the value to delete is
set._values[toDeleteIndex] = lastValue;
// Update the index for the moved value
set._indexes[lastValue] = valueIndex; // Replace lastValue's index to valueIndex
}
// Delete the slot where the moved value was stored
set._values.pop();
// Delete the index for the deleted slot
delete set._indexes[value];
return true;
} else {
return false;
}
}
/**
* @dev Returns true if the value is in the set. O(1).
*/
function _contains(Set storage set, bytes32 value) private view returns (bool) {
return set._indexes[value] != 0;
}
/**
* @dev Returns the number of values on the set. O(1).
*/
function _length(Set storage set) private view returns (uint256) {
return set._values.length;
}
/**
* @dev Returns the value stored at position `index` in the set. O(1).
*
* Note that there are no guarantees on the ordering of values inside the
* array, and it may change when more values are added or removed.
*
* Requirements:
*
* - `index` must be strictly less than {length}.
*/
function _at(Set storage set, uint256 index) private view returns (bytes32) {
return set._values[index];
}
/**
* @dev Return the entire set in an array
*
* WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed
* to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that
* this function has an unbounded cost, and using it as part of a state-changing function may render the function
* uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.
*/
function _values(Set storage set) private view returns (bytes32[] memory) {
return set._values;
}
// Bytes32Set
struct Bytes32Set {
Set _inner;
}
/**
* @dev Add a value to a set. O(1).
*
* Returns true if the value was added to the set, that is if it was not
* already present.
*/
function add(Bytes32Set storage set, bytes32 value) internal returns (bool) {
return _add(set._inner, value);
}
/**
* @dev Removes a value from a set. O(1).
*
* Returns true if the value was removed from the set, that is if it was
* present.
*/
function remove(Bytes32Set storage set, bytes32 value) internal returns (bool) {
return _remove(set._inner, value);
}
/**
* @dev Returns true if the value is in the set. O(1).
*/
function contains(Bytes32Set storage set, bytes32 value) internal view returns (bool) {
return _contains(set._inner, value);
}
/**
* @dev Returns the number of values in the set. O(1).
*/
function length(Bytes32Set storage set) internal view returns (uint256) {
return _length(set._inner);
}
/**
* @dev Returns the value stored at position `index` in the set. O(1).
*
* Note that there are no guarantees on the ordering of values inside the
* array, and it may change when more values are added or removed.
*
* Requirements:
*
* - `index` must be strictly less than {length}.
*/
function at(Bytes32Set storage set, uint256 index) internal view returns (bytes32) {
return _at(set._inner, index);
}
/**
* @dev Return the entire set in an array
*
* WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed
* to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that
* this function has an unbounded cost, and using it as part of a state-changing function may render the function
* uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.
*/
function values(Bytes32Set storage set) internal view returns (bytes32[] memory) {
bytes32[] memory store = _values(set._inner);
bytes32[] memory result;
/// @solidity memory-safe-assembly
assembly {
result := store
}
return result;
}
// AddressSet
struct AddressSet {
Set _inner;
}
/**
* @dev Add a value to a set. O(1).
*
* Returns true if the value was added to the set, that is if it was not
* already present.
*/
function add(AddressSet storage set, address value) internal returns (bool) {
return _add(set._inner, bytes32(uint256(uint160(value))));
}
/**
* @dev Removes a value from a set. O(1).
*
* Returns true if the value was removed from the set, that is if it was
* present.
*/
function remove(AddressSet storage set, address value) internal returns (bool) {
return _remove(set._inner, bytes32(uint256(uint160(value))));
}
/**
* @dev Returns true if the value is in the set. O(1).
*/
function contains(AddressSet storage set, address value) internal view returns (bool) {
return _contains(set._inner, bytes32(uint256(uint160(value))));
}
/**
* @dev Returns the number of values in the set. O(1).
*/
function length(AddressSet storage set) internal view returns (uint256) {
return _length(set._inner);
}
/**
* @dev Returns the value stored at position `index` in the set. O(1).
*
* Note that there are no guarantees on the ordering of values inside the
* array, and it may change when more values are added or removed.
*
* Requirements:
*
* - `index` must be strictly less than {length}.
*/
function at(AddressSet storage set, uint256 index) internal view returns (address) {
return address(uint160(uint256(_at(set._inner, index))));
}
/**
* @dev Return the entire set in an array
*
* WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed
* to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that
* this function has an unbounded cost, and using it as part of a state-changing function may render the function
* uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.
*/
function values(AddressSet storage set) internal view returns (address[] memory) {
bytes32[] memory store = _values(set._inner);
address[] memory result;
/// @solidity memory-safe-assembly
assembly {
result := store
}
return result;
}
// UintSet
struct UintSet {
Set _inner;
}
/**
* @dev Add a value to a set. O(1).
*
* Returns true if the value was added to the set, that is if it was not
* already present.
*/
function add(UintSet storage set, uint256 value) internal returns (bool) {
return _add(set._inner, bytes32(value));
}
/**
* @dev Removes a value from a set. O(1).
*
* Returns true if the value was removed from the set, that is if it was
* present.
*/
function remove(UintSet storage set, uint256 value) internal returns (bool) {
return _remove(set._inner, bytes32(value));
}
/**
* @dev Returns true if the value is in the set. O(1).
*/
function contains(UintSet storage set, uint256 value) internal view returns (bool) {
return _contains(set._inner, bytes32(value));
}
/**
* @dev Returns the number of values in the set. O(1).
*/
function length(UintSet storage set) internal view returns (uint256) {
return _length(set._inner);
}
/**
* @dev Returns the value stored at position `index` in the set. O(1).
*
* Note that there are no guarantees on the ordering of values inside the
* array, and it may change when more values are added or removed.
*
* Requirements:
*
* - `index` must be strictly less than {length}.
*/
function at(UintSet storage set, uint256 index) internal view returns (uint256) {
return uint256(_at(set._inner, index));
}
/**
* @dev Return the entire set in an array
*
* WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed
* to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that
* this function has an unbounded cost, and using it as part of a state-changing function may render the function
* uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.
*/
function values(UintSet storage set) internal view returns (uint256[] memory) {
bytes32[] memory store = _values(set._inner);
uint256[] memory result;
/// @solidity memory-safe-assembly
assembly {
result := store
}
return result;
}
}// SPDX-License-Identifier: UNLICENSED
pragma solidity 0.8.23;
interface IRouter_ETH_BNB_AVAX {
function addLiquidity(
address tokenA,
address tokenB,
uint amountADesired,
uint amountBDesired,
uint amountAMin,
uint amountBMin,
address to,
uint deadline
) external returns (uint amountA, uint amountB, uint liquidity);
function factory() external view returns (address);
}
interface IFactory_ETH_BNB_AVAX {
function getPair(
address tokenA,
address tokenB
) external view returns (address);
}
abstract contract BondingCurveTypes {
event TokensPurchased(
address indexed user,
uint256 amount,
uint256 preSwapFee,
uint256 tokenReceived,
uint256 raisedTokenAmount,
uint256 currentPrice
);
event Refunded(
address indexed user,
uint256 raisedTokenAmount,
uint256 currentPrice
);
event BatchRefunded(address[] user);
event Claimed(
address indexed token,
address indexed user,
uint256 indexed amount
);
event AddedToDex();
error InvalidPercent();
error InvalidVestingTimings();
error InvalidCaps();
error InvalidAmount();
error ExceedAllocation();
error UserNotAuthenticated();
error RoundNotStarted();
error RefundNotAllowed();
error NoTokensToRefund();
error NoTokensToClaim();
error HardCapExceeded();
error ZeroTokenAddress();
error ZeroAddress();
error BondingCurveNotActive();
error BondingCurveNotCompleted();
error ExceedTokenToSell();
error EmptyArray();
error SlippageToHigh();
error OnlyProjectOwner();
error LpIsLocked();
error AmountMustBeGreaterThanZero();
error InsufficientFunds();
error NotAddedToDex();
error InvalidEndingPriceOrMultipler();
error UserAlreadyRefunded();
enum BondingCurveType {
Degen,
Curator
}
enum BondingCurveRoundType {
Tier9,
Tier8,
Tier7,
Tier6,
Tier5,
Tier4,
Tier3,
Tier2,
Tier1,
Whitelist,
kol,
publicSale
}
struct SetUp {
ProjectTokenDetails projectTokenDetails;
BondedTokenDetails bondedTokenDetails;
VestingDetails vestingDetails;
BondingCurveTimestamps bondingCurveTimestamps;
address projectOwner;
address platformOwner;
address teamWallet;
address ecosystemWallet;
address feeCollector;
address bondingCurveLibrary;
address router;
address curatorAddress;
uint16 multiplier;
BondingCurveType bondingCurveType;
bytes32 merkleRoot;
uint256 softCap;
uint256 hardCap;
uint256 endingPrice;
}
struct ProjectTokenDetails {
uint16 reservedFee;
uint16 teamFee;
uint16 ecosystemFee;
uint16 tokenToSellPercent;
uint16 lPPercent;
uint32 lpLockUntil;
address token;
}
struct BondedTokenDetails {
uint256 launchFee;
uint16 preSwapFee;
uint16 raiseFee;
uint16 curatorFee;
uint16 lPPercent;
address token;
}
struct VestingDetails {
uint32 startDate;
uint32 cliff;
uint32 endDate;
uint16 baseTGEUnlockPercent;
}
struct BondingCurveTimestamps {
uint32 end;
uint32 tier9;
uint32 tier8;
uint32 tier7;
uint32 tier6;
uint32 tier5;
uint32 tier4;
uint32 tier3;
uint32 tier2;
uint32 tier1;
uint32 whitelist;
uint32 kol;
uint32 publicSale;
}
struct Ledger {
uint256 teamAmount;
uint256 ecosystemAmount;
uint256 reserveFeeAmount;
uint256 raisedTokenAmount;
uint256 projectTokenLPAmount;
uint256 preSwapCollection;
uint256 totalProjectTokenSold;
uint256 tokenToSell;
bool isAddedToDex;
}
struct User {
uint256 amountToClaim;
uint256 amountClaimed;
uint256 bondedTokenAmount;
uint256 tgeAmount;
bool isRefunded;
}
struct UserAllocation {
address user;
uint256 amount;
BondingCurveRoundType roundType;
}
}// SPDX-License-Identifier: UNLICENSED
pragma solidity 0.8.23;
import {BondingCurveTypes} from "../../BondingCurveTypes.sol";
interface IBondingCurveWritableRestricted {
function initialize(
BondingCurveTypes.SetUp memory setUp_,
uint256 tSupply,
address[] memory adminAddresses
) external;
function pause() external;
function unpause() external;
function dex() external;
function withdrawLp(address to, uint256 amount) external;
function withdraw(address token, address to, uint256 amount) external;
}// SPDX-License-Identifier: UNLICENSED
pragma solidity 0.8.23;
import {BondingCurveTypes} from "../bondingcurve/BondingCurveTypes.sol";
import {IBondingCurveFactoryInternal} from "./IBondingCurveFactoryInternal.sol";
interface IBondingCurveFactory {
function maxLoop() external view returns (uint256);
function defaultBondingCurve() external view returns (address);
function createBondingCurve(
string calldata curveName,
BondingCurveTypes.SetUp calldata setUp,
IBondingCurveFactoryInternal.TokenDetails calldata tokenDetails,
address[] memory adminAddresses
) external returns (address curve);
function updateDefaultBondingCurve(address newDefaultBondingCurve) external;
function updateDefaultToken(address newDefaultToken) external;
function setMaxLoop(uint256 newMaxLoop) external;
function getBondingCurvesDetails(
uint256 from,
uint256 to
)
external
view
returns (
IBondingCurveFactoryInternal.BondingCurveDetail[] memory curves,
uint256 lastEvaluatedIndex,
uint256 totalItems
);
}// SPDX-License-Identifier: UNLICENSED
pragma solidity 0.8.23;
interface IBondingCurveFactoryInternal {
struct BondingCurveDetail {
string name;
address bondingCurve;
address token;
}
struct TokenDetails {
string name;
string symbol;
uint256 totalSupply;
}
event BondingCurveCreated(string name, address bondingCurve);
event DefaultBondingCurveUpdated(address oldDefault, address newDefault);
event DefaultTokenUpdated(address oldDefault, address newDefault);
event maxLoopUpdated(uint256 maxLoop);
error BondingCurveFactory_CurveNameExists(string curveName);
error BondingCurveFactory_DefaultCurve_NotSet();
error BondingCurveFactory_DefaultCurve_ZeroAddr();
error BondingCurveFactory_DefaultToken_ZeroAddr();
error BondingCurveFactory_IndexesReversed();
error BondingCurveFactory_Admin_ZeroAddr();
error BondingCurveFactory_CurveName_Zero();
error BondingCurveFactory_MaxLoop_Zero();
}// SPDX-License-Identifier: UNLICENSED
pragma solidity 0.8.23;
interface IMyToken {
function initialize(
string memory name_,
string memory symbol_,
address recipient_,
uint256 totalSupply_
) external;
}{
"optimizer": {
"enabled": true,
"runs": 200
},
"evmVersion": "paris",
"outputSelection": {
"*": {
"*": [
"evm.bytecode",
"evm.deployedBytecode",
"devdoc",
"userdoc",
"metadata",
"abi"
]
}
}
}Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
Contract ABI
API[{"inputs":[{"internalType":"address","name":"adminAddress","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"BondingCurveFactory_Admin_ZeroAddr","type":"error"},{"inputs":[{"internalType":"string","name":"curveName","type":"string"}],"name":"BondingCurveFactory_CurveNameExists","type":"error"},{"inputs":[],"name":"BondingCurveFactory_CurveName_Zero","type":"error"},{"inputs":[],"name":"BondingCurveFactory_DefaultCurve_NotSet","type":"error"},{"inputs":[],"name":"BondingCurveFactory_DefaultCurve_ZeroAddr","type":"error"},{"inputs":[],"name":"BondingCurveFactory_DefaultToken_ZeroAddr","type":"error"},{"inputs":[],"name":"BondingCurveFactory_IndexesReversed","type":"error"},{"inputs":[],"name":"BondingCurveFactory_MaxLoop_Zero","type":"error"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"string","name":"name","type":"string"},{"indexed":false,"internalType":"address","name":"bondingCurve","type":"address"}],"name":"BondingCurveCreated","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"oldDefault","type":"address"},{"indexed":false,"internalType":"address","name":"newDefault","type":"address"}],"name":"DefaultBondingCurveUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"oldDefault","type":"address"},{"indexed":false,"internalType":"address","name":"newDefault","type":"address"}],"name":"DefaultTokenUpdated","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":"uint256","name":"maxLoop","type":"uint256"}],"name":"maxLoopUpdated","type":"event"},{"inputs":[],"name":"DEFAULT_ADMIN_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"string","name":"curveName","type":"string"},{"components":[{"components":[{"internalType":"uint16","name":"reservedFee","type":"uint16"},{"internalType":"uint16","name":"teamFee","type":"uint16"},{"internalType":"uint16","name":"ecosystemFee","type":"uint16"},{"internalType":"uint16","name":"tokenToSellPercent","type":"uint16"},{"internalType":"uint16","name":"lPPercent","type":"uint16"},{"internalType":"uint32","name":"lpLockUntil","type":"uint32"},{"internalType":"address","name":"token","type":"address"}],"internalType":"struct BondingCurveTypes.ProjectTokenDetails","name":"projectTokenDetails","type":"tuple"},{"components":[{"internalType":"uint256","name":"launchFee","type":"uint256"},{"internalType":"uint16","name":"preSwapFee","type":"uint16"},{"internalType":"uint16","name":"raiseFee","type":"uint16"},{"internalType":"uint16","name":"curatorFee","type":"uint16"},{"internalType":"uint16","name":"lPPercent","type":"uint16"},{"internalType":"address","name":"token","type":"address"}],"internalType":"struct BondingCurveTypes.BondedTokenDetails","name":"bondedTokenDetails","type":"tuple"},{"components":[{"internalType":"uint32","name":"startDate","type":"uint32"},{"internalType":"uint32","name":"cliff","type":"uint32"},{"internalType":"uint32","name":"endDate","type":"uint32"},{"internalType":"uint16","name":"baseTGEUnlockPercent","type":"uint16"}],"internalType":"struct BondingCurveTypes.VestingDetails","name":"vestingDetails","type":"tuple"},{"components":[{"internalType":"uint32","name":"end","type":"uint32"},{"internalType":"uint32","name":"tier9","type":"uint32"},{"internalType":"uint32","name":"tier8","type":"uint32"},{"internalType":"uint32","name":"tier7","type":"uint32"},{"internalType":"uint32","name":"tier6","type":"uint32"},{"internalType":"uint32","name":"tier5","type":"uint32"},{"internalType":"uint32","name":"tier4","type":"uint32"},{"internalType":"uint32","name":"tier3","type":"uint32"},{"internalType":"uint32","name":"tier2","type":"uint32"},{"internalType":"uint32","name":"tier1","type":"uint32"},{"internalType":"uint32","name":"whitelist","type":"uint32"},{"internalType":"uint32","name":"kol","type":"uint32"},{"internalType":"uint32","name":"publicSale","type":"uint32"}],"internalType":"struct BondingCurveTypes.BondingCurveTimestamps","name":"bondingCurveTimestamps","type":"tuple"},{"internalType":"address","name":"projectOwner","type":"address"},{"internalType":"address","name":"platformOwner","type":"address"},{"internalType":"address","name":"teamWallet","type":"address"},{"internalType":"address","name":"ecosystemWallet","type":"address"},{"internalType":"address","name":"feeCollector","type":"address"},{"internalType":"address","name":"bondingCurveLibrary","type":"address"},{"internalType":"address","name":"router","type":"address"},{"internalType":"address","name":"curatorAddress","type":"address"},{"internalType":"uint16","name":"multiplier","type":"uint16"},{"internalType":"enum BondingCurveTypes.BondingCurveType","name":"bondingCurveType","type":"uint8"},{"internalType":"bytes32","name":"merkleRoot","type":"bytes32"},{"internalType":"uint256","name":"softCap","type":"uint256"},{"internalType":"uint256","name":"hardCap","type":"uint256"},{"internalType":"uint256","name":"endingPrice","type":"uint256"}],"internalType":"struct BondingCurveTypes.SetUp","name":"setUp","type":"tuple"},{"components":[{"internalType":"string","name":"name","type":"string"},{"internalType":"string","name":"symbol","type":"string"},{"internalType":"uint256","name":"totalSupply","type":"uint256"}],"internalType":"struct IBondingCurveFactoryInternal.TokenDetails","name":"tokenDetails","type":"tuple"},{"internalType":"address[]","name":"adminAddresses","type":"address[]"}],"name":"createBondingCurve","outputs":[{"internalType":"address","name":"curve","type":"address"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"defaultBondingCurve","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"from","type":"uint256"},{"internalType":"uint256","name":"to","type":"uint256"}],"name":"getBondingCurvesDetails","outputs":[{"components":[{"internalType":"string","name":"name","type":"string"},{"internalType":"address","name":"bondingCurve","type":"address"},{"internalType":"address","name":"token","type":"address"}],"internalType":"struct IBondingCurveFactoryInternal.BondingCurveDetail[]","name":"curves","type":"tuple[]"},{"internalType":"uint256","name":"lastEvaluatedIndex","type":"uint256"},{"internalType":"uint256","name":"totalItems","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"}],"name":"getRoleAdmin","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"uint256","name":"index","type":"uint256"}],"name":"getRoleMember","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"}],"name":"getRoleMemberCount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"grantRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"hasRole","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"maxLoop","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"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":"newMaxLoop","type":"uint256"}],"name":"setMaxLoop","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes4","name":"interfaceId","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"newDefaultBondingCurve","type":"address"}],"name":"updateDefaultBondingCurve","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newDefaultToken","type":"address"}],"name":"updateDefaultToken","outputs":[],"stateMutability":"nonpayable","type":"function"}]Contract Creation Code
608060405260646003553480156200001657600080fd5b506040516200228e3803806200228e8339810160408190526200003991620001b8565b60016002556001600160a01b03811662000066576040516327f3e5c760e21b815260040160405180910390fd5b620000736000826200007a565b50620001ea565b620000868282620000a5565b6000828152600160205260409020620000a0908262000146565b505050565b6000828152602081815260408083206001600160a01b038516845290915290205460ff1662000142576000828152602081815260408083206001600160a01b03851684529091529020805460ff19166001179055620001013390565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45b5050565b60006200015d836001600160a01b03841662000166565b90505b92915050565b6000818152600183016020526040812054620001af5750815460018181018455600084815260208082209093018490558454848252828601909352604090209190915562000160565b50600062000160565b600060208284031215620001cb57600080fd5b81516001600160a01b0381168114620001e357600080fd5b9392505050565b61209480620001fa6000396000f3fe608060405234801561001057600080fd5b50600436106101005760003560e01c80639010d07c11610097578063ca15c87311610066578063ca15c8731461023a578063d547741f1461024d578063ed4fe58914610260578063fc53863d1461026857600080fd5b80639010d07c146101ea57806391d14854146101fd578063a217fddf14610210578063c873b8291461021857600080fd5b8063248a9ca3116100d3578063248a9ca3146101805780632b01b4d5146101b15780632f2ff15d146101c457806336568abe146101d757600080fd5b806301ffc9a71461010557806305f6711f1461012d5780630c25e968146101425780631a2ec15414610155575b600080fd5b610118610113366004611147565b610279565b60405190151581526020015b60405180910390f35b61014061013b366004611171565b6102a4565b005b6101406101503660046111a6565b61030c565b6101686101633660046112f5565b6103a8565b6040516001600160a01b039091168152602001610124565b6101a361018e366004611171565b60009081526020819052604090206001015490565b604051908152602001610124565b6101406101bf3660046111a6565b610410565b6101406101d23660046113c6565b6104ac565b6101406101e53660046113c6565b6104d6565b6101686101f83660046113f2565b610559565b61011861020b3660046113c6565b610578565b6101a3600081565b61022b6102263660046113f2565b6105a1565b60405161012493929190611464565b6101a3610248366004611171565b61077d565b61014061025b3660046113c6565b610794565b6003546101a3565b6004546001600160a01b0316610168565b60006001600160e01b03198216635a05180f60e01b148061029e575061029e826107b9565b92915050565b60006102af816107ee565b816000036102d05760405163bd2b2d1960e01b815260040160405180910390fd5b60038290556040518281527fe5eeafab961b9082a9736cdfb7f1a19763c7dc65f7c43f5fb2c0b318b80d24a59060200160405180910390a15050565b6000610317816107ee565b6001600160a01b03821661033e5760405163c787ef0160e01b815260040160405180910390fd5b600454604080516001600160a01b03928316815291841660208301527fcd5ebb215c8f54d3b67dd34becb6132f66eb966e83f23e0c4df9388f0a2b6096910160405180910390a150600480546001600160a01b0319166001600160a01b0392909216919091179055565b60006103b26107fb565b60006103bd816107ee565b60008690036103df576040516304616deb60e01b815260040160405180910390fd5b6103fa87876103f336899003890189611801565b8787610852565b9150506104076001600255565b95945050505050565b600061041b816107ee565b6001600160a01b0382166104425760405163237ca5a360e11b815260040160405180910390fd5b600554604080516001600160a01b03928316815291841660208301527fd0d68bda7ca525a1ae99eadb886ec1aa8c0f0239913d37e1045e8fbbe1280eeb910160405180910390a150600580546001600160a01b0319166001600160a01b0392909216919091179055565b6000828152602081905260409020600101546104c7816107ee565b6104d18383610bca565b505050565b6001600160a01b038116331461054b5760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201526e103937b632b9903337b91039b2b63360891b60648201526084015b60405180910390fd5b6105558282610bec565b5050565b60008281526001602052604081206105719083610c0e565b9392505050565b6000918252602082815260408084206001600160a01b0393909316845291905290205460ff1690565b6060600080838511156105c75760405163e6b1de4d60e01b815260040160405180910390fd5b60035485850311156105db57600354850193505b6006548411156105eb5760065493505b84840367ffffffffffffffff811115610606576106066111ec565b60405190808252806020026020018201604052801561065157816020015b60408051606080820183528152600060208083018290529282015282526000199092019101816106245790505b509250845b84811015610768576006818154811061067157610671611954565b906000526020600020906003020160405180606001604052908160008201805461069a9061196a565b80601f01602080910402602001604051908101604052809291908181526020018280546106c69061196a565b80156107135780601f106106e857610100808354040283529160200191610713565b820191906000526020600020905b8154815290600101906020018083116106f657829003601f168201915b505050918352505060018201546001600160a01b0390811660208301526002909201549091166040909101528451859088840390811061075557610755611954565b6020908102919091010152600101610656565b50506006549194600019909301935090919050565b600081815260016020526040812061029e90610c1a565b6000828152602081905260409020600101546107af816107ee565b6104d18383610bec565b60006001600160e01b03198216637965db0b60e01b148061029e57506301ffc9a760e01b6001600160e01b031983161461029e565b6107f88133610c24565b50565b600280540361084c5760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606401610542565b60028055565b6000806001600160a01b03166007878760405161087092919061199e565b908152604051908190036020019020600101546001600160a01b0316146108ae57858560405163a891cec560e01b81526004016105429291906119d7565b6004546001600160a01b03166108d7576040516336865d1960e21b815260040160405180910390fd5b60003387876040516020016108ee939291906119f3565b60408051601f198184030181529190528051602090910120600454909150600090610922906001600160a01b031683610c7d565b60055490915060009061093e906001600160a01b031684610c7d565b90506001600160a01b03811663f542033f6109598880611a18565b61096660208b018b611a18565b878c604001356040518763ffffffff1660e01b815260040161098d96959493929190611a66565b600060405180830381600087803b1580156109a757600080fd5b505af11580156109bb573d6000803e3d6000fd5b505088516001600160a01b03841660c09091015250506040805160806020601f8c018190040282018101909252606081018a81526000928291908d908d908190850183828082843760009201829052509385525050506001600160a01b03808716602084015285166040909201919091526006805460018101825591528151919250829160039091027ff652222313e28459528d920b65115c16c04f3efc82aaedc97be59f3f377c0d3f01908190610a739082611afc565b5060208201516001820180546001600160a01b039283166001600160a01b03199182161790915560409384015160029093018054939092169216919091179055518190600790610ac6908d908d9061199e565b90815260405190819003602001902081518190610ae39082611afc565b5060208201516001820180546001600160a01b03199081166001600160a01b03938416179091556040938401516002909301805490911692821692909217909155815163d71a5e4d60e01b81529085169163d71a5e4d91610b4f918c91908c0135908b90600401611d1f565b600060405180830381600087803b158015610b6957600080fd5b505af1158015610b7d573d6000803e3d6000fd5b505050507f29f280041d9433075fdda45c4d7537262f48538e5ee7395093f50e0e98bee7438a8a85604051610bb493929190611f2a565b60405180910390a1509098975050505050505050565b610bd48282610d1a565b60008281526001602052604090206104d19082610d9e565b610bf68282610db3565b60008281526001602052604090206104d19082610e18565b60006105718383610e2d565b600061029e825490565b610c2e8282610578565b61055557610c3b81610e57565b610c46836020610e69565b604051602001610c57929190611f56565b60408051601f198184030181529082905262461bcd60e51b825261054291600401611fcb565b6000763d602d80600a3d3981f3363d3d373d3d3d363d730000008360601b60e81c176000526e5af43d82803e903d91602b57fd5bf38360781b1760205281603760096000f590506001600160a01b03811661029e5760405162461bcd60e51b815260206004820152601760248201527f455243313136373a2063726561746532206661696c65640000000000000000006044820152606401610542565b610d248282610578565b610555576000828152602081815260408083206001600160a01b03851684529091529020805460ff19166001179055610d5a3390565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b6000610571836001600160a01b038416611005565b610dbd8282610578565b15610555576000828152602081815260408083206001600160a01b0385168085529252808320805460ff1916905551339285917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a45050565b6000610571836001600160a01b038416611054565b6000826000018281548110610e4457610e44611954565b9060005260206000200154905092915050565b606061029e6001600160a01b03831660145b60606000610e78836002611ff4565b610e8390600261200b565b67ffffffffffffffff811115610e9b57610e9b6111ec565b6040519080825280601f01601f191660200182016040528015610ec5576020820181803683370190505b509050600360fc1b81600081518110610ee057610ee0611954565b60200101906001600160f81b031916908160001a905350600f60fb1b81600181518110610f0f57610f0f611954565b60200101906001600160f81b031916908160001a9053506000610f33846002611ff4565b610f3e90600161200b565b90505b6001811115610fb6576f181899199a1a9b1b9c1cb0b131b232b360811b85600f1660108110610f7257610f72611954565b1a60f81b828281518110610f8857610f88611954565b60200101906001600160f81b031916908160001a90535060049490941c93610faf8161201e565b9050610f41565b5083156105715760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e746044820152606401610542565b600081815260018301602052604081205461104c5750815460018181018455600084815260208082209093018490558454848252828601909352604090209190915561029e565b50600061029e565b6000818152600183016020526040812054801561113d576000611078600183612035565b855490915060009061108c90600190612035565b90508181146110f15760008660000182815481106110ac576110ac611954565b90600052602060002001549050808760000184815481106110cf576110cf611954565b6000918252602080832090910192909255918252600188019052604090208390555b855486908061110257611102612048565b60019003818190600052602060002001600090559055856001016000868152602001908152602001600020600090556001935050505061029e565b600091505061029e565b60006020828403121561115957600080fd5b81356001600160e01b03198116811461057157600080fd5b60006020828403121561118357600080fd5b5035919050565b80356001600160a01b03811681146111a157600080fd5b919050565b6000602082840312156111b857600080fd5b6105718261118a565b600061058082840312156111d457600080fd5b50919050565b6000606082840312156111d457600080fd5b634e487b7160e01b600052604160045260246000fd5b6040516101a0810167ffffffffffffffff81118282101715611226576112266111ec565b60405290565b604051610240810167ffffffffffffffff81118282101715611226576112266111ec565b600082601f83011261126157600080fd5b8135602067ffffffffffffffff8083111561127e5761127e6111ec565b8260051b604051601f19603f830116810181811084821117156112a3576112a36111ec565b60405293845260208187018101949081019250878511156112c357600080fd5b6020870191505b848210156112ea576112db8261118a565b835291830191908301906112ca565b979650505050505050565b60008060008060006105e0868803121561130e57600080fd5b853567ffffffffffffffff8082111561132657600080fd5b818801915088601f83011261133a57600080fd5b81358181111561134957600080fd5b89602082850101111561135b57600080fd5b602083019750809650506113728960208a016111c1565b94506105a088013591508082111561138957600080fd5b61139589838a016111da565b93506105c08801359150808211156113ac57600080fd5b506113b988828901611250565b9150509295509295909350565b600080604083850312156113d957600080fd5b823591506113e96020840161118a565b90509250929050565b6000806040838503121561140557600080fd5b50508035926020909101359150565b60005b8381101561142f578181015183820152602001611417565b50506000910152565b60008151808452611450816020860160208601611414565b601f01601f19169290920160200192915050565b600060608083016060845280875180835260808601915060808160051b87010192506020808a0160005b838110156114e557888603607f19018552815180518888526114b289890182611438565b828601516001600160a01b039081168a88015260409384015116929098019190915250938201939082019060010161148e565b505086019790975250604090930193909352509392505050565b803561ffff811681146111a157600080fd5b803563ffffffff811681146111a157600080fd5b600060e0828403121561153757600080fd5b60405160e0810181811067ffffffffffffffff8211171561155a5761155a6111ec565b604052905080611569836114ff565b8152611577602084016114ff565b6020820152611588604084016114ff565b6040820152611599606084016114ff565b60608201526115aa608084016114ff565b60808201526115bb60a08401611511565b60a08201526115cc60c0840161118a565b60c08201525092915050565b600060c082840312156115ea57600080fd5b60405160c0810181811067ffffffffffffffff8211171561160d5761160d6111ec565b60405282358152905080611623602084016114ff565b6020820152611634604084016114ff565b6040820152611645606084016114ff565b6060820152611656608084016114ff565b608082015261166760a0840161118a565b60a08201525092915050565b60006080828403121561168557600080fd5b6040516080810181811067ffffffffffffffff821117156116a8576116a86111ec565b6040529050806116b783611511565b81526116c560208401611511565b60208201526116d660408401611511565b60408201526116e7606084016114ff565b60608201525092915050565b60006101a0828403121561170657600080fd5b61170e611202565b905061171982611511565b815261172760208301611511565b602082015261173860408301611511565b604082015261174960608301611511565b606082015261175a60808301611511565b608082015261176b60a08301611511565b60a082015261177c60c08301611511565b60c082015261178d60e08301611511565b60e08201526101006117a0818401611511565b908201526101206117b2838201611511565b908201526101406117c4838201611511565b908201526101606117d6838201611511565b908201526101806117e8838201611511565b9082015292915050565b8035600281106111a157600080fd5b6000610580828403121561181457600080fd5b61181c61122c565b6118268484611525565b81526118358460e085016115d8565b60208201526101a061184985828601611673565b604083015261022061185d868287016116f3565b606084015261186f6103c0860161118a565b60808401526118816103e0860161118a565b60a0840152611893610400860161118a565b60c08401526118a5610420860161118a565b60e08401526118b7610440860161118a565b6101008401526118ca610460860161118a565b6101208401526118dd610480860161118a565b6101408401526118f06104a0860161118a565b6101608401526119036104c086016114ff565b6101808401526119166104e086016117f2565b828401526105008501356101c08401526105208501356101e08401526105408501356102008401526105608501358184015250508091505092915050565b634e487b7160e01b600052603260045260246000fd5b600181811c9082168061197e57607f821691505b6020821081036111d457634e487b7160e01b600052602260045260246000fd5b8183823760009101908152919050565b81835281816020850137506000828201602090810191909152601f909101601f19169091010190565b6020815260006119eb6020830184866119ae565b949350505050565b6001600160a01b038416815260406020820181905260009061040790830184866119ae565b6000808335601e19843603018112611a2f57600080fd5b83018035915067ffffffffffffffff821115611a4a57600080fd5b602001915036819003821315611a5f57600080fd5b9250929050565b608081526000611a7a60808301888a6119ae565b8281036020840152611a8d8187896119ae565b6001600160a01b03959095166040840152505060600152949350505050565b601f8211156104d1576000816000526020600020601f850160051c81016020861015611ad55750805b601f850160051c820191505b81811015611af457828155600101611ae1565b505050505050565b815167ffffffffffffffff811115611b1657611b166111ec565b611b2a81611b24845461196a565b84611aac565b602080601f831160018114611b5f5760008415611b475750858301515b600019600386901b1c1916600185901b178555611af4565b600085815260208120601f198616915b82811015611b8e57888601518255948401946001909101908401611b6f565b5085821015611bac5787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b805163ffffffff1682526020810151611bdd602084018263ffffffff169052565b506040810151611bf5604084018263ffffffff169052565b506060810151611c0d606084018263ffffffff169052565b506080810151611c25608084018263ffffffff169052565b5060a0810151611c3d60a084018263ffffffff169052565b5060c0810151611c5560c084018263ffffffff169052565b5060e0810151611c6d60e084018263ffffffff169052565b506101008181015163ffffffff908116918401919091526101208083015182169084015261014080830151821690840152610160808301518216908401526101809182015116910152565b60028110611cd657634e487b7160e01b600052602160045260246000fd5b9052565b60008151808452602080850194506020840160005b83811015611d145781516001600160a01b031687529582019590820190600101611cef565b509495945050505050565b60006105c0611d8a83875161ffff8082511683528060208301511660208401528060408301511660408401528060608301511660608401528060808301511660808401525063ffffffff60a08201511660a083015260018060a01b0360c08201511660c08301525050565b602086810151805160e08601529081015161ffff908116610100860152604082015181166101208601526060820151811661014086015260808201511661016085015260a08101516001600160a01b03166101808501525060408601516101a0611e278186018363ffffffff8082511683528060208301511660208401528060408301511660408401525061ffff60608201511660608301525050565b60608801519150610220611e3d81870184611bbc565b60808901516001600160a01b039081166103c088015260a08a015181166103e088015260c08a0151811661040088015260e08a015181166104208801526101008a015181166104408801526101208a015181166104608801526101408a015181166104808801526101608a0151166104a087015261018089015161ffff166104c0870152818901519250611ed56104e0870184611cb8565b6101c08901516105008701526101e08901516105208701526102008901516105408701528089015161056087015250505084610580840152806105a0840152611f2081840185611cda565b9695505050505050565b604081526000611f3e6040830185876119ae565b905060018060a01b0383166020830152949350505050565b7f416363657373436f6e74726f6c3a206163636f756e7420000000000000000000815260008351611f8e816017850160208801611414565b7001034b99036b4b9b9b4b733903937b6329607d1b6017918401918201528351611fbf816028840160208801611414565b01602801949350505050565b6020815260006105716020830184611438565b634e487b7160e01b600052601160045260246000fd5b808202811582820484141761029e5761029e611fde565b8082018082111561029e5761029e611fde565b60008161202d5761202d611fde565b506000190190565b8181038181111561029e5761029e611fde565b634e487b7160e01b600052603160045260246000fdfea26469706673582212208842fbeefb9d163e34cb63b0f2cf1d6c6baea9d2cfff7592dda70ae90220d46f64736f6c634300081700330000000000000000000000003309bbd1be6286aab44d74e8947c7c77f2b86360
Deployed Bytecode
0x608060405234801561001057600080fd5b50600436106101005760003560e01c80639010d07c11610097578063ca15c87311610066578063ca15c8731461023a578063d547741f1461024d578063ed4fe58914610260578063fc53863d1461026857600080fd5b80639010d07c146101ea57806391d14854146101fd578063a217fddf14610210578063c873b8291461021857600080fd5b8063248a9ca3116100d3578063248a9ca3146101805780632b01b4d5146101b15780632f2ff15d146101c457806336568abe146101d757600080fd5b806301ffc9a71461010557806305f6711f1461012d5780630c25e968146101425780631a2ec15414610155575b600080fd5b610118610113366004611147565b610279565b60405190151581526020015b60405180910390f35b61014061013b366004611171565b6102a4565b005b6101406101503660046111a6565b61030c565b6101686101633660046112f5565b6103a8565b6040516001600160a01b039091168152602001610124565b6101a361018e366004611171565b60009081526020819052604090206001015490565b604051908152602001610124565b6101406101bf3660046111a6565b610410565b6101406101d23660046113c6565b6104ac565b6101406101e53660046113c6565b6104d6565b6101686101f83660046113f2565b610559565b61011861020b3660046113c6565b610578565b6101a3600081565b61022b6102263660046113f2565b6105a1565b60405161012493929190611464565b6101a3610248366004611171565b61077d565b61014061025b3660046113c6565b610794565b6003546101a3565b6004546001600160a01b0316610168565b60006001600160e01b03198216635a05180f60e01b148061029e575061029e826107b9565b92915050565b60006102af816107ee565b816000036102d05760405163bd2b2d1960e01b815260040160405180910390fd5b60038290556040518281527fe5eeafab961b9082a9736cdfb7f1a19763c7dc65f7c43f5fb2c0b318b80d24a59060200160405180910390a15050565b6000610317816107ee565b6001600160a01b03821661033e5760405163c787ef0160e01b815260040160405180910390fd5b600454604080516001600160a01b03928316815291841660208301527fcd5ebb215c8f54d3b67dd34becb6132f66eb966e83f23e0c4df9388f0a2b6096910160405180910390a150600480546001600160a01b0319166001600160a01b0392909216919091179055565b60006103b26107fb565b60006103bd816107ee565b60008690036103df576040516304616deb60e01b815260040160405180910390fd5b6103fa87876103f336899003890189611801565b8787610852565b9150506104076001600255565b95945050505050565b600061041b816107ee565b6001600160a01b0382166104425760405163237ca5a360e11b815260040160405180910390fd5b600554604080516001600160a01b03928316815291841660208301527fd0d68bda7ca525a1ae99eadb886ec1aa8c0f0239913d37e1045e8fbbe1280eeb910160405180910390a150600580546001600160a01b0319166001600160a01b0392909216919091179055565b6000828152602081905260409020600101546104c7816107ee565b6104d18383610bca565b505050565b6001600160a01b038116331461054b5760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201526e103937b632b9903337b91039b2b63360891b60648201526084015b60405180910390fd5b6105558282610bec565b5050565b60008281526001602052604081206105719083610c0e565b9392505050565b6000918252602082815260408084206001600160a01b0393909316845291905290205460ff1690565b6060600080838511156105c75760405163e6b1de4d60e01b815260040160405180910390fd5b60035485850311156105db57600354850193505b6006548411156105eb5760065493505b84840367ffffffffffffffff811115610606576106066111ec565b60405190808252806020026020018201604052801561065157816020015b60408051606080820183528152600060208083018290529282015282526000199092019101816106245790505b509250845b84811015610768576006818154811061067157610671611954565b906000526020600020906003020160405180606001604052908160008201805461069a9061196a565b80601f01602080910402602001604051908101604052809291908181526020018280546106c69061196a565b80156107135780601f106106e857610100808354040283529160200191610713565b820191906000526020600020905b8154815290600101906020018083116106f657829003601f168201915b505050918352505060018201546001600160a01b0390811660208301526002909201549091166040909101528451859088840390811061075557610755611954565b6020908102919091010152600101610656565b50506006549194600019909301935090919050565b600081815260016020526040812061029e90610c1a565b6000828152602081905260409020600101546107af816107ee565b6104d18383610bec565b60006001600160e01b03198216637965db0b60e01b148061029e57506301ffc9a760e01b6001600160e01b031983161461029e565b6107f88133610c24565b50565b600280540361084c5760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606401610542565b60028055565b6000806001600160a01b03166007878760405161087092919061199e565b908152604051908190036020019020600101546001600160a01b0316146108ae57858560405163a891cec560e01b81526004016105429291906119d7565b6004546001600160a01b03166108d7576040516336865d1960e21b815260040160405180910390fd5b60003387876040516020016108ee939291906119f3565b60408051601f198184030181529190528051602090910120600454909150600090610922906001600160a01b031683610c7d565b60055490915060009061093e906001600160a01b031684610c7d565b90506001600160a01b03811663f542033f6109598880611a18565b61096660208b018b611a18565b878c604001356040518763ffffffff1660e01b815260040161098d96959493929190611a66565b600060405180830381600087803b1580156109a757600080fd5b505af11580156109bb573d6000803e3d6000fd5b505088516001600160a01b03841660c09091015250506040805160806020601f8c018190040282018101909252606081018a81526000928291908d908d908190850183828082843760009201829052509385525050506001600160a01b03808716602084015285166040909201919091526006805460018101825591528151919250829160039091027ff652222313e28459528d920b65115c16c04f3efc82aaedc97be59f3f377c0d3f01908190610a739082611afc565b5060208201516001820180546001600160a01b039283166001600160a01b03199182161790915560409384015160029093018054939092169216919091179055518190600790610ac6908d908d9061199e565b90815260405190819003602001902081518190610ae39082611afc565b5060208201516001820180546001600160a01b03199081166001600160a01b03938416179091556040938401516002909301805490911692821692909217909155815163d71a5e4d60e01b81529085169163d71a5e4d91610b4f918c91908c0135908b90600401611d1f565b600060405180830381600087803b158015610b6957600080fd5b505af1158015610b7d573d6000803e3d6000fd5b505050507f29f280041d9433075fdda45c4d7537262f48538e5ee7395093f50e0e98bee7438a8a85604051610bb493929190611f2a565b60405180910390a1509098975050505050505050565b610bd48282610d1a565b60008281526001602052604090206104d19082610d9e565b610bf68282610db3565b60008281526001602052604090206104d19082610e18565b60006105718383610e2d565b600061029e825490565b610c2e8282610578565b61055557610c3b81610e57565b610c46836020610e69565b604051602001610c57929190611f56565b60408051601f198184030181529082905262461bcd60e51b825261054291600401611fcb565b6000763d602d80600a3d3981f3363d3d373d3d3d363d730000008360601b60e81c176000526e5af43d82803e903d91602b57fd5bf38360781b1760205281603760096000f590506001600160a01b03811661029e5760405162461bcd60e51b815260206004820152601760248201527f455243313136373a2063726561746532206661696c65640000000000000000006044820152606401610542565b610d248282610578565b610555576000828152602081815260408083206001600160a01b03851684529091529020805460ff19166001179055610d5a3390565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b6000610571836001600160a01b038416611005565b610dbd8282610578565b15610555576000828152602081815260408083206001600160a01b0385168085529252808320805460ff1916905551339285917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a45050565b6000610571836001600160a01b038416611054565b6000826000018281548110610e4457610e44611954565b9060005260206000200154905092915050565b606061029e6001600160a01b03831660145b60606000610e78836002611ff4565b610e8390600261200b565b67ffffffffffffffff811115610e9b57610e9b6111ec565b6040519080825280601f01601f191660200182016040528015610ec5576020820181803683370190505b509050600360fc1b81600081518110610ee057610ee0611954565b60200101906001600160f81b031916908160001a905350600f60fb1b81600181518110610f0f57610f0f611954565b60200101906001600160f81b031916908160001a9053506000610f33846002611ff4565b610f3e90600161200b565b90505b6001811115610fb6576f181899199a1a9b1b9c1cb0b131b232b360811b85600f1660108110610f7257610f72611954565b1a60f81b828281518110610f8857610f88611954565b60200101906001600160f81b031916908160001a90535060049490941c93610faf8161201e565b9050610f41565b5083156105715760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e746044820152606401610542565b600081815260018301602052604081205461104c5750815460018181018455600084815260208082209093018490558454848252828601909352604090209190915561029e565b50600061029e565b6000818152600183016020526040812054801561113d576000611078600183612035565b855490915060009061108c90600190612035565b90508181146110f15760008660000182815481106110ac576110ac611954565b90600052602060002001549050808760000184815481106110cf576110cf611954565b6000918252602080832090910192909255918252600188019052604090208390555b855486908061110257611102612048565b60019003818190600052602060002001600090559055856001016000868152602001908152602001600020600090556001935050505061029e565b600091505061029e565b60006020828403121561115957600080fd5b81356001600160e01b03198116811461057157600080fd5b60006020828403121561118357600080fd5b5035919050565b80356001600160a01b03811681146111a157600080fd5b919050565b6000602082840312156111b857600080fd5b6105718261118a565b600061058082840312156111d457600080fd5b50919050565b6000606082840312156111d457600080fd5b634e487b7160e01b600052604160045260246000fd5b6040516101a0810167ffffffffffffffff81118282101715611226576112266111ec565b60405290565b604051610240810167ffffffffffffffff81118282101715611226576112266111ec565b600082601f83011261126157600080fd5b8135602067ffffffffffffffff8083111561127e5761127e6111ec565b8260051b604051601f19603f830116810181811084821117156112a3576112a36111ec565b60405293845260208187018101949081019250878511156112c357600080fd5b6020870191505b848210156112ea576112db8261118a565b835291830191908301906112ca565b979650505050505050565b60008060008060006105e0868803121561130e57600080fd5b853567ffffffffffffffff8082111561132657600080fd5b818801915088601f83011261133a57600080fd5b81358181111561134957600080fd5b89602082850101111561135b57600080fd5b602083019750809650506113728960208a016111c1565b94506105a088013591508082111561138957600080fd5b61139589838a016111da565b93506105c08801359150808211156113ac57600080fd5b506113b988828901611250565b9150509295509295909350565b600080604083850312156113d957600080fd5b823591506113e96020840161118a565b90509250929050565b6000806040838503121561140557600080fd5b50508035926020909101359150565b60005b8381101561142f578181015183820152602001611417565b50506000910152565b60008151808452611450816020860160208601611414565b601f01601f19169290920160200192915050565b600060608083016060845280875180835260808601915060808160051b87010192506020808a0160005b838110156114e557888603607f19018552815180518888526114b289890182611438565b828601516001600160a01b039081168a88015260409384015116929098019190915250938201939082019060010161148e565b505086019790975250604090930193909352509392505050565b803561ffff811681146111a157600080fd5b803563ffffffff811681146111a157600080fd5b600060e0828403121561153757600080fd5b60405160e0810181811067ffffffffffffffff8211171561155a5761155a6111ec565b604052905080611569836114ff565b8152611577602084016114ff565b6020820152611588604084016114ff565b6040820152611599606084016114ff565b60608201526115aa608084016114ff565b60808201526115bb60a08401611511565b60a08201526115cc60c0840161118a565b60c08201525092915050565b600060c082840312156115ea57600080fd5b60405160c0810181811067ffffffffffffffff8211171561160d5761160d6111ec565b60405282358152905080611623602084016114ff565b6020820152611634604084016114ff565b6040820152611645606084016114ff565b6060820152611656608084016114ff565b608082015261166760a0840161118a565b60a08201525092915050565b60006080828403121561168557600080fd5b6040516080810181811067ffffffffffffffff821117156116a8576116a86111ec565b6040529050806116b783611511565b81526116c560208401611511565b60208201526116d660408401611511565b60408201526116e7606084016114ff565b60608201525092915050565b60006101a0828403121561170657600080fd5b61170e611202565b905061171982611511565b815261172760208301611511565b602082015261173860408301611511565b604082015261174960608301611511565b606082015261175a60808301611511565b608082015261176b60a08301611511565b60a082015261177c60c08301611511565b60c082015261178d60e08301611511565b60e08201526101006117a0818401611511565b908201526101206117b2838201611511565b908201526101406117c4838201611511565b908201526101606117d6838201611511565b908201526101806117e8838201611511565b9082015292915050565b8035600281106111a157600080fd5b6000610580828403121561181457600080fd5b61181c61122c565b6118268484611525565b81526118358460e085016115d8565b60208201526101a061184985828601611673565b604083015261022061185d868287016116f3565b606084015261186f6103c0860161118a565b60808401526118816103e0860161118a565b60a0840152611893610400860161118a565b60c08401526118a5610420860161118a565b60e08401526118b7610440860161118a565b6101008401526118ca610460860161118a565b6101208401526118dd610480860161118a565b6101408401526118f06104a0860161118a565b6101608401526119036104c086016114ff565b6101808401526119166104e086016117f2565b828401526105008501356101c08401526105208501356101e08401526105408501356102008401526105608501358184015250508091505092915050565b634e487b7160e01b600052603260045260246000fd5b600181811c9082168061197e57607f821691505b6020821081036111d457634e487b7160e01b600052602260045260246000fd5b8183823760009101908152919050565b81835281816020850137506000828201602090810191909152601f909101601f19169091010190565b6020815260006119eb6020830184866119ae565b949350505050565b6001600160a01b038416815260406020820181905260009061040790830184866119ae565b6000808335601e19843603018112611a2f57600080fd5b83018035915067ffffffffffffffff821115611a4a57600080fd5b602001915036819003821315611a5f57600080fd5b9250929050565b608081526000611a7a60808301888a6119ae565b8281036020840152611a8d8187896119ae565b6001600160a01b03959095166040840152505060600152949350505050565b601f8211156104d1576000816000526020600020601f850160051c81016020861015611ad55750805b601f850160051c820191505b81811015611af457828155600101611ae1565b505050505050565b815167ffffffffffffffff811115611b1657611b166111ec565b611b2a81611b24845461196a565b84611aac565b602080601f831160018114611b5f5760008415611b475750858301515b600019600386901b1c1916600185901b178555611af4565b600085815260208120601f198616915b82811015611b8e57888601518255948401946001909101908401611b6f565b5085821015611bac5787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b805163ffffffff1682526020810151611bdd602084018263ffffffff169052565b506040810151611bf5604084018263ffffffff169052565b506060810151611c0d606084018263ffffffff169052565b506080810151611c25608084018263ffffffff169052565b5060a0810151611c3d60a084018263ffffffff169052565b5060c0810151611c5560c084018263ffffffff169052565b5060e0810151611c6d60e084018263ffffffff169052565b506101008181015163ffffffff908116918401919091526101208083015182169084015261014080830151821690840152610160808301518216908401526101809182015116910152565b60028110611cd657634e487b7160e01b600052602160045260246000fd5b9052565b60008151808452602080850194506020840160005b83811015611d145781516001600160a01b031687529582019590820190600101611cef565b509495945050505050565b60006105c0611d8a83875161ffff8082511683528060208301511660208401528060408301511660408401528060608301511660608401528060808301511660808401525063ffffffff60a08201511660a083015260018060a01b0360c08201511660c08301525050565b602086810151805160e08601529081015161ffff908116610100860152604082015181166101208601526060820151811661014086015260808201511661016085015260a08101516001600160a01b03166101808501525060408601516101a0611e278186018363ffffffff8082511683528060208301511660208401528060408301511660408401525061ffff60608201511660608301525050565b60608801519150610220611e3d81870184611bbc565b60808901516001600160a01b039081166103c088015260a08a015181166103e088015260c08a0151811661040088015260e08a015181166104208801526101008a015181166104408801526101208a015181166104608801526101408a015181166104808801526101608a0151166104a087015261018089015161ffff166104c0870152818901519250611ed56104e0870184611cb8565b6101c08901516105008701526101e08901516105208701526102008901516105408701528089015161056087015250505084610580840152806105a0840152611f2081840185611cda565b9695505050505050565b604081526000611f3e6040830185876119ae565b905060018060a01b0383166020830152949350505050565b7f416363657373436f6e74726f6c3a206163636f756e7420000000000000000000815260008351611f8e816017850160208801611414565b7001034b99036b4b9b9b4b733903937b6329607d1b6017918401918201528351611fbf816028840160208801611414565b01602801949350505050565b6020815260006105716020830184611438565b634e487b7160e01b600052601160045260246000fd5b808202811582820484141761029e5761029e611fde565b8082018082111561029e5761029e611fde565b60008161202d5761202d611fde565b506000190190565b8181038181111561029e5761029e611fde565b634e487b7160e01b600052603160045260246000fdfea26469706673582212208842fbeefb9d163e34cb63b0f2cf1d6c6baea9d2cfff7592dda70ae90220d46f64736f6c63430008170033
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
0000000000000000000000003309bbd1be6286aab44d74e8947c7c77f2b86360
-----Decoded View---------------
Arg [0] : adminAddress (address): 0x3309BBd1bE6286aAB44D74e8947C7C77f2b86360
-----Encoded View---------------
1 Constructor Arguments found :
Arg [0] : 0000000000000000000000003309bbd1be6286aab44d74e8947c7c77f2b86360
Loading...
Loading
Loading...
Loading
Net Worth in USD
$0.00
Net Worth in ETH
0
Multichain Portfolio | 34 Chains
| Chain | Token | Portfolio % | Price | Amount | Value |
|---|
Loading...
Loading
Loading...
Loading
Loading...
Loading
[ Download: CSV Export ]
[ 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.