Source Code
Latest 25 from a total of 31 transactions
| Transaction Hash |
|
Block
|
From
|
To
|
|||||
|---|---|---|---|---|---|---|---|---|---|
| Create Vault | 1914855 | 658 days ago | IN | 0 ETH | 0.00005779 | ||||
| Create Vault Wit... | 1063468 | 678 days ago | IN | 0 ETH | 0.00010954 | ||||
| Create Vault | 868939 | 682 days ago | IN | 0 ETH | 0.00021922 | ||||
| Create Vault | 682368 | 687 days ago | IN | 0 ETH | 0.00028457 | ||||
| Create Vault Wit... | 515342 | 691 days ago | IN | 0 ETH | 0.00475216 | ||||
| Create Vault | 472765 | 692 days ago | IN | 0 ETH | 0.00435124 | ||||
| Create Vault Wit... | 470401 | 692 days ago | IN | 0 ETH | 0.00405758 | ||||
| Create Vault Wit... | 431189 | 693 days ago | IN | 0 ETH | 0.00419312 | ||||
| Create Vault | 430520 | 693 days ago | IN | 0.01484236 ETH | 0.00470162 | ||||
| Create Vault Wit... | 379341 | 694 days ago | IN | 0 ETH | 0.00419397 | ||||
| Create Vault Wit... | 333964 | 695 days ago | IN | 0 ETH | 0.0039463 | ||||
| Create Vault Wit... | 333940 | 695 days ago | IN | 0 ETH | 0.00393234 | ||||
| Create Vault Wit... | 333904 | 695 days ago | IN | 0 ETH | 0.00393882 | ||||
| Create Vault Wit... | 333872 | 695 days ago | IN | 0 ETH | 0.00392061 | ||||
| Create Vault Wit... | 301729 | 696 days ago | IN | 0 ETH | 0.00011855 | ||||
| Create Vault Wit... | 294384 | 696 days ago | IN | 0 ETH | 0.00387758 | ||||
| Create Vault Wit... | 241969 | 697 days ago | IN | 0 ETH | 0.00368271 | ||||
| Burn | 236316 | 697 days ago | IN | 0 ETH | 0.00057206 | ||||
| Create Vault Wit... | 236289 | 697 days ago | IN | 0 ETH | 0.00375426 | ||||
| Create Vault Wit... | 221392 | 697 days ago | IN | 0 ETH | 0.00243573 | ||||
| Create Vault | 221093 | 697 days ago | IN | 0 ETH | 0.00411251 | ||||
| Burn | 220877 | 697 days ago | IN | 0 ETH | 0.00051934 | ||||
| Burn | 220716 | 697 days ago | IN | 0 ETH | 0.00141138 | ||||
| Create Vault | 220402 | 697 days ago | IN | 0 ETH | 0.00268911 | ||||
| Burn | 220205 | 697 days ago | IN | 0 ETH | 0.00061731 |
Latest 1 internal transaction
Advanced mode:
| Parent Transaction Hash | Block | From | To | |||
|---|---|---|---|---|---|---|
| 430520 | 693 days ago | 0.01484236 ETH |
Cross-Chain Transactions
Loading...
Loading
Contract Name:
VaultFactory
Compiler Version
v0.8.23+commit.f704f362
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: MIT
pragma solidity 0.8.23;
import { IVaultFactory } from "./interfaces/IVaultFactory.sol";
import { IVaultDeployer } from "./interfaces/IVaultDeployer.sol";
import { IPaymentModule } from "./interfaces/IPaymentModule.sol";
import { IVault } from "./interfaces/IVault.sol";
import { IVaultKey } from "../common/interfaces/IVaultKey.sol";
import { Whitelist } from "../common/utils/Whitelist.sol";
contract VaultFactory is Whitelist, IVaultFactory {
address public constant BURN_ADDRESS = 0x000000000000000000000000000000000000dEaD;
enum VaultStatus {
Inactive,
Locked,
Unlocked
}
mapping(uint256 => address) public vaultByKey;
mapping(address => VaultStatus) public vaultStatus;
address public override paymentModule;
address public vaultDeployer;
uint256 public maxTokensPerVault;
uint256 public vaultUnlockedLastBlock;
uint256 public vaultCreatedLastBlock;
uint256 public vaultExtendedLastBlock;
uint256 public vaultBurnedLastBlock;
event MaxTokensUpdated(uint256 indexed oldMax, uint256 indexed newMax);
event PaymentModuleUpdated(address indexed oldModule, address indexed newModule);
event VaultDeployerUpdated(address indexed oldDeployer, address indexed newDeployer);
event VaultUnlocked(uint256 previousBlock, address indexed vault, uint256 timestamp, bool isCompletelyUnlocked);
event VaultCreated(
uint256 previousBlock,
address indexed vault,
uint256 key,
address benefactor,
address indexed beneficiary,
address indexed referrer,
uint256 unlockTimestamp,
FungibleTokenDeposit[] fungibleTokenDeposits,
NonFungibleTokenDeposit[] nonFungibleTokenDeposits,
MultiTokenDeposit[] multiTokenDeposits,
bool isVesting
);
event TokensBurned(
uint256 indexed previousBlock,
address indexed benefactor,
address indexed referrer,
FungibleTokenDeposit[] fungibleTokenDeposits,
NonFungibleTokenDeposit[] nonFungibleTokenDeposits,
MultiTokenDeposit[] multiTokenDeposits
);
event VaultLockExtended(uint256 indexed previousBlock, address indexed vault, uint256 oldUnlockTimestamp, uint256 newUnlockTimestamp);
constructor(address _paymentModule, uint256 maxTokens) {
paymentModule = _paymentModule;
maxTokensPerVault = maxTokens;
_grantRole(DEFAULT_ADMIN_ROLE, msg.sender);
}
function setMaxTokensPerVault(uint256 newMax) external onlyRole(DEFAULT_ADMIN_ROLE) {
uint256 oldMax = maxTokensPerVault;
maxTokensPerVault = newMax;
emit MaxTokensUpdated(oldMax, newMax);
}
function createVault(
address referrer,
address beneficiary,
uint256 unlockTimestamp,
FungibleTokenDeposit[] memory fungibleTokenDeposits,
NonFungibleTokenDeposit[] memory nonFungibleTokenDeposits,
MultiTokenDeposit[] memory multiTokenDeposits,
bool isVesting
) external payable override onlyWhitelisted(msg.sender) {
_createVault(referrer, beneficiary, unlockTimestamp, fungibleTokenDeposits, nonFungibleTokenDeposits, multiTokenDeposits, isVesting, true);
}
function createVaultWithoutKey(
address referrer,
address beneficiary,
uint256 unlockTimestamp,
FungibleTokenDeposit[] memory fungibleTokenDeposits,
NonFungibleTokenDeposit[] memory nonFungibleTokenDeposits,
MultiTokenDeposit[] memory multiTokenDeposits,
bool isVesting
) external payable override onlyWhitelisted(msg.sender) {
_createVault(referrer, beneficiary, unlockTimestamp, fungibleTokenDeposits, nonFungibleTokenDeposits, multiTokenDeposits, isVesting, false);
}
function _createVault(
address referrer,
address beneficiary,
uint256 unlockTimestamp,
FungibleTokenDeposit[] memory fungibleTokenDeposits,
NonFungibleTokenDeposit[] memory nonFungibleTokenDeposits,
MultiTokenDeposit[] memory multiTokenDeposits,
bool isVesting,
bool shouldMintKey
) private {
require(unlockTimestamp >= block.timestamp, "VaultFactory:createVault:UNLOCK_IN_PAST");
require(
fungibleTokenDeposits.length > 0 || nonFungibleTokenDeposits.length > 0 || multiTokenDeposits.length > 0,
"VaultFactory:createVault:NO_DEPOSITS"
);
require(
fungibleTokenDeposits.length + nonFungibleTokenDeposits.length + multiTokenDeposits.length < maxTokensPerVault,
"VaultFactory:createVault:MAX_DEPOSITS_EXCEEDED"
);
require(msg.sender != referrer, "VaultFactory:createVault:SELF_REFERRAL");
require(beneficiary != referrer, "VaultFactory:createVault:REFERRER_IS_BENEFICIARY");
for (uint256 i = 0; i < fungibleTokenDeposits.length; i++) {
require(fungibleTokenDeposits[i].amount > 0, "VaultFactory:createVault:ZERO_DEPOSIT");
}
for (uint256 i = 0; i < multiTokenDeposits.length; i++) {
require(multiTokenDeposits[i].amount > 0, "VaultFactory:createVault:ZERO_DEPOSIT");
}
// Early definition of vault address variable to allow usage by the
// conditional branches of this function.
address vault;
if (isVesting) {
require(nonFungibleTokenDeposits.length == 0 && multiTokenDeposits.length == 0, "VaultFactory:createVault:ONLY_FUNGIBLE_VESTING");
vault = IVaultDeployer(vaultDeployer).createVestingVault(shouldMintKey, beneficiary, unlockTimestamp, abi.encode(fungibleTokenDeposits));
} else {
vault = IVaultDeployer(vaultDeployer).createBatchVault(
shouldMintKey,
beneficiary,
unlockTimestamp,
abi.encode(fungibleTokenDeposits),
abi.encode(nonFungibleTokenDeposits),
abi.encode(multiTokenDeposits)
);
}
IPaymentModule(paymentModule).processPayment{ value: msg.value }(
IPaymentModule.ProcessPaymentParams({
vault: vault,
user: msg.sender,
referrer: referrer,
fungibleTokenDeposits: fungibleTokenDeposits,
nonFungibleTokenDeposits: nonFungibleTokenDeposits,
multiTokenDeposits: multiTokenDeposits,
isVesting: isVesting
})
);
uint256 keyId = IVault(vault).vaultKeyId();
if (keyId != 0) {
vaultByKey[keyId] = vault;
}
vaultStatus[vault] = VaultStatus.Locked;
emit VaultCreated(
vaultCreatedLastBlock,
vault,
keyId,
msg.sender,
beneficiary,
referrer,
unlockTimestamp,
fungibleTokenDeposits,
nonFungibleTokenDeposits,
multiTokenDeposits,
isVesting
);
vaultCreatedLastBlock = block.number;
}
function burn(
address referrer,
FungibleTokenDeposit[] memory fungibleTokenDeposits,
NonFungibleTokenDeposit[] memory nonFungibleTokenDeposits,
MultiTokenDeposit[] memory multiTokenDeposits
) external payable override onlyWhitelisted(msg.sender) {
require(
fungibleTokenDeposits.length > 0 || nonFungibleTokenDeposits.length > 0 || multiTokenDeposits.length > 0,
"VaultFactory:createVault:NO_DEPOSITS"
);
require(
fungibleTokenDeposits.length + nonFungibleTokenDeposits.length + multiTokenDeposits.length < maxTokensPerVault,
"VaultFactory:createVault:MAX_DEPOSITS_EXCEEDED"
);
require(msg.sender != referrer, "VaultFactory:createVault:SELF_REFERRAL");
for (uint256 i = 0; i < fungibleTokenDeposits.length; i++) {
require(fungibleTokenDeposits[i].amount > 0, "VaultFactory:createVault:ZERO_DEPOSIT");
}
for (uint256 i = 0; i < multiTokenDeposits.length; i++) {
require(multiTokenDeposits[i].amount > 0, "VaultFactory:createVault:ZERO_DEPOSIT");
}
IPaymentModule(paymentModule).processPayment{ value: msg.value }(
IPaymentModule.ProcessPaymentParams({
vault: BURN_ADDRESS,
user: msg.sender,
referrer: referrer,
fungibleTokenDeposits: fungibleTokenDeposits,
nonFungibleTokenDeposits: nonFungibleTokenDeposits,
multiTokenDeposits: multiTokenDeposits,
isVesting: false
})
);
emit TokensBurned(vaultBurnedLastBlock, msg.sender, referrer, fungibleTokenDeposits, nonFungibleTokenDeposits, multiTokenDeposits);
vaultBurnedLastBlock = block.number;
}
function notifyUnlock(bool isCompletelyUnlocked) external override {
require(vaultStatus[msg.sender] == VaultStatus.Locked, "VaultFactory:notifyUnlock:ALREADY_FULL_UNLOCKED");
if (isCompletelyUnlocked) {
vaultStatus[msg.sender] = VaultStatus.Unlocked;
}
emit VaultUnlocked(vaultUnlockedLastBlock, msg.sender, block.timestamp, isCompletelyUnlocked);
vaultUnlockedLastBlock = block.number;
}
function updatePaymentModule(address newModule) external onlyRole(DEFAULT_ADMIN_ROLE) {
address oldModule = paymentModule;
paymentModule = newModule;
emit PaymentModuleUpdated(oldModule, newModule);
}
function updateVaultDeployer(address newDeployer) external onlyRole(DEFAULT_ADMIN_ROLE) {
address oldDeployer = vaultDeployer;
vaultDeployer = newDeployer;
emit VaultDeployerUpdated(oldDeployer, newDeployer);
}
function lockExtended(uint256 oldUnlockTimestamp, uint256 newUnlockTimestamp) external override {
require(vaultStatus[msg.sender] == VaultStatus.Locked, "VaultFactory:lockExtended:ALREADY_FULL_UNLOCKED");
emit VaultLockExtended(vaultExtendedLastBlock, msg.sender, oldUnlockTimestamp, newUnlockTimestamp);
vaultExtendedLastBlock = block.number;
}
}// 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) (token/ERC721/IERC721.sol)
pragma solidity ^0.8.0;
import "../../utils/introspection/IERC165.sol";
/**
* @dev Required interface of an ERC721 compliant contract.
*/
interface IERC721 is IERC165 {
/**
* @dev Emitted when `tokenId` token is transferred from `from` to `to`.
*/
event Transfer(address indexed from, address indexed to, uint256 indexed tokenId);
/**
* @dev Emitted when `owner` enables `approved` to manage the `tokenId` token.
*/
event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId);
/**
* @dev Emitted when `owner` enables or disables (`approved`) `operator` to manage all of its assets.
*/
event ApprovalForAll(address indexed owner, address indexed operator, bool approved);
/**
* @dev Returns the number of tokens in ``owner``'s account.
*/
function balanceOf(address owner) external view returns (uint256 balance);
/**
* @dev Returns the owner of the `tokenId` token.
*
* Requirements:
*
* - `tokenId` must exist.
*/
function ownerOf(uint256 tokenId) external view returns (address owner);
/**
* @dev Safely transfers `tokenId` token from `from` to `to`.
*
* Requirements:
*
* - `from` cannot be the zero address.
* - `to` cannot be the zero address.
* - `tokenId` token must exist and be owned by `from`.
* - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}.
* - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.
*
* Emits a {Transfer} event.
*/
function safeTransferFrom(address from, address to, uint256 tokenId, bytes calldata data) external;
/**
* @dev Safely transfers `tokenId` token from `from` to `to`, checking first that contract recipients
* are aware of the ERC721 protocol to prevent tokens from being forever locked.
*
* Requirements:
*
* - `from` cannot be the zero address.
* - `to` cannot be the zero address.
* - `tokenId` token must exist and be owned by `from`.
* - If the caller is not `from`, it must have been allowed to move this token by either {approve} or {setApprovalForAll}.
* - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.
*
* Emits a {Transfer} event.
*/
function safeTransferFrom(address from, address to, uint256 tokenId) external;
/**
* @dev Transfers `tokenId` token from `from` to `to`.
*
* WARNING: Note that the caller is responsible to confirm that the recipient is capable of receiving ERC721
* or else they may be permanently lost. Usage of {safeTransferFrom} prevents loss, though the caller must
* understand this adds an external call which potentially creates a reentrancy vulnerability.
*
* Requirements:
*
* - `from` cannot be the zero address.
* - `to` cannot be the zero address.
* - `tokenId` token must be owned by `from`.
* - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}.
*
* Emits a {Transfer} event.
*/
function transferFrom(address from, address to, uint256 tokenId) external;
/**
* @dev Gives permission to `to` to transfer `tokenId` token to another account.
* The approval is cleared when the token is transferred.
*
* Only a single account can be approved at a time, so approving the zero address clears previous approvals.
*
* Requirements:
*
* - The caller must own the token or be an approved operator.
* - `tokenId` must exist.
*
* Emits an {Approval} event.
*/
function approve(address to, uint256 tokenId) external;
/**
* @dev Approve or remove `operator` as an operator for the caller.
* Operators can call {transferFrom} or {safeTransferFrom} for any token owned by the caller.
*
* Requirements:
*
* - The `operator` cannot be the caller.
*
* Emits an {ApprovalForAll} event.
*/
function setApprovalForAll(address operator, bool approved) external;
/**
* @dev Returns the account approved for `tokenId` token.
*
* Requirements:
*
* - `tokenId` must exist.
*/
function getApproved(uint256 tokenId) external view returns (address operator);
/**
* @dev Returns if the `operator` is allowed to manage all of the assets of `owner`.
*
* See {setApprovalForAll}
*/
function isApprovedForAll(address owner, address operator) external view returns (bool);
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.5.0) (token/ERC721/extensions/IERC721Enumerable.sol)
pragma solidity ^0.8.0;
import "../IERC721.sol";
/**
* @title ERC-721 Non-Fungible Token Standard, optional enumeration extension
* @dev See https://eips.ethereum.org/EIPS/eip-721
*/
interface IERC721Enumerable is IERC721 {
/**
* @dev Returns the total amount of tokens stored by the contract.
*/
function totalSupply() external view returns (uint256);
/**
* @dev Returns a token ID owned by `owner` at a given `index` of its token list.
* Use along with {balanceOf} to enumerate all of ``owner``'s tokens.
*/
function tokenOfOwnerByIndex(address owner, uint256 index) external view returns (uint256);
/**
* @dev Returns a token ID at a given `index` of all the tokens stored by the contract.
* Use along with {totalSupply} to enumerate all tokens.
*/
function tokenByIndex(uint256 index) external view returns (uint256);
}// 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 (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 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/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: MIT
pragma solidity 0.8.23;
import { IERC721Enumerable } from "@openzeppelin/contracts/token/ERC721/extensions/IERC721Enumerable.sol";
interface IVaultKey is IERC721Enumerable {
function mintKey(address to, address vault) external;
function lastMintedKeyId(address to) external view returns (uint256);
event VaultKeyMinted(uint256 previousBlock, address indexed to, uint256 indexed tokenId, address indexed vault);
event VaultKeyTransfer(uint256 previousBlock, address from, address indexed to, uint256 indexed tokenId);
}// SPDX-License-Identifier: MIT
pragma solidity 0.8.23;
import { AccessControlEnumerable } from "@openzeppelin/contracts/access/AccessControlEnumerable.sol";
contract Whitelist is AccessControlEnumerable {
bytes32 public constant WHITELIST_ADMIN_ROLE = keccak256("WHITELIST_ADMIN_ROLE");
mapping(address => bool) public whitelist;
bool public isWhitelistEnabled;
event WhitelistedAdded(address indexed account);
event WhitelistedRemoved(address indexed account);
constructor() {
isWhitelistEnabled = true;
_grantRole(WHITELIST_ADMIN_ROLE, msg.sender);
}
function addWhitelisted(address account) external onlyRole(WHITELIST_ADMIN_ROLE) {
whitelist[account] = true;
emit WhitelistedAdded(account);
}
function removeWhitelisted(address account) external onlyRole(WHITELIST_ADMIN_ROLE) {
whitelist[account] = false;
emit WhitelistedRemoved(account);
}
function setWhitelistEnabled(bool enabled) external onlyRole(WHITELIST_ADMIN_ROLE) {
isWhitelistEnabled = enabled;
}
modifier onlyWhitelisted(address account) {
require(!isWhitelistEnabled || whitelist[account], "Whitelist: caller is not whitelisted");
_;
}
}// SPDX-License-Identifier: MIT
pragma solidity 0.8.23;
interface IDepositHandler {
struct FungibleTokenDeposit {
address tokenAddress;
uint256 amount;
bool isLP;
}
struct NonFungibleTokenDeposit {
address tokenAddress;
uint256 tokenId;
}
struct MultiTokenDeposit {
address tokenAddress;
uint256 tokenId;
uint256 amount;
}
struct V3LPData {
address tokenAddress;
address token0;
address token1;
uint128 liquidityToRemove;
uint24 fee;
}
}// SPDX-License-Identifier: MIT
pragma solidity 0.8.23;
import { IDepositHandler } from "./IDepositHandler.sol";
interface IPaymentModule is IDepositHandler {
struct PaymentHolder {
address tokenAddress;
uint256 amount;
uint256 payment;
}
struct ProcessPaymentParams {
address vault;
address user;
address referrer;
FungibleTokenDeposit[] fungibleTokenDeposits;
NonFungibleTokenDeposit[] nonFungibleTokenDeposits;
MultiTokenDeposit[] multiTokenDeposits;
bool isVesting;
}
function processPayment(ProcessPaymentParams memory params) external payable;
}// SPDX-License-Identifier: MIT
pragma solidity 0.8.23;
interface IVault {
function getBeneficiary() external view returns (address);
function mintKey(uint256 keyId) external;
function vaultKeyId() external view returns (uint256);
}// SPDX-License-Identifier: MIT
pragma solidity 0.8.23;
import { IDepositHandler } from "./IDepositHandler.sol";
interface IVaultDeployer is IDepositHandler {
function createVestingVault(
bool shouldMintKey,
address beneficiary,
uint256 unlockTimestamp,
bytes memory fungibleTokenDeposits
) external returns (address);
function createBatchVault(
bool shouldMintKey,
address beneficiary,
uint256 unlockTimestamp,
bytes memory fungibleTokenDeposits,
bytes memory nonFungibleTokenDeposits,
bytes memory multiTokenDeposits
) external returns (address);
}// SPDX-License-Identifier: MIT
pragma solidity 0.8.23;
import { IDepositHandler } from "./IDepositHandler.sol";
interface IVaultFactory is IDepositHandler {
function createVault(
address referrer,
address beneficiary,
uint256 unlockTimestamp,
IDepositHandler.FungibleTokenDeposit[] memory fungibleTokenDeposits,
IDepositHandler.NonFungibleTokenDeposit[] memory nonFungibleTokenDeposits,
IDepositHandler.MultiTokenDeposit[] memory multiTokenDeposits,
bool isVesting
) external payable;
function createVaultWithoutKey(
address referrer,
address beneficiary,
uint256 unlockTimestamp,
IDepositHandler.FungibleTokenDeposit[] memory fungibleTokenDeposits,
IDepositHandler.NonFungibleTokenDeposit[] memory nonFungibleTokenDeposits,
IDepositHandler.MultiTokenDeposit[] memory multiTokenDeposits,
bool isVesting
) external payable;
function burn(
address referrer,
IDepositHandler.FungibleTokenDeposit[] memory fungibleTokenDeposits,
IDepositHandler.NonFungibleTokenDeposit[] memory nonFungibleTokenDeposits,
IDepositHandler.MultiTokenDeposit[] memory multiTokenDeposits
) external payable;
function notifyUnlock(bool isCompletelyUnlocked) external;
function lockExtended(uint256 oldUnlockTimestamp, uint256 newUnlockTimestamp) external;
function paymentModule() external view returns (address);
}{
"evmVersion": "london",
"libraries": {},
"metadata": {
"bytecodeHash": "none",
"useLiteralContent": true
},
"optimizer": {
"enabled": true,
"runs": 10
},
"remappings": [],
"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":"_paymentModule","type":"address"},{"internalType":"uint256","name":"maxTokens","type":"uint256"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"oldMax","type":"uint256"},{"indexed":true,"internalType":"uint256","name":"newMax","type":"uint256"}],"name":"MaxTokensUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"oldModule","type":"address"},{"indexed":true,"internalType":"address","name":"newModule","type":"address"}],"name":"PaymentModuleUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"bytes32","name":"previousAdminRole","type":"bytes32"},{"indexed":true,"internalType":"bytes32","name":"newAdminRole","type":"bytes32"}],"name":"RoleAdminChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"sender","type":"address"}],"name":"RoleGranted","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"sender","type":"address"}],"name":"RoleRevoked","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"previousBlock","type":"uint256"},{"indexed":true,"internalType":"address","name":"benefactor","type":"address"},{"indexed":true,"internalType":"address","name":"referrer","type":"address"},{"components":[{"internalType":"address","name":"tokenAddress","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"bool","name":"isLP","type":"bool"}],"indexed":false,"internalType":"struct IDepositHandler.FungibleTokenDeposit[]","name":"fungibleTokenDeposits","type":"tuple[]"},{"components":[{"internalType":"address","name":"tokenAddress","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"indexed":false,"internalType":"struct IDepositHandler.NonFungibleTokenDeposit[]","name":"nonFungibleTokenDeposits","type":"tuple[]"},{"components":[{"internalType":"address","name":"tokenAddress","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"uint256","name":"amount","type":"uint256"}],"indexed":false,"internalType":"struct IDepositHandler.MultiTokenDeposit[]","name":"multiTokenDeposits","type":"tuple[]"}],"name":"TokensBurned","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"previousBlock","type":"uint256"},{"indexed":true,"internalType":"address","name":"vault","type":"address"},{"indexed":false,"internalType":"uint256","name":"key","type":"uint256"},{"indexed":false,"internalType":"address","name":"benefactor","type":"address"},{"indexed":true,"internalType":"address","name":"beneficiary","type":"address"},{"indexed":true,"internalType":"address","name":"referrer","type":"address"},{"indexed":false,"internalType":"uint256","name":"unlockTimestamp","type":"uint256"},{"components":[{"internalType":"address","name":"tokenAddress","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"bool","name":"isLP","type":"bool"}],"indexed":false,"internalType":"struct IDepositHandler.FungibleTokenDeposit[]","name":"fungibleTokenDeposits","type":"tuple[]"},{"components":[{"internalType":"address","name":"tokenAddress","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"indexed":false,"internalType":"struct IDepositHandler.NonFungibleTokenDeposit[]","name":"nonFungibleTokenDeposits","type":"tuple[]"},{"components":[{"internalType":"address","name":"tokenAddress","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"uint256","name":"amount","type":"uint256"}],"indexed":false,"internalType":"struct IDepositHandler.MultiTokenDeposit[]","name":"multiTokenDeposits","type":"tuple[]"},{"indexed":false,"internalType":"bool","name":"isVesting","type":"bool"}],"name":"VaultCreated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"oldDeployer","type":"address"},{"indexed":true,"internalType":"address","name":"newDeployer","type":"address"}],"name":"VaultDeployerUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"previousBlock","type":"uint256"},{"indexed":true,"internalType":"address","name":"vault","type":"address"},{"indexed":false,"internalType":"uint256","name":"oldUnlockTimestamp","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"newUnlockTimestamp","type":"uint256"}],"name":"VaultLockExtended","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"previousBlock","type":"uint256"},{"indexed":true,"internalType":"address","name":"vault","type":"address"},{"indexed":false,"internalType":"uint256","name":"timestamp","type":"uint256"},{"indexed":false,"internalType":"bool","name":"isCompletelyUnlocked","type":"bool"}],"name":"VaultUnlocked","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"account","type":"address"}],"name":"WhitelistedAdded","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"account","type":"address"}],"name":"WhitelistedRemoved","type":"event"},{"inputs":[],"name":"BURN_ADDRESS","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"DEFAULT_ADMIN_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"WHITELIST_ADMIN_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"addWhitelisted","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"referrer","type":"address"},{"components":[{"internalType":"address","name":"tokenAddress","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"bool","name":"isLP","type":"bool"}],"internalType":"struct IDepositHandler.FungibleTokenDeposit[]","name":"fungibleTokenDeposits","type":"tuple[]"},{"components":[{"internalType":"address","name":"tokenAddress","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"internalType":"struct IDepositHandler.NonFungibleTokenDeposit[]","name":"nonFungibleTokenDeposits","type":"tuple[]"},{"components":[{"internalType":"address","name":"tokenAddress","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"uint256","name":"amount","type":"uint256"}],"internalType":"struct IDepositHandler.MultiTokenDeposit[]","name":"multiTokenDeposits","type":"tuple[]"}],"name":"burn","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"referrer","type":"address"},{"internalType":"address","name":"beneficiary","type":"address"},{"internalType":"uint256","name":"unlockTimestamp","type":"uint256"},{"components":[{"internalType":"address","name":"tokenAddress","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"bool","name":"isLP","type":"bool"}],"internalType":"struct IDepositHandler.FungibleTokenDeposit[]","name":"fungibleTokenDeposits","type":"tuple[]"},{"components":[{"internalType":"address","name":"tokenAddress","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"internalType":"struct IDepositHandler.NonFungibleTokenDeposit[]","name":"nonFungibleTokenDeposits","type":"tuple[]"},{"components":[{"internalType":"address","name":"tokenAddress","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"uint256","name":"amount","type":"uint256"}],"internalType":"struct IDepositHandler.MultiTokenDeposit[]","name":"multiTokenDeposits","type":"tuple[]"},{"internalType":"bool","name":"isVesting","type":"bool"}],"name":"createVault","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"referrer","type":"address"},{"internalType":"address","name":"beneficiary","type":"address"},{"internalType":"uint256","name":"unlockTimestamp","type":"uint256"},{"components":[{"internalType":"address","name":"tokenAddress","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"bool","name":"isLP","type":"bool"}],"internalType":"struct IDepositHandler.FungibleTokenDeposit[]","name":"fungibleTokenDeposits","type":"tuple[]"},{"components":[{"internalType":"address","name":"tokenAddress","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"internalType":"struct IDepositHandler.NonFungibleTokenDeposit[]","name":"nonFungibleTokenDeposits","type":"tuple[]"},{"components":[{"internalType":"address","name":"tokenAddress","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"uint256","name":"amount","type":"uint256"}],"internalType":"struct IDepositHandler.MultiTokenDeposit[]","name":"multiTokenDeposits","type":"tuple[]"},{"internalType":"bool","name":"isVesting","type":"bool"}],"name":"createVaultWithoutKey","outputs":[],"stateMutability":"payable","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":"isWhitelistEnabled","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"oldUnlockTimestamp","type":"uint256"},{"internalType":"uint256","name":"newUnlockTimestamp","type":"uint256"}],"name":"lockExtended","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"maxTokensPerVault","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bool","name":"isCompletelyUnlocked","type":"bool"}],"name":"notifyUnlock","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"paymentModule","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"removeWhitelisted","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"renounceRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"revokeRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"newMax","type":"uint256"}],"name":"setMaxTokensPerVault","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bool","name":"enabled","type":"bool"}],"name":"setWhitelistEnabled","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":"newModule","type":"address"}],"name":"updatePaymentModule","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newDeployer","type":"address"}],"name":"updateVaultDeployer","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"vaultBurnedLastBlock","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"vaultByKey","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"vaultCreatedLastBlock","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"vaultDeployer","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"vaultExtendedLastBlock","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"vaultStatus","outputs":[{"internalType":"enum VaultFactory.VaultStatus","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"vaultUnlockedLastBlock","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"whitelist","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"}]Contract Creation Code
60806040523480156200001157600080fd5b50604051620026e8380380620026e88339810160408190526200003491620001e0565b6003805460ff191660011790556200006d7f28f5a99355973cc89255b8c4ac88405f27c78ded7608b040ee77a8bdf44d15e233620000a2565b600680546001600160a01b0319166001600160a01b03841617905560088190556200009a600033620000a2565b50506200021c565b620000ae8282620000cd565b6000828152600160205260409020620000c890826200016e565b505050565b6000828152602081815260408083206001600160a01b038516845290915290205460ff166200016a576000828152602081815260408083206001600160a01b03851684529091529020805460ff19166001179055620001293390565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45b5050565b600062000185836001600160a01b0384166200018e565b90505b92915050565b6000818152600183016020526040812054620001d75750815460018181018455600084815260208082209093018490558454848252828601909352604090209190915562000188565b50600062000188565b60008060408385031215620001f457600080fd5b82516001600160a01b03811681146200020c57600080fd5b6020939093015192949293505050565b6124bc806200022c6000396000f3fe60806040526004361061017e5760003560e01c806301ffc9a714610183578063052d9e7e146101b857806310154bad146101da578063184d69ab146101fa5780631ace569914610214578063248a9ca314610227578063291d9549146102555780632f17e030146102755780632f2ff15d146102ad57806330a1cc96146102cd57806336568abe146102ed5780633cf57c611461030d57806354202c4e1461032d5780636183a98a1461034f57806364e1d9a21461036557806378546fa21461037b5780639010d07c14610391578063919ba2e7146103b157806391d14854146103c45780639b19251a146103e4578063a217fddf14610414578063b9f53fc314610429578063ca15c8731461045f578063cf39440a1461047f578063d0cf00541461049f578063d39f56de146104dc578063d547741f146104f2578063d913484f14610512578063de1db43a14610528578063e46d96a214610548578063ea01a0e814610568578063f4ddaef314610588578063fccc28131461059b575b600080fd5b34801561018f57600080fd5b506101a361019e366004611913565b6105b1565b60405190151581526020015b60405180910390f35b3480156101c457600080fd5b506101d86101d3366004611952565b6105dc565b005b3480156101e657600080fd5b506101d86101f5366004611982565b610608565b34801561020657600080fd5b506003546101a39060ff1681565b6101d8610222366004611c1e565b61066d565b34801561023357600080fd5b50610247610242366004611ce5565b6106d9565b6040519081526020016101af565b34801561026157600080fd5b506101d8610270366004611982565b6106ee565b34801561028157600080fd5b50600754610295906001600160a01b031681565b6040516001600160a01b0390911681526020016101af565b3480156102b957600080fd5b506101d86102c8366004611cfe565b610750565b3480156102d957600080fd5b50600654610295906001600160a01b031681565b3480156102f957600080fd5b506101d8610308366004611cfe565b610771565b34801561031957600080fd5b506101d8610328366004611ce5565b6107ef565b34801561033957600080fd5b5061024760008051602061249083398151915281565b34801561035b57600080fd5b50610247600a5481565b34801561037157600080fd5b5061024760095481565b34801561038757600080fd5b5061024760085481565b34801561039d57600080fd5b506102956103ac366004611d2e565b610834565b6101d86103bf366004611d50565b610853565b3480156103d057600080fd5b506101a36103df366004611cfe565b610ad1565b3480156103f057600080fd5b506101a36103ff366004611982565b60026020526000908152604090205460ff1681565b34801561042057600080fd5b50610247600081565b34801561043557600080fd5b50610295610444366004611ce5565b6004602052600090815260409020546001600160a01b031681565b34801561046b57600080fd5b5061024761047a366004611ce5565b610afa565b34801561048b57600080fd5b506101d861049a366004611982565b610b11565b3480156104ab57600080fd5b506104cf6104ba366004611982565b60056020526000908152604090205460ff1681565b6040516101af9190611e00565b3480156104e857600080fd5b50610247600b5481565b3480156104fe57600080fd5b506101d861050d366004611cfe565b610b6f565b34801561051e57600080fd5b50610247600c5481565b34801561053457600080fd5b506101d8610543366004611982565b610b8b565b34801561055457600080fd5b506101d8610563366004611952565b610be9565b34801561057457600080fd5b506101d8610583366004611d2e565b610ce2565b6101d8610596366004611c1e565b610db4565b3480156105a757600080fd5b5061029561dead81565b60006001600160e01b03198216635a05180f60e01b14806105d657506105d682610e0d565b92915050565b6000805160206124908339815191526105f481610e42565b506003805460ff1916911515919091179055565b60008051602061249083398151915261062081610e42565b6001600160a01b038216600081815260026020526040808220805460ff19166001179055517fee1504a83b6d4a361f4c1dc78ab59bfa30d6a3b6612c403e86bb01ef2984295f9190a25050565b600354339060ff16158061069957506001600160a01b03811660009081526002602052604090205460ff165b6106be5760405162461bcd60e51b81526004016106b590611e28565b60405180910390fd5b6106cf888888888888886000610e4f565b5050505050505050565b60009081526020819052604090206001015490565b60008051602061249083398151915261070681610e42565b6001600160a01b038216600081815260026020526040808220805460ff19169055517f270d9b30cf5b0793bbfd54c9d5b94aeb49462b8148399000265144a8722da6b69190a25050565b610759826106d9565b61076281610e42565b61076c8383611434565b505050565b6001600160a01b03811633146107e15760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201526e103937b632b9903337b91039b2b63360891b60648201526084016106b5565b6107eb8282611456565b5050565b60006107fa81610e42565b6008805490839055604051839082907fed0b12faffd2cf512a39ed490e2449ef21e0fceb01dfbd1b163d455947cde7bb90600090a3505050565b600082815260016020526040812061084c9083611478565b9392505050565b600354339060ff16158061087f57506001600160a01b03811660009081526002602052604090205460ff165b61089b5760405162461bcd60e51b81526004016106b590611e28565b6000845111806108ac575060008351115b806108b8575060008251115b6108d45760405162461bcd60e51b81526004016106b590611e6c565b6008548251845186516108e79190611ec6565b6108f19190611ec6565b1061090e5760405162461bcd60e51b81526004016106b590611ed9565b6001600160a01b03851633036109365760405162461bcd60e51b81526004016106b590611f27565b60005b845181101561098757600085828151811061095657610956611f6d565b6020026020010151602001511161097f5760405162461bcd60e51b81526004016106b590611f83565b600101610939565b5060005b82518110156109d95760008382815181106109a8576109a8611f6d565b602002602001015160400151116109d15760405162461bcd60e51b81526004016106b590611f83565b60010161098b565b506006546040805160e08101825261dead81523360208201526001600160a01b0388811682840152606082018890526080820187905260a08201869052600060c0830152915163967737c960e01b8152919092169163967737c9913491610a42916004016120c7565b6000604051808303818588803b158015610a5b57600080fd5b505af1158015610a6f573d6000803e3d6000fd5b5050505050846001600160a01b0316336001600160a01b0316600c547fef46f8b2c97944bff8580793ccae0a22b61472c761e02493a20f860d6d462b1d878787604051610abe939291906121af565b60405180910390a4505043600c55505050565b6000918252602082815260408084206001600160a01b0393909316845291905290205460ff1690565b60008181526001602052604081206105d690611484565b6000610b1c81610e42565b600780546001600160a01b038481166001600160a01b0319831681179093556040519116919082907f59ad64a1ab3be29ccfaed6ba5087596b0eb2f48f8cad53582715c8be48cbacb590600090a3505050565b610b78826106d9565b610b8181610e42565b61076c8383611456565b6000610b9681610e42565b600680546001600160a01b038481166001600160a01b0319831681179093556040519116919082907fb9cd00730add6e591032c866c4356d07d8e8a417427b3898f6b2a3f451c13b9d90600090a3505050565b60013360009081526005602052604090205460ff166002811115610c0f57610c0f611dea565b14610c745760405162461bcd60e51b815260206004820152602f60248201527f5661756c74466163746f72793a6e6f74696679556e6c6f636b3a414c5245414460448201526e1657d195531317d5539313d0d2d151608a1b60648201526084016106b5565b8015610c9557336000908152600560205260409020805460ff191660021790555b600954604080519182524260208301528215159082015233907f7301e817558ac55a934632b4d6881c5e77e3eca6bc45e38106297b3f6846f8f09060600160405180910390a25043600955565b60013360009081526005602052604090205460ff166002811115610d0857610d08611dea565b14610d6d5760405162461bcd60e51b815260206004820152602f60248201527f5661756c74466163746f72793a6c6f636b457874656e6465643a414c5245414460448201526e1657d195531317d5539313d0d2d151608a1b60648201526084016106b5565b600b5460408051848152602081018490523392917f5d496a622973c74cc5df343adb5c6b3acc8e4e3d3a0a39b031be7dde2e40e60d910160405180910390a3505043600b55565b600354339060ff161580610de057506001600160a01b03811660009081526002602052604090205460ff165b610dfc5760405162461bcd60e51b81526004016106b590611e28565b6106cf888888888888886001610e4f565b60006001600160e01b03198216637965db0b60e01b14806105d657506301ffc9a760e01b6001600160e01b03198316146105d6565b610e4c813361148e565b50565b42861015610eaf5760405162461bcd60e51b815260206004820152602760248201527f5661756c74466163746f72793a6372656174655661756c743a554e4c4f434b5f604482015266125397d41054d560ca1b60648201526084016106b5565b600085511180610ec0575060008451115b80610ecc575060008351115b610ee85760405162461bcd60e51b81526004016106b590611e6c565b600854835185518751610efb9190611ec6565b610f059190611ec6565b10610f225760405162461bcd60e51b81526004016106b590611ed9565b6001600160a01b0388163303610f4a5760405162461bcd60e51b81526004016106b590611f27565b876001600160a01b0316876001600160a01b031603610fc45760405162461bcd60e51b815260206004820152603060248201527f5661756c74466163746f72793a6372656174655661756c743a5245464552524560448201526f525f49535f42454e454649434941525960801b60648201526084016106b5565b60005b8551811015611015576000868281518110610fe457610fe4611f6d565b6020026020010151602001511161100d5760405162461bcd60e51b81526004016106b590611f83565b600101610fc7565b5060005b835181101561106757600084828151811061103657611036611f6d565b6020026020010151604001511161105f5760405162461bcd60e51b81526004016106b590611f83565b600101611019565b506000821561118557845115801561107e57508351155b6110e15760405162461bcd60e51b815260206004820152602e60248201527f5661756c74466163746f72793a6372656174655661756c743a4f4e4c595f465560448201526d4e4749424c455f56455354494e4760901b60648201526084016106b5565b6007546040516001600160a01b039091169063f509ebfc9084908b908b9061110d908c906020016121f2565b6040516020818303038152906040526040518563ffffffff1660e01b815260040161113b9493929190612255565b6020604051808303816000875af115801561115a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061117e9190612284565b9050611267565b6007546040516001600160a01b039091169063e5de32659084908b908b906111b1908c906020016121f2565b6040516020818303038152906040528a6040516020016111d191906122a1565b6040516020818303038152906040528a6040516020016111f191906122b4565b6040516020818303038152906040526040518763ffffffff1660e01b8152600401611221969594939291906122c7565b6020604051808303816000875af1158015611240573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906112649190612284565b90505b6006546040805160e0810182526001600160a01b0384811682523360208301528c811682840152606082018a90526080820189905260a0820188905286151560c0830152915163967737c960e01b8152919092169163967737c99134916112d0916004016120c7565b6000604051808303818588803b1580156112e957600080fd5b505af11580156112fd573d6000803e3d6000fd5b50505050506000816001600160a01b031663e4dfeac06040518163ffffffff1660e01b8152600401602060405180830381865afa158015611342573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113669190612329565b9050801561139657600081815260046020526040902080546001600160a01b0319166001600160a01b0384161790555b6001600160a01b038216600090815260056020526040902080546001919060ff191682800217905550896001600160a01b0316896001600160a01b0316836001600160a01b03167f7a89dae678345f4c1e6fc361a48ecddf1290fe10bbb57d27012a394a57fd3303600a5485338e8e8e8e8e60405161141c989796959493929190612342565b60405180910390a4505043600a555050505050505050565b61143e82826114e7565b600082815260016020526040902061076c908261156b565b6114608282611580565b600082815260016020526040902061076c90826115e5565b600061084c83836115fa565b60006105d6825490565b6114988282610ad1565b6107eb576114a581611624565b6114b0836020611636565b6040516020016114c19291906123b6565b60408051601f198184030181529082905262461bcd60e51b82526106b591600401612425565b6114f18282610ad1565b6107eb576000828152602081815260408083206001600160a01b03851684529091529020805460ff191660011790556115273390565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b600061084c836001600160a01b0384166117d1565b61158a8282610ad1565b156107eb576000828152602081815260408083206001600160a01b0385168085529252808320805460ff1916905551339285917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a45050565b600061084c836001600160a01b038416611820565b600082600001828154811061161157611611611f6d565b9060005260206000200154905092915050565b60606105d66001600160a01b03831660145b60606000611645836002612438565b611650906002611ec6565b6001600160401b038111156116675761166761199f565b6040519080825280601f01601f191660200182016040528015611691576020820181803683370190505b509050600360fc1b816000815181106116ac576116ac611f6d565b60200101906001600160f81b031916908160001a905350600f60fb1b816001815181106116db576116db611f6d565b60200101906001600160f81b031916908160001a90535060006116ff846002612438565b61170a906001611ec6565b90505b6001811115611782576f181899199a1a9b1b9c1cb0b131b232b360811b85600f166010811061173e5761173e611f6d565b1a60f81b82828151811061175457611754611f6d565b60200101906001600160f81b031916908160001a90535060049490941c9361177b8161244f565b905061170d565b50831561084c5760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e7460448201526064016106b5565b6000818152600183016020526040812054611818575081546001818101845560008481526020808220909301849055845484825282860190935260409020919091556105d6565b5060006105d6565b60008181526001830160205260408120548015611909576000611844600183612466565b855490915060009061185890600190612466565b90508181146118bd57600086600001828154811061187857611878611f6d565b906000526020600020015490508087600001848154811061189b5761189b611f6d565b6000918252602080832090910192909255918252600188019052604090208390555b85548690806118ce576118ce612479565b6001900381819060005260206000200160009055905585600101600086815260200190815260200160002060009055600193505050506105d6565b60009150506105d6565b60006020828403121561192557600080fd5b81356001600160e01b03198116811461084c57600080fd5b8035801515811461194d57600080fd5b919050565b60006020828403121561196457600080fd5b61084c8261193d565b6001600160a01b0381168114610e4c57600080fd5b60006020828403121561199457600080fd5b813561084c8161196d565b634e487b7160e01b600052604160045260246000fd5b604051606081016001600160401b03811182821017156119d7576119d761199f565b60405290565b604080519081016001600160401b03811182821017156119d7576119d761199f565b604051601f8201601f191681016001600160401b0381118282101715611a2757611a2761199f565b604052919050565b60006001600160401b03821115611a4857611a4861199f565b5060051b60200190565b600082601f830112611a6357600080fd5b81356020611a78611a7383611a2f565b6119ff565b82815260609283028501820192828201919087851115611a9757600080fd5b8387015b85811015611aee5781818a031215611ab35760008081fd5b611abb6119b5565b8135611ac68161196d565b815281860135868201526040611add81840161193d565b908201528452928401928101611a9b565b5090979650505050505050565b600082601f830112611b0c57600080fd5b81356020611b1c611a7383611a2f565b82815260069290921b84018101918181019086841115611b3b57600080fd5b8286015b84811015611b835760408189031215611b585760008081fd5b611b606119dd565b8135611b6b8161196d565b81528185013585820152835291830191604001611b3f565b509695505050505050565b600082601f830112611b9f57600080fd5b81356020611baf611a7383611a2f565b82815260609283028501820192828201919087851115611bce57600080fd5b8387015b85811015611aee5781818a031215611bea5760008081fd5b611bf26119b5565b8135611bfd8161196d565b81528186013586820152604080830135908201528452928401928101611bd2565b600080600080600080600060e0888a031215611c3957600080fd5b8735611c448161196d565b96506020880135611c548161196d565b95506040880135945060608801356001600160401b0380821115611c7757600080fd5b611c838b838c01611a52565b955060808a0135915080821115611c9957600080fd5b611ca58b838c01611afb565b945060a08a0135915080821115611cbb57600080fd5b50611cc88a828b01611b8e565b925050611cd760c0890161193d565b905092959891949750929550565b600060208284031215611cf757600080fd5b5035919050565b60008060408385031215611d1157600080fd5b823591506020830135611d238161196d565b809150509250929050565b60008060408385031215611d4157600080fd5b50508035926020909101359150565b60008060008060808587031215611d6657600080fd5b8435611d718161196d565b935060208501356001600160401b0380821115611d8d57600080fd5b611d9988838901611a52565b94506040870135915080821115611daf57600080fd5b611dbb88838901611afb565b93506060870135915080821115611dd157600080fd5b50611dde87828801611b8e565b91505092959194509250565b634e487b7160e01b600052602160045260246000fd5b6020810160038310611e2257634e487b7160e01b600052602160045260246000fd5b91905290565b60208082526024908201527f57686974656c6973743a2063616c6c6572206973206e6f742077686974656c696040820152631cdd195960e21b606082015260800190565b60208082526024908201527f5661756c74466163746f72793a6372656174655661756c743a4e4f5f4445504f6040820152635349545360e01b606082015260800190565b634e487b7160e01b600052601160045260246000fd5b808201808211156105d6576105d6611eb0565b6020808252602e908201527f5661756c74466163746f72793a6372656174655661756c743a4d41585f44455060408201526d13d4d25514d7d15610d15151115160921b606082015260800190565b60208082526026908201527f5661756c74466163746f72793a6372656174655661756c743a53454c465f524560408201526511915494905360d21b606082015260800190565b634e487b7160e01b600052603260045260246000fd5b60208082526025908201527f5661756c74466163746f72793a6372656174655661756c743a5a45524f5f44456040820152641413d4d25560da1b606082015260800190565b80516001600160a01b031682526020808201519083015260409081015115159082015260600190565b60008151808452602080850194506020840160005b8381101561202757612019878351611fc8565b965090820190600101612006565b509495945050505050565b60008151808452602080850194506020840160005b8381101561202757815180516001600160a01b031688528301518388015260409096019590820190600101612047565b60008151808452602080850194506020840160005b8381101561202757815180516001600160a01b031688528381015184890152604090810151908801526060909601959082019060010161208c565b60208152600060018060a01b0380845116602084015280602085015116604084015250604083015161210460608401826001600160a01b03169052565b50606083015160e0608084015261211f610100840182611ff1565b90506080840151601f19808584030160a086015261213d8383612032565b925060a08601519150808584030160c08601525061215b8282612077565b91505060c084015161217160e085018215159052565b509392505050565b60008151808452602080850194506020840160005b83811015612027576121a1878351611fc8565b96509082019060010161218e565b6060815260006121c26060830186612179565b82810360208401526121d48186612032565b905082810360408401526121e88185612077565b9695505050505050565b60208152600061084c6020830184612179565b60005b83811015612220578181015183820152602001612208565b50506000910152565b60008151808452612241816020860160208601612205565b601f01601f19169290920160200192915050565b841515815260018060a01b03841660208201528260408201526080606082015260006121e86080830184612229565b60006020828403121561229657600080fd5b815161084c8161196d565b60208152600061084c6020830184612032565b60208152600061084c6020830184612077565b861515815260018060a01b038616602082015284604082015260c0606082015260006122f660c0830186612229565b82810360808401526123088186612229565b905082810360a084015261231c8185612229565b9998505050505050505050565b60006020828403121561233b57600080fd5b5051919050565b60006101008a835289602084015260018060a01b038916604084015287606084015280608084015261237681840188612179565b905082810360a084015261238a8187612032565b905082810360c084015261239e8186612077565b91505082151560e08301529998505050505050505050565b76020b1b1b2b9b9a1b7b73a3937b61d1030b1b1b7bab73a1604d1b8152600083516123e8816017850160208801612205565b7001034b99036b4b9b9b4b733903937b6329607d1b6017918401918201528351612419816028840160208801612205565b01602801949350505050565b60208152600061084c6020830184612229565b80820281158282048414176105d6576105d6611eb0565b60008161245e5761245e611eb0565b506000190190565b818103818111156105d6576105d6611eb0565b634e487b7160e01b600052603160045260246000fdfe28f5a99355973cc89255b8c4ac88405f27c78ded7608b040ee77a8bdf44d15e2a164736f6c6343000817000a00000000000000000000000018b65375097112e673145eaec401eb6c9f92abef0000000000000000000000000000000000000000000000000000000000000064
Deployed Bytecode
0x60806040526004361061017e5760003560e01c806301ffc9a714610183578063052d9e7e146101b857806310154bad146101da578063184d69ab146101fa5780631ace569914610214578063248a9ca314610227578063291d9549146102555780632f17e030146102755780632f2ff15d146102ad57806330a1cc96146102cd57806336568abe146102ed5780633cf57c611461030d57806354202c4e1461032d5780636183a98a1461034f57806364e1d9a21461036557806378546fa21461037b5780639010d07c14610391578063919ba2e7146103b157806391d14854146103c45780639b19251a146103e4578063a217fddf14610414578063b9f53fc314610429578063ca15c8731461045f578063cf39440a1461047f578063d0cf00541461049f578063d39f56de146104dc578063d547741f146104f2578063d913484f14610512578063de1db43a14610528578063e46d96a214610548578063ea01a0e814610568578063f4ddaef314610588578063fccc28131461059b575b600080fd5b34801561018f57600080fd5b506101a361019e366004611913565b6105b1565b60405190151581526020015b60405180910390f35b3480156101c457600080fd5b506101d86101d3366004611952565b6105dc565b005b3480156101e657600080fd5b506101d86101f5366004611982565b610608565b34801561020657600080fd5b506003546101a39060ff1681565b6101d8610222366004611c1e565b61066d565b34801561023357600080fd5b50610247610242366004611ce5565b6106d9565b6040519081526020016101af565b34801561026157600080fd5b506101d8610270366004611982565b6106ee565b34801561028157600080fd5b50600754610295906001600160a01b031681565b6040516001600160a01b0390911681526020016101af565b3480156102b957600080fd5b506101d86102c8366004611cfe565b610750565b3480156102d957600080fd5b50600654610295906001600160a01b031681565b3480156102f957600080fd5b506101d8610308366004611cfe565b610771565b34801561031957600080fd5b506101d8610328366004611ce5565b6107ef565b34801561033957600080fd5b5061024760008051602061249083398151915281565b34801561035b57600080fd5b50610247600a5481565b34801561037157600080fd5b5061024760095481565b34801561038757600080fd5b5061024760085481565b34801561039d57600080fd5b506102956103ac366004611d2e565b610834565b6101d86103bf366004611d50565b610853565b3480156103d057600080fd5b506101a36103df366004611cfe565b610ad1565b3480156103f057600080fd5b506101a36103ff366004611982565b60026020526000908152604090205460ff1681565b34801561042057600080fd5b50610247600081565b34801561043557600080fd5b50610295610444366004611ce5565b6004602052600090815260409020546001600160a01b031681565b34801561046b57600080fd5b5061024761047a366004611ce5565b610afa565b34801561048b57600080fd5b506101d861049a366004611982565b610b11565b3480156104ab57600080fd5b506104cf6104ba366004611982565b60056020526000908152604090205460ff1681565b6040516101af9190611e00565b3480156104e857600080fd5b50610247600b5481565b3480156104fe57600080fd5b506101d861050d366004611cfe565b610b6f565b34801561051e57600080fd5b50610247600c5481565b34801561053457600080fd5b506101d8610543366004611982565b610b8b565b34801561055457600080fd5b506101d8610563366004611952565b610be9565b34801561057457600080fd5b506101d8610583366004611d2e565b610ce2565b6101d8610596366004611c1e565b610db4565b3480156105a757600080fd5b5061029561dead81565b60006001600160e01b03198216635a05180f60e01b14806105d657506105d682610e0d565b92915050565b6000805160206124908339815191526105f481610e42565b506003805460ff1916911515919091179055565b60008051602061249083398151915261062081610e42565b6001600160a01b038216600081815260026020526040808220805460ff19166001179055517fee1504a83b6d4a361f4c1dc78ab59bfa30d6a3b6612c403e86bb01ef2984295f9190a25050565b600354339060ff16158061069957506001600160a01b03811660009081526002602052604090205460ff165b6106be5760405162461bcd60e51b81526004016106b590611e28565b60405180910390fd5b6106cf888888888888886000610e4f565b5050505050505050565b60009081526020819052604090206001015490565b60008051602061249083398151915261070681610e42565b6001600160a01b038216600081815260026020526040808220805460ff19169055517f270d9b30cf5b0793bbfd54c9d5b94aeb49462b8148399000265144a8722da6b69190a25050565b610759826106d9565b61076281610e42565b61076c8383611434565b505050565b6001600160a01b03811633146107e15760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201526e103937b632b9903337b91039b2b63360891b60648201526084016106b5565b6107eb8282611456565b5050565b60006107fa81610e42565b6008805490839055604051839082907fed0b12faffd2cf512a39ed490e2449ef21e0fceb01dfbd1b163d455947cde7bb90600090a3505050565b600082815260016020526040812061084c9083611478565b9392505050565b600354339060ff16158061087f57506001600160a01b03811660009081526002602052604090205460ff165b61089b5760405162461bcd60e51b81526004016106b590611e28565b6000845111806108ac575060008351115b806108b8575060008251115b6108d45760405162461bcd60e51b81526004016106b590611e6c565b6008548251845186516108e79190611ec6565b6108f19190611ec6565b1061090e5760405162461bcd60e51b81526004016106b590611ed9565b6001600160a01b03851633036109365760405162461bcd60e51b81526004016106b590611f27565b60005b845181101561098757600085828151811061095657610956611f6d565b6020026020010151602001511161097f5760405162461bcd60e51b81526004016106b590611f83565b600101610939565b5060005b82518110156109d95760008382815181106109a8576109a8611f6d565b602002602001015160400151116109d15760405162461bcd60e51b81526004016106b590611f83565b60010161098b565b506006546040805160e08101825261dead81523360208201526001600160a01b0388811682840152606082018890526080820187905260a08201869052600060c0830152915163967737c960e01b8152919092169163967737c9913491610a42916004016120c7565b6000604051808303818588803b158015610a5b57600080fd5b505af1158015610a6f573d6000803e3d6000fd5b5050505050846001600160a01b0316336001600160a01b0316600c547fef46f8b2c97944bff8580793ccae0a22b61472c761e02493a20f860d6d462b1d878787604051610abe939291906121af565b60405180910390a4505043600c55505050565b6000918252602082815260408084206001600160a01b0393909316845291905290205460ff1690565b60008181526001602052604081206105d690611484565b6000610b1c81610e42565b600780546001600160a01b038481166001600160a01b0319831681179093556040519116919082907f59ad64a1ab3be29ccfaed6ba5087596b0eb2f48f8cad53582715c8be48cbacb590600090a3505050565b610b78826106d9565b610b8181610e42565b61076c8383611456565b6000610b9681610e42565b600680546001600160a01b038481166001600160a01b0319831681179093556040519116919082907fb9cd00730add6e591032c866c4356d07d8e8a417427b3898f6b2a3f451c13b9d90600090a3505050565b60013360009081526005602052604090205460ff166002811115610c0f57610c0f611dea565b14610c745760405162461bcd60e51b815260206004820152602f60248201527f5661756c74466163746f72793a6e6f74696679556e6c6f636b3a414c5245414460448201526e1657d195531317d5539313d0d2d151608a1b60648201526084016106b5565b8015610c9557336000908152600560205260409020805460ff191660021790555b600954604080519182524260208301528215159082015233907f7301e817558ac55a934632b4d6881c5e77e3eca6bc45e38106297b3f6846f8f09060600160405180910390a25043600955565b60013360009081526005602052604090205460ff166002811115610d0857610d08611dea565b14610d6d5760405162461bcd60e51b815260206004820152602f60248201527f5661756c74466163746f72793a6c6f636b457874656e6465643a414c5245414460448201526e1657d195531317d5539313d0d2d151608a1b60648201526084016106b5565b600b5460408051848152602081018490523392917f5d496a622973c74cc5df343adb5c6b3acc8e4e3d3a0a39b031be7dde2e40e60d910160405180910390a3505043600b55565b600354339060ff161580610de057506001600160a01b03811660009081526002602052604090205460ff165b610dfc5760405162461bcd60e51b81526004016106b590611e28565b6106cf888888888888886001610e4f565b60006001600160e01b03198216637965db0b60e01b14806105d657506301ffc9a760e01b6001600160e01b03198316146105d6565b610e4c813361148e565b50565b42861015610eaf5760405162461bcd60e51b815260206004820152602760248201527f5661756c74466163746f72793a6372656174655661756c743a554e4c4f434b5f604482015266125397d41054d560ca1b60648201526084016106b5565b600085511180610ec0575060008451115b80610ecc575060008351115b610ee85760405162461bcd60e51b81526004016106b590611e6c565b600854835185518751610efb9190611ec6565b610f059190611ec6565b10610f225760405162461bcd60e51b81526004016106b590611ed9565b6001600160a01b0388163303610f4a5760405162461bcd60e51b81526004016106b590611f27565b876001600160a01b0316876001600160a01b031603610fc45760405162461bcd60e51b815260206004820152603060248201527f5661756c74466163746f72793a6372656174655661756c743a5245464552524560448201526f525f49535f42454e454649434941525960801b60648201526084016106b5565b60005b8551811015611015576000868281518110610fe457610fe4611f6d565b6020026020010151602001511161100d5760405162461bcd60e51b81526004016106b590611f83565b600101610fc7565b5060005b835181101561106757600084828151811061103657611036611f6d565b6020026020010151604001511161105f5760405162461bcd60e51b81526004016106b590611f83565b600101611019565b506000821561118557845115801561107e57508351155b6110e15760405162461bcd60e51b815260206004820152602e60248201527f5661756c74466163746f72793a6372656174655661756c743a4f4e4c595f465560448201526d4e4749424c455f56455354494e4760901b60648201526084016106b5565b6007546040516001600160a01b039091169063f509ebfc9084908b908b9061110d908c906020016121f2565b6040516020818303038152906040526040518563ffffffff1660e01b815260040161113b9493929190612255565b6020604051808303816000875af115801561115a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061117e9190612284565b9050611267565b6007546040516001600160a01b039091169063e5de32659084908b908b906111b1908c906020016121f2565b6040516020818303038152906040528a6040516020016111d191906122a1565b6040516020818303038152906040528a6040516020016111f191906122b4565b6040516020818303038152906040526040518763ffffffff1660e01b8152600401611221969594939291906122c7565b6020604051808303816000875af1158015611240573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906112649190612284565b90505b6006546040805160e0810182526001600160a01b0384811682523360208301528c811682840152606082018a90526080820189905260a0820188905286151560c0830152915163967737c960e01b8152919092169163967737c99134916112d0916004016120c7565b6000604051808303818588803b1580156112e957600080fd5b505af11580156112fd573d6000803e3d6000fd5b50505050506000816001600160a01b031663e4dfeac06040518163ffffffff1660e01b8152600401602060405180830381865afa158015611342573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113669190612329565b9050801561139657600081815260046020526040902080546001600160a01b0319166001600160a01b0384161790555b6001600160a01b038216600090815260056020526040902080546001919060ff191682800217905550896001600160a01b0316896001600160a01b0316836001600160a01b03167f7a89dae678345f4c1e6fc361a48ecddf1290fe10bbb57d27012a394a57fd3303600a5485338e8e8e8e8e60405161141c989796959493929190612342565b60405180910390a4505043600a555050505050505050565b61143e82826114e7565b600082815260016020526040902061076c908261156b565b6114608282611580565b600082815260016020526040902061076c90826115e5565b600061084c83836115fa565b60006105d6825490565b6114988282610ad1565b6107eb576114a581611624565b6114b0836020611636565b6040516020016114c19291906123b6565b60408051601f198184030181529082905262461bcd60e51b82526106b591600401612425565b6114f18282610ad1565b6107eb576000828152602081815260408083206001600160a01b03851684529091529020805460ff191660011790556115273390565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b600061084c836001600160a01b0384166117d1565b61158a8282610ad1565b156107eb576000828152602081815260408083206001600160a01b0385168085529252808320805460ff1916905551339285917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a45050565b600061084c836001600160a01b038416611820565b600082600001828154811061161157611611611f6d565b9060005260206000200154905092915050565b60606105d66001600160a01b03831660145b60606000611645836002612438565b611650906002611ec6565b6001600160401b038111156116675761166761199f565b6040519080825280601f01601f191660200182016040528015611691576020820181803683370190505b509050600360fc1b816000815181106116ac576116ac611f6d565b60200101906001600160f81b031916908160001a905350600f60fb1b816001815181106116db576116db611f6d565b60200101906001600160f81b031916908160001a90535060006116ff846002612438565b61170a906001611ec6565b90505b6001811115611782576f181899199a1a9b1b9c1cb0b131b232b360811b85600f166010811061173e5761173e611f6d565b1a60f81b82828151811061175457611754611f6d565b60200101906001600160f81b031916908160001a90535060049490941c9361177b8161244f565b905061170d565b50831561084c5760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e7460448201526064016106b5565b6000818152600183016020526040812054611818575081546001818101845560008481526020808220909301849055845484825282860190935260409020919091556105d6565b5060006105d6565b60008181526001830160205260408120548015611909576000611844600183612466565b855490915060009061185890600190612466565b90508181146118bd57600086600001828154811061187857611878611f6d565b906000526020600020015490508087600001848154811061189b5761189b611f6d565b6000918252602080832090910192909255918252600188019052604090208390555b85548690806118ce576118ce612479565b6001900381819060005260206000200160009055905585600101600086815260200190815260200160002060009055600193505050506105d6565b60009150506105d6565b60006020828403121561192557600080fd5b81356001600160e01b03198116811461084c57600080fd5b8035801515811461194d57600080fd5b919050565b60006020828403121561196457600080fd5b61084c8261193d565b6001600160a01b0381168114610e4c57600080fd5b60006020828403121561199457600080fd5b813561084c8161196d565b634e487b7160e01b600052604160045260246000fd5b604051606081016001600160401b03811182821017156119d7576119d761199f565b60405290565b604080519081016001600160401b03811182821017156119d7576119d761199f565b604051601f8201601f191681016001600160401b0381118282101715611a2757611a2761199f565b604052919050565b60006001600160401b03821115611a4857611a4861199f565b5060051b60200190565b600082601f830112611a6357600080fd5b81356020611a78611a7383611a2f565b6119ff565b82815260609283028501820192828201919087851115611a9757600080fd5b8387015b85811015611aee5781818a031215611ab35760008081fd5b611abb6119b5565b8135611ac68161196d565b815281860135868201526040611add81840161193d565b908201528452928401928101611a9b565b5090979650505050505050565b600082601f830112611b0c57600080fd5b81356020611b1c611a7383611a2f565b82815260069290921b84018101918181019086841115611b3b57600080fd5b8286015b84811015611b835760408189031215611b585760008081fd5b611b606119dd565b8135611b6b8161196d565b81528185013585820152835291830191604001611b3f565b509695505050505050565b600082601f830112611b9f57600080fd5b81356020611baf611a7383611a2f565b82815260609283028501820192828201919087851115611bce57600080fd5b8387015b85811015611aee5781818a031215611bea5760008081fd5b611bf26119b5565b8135611bfd8161196d565b81528186013586820152604080830135908201528452928401928101611bd2565b600080600080600080600060e0888a031215611c3957600080fd5b8735611c448161196d565b96506020880135611c548161196d565b95506040880135945060608801356001600160401b0380821115611c7757600080fd5b611c838b838c01611a52565b955060808a0135915080821115611c9957600080fd5b611ca58b838c01611afb565b945060a08a0135915080821115611cbb57600080fd5b50611cc88a828b01611b8e565b925050611cd760c0890161193d565b905092959891949750929550565b600060208284031215611cf757600080fd5b5035919050565b60008060408385031215611d1157600080fd5b823591506020830135611d238161196d565b809150509250929050565b60008060408385031215611d4157600080fd5b50508035926020909101359150565b60008060008060808587031215611d6657600080fd5b8435611d718161196d565b935060208501356001600160401b0380821115611d8d57600080fd5b611d9988838901611a52565b94506040870135915080821115611daf57600080fd5b611dbb88838901611afb565b93506060870135915080821115611dd157600080fd5b50611dde87828801611b8e565b91505092959194509250565b634e487b7160e01b600052602160045260246000fd5b6020810160038310611e2257634e487b7160e01b600052602160045260246000fd5b91905290565b60208082526024908201527f57686974656c6973743a2063616c6c6572206973206e6f742077686974656c696040820152631cdd195960e21b606082015260800190565b60208082526024908201527f5661756c74466163746f72793a6372656174655661756c743a4e4f5f4445504f6040820152635349545360e01b606082015260800190565b634e487b7160e01b600052601160045260246000fd5b808201808211156105d6576105d6611eb0565b6020808252602e908201527f5661756c74466163746f72793a6372656174655661756c743a4d41585f44455060408201526d13d4d25514d7d15610d15151115160921b606082015260800190565b60208082526026908201527f5661756c74466163746f72793a6372656174655661756c743a53454c465f524560408201526511915494905360d21b606082015260800190565b634e487b7160e01b600052603260045260246000fd5b60208082526025908201527f5661756c74466163746f72793a6372656174655661756c743a5a45524f5f44456040820152641413d4d25560da1b606082015260800190565b80516001600160a01b031682526020808201519083015260409081015115159082015260600190565b60008151808452602080850194506020840160005b8381101561202757612019878351611fc8565b965090820190600101612006565b509495945050505050565b60008151808452602080850194506020840160005b8381101561202757815180516001600160a01b031688528301518388015260409096019590820190600101612047565b60008151808452602080850194506020840160005b8381101561202757815180516001600160a01b031688528381015184890152604090810151908801526060909601959082019060010161208c565b60208152600060018060a01b0380845116602084015280602085015116604084015250604083015161210460608401826001600160a01b03169052565b50606083015160e0608084015261211f610100840182611ff1565b90506080840151601f19808584030160a086015261213d8383612032565b925060a08601519150808584030160c08601525061215b8282612077565b91505060c084015161217160e085018215159052565b509392505050565b60008151808452602080850194506020840160005b83811015612027576121a1878351611fc8565b96509082019060010161218e565b6060815260006121c26060830186612179565b82810360208401526121d48186612032565b905082810360408401526121e88185612077565b9695505050505050565b60208152600061084c6020830184612179565b60005b83811015612220578181015183820152602001612208565b50506000910152565b60008151808452612241816020860160208601612205565b601f01601f19169290920160200192915050565b841515815260018060a01b03841660208201528260408201526080606082015260006121e86080830184612229565b60006020828403121561229657600080fd5b815161084c8161196d565b60208152600061084c6020830184612032565b60208152600061084c6020830184612077565b861515815260018060a01b038616602082015284604082015260c0606082015260006122f660c0830186612229565b82810360808401526123088186612229565b905082810360a084015261231c8185612229565b9998505050505050505050565b60006020828403121561233b57600080fd5b5051919050565b60006101008a835289602084015260018060a01b038916604084015287606084015280608084015261237681840188612179565b905082810360a084015261238a8187612032565b905082810360c084015261239e8186612077565b91505082151560e08301529998505050505050505050565b76020b1b1b2b9b9a1b7b73a3937b61d1030b1b1b7bab73a1604d1b8152600083516123e8816017850160208801612205565b7001034b99036b4b9b9b4b733903937b6329607d1b6017918401918201528351612419816028840160208801612205565b01602801949350505050565b60208152600061084c6020830184612229565b80820281158282048414176105d6576105d6611eb0565b60008161245e5761245e611eb0565b506000190190565b818103818111156105d6576105d6611eb0565b634e487b7160e01b600052603160045260246000fdfe28f5a99355973cc89255b8c4ac88405f27c78ded7608b040ee77a8bdf44d15e2a164736f6c6343000817000a
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
00000000000000000000000018b65375097112e673145eaec401eb6c9f92abef0000000000000000000000000000000000000000000000000000000000000064
-----Decoded View---------------
Arg [0] : _paymentModule (address): 0x18B65375097112E673145eAec401eB6c9f92AbEF
Arg [1] : maxTokens (uint256): 100
-----Encoded View---------------
2 Constructor Arguments found :
Arg [0] : 00000000000000000000000018b65375097112e673145eaec401eb6c9f92abef
Arg [1] : 0000000000000000000000000000000000000000000000000000000000000064
Loading...
Loading
Loading...
Loading
Loading...
Loading
Net Worth in USD
$0.00
Net Worth in ETH
0
Multichain Portfolio | 35 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.