Skip to content

Commit

Permalink
feat: new kyc criteria (#404)
Browse files Browse the repository at this point in the history
### Description

Update the KYC credentials to required level(plus) and expected
countries(DRC, CUBA, GB, IRAN, DPKR, MALI, MYANMAR, SOUTH SUDAN, SYRIA,
US, YEMEN)
Blacklisted regions that are not countries will be blocked by fractal
using an exception

### Other changes

No

### Tested

- Current tests are updated
- Signature that returns from fractal is verified to work with the
updated claim function
- It will be tested with forked-integration tests after a new deployment

### Related issues

- Fixes [291](#291)
  • Loading branch information
baroooo authored Apr 2, 2024
1 parent d174c8a commit 8713527
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 10 deletions.
11 changes: 3 additions & 8 deletions contracts/governance/Airgrab.sol
Original file line number Diff line number Diff line change
Expand Up @@ -93,14 +93,9 @@ contract Airgrab is ReentrancyGuard {
";",
Strings.toString(validUntil),
";",
// TODO: if we parameterize this at the contract level
// it has to go in storage because solidity only supports
// immutable base types. One way to work around this would
// be to record a hash of this string as an immutable
// value during initialization and then pass the actual
// string from the caller and just verify its hash.
// Otherwise we can just keep it static here.
"level:plus;residency_not:ca,us"
// ISO 3166-1 alpha-2 country codes
// DRC, CUBA, GB, IRAN, DPKR, MALI, MYANMAR, SOUTH SUDAN, SYRIA, US, YEMEN
"level:plus+liveness;citizenship_not:;residency_not:cd,cu,gb,ir,kp,ml,mm,ss,sy,us,ye"
)
);

Expand Down
3 changes: 2 additions & 1 deletion test/governance/Airgrab.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,8 @@ contract AirgrabTest is Test {
uint32 public constant MAX_SLOPE_PERIOD = 104;

/// @notice see https://github.com/trustfractal/credentials-api-verifiers#setup
string constant EXPECTED_CREDENTIAL = "level:plus;residency_not:ca,us";
string constant EXPECTED_CREDENTIAL =
"level:plus+liveness;citizenship_not:;residency_not:cd,cu,gb,ir,kp,ml,mm,ss,sy,us,ye";
string constant OTHER_CREDENTIAL = "level:plus;residency_not:de";

Airgrab public airgrab;
Expand Down
3 changes: 2 additions & 1 deletion test/governance/IntegrationTests/GovernanceIntegration.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,8 @@ contract GovernanceIntegrationTest is TestSetup {
uint96 public claimer1Amount = 20_000e18;
bytes32[] public claimer1Proof = Arrays.bytes32s(0x0294d3fc355e136dd6fea7f5c2934dd7cb67c2b4607110780e5fbb23d65d7ac4);

string public constant EXPECTED_CREDENTIAL = "level:plus;residency_not:ca,us";
string public constant EXPECTED_CREDENTIAL =
"level:plus+liveness;citizenship_not:;residency_not:cd,cu,gb,ir,kp,ml,mm,ss,sy,us,ye";

modifier s_governance() {
vm.prank(governanceTimelockAddress);
Expand Down

0 comments on commit 8713527

Please sign in to comment.