From 0cb5b1bd8923f5d52409fd8dee003204d3dabd06 Mon Sep 17 00:00:00 2001 From: Ramon Recuero Date: Thu, 4 Jan 2024 10:43:12 -0800 Subject: [PATCH] Adds hasTrait to viewer --- src/interfaces/IKYCViewer.sol | 2 ++ src/viewers/KYCViewer.sol | 4 ++++ test/KYCViewer.t.sol | 1 + 3 files changed, 7 insertions(+) diff --git a/src/interfaces/IKYCViewer.sol b/src/interfaces/IKYCViewer.sol index 63b241cb..fecd3173 100644 --- a/src/interfaces/IKYCViewer.sol +++ b/src/interfaces/IKYCViewer.sol @@ -17,6 +17,8 @@ interface IKYCViewer { function isIndividual(address _account) external view returns (bool); + function hasTrait(address _account, uint8 _traitId) external view returns (bool); + /* ============ Constants and attrs ============ */ function kintoID() external view returns (IKintoID); diff --git a/src/viewers/KYCViewer.sol b/src/viewers/KYCViewer.sol index 0da007c6..99ee7a03 100644 --- a/src/viewers/KYCViewer.sol +++ b/src/viewers/KYCViewer.sol @@ -72,6 +72,10 @@ contract KYCViewer is Initializable, UUPSUpgradeable, OwnableUpgradeable, IKYCVi return kintoID.isIndividual(_getFinalAddress(_account)); } + function hasTrait(address _account, uint8 _traitId) external view returns (bool) { + return kintoID.hasTrait(_getFinalAddress(_account), _traitId); + } + /* ============ Helpers ============ */ function _getFinalAddress(address _address) private view returns (address) { diff --git a/test/KYCViewer.t.sol b/test/KYCViewer.t.sol index b8372fe8..ee6bec70 100644 --- a/test/KYCViewer.t.sol +++ b/test/KYCViewer.t.sol @@ -104,5 +104,6 @@ contract KYCViewerTest is Create2Helper, UserOp, AATestScaffolding { assertEq(_kycViewer.isKYC(address(_kintoWalletv1)), _kycViewer.isKYC(_owner)); assertEq(_kycViewer.isIndividual(address(_kintoWalletv1)), _kycViewer.isIndividual(_owner)); assertEq(_kycViewer.isCompany(address(_kintoWalletv1)), false); + assertEq(_kycViewer.hasTrait(address(_kintoWalletv1), 6), false); } }