Canon Guard is a multisig solution designed to significantly enhance security, minimize reliance on external services, and simplify the verification of recurring transactions. Canon Guard leverages fully on-chain Actions contracts and dynamic timelocks to ensure security, transparency, and resilience.
- Install Foundry by following the instructions from their repository.
- Copy the
.env.examplefile to.envand fill in the variables. - Install rust dependencies:
cargo install lintspec - Install the dependencies by running:
yarn install. In case there is an error with the commands, runfoundryupand try them again.
The default way to build the code is suboptimal but fast, you can run it via:
yarn buildIn order to build a more optimized code (via IR), run:
yarn build:optimizedUnit tests should be isolated from any externalities, while Integration usually run in a fork of the blockchain. In this boilerplate you will find example of both.
In order to run both unit and integration tests, run:
yarn testIn order to just run unit tests, run:
yarn test:unitIn order to run unit tests and run way more fuzzing than usual (5x), run:
yarn test:unit:deepIn order to just run integration tests, run:
yarn test:integrationIn order to start the Medusa fuzzing campaign (requires Medusa installed), run:
yarn test:fuzzIn order to just run the symbolic execution tests (requires Halmos installed), run:
yarn test:symbolicIn order to check your current code coverage, run:
yarn coverageConfigure the .env variables and source them:
source .envImport your private keys into Foundry's encrypted keystore:
cast wallet import $ETHEREUM_DEPLOYER_NAME --interactivecast wallet import $OPTIMISM_DEPLOYER_NAME --interactiveyarn deploy:ethereum:canon-guardyarn deploy:optimism:canon-guardThe deployments are stored in ./broadcast
See the Foundry Book for available options.
Export TypeScript interfaces from Solidity contracts and interfaces providing compatibility with TypeChain. Publish the exported packages to NPM.
To enable this feature, make sure you've set the NPM_TOKEN on your org's secrets. Then set the job's conditional to true:
jobs:
export:
name: Generate Interfaces And Contracts
# Remove the following line if you wish to export your Solidity contracts and interfaces and publish them to NPM
if: true
...Also, remember to update the package_name param to your package name:
- name: Export Solidity - ${{ matrix.export_type }}
uses: defi-wonderland/solidity-exporter-action@1dbf5371c260add4a354e7a8d3467e5d3b9580b8
with:
# Update package_name with your package name
package_name: "my-cool-project"
...
- name: Publish to NPM - ${{ matrix.export_type }}
# Update `my-cool-project` with your package name
run: cd export/my-cool-project-${{ matrix.export_type }} && npm publish --access public
...You can take a look at our solidity-exporter-action repository for more information and usage examples.
Canon Guard is a public good. If you want to support its development, visit our Giveth project.
The primary license for the boilerplate is MIT, see LICENSE