Skip to content

Commit

Permalink
style: formatted everything
Browse files Browse the repository at this point in the history
  • Loading branch information
benesjan committed Jul 6, 2022
1 parent 00874b6 commit 835967a
Show file tree
Hide file tree
Showing 18 changed files with 159 additions and 135 deletions.
10 changes: 5 additions & 5 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
version: '2.1'
version: "2.1"
orbs:
node: circleci/[email protected]
jobs:
build-and-test:
docker:
- image: 'cimg/base:stable-20.04'
- image: "cimg/base:stable-20.04"
steps:
- checkout
- node/install:
install-yarn: true
node-version: '16.13'
node-version: "16.13"
- run:
name: Setup Foundry
shell: /bin/bash
Expand Down Expand Up @@ -53,12 +53,12 @@ jobs:
yarn build
publish:
docker:
- image: 'cimg/base:stable-20.04'
- image: "cimg/base:stable-20.04"
steps:
- checkout
- node/install:
install-yarn: true
node-version: '16.13'
node-version: "16.13"
- run:
name: Authenticate with registry
command: echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" > .npmrc
Expand Down
18 changes: 9 additions & 9 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
module.exports = {
root: true,
parser: '@typescript-eslint/parser',
plugins: ['@typescript-eslint'],
extends: ['eslint:recommended', 'plugin:@typescript-eslint/recommended', 'prettier/@typescript-eslint'],
parser: "@typescript-eslint/parser",
plugins: ["@typescript-eslint"],
extends: ["eslint:recommended", "plugin:@typescript-eslint/recommended", "prettier/@typescript-eslint"],
env: {
node: true,
},
rules: {
'@typescript-eslint/explicit-module-boundary-types': 'off',
'@typescript-eslint/no-non-null-assertion': 'off',
'@typescript-eslint/no-explicit-any': 'off',
'@typescript-eslint/no-empty-function': 'off',
'no-constant-condition': 'off',
"@typescript-eslint/explicit-module-boundary-types": "off",
"@typescript-eslint/no-non-null-assertion": "off",
"@typescript-eslint/no-explicit-any": "off",
"@typescript-eslint/no-empty-function": "off",
"no-constant-condition": "off",
camelcase: 2,
},
ignorePatterns: ['node_modules', 'dest*', 'dist', '*.js', '.eslintrc'],
ignorePatterns: ["node_modules", "dest*", "dist", "*.js", ".eslintrc"],
};
6 changes: 2 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
cache
cache/
out/
node_modules
node_modules/
artifacts/
yarn-error.log
contracts
client-dest/
types/
typechain-types/
8 changes: 8 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
cache/
out/
node_modules/
artifacts/
yarn-error.log
client-dest/
lib/
typechain-types/
4 changes: 2 additions & 2 deletions .solhint.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
"func-visibility": ["warn", { "ignoreConstructors": true }],
"no-empty-blocks": "off",
"not-rely-on-time": "off",
"const-name-snakecase": ["warn", { "treatImmutableVarAsConstant": true}],
"var-name-mixedcase": ["warn", { "treatImmutableVarAsConstant": true}],
"const-name-snakecase": ["warn", { "treatImmutableVarAsConstant": true }],
"var-name-mixedcase": ["warn", { "treatImmutableVarAsConstant": true }],
"error-name-mixedcase": ["warn"],
"private-func-leading-underscore": ["warn"],
"private-vars-no-leading-underscore": ["warn"],
Expand Down
29 changes: 14 additions & 15 deletions CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

# Contributor Covenant Code of Conduct

## Our Pledge
Expand All @@ -18,23 +17,23 @@ diverse, inclusive, and healthy community.
Examples of behavior that contributes to a positive environment for our
community include:

* Demonstrating empathy and kindness toward other people
* Being respectful of differing opinions, viewpoints, and experiences
* Giving and gracefully accepting constructive feedback
* Accepting responsibility and apologizing to those affected by our mistakes,
- Demonstrating empathy and kindness toward other people
- Being respectful of differing opinions, viewpoints, and experiences
- Giving and gracefully accepting constructive feedback
- Accepting responsibility and apologizing to those affected by our mistakes,
and learning from the experience
* Focusing on what is best not just for us as individuals, but for the overall
- Focusing on what is best not just for us as individuals, but for the overall
community

Examples of unacceptable behavior include:

* The use of sexualized language or imagery, and sexual attention or advances of
- The use of sexualized language or imagery, and sexual attention or advances of
any kind
* Trolling, insulting or derogatory comments, and personal or political attacks
* Public or private harassment
* Publishing others' private information, such as a physical or email address,
- Trolling, insulting or derogatory comments, and personal or political attacks
- Public or private harassment
- Publishing others' private information, such as a physical or email address,
without their explicit permission
* Other conduct which could reasonably be considered inappropriate in a
- Other conduct which could reasonably be considered inappropriate in a
professional setting

## Enforcement Responsibilities
Expand Down Expand Up @@ -120,14 +119,14 @@ version 2.1, available at
[https://www.contributor-covenant.org/version/2/1/code_of_conduct.html][v2.1].

Community Impact Guidelines were inspired by
[Mozilla's code of conduct enforcement ladder][Mozilla CoC].
[Mozilla's code of conduct enforcement ladder][mozilla coc].

For answers to common questions about this code of conduct, see the FAQ at
[https://www.contributor-covenant.org/faq][FAQ]. Translations are available at
[https://www.contributor-covenant.org/faq][faq]. Translations are available at
[https://www.contributor-covenant.org/translations][translations].

[homepage]: https://www.contributor-covenant.org
[v2.1]: https://www.contributor-covenant.org/version/2/1/code_of_conduct.html
[Mozilla CoC]: https://github.com/mozilla/diversity
[FAQ]: https://www.contributor-covenant.org/faq
[mozilla coc]: https://github.com/mozilla/diversity
[faq]: https://www.contributor-covenant.org/faq
[translations]: https://www.contributor-covenant.org/translations
21 changes: 14 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,12 @@ Developing a bridge is simple and permissionless. It is done entirely in Solidit

## Deployed Bridge Info

| Bridge | Id | InputAssetA (AssetId) | InputAssetB (AssetId) | OutputAssetA (AssetId) | OutputAssetB (AssetId) | auxData | async | Description |
|---|---|---|---|---|---|---|---|---|
| [Element](https://etherscan.io/address/0xaeD181779A8AAbD8Ce996949853FEA442C2CDB47) | 1 | DAI (1) | Not used | DAI (1) | Not used | The tranche expiry value for the interaction. | Yes | Smart contract responsible for depositing, managing and redeeming Defi interactions with the Element protocol |
| [LidoBridge](https://etherscan.io/address/0x381abF150B53cc699f0dBBBEF3C5c0D1fA4B3Efd) | 2 | ETH (0) or wstETH (2) | Not used | wstETH (2) or ETH (0) | Not used | Not used | No | Deposit Eth and get wstETH from Lido, or deposit wstETH and get ETH from a Curve swap. |
| [AceOfZkBridge](https://etherscan.io/address/0x0eb7F9464060289fE4FDDFDe2258f518c6347a70) | 4 | [Ace of ZK NFT](https://opensea.io/assets/ethereum/0xe56b526e532804054411a470c49715c531cfd485/16) | Not used | Not used | Not used | | No | A bridge to send the Ace of ZK to the rollup processor contract. |
| [CurveStEthBridge](https://etherscan.io/address/0x0031130c56162e00A7e9C01eE4147b11cbac8776) | 5 | ETH (0) or wstETH (2) | Not used | wsthETH (2) or ETH (0) - will be opposite of `inputAssetA` | Not used | Not used | No | A DeFiBridge for trading between Eth and wstEth using curve and the stEth wrapper. |
| Bridge | Id | InputAssetA (AssetId) | InputAssetB (AssetId) | OutputAssetA (AssetId) | OutputAssetB (AssetId) | auxData | async | Description |
| ------------------------------------------------------------------------------------------- | --- | ------------------------------------------------------------------------------------------------- | --------------------- | ---------------------------------------------------------- | ---------------------- | --------------------------------------------- | ----- | ------------------------------------------------------------------------------------------------------------- |
| [Element](https://etherscan.io/address/0xaeD181779A8AAbD8Ce996949853FEA442C2CDB47) | 1 | DAI (1) | Not used | DAI (1) | Not used | The tranche expiry value for the interaction. | Yes | Smart contract responsible for depositing, managing and redeeming Defi interactions with the Element protocol |
| [LidoBridge](https://etherscan.io/address/0x381abF150B53cc699f0dBBBEF3C5c0D1fA4B3Efd) | 2 | ETH (0) or wstETH (2) | Not used | wstETH (2) or ETH (0) | Not used | Not used | No | Deposit Eth and get wstETH from Lido, or deposit wstETH and get ETH from a Curve swap. |
| [AceOfZkBridge](https://etherscan.io/address/0x0eb7F9464060289fE4FDDFDe2258f518c6347a70) | 4 | [Ace of ZK NFT](https://opensea.io/assets/ethereum/0xe56b526e532804054411a470c49715c531cfd485/16) | Not used | Not used | Not used | | No | A bridge to send the Ace of ZK to the rollup processor contract. |
| [CurveStEthBridge](https://etherscan.io/address/0x0031130c56162e00A7e9C01eE4147b11cbac8776) | 5 | ETH (0) or wstETH (2) | Not used | wsthETH (2) or ETH (0) - will be opposite of `inputAssetA` | Not used | Not used | No | A DeFiBridge for trading between Eth and wstEth using curve and the stEth wrapper. |

## Getting started

Expand Down Expand Up @@ -271,7 +271,14 @@ interface IDefiBridge {
Types.AztecAsset calldata outputAssetB,
uint256 interactionNonce,
uint64 auxData
) external payable returns (uint256 outputValueA, uint256 outputValueB, bool interactionComplete);
)
external
payable
returns (
uint256 outputValueA,
uint256 outputValueB,
bool interactionComplete
);
}
```
Expand Down
20 changes: 9 additions & 11 deletions ensure_versions.js
Original file line number Diff line number Diff line change
@@ -1,15 +1,13 @@
const path = require('path');
const { readFileSync, writeFileSync } = require('fs');
const path = require("path");
const { readFileSync, writeFileSync } = require("fs");

// https://github.com/Uniswap/uniswap-v2-periphery/pull/53
const safeMathFilename = path.resolve(__dirname, './node_modules/@uniswap/v2-periphery/contracts/libraries/SafeMath.sol');
const safeMathFilename = path.resolve(
__dirname,
"./node_modules/@uniswap/v2-periphery/contracts/libraries/SafeMath.sol",
);

try {
const content = readFileSync(safeMathFilename, 'utf-8');
writeFileSync(
safeMathFilename,
content.replace('pragma solidity =0.6.6;', 'pragma solidity >=0.6.6;'),
'utf-8',
);
} catch (e) {
}
const content = readFileSync(safeMathFilename, "utf-8");
writeFileSync(safeMathFilename, content.replace("pragma solidity =0.6.6;", "pragma solidity >=0.6.6;"), "utf-8");
} catch (e) {}
18 changes: 9 additions & 9 deletions hardhat.config.ts
Original file line number Diff line number Diff line change
@@ -1,37 +1,37 @@
import { HardhatUserConfig, subtask } from 'hardhat/config';
import '@typechain/hardhat';
import { HardhatUserConfig, subtask } from "hardhat/config";
import "@typechain/hardhat";

const { TASK_COMPILE_SOLIDITY_GET_SOURCE_PATHS } = require('hardhat/builtin-tasks/task-names');
const { TASK_COMPILE_SOLIDITY_GET_SOURCE_PATHS } = require("hardhat/builtin-tasks/task-names");

subtask(TASK_COMPILE_SOLIDITY_GET_SOURCE_PATHS).setAction(async (_, __, runSuper) => {
const paths = await runSuper();

// Do not generate types for files in the src/test folder unless they are in interface subfolder.
// (Types of all the interfaces are needed in end to end tests.)
return paths.filter((p: any) => !p.includes('src/test/') || p.includes('interface'));
return paths.filter((p: any) => !p.includes("src/test/") || p.includes("interface"));
});

const config: HardhatUserConfig = {
solidity: {
version: '0.8.10',
version: "0.8.10",
settings: {
optimizer: { enabled: true, runs: 200 },
},
},
typechain: {
target: 'ethers-v5',
target: "ethers-v5",
},
networks: {
ganache: {
url: `http://${process.env.GANACHE_HOST || 'localhost'}:8545`,
url: `http://${process.env.GANACHE_HOST || "localhost"}:8545`,
},
hardhat: {
blockGasLimit: 15000000,
},
},
paths: {
sources: 'src/',
artifacts: './artifacts',
sources: "src/",
artifacts: "./artifacts",
},
};

Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@
"build": "yarn clean && yarn compile:typechain && yarn compile:client-dest",
"lint": "yarn formatting && yarn solhint",
"lint:check": "yarn formatting:check && yarn solhint:check",
"formatting": "yarn formatting:check --write",
"formatting:check": "prettier --check \"src/**/*.sol\"",
"formatting": "yarn prettier --write .",
"formatting:check": "prettier --check .",
"solhint": "yarn solhint:check --fix",
"solhint:check": "solhint --config ./.solhint.json \"src/**/*.sol\""
},
Expand Down
2 changes: 1 addition & 1 deletion src/client/aztec/provider/index.ts
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export * from './web3_provider';
export * from "./web3_provider";
4 changes: 2 additions & 2 deletions src/client/aztec/provider/web3_provider.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Web3Provider } from '@ethersproject/providers';
import { EthereumProvider } from '@aztec/barretenberg/blockchain';
import { Web3Provider } from "@ethersproject/providers";
import { EthereumProvider } from "@aztec/barretenberg/blockchain";

export const createWeb3Provider = (ethereumProvider: EthereumProvider) => new Web3Provider(ethereumProvider);
Loading

0 comments on commit 835967a

Please sign in to comment.