The home for Hyperlane core contracts, sdk packages, and other infrastructure
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 
hyperlane-monorepo/solidity/flatten.sh

23 lines
631 B

LICENSE="// SPDX-License-Identifier: MIT OR Apache-2.0"
rm -rf flattened
mkdir -p flattened
# flatten contracts
yarn hardhat flatten > flattened/flattened.sol
# remove duplicate licenses
grep -vE "// SPDX.*" flattened/flattened.sol > flattened/delicensed.sol
# add license
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"
exit 1
fi