Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ typechain
dist
typechain-types

# Vim files
*.swp

# Hardhat files
cache
artifacts
Expand All @@ -15,5 +18,8 @@ artifacts-zk
# Upgradeability files
.openzeppelin

# Storage layouts. Only save latest deployed storage layouts.
storage-layouts/proposed*

# IDE
.idea
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[submodule "lib/forge-std"]
path = lib/forge-std
url = https://github.com/foundry-rs/forge-std
26 changes: 26 additions & 0 deletions foundry.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
[profile.default]
src = "contracts"
out = "artifacts"
libs = ["node_modules", "lib"]
remappings = [
"@across-protocol/=node_modules/@across-protocol/",
"@ensdomains/=node_modules/@ensdomains/",
"@eth-optimism/=node_modules/@eth-optimism/",
"@gnosis.pm/=node_modules/@gnosis.pm/",
"@maticnetwork/=node_modules/@maticnetwork/",
"@matterlabs/=node_modules/@matterlabs/",
"@openzeppelin/=node_modules/@openzeppelin/",
"@scroll-tech/=node_modules/@scroll-tech/",
"@uma/=node_modules/@uma/",
"@uniswap/=node_modules/@uniswap/",
"arb-bridge-eth/=node_modules/arb-bridge-eth/",
"arb-bridge-peripherals/=node_modules/arb-bridge-peripherals/",
"arbos-precompiles/=node_modules/arbos-precompiles/",
"base64-sol/=node_modules/base64-sol/",
"eth-gas-reporter/=node_modules/eth-gas-reporter/",
"hardhat-deploy/=node_modules/hardhat-deploy/",
"hardhat/=node_modules/hardhat/",
]
via_ir = true

# See more config options https://github.com/foundry-rs/foundry/blob/master/crates/config/README.md#all-options
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@
"lint": "yarn prettier --list-different",
"lint-fix": "yarn prettier --write",
"prettier": "prettier .",
"clean": "for dir in node_modules cache cache-zk artifacts artifacts-zk dist typechain; do mv \"${dir}\" \"_${dir}\"; rm -rf \"_${dir}\" &; done",
"clean-fast": "for dir in node_modules cache cache-zk artifacts artifacts-zk dist typechain; do mv \"${dir}\" \"_${dir}\"; rm -rf \"_${dir}\" &; done",
"clean": "rm -rf node_modules cache cache-zk artifacts artifacts-zk dist typechain",
"build": "hardhat compile && tsc && rsync -a --include '*/' --include '*.d.ts' --exclude '*' ./typechain ./dist/",
"test": "hardhat test",
"test:report-gas": "REPORT_GAS=true hardhat test",
Expand Down
26 changes: 26 additions & 0 deletions scripts/storageLayout.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
#!/bin/bash

CONTRACT=$1
if [ -z "$CONTRACT" ]
then
echo "Error: CONTRACT should be name of contract that you want to inspect storage layout of. e.g. Arbitrum_SpokePool"
exit 1
fi

echo "Creating a storage layout snapshot of the $CONTRACT contract at ./storage-layouts/proposed.$CONTRACT.json"
echo "⏳ This can take a few minutes to complete if you haven't run a forge command recently"
touch ./storage-layouts/proposed.$CONTRACT.json
forge inspect $CONTRACT storagelayout > ./storage-layouts/proposed.$CONTRACT.json
echo "✅ Done!"

read -r -p "Do you want to run a diff on the proposed storage layout with the deployed one? [y/N] " response
case "$response" in
[yY][eE][sS]|[yY])
vim -d ./storage-layouts/proposed.$CONTRACT.json ./storage-layouts/$CONTRACT.json
;;
*)
;;
esac

exit 0

Loading