Skip to content
This repository was archived by the owner on Mar 1, 2024. It is now read-only.

Commit 50a2dc0

Browse files
authored
Merge pull request #502 from maticnetwork/stage
POL updates, migration to Foundry/Hardhat
2 parents f15e4be + 6255127 commit 50a2dc0

File tree

306 files changed

+32723
-29672
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

306 files changed

+32723
-29672
lines changed

.babelrc

-3
This file was deleted.

.editorconfig

-14
This file was deleted.

.env.example

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
INFURA_TOKEN="909b972ab2ff3afb8b0f8f6a9667test"
2+
BOR_CHAIN_URL="http://localhost:9545"
3+
ENV="local"
4+
MNEMONIC_DEV="poly radar mass judge dismiss just intact mind resemble fringe diary casino"

.eslintrc.js

-17
This file was deleted.

.github/workflows/ci.yml

+41-20
Original file line numberDiff line numberDiff line change
@@ -2,30 +2,51 @@ name: CI
22

33
on:
44
push:
5-
branches:
5+
branches:
66
- main
77
pull_request:
88

99
jobs:
1010
build:
1111
runs-on: ubuntu-latest
1212
steps:
13-
- uses: actions/checkout@v2
14-
- name: Setup Node.js environment
15-
uses: actions/setup-node@v2-beta
16-
with:
17-
node-version: '10.x'
18-
registry-url: 'https://registry.npmjs.org'
19-
- name: Cache npm dependencies
20-
uses: actions/cache@v1
21-
with:
22-
path: ~/.npm
23-
key: ${{ runner.OS }}-npm-cache-${{ hashFiles('**/package-lock.json') }}
24-
restore-keys: |
25-
${{ runner.OS }}-npm-cache-
26-
- name: Install npm dependencies
27-
run: npm install
28-
- name: Process templates
29-
run: npm run template:process
30-
- name: Run tests
31-
run: npm run test:ci
13+
- uses: actions/checkout@v4
14+
15+
- name: Setup Node.js environment
16+
uses: actions/setup-node@v4
17+
with:
18+
node-version: "20.x"
19+
registry-url: "https://registry.npmjs.org"
20+
21+
- name: Cache npm dependencies
22+
uses: actions/cache@v4
23+
with:
24+
path: ~/.npm
25+
key: ${{ runner.OS }}-npm-cache-${{ hashFiles('./package-lock.json') }}
26+
restore-keys: |
27+
${{ runner.OS }}-npm-cache-
28+
29+
- name: Install npm dependencies
30+
run: npm install
31+
32+
- name: Process templates
33+
run: npm run template:process
34+
35+
- name: Run Coverage and Hardhat tests
36+
run: npm run test:ci
37+
38+
- name: Install Foundry
39+
uses: foundry-rs/foundry-toolchain@v1
40+
with:
41+
version: nightly
42+
43+
- name: Run Forge build
44+
run: |
45+
forge --version
46+
forge build --sizes
47+
id: build
48+
49+
- name: Run Forge tests
50+
run: |
51+
forge test -vvv
52+
id: test

.gitignore

+10-6
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,26 @@
11
node_modules
2-
build
2+
artifacts
3+
out
34
contractAddresses.json
5+
.vscode
6+
47

58
# ignore generated files
69
contracts/root/predicates/TransferWithSigUtils.sol
710
contracts/common/mixin/ChainIdMixin.sol
8-
test-blockchain/genesis.json
9-
test-blockchain/start.sh
1011
test/helpers/marketplaceUtils.js
12+
cache_hardhat
13+
forge-cache
14+
1115

12-
test-blockchain/geth
13-
test-blockchain/history
14-
test-blockchain/data
16+
test-bor-docker/history
17+
test-bor-docker/data
1518

1619
*.pid
1720
*.log
1821

1922
.DS_Store
23+
.vscode
2024
*.env
2125

2226
coverage/

.gitmodules

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
[submodule "lib/solady"]
2+
path = lib/solady
3+
url = https://github.com/vectorized/solady
4+
[submodule "lib/deployment-log-generator"]
5+
path = lib/deployment-log-generator
6+
url = https://github.com/0xPolygon/deployment-log-generator
7+
[submodule "lib/contract-deployer-template"]
8+
path = lib/contract-deployer-template
9+
url = https://github.com/0xPolygon/contract-deployer-template
10+
[submodule "lib/storage-layout-checker"]
11+
path = lib/storage-layout-checker
12+
url = https://github.com/0xPolygon/storage-layout-checker

.nvmrc

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
11.1.0
1+
20.6.0

.pre-commit-config.yaml

+30
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
repos:
2+
- repo: https://github.com/pre-commit/pre-commit-hooks
3+
rev: v4.5.0
4+
hooks:
5+
- id: mixed-line-ending
6+
args: ["--fix=lf"]
7+
description: Forces to replace line ending by the UNIX 'lf' character.
8+
exclude: "^docs/autogen"
9+
- repo: local
10+
hooks:
11+
- id: format
12+
name: Format solidity code
13+
description: Format solidity code with `forge fmt`
14+
language: system
15+
entry: forge fmt
16+
exclude: "^lib/"
17+
pass_filenames: true
18+
- id: doc
19+
name: Generate documentation
20+
description: Generate docs with `forge doc`
21+
language: system
22+
# generates docs and unstages files if only the commit hash changed within the file, this way only when the documentation is updated, the documentation needs to be regenerated and only the changed files are pushed
23+
entry: "scripts/util/doc_gen.sh"
24+
pass_filenames: false
25+
- repo: https://github.com/pre-commit/mirrors-prettier
26+
rev: "v3.0.3"
27+
hooks:
28+
- id: prettier
29+
name: Format non solidity files with prettier
30+
exclude: "^docs/autogen"

.prettierrc

+10
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,16 @@
1010
"bracketSpacing": false,
1111
"explicitTypes": "always"
1212
}
13+
},
14+
{
15+
"files": "*.js",
16+
"options": {
17+
"semi": false,
18+
"singleQuote": true,
19+
"tabWidth": 2,
20+
"printWidth": 120,
21+
"trailingComma": "none"
22+
}
1323
}
1424
]
1525
}

.solcover.cjs

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
module.exports = {
2+
mocha: {
3+
grep: "@skip-on-coverage", // Find everything with this tag
4+
invert: true, // Run the grep's inverse set.
5+
},
6+
compileCommand: "npx hardhat compile",
7+
};

.solcover.js

-14
This file was deleted.

.soliumrc.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
"no-unused-vars": 1,
1515
"quotes": 1,
1616
"error-reason": 0,
17-
"indentation": ["error", 2],
17+
"indentation": ["error", 4],
1818
"arg-overflow": ["error", 8],
1919
"whitespace": 1,
2020
"deprecated-suicide": 1,

0 commit comments

Comments
 (0)