The DetectionEscrow contract manages the payment process for claims approved by the protocol admin.
The Firewall contract provides an open marketplace for firewall policies that can be subscribed to by consumers. It allows for the management of policies, enabling consumers to add or remove policies as needed. The contract ensures that calls to consumer contracts are validated against the defined policies.
The OperatorRegistry contract serves as a central registry for operators. It allows for the registration of operators and the subscription to other operators (e.g. security providers).
The ProtocolRegistry contract serves as a central registry for protocols and their associated detection mechanisms. It allows for the creation and registration of protocol detections, manages protocol fees, and ensures that only authorized policies can be registered.
The VennToken contract is an ERC20 token that represents the native currency of the Venn Protocol.
The VennFirewallConsumerBase contract is an abstract base contract that provides firewall protection to any contract that inherits from it. It defines the necessary hooks for pre-execution and post-execution checks against the firewall policies.
The VennFirewallConsumer contract extends the VennFirewallConsumerBase and allows for the implementation of firewall protection in consumer contracts. It sets up the necessary storage slots for the firewall and firewall admin addresses. It can be used for non-upgradeable contracts.
The ProxyVennFirewallConsumer contract is an abstract contract that allows for the initialization of the firewall admin in proxy scenarios. It ensures that the firewall admin can be set even if the contract was originally deployed with a zero address.
The BeaconProxyVennFirewallConsumer contract extends the ProxyVennFirewallConsumer and allows the Beacon Proxy Owner to initialize the firewall admin.
The TransparentProxyVennFirewallConsumer contract is similar to the BeaconProxyVennFirewallConsumer, but it is designed for transparent proxies.
The FirewallModule contract is a module for the gnosis safe. It allows for the management of firewall policies and the ability to subscribe to them. It is used to automatically subscribe to the firewall policies during the deployment using the Factory contract.
The VennGuard contract is a security guard for the gnosis safe transactions.
The AttestationCenterProxy contract is a proxy for the AttestationCenter contract. It allows provide a fee value to the AttestationCenter contract when submitting tasks.
The FeePool contract is a contract that allows for the management of the fees.
The VennAvsLogic contract is a contract that provides the logic for the AttestationCenter contract. It is used to validate the task submission and ensure that the correct fee is provided. It also provides the logic for the veto / requiredOperators mechanism.
The VennFeeCalculator contract is a contract that provides the logic for the fee calculation. It is used to calculate the fee for the AttestationCenter contract.
The VennVaultL2 contract is a contract that provides the logic for the AttestationCenter contract. It is minting the rewards and providing the logic for the beforePaymentRequest hook.
The TransientApprovedCallsPolicy contract is a policy that requires a transaction to a consumer to be signed and approved on chain before execution.
The DynamicTransientApprovedCallsPolicy contract is an extension of the TransientApprovedCallsPolicy contract. It allows to have a range of values for the uint256 types values during execution.
The PolicyDeployer contract is a contract that allows for the deployment of policies. It is used to deploy the TransientApprovedCallsPolicy contract. It also approves the policies to the Firewall contract.
Visit the Venn Architecture for more details.
Install the dependencies by running the following command:
npm installTo compile the contracts, use the next script:
npm run buildBefore any following steps, you need to create an .env file following the example of .env.example.
To run the tests, execute the following command:
npm run testTo run the tests for forked network, run:
You need to set the
FORKING_URLandFORKING_BLOCK_NUMBERenvironment variables to run the tests for forked network.
npm run test-forkTo see the coverage, run:
You need to set the
FORKING_URLandFORKING_BLOCK_NUMBERenvironment variables to run the coverage.
npm run coverageTo deploy the contracts, setup the params in the deploy/data/config.ts file and run:
You need to set the
PRIVATE_KEYenvironment variable to deploy the contracts. And you need to have theETHERSCAN_KEYenvironment variable set to verify the contracts in Etherscan.
npx hardhat migrate --namespace venn/L2 --network <network> --verifyYou may check the Deployment Guide for more details.
To deploy the contracts in the local network, you need to fork the network and run the migrations.
npx hardhat node --fork <forking-url>
npx hardhat migrate --namespace venn/L2 --network localhost --verifyThe command to generate the bindings is as follows:
npm run generate-typesSee the full list of available commands in the
package.jsonfile.