Skip to content

Commit

Permalink
Client purge (AztecProtocol#288)
Browse files Browse the repository at this point in the history
* fix: remove typescript where possible

* fix: remove clients from readme and template + update circle ci

* fix: delete type-chain types

* fix: remove bridge-client related stuff from readme
  • Loading branch information
LHerskind authored Nov 25, 2022
1 parent 8352afc commit b4f74e5
Show file tree
Hide file tree
Showing 163 changed files with 65 additions and 55,918 deletions.
39 changes: 2 additions & 37 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,27 +44,14 @@ jobs:
shell: /bin/bash
command: |
yarn config set script-shell /bin/bash
yarn lint:contracts
- run:
name: Check Linting Errors in Clients
shell: /bin/bash
command: |
yarn config set script-shell /bin/bash
yarn lint:clients
yarn lint
- run:
name: Test Contracts
shell: /bin/bash
command: |
yarn config set script-shell /bin/bash
export PATH=/home/circleci/.foundry/bin:$PATH
yarn test:contracts
- run:
name: Test Clients
shell: /bin/bash
command: |
yarn config set script-shell /bin/bash
export PATH=/home/circleci/.foundry/bin:$PATH
yarn test:clients
yarn test
publish:
docker:
- image: "cimg/python:3.10.6"
Expand All @@ -76,28 +63,6 @@ jobs:
- run:
name: Authenticate with registry
command: echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" > .npmrc
- run:
name: Setup Vyper
shell: /bin/bash
command: |
pip install vyper
export PATH=/home/cicleci/.local/bin:$PATH
vyper --version
- run:
name: Setup Foundry
shell: /bin/bash
command: |
yarn config set script-shell /bin/bash
yarn install:foundryup
export PATH=/home/circleci/.foundry/bin:$PATH
yarn install:foundry
- run:
name: Build Project
shell: /bin/bash
command: |
export PATH=/home/circleci/.foundry/bin:$PATH
yarn install:dependencies
yarn build
- run:
name: Publish
shell: /bin/bash
Expand Down
19 changes: 0 additions & 19 deletions .eslintrc.cjs

This file was deleted.

5 changes: 2 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,5 @@ cache/
out/
node_modules/
yarn-error.log
client-dest/
# typechain-types/
broadcast/
typechain-types/
broadcast/
4 changes: 4 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,7 @@
[submodule "lib/rollup-encoder"]
path = lib/rollup-encoder
url = https://github.com/AztecProtocol/rollup-encoder
[submodule "lib/openzeppelin-contracts"]
path = lib/openzeppelin-contracts
url = https://github.com/openzeppelin/openzeppelin-contracts
branch = v4.8.0
7 changes: 0 additions & 7 deletions .prettierignore

This file was deleted.

6 changes: 0 additions & 6 deletions .prettierrc

This file was deleted.

17 changes: 4 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ To get started follow the steps below:
```
src/bridges/example
src/test/example
src/client/example
src/specs/example
src/deployment/example
```
Expand Down Expand Up @@ -77,11 +76,10 @@ To receive a grant payment we expect the following work to be done:
1. A solidity bridge that interfaces with the protocol you are bridging to (e.g AAVE),
2. tests in Solidity that test the bridge with production values and the deployed protocol that is currently on mainnet (you should test a range of assets, edge cases and use [Forge's fuzzing abilities](https://book.getfoundry.sh/forge/fuzz-testing.html)),
3. tests cover the full contract, there are no untested functions or lines.
4. implementation of the Typescript `bridge-data.ts` class that tells a frontend developer how to use your bridge.
5. an explanation of the flows your bridge supports should be included as `spec.md`,
6. [NatSpec](https://docs.soliditylang.org/en/develop/natspec-format.html) documentation of all the functions in all the contracts which are to be deployed on mainnet,
7. a deployment script to deploy the bridge with proper configuration,
8. Subsidy contract has been integrated (see the [Subsidy integration section](#subsidy-integration) for details).
4. an explanation of the flows your bridge supports should be included as `spec.md`,
5. [NatSpec](https://docs.soliditylang.org/en/develop/natspec-format.html) documentation of all the functions in all the contracts which are to be deployed on mainnet,
6. a deployment script to deploy the bridge with proper configuration,
7. Subsidy contract has been integrated (see the [Subsidy integration section](#subsidy-integration) for details).

Before submitting a PR for a review make sure that the following is true:

Expand Down Expand Up @@ -177,13 +175,6 @@ In unit tests it is expected that you transfer these tokens on your own.
ETH is returned to the rollup from a bridge by calling the payable function with a `msg.value` `rollupContract.receiveETH(uint256 interactionNonce)`.
You must also set the `outputValue` of the corresponding `outputAsset` (A or B) to be the amount of ETH sent.

This repo supports TypeChain so all Typescript bindings will be auto generated and added to the `typechain-types` folder.

### bridge-data.ts

This is a Typescript class designed to help a developer on the frontend use your bridge.
You should implement the functions to fetch data from your bridge / L1.

## Aztec Connect Background

You can also find more information on the [Aztec docs site](https://docs.aztec.network).
Expand Down
2 changes: 1 addition & 1 deletion foundry.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
src = 'src'
out = 'out'
libs = ['lib']
remappings = ['@openzeppelin/=node_modules/@openzeppelin/', 'forge-std/=lib/forge-std/src', 'rollup-encoder/=lib/rollup-encoder/src']
remappings = ['@openzeppelin/=lib/openzeppelin-contracts/', 'forge-std/=lib/forge-std/src', 'rollup-encoder/=lib/rollup-encoder/src']
fuzz_runs = 256
gas_reports = ["*"]
eth-rpc-url = 'https://mainnet.infura.io/v3/9928b52099854248b3a096be07a6b23c'
Expand Down
1 change: 1 addition & 0 deletions lib/openzeppelin-contracts
Submodule openzeppelin-contracts added at 8c9a83
62 changes: 10 additions & 52 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@aztec/bridge-clients",
"version": "0.1.74",
"description": "This repo contains the solidity files and typescript helper class for all of the Aztec Connect Bridge Contracts",
"description": "This repo contains the solidity files for Aztec Connect Bridge Contracts",
"repository": "[email protected]:AztecProtocol/aztec-connect-bridges.git",
"license": "Apache-2.0",
"type": "module",
Expand All @@ -10,65 +10,23 @@
"install:foundry": "foundryup",
"install:dependencies": "git submodule update --init --recursive && yarn",
"setup": "yarn install:foundryup && yarn install:foundry && yarn install:dependencies",
"clean": "rm -rf ./cache ./dest ./out ./typechain-types ./client-dest",
"clean": "rm -rf ./cache ./dest ./out ./typechain-types",
"build": "forge build",
"compile:typechain": "yarn clean && forge build --skip test --skip script && typechain --target ethers-v5 --out-dir ./typechain-types './out/?(DataProvider|RollupProcessor|*Bridge|I*).sol/*.json'",
"compile:client-dest": "tsc --project tsconfig.client-dest.json",
"build": "yarn compile:client-dest",
"test:pinned:14000000": "forge test --fork-block-number 14000000 --match-contract 'Element' --fork-url https://mainnet.infura.io/v3/9928b52099854248b3a096be07a6b23c",
"test:pinned:14970000": "forge test --fork-block-number 14970000 -m 'testRedistributionSuccessfulSwap|testRedistributionExitWhenICREqualsMCR' --fork-url https://mainnet.infura.io/v3/9928b52099854248b3a096be07a6b23c",
"test:pinned:14972000": "forge test --fork-block-number 14972000 -m 'testRedistributionFailingSwap' --fork-url https://mainnet.infura.io/v3/9928b52099854248b3a096be07a6b23c",
"test:pinned": "yarn test:pinned:14000000 && yarn test:pinned:14970000 && yarn test:pinned:14972000",
"test:contracts": "forge test --no-match-contract 'Element' --no-match-test 'testRedistribution' && yarn test:pinned",
"test:clients": "NODE_OPTIONS=--experimental-vm-modules yarn jest",
"test": "yarn test:contracts && yarn test:clients",
"formatting": "forge fmt && yarn prettier --write ./src/client/**/*.ts",
"formatting:check": "forge fmt --check && prettier --check ./src/client/**/*.ts",
"lint": "yarn lint:contracts && yarn lint:clients",
"lint:contracts": "solhint --config ./.solhint.json --fix \"src/**/*.sol\"",
"lint:clients": "eslint \"src/**/*.{ts,tsx}\""
"test": "forge test --no-match-contract 'Element' --no-match-test 'testRedistribution' && yarn test:pinned",
"formatting": "forge fmt",
"formatting:check": "forge fmt --check",
"lint": "solhint --config ./.solhint.json --fix \"src/**/*.sol\""
},
"dependencies": {
"@aztec/barretenberg": "2.1.52",
"@ethersproject/providers": "^5.7.2",
"@openzeppelin/contracts": "^4.7.3",
"devDependencies": {
"@typechain/ethers-v5": "^10.1.1",
"ethers": "^5.7.2",
"isomorphic-fetch": "^3.0.0",
"ts-node": "^10.9.1",
"solhint": "https://github.com/LHerskind/solhint",
"typechain": "^8.1.1",
"typescript": "^4.9.3"
},
"devDependencies": {
"@types/jest": "^29.2.3",
"@typescript-eslint/eslint-plugin": "^5.43.0",
"@typescript-eslint/parser": "^5.43.0",
"eslint": "^8.27.0",
"eslint-config-prettier": "^8.5.0",
"eslint-plugin-prettier": "^4.2.1",
"jest": "^29.3.1",
"jest-environment-jsdom": "^29.3.1",
"prettier": "^2.7.1",
"solhint": "https://github.com/LHerskind/solhint",
"ts-jest": "^29.0.3"
},
"jest": {
"preset": "ts-jest/presets/default-esm",
"transform": {
"^.+\\.ts$": [
"ts-jest",
{
"useESM": true
}
]
},
"moduleNameMapper": {
"^(\\.{1,2}/.*)\\.js$": "$1"
},
"testEnvironment": "jsdom",
"testRegex": ".*\\.test\\.ts$",
"rootDir": "./src"
},
"files": [
"./client-dest"
]
}
}
72 changes: 0 additions & 72 deletions src/client/aavev2/aavev2-bridge-data.test.ts

This file was deleted.

Loading

0 comments on commit b4f74e5

Please sign in to comment.