Files
smom-dbis-138/contracts/emoney/libraries/AccountHashing.sol
defiQUG cad927816e
Some checks failed
CI/CD Pipeline / Solidity Contracts (push) Failing after 1m20s
CI/CD Pipeline / Security Scanning (push) Successful in 2m48s
CI/CD Pipeline / Lint and Format (push) Failing after 47s
CI/CD Pipeline / Terraform Validation (push) Failing after 28s
CI/CD Pipeline / Kubernetes Validation (push) Successful in 30s
HYBX OMNL TypeScript & anchor / token-aggregation build + reconcile artifact (push) Failing after 44s
Validation / validate-genesis (push) Successful in 37s
Validation / validate-terraform (push) Failing after 42s
Validation / validate-kubernetes (push) Failing after 12s
Validation / validate-smart-contracts (push) Failing after 16m44s
Validation / validate-security (push) Failing after 20s
Validation / validate-documentation (push) Failing after 19s
Verify Deployment / Verify Deployment (push) Failing after 1m21s
fix(token-list): align cUSDC_V2/cUSDT_V2 logoURI with registry policy
Use dedicated cusdc_v2/cusdt_v2 SVG paths so GRU token alignment validation passes.
2026-06-30 15:31:55 -07:00

52 lines
1.9 KiB
Solidity

// SPDX-License-Identifier: MIT
pragma solidity ^0.8.19;
/**
* @title AccountHashing
* @notice Utilities for hashing account identifiers with salts to protect PII
*/
library AccountHashing {
/**
* @notice Generates a hashed account reference ID
* @param rail The payment rail identifier (e.g., "FEDWIRE", "SEPA")
* @param countryCode The country code (e.g., "US", "DE")
* @param accountIdentifier The account identifier (IBAN, ABA, etc.) - should be hashed off-chain
* @param salt A unique salt for this account
* @return accountRefId The hashed account reference ID
*/
function hashAccountRef(
bytes32 rail,
bytes32 countryCode,
bytes32 accountIdentifier,
bytes32 salt
) internal pure returns (bytes32 accountRefId) {
return keccak256(abi.encodePacked(rail, countryCode, accountIdentifier, salt));
}
/**
* @notice Generates a hashed wallet reference ID
* @param chainId The chain ID where the wallet exists
* @param walletAddress The wallet address
* @param providerId The provider identifier (e.g., "METAMASK", "FIREBLOCKS")
* @return walletRefId The hashed wallet reference ID
*/
function hashWalletRef(
uint256 chainId,
address walletAddress,
bytes32 providerId
) internal pure returns (bytes32 walletRefId) {
return keccak256(abi.encodePacked(chainId, walletAddress, providerId));
}
/**
* @notice Generates an ICAN (Internal Canonical Account Number) reference ID
* @param namespace The internal namespace identifier
* @param accountId The internal account ID
* @return icanRefId The ICAN reference ID
*/
function hashICANRef(bytes32 namespace, bytes32 accountId) internal pure returns (bytes32 icanRefId) {
return keccak256(abi.encodePacked(namespace, accountId));
}
}