-
Notifications
You must be signed in to change notification settings - Fork 308
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
26 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,33 +1,35 @@ | ||
set -euo pipefail; | ||
|
||
# create generated dir if it doesn't exist | ||
mkdir -p generated; | ||
target_dir=./generated | ||
|
||
echo -ne "/**\n * DecoderHelper ABI.\n */\nexport const DecoderHelperAbi = " > ./generated/DecoderHelperAbi.ts; | ||
jq -j '.abi' ../../l1-contracts/out/DecoderHelper.sol/DecoderHelper.json >> ./generated/DecoderHelperAbi.ts; | ||
echo " as const;" >> ./generated/DecoderHelperAbi.ts; | ||
echo -ne "/**\n * DecoderHelper bytecode.\n */\nexport const DecoderHelperBytecode = \"" > ./generated/DecoderHelperBytecode.ts; | ||
jq -j '.bytecode.object' ../../l1-contracts/out/DecoderHelper.sol/DecoderHelper.json >> ./generated/DecoderHelperBytecode.ts; | ||
echo "\";" >> ./generated/DecoderHelperBytecode.ts; | ||
# create target dir if it doesn't exist | ||
mkdir -p "$target_dir"; | ||
|
||
echo -ne "/**\n * Rollup ABI.\n */\nexport const RollupAbi = " > ./generated/RollupAbi.ts; | ||
jq -j '.abi' ../../l1-contracts/out/Rollup.sol/Rollup.json >> ./generated/RollupAbi.ts; | ||
echo " as const;" >> ./generated/RollupAbi.ts; | ||
echo -ne "/**\n * DecoderHelper ABI.\n */\nexport const DecoderHelperAbi = " > "$target_dir/DecoderHelperAbi.ts"; | ||
jq -j '.abi' ../../l1-contracts/out/DecoderHelper.sol/DecoderHelper.json >> "$target_dir/DecoderHelperAbi.ts"; | ||
echo " as const;" >> "$target_dir/DecoderHelperAbi.ts"; | ||
echo -ne "/**\n * DecoderHelper bytecode.\n */\nexport const DecoderHelperBytecode = \"" > "$target_dir/DecoderHelperBytecode.ts"; | ||
jq -j '.bytecode.object' ../../l1-contracts/out/DecoderHelper.sol/DecoderHelper.json >> "$target_dir/DecoderHelperBytecode.ts"; | ||
echo "\";" >> "$target_dir/DecoderHelperBytecode.ts"; | ||
|
||
echo -ne "/**\n * Rollup bytecode.\n */\nexport const RollupBytecode = '" > ./generated/RollupBytecode.ts; | ||
jq -j '.bytecode.object' ../../l1-contracts/out/Rollup.sol/Rollup.json >> ./generated/RollupBytecode.ts; | ||
echo "' as const;" >> ./generated/RollupBytecode.ts; | ||
echo -ne "/**\n * Rollup ABI.\n */\nexport const RollupAbi = " > "$target_dir/RollupAbi.ts"; | ||
jq -j '.abi' ../../l1-contracts/out/Rollup.sol/Rollup.json >> "$target_dir/RollupAbi.ts"; | ||
echo " as const;" >> "$target_dir/RollupAbi.ts"; | ||
|
||
echo -ne "/**\n * UnverifiedDataEmitter ABI.\n */\nexport const UnverifiedDataEmitterAbi = " > ./generated/UnverifiedDataEmitterAbi.ts; | ||
jq -j '.abi' ../../l1-contracts/out/UnverifiedDataEmitter.sol/UnverifiedDataEmitter.json >> ./generated/UnverifiedDataEmitterAbi.ts; | ||
echo " as const;" >> ./generated/UnverifiedDataEmitterAbi.ts; | ||
echo -ne "/**\n * Rollup bytecode.\n */\nexport const RollupBytecode = '" > "$target_dir/RollupBytecode.ts"; | ||
jq -j '.bytecode.object' ../../l1-contracts/out/Rollup.sol/Rollup.json >> "$target_dir/RollupBytecode.ts"; | ||
echo "' as const;" >> "$target_dir/RollupBytecode.ts"; | ||
|
||
echo -ne "/**\n * UnverifiedDataEmitter bytecode.\n */\nexport const UnverifiedDataEmitterBytecode = '" > ./generated/UnverifiedDataEmitterBytecode.ts; | ||
jq -j '.bytecode.object' ../../l1-contracts/out/UnverifiedDataEmitter.sol/UnverifiedDataEmitter.json >> ./generated/UnverifiedDataEmitterBytecode.ts; | ||
echo "' as const;" >> ./generated/UnverifiedDataEmitterBytecode.ts; | ||
echo -ne "/**\n * UnverifiedDataEmitter ABI.\n */\nexport const UnverifiedDataEmitterAbi = " > "$target_dir/UnverifiedDataEmitterAbi.ts"; | ||
jq -j '.abi' ../../l1-contracts/out/UnverifiedDataEmitter.sol/UnverifiedDataEmitter.json >> "$target_dir/UnverifiedDataEmitterAbi.ts"; | ||
echo " as const;" >> "$target_dir/UnverifiedDataEmitterAbi.ts"; | ||
|
||
echo -ne "export * from './DecoderHelperAbi.js';\nexport * from './DecoderHelperBytecode.js';\n" > ./generated/index.ts; | ||
echo -ne "export * from './RollupAbi.js';\nexport * from './RollupBytecode.js';\n" >> ./generated/index.ts; | ||
echo -ne "export * from './UnverifiedDataEmitterAbi.js';\nexport * from './UnverifiedDataEmitterBytecode.js';" >> ./generated/index.ts; | ||
echo -ne "/**\n * UnverifiedDataEmitter bytecode.\n */\nexport const UnverifiedDataEmitterBytecode = '" > "$target_dir/UnverifiedDataEmitterBytecode.ts"; | ||
jq -j '.bytecode.object' ../../l1-contracts/out/UnverifiedDataEmitter.sol/UnverifiedDataEmitter.json >> "$target_dir/UnverifiedDataEmitterBytecode.ts"; | ||
echo "' as const;" >> "$target_dir/UnverifiedDataEmitterBytecode.ts"; | ||
|
||
echo "Successfully generated TS artifacts!"; | ||
echo -ne "export * from './DecoderHelperAbi.js';\nexport * from './DecoderHelperBytecode.js';\n" > "$target_dir/index.ts"; | ||
echo -ne "export * from './RollupAbi.js';\nexport * from './RollupBytecode.js';\n" >> "$target_dir/index.ts"; | ||
echo -ne "export * from './UnverifiedDataEmitterAbi.js';\nexport * from './UnverifiedDataEmitterBytecode.js';" >> "$target_dir/index.ts"; | ||
|
||
echo "Successfully generated TS artifacts!"; |