Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions contracts/verifiers/AnonAadhaarCredentialIssuer.sol
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ error InvalidIssuerDidHash();
error InvalidExpirationDate(uint256 expected, uint256 provided);
error ProofExpired();
error InvalidPubKeyHash();
error NullifierAlreadyExists();
error NullifierDoesNotExist();
error InvalidVerifierAddress();
error InvalidStateContractAddress();
Expand All @@ -39,7 +38,7 @@ event AnonAadhaarCircuitVerifierUpdated(string circuitId, address verifierAddres
contract AnonAadhaarCredentialIssuer is IdentityBase, Ownable2StepUpgradeable {
using IdentityLib for IdentityLib.Data;

string public constant VERSION = "1.0.2";
string public constant VERSION = "1.0.3";
string private constant defaultCircuitId = "anon_aadhaar_v1";

struct StateInfo {
Expand Down Expand Up @@ -428,7 +427,6 @@ contract AnonAadhaarCredentialIssuer is IdentityBase, Ownable2StepUpgradeable {
if (expirationDate <= block.timestamp) revert ProofExpired();
if (!$.publicKeysHashes[pubKeyHash]) revert InvalidPubKeyHash();
if (!$.qrVersions[qrVersion]) revert UnsupportedQrVersion(qrVersion);
if ($._nullifiersToRevocationNonce[nullifier] != 0) revert NullifierAlreadyExists();
}

function _addHashAndTransit(uint256 hi, uint256 hv) internal {
Expand All @@ -439,6 +437,11 @@ contract AnonAadhaarCredentialIssuer is IdentityBase, Ownable2StepUpgradeable {
function _setNullifier(uint256 nullifier, uint64 revocationNonce) private {
if (revocationNonce == 0) revert InvalidRevocationNonce(revocationNonce);
AnonAadhaarCredentialIssuerStorage storage $ = _getAnonAadhaarCredentialIssuerStorage();
uint64 existingNonce = $._nullifiersToRevocationNonce[nullifier];
if (existingNonce != 0) {
_getIdentityBaseStorage().identity.revokeClaim(existingNonce);
emit CredentialRevoked(nullifier, existingNonce);
}
$._nullifiersToRevocationNonce[nullifier] = revocationNonce;
}

Expand Down
11 changes: 6 additions & 5 deletions contracts/verifiers/PassportCredentialIssuer.sol
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ error IssuanceDateExpired(uint256 issuanceDate);
error IssuanceDateInFuture(uint256 issuanceDate);
error CurrentDateExpired(uint256 currentDate);
error CurrentDateInFuture(uint256 currentDate);
error NullifierAlreadyExists(uint256 nullifier);
error NullifierDoesNotExist(uint256 nullifier);
error LengthMismatch(uint256 length1, uint256 length2);
error NoVerifierSet();
Expand Down Expand Up @@ -49,7 +48,7 @@ contract PassportCredentialIssuer is IdentityBase, EIP712Upgradeable, Ownable2St
/**
* @dev Version of the contract
*/
string public constant VERSION = "1.0.2";
string public constant VERSION = "1.0.3";

/**
* @dev Version of EIP 712 domain
Expand Down Expand Up @@ -547,9 +546,6 @@ contract PassportCredentialIssuer is IdentityBase, EIP712Upgradeable, Ownable2St
revert IssuanceDateInFuture(issuanceDate);

if ($._issuerDidHash != issuerDidHash) revert InvalidIssuerDidHash();

if ($._nullifiersToRevocationNonce[nullifier] != 0)
revert NullifierAlreadyExists(nullifier);
}

function _addHashAndTransit(uint256 hi, uint256 hv) internal {
Expand All @@ -565,6 +561,11 @@ contract PassportCredentialIssuer is IdentityBase, EIP712Upgradeable, Ownable2St
function _setNullifier(uint256 nullifier, uint64 revocationNonce) internal {
if (revocationNonce == 0) revert InvalidRevocationNonce(revocationNonce);
PassportCredentialIssuerStorage storage $ = _getPassportCredentialIssuerStorage();
uint64 existingNonce = $._nullifiersToRevocationNonce[nullifier];
if (existingNonce != 0) {
_getIdentityBaseStorage().identity.revokeClaim(existingNonce);
emit CredentialRevoked(nullifier, existingNonce);
}
$._nullifiersToRevocationNonce[nullifier] = revocationNonce;
}

Expand Down
4 changes: 2 additions & 2 deletions helpers/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -392,13 +392,13 @@ export const contractsInfo = Object.freeze({
},
PASSPORT_CREDENTIAL_ISSUER: {
name: "PassportCredentialIssuer",
version: "1.0.2",
version: "1.0.3",
unifiedAddress: "0x167aCF1529176C04AacE628FC0ae4883D8462929",
create2Calldata: ethers.hexlify(ethers.toUtf8Bytes("iden3.create2.PassportCredentialIssuer")),
},
ANONAADHAAR_CREDENTIAL_ISSUER: {
name: "AnonAadhaarCredentialIssuer",
version: "1.0.2",
version: "1.0.3",
unifiedAddress: "0xC450Bd8705DF646a14F54b1a86b5E6De55dFEe66",
create2Calldata: ethers.hexlify(
ethers.toUtf8Bytes("iden3.create2.AnonAadhaarCredentialIssuer"),
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"_format": "hh-sol-dbg-1",
"buildInfo": "../build-info/d783ac14720c03d5b1aae55aa59adc85.json"
}
Loading
Loading