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

KYC Sanction Expiration #320

Merged
merged 9 commits into from
Dec 6, 2024
Merged

KYC Sanction Expiration #320

merged 9 commits into from
Dec 6, 2024

Conversation

ylv-io
Copy link
Collaborator

@ylv-io ylv-io commented Nov 27, 2024

Description

This pull request introduces several enhancements and modifications to the KintoID contract, focusing on governance, sanction management, and role definitions. It also updates the IKintoID interface to reflect these changes.

Implementation Details:

  • Added a new constant GOVERNANCE_ROLE to define a governance role within the contract.
  • Introduced two new immutable addresses: walletFactory and faucet, which are now public and override existing definitions.
  • Deprecated the walletFactory address by making it private and adding a notice for its deprecation.
  • Added a new mapping sanctionedAt to track the timestamp of the last sanction applied to each user.
  • Updated the revokeKYC function to set the sanctionedAt timestamp to the current block timestamp when a KYC is revoked.
  • Modified the addSanction function to update the sanctionedAt timestamp when a sanction is added.
  • Enhanced the isKYC function to include logic for checking if an account is sanctions safe and handling the 3-day confirmation period for sanctions.
  • Updated the isSanctionsSafe function to incorporate the 3-day confirmation logic for sanctions and to check if an account is monitored for sanctions.
  • Introduced a new function confirmSanction that allows the governance role to reset the sanction timestamp, making the sanction indefinite.
  • Corrected a typo in the isIndividual function's return description from "indivdual" to "individual".
  • Updated the IKintoID interface to include the new GOVERNANCE_ROLE function.

Type of change

  • Bug fix
  • New feature
  • Breaking change
  • Dependency changes
  • Deployment
  • Forge Script
  • Code refactor / cleanup
  • Documentation or wording changes
  • Other

Checklist:

  • The diff is legible and has no extraneous changes
  • Complex code has been commented, including external interfaces
  • Tests have 100% code coverage
  • The base branch is either main, or there's a description of how to merge

Issue Resolution

@ylv-io ylv-io changed the title KYC Expiration KYC Sanction Expiration Nov 27, 2024
Copy link

openzeppelin-code bot commented Nov 27, 2024

KYC Sanction Expiration

Generated at commit: 7e2f2d1003f6f8fc77587bc31c99ded200a042f6

🚨 Report Summary

Severity Level Results
Contracts Critical
High
Medium
Low
Note
Total
4
2
0
12
39
57
Dependencies Critical
High
Medium
Low
Note
Total
0
0
0
0
0
0

For more details view the full report in OpenZeppelin Code Inspector

src/KintoID.sol Outdated Show resolved Hide resolved
src/KintoID.sol Outdated
@@ -343,7 +357,24 @@ contract KintoID is
* @return true if the account has KYC token.
*/
function isKYC(address _account) external view override returns (bool) {
return balanceOf(_account) > 0 && isSanctionsSafe(_account);
if (balanceOf(_account) == 0) {
// If the account doesn't have a KYC token
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe we should just return false in this case, if there is no NFT it should be false

src/KintoID.sol Outdated Show resolved Hide resolved
Copy link

Slither report

THIS CHECKLIST IS NOT COMPLETE. Use --show-ignored-findings to show all the results.
Summary

Copy link

codecov bot commented Nov 28, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 89.04%. Comparing base (ae284ac) to head (7a226c7).
Report is 2 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #320      +/-   ##
==========================================
- Coverage   90.57%   89.04%   -1.53%     
==========================================
  Files          41       41              
  Lines        2016     2483     +467     
==========================================
+ Hits         1826     2211     +385     
- Misses        190      272      +82     
Files with missing lines Coverage Δ
src/KintoID.sol 98.77% <100.00%> (-0.43%) ⬇️

... and 40 files with indirect coverage changes

src/KintoID.sol Outdated Show resolved Hide resolved
src/KintoID.sol Outdated Show resolved Hide resolved
@ylv-io ylv-io merged commit 178f922 into main Dec 6, 2024
1 check failed
@rrecuero rrecuero deleted the feat/kyc-expiration branch December 6, 2024 23:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants