This repository contains smart contracts for the Broker entity in the Yellow Network.
Broker and Canary utility token is a simple ERC20 token with permit functionality. All the supply is minted to the deployer.
A simple vault that allows users to deposit and withdraw tokens. Deposit is allowed regardless of the time, whereas withdrawal is allowed only when authorized by the Authorizer contract. LiteVault Owner can change the Authorizer contract, which will enable a grace withdrawal period for 3 days, during which users will be able to withdraw their funds.
Authorizer contract that authorize withdrawal regardless of token and amount, but only outside of the time range specified on deployment.
This project uses forge fmt
for consistent Solidity code formatting. We follow an editor-agnostic approach with additional convenience settings for VS Code users.
-
Git Hooks: The project includes pre-commit hooks that automatically format Solidity files using
forge fmt
before each commit.To set up the pre-commit hook:
# Configure git to use the hooks in the .githooks directory git config core.hooksPath .githooks
-
EditorConfig: The project includes an
.editorconfig
file with basic formatting rules that many editors support.To use these settings:
- Install an EditorConfig plugin for your editor if it doesn't have built-in support
- The plugin will automatically apply basic formatting rules (indentation, line endings, etc.)
More information about EditorConfig can be found at https://editorconfig.org/
For VS Code users, additional settings are provided in .vscode/settings.json
that:
- Configure VS Code to use
forge fmt
automatically when saving Solidity files - Ensure consistent formatting directly in the editor
These settings are optional and only apply to VS Code users. Other editors may need their own configuration to exactly match forge fmt
behavior.
The recommended workflow for all developers, regardless of editor:
- Use the pre-commit hooks to ensure consistent formatting in the repository
- If needed, run
forge fmt
manually before committing to see changes
This repository uses Foundry toolchain for development, testing and deployment.
$ forge build [contract]
$ make all
$ forge test []
$ forge fmt
$ forge snapshot
$ forge create <contract> --constructor-args [C_ARGS] -r $RPC_URL --private-key $PRIV_KEY [--optimizer-runs <runs> --via-ir]
To interact with smart contracts, use cast
command with either call
or send
subcommand to read or write data respectively.
$ cast call <contract_address> "<method_signature>" [params] -r $RPC_URL
$ cast send <contract_address> "<method_signature>" [params] -r $RPC_URL --private-key $PRIV_KEY