EthGlobal Bangkok
Last updated
Was this helpful?
Was this helpful?
cp .env.example .envPRIVATE_KEY=...
RPC_URL=...npm run firewall:compile # the warning are a feature, not a bug 😅npm run firewall:deploy -- --network <network>npm i -g @vennbuild/clivenn fw integ -r -d contractspragma solidity ^0.8;
contract MyContract {
myMethod() {
...
}
}pragma solidity ^0.8;
import {VennFirewallConsumer} from "@ironblocks/firewall-consumer/contracts/consumers/VennFirewallConsumer.sol";
contract MyContract is VennFirewallConsumer {
myMethod() firewallProtected {
...
}
}hardhat run scripts/deploy.js # your deployment script{
"networks": {
"holesky": {
"firewall": "0x123...",
"contracts": {
"MyContract1": "0x11111...",
"MyContract2": "0x22222..."
}
}
}
}npm run firewall:setup -- --network <network>npm i @vennbuild/venn-dapp-sdkimport { VennClient } from '@vennbuild/venn-dapp-sdk';
const vennURL = "https://dc7sea.venn.build/sign";
const vennPolicyAddress = YOUR FIREWALL ADDRESS;
const vennClient = new VennClient({ vennURL, vennPolicyAddress });// You probably have something like this:
const tx = { to, from, data, value };
const receipt = await wallet.sendTransaction(approvedTransaction);
// But now you need this:
const tx = { to, from, data, value };
const approvedTransaction = await vennClient.approve(tx);
const receipt = await wallet.sendTransaction(approvedTransaction);