# Adding on-chain kycNFT checks

Our smart contract deployed on NEAR chain implements a very simple interface which implementing smart contracts can use to quickly check if a certain AccountID has a valid kycNFT.

/// A trait for checking whether an address has a valid kycNFT token
trait KycValidity {
    /// Check if an account has any valid tokens
    fn has_valid_token(&self, address: AccountId) -> bool;

You can use the above function in a cross-contract call to check if a given AccountID has valid kycNFT.

# Example

Here is an example of a contract using a cross-contract call to check if the AccountId has a valid kycNFT token.

fn query_kyc(&self, account_id: AccountId) -> Promise {
    // Create a promise to call kycdao.has_valid_token()
    let promise = kycdao::ext(self.kyc_contract_address.clone())
    return promise.then( // Create a promise to callback query_kyc_callback

pub fn query_kyc_callback(&self, #[callback_result] call_result: Result<bool, PromiseError>) -> bool {
    if call_result.is_err() {
      log!("There was an error contacting KYC Contract");
      return false;
    // Return the KYC validity, or do some gating with it
    let validity: bool = call_result.unwrap();

# Contract addresses

Blockchain Network Contract Address
NEAR Mainnet KYC app.kycdao.near
NEAR Testnet KYC app.kycdao.testnet