Skip to content

Commit

Permalink
build: generate function selector list to selectors.txt (#671)
Browse files Browse the repository at this point in the history
  • Loading branch information
jtakalai authored Oct 4, 2023
1 parent 5c3884d commit 042946e
Show file tree
Hide file tree
Showing 3 changed files with 597 additions and 1 deletion.
11 changes: 11 additions & 0 deletions packages/network-contracts/generateSelectorsTxt.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/bin/sh

cd ../..
npx hardhat flatten packages/network-contracts/contracts/OperatorTokenomics/Operator.sol > temp.sol
grep -v SPDX-License-Identifier temp.sol > temp2.sol
grep -v "pragma experimental" temp2.sol > temp.sol
echo // SPDX-License-Identifier: MIT > sol
echo pragma experimental ABIEncoderV2; >> sol
cat temp.sol >> sol
docker run -v .:/Operator ethereum/solc:0.8.13 --hashes Operator/sol > packages/network-contracts/selectors.txt
rm temp.sol temp2.sol sol
2 changes: 1 addition & 1 deletion packages/network-contracts/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"main": "./dist/src/exports.js",
"types": "./dist/src/exports.d.ts",
"scripts": {
"build": "rm -rf artifacts && hardhat compile && rm -rf dist && tsc -p tsconfig.build.json",
"build": "rm -rf artifacts && hardhat compile && rm -rf dist && tsc -p tsconfig.build.json && ./generateSelectorsTxt.sh",
"clean": "rm -rf artifacts dist cache coverage typechain deployments .openzeppelin/unknown-31337.json",
"test": "npm run test:fast && npm run test:slow",
"integration-test": "npm run test:dev-chain && npm run test:ens-e2e",
Expand Down
Loading

0 comments on commit 042946e

Please sign in to comment.