Skip to content

primus-labs/zktls-contracts

Repository files navigation

Primus zktls-contract

The Primus zkTLS protocol is compatible with multiple blockchains. We provide smart contracts that can be deployed on different blockchains to verify data proofs generated by users through the zkTLS SDK.

Documentation

You can find the documentation here: Primus-Doc

Supported Blockchains

You can check the contract address on the Contract Addresses List.

Supported Languages

  • Solidity

Usage Example

  • using Primus ZKTLs contracts in Foundry
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.20;

import { IPrimusZKTLS, Attestation } from "@primuslabs/zktls-contracts/src/IPrimusZKTLS.sol";
contract AttestorTest {
   address public primusAddress;

   constructor(address _primusAddress) {
      // Replace with the network you are deploying on
      primusAddress = _primusAddress;
   }

   function verifySignature(Attestation calldata attestation) public view returns(bool) {
        IPrimusZKTLS(primusAddress).verifyAttestation(attestation);

        // Your business logic upon successful verification
        // Example: Verify that proof.context matches your expectations
        return true;
   }
}

Usage

Test

$ forge test

Deploy

$ forge script script/PrimusZKTLS.s.sol --rpc-url <your_rpc_url> --private-key <your_private_key> --broadcast

Upgrade

$ forge script script/UpgradeZKTLS.s.sol --rpc-url <your_rpc_url> --private-key <your_private_key> --broadcast

Verify Logic

forge verify-contract --chain-id chian_ID \
    --etherscan-api-key your_private_apikey \
    contract_address \
    src/PrimusZKTLS.sol:PrimusZKTLS \
    --watch

Help

$ forge --help
$ anvil --help
$ cast --help