Skip to content

Commit

Permalink
Merge pull request #27 from KintoXYZ/viewer-has-trait
Browse files Browse the repository at this point in the history
Adds hasTrait to viewer
  • Loading branch information
rrecuero authored Jan 4, 2024
2 parents 6cc4ac7 + 0cb5b1b commit 86fa905
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/interfaces/IKYCViewer.sol
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
4 changes: 4 additions & 0 deletions src/viewers/KYCViewer.sol
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
1 change: 1 addition & 0 deletions test/KYCViewer.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}

0 comments on commit 86fa905

Please sign in to comment.