Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Only have normalized storage layouts in repository #1289

Merged
merged 2 commits into from
Sep 13, 2024
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
5 changes: 1 addition & 4 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -84,12 +84,9 @@ jobs:
- run:
name: "Check contract sizes"
command: npx hardhat size-contracts
- run:
name: "Checking contract storage layout hasn't broken existing slots"
command: npx hardhat storage-layout --check
- run:
name: "Checking contract storage layout hasn't had additions made"
command: npx hardhat storage-layout --update && npm run normalize:storageSlots && git checkout ./.storage-layouts && git diff --exit-code
command: npx hardhat storage-layout --update && npm run normalize:storageSlots && test -z "$(git status --porcelain)"
- run:
name: "Upload function selectors to 4byte.directory"
command: npx hardhat upload-selectors
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -34,3 +34,4 @@ ganache-chain-db-2/
build-coverage/
coverage-extensions/
.pnpm-store
.storage-layouts
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
{
"storage": [
{
"contract": "contracts/testHelpers/ERC20Like.sol:ERC20Like",
"label": "totalSupply",
"offset": 0,
"slot": "0",
"type": {
"encoding": "inplace",
"label": "uint256",
"numberOfBytes": "32"
}
},
{
"contract": "contracts/testHelpers/ERC20Like.sol:ERC20Like",
"label": "balanceOf",
"offset": 0,
"slot": "1",
"type": {
"encoding": "mapping",
"key": {
"encoding": "inplace",
"label": "address",
"numberOfBytes": "20"
},
"label": "mapping(address => uint256)",
"numberOfBytes": "32",
"value": {
"encoding": "inplace",
"label": "uint256",
"numberOfBytes": "32"
}
}
},
{
"contract": "contracts/testHelpers/ERC20Like.sol:ERC20Like",
"label": "allowance",
"offset": 0,
"slot": "2",
"type": {
"encoding": "mapping",
"key": {
"encoding": "inplace",
"label": "address",
"numberOfBytes": "20"
},
"label": "mapping(address => mapping(address => uint256))",
"numberOfBytes": "32",
"value": {
"encoding": "mapping",
"key": {
"encoding": "inplace",
"label": "address",
"numberOfBytes": "20"
},
"label": "mapping(address => uint256)",
"numberOfBytes": "32",
"value": {
"encoding": "inplace",
"label": "uint256",
"numberOfBytes": "32"
}
}
}
},
{
"contract": "contracts/testHelpers/ERC20Like.sol:ERC20Like",
"label": "name",
"offset": 0,
"slot": "3",
"type": {
"encoding": "bytes",
"label": "string",
"numberOfBytes": "32"
}
},
{
"contract": "contracts/testHelpers/ERC20Like.sol:ERC20Like",
"label": "symbol",
"offset": 0,
"slot": "4",
"type": {
"encoding": "bytes",
"label": "string",
"numberOfBytes": "32"
}
},
{
"contract": "contracts/testHelpers/ERC20Like.sol:ERC20Like",
"label": "decimals",
"offset": 0,
"slot": "5",
"type": {
"encoding": "inplace",
"label": "uint8",
"numberOfBytes": "1"
}
}
]
}
19 changes: 0 additions & 19 deletions .storage-layouts/contracts/Migrations.sol:Migrations.json

This file was deleted.

This file was deleted.

This file was deleted.

Loading