This project demonstrates how to deploy a smart contract to the Venn Testnet (Holesky) with firewall protection using the Venn Firewall SDK (@ironblocks/firewall-consumer) and integrate the Venn DApp SDK (@vennbuild/venn-dapp-sdk) to approve transactions in a frontend. The contract (Rare) includes a simple contract.
- Node.js and npm: Install Node.js (v16 or later) and npm on your local machine:
- Windows/macOS/Linux: Download from nodejs.org.
- Hardhat: This project uses Hardhat for smart contract development.
- MetaMask: A wallet with Holesky ETH for deployment and testing (request from holesky-faucet.com).
- Git: To clone the repository.
- Terminal: Use a terminal like Command Prompt (Windows), Terminal (macOS/Linux).
Open a terminal and clone the repository:
git clone https://github.com/Wizbisy/Venn.git
cd Vennrun
npm install
npm i -g @vennbuild/cliopen the .env file and update with your own variables
VENN_PRIVATE_KEY=your_metamask_private_key
API_URL=https://ethereum-holesky-rpc.publicnode.com
VENN_NODE_URL=https://signer2.testnet.venn.build/api/17000/sign
VENN_POLICY_ADDRESS=your_policy_addressVENN_PRIVATE_KEY; Your metamask private key containing holesky eth. VENN_POLICY_ADDRESS: Your policy address gotten after registering your smart contract with venn in step 6
run
npx hardhat compile you should see something just like this
Deploy the contract to Holesky testnet.
npx hardhat run scripts/deploy.js --network holeskyGet your smart contract and update the venn.config.json file with your actual smart contract.
after updating the venn.config.json file run
venn enable --network holeskythen get your POLICY ADDRESS from your terminal and update the
.env and venn.config.json file.
after updating the .env and venn.config.json file Use the Venn DApp SDK to approve transactions before sending them on-chain
npx hardhat run scripts/approve-tx.js --network holesky