Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

10 days exit window period for sanctions monitor #326

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/KintoID.sol
Original file line number Diff line number Diff line change
Expand Up @@ -455,7 +455,7 @@ contract KintoID is
* @param _days Number of days to consider for monitoring freshness
* @return bool True if sanctions were monitored within the specified period
*/
function isSanctionsMonitored(uint32 _days) public view virtual override returns (bool) {
function isSanctionsMonitored(uint256 _days) public view virtual override returns (bool) {
return block.timestamp - lastMonitoredAt < _days * (1 days);
}

Expand All @@ -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(7)
return isSanctionsMonitored(EXIT_WINDOW_PERIOD)
&& (
_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(7)
return isSanctionsMonitored(EXIT_WINDOW_PERIOD)
&& (
!_kycmetas[_account].sanctions.get(_countryId)
|| (sanctionedAt[_account] != 0 && (block.timestamp - sanctionedAt[_account]) > SANCTION_EXPIRY_PERIOD)
Expand Down
2 changes: 1 addition & 1 deletion src/interfaces/IKintoID.sol
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ interface IKintoID {

function isKYC(address _account) external view returns (bool);

function isSanctionsMonitored(uint32 _days) external view returns (bool);
function isSanctionsMonitored(uint256 _days) external view returns (bool);

function isSanctionsSafe(address _account) external view returns (bool);

Expand Down
2 changes: 1 addition & 1 deletion test/harness/KintoIdHarness.sol
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import {KintoID} from "@kinto-core/KintoID.sol";
contract KintoIdHarness is KintoID {
constructor(address _walletFactory, address _faucet) KintoID(_walletFactory, _faucet) {}

function isSanctionsMonitored(uint32) public view virtual override returns (bool) {
function isSanctionsMonitored(uint256) public view virtual override returns (bool) {
return true;
}
}
Loading