Graphite
  • Overview
    • Introduction
    • What is Graphite?
    • Connect to Graphite
    • Graphite account activation
    • Graphite Wrapped Tokens
  • Build on Graphite
    • Getting started
    • System Contracts
      • Account Activation
      • Filter Contract (KYC Transaction Filters)
      • KYC Contract
      • Reputation
    • How to Complete KYC in a Testnet
    • How to Deploy Smart Contracts Using Hardhat: A Step-by-Step Guide
    • SDK
      • JS SDK
  • Infrastructure
    • Graphite Nodes
      • Graphite testnet node setup
      • Graphite mainnet node setup
  • Ecosystem
    • Graphite Wallet
      • Graphite Web3 Documentation
    • Graphite Bridge
    • The Graphite Explorer
      • API documentation
    • Faucet Testnet
Powered by GitBook
On this page
  • Intro
  • Network address of the contract
  • Functions
  • setFilterLevel(level)
  • viewFilterLevel()
  • filter(sender, destination)
  1. Build on Graphite
  2. System Contracts

Filter Contract (KYC Transaction Filters)

PreviousAccount ActivationNextKYC Contract

Last updated 6 months ago

Intro

FilterContract.sol is a Graphite system smart contract. It's needed for users to work with KYC-Filters for incoming transactions.

  • To set a filter level for your account, call setFilterLevel(level).

  • To check the current KYC-Filter level of your account, call viewFilterLevel().

  • To check if a potential transaction from account A to account B goes through (i.e. isn't blocked by KYC-Filter on B), call filter(sender, destination).

Network address of the contract

FilterContract_address = "0x0000000000000000000000000000000000001002"

Functions

setFilterLevel(level)

    setFilterLevel(uint _level)
    ⎯⎯
    _level - uint; KYC-Filter for incoming transactions to be set.
  • Purpose

Call setFilterLevel(level) to set up a value for a KYC transaction filter for incoming transactions, rejecting senders with KYC level lower than the filter value.

  • Arguments

level - integer value; the value of the KYC Filter (directly related to sender's KYC Level)

  • After Execution

Upon successful execution, a caller wallet address will have a KYC Filter for incoming transactions set at a certain value.

  • Details

Since the exact number of available KYC Verification levels is not yet finalized, the level(value) of KYC Filters is not limited on the testnet. Additionally, at the moment there are no KYC Level restrictions that the KYC Center is able to grant. On the mainnet, it's expected that there'll be 2-5 available KYC levels.

Transactions that don't fit the KYC Filter are rejected by Graphite nodes.

viewFilterLevel()

viewFilterLevel()
  • Purpose

Call viewFilterLevel() to get the current KYC Filter level that a caller has for incoming transactions.

  • Arguments

none

  • After Execution

Function restores the KYC Filter level.

  • Details

A wallet address can call this function only for itself, not for others.

filter(sender, destination)

    filter(address _sender,address _destination)
    ⎯⎯
    _sender - address; wallet address of a sender in a potential transaction
    _destination - address; destination wallet address in this transaction
  • Purpose

Call filter(sender, destination) to check if a transfer from sender address to destination address will or won't be rejected by the blockchain.

  • Arguments

sender - wallet address of a sender of a potential transaction. destination - wallet address of the receiver (destination).

  • After Execution

Returns true if sender's KYC level is greater than destination's KYC Filter level (i.e. a potential transaction will go through and won't be rejected by nodes).

Returns false if sender's KYC level is less than destination's KYC Filter level (i.e. a potential transaction won't go through and will be rejected by nodes).

  • Details

This function uses the KYCContract smart contact to get KYC level data.