Skip to content

Commit

Permalink
Fix pjson yarn flatten command
Browse files Browse the repository at this point in the history
  • Loading branch information
yorhodes committed Oct 18, 2023
1 parent e7726b1 commit 1ccdca8
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion solidity/flatten.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
LICENSE="// SPDX-License-Identifier: MIT OR Apache-2.0"

rm -rf flattened
mkdir -p flattened

Expand All @@ -8,12 +10,12 @@ yarn hardhat flatten > flattened/flattened.sol
grep -vE "// SPDX.*" flattened/flattened.sol > flattened/delicensed.sol

# add license
LICENSE="// SPDX-License-Identifier: MIT OR Apache-2.0"
echo "$LICENSE" | cat - flattened/delicensed.sol > flattened/licensed.sol

# compile
solc flattened/licensed.sol

# TODO: automate this?
if [ $? -ne 0 ]; then
echo "Remove @openzeppelin/../ICrossDomainMessenger and replace Optimism_Bridge with ICrossDomainMessenger"
echo "Then try compiling again with solc flattened/licensed.sol"
Expand Down
2 changes: 1 addition & 1 deletion solidity/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
"clean": "hardhat clean && rm -rf ./dist ./cache ./types ./coverage",
"coverage": "./coverage.sh",
"docs": "forge doc",
"flatten": "hardhat flatten > contracts/flattened.sol && grep -vE '// SPDX.*' contracts/flattened.sol",
"flatten": "./flatten.sh",
"prettier": "prettier --write ./contracts ./test",
"test": "hardhat test && forge test -vvv",
"gas": "forge snapshot",
Expand Down

0 comments on commit 1ccdca8

Please sign in to comment.