-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: fix release workflow auto deployment logic
- Loading branch information
Showing
172 changed files
with
55,817 additions
and
1,762 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 |
---|---|---|
@@ -0,0 +1,22 @@ | ||
# yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json | ||
language: "en-US" | ||
early_access: false | ||
reviews: | ||
profile: "chill" | ||
request_changes_workflow: false | ||
high_level_summary: true | ||
poem: true | ||
review_status: true | ||
collapse_walkthrough: false | ||
auto_review: | ||
enabled: true | ||
drafts: false | ||
path_instructions: | ||
- path: "./bindings" | ||
instructions: | | ||
Ignore the generated files in this directory | ||
- path: "./src/evm/contracts" | ||
instructions: | | ||
Ignore the generated files in this directory | ||
chat: | ||
auto_reply: true |
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
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
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
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 |
---|---|---|
|
@@ -22,7 +22,6 @@ src/contracts.template.ts | |
forge-cache/ | ||
|
||
node_modules | ||
package-lock.json | ||
.env | ||
coverage | ||
coverage.json | ||
|
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
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,40 +1,34 @@ | ||
.SILENT: | ||
|
||
CONTRACT_ABI_FILES = \ | ||
./out/Dispatcher.sol/Dispatcher.json \ | ||
./out/UniversalChannelHandler.sol/UniversalChannelHandler.json \ | ||
./out/Mars.sol/Mars.json \ | ||
./out/Earth.sol/Earth.json \ | ||
./out/Moon.sol/Moon.json | ||
|
||
TMP_ABI_DIR = .tmp_abi_vibc | ||
|
||
.PHONY: build-contracts abigen clean extract_artifacts | ||
.PHONY: build-contracts bindings-gen-go | ||
|
||
build-contracts: | ||
echo "Building contracts"; \ | ||
rm -frd ./out; \ | ||
forge install; \ | ||
forge build | ||
|
||
extract_artifacts: build-contracts | ||
echo "Extracting ABI artifacts..."; \ | ||
rm -rf $(TMP_ABI_DIR); \ | ||
mkdir -p $(TMP_ABI_DIR); \ | ||
for abi_file in $(CONTRACT_ABI_FILES); do \ | ||
cat $$abi_file | jq .abi > $(TMP_ABI_DIR)/$$(basename $$abi_file); \ | ||
done | ||
forge build contracts lib/openzeppelin-contracts/contracts/proxy/ERC1967/ERC1967Proxy.sol lib/openzeppelin-contracts/contracts/proxy/ERC1967/ERC1967Upgrade.sol -C contracts --lib-paths lib --skip test script $(wildcard contracts/implementation_templates/**/*) utils draft Rc $(wildcard contracts/mocks/**/*) --extra-output-files abi | ||
|
||
abigen: extract_artifacts | ||
# Libraries do not generate the correct ABI code (ChannelState enum causes errors) | ||
# So the Ibc.sol abi generated code from abigen throws errors but is not needed. | ||
# This is because the types exported are included in the ABIs of contracts and | ||
# correctly interpreted (enums -> uint8 etc), the library methods are used inside | ||
# of other contract methods and thus bindings for them do not need to be generated | ||
# as they are not publicly exposed, but rather used within the contract itself. | ||
# | ||
# ABIGen issue ref: https://github.com/ethereum/solidity/issues/9278 | ||
bindings-gen-go: build-contracts | ||
echo "Generating Go vIBC bindings..."; \ | ||
for abi_file in $(wildcard $(TMP_ABI_DIR)/*.json); do \ | ||
abi_base=$$(basename $$abi_file); \ | ||
type=$$(basename $$abi_file .json | tr "[:upper:]" "[:lower:]"); \ | ||
pkg=$$(basename $$abi_base .json | tr "[:upper:]" "[:lower:]"); \ | ||
mkdir -p ./bindings/$$pkg; \ | ||
abigen --abi $$abi_file --pkg $$pkg --type $$type --out ./bindings/$$pkg/$$type.go; \ | ||
done | ||
rm -rfd ./bindings/go/* ; \ | ||
files=$$(/usr/bin/find $$(pwd)/out -type d | sed 's,^.*/out/,out/,' | awk -F'/' '{if ($$NF ~ /\.sol$$/) print $$0}' | awk '{split($$1,p,"[/]"); if (p[2] !~ /([Rr]c|[Vv])[0-9]+|Init|Std|AddressUpgradeable|[0-9]\$$/ && gsub(/\./,"",p[2])==1) print $$0}' | grep "out/[A-Z]" | xargs -I {} /usr/bin/find {} -maxdepth 1 -name '*.abi.json'); \ | ||
for abi_file in $$files; do \ | ||
abi_base=$$(basename $$(dirname $$abi_file)); \ | ||
if [ "$$abi_base" = "Ibc.sol" ]; then \ | ||
continue; \ | ||
fi; \ | ||
type=$$(basename $$abi_file .abi.json); \ | ||
pkg=$$(basename $$abi_base .sol | tr "[:upper:]" "[:lower:]"); \ | ||
mkdir -p ./bindings/go/$$pkg; \ | ||
abigen --abi $$abi_file --pkg $$pkg --type $$type --out ./bindings/go/$$pkg/$$type.go; \ | ||
done; \ | ||
echo "Done." | ||
|
||
clean: | ||
echo "Cleaning up all artifacts..."; \ | ||
rm -rf $(TMP_ABI_DIR); \ | ||
forge clean |
Oops, something went wrong.