Skip to main content
This guide walks you through creating a project in the Credible Layer dApp and deploying assertions to protect your smart contracts. Prerequisites: What you’ll accomplish: Create a project, link your contracts, and deploy assertions to production.
New to the dApp? See the dApp Overview to understand its features.

Step 1: Authenticate

Authenticate through pcl:
pcl auth login
  1. A login link appears in your terminal
  2. Open it in your browser
  3. Connect your wallet
  4. Enter the login code from the CLI
Authentication with pcl auth login

Authentication with pcl auth login

Authentication links your wallet address with your pcl session, allowing you to manage projects that your wallet owns.

Step 2: Create a Project

  1. Navigate to the “Projects” tab or click “Create a Project”
  2. Enter project details:
    • Project Name: Your protocol name
    • Project Description: What your project does
    • Target Chain: Where your contracts are deployed
  3. Click “Continue to contract selection”
  4. Add contract addresses:
    • Enter each contract you want to protect
    • Only contracts where you are the owner can be added
    • The dApp verifies ownership by calling owner() on each contract
  5. Review and click “Save and publish”
Creating a Project

Creating a Project in the dApp

Only the contract owner can create a project for it. See Ownership Verification for details on verification methods.

Step 3: Store and Submit Your Assertion

Use pcl to upload and submit your assertion:
# Store the bytecode
pcl store MyAssertion 0xYOUR_CONTRACT_ADDRESS

# Submit to your project
pcl submit -a 'MyAssertion(0xYOUR_CONTRACT_ADDRESS)' -p my-project
See Store and Submit Assertions for detailed instructions.

Step 4: Deploy the Assertion

After submitting via pcl, complete deployment in the dApp:
  1. Navigate to your project
  2. Click the “Deployment” tab
  3. Find your assertion and click “Proceed to Review”
  4. Select the target contract to protect
  5. Review assertion details:
    • Assertion name and parameters
    • Target contract address
    • Trigger conditions
  6. Choose environment:
    • Staging: For testing (assertions run but don’t block transactions)
    • Production: For active protection (assertions block violating transactions)
  7. Click “Deploy” and sign the transaction
Deploying Assertion

Deploying Assertion in the dApp

After deployment, your assertion enters a timelock period. Once the timelock expires, the assertion becomes actively enforced.

Step 5: Monitor Your Assertions

After deployment, manage assertions through your project dashboard:
  • View Active Assertions: See all assertions protecting your contracts
  • Monitor Status: Check assertion execution and triggered violations
  • View Incidents: View incidents that were prevented by assertions
  • Update Assertions: Submit new versions as your protocol evolves
  • Remove Assertions: Deactivate assertions when needed

Troubleshooting

ErrorSolution
”Contract ownership verification failed”Ensure your contract has owner() and you’re connected with the owner wallet
”Assertion already exists”Use a different name or update the existing assertion
”Authentication expired”Run pcl auth login to refresh

Recap

You’ve deployed an assertion to protect your protocol:
  1. Authenticate: Connect your wallet via pcl auth login
  2. Create project: Set up your project and link contracts
  3. Store and submit: Upload assertion via pcl
  4. Deploy: Complete deployment in dApp and sign transaction
  5. Monitor: Track assertion status in your dashboard

Video Walkthrough

Full walkthrough from authentication to deployment:

Next Steps