npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@swisstronik/sdi-contracts

v1.1.1

Published

Swisstronik SDI contracts

Downloads

3

Readme

Swisstronik SDI Contracts

Overview

Contracts to interact witht the compliance module.

It's designed for managing issuer records and verifying user compliance based on various criteria. It leverages the OpenZeppelin library for secure contract upgradeability and ownership management. The contract interacts with the compliance module/bridge to verify user data against issuer records.

Features

  • Issuer Management: Add, update, and remove issuer records securely.
  • User Verification: Verify users based on compliance criteria such as AML (Anti-Money Laundering) checks and humanity verification.
  • Data Retrieval: List issuer records and verification data for users.
  • Upgradeability: Utilizes OpenZeppelin's upgradeable contracts for future improvements without losing state.

Integration

In your solidity repository, run npm i @swisstronik/sdi-contracts


pragma solidity ^0.8.24;

import {ISWTRProxy} from "@swisstronik/sdi-contracts/contracts/interfaces/ISWTRProxy.sol";

contract Sample {
    ISWTRProxy public swtrProxy;
    
    constructor(ISWTRProxy _swtrProxy) { swtrProxy = _swtrProxy; }

    function isUserVerified(
        address user,
        ISWTRProxy.VerificationType verificationType
    ) public view returns (bool) {
      return swtrProxy.isUserVerified(user, verificationType);
    }

}

Functions

Issuer Management

  • addIssuersRecord(string[] memory name, uint32[] memory version, address[] memory issuerAddress): Adds multiple issuer records.
  • removeIssuerRecord(string memory name, uint32 version): Removes an issuer record.
  • function getIssuerRecordByAddress(address issuerAddress): Gets the issuer record by its address.
  • getIssuerAddressesByNameAndVersions(string memory name, uint32[] memory version): Get list of Issuer addresses by their name and versions
  • updateIssuerRecord(address issuerAddress, string memory name): Updates the name of an issuer.
  • listIssuersRecord(uint256 start, uint256 end): Lists issuer records within a specified range.
  • issuerRecordCount(): Returns the total number of issuer records.

User Verification

  • isUserVerified(address userAddress, IComplianceBridge.VerificationType verificationType): Checks if a user is verified based on a specific verification type.
  • isUserVerifiedBy(address userAddress, IComplianceBridge.VerificationType verificationType, address[] memory allowedIssuers): Checks if a user is verified by specific issuers.
  • listVerificationData(address userAddress, address issuerAddress): Lists verification data for a user by an issuer.
  • getVerificationDataById(address userAddress, address issuerAddress, bytes memory verificationId): Retrieves verification data by ID.
  • getVerificationCountry(address userAddress, address issuerAddress, IComplianceBridge.VerificationType verificationType): Retrieves the country associated with a verification.
  • passedVerificationType(address userAddress, address issuerAddress, IComplianceBridge.VerificationType verificationType): Checks if a user has passed a specific verification type.
  • isUserHuman(address userAddress, address issuerAddress): Checks if a user has passed humanity verification.
  • walletPassedAML(address userAddress, address issuerAddress): Checks if a user's wallet has passed AML checks.

Data Decoding

  • decodeQuadrataPassportV1OriginalData(bytes memory originalData): Decodes data for Quadrata Passport V1.
  • decodeWorldcoinV1OriginalData(bytes memory originalData): Decodes data for Worldcoin V1.

Build

npx hardhat compile

Deploy

npx hardhat run scripts/deploy.ts --network testnet

Deployed Contracts

| Contract | Address | |------------|--------------------------------------------| | ProxyAdmin | 0x96e3ba5a33d21f64E5504Fd964656d1535a87F7e | | SWTRProxy | 0xBF896E5616d12fE6Bd7a376D2DBb924ff531CFDF |