## Foundry **Foundry is a blazing fast, portable and modular toolkit for Ethereum application development written in Rust.** Foundry consists of: - **Forge**: Ethereum testing framework (like Truffle, Hardhat and DappTools). - **Cast**: Swiss army knife for interacting with EVM smart contracts, sending transactions and getting chain data. - **Anvil**: Local Ethereum node, akin to Ganache, Hardhat Network. - **Chisel**: Fast, utilitarian, and verbose solidity REPL. ## Documentation https://book.getfoundry.sh/ ## Usage ### Clone ```shell # clone the repository git clone --recursive git@github.com:lista-dao/moolah.git # update submodules if cloned without --recursive git submodule update --init --recursive ``` ### Install ```shell yarn install ``` ### Build ```shell $ forge build ``` ### Test ```shell $ forge test ``` #### test a specific contract ```shell forge test --match-contract SafeGuardTest -vvv forge test --match-contract BuybackTest --match-test "testExecutorOfNoneOwner" -vvv ``` ### Format ```shell $ forge fmt ``` ### Gas Snapshots ```shell $ forge snapshot ``` ### Anvil ```shell $ anvil ``` ### Deploy ```shell $ forge script --rpc-url --private-key --etherscan-api-key --broadcast --verify -vvv --via-ir # deploy SafeGuard Contract $ forge script script/safe/SafeGuard.s.sol:SafeGuardScript --rpc-url --private-key --etherscan-api-key --broadcast --verify -vvv ``` ### Verify ```shell $ forge verify-contract --rpc-url --chain-id
--api-key ``` ### Cast ```shell $ cast $ cast call $ cast send --private-key # demo $ cast send "addExecutor(address)" <...parameters> --rpc-url $RPC --private-key $PRIVATE_KEY ``` ### Help ```shell $ forge --help $ anvil --help $ cast --help ``` ## License Files in this repository are licensed under MIT, see [`LICENSE`](./LICENSE), except the V3 LP collateral module, which is licensed under the Business Source License 1.1, see [`LICENSE-BUSL`](./LICENSE-BUSL). A file's SPDX header states which applies: `BUSL-1.1` covers `src/provider/v3/`, `src/provider/libraries/{V3PositionLib,SwapInventoryLib,V3ProviderLib}.sol` and `src/liquidator/V3Liquidator.sol`; their interfaces (`src/provider/interfaces/IV3*.sol`, `ISlisBNBV3DexAdapter.sol`) stay MIT. The Change License is MIT.