Source Code
Overview
ETH Balance
0 ETH
ETH Value
$0.00| Transaction Hash |
|
Block
|
From
|
To
|
|||||
|---|---|---|---|---|---|---|---|---|---|
Latest 25 internal transactions (View All)
Advanced mode:
| Parent Transaction Hash | Block | From | To | |||
|---|---|---|---|---|---|---|
| 107558388 | 909 days ago | 0 ETH | ||||
| 107558386 | 909 days ago | 0 ETH | ||||
| 107558385 | 909 days ago | 0 ETH | ||||
| 107558384 | 909 days ago | 0 ETH | ||||
| 107558384 | 909 days ago | 0 ETH | ||||
| 107558383 | 909 days ago | 0 ETH | ||||
| 107558379 | 909 days ago | 0 ETH | ||||
| 107558378 | 909 days ago | 0 ETH | ||||
| 107558377 | 909 days ago | 0 ETH | ||||
| 107558376 | 909 days ago | 0 ETH | ||||
| 107558375 | 909 days ago | 0 ETH | ||||
| 107558374 | 909 days ago | 0 ETH | ||||
| 107558369 | 909 days ago | 0 ETH | ||||
| 107558365 | 909 days ago | 0 ETH | ||||
| 107558364 | 909 days ago | 0 ETH | ||||
| 107558363 | 909 days ago | 0 ETH | ||||
| 107558363 | 909 days ago | 0 ETH | ||||
| 107558363 | 909 days ago | 0 ETH | ||||
| 107558361 | 909 days ago | 0 ETH | ||||
| 107558359 | 909 days ago | 0 ETH | ||||
| 107558357 | 909 days ago | 0 ETH | ||||
| 107558356 | 909 days ago | 0 ETH | ||||
| 107558356 | 909 days ago | 0 ETH | ||||
| 107558354 | 909 days ago | 0 ETH | ||||
| 107558353 | 909 days ago | 0 ETH |
Cross-Chain Transactions
Loading...
Loading
This contract may be a proxy contract. Click on More Options and select Is this a proxy? to confirm and enable the "Read as Proxy" & "Write as Proxy" tabs.
Contract Name:
WorldIDRouterImplV1
Compiler Version
v0.8.19+commit.7dd6d404
Optimization Enabled:
Yes with 200 runs
Other Settings:
default evmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.19;
import {WorldIDImpl} from "./abstract/WorldIDImpl.sol";
import {IWorldIDGroups} from "./interfaces/IWorldIDGroups.sol";
import {IWorldID} from "./interfaces/IWorldID.sol";
/// @title WorldID Router Implementation Version 1
/// @author Worldcoin
/// @notice A router component that can dispatch group numbers to the correct identity manager
/// implementation.
/// @dev This is the implementation delegated to by a proxy.
contract WorldIDRouterImplV1 is WorldIDImpl, IWorldIDGroups {
///////////////////////////////////////////////////////////////////////////////
/// A NOTE ON IMPLEMENTATION CONTRACTS ///
///////////////////////////////////////////////////////////////////////////////
// This contract is designed explicitly to operate from behind a proxy contract. As a result,
// there are a few important implementation considerations:
//
// - All updates made after deploying a given version of the implementation should inherit from
// the latest version of the implementation. This prevents storage clashes.
// - All functions that are less access-restricted than `private` should be marked `virtual` in
// order to enable the fixing of bugs in the existing interface.
// - Any function that reads from or modifies state (i.e. is not marked `pure`) must be
// annotated with the `onlyProxy` and `onlyInitialized` modifiers. This ensures that it can
// only be called when it has access to the data in the proxy, otherwise results are likely to
// be nonsensical.
// - This contract deals with important data for the WorldID system. Ensure that all newly-added
// functionality is carefully access controlled using `onlyOwner`, or a more granular access
// mechanism.
// - Do not assign any contract-level variables at the definition site unless they are
// `constant`.
//
// Additionally, the following notes apply:
//
// - Initialisation and ownership management are not protected behind `onlyProxy` intentionally.
// This ensures that the contract can safely be disposed of after it is no longer used.
// - Carefully consider what data recovery options are presented as new functionality is added.
// Care must be taken to ensure that a migration plan can exist for cases where upgrades
// cannot recover from an issue or vulnerability.
///////////////////////////////////////////////////////////////////////////////
/// !!!!! DATA: DO NOT REORDER !!!!! ///
///////////////////////////////////////////////////////////////////////////////
/// The null address.
IWorldID internal constant NULL_ROUTER = IWorldID(address(0x0));
/// The routing table used to dispatch from groups to addresses.
IWorldID[] internal routingTable;
///////////////////////////////////////////////////////////////////////////////
/// ERRORS ///
///////////////////////////////////////////////////////////////////////////////
/// @notice An error raised when routing is requested for a group that does not exist.
///
/// @param groupId The group identifier that was requested but does not exist.
error NoSuchGroup(uint256 groupId);
/// @notice The requested group has been disabled.
error GroupIsDisabled();
///////////////////////////////////////////////////////////////////////////////
/// EVENTS ///
///////////////////////////////////////////////////////////////////////////////
/// @notice Emitted when a group is added to the router.
///
/// @param groupId The identifier for the group.
/// @param identityManager The address of the identity manager associated with the group.
event GroupAdded(uint256 indexed groupId, address indexed identityManager);
/// @notice Emitted when a group is updated in the router.
///
/// @param groupId The identitfier for the group.
/// @param oldIdentityManager The address of the previous identity manager associated with the
/// group.
/// @param newIdentityManager The address of the new identity manager associated with the group.
event GroupUpdated(
uint256 indexed groupId,
address indexed oldIdentityManager,
address indexed newIdentityManager
);
/// @notice Emitted when a group is disabled in the router.
///
/// @param groupId The identifier of the group that has been disabled.
event GroupDisabled(uint256 indexed groupId);
/// @notice Emitted when a group is enabled in the router.
///
/// @param initialGroupIdentityManager The address of the identity manager to be used for the first group
event GroupIdentityManagerRouterImplInitialized(IWorldID initialGroupIdentityManager);
///////////////////////////////////////////////////////////////////////////////
/// INITIALIZATION ///
///////////////////////////////////////////////////////////////////////////////
/// @notice Constructs the contract.
constructor() {
// When called in the constructor, this is called in the context of the implementation and
// not the proxy. Calling this thereby ensures that the contract cannot be spuriously
// initialized on its own.
_disableInitializers();
}
/// @notice Initializes the contract.
/// @dev Must be called exactly once.
/// @dev This is marked `reinitializer()` to allow for updated initialisation steps when working
/// with upgrades based upon this contract. Be aware that there are only 256 (zero-indexed)
/// initialisations allowed, so decide carefully when to use them. Many cases can safely be
/// replaced by use of setters.
/// @dev This function is explicitly not virtual as it does not make sense to override even when
/// upgrading. Create a separate initializer function instead.
///
/// @param initialGroupIdentityManager The address of the identity manager to be used for the
/// initial group (group ID 0) when instantiating the router.
///
/// @custom:reverts string If called more than once at the same initalisation number.
function initialize(IWorldID initialGroupIdentityManager) public reinitializer(1) {
// Initialize the sub-contracts.
__delegateInit();
// Now we can perform our own internal initialisation.
routingTable.push(initialGroupIdentityManager);
// Mark the contract as initialized.
__setInitialized();
emit GroupIdentityManagerRouterImplInitialized(initialGroupIdentityManager);
}
/// @notice Responsible for initialising all of the supertypes of this contract.
/// @dev Must be called exactly once.
/// @dev When adding new superclasses, ensure that any initialization that they need to perform
/// is accounted for here.
///
/// @custom:reverts string If called more than once.
function __delegateInit() internal virtual onlyInitializing {
__WorldIDImpl_init();
}
///////////////////////////////////////////////////////////////////////////////
/// ROUTING ///
///////////////////////////////////////////////////////////////////////////////
/// @notice Gets the route for the provided group number.
///
/// @param groupNumber The number of the group to get the route for.
///
/// @return target The target address for the group number.
///
/// @custom:reverts NoSuchGroup If the requested `groupNumber` does not exist.
/// @custom:reverts GroupDisabled If the group has been disabled.
function routeFor(uint256 groupNumber)
public
view
virtual
onlyProxy
onlyInitialized
returns (IWorldID)
{
// We want to revert if the group does not exist.
if (groupNumber >= groupCount()) {
revert NoSuchGroup(groupNumber);
}
// If there is no valid route for a given group we also revert.
if (routingTable[groupNumber] == NULL_ROUTER) {
revert GroupIsDisabled();
}
// With preconditions checked we can return the route.
return routingTable[groupNumber];
}
///////////////////////////////////////////////////////////////////////////////
/// GROUP MANAGEMENT ///
///////////////////////////////////////////////////////////////////////////////
/// @notice Adds a group to the router.
/// @dev It is perfectly valid to add a group with a target address of 0 in order to disable it.
/// @dev While it reverts if the group identifier is not sequential, this is due to the fact
/// that group identifiers are allocated externally. As a result, they cannot just be
/// allocated by the router.
///
/// @param groupIdentityManager The address of the identity manager instance to be used for the
/// group. If this is set to the null address the group is disabled.
///
/// @custom:reverts DuplicateGroup If the `groupId` already exists in the routing table.
/// @custom:reverts NonSequentialGroup If the `groupId` is not the sequentially next group based
/// on the known groups.
function addGroup(IWorldID groupIdentityManager)
public
virtual
onlyProxy
onlyInitialized
onlyOwner
{
uint256 groupId = groupCount();
// Insert the entry into the routing table.
insertNewTableEntry(groupIdentityManager);
emit GroupAdded(groupId, address(groupIdentityManager));
}
/// @notice Updates the target address for a group in the router.
/// @dev It is perfectly valid to update a group with a target address of 0 in order to disable
/// it.
///
/// @param groupId The identitifier for the group to have its target address updated.
/// @param newTargetAddress The new target address for the group in routing. If this is set to
/// the null address the group will be disabled.
///
/// @return oldTarget The old target address for the group.
///
/// @custom:reverts NoSuchGroup If the target group does not exist to be updated.
function updateGroup(uint256 groupId, IWorldID newTargetAddress)
public
virtual
onlyProxy
onlyInitialized
onlyOwner
returns (IWorldID oldTarget)
{
oldTarget = performGroupUpdate(groupId, newTargetAddress);
emit GroupUpdated(groupId, address(oldTarget), address(newTargetAddress));
}
/// @notice Disables the target group in the router.
///
/// @param groupId The identifier for the group to be disabled.
///
/// @return oldTarget The old target address for the group.
///
/// @custom:reverts NoSuchGroup If the target group does not exist to be disabled.
function disableGroup(uint256 groupId)
public
virtual
onlyProxy
onlyInitialized
onlyOwner
returns (IWorldID oldTarget)
{
oldTarget = performGroupUpdate(groupId, NULL_ROUTER);
emit GroupDisabled(groupId);
}
/// @notice Updates the target address for a group in the router.
/// @dev It is perfectly valid to update a group with a target address of 0 in order to disable
/// it.
///
/// @param groupId The identitifier for the group to have its target address updated.
/// @param newTarget The new target address for the group in routing. If this is set to the null
/// address the group will be disabled.
///
/// @return oldTarget The old target address for the group.
///
/// @custom:reverts NoSuchGroup If the target group does not exist to be updated.
function performGroupUpdate(uint256 groupId, IWorldID newTarget)
internal
virtual
onlyProxy
onlyInitialized
onlyOwner
returns (IWorldID oldTarget)
{
// It is not possible to update a non-existent group.
if (groupId >= groupCount()) {
revert NoSuchGroup(groupId);
}
oldTarget = routingTable[groupId];
routingTable[groupId] = newTarget;
}
///////////////////////////////////////////////////////////////////////////////
/// DATA QUERYING ///
///////////////////////////////////////////////////////////////////////////////
/// @notice Gets the number of groups in the routing table.
///
/// @return count The number of groups in the table.
function groupCount() public view virtual onlyProxy onlyInitialized returns (uint256 count) {
return routingTable.length;
}
///////////////////////////////////////////////////////////////////////////////
/// INTERNAL FUNCTIONS ///
///////////////////////////////////////////////////////////////////////////////
/// @notice Inserts the `targetAddress` into the routing table for the provided `groupId`.
/// @dev Callers must ensure that the group identifier requested is the next in the table before
/// calling.
///
/// @param targetAddress The address to be routed to for the provided `groupId`.
function insertNewTableEntry(IWorldID targetAddress)
internal
virtual
onlyProxy
onlyInitialized
{
routingTable.push(targetAddress);
}
/// @notice Gets the group identifier for the group with the highest group identifier known to
/// the router.
///
/// @return groupId The highest group identifier known.
function nextGroupId()
internal
view
virtual
onlyProxy
onlyInitialized
returns (uint256 groupId)
{
return groupCount();
}
///////////////////////////////////////////////////////////////////////////////
/// WORLDID COMPLIANCE ///
///////////////////////////////////////////////////////////////////////////////
/// @notice Verifies a WorldID zero knowledge proof.
/// @dev Note that a double-signaling check is not included here, and should be carried by the
/// caller.
///
/// @param root The of the Merkle tree
/// @param groupId The group identifier for the group to verify a proof for.
/// @param signalHash A keccak256 hash of the Semaphore signal
/// @param nullifierHash The nullifier hash
/// @param externalNullifierHash A keccak256 hash of the external nullifier
/// @param proof The zero-knowledge proof
///
/// @custom:reverts Any If the `proof` is invalid. The exact type of the revert depends on the
/// `IWorldID` implementation being called into.
/// @custom:reverts NoSuchGroup If the provided `groupId` references a group that does not exist.
function verifyProof(
uint256 root,
uint256 groupId,
uint256 signalHash,
uint256 nullifierHash,
uint256 externalNullifierHash,
uint256[8] calldata proof
) external virtual onlyProxy onlyInitialized {
IWorldID identityManager = routeFor(groupId);
identityManager.verifyProof(root, signalHash, nullifierHash, externalNullifierHash, proof);
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.8.0) (access/Ownable2Step.sol)
pragma solidity ^0.8.0;
import "./OwnableUpgradeable.sol";
import "../proxy/utils/Initializable.sol";
/**
* @dev Contract module which provides access control mechanism, where
* there is an account (an owner) that can be granted exclusive access to
* specific functions.
*
* By default, the owner account will be the one that deploys the contract. This
* can later be changed with {transferOwnership} and {acceptOwnership}.
*
* This module is used through inheritance. It will make available all functions
* from parent (Ownable).
*/
abstract contract Ownable2StepUpgradeable is Initializable, OwnableUpgradeable {
function __Ownable2Step_init() internal onlyInitializing {
__Ownable_init_unchained();
}
function __Ownable2Step_init_unchained() internal onlyInitializing {
}
address private _pendingOwner;
event OwnershipTransferStarted(address indexed previousOwner, address indexed newOwner);
/**
* @dev Returns the address of the pending owner.
*/
function pendingOwner() public view virtual returns (address) {
return _pendingOwner;
}
/**
* @dev Starts the ownership transfer of the contract to a new account. Replaces the pending transfer if there is one.
* Can only be called by the current owner.
*/
function transferOwnership(address newOwner) public virtual override onlyOwner {
_pendingOwner = newOwner;
emit OwnershipTransferStarted(owner(), newOwner);
}
/**
* @dev Transfers ownership of the contract to a new account (`newOwner`) and deletes any pending owner.
* Internal function without access restriction.
*/
function _transferOwnership(address newOwner) internal virtual override {
delete _pendingOwner;
super._transferOwnership(newOwner);
}
/**
* @dev The new owner accepts the ownership transfer.
*/
function acceptOwnership() external {
address sender = _msgSender();
require(pendingOwner() == sender, "Ownable2Step: caller is not the new owner");
_transferOwnership(sender);
}
/**
* @dev This empty reserved space is put in place to allow future versions to add new
* variables without shifting down storage in the inheritance chain.
* See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps
*/
uint256[49] private __gap;
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.0) (access/Ownable.sol)
pragma solidity ^0.8.0;
import "../utils/ContextUpgradeable.sol";
import "../proxy/utils/Initializable.sol";
/**
* @dev Contract module which provides a basic access control mechanism, where
* there is an account (an owner) that can be granted exclusive access to
* specific functions.
*
* By default, the owner account will be the one that deploys the contract. This
* can later be changed with {transferOwnership}.
*
* This module is used through inheritance. It will make available the modifier
* `onlyOwner`, which can be applied to your functions to restrict their use to
* the owner.
*/
abstract contract OwnableUpgradeable is Initializable, ContextUpgradeable {
address private _owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev Initializes the contract setting the deployer as the initial owner.
*/
function __Ownable_init() internal onlyInitializing {
__Ownable_init_unchained();
}
function __Ownable_init_unchained() internal onlyInitializing {
_transferOwnership(_msgSender());
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
_checkOwner();
_;
}
/**
* @dev Returns the address of the current owner.
*/
function owner() public view virtual returns (address) {
return _owner;
}
/**
* @dev Throws if the sender is not the owner.
*/
function _checkOwner() internal view virtual {
require(owner() == _msgSender(), "Ownable: caller is not the owner");
}
/**
* @dev Leaves the contract without owner. It will not be possible to call
* `onlyOwner` functions anymore. Can only be called by the current owner.
*
* NOTE: Renouncing ownership will leave the contract without an owner,
* thereby removing any functionality that is only available to the owner.
*/
function renounceOwnership() public virtual onlyOwner {
_transferOwnership(address(0));
}
/**
* @dev Transfers ownership of the contract to a new account (`newOwner`).
* Can only be called by the current owner.
*/
function transferOwnership(address newOwner) public virtual onlyOwner {
require(newOwner != address(0), "Ownable: new owner is the zero address");
_transferOwnership(newOwner);
}
/**
* @dev Transfers ownership of the contract to a new account (`newOwner`).
* Internal function without access restriction.
*/
function _transferOwnership(address newOwner) internal virtual {
address oldOwner = _owner;
_owner = newOwner;
emit OwnershipTransferred(oldOwner, newOwner);
}
/**
* @dev This empty reserved space is put in place to allow future versions to add new
* variables without shifting down storage in the inheritance chain.
* See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps
*/
uint256[49] private __gap;
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.5.0) (interfaces/draft-IERC1822.sol)
pragma solidity ^0.8.0;
/**
* @dev ERC1822: Universal Upgradeable Proxy Standard (UUPS) documents a method for upgradeability through a simplified
* proxy whose upgrades are fully controlled by the current implementation.
*/
interface IERC1822ProxiableUpgradeable {
/**
* @dev Returns the storage slot that the proxiable contract assumes is being used to store the implementation
* address.
*
* IMPORTANT: A proxy pointing at a proxiable contract should not be considered proxiable itself, because this risks
* bricking a proxy that upgrades to it, by delegating to itself until out of gas. Thus it is critical that this
* function revert if invoked through a proxy.
*/
function proxiableUUID() external view returns (bytes32);
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.5.0) (proxy/ERC1967/ERC1967Upgrade.sol)
pragma solidity ^0.8.2;
import "../beacon/IBeaconUpgradeable.sol";
import "../../interfaces/draft-IERC1822Upgradeable.sol";
import "../../utils/AddressUpgradeable.sol";
import "../../utils/StorageSlotUpgradeable.sol";
import "../utils/Initializable.sol";
/**
* @dev This abstract contract provides getters and event emitting update functions for
* https://eips.ethereum.org/EIPS/eip-1967[EIP1967] slots.
*
* _Available since v4.1._
*
* @custom:oz-upgrades-unsafe-allow delegatecall
*/
abstract contract ERC1967UpgradeUpgradeable is Initializable {
function __ERC1967Upgrade_init() internal onlyInitializing {
}
function __ERC1967Upgrade_init_unchained() internal onlyInitializing {
}
// This is the keccak-256 hash of "eip1967.proxy.rollback" subtracted by 1
bytes32 private constant _ROLLBACK_SLOT = 0x4910fdfa16fed3260ed0e7147f7cc6da11a60208b5b9406d12a635614ffd9143;
/**
* @dev Storage slot with the address of the current implementation.
* This is the keccak-256 hash of "eip1967.proxy.implementation" subtracted by 1, and is
* validated in the constructor.
*/
bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;
/**
* @dev Emitted when the implementation is upgraded.
*/
event Upgraded(address indexed implementation);
/**
* @dev Returns the current implementation address.
*/
function _getImplementation() internal view returns (address) {
return StorageSlotUpgradeable.getAddressSlot(_IMPLEMENTATION_SLOT).value;
}
/**
* @dev Stores a new address in the EIP1967 implementation slot.
*/
function _setImplementation(address newImplementation) private {
require(AddressUpgradeable.isContract(newImplementation), "ERC1967: new implementation is not a contract");
StorageSlotUpgradeable.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;
}
/**
* @dev Perform implementation upgrade
*
* Emits an {Upgraded} event.
*/
function _upgradeTo(address newImplementation) internal {
_setImplementation(newImplementation);
emit Upgraded(newImplementation);
}
/**
* @dev Perform implementation upgrade with additional setup call.
*
* Emits an {Upgraded} event.
*/
function _upgradeToAndCall(
address newImplementation,
bytes memory data,
bool forceCall
) internal {
_upgradeTo(newImplementation);
if (data.length > 0 || forceCall) {
_functionDelegateCall(newImplementation, data);
}
}
/**
* @dev Perform implementation upgrade with security checks for UUPS proxies, and additional setup call.
*
* Emits an {Upgraded} event.
*/
function _upgradeToAndCallUUPS(
address newImplementation,
bytes memory data,
bool forceCall
) internal {
// Upgrades from old implementations will perform a rollback test. This test requires the new
// implementation to upgrade back to the old, non-ERC1822 compliant, implementation. Removing
// this special case will break upgrade paths from old UUPS implementation to new ones.
if (StorageSlotUpgradeable.getBooleanSlot(_ROLLBACK_SLOT).value) {
_setImplementation(newImplementation);
} else {
try IERC1822ProxiableUpgradeable(newImplementation).proxiableUUID() returns (bytes32 slot) {
require(slot == _IMPLEMENTATION_SLOT, "ERC1967Upgrade: unsupported proxiableUUID");
} catch {
revert("ERC1967Upgrade: new implementation is not UUPS");
}
_upgradeToAndCall(newImplementation, data, forceCall);
}
}
/**
* @dev Storage slot with the admin of the contract.
* This is the keccak-256 hash of "eip1967.proxy.admin" subtracted by 1, and is
* validated in the constructor.
*/
bytes32 internal constant _ADMIN_SLOT = 0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103;
/**
* @dev Emitted when the admin account has changed.
*/
event AdminChanged(address previousAdmin, address newAdmin);
/**
* @dev Returns the current admin.
*/
function _getAdmin() internal view returns (address) {
return StorageSlotUpgradeable.getAddressSlot(_ADMIN_SLOT).value;
}
/**
* @dev Stores a new address in the EIP1967 admin slot.
*/
function _setAdmin(address newAdmin) private {
require(newAdmin != address(0), "ERC1967: new admin is the zero address");
StorageSlotUpgradeable.getAddressSlot(_ADMIN_SLOT).value = newAdmin;
}
/**
* @dev Changes the admin of the proxy.
*
* Emits an {AdminChanged} event.
*/
function _changeAdmin(address newAdmin) internal {
emit AdminChanged(_getAdmin(), newAdmin);
_setAdmin(newAdmin);
}
/**
* @dev The storage slot of the UpgradeableBeacon contract which defines the implementation for this proxy.
* This is bytes32(uint256(keccak256('eip1967.proxy.beacon')) - 1)) and is validated in the constructor.
*/
bytes32 internal constant _BEACON_SLOT = 0xa3f0ad74e5423aebfd80d3ef4346578335a9a72aeaee59ff6cb3582b35133d50;
/**
* @dev Emitted when the beacon is upgraded.
*/
event BeaconUpgraded(address indexed beacon);
/**
* @dev Returns the current beacon.
*/
function _getBeacon() internal view returns (address) {
return StorageSlotUpgradeable.getAddressSlot(_BEACON_SLOT).value;
}
/**
* @dev Stores a new beacon in the EIP1967 beacon slot.
*/
function _setBeacon(address newBeacon) private {
require(AddressUpgradeable.isContract(newBeacon), "ERC1967: new beacon is not a contract");
require(
AddressUpgradeable.isContract(IBeaconUpgradeable(newBeacon).implementation()),
"ERC1967: beacon implementation is not a contract"
);
StorageSlotUpgradeable.getAddressSlot(_BEACON_SLOT).value = newBeacon;
}
/**
* @dev Perform beacon upgrade with additional setup call. Note: This upgrades the address of the beacon, it does
* not upgrade the implementation contained in the beacon (see {UpgradeableBeacon-_setImplementation} for that).
*
* Emits a {BeaconUpgraded} event.
*/
function _upgradeBeaconToAndCall(
address newBeacon,
bytes memory data,
bool forceCall
) internal {
_setBeacon(newBeacon);
emit BeaconUpgraded(newBeacon);
if (data.length > 0 || forceCall) {
_functionDelegateCall(IBeaconUpgradeable(newBeacon).implementation(), data);
}
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
* but performing a delegate call.
*
* _Available since v3.4._
*/
function _functionDelegateCall(address target, bytes memory data) private returns (bytes memory) {
require(AddressUpgradeable.isContract(target), "Address: delegate call to non-contract");
// solhint-disable-next-line avoid-low-level-calls
(bool success, bytes memory returndata) = target.delegatecall(data);
return AddressUpgradeable.verifyCallResult(success, returndata, "Address: low-level delegate call failed");
}
/**
* @dev This empty reserved space is put in place to allow future versions to add new
* variables without shifting down storage in the inheritance chain.
* See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps
*/
uint256[50] private __gap;
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (proxy/beacon/IBeacon.sol)
pragma solidity ^0.8.0;
/**
* @dev This is the interface that {BeaconProxy} expects of its beacon.
*/
interface IBeaconUpgradeable {
/**
* @dev Must return an address that can be used as a delegate call target.
*
* {BeaconProxy} will check that this address is a contract.
*/
function implementation() external view returns (address);
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.8.1) (proxy/utils/Initializable.sol)
pragma solidity ^0.8.2;
import "../../utils/AddressUpgradeable.sol";
/**
* @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed
* behind a proxy. Since proxied contracts do not make use of a constructor, it's common to move constructor logic to an
* external initializer function, usually called `initialize`. It then becomes necessary to protect this initializer
* function so it can only be called once. The {initializer} modifier provided by this contract will have this effect.
*
* The initialization functions use a version number. Once a version number is used, it is consumed and cannot be
* reused. This mechanism prevents re-execution of each "step" but allows the creation of new initialization steps in
* case an upgrade adds a module that needs to be initialized.
*
* For example:
*
* [.hljs-theme-light.nopadding]
* ```
* contract MyToken is ERC20Upgradeable {
* function initialize() initializer public {
* __ERC20_init("MyToken", "MTK");
* }
* }
* contract MyTokenV2 is MyToken, ERC20PermitUpgradeable {
* function initializeV2() reinitializer(2) public {
* __ERC20Permit_init("MyToken");
* }
* }
* ```
*
* TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as
* possible by providing the encoded function call as the `_data` argument to {ERC1967Proxy-constructor}.
*
* CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure
* that all initializers are idempotent. This is not verified automatically as constructors are by Solidity.
*
* [CAUTION]
* ====
* Avoid leaving a contract uninitialized.
*
* An uninitialized contract can be taken over by an attacker. This applies to both a proxy and its implementation
* contract, which may impact the proxy. To prevent the implementation contract from being used, you should invoke
* the {_disableInitializers} function in the constructor to automatically lock it when it is deployed:
*
* [.hljs-theme-light.nopadding]
* ```
* /// @custom:oz-upgrades-unsafe-allow constructor
* constructor() {
* _disableInitializers();
* }
* ```
* ====
*/
abstract contract Initializable {
/**
* @dev Indicates that the contract has been initialized.
* @custom:oz-retyped-from bool
*/
uint8 private _initialized;
/**
* @dev Indicates that the contract is in the process of being initialized.
*/
bool private _initializing;
/**
* @dev Triggered when the contract has been initialized or reinitialized.
*/
event Initialized(uint8 version);
/**
* @dev A modifier that defines a protected initializer function that can be invoked at most once. In its scope,
* `onlyInitializing` functions can be used to initialize parent contracts.
*
* Similar to `reinitializer(1)`, except that functions marked with `initializer` can be nested in the context of a
* constructor.
*
* Emits an {Initialized} event.
*/
modifier initializer() {
bool isTopLevelCall = !_initializing;
require(
(isTopLevelCall && _initialized < 1) || (!AddressUpgradeable.isContract(address(this)) && _initialized == 1),
"Initializable: contract is already initialized"
);
_initialized = 1;
if (isTopLevelCall) {
_initializing = true;
}
_;
if (isTopLevelCall) {
_initializing = false;
emit Initialized(1);
}
}
/**
* @dev A modifier that defines a protected reinitializer function that can be invoked at most once, and only if the
* contract hasn't been initialized to a greater version before. In its scope, `onlyInitializing` functions can be
* used to initialize parent contracts.
*
* A reinitializer may be used after the original initialization step. This is essential to configure modules that
* are added through upgrades and that require initialization.
*
* When `version` is 1, this modifier is similar to `initializer`, except that functions marked with `reinitializer`
* cannot be nested. If one is invoked in the context of another, execution will revert.
*
* Note that versions can jump in increments greater than 1; this implies that if multiple reinitializers coexist in
* a contract, executing them in the right order is up to the developer or operator.
*
* WARNING: setting the version to 255 will prevent any future reinitialization.
*
* Emits an {Initialized} event.
*/
modifier reinitializer(uint8 version) {
require(!_initializing && _initialized < version, "Initializable: contract is already initialized");
_initialized = version;
_initializing = true;
_;
_initializing = false;
emit Initialized(version);
}
/**
* @dev Modifier to protect an initialization function so that it can only be invoked by functions with the
* {initializer} and {reinitializer} modifiers, directly or indirectly.
*/
modifier onlyInitializing() {
require(_initializing, "Initializable: contract is not initializing");
_;
}
/**
* @dev Locks the contract, preventing any future reinitialization. This cannot be part of an initializer call.
* Calling this in the constructor of a contract will prevent that contract from being initialized or reinitialized
* to any version. It is recommended to use this to lock implementation contracts that are designed to be called
* through proxies.
*
* Emits an {Initialized} event the first time it is successfully executed.
*/
function _disableInitializers() internal virtual {
require(!_initializing, "Initializable: contract is initializing");
if (_initialized < type(uint8).max) {
_initialized = type(uint8).max;
emit Initialized(type(uint8).max);
}
}
/**
* @dev Returns the highest version that has been initialized. See {reinitializer}.
*/
function _getInitializedVersion() internal view returns (uint8) {
return _initialized;
}
/**
* @dev Returns `true` if the contract is currently initializing. See {onlyInitializing}.
*/
function _isInitializing() internal view returns (bool) {
return _initializing;
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.8.0) (proxy/utils/UUPSUpgradeable.sol)
pragma solidity ^0.8.0;
import "../../interfaces/draft-IERC1822Upgradeable.sol";
import "../ERC1967/ERC1967UpgradeUpgradeable.sol";
import "./Initializable.sol";
/**
* @dev An upgradeability mechanism designed for UUPS proxies. The functions included here can perform an upgrade of an
* {ERC1967Proxy}, when this contract is set as the implementation behind such a proxy.
*
* A security mechanism ensures that an upgrade does not turn off upgradeability accidentally, although this risk is
* reinstated if the upgrade retains upgradeability but removes the security mechanism, e.g. by replacing
* `UUPSUpgradeable` with a custom implementation of upgrades.
*
* The {_authorizeUpgrade} function must be overridden to include access restriction to the upgrade mechanism.
*
* _Available since v4.1._
*/
abstract contract UUPSUpgradeable is Initializable, IERC1822ProxiableUpgradeable, ERC1967UpgradeUpgradeable {
function __UUPSUpgradeable_init() internal onlyInitializing {
}
function __UUPSUpgradeable_init_unchained() internal onlyInitializing {
}
/// @custom:oz-upgrades-unsafe-allow state-variable-immutable state-variable-assignment
address private immutable __self = address(this);
/**
* @dev Check that the execution is being performed through a delegatecall call and that the execution context is
* a proxy contract with an implementation (as defined in ERC1967) pointing to self. This should only be the case
* for UUPS and transparent proxies that are using the current contract as their implementation. Execution of a
* function through ERC1167 minimal proxies (clones) would not normally pass this test, but is not guaranteed to
* fail.
*/
modifier onlyProxy() {
require(address(this) != __self, "Function must be called through delegatecall");
require(_getImplementation() == __self, "Function must be called through active proxy");
_;
}
/**
* @dev Check that the execution is not being performed through a delegate call. This allows a function to be
* callable on the implementing contract but not through proxies.
*/
modifier notDelegated() {
require(address(this) == __self, "UUPSUpgradeable: must not be called through delegatecall");
_;
}
/**
* @dev Implementation of the ERC1822 {proxiableUUID} function. This returns the storage slot used by the
* implementation. It is used to validate the implementation's compatibility when performing an upgrade.
*
* IMPORTANT: A proxy pointing at a proxiable contract should not be considered proxiable itself, because this risks
* bricking a proxy that upgrades to it, by delegating to itself until out of gas. Thus it is critical that this
* function revert if invoked through a proxy. This is guaranteed by the `notDelegated` modifier.
*/
function proxiableUUID() external view virtual override notDelegated returns (bytes32) {
return _IMPLEMENTATION_SLOT;
}
/**
* @dev Upgrade the implementation of the proxy to `newImplementation`.
*
* Calls {_authorizeUpgrade}.
*
* Emits an {Upgraded} event.
*/
function upgradeTo(address newImplementation) external virtual onlyProxy {
_authorizeUpgrade(newImplementation);
_upgradeToAndCallUUPS(newImplementation, new bytes(0), false);
}
/**
* @dev Upgrade the implementation of the proxy to `newImplementation`, and subsequently execute the function call
* encoded in `data`.
*
* Calls {_authorizeUpgrade}.
*
* Emits an {Upgraded} event.
*/
function upgradeToAndCall(address newImplementation, bytes memory data) external payable virtual onlyProxy {
_authorizeUpgrade(newImplementation);
_upgradeToAndCallUUPS(newImplementation, data, true);
}
/**
* @dev Function that should revert when `msg.sender` is not authorized to upgrade the contract. Called by
* {upgradeTo} and {upgradeToAndCall}.
*
* Normally, this function will use an xref:access.adoc[access control] modifier such as {Ownable-onlyOwner}.
*
* ```solidity
* function _authorizeUpgrade(address) internal override onlyOwner {}
* ```
*/
function _authorizeUpgrade(address newImplementation) internal virtual;
/**
* @dev This empty reserved space is put in place to allow future versions to add new
* variables without shifting down storage in the inheritance chain.
* See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps
*/
uint256[50] private __gap;
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.8.0) (utils/Address.sol)
pragma solidity ^0.8.1;
/**
* @dev Collection of functions related to the address type
*/
library AddressUpgradeable {
/**
* @dev Returns true if `account` is a contract.
*
* [IMPORTANT]
* ====
* It is unsafe to assume that an address for which this function returns
* false is an externally-owned account (EOA) and not a contract.
*
* Among others, `isContract` will return false for the following
* types of addresses:
*
* - an externally-owned account
* - a contract in construction
* - an address where a contract will be created
* - an address where a contract lived, but was destroyed
* ====
*
* [IMPORTANT]
* ====
* You shouldn't rely on `isContract` to protect against flash loan attacks!
*
* Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets
* like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract
* constructor.
* ====
*/
function isContract(address account) internal view returns (bool) {
// This method relies on extcodesize/address.code.length, which returns 0
// for contracts in construction, since the code is only stored at the end
// of the constructor execution.
return account.code.length > 0;
}
/**
* @dev Replacement for Solidity's `transfer`: sends `amount` wei to
* `recipient`, forwarding all available gas and reverting on errors.
*
* https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost
* of certain opcodes, possibly making contracts go over the 2300 gas limit
* imposed by `transfer`, making them unable to receive funds via
* `transfer`. {sendValue} removes this limitation.
*
* https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].
*
* IMPORTANT: because control is transferred to `recipient`, care must be
* taken to not create reentrancy vulnerabilities. Consider using
* {ReentrancyGuard} or the
* https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].
*/
function sendValue(address payable recipient, uint256 amount) internal {
require(address(this).balance >= amount, "Address: insufficient balance");
(bool success, ) = recipient.call{value: amount}("");
require(success, "Address: unable to send value, recipient may have reverted");
}
/**
* @dev Performs a Solidity function call using a low level `call`. A
* plain `call` is an unsafe replacement for a function call: use this
* function instead.
*
* If `target` reverts with a revert reason, it is bubbled up by this
* function (like regular Solidity function calls).
*
* Returns the raw returned data. To convert to the expected return value,
* use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].
*
* Requirements:
*
* - `target` must be a contract.
* - calling `target` with `data` must not revert.
*
* _Available since v3.1._
*/
function functionCall(address target, bytes memory data) internal returns (bytes memory) {
return functionCallWithValue(target, data, 0, "Address: low-level call failed");
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with
* `errorMessage` as a fallback revert reason when `target` reverts.
*
* _Available since v3.1._
*/
function functionCall(
address target,
bytes memory data,
string memory errorMessage
) internal returns (bytes memory) {
return functionCallWithValue(target, data, 0, errorMessage);
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
* but also transferring `value` wei to `target`.
*
* Requirements:
*
* - the calling contract must have an ETH balance of at least `value`.
* - the called Solidity function must be `payable`.
*
* _Available since v3.1._
*/
function functionCallWithValue(
address target,
bytes memory data,
uint256 value
) internal returns (bytes memory) {
return functionCallWithValue(target, data, value, "Address: low-level call with value failed");
}
/**
* @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but
* with `errorMessage` as a fallback revert reason when `target` reverts.
*
* _Available since v3.1._
*/
function functionCallWithValue(
address target,
bytes memory data,
uint256 value,
string memory errorMessage
) internal returns (bytes memory) {
require(address(this).balance >= value, "Address: insufficient balance for call");
(bool success, bytes memory returndata) = target.call{value: value}(data);
return verifyCallResultFromTarget(target, success, returndata, errorMessage);
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
* but performing a static call.
*
* _Available since v3.3._
*/
function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {
return functionStaticCall(target, data, "Address: low-level static call failed");
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
* but performing a static call.
*
* _Available since v3.3._
*/
function functionStaticCall(
address target,
bytes memory data,
string memory errorMessage
) internal view returns (bytes memory) {
(bool success, bytes memory returndata) = target.staticcall(data);
return verifyCallResultFromTarget(target, success, returndata, errorMessage);
}
/**
* @dev Tool to verify that a low level call to smart-contract was successful, and revert (either by bubbling
* the revert reason or using the provided one) in case of unsuccessful call or if target was not a contract.
*
* _Available since v4.8._
*/
function verifyCallResultFromTarget(
address target,
bool success,
bytes memory returndata,
string memory errorMessage
) internal view returns (bytes memory) {
if (success) {
if (returndata.length == 0) {
// only check isContract if the call was successful and the return data is empty
// otherwise we already know that it was a contract
require(isContract(target), "Address: call to non-contract");
}
return returndata;
} else {
_revert(returndata, errorMessage);
}
}
/**
* @dev Tool to verify that a low level call was successful, and revert if it wasn't, either by bubbling the
* revert reason or using the provided one.
*
* _Available since v4.3._
*/
function verifyCallResult(
bool success,
bytes memory returndata,
string memory errorMessage
) internal pure returns (bytes memory) {
if (success) {
return returndata;
} else {
_revert(returndata, errorMessage);
}
}
function _revert(bytes memory returndata, string memory errorMessage) private pure {
// Look for revert reason and bubble it up if present
if (returndata.length > 0) {
// The easiest way to bubble the revert reason is using memory via assembly
/// @solidity memory-safe-assembly
assembly {
let returndata_size := mload(returndata)
revert(add(32, returndata), returndata_size)
}
} else {
revert(errorMessage);
}
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)
pragma solidity ^0.8.0;
import "../proxy/utils/Initializable.sol";
/**
* @dev Provides information about the current execution context, including the
* sender of the transaction and its data. While these are generally available
* via msg.sender and msg.data, they should not be accessed in such a direct
* manner, since when dealing with meta-transactions the account sending and
* paying for execution may not be the actual sender (as far as an application
* is concerned).
*
* This contract is only required for intermediate, library-like contracts.
*/
abstract contract ContextUpgradeable is Initializable {
function __Context_init() internal onlyInitializing {
}
function __Context_init_unchained() internal onlyInitializing {
}
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
function _msgData() internal view virtual returns (bytes calldata) {
return msg.data;
}
/**
* @dev This empty reserved space is put in place to allow future versions to add new
* variables without shifting down storage in the inheritance chain.
* See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps
*/
uint256[50] private __gap;
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.0) (utils/StorageSlot.sol)
pragma solidity ^0.8.0;
/**
* @dev Library for reading and writing primitive types to specific storage slots.
*
* Storage slots are often used to avoid storage conflict when dealing with upgradeable contracts.
* This library helps with reading and writing to such slots without the need for inline assembly.
*
* The functions in this library return Slot structs that contain a `value` member that can be used to read or write.
*
* Example usage to set ERC1967 implementation slot:
* ```
* contract ERC1967 {
* bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;
*
* function _getImplementation() internal view returns (address) {
* return StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value;
* }
*
* function _setImplementation(address newImplementation) internal {
* require(Address.isContract(newImplementation), "ERC1967: new implementation is not a contract");
* StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;
* }
* }
* ```
*
* _Available since v4.1 for `address`, `bool`, `bytes32`, and `uint256`._
*/
library StorageSlotUpgradeable {
struct AddressSlot {
address value;
}
struct BooleanSlot {
bool value;
}
struct Bytes32Slot {
bytes32 value;
}
struct Uint256Slot {
uint256 value;
}
/**
* @dev Returns an `AddressSlot` with member `value` located at `slot`.
*/
function getAddressSlot(bytes32 slot) internal pure returns (AddressSlot storage r) {
/// @solidity memory-safe-assembly
assembly {
r.slot := slot
}
}
/**
* @dev Returns an `BooleanSlot` with member `value` located at `slot`.
*/
function getBooleanSlot(bytes32 slot) internal pure returns (BooleanSlot storage r) {
/// @solidity memory-safe-assembly
assembly {
r.slot := slot
}
}
/**
* @dev Returns an `Bytes32Slot` with member `value` located at `slot`.
*/
function getBytes32Slot(bytes32 slot) internal pure returns (Bytes32Slot storage r) {
/// @solidity memory-safe-assembly
assembly {
r.slot := slot
}
}
/**
* @dev Returns an `Uint256Slot` with member `value` located at `slot`.
*/
function getUint256Slot(bytes32 slot) internal pure returns (Uint256Slot storage r) {
/// @solidity memory-safe-assembly
assembly {
r.slot := slot
}
}
}// SPDX-License-Identifier: MIT
pragma solidity ^0.8.19;
import {CheckInitialized} from "../utils/CheckInitialized.sol";
import {Ownable2StepUpgradeable} from "contracts-upgradeable/access/Ownable2StepUpgradeable.sol";
import {UUPSUpgradeable} from "contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol";
/// @title WorldID Proxy Contract Implementation
/// @author Worldcoin
/// @notice A router component that can dispatch group numbers to the correct identity manager
/// implementation.
/// @dev This is base class for implementations delegated to by a proxy.
abstract contract WorldIDImpl is Ownable2StepUpgradeable, UUPSUpgradeable, CheckInitialized {
///////////////////////////////////////////////////////////////////////////////
/// A NOTE ON IMPLEMENTATION CONTRACTS ///
///////////////////////////////////////////////////////////////////////////////
// This contract is designed explicitly to operate from behind a proxy contract. As a result,
// there are a few important implementation considerations:
//
// - All updates made after deploying a given version of the implementation should inherit from
// the latest version of the implementation. This prevents storage clashes.
// - All functions that are less access-restricted than `private` should be marked `virtual` in
// order to enable the fixing of bugs in the existing interface.
// - Any function that reads from or modifies state (i.e. is not marked `pure`) must be
// annotated with the `onlyProxy` and `onlyInitialized` modifiers. This ensures that it can
// only be called when it has access to the data in the proxy, otherwise results are likely to
// be nonsensical.
// - This contract deals with important data for the WorldID system. Ensure that all newly-added
// functionality is carefully access controlled using `onlyOwner`, or a more granular access
// mechanism.
// - Do not assign any contract-level variables at the definition site unless they are
// `constant`.
//
// Additionally, the following notes apply:
//
// - Initialisation and ownership management are not protected behind `onlyProxy` intentionally.
// This ensures that the contract can safely be disposed of after it is no longer used.
// - Carefully consider what data recovery options are presented as new functionality is added.
// Care must be taken to ensure that a migration plan can exist for cases where upgrades
// cannot recover from an issue or vulnerability.
///////////////////////////////////////////////////////////////////////////////
/// INITIALIZATION ///
///////////////////////////////////////////////////////////////////////////////
/// @notice Performs the initialisation steps necessary for the base contracts of this contract.
/// @dev Must be called during `initialize` before performing any additional steps.
function __WorldIDImpl_init() internal virtual onlyInitializing {
__Ownable_init();
__UUPSUpgradeable_init();
}
///////////////////////////////////////////////////////////////////////////////
/// ERRORS ///
///////////////////////////////////////////////////////////////////////////////
/// @notice Thrown when an attempt is made to renounce ownership.
error CannotRenounceOwnership();
///////////////////////////////////////////////////////////////////////////////
/// AUTHENTICATION ///
///////////////////////////////////////////////////////////////////////////////
/// @notice Is called when upgrading the contract to check whether it should be performed.
///
/// @param newImplementation The address of the implementation being upgraded to.
///
/// @custom:reverts string If the upgrade should not be performed.
function _authorizeUpgrade(address newImplementation)
internal
virtual
override
onlyProxy
onlyOwner
{
// No body needed as `onlyOwner` handles it.
}
/// @notice Ensures that ownership of WorldID implementations cannot be renounced.
/// @dev This function is intentionally not `virtual` as we do not want it to be possible to
/// renounce ownership for any WorldID implementation.
/// @dev This function is marked as `onlyOwner` to maintain the access restriction from the base
/// contract.
function renounceOwnership() public view override onlyOwner {
revert CannotRenounceOwnership();
}
}//SPDX-License-Identifier: MIT
pragma solidity ^0.8.19;
/// @title Base WorldID interface
/// @author Worldcoin
/// @notice The interface providing basic types across various WorldID contracts.
interface IBaseWorldID {
///////////////////////////////////////////////////////////////////////////////
/// ERRORS ///
///////////////////////////////////////////////////////////////////////////////
/// @notice Thrown when attempting to validate a root that has expired.
error ExpiredRoot();
/// @notice Thrown when attempting to validate a root that has yet to be added to the root
/// history.
error NonExistentRoot();
}//SPDX-License-Identifier: MIT
pragma solidity ^0.8.19;
import {IBaseWorldID} from "./IBaseWorldID.sol";
/// @title WorldID Interface
/// @author Worldcoin
/// @notice The interface to the proof verification for WorldID.
interface IWorldID is IBaseWorldID {
/// @notice Verifies a WorldID zero knowledge proof.
/// @dev Note that a double-signaling check is not included here, and should be carried by the
/// caller.
/// @dev It is highly recommended that the implementation is restricted to `view` if possible.
///
/// @param root The of the Merkle tree
/// @param signalHash A keccak256 hash of the Semaphore signal
/// @param nullifierHash The nullifier hash
/// @param externalNullifierHash A keccak256 hash of the external nullifier
/// @param proof The zero-knowledge proof
///
/// @custom:reverts string If the `proof` is invalid.
function verifyProof(
uint256 root,
uint256 signalHash,
uint256 nullifierHash,
uint256 externalNullifierHash,
uint256[8] calldata proof
) external;
}//SPDX-License-Identifier: MIT
pragma solidity ^0.8.19;
import {IBaseWorldID} from "./IBaseWorldID.sol";
/// @title WorldID Interface with Groups
/// @author Worldcoin
/// @notice The interface to the proof verification for WorldID.
interface IWorldIDGroups is IBaseWorldID {
/// @notice Verifies a WorldID zero knowledge proof.
/// @dev Note that a double-signaling check is not included here, and should be carried by the
/// caller.
/// @dev It is highly recommended that the implementation is restricted to `view` if possible.
///
/// @param groupId The group identifier for the group to verify a proof for.
/// @param root The of the Merkle tree
/// @param signalHash A keccak256 hash of the Semaphore signal
/// @param nullifierHash The nullifier hash
/// @param externalNullifierHash A keccak256 hash of the external nullifier
/// @param proof The zero-knowledge proof
///
/// @custom:reverts string If the `proof` is invalid.
/// @custom:reverts NoSuchGroup If the provided `groupId` references a group that does not exist.
function verifyProof(
uint256 root,
uint256 groupId,
uint256 signalHash,
uint256 nullifierHash,
uint256 externalNullifierHash,
uint256[8] calldata proof
) external;
}// SPDX-License-Identifier: MIT
pragma solidity ^0.8.19;
import {Initializable} from "contracts-upgradeable/proxy/utils/Initializable.sol";
/// @title Initialization Checker
/// @author Worldcoin
/// @notice A contract that represents the ability to initialize a proxy-based contract but also to
/// check that said contract is initialized.
contract CheckInitialized is Initializable {
/// @notice Whether the initialization has been completed.
/// @dev This relies on the fact that a default-init `bool` is `false` here.
bool private _initialized;
/// @notice Thrown when attempting to call a function while the implementation has not been
/// initialized.
error ImplementationNotInitialized();
/// @notice Sets the contract as initialized.
function __setInitialized() internal onlyInitializing {
_initialized = true;
}
/// @notice Asserts that the annotated function can only be called once the contract has been
/// initialized.
modifier onlyInitialized() {
if (!_initialized) {
revert ImplementationNotInitialized();
}
_;
}
/**
* @dev This empty reserved space is put in place to allow future versions to add new
* variables without shifting down storage in the inheritance chain.
* See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps
*/
uint256[49] private __gap;
}{
"remappings": [
"@zk-kit/=lib/zk-kit/packages/",
"contracts-upgradeable/=lib/openzeppelin-contracts-upgradeable/contracts/",
"ds-test/=lib/ds-test/src/",
"erc4626-tests/=lib/openzeppelin-contracts/lib/erc4626-tests/",
"forge-std/=lib/forge-std/src/",
"openzeppelin-contracts-upgradeable/=lib/openzeppelin-contracts-upgradeable/",
"openzeppelin-contracts/=lib/openzeppelin-contracts/contracts/",
"openzeppelin/=lib/openzeppelin-contracts/contracts/",
"semaphore/=lib/semaphore/packages/contracts/contracts/",
"solmate/=lib/solmate/src/",
"zk-kit/=lib/zk-kit/"
],
"optimizer": {
"enabled": true,
"runs": 200,
"details": {
"peephole": true,
"inliner": true,
"deduplicate": true,
"cse": true,
"yul": true
}
},
"metadata": {
"bytecodeHash": "ipfs",
"appendCBOR": true
},
"outputSelection": {
"*": {
"*": [
"evm.bytecode",
"evm.deployedBytecode",
"devdoc",
"userdoc",
"metadata",
"abi"
]
}
},
"evmVersion": "london",
"libraries": {}
}Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
Contract ABI
API[{"inputs":[],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"CannotRenounceOwnership","type":"error"},{"inputs":[],"name":"ExpiredRoot","type":"error"},{"inputs":[],"name":"GroupIsDisabled","type":"error"},{"inputs":[],"name":"ImplementationNotInitialized","type":"error"},{"inputs":[{"internalType":"uint256","name":"groupId","type":"uint256"}],"name":"NoSuchGroup","type":"error"},{"inputs":[],"name":"NonExistentRoot","type":"error"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"previousAdmin","type":"address"},{"indexed":false,"internalType":"address","name":"newAdmin","type":"address"}],"name":"AdminChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"beacon","type":"address"}],"name":"BeaconUpgraded","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"groupId","type":"uint256"},{"indexed":true,"internalType":"address","name":"identityManager","type":"address"}],"name":"GroupAdded","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"groupId","type":"uint256"}],"name":"GroupDisabled","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"contract IWorldID","name":"initialGroupIdentityManager","type":"address"}],"name":"GroupIdentityManagerRouterImplInitialized","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"groupId","type":"uint256"},{"indexed":true,"internalType":"address","name":"oldIdentityManager","type":"address"},{"indexed":true,"internalType":"address","name":"newIdentityManager","type":"address"}],"name":"GroupUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint8","name":"version","type":"uint8"}],"name":"Initialized","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferStarted","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"implementation","type":"address"}],"name":"Upgraded","type":"event"},{"inputs":[],"name":"acceptOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract IWorldID","name":"groupIdentityManager","type":"address"}],"name":"addGroup","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"groupId","type":"uint256"}],"name":"disableGroup","outputs":[{"internalType":"contract IWorldID","name":"oldTarget","type":"address"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"groupCount","outputs":[{"internalType":"uint256","name":"count","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"contract IWorldID","name":"initialGroupIdentityManager","type":"address"}],"name":"initialize","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pendingOwner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"proxiableUUID","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"groupNumber","type":"uint256"}],"name":"routeFor","outputs":[{"internalType":"contract IWorldID","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"groupId","type":"uint256"},{"internalType":"contract IWorldID","name":"newTargetAddress","type":"address"}],"name":"updateGroup","outputs":[{"internalType":"contract IWorldID","name":"oldTarget","type":"address"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newImplementation","type":"address"}],"name":"upgradeTo","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newImplementation","type":"address"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"upgradeToAndCall","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"uint256","name":"root","type":"uint256"},{"internalType":"uint256","name":"groupId","type":"uint256"},{"internalType":"uint256","name":"signalHash","type":"uint256"},{"internalType":"uint256","name":"nullifierHash","type":"uint256"},{"internalType":"uint256","name":"externalNullifierHash","type":"uint256"},{"internalType":"uint256[8]","name":"proof","type":"uint256[8]"}],"name":"verifyProof","outputs":[],"stateMutability":"nonpayable","type":"function"}]Contract Creation Code
60a06040523060805234801561001457600080fd5b5061001d610022565b6100e2565b600054610100900460ff161561008e5760405162461bcd60e51b815260206004820152602760248201527f496e697469616c697a61626c653a20636f6e747261637420697320696e697469604482015266616c697a696e6760c81b606482015260840160405180910390fd5b60005460ff90811610156100e0576000805460ff191660ff9081179091556040519081527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b565b608051611b05610197600039600081816102c70152818161031001528181610398015281816103d8015281816104d80152818161051801528181610594015281816106de0152818161071e015281816107fe0152818161083e015281816108cb0152818161090b01528181610c2201528181610c6201528181610d2b01528181610d6b01528181610e6101528181610ea1015281816110f001528181611130015281816112c201526113020152611b056000f3fe6080604052600436106100e85760003560e01c80638da5cb5b1161008a578063e30c397811610059578063e30c39781461023f578063f2fde38b1461025d578063f73b9f221461027d578063f9515f1b1461029d57600080fd5b80638da5cb5b146101cc5780638f23b326146101ea578063bbe0d986146101ff578063c4d66de81461021f57600080fd5b806352d1902d116100c657806352d1902d14610142578063715018a61461016a57806379ba50971461017f57806384ac1e621461019457600080fd5b80633659cfe6146100ed5780633bc778e31461010f5780634f1ef2861461012f575b600080fd5b3480156100f957600080fd5b5061010d610108366004611737565b6102bd565b005b34801561011b57600080fd5b5061010d61012a366004611754565b61038e565b61010d61013d3660046117c5565b6104ce565b34801561014e57600080fd5b50610157610587565b6040519081526020015b60405180910390f35b34801561017657600080fd5b5061010d61063a565b34801561018b57600080fd5b5061010d61065b565b3480156101a057600080fd5b506101b46101af366004611889565b6106d2565b6040516001600160a01b039091168152602001610161565b3480156101d857600080fd5b506033546001600160a01b03166101b4565b3480156101f657600080fd5b506101576107f2565b34801561020b57600080fd5b506101b461021a3660046118b9565b6108bf565b34801561022b57600080fd5b5061010d61023a366004611737565b610a2f565b34801561024b57600080fd5b506065546001600160a01b03166101b4565b34801561026957600080fd5b5061010d610278366004611737565b610ba5565b34801561028957600080fd5b506101b46102983660046118b9565b610c16565b3480156102a957600080fd5b5061010d6102b8366004611737565b610d21565b6001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016300361030e5760405162461bcd60e51b8152600401610305906118d2565b60405180910390fd5b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316610340610e3b565b6001600160a01b0316146103665760405162461bcd60e51b81526004016103059061191e565b61036f81610e57565b6040805160008082526020820190925261038b91839190610eff565b50565b6001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001630036103d65760405162461bcd60e51b8152600401610305906118d2565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316610408610e3b565b6001600160a01b03161461042e5760405162461bcd60e51b81526004016103059061191e565b60fb5460ff1661045157604051630103019560e11b815260040160405180910390fd5b600061045c866108bf565b6040516301aa650960e51b81529091506001600160a01b0382169063354ca12090610493908a90899089908990899060040161196a565b600060405180830381600087803b1580156104ad57600080fd5b505af11580156104c1573d6000803e3d6000fd5b5050505050505050505050565b6001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001630036105165760405162461bcd60e51b8152600401610305906118d2565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316610548610e3b565b6001600160a01b03161461056e5760405162461bcd60e51b81526004016103059061191e565b61057782610e57565b61058382826001610eff565b5050565b6000306001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016146106275760405162461bcd60e51b815260206004820152603860248201527f555550535570677261646561626c653a206d757374206e6f742062652063616c60448201527f6c6564207468726f7567682064656c656761746563616c6c00000000000000006064820152608401610305565b50600080516020611a8983398151915290565b61064261106f565b6040516377aeb0ad60e01b815260040160405180910390fd5b60655433906001600160a01b031681146106c95760405162461bcd60e51b815260206004820152602960248201527f4f776e61626c6532537465703a2063616c6c6572206973206e6f7420746865206044820152683732bb9037bbb732b960b91b6064820152608401610305565b61038b816110cb565b60006001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016300361071c5760405162461bcd60e51b8152600401610305906118d2565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031661074e610e3b565b6001600160a01b0316146107745760405162461bcd60e51b81526004016103059061191e565b60fb5460ff1661079757604051630103019560e11b815260040160405180910390fd5b61079f61106f565b6107a983836110e4565b9050816001600160a01b0316816001600160a01b0316847f7caadb1a7c9ec3ef16bf4ad07008c903ec36d555827ff758212d1f8bf906ad1260405160405180910390a492915050565b60006001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016300361083c5760405162461bcd60e51b8152600401610305906118d2565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031661086e610e3b565b6001600160a01b0316146108945760405162461bcd60e51b81526004016103059061191e565b60fb5460ff166108b757604051630103019560e11b815260040160405180910390fd5b5061012d5490565b60006001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001630036109095760405162461bcd60e51b8152600401610305906118d2565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031661093b610e3b565b6001600160a01b0316146109615760405162461bcd60e51b81526004016103059061191e565b60fb5460ff1661098457604051630103019560e11b815260040160405180910390fd5b61098c6107f2565b82106109ae576040516339456f4960e11b815260048101839052602401610305565b60006001600160a01b031661012d83815481106109cd576109cd61199b565b6000918252602090912001546001600160a01b031603610a0057604051630958e77760e31b815260040160405180910390fd5b61012d8281548110610a1457610a1461199b565b6000918252602090912001546001600160a01b031692915050565b600054600190610100900460ff16158015610a51575060005460ff8083169116105b610ab45760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b6064820152608401610305565b6000805461ffff191660ff831617610100179055610ad0611253565b61012d80546001810182556000919091527f193a3ae4da5049eb74cee39e4cf5827f7ce7b1d1d1775ef1c6311eb60558e6d50180546001600160a01b0319166001600160a01b038416179055610b24611282565b6040516001600160a01b03831681527f40bf88254d4e5b06619e430e259e4b502d1b4da7369339025596a9206879867e9060200160405180910390a16000805461ff001916905560405160ff821681527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15050565b610bad61106f565b606580546001600160a01b0383166001600160a01b03199091168117909155610bde6033546001600160a01b031690565b6001600160a01b03167f38d16b8cac22d99fc7c124b9cd0de2d3fa1faef420bfe791d8c362d765e2270060405160405180910390a350565b60006001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000163003610c605760405162461bcd60e51b8152600401610305906118d2565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316610c92610e3b565b6001600160a01b031614610cb85760405162461bcd60e51b81526004016103059061191e565b60fb5460ff16610cdb57604051630103019560e11b815260040160405180910390fd5b610ce361106f565b610cee8260006110e4565b60405190915082907fd80e1e836ad428e388ec8f855edd512d56d58bf942ac36d08934a3d49ec3b30190600090a2919050565b6001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000163003610d695760405162461bcd60e51b8152600401610305906118d2565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316610d9b610e3b565b6001600160a01b031614610dc15760405162461bcd60e51b81526004016103059061191e565b60fb5460ff16610de457604051630103019560e11b815260040160405180910390fd5b610dec61106f565b6000610df66107f2565b9050610e01826112b8565b6040516001600160a01b0383169082907f798d9cdeda10ca361ffa1519bf19e23cb5fda7f3ec138b3efe5b9002c1d2488390600090a35050565b600080516020611a89833981519152546001600160a01b031690565b6001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000163003610e9f5760405162461bcd60e51b8152600401610305906118d2565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316610ed1610e3b565b6001600160a01b031614610ef75760405162461bcd60e51b81526004016103059061191e565b61038b61106f565b7f4910fdfa16fed3260ed0e7147f7cc6da11a60208b5b9406d12a635614ffd91435460ff1615610f3757610f32836113ce565b505050565b826001600160a01b03166352d1902d6040518163ffffffff1660e01b8152600401602060405180830381865afa925050508015610f91575060408051601f3d908101601f19168201909252610f8e918101906119b1565b60015b610ff45760405162461bcd60e51b815260206004820152602e60248201527f45524331393637557067726164653a206e657720696d706c656d656e7461746960448201526d6f6e206973206e6f74205555505360901b6064820152608401610305565b600080516020611a8983398151915281146110635760405162461bcd60e51b815260206004820152602960248201527f45524331393637557067726164653a20756e737570706f727465642070726f786044820152681a58589b195555525160ba1b6064820152608401610305565b50610f3283838361146a565b6033546001600160a01b031633146110c95760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610305565b565b606580546001600160a01b031916905561038b81611495565b60006001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016300361112e5760405162461bcd60e51b8152600401610305906118d2565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316611160610e3b565b6001600160a01b0316146111865760405162461bcd60e51b81526004016103059061191e565b60fb5460ff166111a957604051630103019560e11b815260040160405180910390fd5b6111b161106f565b6111b96107f2565b83106111db576040516339456f4960e11b815260048101849052602401610305565b61012d83815481106111ef576111ef61199b565b60009182526020909120015461012d80546001600160a01b03909216925083918590811061121f5761121f61199b565b9060005260206000200160006101000a8154816001600160a01b0302191690836001600160a01b0316021790555092915050565b600054610100900460ff1661127a5760405162461bcd60e51b8152600401610305906119ca565b6110c96114e7565b600054610100900460ff166112a95760405162461bcd60e51b8152600401610305906119ca565b60fb805460ff19166001179055565b6001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001630036113005760405162461bcd60e51b8152600401610305906118d2565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316611332610e3b565b6001600160a01b0316146113585760405162461bcd60e51b81526004016103059061191e565b60fb5460ff1661137b57604051630103019560e11b815260040160405180910390fd5b61012d80546001810182556000919091527f193a3ae4da5049eb74cee39e4cf5827f7ce7b1d1d1775ef1c6311eb60558e6d50180546001600160a01b0319166001600160a01b0392909216919091179055565b6001600160a01b0381163b61143b5760405162461bcd60e51b815260206004820152602d60248201527f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60448201526c1bdd08184818dbdb9d1c9858dd609a1b6064820152608401610305565b600080516020611a8983398151915280546001600160a01b0319166001600160a01b0392909216919091179055565b6114738361151e565b6000825111806114805750805b15610f325761148f838361155e565b50505050565b603380546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b600054610100900460ff1661150e5760405162461bcd60e51b8152600401610305906119ca565b611516611652565b6110c9611681565b611527816113ce565b6040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b60606001600160a01b0383163b6115c65760405162461bcd60e51b815260206004820152602660248201527f416464726573733a2064656c65676174652063616c6c20746f206e6f6e2d636f6044820152651b9d1c9858dd60d21b6064820152608401610305565b600080846001600160a01b0316846040516115e19190611a39565b600060405180830381855af49150503d806000811461161c576040519150601f19603f3d011682016040523d82523d6000602084013e611621565b606091505b50915091506116498282604051806060016040528060278152602001611aa9602791396116a8565b95945050505050565b600054610100900460ff166116795760405162461bcd60e51b8152600401610305906119ca565b6110c96116c8565b600054610100900460ff166110c95760405162461bcd60e51b8152600401610305906119ca565b606083156116b75750816116c1565b6116c183836116f8565b9392505050565b600054610100900460ff166116ef5760405162461bcd60e51b8152600401610305906119ca565b6110c9336110cb565b8151156117085781518083602001fd5b8060405162461bcd60e51b81526004016103059190611a55565b6001600160a01b038116811461038b57600080fd5b60006020828403121561174957600080fd5b81356116c181611722565b6000806000806000806101a080888a03121561176f57600080fd5b873596506020880135955060408801359450606088013593506080880135925088818901111561179e57600080fd5b5060a0870190509295509295509295565b634e487b7160e01b600052604160045260246000fd5b600080604083850312156117d857600080fd5b82356117e381611722565b9150602083013567ffffffffffffffff8082111561180057600080fd5b818501915085601f83011261181457600080fd5b813581811115611826576118266117af565b604051601f8201601f19908116603f0116810190838211818310171561184e5761184e6117af565b8160405282815288602084870101111561186757600080fd5b8260208601602083013760006020848301015280955050505050509250929050565b6000806040838503121561189c57600080fd5b8235915060208301356118ae81611722565b809150509250929050565b6000602082840312156118cb57600080fd5b5035919050565b6020808252602c908201527f46756e6374696f6e206d7573742062652063616c6c6564207468726f7567682060408201526b19195b1959d85d1958d85b1b60a21b606082015260800190565b6020808252602c908201527f46756e6374696f6e206d7573742062652063616c6c6564207468726f7567682060408201526b6163746976652070726f787960a01b606082015260800190565b6000610180820190508682528560208301528460408301528360608301526101008360808401379695505050505050565b634e487b7160e01b600052603260045260246000fd5b6000602082840312156119c357600080fd5b5051919050565b6020808252602b908201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960408201526a6e697469616c697a696e6760a81b606082015260800190565b60005b83811015611a30578181015183820152602001611a18565b50506000910152565b60008251611a4b818460208701611a15565b9190910192915050565b6020815260008251806020840152611a74816040850160208701611a15565b601f01601f1916919091016040019291505056fe360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564a2646970667358221220ebbb83bd91c8ce606e8f85a7bc353c915c69beafb02a6ccb6bbc489dc9803ada64736f6c63430008130033
Deployed Bytecode
0x6080604052600436106100e85760003560e01c80638da5cb5b1161008a578063e30c397811610059578063e30c39781461023f578063f2fde38b1461025d578063f73b9f221461027d578063f9515f1b1461029d57600080fd5b80638da5cb5b146101cc5780638f23b326146101ea578063bbe0d986146101ff578063c4d66de81461021f57600080fd5b806352d1902d116100c657806352d1902d14610142578063715018a61461016a57806379ba50971461017f57806384ac1e621461019457600080fd5b80633659cfe6146100ed5780633bc778e31461010f5780634f1ef2861461012f575b600080fd5b3480156100f957600080fd5b5061010d610108366004611737565b6102bd565b005b34801561011b57600080fd5b5061010d61012a366004611754565b61038e565b61010d61013d3660046117c5565b6104ce565b34801561014e57600080fd5b50610157610587565b6040519081526020015b60405180910390f35b34801561017657600080fd5b5061010d61063a565b34801561018b57600080fd5b5061010d61065b565b3480156101a057600080fd5b506101b46101af366004611889565b6106d2565b6040516001600160a01b039091168152602001610161565b3480156101d857600080fd5b506033546001600160a01b03166101b4565b3480156101f657600080fd5b506101576107f2565b34801561020b57600080fd5b506101b461021a3660046118b9565b6108bf565b34801561022b57600080fd5b5061010d61023a366004611737565b610a2f565b34801561024b57600080fd5b506065546001600160a01b03166101b4565b34801561026957600080fd5b5061010d610278366004611737565b610ba5565b34801561028957600080fd5b506101b46102983660046118b9565b610c16565b3480156102a957600080fd5b5061010d6102b8366004611737565b610d21565b6001600160a01b037f00000000000000000000000011ca3127182f7583efc416a8771bd4d11fae433416300361030e5760405162461bcd60e51b8152600401610305906118d2565b60405180910390fd5b7f00000000000000000000000011ca3127182f7583efc416a8771bd4d11fae43346001600160a01b0316610340610e3b565b6001600160a01b0316146103665760405162461bcd60e51b81526004016103059061191e565b61036f81610e57565b6040805160008082526020820190925261038b91839190610eff565b50565b6001600160a01b037f00000000000000000000000011ca3127182f7583efc416a8771bd4d11fae43341630036103d65760405162461bcd60e51b8152600401610305906118d2565b7f00000000000000000000000011ca3127182f7583efc416a8771bd4d11fae43346001600160a01b0316610408610e3b565b6001600160a01b03161461042e5760405162461bcd60e51b81526004016103059061191e565b60fb5460ff1661045157604051630103019560e11b815260040160405180910390fd5b600061045c866108bf565b6040516301aa650960e51b81529091506001600160a01b0382169063354ca12090610493908a90899089908990899060040161196a565b600060405180830381600087803b1580156104ad57600080fd5b505af11580156104c1573d6000803e3d6000fd5b5050505050505050505050565b6001600160a01b037f00000000000000000000000011ca3127182f7583efc416a8771bd4d11fae43341630036105165760405162461bcd60e51b8152600401610305906118d2565b7f00000000000000000000000011ca3127182f7583efc416a8771bd4d11fae43346001600160a01b0316610548610e3b565b6001600160a01b03161461056e5760405162461bcd60e51b81526004016103059061191e565b61057782610e57565b61058382826001610eff565b5050565b6000306001600160a01b037f00000000000000000000000011ca3127182f7583efc416a8771bd4d11fae433416146106275760405162461bcd60e51b815260206004820152603860248201527f555550535570677261646561626c653a206d757374206e6f742062652063616c60448201527f6c6564207468726f7567682064656c656761746563616c6c00000000000000006064820152608401610305565b50600080516020611a8983398151915290565b61064261106f565b6040516377aeb0ad60e01b815260040160405180910390fd5b60655433906001600160a01b031681146106c95760405162461bcd60e51b815260206004820152602960248201527f4f776e61626c6532537465703a2063616c6c6572206973206e6f7420746865206044820152683732bb9037bbb732b960b91b6064820152608401610305565b61038b816110cb565b60006001600160a01b037f00000000000000000000000011ca3127182f7583efc416a8771bd4d11fae433416300361071c5760405162461bcd60e51b8152600401610305906118d2565b7f00000000000000000000000011ca3127182f7583efc416a8771bd4d11fae43346001600160a01b031661074e610e3b565b6001600160a01b0316146107745760405162461bcd60e51b81526004016103059061191e565b60fb5460ff1661079757604051630103019560e11b815260040160405180910390fd5b61079f61106f565b6107a983836110e4565b9050816001600160a01b0316816001600160a01b0316847f7caadb1a7c9ec3ef16bf4ad07008c903ec36d555827ff758212d1f8bf906ad1260405160405180910390a492915050565b60006001600160a01b037f00000000000000000000000011ca3127182f7583efc416a8771bd4d11fae433416300361083c5760405162461bcd60e51b8152600401610305906118d2565b7f00000000000000000000000011ca3127182f7583efc416a8771bd4d11fae43346001600160a01b031661086e610e3b565b6001600160a01b0316146108945760405162461bcd60e51b81526004016103059061191e565b60fb5460ff166108b757604051630103019560e11b815260040160405180910390fd5b5061012d5490565b60006001600160a01b037f00000000000000000000000011ca3127182f7583efc416a8771bd4d11fae43341630036109095760405162461bcd60e51b8152600401610305906118d2565b7f00000000000000000000000011ca3127182f7583efc416a8771bd4d11fae43346001600160a01b031661093b610e3b565b6001600160a01b0316146109615760405162461bcd60e51b81526004016103059061191e565b60fb5460ff1661098457604051630103019560e11b815260040160405180910390fd5b61098c6107f2565b82106109ae576040516339456f4960e11b815260048101839052602401610305565b60006001600160a01b031661012d83815481106109cd576109cd61199b565b6000918252602090912001546001600160a01b031603610a0057604051630958e77760e31b815260040160405180910390fd5b61012d8281548110610a1457610a1461199b565b6000918252602090912001546001600160a01b031692915050565b600054600190610100900460ff16158015610a51575060005460ff8083169116105b610ab45760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b6064820152608401610305565b6000805461ffff191660ff831617610100179055610ad0611253565b61012d80546001810182556000919091527f193a3ae4da5049eb74cee39e4cf5827f7ce7b1d1d1775ef1c6311eb60558e6d50180546001600160a01b0319166001600160a01b038416179055610b24611282565b6040516001600160a01b03831681527f40bf88254d4e5b06619e430e259e4b502d1b4da7369339025596a9206879867e9060200160405180910390a16000805461ff001916905560405160ff821681527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15050565b610bad61106f565b606580546001600160a01b0383166001600160a01b03199091168117909155610bde6033546001600160a01b031690565b6001600160a01b03167f38d16b8cac22d99fc7c124b9cd0de2d3fa1faef420bfe791d8c362d765e2270060405160405180910390a350565b60006001600160a01b037f00000000000000000000000011ca3127182f7583efc416a8771bd4d11fae4334163003610c605760405162461bcd60e51b8152600401610305906118d2565b7f00000000000000000000000011ca3127182f7583efc416a8771bd4d11fae43346001600160a01b0316610c92610e3b565b6001600160a01b031614610cb85760405162461bcd60e51b81526004016103059061191e565b60fb5460ff16610cdb57604051630103019560e11b815260040160405180910390fd5b610ce361106f565b610cee8260006110e4565b60405190915082907fd80e1e836ad428e388ec8f855edd512d56d58bf942ac36d08934a3d49ec3b30190600090a2919050565b6001600160a01b037f00000000000000000000000011ca3127182f7583efc416a8771bd4d11fae4334163003610d695760405162461bcd60e51b8152600401610305906118d2565b7f00000000000000000000000011ca3127182f7583efc416a8771bd4d11fae43346001600160a01b0316610d9b610e3b565b6001600160a01b031614610dc15760405162461bcd60e51b81526004016103059061191e565b60fb5460ff16610de457604051630103019560e11b815260040160405180910390fd5b610dec61106f565b6000610df66107f2565b9050610e01826112b8565b6040516001600160a01b0383169082907f798d9cdeda10ca361ffa1519bf19e23cb5fda7f3ec138b3efe5b9002c1d2488390600090a35050565b600080516020611a89833981519152546001600160a01b031690565b6001600160a01b037f00000000000000000000000011ca3127182f7583efc416a8771bd4d11fae4334163003610e9f5760405162461bcd60e51b8152600401610305906118d2565b7f00000000000000000000000011ca3127182f7583efc416a8771bd4d11fae43346001600160a01b0316610ed1610e3b565b6001600160a01b031614610ef75760405162461bcd60e51b81526004016103059061191e565b61038b61106f565b7f4910fdfa16fed3260ed0e7147f7cc6da11a60208b5b9406d12a635614ffd91435460ff1615610f3757610f32836113ce565b505050565b826001600160a01b03166352d1902d6040518163ffffffff1660e01b8152600401602060405180830381865afa925050508015610f91575060408051601f3d908101601f19168201909252610f8e918101906119b1565b60015b610ff45760405162461bcd60e51b815260206004820152602e60248201527f45524331393637557067726164653a206e657720696d706c656d656e7461746960448201526d6f6e206973206e6f74205555505360901b6064820152608401610305565b600080516020611a8983398151915281146110635760405162461bcd60e51b815260206004820152602960248201527f45524331393637557067726164653a20756e737570706f727465642070726f786044820152681a58589b195555525160ba1b6064820152608401610305565b50610f3283838361146a565b6033546001600160a01b031633146110c95760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610305565b565b606580546001600160a01b031916905561038b81611495565b60006001600160a01b037f00000000000000000000000011ca3127182f7583efc416a8771bd4d11fae433416300361112e5760405162461bcd60e51b8152600401610305906118d2565b7f00000000000000000000000011ca3127182f7583efc416a8771bd4d11fae43346001600160a01b0316611160610e3b565b6001600160a01b0316146111865760405162461bcd60e51b81526004016103059061191e565b60fb5460ff166111a957604051630103019560e11b815260040160405180910390fd5b6111b161106f565b6111b96107f2565b83106111db576040516339456f4960e11b815260048101849052602401610305565b61012d83815481106111ef576111ef61199b565b60009182526020909120015461012d80546001600160a01b03909216925083918590811061121f5761121f61199b565b9060005260206000200160006101000a8154816001600160a01b0302191690836001600160a01b0316021790555092915050565b600054610100900460ff1661127a5760405162461bcd60e51b8152600401610305906119ca565b6110c96114e7565b600054610100900460ff166112a95760405162461bcd60e51b8152600401610305906119ca565b60fb805460ff19166001179055565b6001600160a01b037f00000000000000000000000011ca3127182f7583efc416a8771bd4d11fae43341630036113005760405162461bcd60e51b8152600401610305906118d2565b7f00000000000000000000000011ca3127182f7583efc416a8771bd4d11fae43346001600160a01b0316611332610e3b565b6001600160a01b0316146113585760405162461bcd60e51b81526004016103059061191e565b60fb5460ff1661137b57604051630103019560e11b815260040160405180910390fd5b61012d80546001810182556000919091527f193a3ae4da5049eb74cee39e4cf5827f7ce7b1d1d1775ef1c6311eb60558e6d50180546001600160a01b0319166001600160a01b0392909216919091179055565b6001600160a01b0381163b61143b5760405162461bcd60e51b815260206004820152602d60248201527f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60448201526c1bdd08184818dbdb9d1c9858dd609a1b6064820152608401610305565b600080516020611a8983398151915280546001600160a01b0319166001600160a01b0392909216919091179055565b6114738361151e565b6000825111806114805750805b15610f325761148f838361155e565b50505050565b603380546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b600054610100900460ff1661150e5760405162461bcd60e51b8152600401610305906119ca565b611516611652565b6110c9611681565b611527816113ce565b6040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b60606001600160a01b0383163b6115c65760405162461bcd60e51b815260206004820152602660248201527f416464726573733a2064656c65676174652063616c6c20746f206e6f6e2d636f6044820152651b9d1c9858dd60d21b6064820152608401610305565b600080846001600160a01b0316846040516115e19190611a39565b600060405180830381855af49150503d806000811461161c576040519150601f19603f3d011682016040523d82523d6000602084013e611621565b606091505b50915091506116498282604051806060016040528060278152602001611aa9602791396116a8565b95945050505050565b600054610100900460ff166116795760405162461bcd60e51b8152600401610305906119ca565b6110c96116c8565b600054610100900460ff166110c95760405162461bcd60e51b8152600401610305906119ca565b606083156116b75750816116c1565b6116c183836116f8565b9392505050565b600054610100900460ff166116ef5760405162461bcd60e51b8152600401610305906119ca565b6110c9336110cb565b8151156117085781518083602001fd5b8060405162461bcd60e51b81526004016103059190611a55565b6001600160a01b038116811461038b57600080fd5b60006020828403121561174957600080fd5b81356116c181611722565b6000806000806000806101a080888a03121561176f57600080fd5b873596506020880135955060408801359450606088013593506080880135925088818901111561179e57600080fd5b5060a0870190509295509295509295565b634e487b7160e01b600052604160045260246000fd5b600080604083850312156117d857600080fd5b82356117e381611722565b9150602083013567ffffffffffffffff8082111561180057600080fd5b818501915085601f83011261181457600080fd5b813581811115611826576118266117af565b604051601f8201601f19908116603f0116810190838211818310171561184e5761184e6117af565b8160405282815288602084870101111561186757600080fd5b8260208601602083013760006020848301015280955050505050509250929050565b6000806040838503121561189c57600080fd5b8235915060208301356118ae81611722565b809150509250929050565b6000602082840312156118cb57600080fd5b5035919050565b6020808252602c908201527f46756e6374696f6e206d7573742062652063616c6c6564207468726f7567682060408201526b19195b1959d85d1958d85b1b60a21b606082015260800190565b6020808252602c908201527f46756e6374696f6e206d7573742062652063616c6c6564207468726f7567682060408201526b6163746976652070726f787960a01b606082015260800190565b6000610180820190508682528560208301528460408301528360608301526101008360808401379695505050505050565b634e487b7160e01b600052603260045260246000fd5b6000602082840312156119c357600080fd5b5051919050565b6020808252602b908201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960408201526a6e697469616c697a696e6760a81b606082015260800190565b60005b83811015611a30578181015183820152602001611a18565b50506000910152565b60008251611a4b818460208701611a15565b9190910192915050565b6020815260008251806020840152611a74816040850160208701611a15565b601f01601f1916919091016040019291505056fe360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564a2646970667358221220ebbb83bd91c8ce606e8f85a7bc353c915c69beafb02a6ccb6bbc489dc9803ada64736f6c63430008130033
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 ]
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.