Playground

Introduction to Venn Playground

The Venn Playground is a demo dApp on the Venn testnet that enables you to explore and understand how Venn works. By simulating transactions on the Holskey testnet, you can experience different transaction types and observe how they are validated and handled within the Venn ecosystem.

We're on Holesky!

Stay tuned for updates as we add more chains to our Public Testnet.

Tip: Getting a Holesky Faucet. To interact with the Venn playground, you'll need Holesky testnet tokens. You can quickly get them from one of the following Holesky faucets:


How to Play

Follow these steps to explore the Venn Playground:

Step 0: Open the Playground:

Access the Venn Playground at https://playground.venn.build

Step 1: Connect Your Wallet

Connect your wallet to start exploring Venn Playground. This will enable you to simulate transactions.

Step 2: Select Transaction Type to Simulate

Select the type of transaction you want to simulate. This will allow you to see how Venn processes and validates different transaction scenarios.

Available Transaction Types:

1. Normal Transaction: Simulate a legitimate transaction that is successfully validated through Venn. This transaction will be processed without any issues, and you’ll see it as ‘Executed’ on the Venn Explorer.

2. Malicious Transaction: Simulate a malicious transaction that will not be validated. The Venn Explorer will show it was ‘Venn Rejected’, and the operator voted ‘Not-Secure’ due to security risk.

3. Bypass Attempt: Simulate a transaction attempting to bypass Venn by sending it directly to the protocol. The firewall will block this attempt, and the Venn Explorer will indicate that the transaction was ‘Firewall Reverted'.

Step 3: Vault Deposits

To interact with Venn’s features, please deposit and withdraw testnet tokens. This will generate the required transaction we want to simulate.

• Deposit Funds: Add testnet tokens to your account to begin simulating transactions.

• Withdraw Funds: You can withdraw your testnet tokens at any time.

Step 4: Check Vault Deposits

Enter your address to verify that your deposits have been successfully added to the vault.

How to Check:

• Input your wallet address in the designated field.

• View your deposit amount.

Step 5: Check Transaction Details on Venn Explorer

Discover how Venn validates your transactions. Instructions:

• Go to the Venn Explorer at https://explorer.venn.build

• Search your wallet address in the search bar.

• Review the status and details of your transactions.

Step 6: dApp Addresses

Review the important addresses associated with the dApp. Addresses Include:

Step 7: Explore Integrations

Discover how Venn integrations work and look - see the actual integration code for the dApp.

1. Venn SDK:

// Setup
//
import { VennClient } from '@vennbuild/venn-dapp-sdk';

const vennURL           = process.env.VENN_NODE_URL;
const vennPolicyAddress = process.env.VENN_POLICY_ADDRESS;

const vennClient = new VennClient({ vennURL, vennPolicyAddress });

// Approve Tx with Venn
//
const approvedTransaction = await vennClient.approve({
    from,
    to,
    data,
    value
});

// Submit Tx Onchain
//
const receipt = await wallet.sendTransaction(approvedTransaction);

2. Contract Integration:

// SPDX-License-Identifier: UNLICENSED
// See LICENSE file for full license text.
// Copyright (c) Ironblocks 2024
pragma solidity ^0.8;

import {VennFirewallConsumer} from "@ironblocks/firewall-consumer/contracts/consumers/VennFirewallConsumer.sol";
import {Ownable} from "@openzeppelin/contracts/access/Ownable.sol";
import {Address} from "@openzeppelin/contracts/utils/Address.sol";

contract SafeVault is VennFirewallConsumer, Ownable {
    mapping (address user => uint256 ethBalance) public deposits;

    constructor() Ownable(msg.sender) {}

    function deposit() external payable firewallProtected {
        deposits[msg.sender] += msg.value;
    }

    function withdraw(uint256 amount) external firewallProtected {
        deposits[msg.sender] -= amount;
        Address.sendValue(payable(msg.sender), amount);
    }
}

Last updated