forge init
- create a new projectforge compile
- compile contractforge create SimpleStorage --rpc-url http://127.0.0.1:7545 --interactive
- via Ganacheanvil; forge create SimpleStorage --interactive
- via Anvil (anvil in another tab)forge script script/DeploySimpleStorage.s.sol
- run forge script on termoral anvilforge script script/DeploySimpleStorage.s.sol --rpc-url http://127.0.0.1:8545 --broadcast --private-key <private key from anvil>
- run forge script on existing anvil (check broadcast folder)cast --to-base 0x714c2 dec
- convert hex to decsource .env
- load env vars into shell, to use as$PRIVATE_KEY
cast send 0xe7f1725E7734CE288F8367e1Bb143E90bb3F0512 "store(uint256)" 123 --rpc-url $RPC_URL --private-key $PRIVATE_KEY
- send method on deployed contract from terminalcast call 0xe7f1725E7734CE288F8367e1Bb143E90bb3F0512 "retrieve()"
- call method from terminalforge fmt
- format all solidity code
[https://www.evm.codes/](EMV OP CODES GAS)
forge init
- init a new projectforge test
- run testforge install smartcontractkit/chainlink-brownie-contracts --no-commit
- install chainlink libs- Add into
foundry.toml
:remappings = ["@chainlink/contracts/=lib/chainlink-brownie-contracts/contracts/",]
forge remappings > remappings.txt
- add remappings for libsforge test -vv
- run tests with console.log- !!!
forge test -vvv --fork-url $SEPOLIA_RPC_URL
- run tests on forked sepolia forge coverage --fork-url $SEPOLIA_RPC_URL
- show coverage on forked sepoliachisel
- run solidity line-by-line executorforge snapshot
- get gas spend for every functionforge test --mt testWithdrawWithASingleFunder -vv
- run a particular testforge inspect FundMe storageLayout
- get storage layoutforge install cyfrin/foundry-devops --no-commit
- install devopscast sig "fund()"
- find hex function selectorcast --calldata-decode "fund()" 0xb60d4288
- decode hex data