Skip to content

Commit

Permalink
Merge 6b2474f into d1e5236
Browse files Browse the repository at this point in the history
  • Loading branch information
ylv-io authored Feb 6, 2025
2 parents d1e5236 + 6b2474f commit f098cd0
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/KintoID.sol
Original file line number Diff line number Diff line change
Expand Up @@ -467,7 +467,7 @@ contract KintoID is
*/
function isSanctionsSafe(address _account) public view virtual override returns (bool) {
// If the sanction is not confirmed within SANCTION_EXPIRY_PERIOD, consider the account sanctions safe
return isSanctionsMonitored(EXIT_WINDOW_PERIOD)
return isSanctionsMonitored(EXIT_WINDOW_PERIOD / (1 days))
&& (
_kycmetas[_account].sanctionsCount == 0
|| (sanctionedAt[_account] != 0 && (block.timestamp - sanctionedAt[_account]) > SANCTION_EXPIRY_PERIOD)
Expand All @@ -483,7 +483,7 @@ contract KintoID is
*/
function isSanctionsSafeIn(address _account, uint16 _countryId) external view virtual override returns (bool) {
// If the sanction is not confirmed within SANCTION_EXPIRY_PERIOD, consider the account sanctions safe
return isSanctionsMonitored(EXIT_WINDOW_PERIOD)
return isSanctionsMonitored(EXIT_WINDOW_PERIOD / (1 days))
&& (
!_kycmetas[_account].sanctions.get(_countryId)
|| (sanctionedAt[_account] != 0 && (block.timestamp - sanctionedAt[_account]) > SANCTION_EXPIRY_PERIOD)
Expand Down
13 changes: 13 additions & 0 deletions test/unit/KintoID.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -256,6 +256,19 @@ contract KintoIDTest is SharedSetup {
_kintoID.monitor(new address[](0), new IKintoID.MonitorUpdateData[][](0));
}

function testIsKYC_WhenMonitorExpires() public {
IKintoID.SignatureData memory sigdata = _auxCreateSignature(_kintoID, _user, _userPk, block.timestamp + 1000);
uint16[] memory traits = new uint16[](0);
vm.startPrank(_kycProvider);
_kintoID.mintIndividualKyc(sigdata, traits);

assertEq(_kintoID.isKYC(_user), true);

vm.warp(block.timestamp + 11 days);

assertEq(_kintoID.isKYC(_user), false);
}

function testIsSanctionsMonitored() public {
vm.prank(_kycProvider);
_kintoID.monitor(new address[](0), new IKintoID.MonitorUpdateData[][](0));
Expand Down

0 comments on commit f098cd0

Please sign in to comment.