WorldIDRouterImplV1

World Chain

0x17b354dd2595411ff79041f930e491a4df39a278

Proxy 實作合約: 0x4055b6d4018e92e4d000865e61e87b57a4e5ab49

Solidity v0.8.21+commit.d9974bed

🤖
透過你的 AI 查詢此合約
參考: 0x17b354dd2595411ff79041f930e491a4df39a278
範例提示詞: "Tell me the current state of world/0x17b354dd2595411ff79041f930e491a4df39a278"
還沒有接入 AI?→ mcp.smarts.md
World Chain 在 Smarts 上是僅文件鏈:原始碼和 ABI 已索引,但目前不提供即時鏈上資料(狀態、最新事件、管理員概覽)。AI 代理仍可透過 MCP 呼叫 get_contract_info 和 get_contract_source。

概覽

讀取函式
6
寫入函式
9
事件
10

讀取函式

groupCount() view

Gets the number of groups in the routing table.

回傳值

名稱 類型 描述
count uint256 count The number of groups in the table.
owner() view

Returns the address of the contract owner.✨ AI

開發者: Returns the address of the current owner.

回傳值

名稱 類型 描述
address The owner address with permission to perform administrative actions on the contract.✨ AI
pendingOwner() view

Returns the address nominated to become the contract owner.✨ AI

開發者: Returns the address of the pending owner.

回傳值

名稱 類型 描述
address The address nominated to become owner, or the zero address if no nomination is pending.✨ AI
proxiableUUID() view

Returns the proxiable UUID that identifies the implementation storage slot for upgradeability.✨ AI

開發者: 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.

回傳值

名稱 類型 描述
bytes32 bytes32 UUID that identifies the EIP-1822 implementation storage slot used by the proxy.✨ AI
renounceOwnership() view

Ensures that ownership of WorldID implementations cannot be renounced.

開發者: This function is marked as `onlyOwner` to maintain the access restriction from the base contract.
routeFor(groupNumber: uint256) view

Gets the route for the provided group number.

參數

名稱 類型 描述
groupNumber uint256 The number of the group to get the route for.

回傳值

名稱 類型 描述
address target The target address for the group number.

寫入函式

acceptOwnership() nonpayable

Completes the transfer of contract ownership to the caller after a pending ownership transfer was initiated.✨ AI

開發者: The new owner accepts the ownership transfer.
addGroup(groupIdentityManager: address) nonpayable

Adds a group to the router.

開發者: 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.

參數

名稱 類型 描述
groupIdentityManager address 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.
disableGroup(groupId: uint256) nonpayable

Disables the target group in the router.

參數

名稱 類型 描述
groupId uint256 The identifier for the group to be disabled.

回傳值

名稱 類型 描述
oldTarget address oldTarget The old target address for the group.
initialize(initialGroupIdentityManager: address) nonpayable

Initializes the contract.

開發者: This function is explicitly not virtual as it does not make sense to override even when upgrading. Create a separate initializer function instead.

參數

名稱 類型 描述
initialGroupIdentityManager address The address of the identity manager to be used for the initial group (group ID 0) when instantiating the router.
transferOwnership(newOwner: address) nonpayable

Transfers contract ownership to the specified new owner address.✨ AI

開發者: 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.

參數

名稱 類型 描述
newOwner address Address that will become the new contract owner.✨ AI
updateGroup(groupId: uint256, newTargetAddress: address) nonpayable

Updates the target address for a group in the router.

開發者: It is perfectly valid to update a group with a target address of 0 in order to disable it.

參數

名稱 類型 描述
groupId uint256 The identitifier for the group to have its target address updated.
newTargetAddress address The new target address for the group in routing. If this is set to the null address the group will be disabled.

回傳值

名稱 類型 描述
oldTarget address oldTarget The old target address for the group.
upgradeTo(newImplementation: address) nonpayable

Upgrade the router to a new implementation contract address.✨ AI

開發者: Upgrade the implementation of the proxy to `newImplementation`. Calls {_authorizeUpgrade}. Emits an {Upgraded} event.

參數

名稱 類型 描述
newImplementation address Address of the new implementation contract.✨ AI
upgradeToAndCall(newImplementation: address, data: bytes) payable

Upgrade the contract implementation to newImplementation and immediately execute an encoded call with data, allowing ETH.✨ AI

開發者: Upgrade the implementation of the proxy to `newImplementation`, and subsequently execute the function call encoded in `data`. Calls {_authorizeUpgrade}. Emits an {Upgraded} event.

參數

名稱 類型 描述
newImplementation address Address of the new implementation contract to upgrade to.✨ AI
data bytes ABI-encoded call data executed on the new implementation after the upgrade; may be empty.✨ AI
verifyProof(root: uint256, groupId: uint256, signalHash: uint256, nullifierHash: uint256, externalNullifierHash: uint256, proof: uint256[8]) nonpayable

Verifies a WorldID zero knowledge proof.

開發者: Note that a double-signaling check is not included here, and should be carried by the caller.

參數

名稱 類型 描述
root uint256 The of the Merkle tree
groupId uint256 The group identifier for the group to verify a proof for.
signalHash uint256 A keccak256 hash of the Semaphore signal
nullifierHash uint256 The nullifier hash
externalNullifierHash uint256 A keccak256 hash of the external nullifier
proof uint256[8] The zero-knowledge proof

事件

AdminChanged(previousAdmin: address, newAdmin: address)
名稱 類型 已索引 描述
previousAdmin address
newAdmin address
BeaconUpgraded(beacon: address)
名稱 類型 已索引 描述
beacon address
GroupAdded(groupId: uint256, identityManager: address)

Emitted when a group is added to the router.

名稱 類型 已索引 描述
groupId uint256 The identifier for the group.
identityManager address The address of the identity manager associated with the group.
GroupDisabled(groupId: uint256)

Emitted when a group is disabled in the router.

名稱 類型 已索引 描述
groupId uint256 The identifier of the group that has been disabled.
GroupIdentityManagerRouterImplInitialized(initialGroupIdentityManager: address)

Emitted when a group is enabled in the router.

名稱 類型 已索引 描述
initialGroupIdentityManager address The address of the identity manager to be used for the first group
GroupUpdated(groupId: uint256, oldIdentityManager: address, newIdentityManager: address)

Emitted when a group is updated in the router.

名稱 類型 已索引 描述
groupId uint256 The identitfier for the group.
oldIdentityManager address The address of the previous identity manager associated with the group.
newIdentityManager address The address of the new identity manager associated with the group.
Initialized(version: uint8)
名稱 類型 已索引 描述
version uint8
OwnershipTransferStarted(previousOwner: address, newOwner: address)
名稱 類型 已索引 描述
previousOwner address
newOwner address
OwnershipTransferred(previousOwner: address, newOwner: address)
名稱 類型 已索引 描述
previousOwner address
newOwner address
Upgraded(implementation: address)
名稱 類型 已索引 描述
implementation address