Skip to content

Commit

Permalink
refactor: use soldeer instead of git submodules (#337)
Browse files Browse the repository at this point in the history
Co-authored-by: Denis Fadeev <[email protected]>
  • Loading branch information
skosito and fadeev authored Sep 11, 2024
1 parent 4fed7cb commit 292d235
Show file tree
Hide file tree
Showing 116 changed files with 1,285 additions and 132 deletions.
7 changes: 3 additions & 4 deletions .github/workflows/generated-files_v2.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,6 @@ jobs:
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
submodules: recursive

- name: Setup Node.js
uses: actions/setup-node@v4
Expand All @@ -44,20 +42,21 @@ jobs:
sudo apt-get update
sudo apt-get install -y jq unzip
yarn install
forge soldeer update
- name: Install specific version of aibgen
run: |
wget https://gethstore.blob.core.windows.net/builds/geth-alltools-linux-amd64-1.11.5-a38f4108.tar.gz
tar -zxvf geth-alltools-linux-amd64-1.11.5-a38f4108.tar.gz
sudo mv geth-alltools-linux-amd64-1.11.5-a38f4108/abigen /usr/local/bin/
- name: Generate Go packages and typechain-types
- name: Generate Go packages and types
run: |
yarn generate
- name: Check for changes
run: |
if git diff --exit-code --ignore-space-change --ignore-all-space --ignore-cr-at-eol -- pkg typechain-types; then
if git diff --exit-code --ignore-space-change --ignore-all-space --ignore-cr-at-eol -- pkg types; then
echo "Generated Go files are up-to-date."
else
echo "::error::Generated files are not up-to-date. Please run 'yarn generate' locally and commit any changes."
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/lint_v2.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,6 @@ jobs:
steps:
- name: Checkout Repository
uses: actions/checkout@v4
with:
submodules: recursive

- name: Setup Node.js
uses: actions/setup-node@v3
Expand All @@ -41,7 +39,9 @@ jobs:
uses: foundry-rs/foundry-toolchain@v1

- name: Install Dependencies
run: yarn install
run: |
yarn install
forge soldeer update
- name: Lint JavaScript/TypeScript
run: yarn lint
Expand Down
8 changes: 5 additions & 3 deletions .github/workflows/publish-npm_v2.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,13 @@ jobs:
node-version: "21"
registry-url: "https://registry.npmjs.org"

- name: Install Dependencies
run: yarn

- name: Install Foundry
uses: foundry-rs/foundry-toolchain@v1

- name: Install Dependencies
run: |
yarn install
forge soldeer update
- name: Generate Files
run: yarn generate
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/slither_v2.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,6 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v4
with:
submodules: recursive

- name: Install Node.js
uses: actions/setup-node@v2
Expand All @@ -43,7 +41,9 @@ jobs:
uses: foundry-rs/foundry-toolchain@v1

- name: Install dependencies
run: yarn install
run: |
yarn install
forge soldeer update
- name: Build project
run: forge build
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/test_v2.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,6 @@ jobs:
steps:
- name: Checkout Repository
uses: actions/checkout@v4
with:
submodules: recursive

- name: Setup Node.js
uses: actions/setup-node@v4
Expand All @@ -41,7 +39,9 @@ jobs:
uses: foundry-rs/foundry-toolchain@v1

- name: Install Dependencies
run: yarn install
run: |
yarn install
forge soldeer update
- name: Test
run: yarn test
Expand Down
8 changes: 7 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -37,4 +37,10 @@ crytic-export

out
cache_forge
v2/broadcast/*/31337
v2/broadcast/*/31337

dependencies/

# Ignoring remappings because we are adding them in foundry.toml
# currently forge soldeer always re-generates them, should be fixed in next version
remappings.txt
9 changes: 0 additions & 9 deletions .gitmodules

This file was deleted.

7 changes: 7 additions & 0 deletions v2/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,13 @@ We are currently developing Version 2 (V2) of our smart contract architecture. T

Developers can already begin testing the new interface by referring to [the V2 Localnet guide](https://github.com/zeta-chain/localnet?tab=readme-ov-file#experimenting-with-the-new-architecture).

### Install dependencies

```shell
$ yarn
$ forge soldeer update
```

### Build

```shell
Expand Down
7 changes: 7 additions & 0 deletions v2/docs/src/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,13 @@ We are currently developing Version 2 (V2) of our smart contract architecture. T

Developers can already begin testing the new interface by referring to [the V2 Localnet guide](https://github.com/zeta-chain/localnet?tab=readme-ov-file#experimenting-with-the-new-architecture).

### Install dependencies

```shell
$ yarn
$ forge soldeer update
```

### Build

```shell
Expand Down
7 changes: 7 additions & 0 deletions v2/docs/src/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,13 @@ We are currently developing Version 2 (V2) of our smart contract architecture. T

Developers can already begin testing the new interface by referring to [the V2 Localnet guide](https://github.com/zeta-chain/localnet?tab=readme-ov-file#experimenting-with-the-new-architecture).

### Install dependencies

```shell
$ yarn
$ forge soldeer update
```

### Build

```shell
Expand Down
2 changes: 1 addition & 1 deletion v2/eslint.config.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module.exports = [
{
ignores: [".yarn", "artifacts", "cache", "dist", "node_modules", "typechain-types", "abi", "docs", "lib"],
ignores: [".yarn", "artifacts", "cache", "dist", "node_modules", "types", "abi", "docs", "lib"],
languageOptions: {
ecmaVersion: 2020,
sourceType: "module",
Expand Down
12 changes: 9 additions & 3 deletions v2/foundry.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,11 @@ libs = ["lib"]
remappings = [
"ds-test/=node_modules/ds-test/src",
"test/=test",
"forge-std/=lib/forge-std/src/",
"@openzeppelin/contracts/=lib/openzeppelin-contracts-upgradeable/lib/openzeppelin-contracts/contracts/",
"@openzeppelin/contracts-upgradeable/=lib/openzeppelin-contracts-upgradeable/contracts/"
"forge-std/=dependencies/forge-std-1.9.2/src/",
"openzeppelin-foundry-upgrades/=dependencies/openzeppelin-foundry-upgrades-0.3.2/src/",
"solidity-stringutils/=dependencies/openzeppelin-foundry-upgrades-0.3.2/lib/solidity-stringutils/",
"@openzeppelin/contracts/=node_modules/@openzeppelin/contracts/",
"@openzeppelin/contracts-upgradeable/=node_modules/@openzeppelin/contracts-upgradeable/"
]

no-match-contract = '.*EchidnaTest$'
Expand All @@ -33,3 +35,7 @@ quote_style = "double"
tab_width = 4
wrap_comments = true
sort_imports=true

[dependencies]
forge-std = "1.9.2"
openzeppelin-foundry-upgrades = "0.3.2"
1 change: 0 additions & 1 deletion v2/lib/forge-std
Submodule forge-std deleted from c28115
1 change: 0 additions & 1 deletion v2/lib/openzeppelin-contracts-upgradeable
Submodule openzeppelin-contracts-upgradeable deleted from 723f8c
1 change: 0 additions & 1 deletion v2/lib/openzeppelin-foundry-upgrades
Submodule openzeppelin-foundry-upgrades deleted from 4cd15f
2 changes: 1 addition & 1 deletion v2/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"test": "forge clean && forge test -vvv",
"coverage": "forge clean && forge coverage --no-match-coverage \"(script|test)\" --report lcov",
"typechain": "npx typechain --target ethers-v6 \"out/**/!(*.t|test).sol/!(*.abi).json\" --out-dir types",
"generate": "forge clean && forge build && forge fmt && ./scripts/generate_go.sh || true && yarn lint:fix && yarn typechain && yarn docs",
"generate": "forge clean && forge build && forge fmt && ./scripts/generate_go.sh || true && yarn lint:fix && yarn typechain",
"prepublishOnly": "copyfiles -u 1 'out/**/*' 'abi'",
"docs": "./scripts/generate_docs.sh"
},
Expand Down
2 changes: 1 addition & 1 deletion v2/pkg/address.sol/address.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion v2/pkg/beaconproxy.sol/beaconproxy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion v2/pkg/console.sol/console.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion v2/pkg/core.sol/core.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion v2/pkg/defender.sol/defender.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion v2/pkg/defenderdeploy.sol/defenderdeploy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 292d235

Please sign in to comment.