Skip to content

Commit

Permalink
Delete type checking feature (#82)
Browse files Browse the repository at this point in the history
  • Loading branch information
anajuliabit authored Jul 4, 2024
1 parent c4e69d4 commit a7044bf
Show file tree
Hide file tree
Showing 21 changed files with 0 additions and 847 deletions.
33 changes: 0 additions & 33 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -108,36 +108,3 @@ jobs:
run: |
echo "## Proposal simulator tests result" >> $GITHUB_STEP_SUMMARY
echo "✅ Passed" >> $GITHUB_STEP_SUMMARY
type-check-test:
runs-on: "ubuntu-latest"
steps:
- name: "Check out the repo"
uses: "actions/checkout@v3"
with:
submodules: "recursive"

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

- name: "Show the Foundry config"
run: "forge config"

- name: "Install Node.js"
uses: "actions/setup-node@v3"
with:
node-version: "lts/*"

- name: "Install the Node.js dependencies"
run: "cd typescript/ && npm install && cd ../ && npm install ts-node"

- name: "Build the contracts and print their size"
run: "forge build --sizes"

- name: "Run typecheck tests"
run: "forge test --mc TypeCheck --ffi --fork-url sepolia"

- name: "Add test summary"
run: |
echo "## Type check tests result" >> $GITHUB_STEP_SUMMARY
echo "✅ Passed" >> $GITHUB_STEP_SUMMARY
4 changes: 0 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,3 @@ node_modules/

lcov.info

# typescript
typescript/node_modules/

typescript/package-lock.json
70 changes: 0 additions & 70 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,76 +50,6 @@ Choose a model that fits your needs:

Create scripts and/or tests. Check [Guides](docs/guides/multisig-proposal.md) and [Integration Tests](docs/testing/integration-tests.md).

### Type Checking

Type checking allows verification of deployed bytecode on any contracts with the bytecode present in local artifacts. With this feature, developer `A` can easily deploy some contracts, and developer `B` can verify `A`'s deployments by simply running the type checking script. Additionaly, `A` can also use this feature to verify their own deployments. `A` can take the following steps:

- Follow the steps 1 to 3 on [Proposal Simulation](#proposal-simulation) section
- Add the deployed contracts to `Addresses.json`.
- Create a `TypeCheckAddresses.json` file following the instructions provided in [type-check.md](docs/guides/type-check.md).
- Enter `lib/forge-proposal-simulator/typescript` directory and install npm packages.

```bash
cd lib/forge-proposal-simulator/typescript && npm i
```

- Change directory again to the root repo

```bash
cd ../../../
```

- Add below environment variables to `.env`.

```
ADDRESSES_PATH # Path to addresses.json file
TYPE_CHECK_ADDRESSES_PATH # Path to typeCheckAddresses.json file
```

Example:

```
TYPE_CHECK_ADDRESSES_PATH=addresses/TypeCheckAddresses.json
ADDRESSES_PATH=addresses/Addresses.json
ARTIFACT_PATH=out/
```

- Make sure to allow read access to `Addresses.json`, `TypeCheckAddresses.json` and `artifact` folder inside of `foundry.toml`.

```toml
[profile.default]

fs_permissions = [{ access = "read", path = "./"}]
```

- Run the following command on root repo to type check all contracts added in `TypeCheckAddresses.json`.

```bash
forge script lib/forge-proposal-simulator/script/TypeCheck.s.sol:TypeCheck --ffi --fork-url <deployed_contracts_chain_rpc_url>
```

### Type checking on Example contracts FPS

#### Step 1: Set environment variables

```
TYPE_CHECK_ADDRESSES_PATH="addresses/TypeCheckAddresses.json"
ADDRESSES_PATH="addresses/Addresses.json"
LIB_PATH=""
```

#### Step 2: Run script to test type checking

```bash
forge script script/TypeCheck.s.sol:TypeCheck --ffi --fork-url sepolia
```

You can also run type checking through inline environment variables if not already set in .env

```bash
TYPE_CHECK_ADDRESSES_PATH="addresses/TypeCheckAddresses.json" ADDRESSES_PATH="addresses/Addresses.json" ARTIFACT_PATH="out/" LIB_PATH="" forge script script/TypeCheck.s.sol:TypeCheck --ffi --fork-url sepolia
```

## Contribute

There are many ways you can participate and help build the next version of FPS. Check out the [contribution guide](CONTRIBUTING.md)!
Expand Down
12 changes: 0 additions & 12 deletions addresses/Addresses.json
Original file line number Diff line number Diff line change
Expand Up @@ -95,18 +95,6 @@
"isContract": true,
"name": "BRAVO_VAULT_TOKEN"
},
{
"addr": "0x293cad26033577eb68137603a34d2dbfd05104d8",
"chainId": 11155111,
"name": "ExampleTypeCheck",
"isContract": true
},
{
"addr": "0x9D7A602541230B2bA04D9aA542fad73B8aaBA4ED",
"chainId": 11155111,
"name": "ExampleTypeCheck_02",
"isContract": true
},
{
"addr": "0x5a0Aae59D09fccBdDb6C6CcEB07B7279367C3d2A",
"chainId": 1,
Expand Down
14 changes: 0 additions & 14 deletions addresses/AddressesIncorrect.json

This file was deleted.

12 changes: 0 additions & 12 deletions addresses/TypeCheckAddresses.json

This file was deleted.

12 changes: 0 additions & 12 deletions addresses/TypeCheckAddressesIncorrect.json

This file was deleted.

6 changes: 0 additions & 6 deletions docs/SUMMARY.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,6 @@

- [Integration Tests](testing/integration-tests.md)

## Type checking

- [Introduction](type-check/introduction.md)
- [Type Check Example](type-check/example.md)
- [TypeCheckAddresses.json](type-check/type-check.md)

## Github Actions

- [Printing Calldata on Pull Requests](actions/print-calldata.md)
Loading

0 comments on commit a7044bf

Please sign in to comment.