Skip to content

Commit

Permalink
Change owner to identityOperator (#549)
Browse files Browse the repository at this point in the history
  • Loading branch information
Dzejkop authored Nov 6, 2023
1 parent 687e9c4 commit 47383dd
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
1 change: 1 addition & 0 deletions src/contracts/abi.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ abigen!(
function deleteIdentities(uint256[8] calldata deletionProof, bytes calldata packedDeletionIndices, uint256 preRoot, uint256 postRoot) public virtual
function latestRoot() public view virtual returns (uint256 root)
function owner() public view virtual returns (address)
function identityOperator() public view virtual returns (address)
function queryRoot(uint256 root) public view virtual returns (RootInfo memory)
function getRootHistoryExpiry() external view returns (uint256)
]"#,
Expand Down
9 changes: 5 additions & 4 deletions src/contracts/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -102,14 +102,15 @@ impl IdentityManager {
ethereum.provider().clone(),
);

let owner = abi.owner().call().await?;
if owner != ethereum.address() {
error!(?owner, signer = ?ethereum.address(), "Signer is not the owner of the identity manager contract.");
let operator = abi.identity_operator().call().await?;
if operator != ethereum.address() {
error!(?operator, signer = ?ethereum.address(), "Signer is not the identity operator of the identity manager contract.");
panic!("Cannot currently continue in read-only mode.")
}

info!(
?address,
?owner,
?operator,
"Connected to the WorldID Identity Manager"
);

Expand Down

0 comments on commit 47383dd

Please sign in to comment.