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 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