Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Smooth test #159

Open
wants to merge 115 commits into
base: use-ZetaInteractor-in-test
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
115 commits
Select commit Hold shift + click to select a range
026fde3
aaiello/zeta-306-fix-smart-contracts-sast-results (#7)
andresaiello Jun 16, 2022
912f7dd
Update README.md (#8)
lucas-janon Jun 16, 2022
d4b9db9
Update protocol contracts (#9)
lucas-janon Jun 16, 2022
ea11bc6
Set initial package version to be able to import via git (#10)
pavel-bc Jun 17, 2022
d651c44
Scaffold repo scripts, add Slither (#3)
CharlieMc0 Jun 22, 2022
50aefdc
aaiello/zeta-335-add-supply-cap-to-smart-contracts (#13)
andresaiello Jun 23, 2022
6981173
Exclude libraries from Slither (#12)
CharlieMc0 Jun 23, 2022
7a03205
Remove initial mint from ZetaNonEth, add tests (#15)
lucas-janon Jun 24, 2022
3ee5860
Update contracts naming (#14)
lucas-janon Jun 24, 2022
5297756
Rename ZetaEth/ZetaNonEth to zeta.eth/zeta.non-eth (#18)
lucas-janon Jun 27, 2022
fd2a200
Allow TSS to call updateTssAddress (#21)
lucas-janon Jun 27, 2022
ac8c0f5
Improve Slither results (#20)
lucas-janon Jun 27, 2022
04ab7c2
Add tx.origin to ZetaSent (#19)
lucas-janon Jun 27, 2022
9e4ae67
Add Pauser role (#17)
lucas-janon Jun 27, 2022
8822455
Add readme to protocol module (#23)
andresaiello Jun 28, 2022
c3aa49b
Create ZetaTokenConsumer (#22)
andresaiello Jun 28, 2022
4bfb3e3
Update OpenZeppelin version
lucas-janon Jun 28, 2022
db87337
Delete useless imports from ZetaEth
lucas-janon Jun 29, 2022
0035046
Allow TSS to call updateTssAndConnectorAddresses
lucas-janon Jun 29, 2022
58c7f41
Add zetainteractor and errors to examples (#24)
andresaiello Jul 1, 2022
89a5cd1
Add not audited contracts disclaimer (#25)
lucas-janon Jul 1, 2022
10a8344
Add connector token approval script (#4)
CharlieMc0 Jul 1, 2022
6952f97
Integrate zeta token consumer (#26)
andresaiello Jul 5, 2022
11564d6
Implement veridise audit suggestions (#30)
andresaiello Jul 13, 2022
3bf2e3f
Aaiello/zeta 790 implement veridise suggestions (#31)
andresaiello Jul 13, 2022
30cd3d2
Implement veridise suggestions (#32)
andresaiello Jul 14, 2022
be7898d
Implement PeckShield suggestions (#33)
andresaiello Jul 18, 2022
53ca9cd
Deploy to deterministic addresses (#28)
andresaiello Jul 20, 2022
07ca732
Add changeset to publish on npm (#29)
andresaiello Jul 21, 2022
1366de2
Fix ci on zetachain repo (#36)
andresaiello Jul 28, 2022
501b847
Improve zetaValueAndgGas naming (#39)
andresaiello Aug 3, 2022
79d150d
Update zetasent event to be read by the protocol (#40)
andresaiello Aug 4, 2022
4e35b55
Expose addresses on npm (#37)
andresaiello Aug 4, 2022
ff13a11
Redeploy Connector and Zeta token (#34)
andresaiello Aug 4, 2022
1c03730
Update npm address pkg (#41)
andresaiello Aug 9, 2022
cc3bbc1
Add klaytn to supported networks (#45)
andresaiello Sep 1, 2022
fbc563d
Fix npm packages to be used externally (#47)
andresaiello Sep 7, 2022
252fd0c
Upgrade node (#49)
andresaiello Sep 7, 2022
0520781
Fix zeta connector deployment scripts (#50)
andresaiello Sep 12, 2022
0eca92b
Deploy connector and zeta token to Klaytn (#46)
andresaiello Sep 19, 2022
77e3185
Add different strategies to swap (#42)
andresaiello Sep 20, 2022
9884884
Deploy send value contract to klaytn (#51)
andresaiello Sep 20, 2022
16b56c7
Implement quantum suggestions (#43)
andresaiello Nov 4, 2022
07e33f1
Develop cross chain swap (#53)
andresaiello Nov 8, 2022
d2a7b79
Develop and deploy zevm uniswap (#55)
andresaiello Nov 28, 2022
6a94cdd
Improvements on contracts ownership (#54)
andresaiello Dec 26, 2022
03a7ff3
Develop cctx testing scripts (#56)
andresaiello Dec 26, 2022
e7402e3
Write SC for multiple output (#57)
andresaiello Jan 5, 2023
010e652
Create bugbounty.md (#59)
Jan 11, 2023
09332dc
Deploy swap to klaytn (#52) (#60)
andresaiello Jan 12, 2023
9336fe2
Bump @openzeppelin/contracts from 4.6.0 to 4.7.3 (#63)
dependabot[bot] Jan 25, 2023
cfe525c
Missing zero address check in (#62)
andresaiello Jan 25, 2023
a4c2aba
Fix dependa bot alerts: Upgrade oz contracts (#64)
andresaiello Jan 25, 2023
76f566c
Update waffle and mocha to latest (#66)
andresaiello Feb 7, 2023
fc15ef5
Charlie/docker_container (#61)
CharlieMc0 Feb 8, 2023
1193d17
enabled gitguardian check (#68)
CharlieMc0 Feb 8, 2023
d4c4153
Bug smart contracts script zeta swap deploy (#69)
andresaiello Feb 13, 2023
399358e
Adjust pause functionality to only apply to send (#70)
andresaiello Feb 24, 2023
95ef8e6
Split smart contracts repo adding zeta app (#71)
andresaiello Feb 27, 2023
a3f689d
Add comments to smart contracts (#72)
andresaiello Mar 21, 2023
7ae7ad5
Deploy send contract to mumbai (#76)
andresaiello Mar 29, 2023
2d33199
Cicd/Build docker (#77)
CharlieMc0 Apr 6, 2023
70f6d21
Publish npm packages to zetaswapv2 (#79)
andresaiello Apr 12, 2023
73fe6df
Add prepublishonly to addressestools (#83)
andresaiello Apr 18, 2023
724cc0a
Add prepublishonly to addressestools 2 (#85)
andresaiello Apr 19, 2023
2ee3bd1
Add prepublishonly to addressestools 3 (#86)
andresaiello Apr 19, 2023
21ae165
chore: replace Alchemy with Ankr RPC (#89)
fadeev May 2, 2023
062b628
Deploy MultiOutput example (#91)
andresaiello May 4, 2023
6273dad
ERC20custody contract (#75)
aldapp7 May 5, 2023
2ef323b
chore: compile TS before publishing (#88)
fadeev May 5, 2023
0f079f8
Deploy zeta token consumer uniswap v3 (#92)
andresaiello May 8, 2023
4993ebe
Cleanup protocol-contracts repo (#93)
andresaiello May 19, 2023
145e65e
Develop v1 of liquidity incentives (#74)
andresaiello May 19, 2023
9aebe38
Fix ZRC20 protocol bug (#94)
andresaiello May 22, 2023
e5f3372
Bump @openzeppelin/contracts from 4.7.3 to 4.8.3 (#96)
andresaiello May 22, 2023
669aada
Bump http-cache-semantics from 4.1.0 to 4.1.1 (#67)
dependabot[bot] May 22, 2023
71392a0
Bump decode-uri-component from 0.2.0 to 0.2.2 (#65)
dependabot[bot] May 22, 2023
ae4b2bf
Publish address 0.0.10 (#97)
andresaiello May 23, 2023
e9e8e4e
Remove ZetaTokenConsumerTrident from zetachain repo (#98)
andresaiello May 24, 2023
69cd5cf
Release a new version of address-tools on npm (#99)
andresaiello May 29, 2023
47d5bcf
Remove extra consolelog from address pkg (#102)
andresaiello Jun 20, 2023
f73a62a
Deploy send contract to Athens3 (#105)
andresaiello Jul 4, 2023
2df7647
Remove Ropsten and upgrade to Athens3 (#106)
andresaiello Jul 10, 2023
715d418
Redeploy swap (#110)
andresaiello Aug 1, 2023
57d542b
Add sendZeta to send contract (#108)
andresaiello Aug 7, 2023
0d1e9ee
Update ZetaChain repo to protocol-contracts 2.0 (#111)
andresaiello Aug 25, 2023
f551f8a
Deploy rewards to Athens2 and 3 (#104)
andresaiello Aug 25, 2023
f11e620
Organize zetachain repo (#115)
andresaiello Sep 1, 2023
90685e8
Add onZetaRevert to send contract (#116)
andresaiello Sep 4, 2023
c80a37f
Add native token support to StakingReward contract (#117)
andresaiello Sep 12, 2023
d288f57
Deploy disperse to athens (#120)
andresaiello Sep 27, 2023
5b35a12
Add bsc-mainnet to addresses pkg (#121)
andresaiello Sep 29, 2023
3763b13
Update address tools repo to deploy bsc-mainnet (#122)
andresaiello Oct 2, 2023
ccd893e
Improve uniswap scripts (#119)
andresaiello Oct 9, 2023
ce2ae52
Deploy Token Incentive contracts on zEVM (#118)
andresaiello Oct 18, 2023
a0b9862
Add deadline to uniswap v2 contract (#126)
andresaiello Nov 5, 2023
b418a4d
Smart contract to verify an address and for accept an invitation (#124)
andresaiello Nov 13, 2023
3a19731
implement immunefi improvements (#131)
andresaiello Nov 14, 2023
6820479
Cleanup zetachain repo to be zeta apps repo (#132)
andresaiello Nov 27, 2023
2b6e85b
Update zetachain repo to support protocol 3.0.1 (#133)
andresaiello Nov 29, 2023
76a7815
Bump word-wrap from 1.2.3 to 1.2.4 (#109)
dependabot[bot] Dec 4, 2023
57c49b9
Bump @openzeppelin/contracts from 4.8.3 to 4.9.3 (#112)
dependabot[bot] Dec 4, 2023
181bace
Bump browserify-sign from 4.2.1 to 4.2.2 (#134)
dependabot[bot] Dec 4, 2023
daa335a
Bump get-func-name from 2.0.0 to 2.0.2 (#135)
dependabot[bot] Dec 4, 2023
2f39eff
fix(setup-tutorial.ts) json error (#130)
tudorpintea999 Dec 5, 2023
86eb10e
feat: ci to zetachain repo (#137)
andresaiello Dec 12, 2023
48f0398
feat: Run slither and coverage (#138)
andresaiello Dec 15, 2023
ce47d94
feat: Iimprove token incentive scripts (#139)
andresaiello Jan 3, 2024
dd13770
feat: Npm Pkg for app contract addresses (#141)
andresaiello Jan 8, 2024
66e4465
feat: npm pkg app contract addresses (#142)
andresaiello Jan 8, 2024
95c5ec9
feat: npm pkg app contract addresses 2 (#143)
andresaiello Jan 8, 2024
fc42ff8
feat: npm pkg app contract addresses 3 (#144)
andresaiello Jan 9, 2024
d7f76a5
feat: Add events to disperse (#146)
andresaiello Jan 28, 2024
f79723b
feat: implement feature to disable invitation (#148)
andresaiello Feb 2, 2024
45930f0
feat: update zetachain multichainvalue (#150)
andresaiello Feb 20, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
**/node_modules/
**/cache
**/.env
Dockerfile
.github
.vscode
.changeset
.dockerignore
.secrets
21 changes: 14 additions & 7 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
const path = require("path");

const OFF = 0;

/**
* @type {import("eslint").Linter.Config}
*/
Expand All @@ -10,12 +12,22 @@ module.exports = {
mocha: true,
node: true,
},
parser: "@typescript-eslint/parser",
plugins: ["@typescript-eslint", "simple-import-sort", "prettier"],
extends: ["plugin:prettier/recommended"],
parser: "@typescript-eslint/parser",
parserOptions: {
ecmaVersion: 12,
},
plugins: ["@typescript-eslint", "prettier", "simple-import-sort", "sort-keys-fix", "typescript-sort-keys"],
rules: {
"@typescript-eslint/sort-type-union-intersection-members": "error",
camelcase: "off",
"no-console": OFF,
"simple-import-sort/exports": "error",
"simple-import-sort/imports": "error",
"sort-keys-fix/sort-keys-fix": "error",
"typescript-sort-keys/interface": "error",
"typescript-sort-keys/string-enum": "error",
},
settings: {
"import/parsers": {
"@typescript-eslint/parser": [".js", ".jsx", ".ts", ".tsx", ".d.ts"],
Expand All @@ -29,9 +41,4 @@ module.exports = {
},
},
},
rules: {
camelcase: "off",
"simple-import-sort/imports": "error",
"simple-import-sort/exports": "error",
},
};
1 change: 1 addition & 0 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* @andresaiello @fadeev @lucas-janon
21 changes: 21 additions & 0 deletions .github/workflows/gitguardian.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: GitGuardian scan

on: [push, pull_request]

jobs:
scanning:
name: GitGuardian scan
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0 # fetch all history so multiple commits can be scanned
- name: GitGuardian scan
uses: GitGuardian/ggshield-action@master
env:
GITHUB_PUSH_BEFORE_SHA: ${{ github.event.before }}
GITHUB_PUSH_BASE_SHA: ${{ github.event.base }}
GITHUB_PULL_BASE_SHA: ${{ github.event.pull_request.base.sha }}
GITHUB_DEFAULT_BRANCH: ${{ github.event.repository.default_branch }}
GITGUARDIAN_API_KEY: ${{ secrets.GITGUARDIAN_API_KEY }}
26 changes: 26 additions & 0 deletions .github/workflows/lint.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Lint TS/JS

on:
pull_request:
branches:
- "*"

jobs:
build:
runs-on: ubuntu-latest

steps:
- name: Checkout Repository
uses: actions/checkout@v3

- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: "16"
registry-url: "https://registry.npmjs.org"

- name: Install Dependencies
run: yarn install

- name: Lint
run: yarn lint
62 changes: 62 additions & 0 deletions .github/workflows/publish-npm.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
name: Publish to NPM

on:
release:
types: [published]

jobs:
build:
runs-on: ubuntu-latest

steps:
- name: Checkout Repository
uses: actions/checkout@v3

- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: "16"
registry-url: "https://registry.npmjs.org"

- name: Install Dependencies
run: yarn install

- name: Determine NPM Tag zeta app contracts
id: determine-npm-tag-zeta-app-contracts
working-directory: packages/zeta-app-contracts
run: |
VERSION_TAG=${GITHUB_REF#refs/tags/v}
if [[ $VERSION_TAG == *"-"* ]]; then
echo ::set-output name=NPM_TAG::${VERSION_TAG#*-}
else
echo ::set-output name=NPM_TAG::latest
fi
env:
GITHUB_REF: ${{ github.ref }}

- name: Publish to NPM zeta app contracts
working-directory: packages/zeta-app-contracts
run: npm publish --tag ${{ steps.determine-npm-tag-zeta-app-contracts.outputs.NPM_TAG }}
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
GITHUB_REF: ${{ github.ref }}

- name: Determine NPM Tag zevm app contracts
id: determine-npm-tag-zevm-app-contracts
working-directory: packages/zevm-app-contracts
run: |
VERSION_TAG=${GITHUB_REF#refs/tags/v}
if [[ $VERSION_TAG == *"-"* ]]; then
echo ::set-output name=NPM_TAG::${VERSION_TAG#*-}
else
echo ::set-output name=NPM_TAG::latest
fi
env:
GITHUB_REF: ${{ github.ref }}

- name: Publish to NPM zevm app contracts
working-directory: packages/zevm-app-contracts
run: npm publish --tag ${{ steps.determine-npm-tag-zevm-app-contracts.outputs.NPM_TAG }}
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
GITHUB_REF: ${{ github.ref }}
16 changes: 16 additions & 0 deletions .github/workflows/semantic-pr.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
name: "Semantic PR"
on:
pull_request_target:
types:
- opened
- edited
- synchronize

jobs:
main:
name: Validate PR title
runs-on: ubuntu-latest
steps:
- uses: amannn/action-semantic-pull-request@v5
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
32 changes: 32 additions & 0 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: Test

on:
pull_request:
branches:
- "*"

jobs:
build:
runs-on: ubuntu-latest

steps:
- name: Checkout Repository
uses: actions/checkout@v3

- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: "16"
registry-url: "https://registry.npmjs.org"

- name: Install Dependencies
run: yarn install

- name: Test
run: yarn test
working-directory: packages/zeta-app-contracts

- name: Test
run: yarn test
working-directory: packages/zevm-app-contracts

10 changes: 10 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ node_modules
!.yarn/sdks
!.yarn/versions


# Hardhat
artifacts
typechain-types
Expand All @@ -20,3 +21,12 @@ tsconfig.tsbuildinfo
# Misc
.env
.DS_Store
.secrets
.wallet.json

# Slither
scripts/slither-results/*
!scripts/slither-results/.gitkeep

**/coverage/*
**/coverage.json
2 changes: 1 addition & 1 deletion .solhint.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"extends": "solhint:recommended",
"rules": {
"compiler-version": ["error", "0.8.9"],
"compiler-version": ["error", "0.8.7"],
"func-visibility": ["warn", { "ignoreConstructors": true }],
"reason-string": ["warn", { "maxLength": 80 }],
"no-empty-blocks": "off",
Expand Down
27 changes: 27 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@

FROM node:16.14-alpine

ENV SHELL /bin/ash
ENV EXECUTE_PROGRAMMATICALLY=true

RUN apk add --update python3 yarn git nodejs make g++

## Install node modules before the code is copied to the container
WORKDIR /home/zetachain/
COPY package*.json ./
COPY packages/zeta-app-contracts/package.json ./packages/zeta-app-contracts/package.json
COPY packages/zevm-app-contracts/package.json ./packages/zevm-app-contracts/package.json
RUN yarn install ; exit 0

COPY . ./
RUN yarn install

RUN yarn add [email protected] [email protected] [email protected] [email protected]

RUN cd packages/zeta-app-contracts && npx hardhat compile && cd -
RUN cd packages/zevm-app-contracts && npx hardhat compile && cd -

WORKDIR /home/zetachain/

ENTRYPOINT ["ash"]

30 changes: 27 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@ ZetaChain is a public, decentralized blockchain and smart contract platform buil

* Utilities to interact with ZetaChain's contracts from your dApp, scripts, or tests.
* Interfaces to easily develop omnichain contracts.
* Omnichain dApp example contracts.
* Protocol native contracts (Zeta Token, Zeta Connector).

## Learn more about ZetaChain

Expand All @@ -32,6 +30,12 @@ ZetaChain is a public, decentralized blockchain and smart contract platform buil

yarn compile

### Packages

#### [Zeta App contracts](packages/zeta-app-contracts)

#### [ZEVM App contracts](packages/zevm-app-contracts)

### Cross-repo commands

#### Package-specific commands
Expand Down Expand Up @@ -62,6 +66,26 @@ yarn lint
yarn lint:fix
```

## Coverage
To check the test coverage run the follow command on the desire package

```bash
npx hardhat coverage
```

## Static test
We run slither on our packages. If you want to run it should install slither

```bash
brew install slither-analyzer
```
and execute it

```bash
slither . --filter-paths "contracts/test/|node_modules/" --exclude naming-convention
```

## Contributing

We welcome (and appreciate) everyone's contributions, if you wanna contribute, read [CONTRIBUTING.md](CONTRIBUTING.md) for next steps.
We welcome (and appreciate) everyone's contributions. If you wanna contribute, read [CONTRIBUTING.md](CONTRIBUTING.md) for next steps.

45 changes: 45 additions & 0 deletions bugbounty.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
## Bug Bounty Overview

ZetaChain is committed to security across all aspects of its ecosystem. To that end, ZetaChain has established a bug bounty program to reward researchers, developers, and users who help identify and report security vulnerabilities.

You can access and report issues at [https://immunefi.com/bounty/zetachain/](https://immunefi.com/bounty/zetachain/).

## Scope

The scope of this bug bounty program is focused on ZetaChain's smart contracts, public-facing APIs, blockchain protocol/infrastructure, and web applications.

## Program Guidelines

1. All reports must be submitted through Immunefi, accessible [here](https://immunefi.com/bounty/zetachain/).
2. Report any suspected vulnerability promptly.
3. Do not attempt to exploit a vulnerability without prior authorization.
4. Do not publicly disclose a vulnerability before it is reported and patched.
5. Do not access data or systems beyond the scope of the vulnerability.
6. Do not use social engineering techniques.
7. Do not attempt to access accounts or personal data of users.

## Rewards

The rewards for successful vulnerability reports range from $5,000 to $100,000, depending on the severity of the issue. All payouts are to be done by the ZetaChain team through Immunefi.

### **Smart Contracts**

| Critical | USD $30,000 to $100,000 |
| --- | --- |
| High | USD $10,000 to $30,000 |
| Medium | USD $10,000 |

### **Websites and Applications**

| Critical | USD $15,000 to $30,000 |
| --- | --- |
| High | USD $5,000 to $15,000 |
| Medium | USD $5,000 |

## Responsible Disclosure

We value responsible disclosure, and we encourage all participants to act responsibly when reporting vulnerabilities.

## Contact

For any questions or concerns, please contact us at [email protected].
Loading
Loading