Skip to content

Commit

Permalink
remove convert credential - can only be called by the user directly t…
Browse files Browse the repository at this point in the history
…o precompile
  • Loading branch information
delneg committed Feb 6, 2025
1 parent cadbea4 commit a2d835e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 22 deletions.
23 changes: 2 additions & 21 deletions contracts/BaseIssuerAdapter.sol
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@ contract BaseIssuerAdapter is Ownable, IssuerAdapter {
// Event now includes the verificationId in addition to the user address.
event UserVerified(address userAddress, bytes verificationId);
event VerificationRevoked(address userAddress, bytes verificationId);
event CredentialConverted(bytes verificationId);


function withdraw() external payable onlyOwner {
uint256 balance = address(this).balance;
Expand All @@ -22,8 +20,6 @@ contract BaseIssuerAdapter is Ownable, IssuerAdapter {
require(success, "Withdrawal failed");
}



/**
* @notice Unified function to mark a user as verified using a single struct of parameters.
* @param params A struct containing all necessary parameters.
Expand All @@ -33,7 +29,7 @@ contract BaseIssuerAdapter is Ownable, IssuerAdapter {
VerificationParams memory params
) public onlyOwner returns (bytes memory verificationId) {
// Compute the issuance timestamp based on current block time.
uint32 issuanceTimestamp = uint32(block.timestamp % 2**32);
uint32 issuanceTimestamp = uint32(block.timestamp % 2 ** 32);
bytes memory payload;
if (params.publicKey == bytes32(0)) {
// Call the V1 addVerificationDetails method.
Expand Down Expand Up @@ -77,7 +73,6 @@ contract BaseIssuerAdapter is Ownable, IssuerAdapter {
return verificationId;
}


/**
* @notice Revokes a verification.
* @param userAddress The address of the user whose verification is to be revoked.
Expand All @@ -93,23 +88,9 @@ contract BaseIssuerAdapter is Ownable, IssuerAdapter {
emit VerificationRevoked(userAddress, verificationId);
}

/**
* @notice Converts a credential by calling the ComplianceBridge.
* @param verificationId The verification id to convert.
* @param publicKey The public key to include in the conversion.
*/
function convertCredential(bytes memory verificationId, bytes32 publicKey) public {
bytes memory payload = abi.encodeCall(
IComplianceBridge.convertCredential,
(verificationId, abi.encodePacked(publicKey))
);
(bool success, bytes memory data) = address(1028).call(payload);
require(success, string(abi.encodePacked("Convert credential failed: ", data)));
emit CredentialConverted(verificationId);
}


function getSupportedTypes() external pure returns (ISWTRProxy.VerificationType[] memory) {
function getSupportedTypes() external public pure returns (ISWTRProxy.VerificationType[] memory) {
ISWTRProxy.VerificationType[] memory types;
return types;
}
Expand Down
1 change: 0 additions & 1 deletion contracts/interfaces/IssuerAdapter.sol
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,4 @@ interface IssuerAdapter {
function getSupportedTypes() external pure returns (ISWTRProxy.VerificationType[] memory);
function markAsVerified(VerificationParams memory params) external returns (bytes memory);
function revokeVerification(address userAddress, bytes memory verificationId) external;
function convertCredential(bytes memory verificationId, bytes32 publicKey) external;
}

0 comments on commit a2d835e

Please sign in to comment.