odyslam
bash-utils
Shell

A collection of useful bash scripts for ChainOps and more

Last updated May 5, 2026
83
Stars
1
Forks
2
Issues
0
Stars/day
Attention Score
32
Language breakdown
Shell 100.0%
Files click to expand
README

Bash Utils

Useful Bash scripts for ChainOps and more

forge-inspect.sh

  • forge-inspect generate [CONTRACTS]: Generate a storage layout file for your [CONTRACTS], which should be a space separated list. It is saved as .storage-layout
  • forge-inspect check [CONTRACTS] : Check the current storage layout of the contracts against an existing .storage-layout file. If the two layouts are not identical, it will print the diff and exit with exist code 1
  • Commit the storage layout to a Git repository and have the CI run forge-inspect check. If the check fails, that means that the storage layout changed. The developer will need to acknowledge that difference and commit the new storage layout for the test to pass
Generate
./forge-inspect generate Replica Home
Creating storage layout diagrams for the following contracts: Replica Home
...
Storage layout snapshot stored at .storage-layout

Check

./forge-inspect check Replica Home
storage-layout test: passes ✅
./forge-inspect check BridgeRouter
storage-layout test: fails ❌
The following lines are different:
21c21
< | xAppConnectionManager | contract XAppConnectionManager | 10  | 0      | 20    | packages/contracts-bridge/contracts/BridgeRouter.sol:BridgeRouter |

> | xAppConnectionManager | contract XAppConnectionManager | 101 | 0 | 20 | packages/contracts-bridge/contracts/BridgeRouter.sol:BridgeRouter |

multi-anvil.sh

Spin up multiple Anvil instances in an instant.

  • CTRL+C to terminate all of them at once.
  • They spin up with incrementing port numbers, starting from 8545
  • Useful for multi-chain testing
  • Different instances will get a differently coloured output
  • You can supply RPC endpoints to enter Forking Mode. Simply populate the rpcs array in multi-anvil.json -- (the RPC endpoints that already exist are PUBLIC)
  • If you use Forking Mode, you will need to supply as many RPC endpoints as the number of Anvil instances you want to spawn

print-util.sh

Useful functions to nicely print messages.

  • info
  • warning
  • announce

Useful variables to colour your terminal output

TPUT_RESET="$(tput sgr 0)"
TPUT_WHITE="$(tput setaf 7)"
TPUT_BGRED="$(tput setab 1)"
TPUT_BGGREEN="$(tput setab 2)"
TPUT_GREEN="$(tput setaf 2)"
TPUT_RED="$(tput setaf 1)"
TPUT_BOLD="$(tput bold)"
TPUT_DIM="$(tput dim)"

License

MIT

© 2026 GitRepoTrend · odyslam/bash-utils · Updated daily from GitHub