Quadrata Integration
  • INTRODUCTION
    • Introduction to Quadrata
    • Passport Attributes
  • HOW TO INTEGRATE
    • Quadrata SDK
      • Get Started Quickly
      • Advanced
        • Installation
        • SDK Configuration
        • Onboarding Example
        • Client Libraries
          • Client Configuration
          • Client Lazy Loading
          • Client Eager Loading
          • Client Helper Component
          • Client React Hooks
            • useOnboardStatus
          • Client Examples
            • With Wagmi Connect
            • KYC Only
            • KYB Only
            • All In One
        • API Libraries
          • API Configuration
          • API Service Options
          • API Service Libraries
            • Create Access Token
            • Create Privacy Access Token
            • Fetch Attribute Values
            • Fetch Onboard Status
            • Fetch Passport List
            • Fetch Privacy Data
            • Fetch Privacy Grants
            • Fetch Wallet Screening
            • Revoke Privacy Grants
    • Onboard users
      • Individual Passport Onboarding
        • 1. Installation
        • 2. API Authentication
        • 3. API Onboard Status
        • 4. QuadClient Package
        • 5. Privacy Data Permissions
        • 6. Full Example
      • Business Passport Onboarding
        • 1. Installation
        • 2. API Authentication
        • 3. QuadrataKyb Package
        • 4. Privacy Data Permissions
        • 5. Full Example
      • All-In-One Passport Onboarding
        • 1. Installation
        • 2. API Authentication
        • 3. QuadrataReact Package
        • 4. Full Example
    • Request Privacy Data
      • List of Privacy Data
      • Privacy Data Permissions
      • API Requests
        • How to sign API
          • Full Example
          • Generate ECDSA Key Pair
        • API Get Privacy Permissions
        • API Privacy Access Token
        • API Get Privacy Data
        • API Revoke Permissions
    • Query attributes
      • Via Smart Contract
        • Query a single attribute
        • Query multiple attributes
        • Query Helper
      • Via API
    • On-Chain Wallet Screening
      • How to sign API
        • Full Example
        • Generate ECDSA Key Pair
      • API Get On-Chain AML Score
    • Webhooks
      • Onboarding Webhooks
      • Ongoing Monitoring Webhooks
      • Webhook Request Signature
    • Burn Passports
  • additional information
    • Smart contracts
    • Quadrata Sandbox
    • Passport Issuers
    • Privileged Roles & Ownership
    • Constants
    • Flex Kit Attributes
      • Smart Contract Addresses
Powered by GitBook
On this page
  1. additional information

Flex Kit Attributes

PreviousConstantsNextSmart Contract Addresses

Last updated 2 years ago

Flex Kit attributes are non-primary attestations (e.g. not COUNTRY, AML, DID, etc) by an attestor on a subject. Any entity can be an attestor and can attest to any data points. Likewise, any single entity can query any attestation if they find it useful.

You can see the implementation on .

setAttributes(bytes32 _issuerAndAttr, bytes32 _attrValue, address _account, bytes calldata _sigAccount)

Write an attestation about a given account. On initial call, _sigAccount is required and is the signature of the _account over the message: "I authorize [ISSUER_ADDRESS] to attest to my address [ACCOUNT_ADDRESS]"

On subsequent calls, _sigAccount can be omitted.

// Sign message from account authorizing issuer to post info about account
const msg = `I authorize ${issuer.address.toLowerCase()} to attest to my address ${account.address.toLowerCase()}`;
const sigAccount = await account.signMessage(msg);

// [Optional] If unknown, get the attribute key unique to the issuer
const attrKey = await flexKit
    .connect(issuer)
    getAttributeKey(issuer.address, ethers.utils.id("USER_TYPE"));

// Write that the account is of user_type "admin".
flexKit
  .connect(issuer)
  .setAttributes(
    attrKey,
    ethers.utils.id("ADMIN"),
    account.address,
    sigAccount
  )

setQueryFee(bytes32 _rawAttrName, uint256 _amount)

Set the query fee for a given attribute name. The input for attribute name must be the raw name (i.e. it must not be SHA3-256(ISSUER_ADDR | RAW_ATTR_NAME).

setRevokedAttributes(bytes32 _attrName, bool _status)

Set write access for an issuer on a user's specific attribute name. This will default to false initially so once called, the user must continue to manage this boolean for the given issuer/attribute pair.

The input for attribute name must be the hashed value (i.e. SHA3-256(ISSUSER_ADDR | RAW_ATTR_NAME).

withdraw()

Withdraw any funds from query fees.

getAttributeKey(address _issuer, bytes32 _attrName)

The attribute key is the hash of the issuer address and the attribute name. This ensure that multiple issuers can re-use the same attribute name without collision.

const attrKey = await flexKit
    .connect(issuer)
    getAttributeKey(issuer.address, ethers.utils.id("USER_TYPE"));

Querying Attributes

The query functions are similar to the ones found in . The functions also accept primary attributes (i.e. COUNTRY, AML, DID, etc) and will fetch the results from the QuadReader.

Github
Query attributes