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

Implement the POL flow #48

Open
wants to merge 142 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
142 commits
Select commit Hold shift + click to select a range
ce6e737
Format configuration and environment files
evercoinx Aug 19, 2024
4fd8877
Fix natspec issue on ChildPool contract
evercoinx Aug 27, 2024
d667817
Fix linter issues
evercoinx Aug 28, 2024
577a04d
Add auxiliary files
evercoinx Aug 28, 2024
7325fc2
Update hardhat configuration
evercoinx Aug 28, 2024
a3f8d52
Add solhint support
evercoinx Aug 28, 2024
980ca5f
Fix solhint issues
evercoinx Aug 28, 2024
742190c
Add local pipeline
evercoinx Aug 29, 2024
ad73c22
Add slitherin support
evercoinx Aug 29, 2024
f425179
Add github workflow
evercoinx Aug 29, 2024
486c3b3
Update environment configuration
evercoinx Aug 29, 2024
81e198d
Upgrade node packages
evercoinx Aug 29, 2024
7715d72
Update prettier and eslint configuration
evercoinx Aug 29, 2024
bc762bc
Add support for POL token on MaticX contract
evercoinx Aug 30, 2024
0c27c8b
Implement method to submit POL
evercoinx Aug 30, 2024
c175e92
Update code style of all tests
evercoinx Aug 30, 2024
a0baa7a
Add npm command to estimate gas
evercoinx Sep 2, 2024
026e74c
Upgrade node packages
evercoinx Sep 2, 2024
9cbfd56
Implement method to request withdraw POL
evercoinx Sep 2, 2024
0af909c
Update solhint configuration
evercoinx Sep 2, 2024
97075a1
Implement method to claim withdrawal POL
evercoinx Sep 3, 2024
f77c97f
Implement method to withdraw rewards POL
evercoinx Sep 3, 2024
dba761f
Implement method to stake rewards and distribute fees POL
evercoinx Sep 3, 2024
54e78c2
Add coverage support
evercoinx Sep 4, 2024
8a022ed
Update contract sizer plugin configuration
evercoinx Sep 4, 2024
45cdba5
Remove instant pool functionality from MaticX contract
evercoinx Sep 4, 2024
c858347
Refactor MaticX contract
evercoinx Sep 4, 2024
5882a67
Upgrade OpenZeppelin contracts
evercoinx Sep 6, 2024
edd98df
Upgrade node packages
evercoinx Sep 6, 2024
87844af
Add environment variables validation
evercoinx Sep 6, 2024
5b12398
Rename variable on MaticX contract
evercoinx Sep 6, 2024
075d66e
Remove INSTANT_POOL_OWNER role from MaticX contract
evercoinx Sep 6, 2024
3a634ac
Implement mainnet forking support for tests
evercoinx Sep 7, 2024
ead090d
Update method to set POL token
evercoinx Sep 8, 2024
4d994ab
Make some methods deprecated on MaticX contract
evercoinx Sep 8, 2024
573574c
Add new tests for MaticX contract
evercoinx Sep 8, 2024
ce8d096
Update natspec comments on MaticX contract
evercoinx Sep 8, 2024
894d7ac
Update imports on some contracts
evercoinx Sep 8, 2024
c1cc3f9
Refactor MaticX contract
evercoinx Sep 9, 2024
40706ff
Add new tests for MaticX contract
evercoinx Sep 10, 2024
a385264
Make improvements to method to request withdrawal
evercoinx Sep 10, 2024
e1a3767
Refactor MaticX contract
evercoinx Sep 11, 2024
7f987f7
Enforce environment variable validation
evercoinx Sep 11, 2024
c9a928e
Make forking mode switchable between tests
evercoinx Sep 11, 2024
2865055
Extend error handling on MaticX contract
evercoinx Sep 12, 2024
1ceff49
Add POL token to ValidatorRegistry contract
evercoinx Sep 12, 2024
40b2de6
Add github workflow for wiki pages
evercoinx Sep 12, 2024
efb8d1e
Update wiki docs
evercoinx Sep 13, 2024
40557da
Fix slither issues
evercoinx Sep 13, 2024
82d742d
Add support for reentrancy guard on MaticX contract
evercoinx Sep 13, 2024
f8c4a5f
Add new tests for MaticX contract
evercoinx Sep 13, 2024
b882e75
Update method to initialize V2 on MaticX contract
evercoinx Sep 14, 2024
87ab531
Update method to initialize V2 on MaticX contract
evercoinx Sep 14, 2024
2f3cb8a
Fix slither issues
evercoinx Sep 14, 2024
f065e7a
Refactor MaticX contract
evercoinx Sep 14, 2024
8ede8f7
Implement method to initialize V2 on ValidatorRegistry contract
evercoinx Sep 14, 2024
fb5107a
Update natspec comments on some contracts
evercoinx Sep 16, 2024
1fb4937
Make improvements to ValidatorRegistry contract
evercoinx Sep 16, 2024
88cc3a9
Add natspec comments to MaticX contract
evercoinx Sep 16, 2024
b1e3e48
Add natspec comments to ValidatorRegistry contract
evercoinx Sep 17, 2024
32e5bfa
Update public API of MaticX contract
evercoinx Sep 17, 2024
dc3d33a
Implement Matic to POL unstaking flow
evercoinx Sep 18, 2024
797a630
Use POL flow for methods to withdraw validator rewards
evercoinx Sep 18, 2024
92e9416
Remove method to set POL token from MaticX contract
evercoinx Sep 18, 2024
7aa2d67
Use POL flow for method to stake rewards and distribute fees
evercoinx Sep 18, 2024
49aea05
Refactor MaticX contract
evercoinx Sep 18, 2024
47b983b
Reformat some interfaces
evercoinx Sep 18, 2024
4e6bc4b
Remove method to mint on MaticX contract
evercoinx Sep 19, 2024
f648c1f
Refactor MaticX contract
evercoinx Sep 19, 2024
0fb9dc7
Update public API of MaticX contract
evercoinx Sep 19, 2024
a2c00c7
Add methods for backward compatibility on MaticX contract
evercoinx Sep 19, 2024
90e4853
Refactor MaticX contract
evercoinx Sep 20, 2024
d7f1644
Reformat source code of some contracts, scripts and tests
evercoinx Sep 20, 2024
48dc919
Update solhint configuration
evercoinx Sep 20, 2024
6e9a672
Upgrade node packages
evercoinx Sep 23, 2024
9e2c7c4
Change output directory for typechain
evercoinx Sep 24, 2024
2a533cb
Upgrade eslint package
evercoinx Sep 24, 2024
fe909f0
Update prettier configuration
evercoinx Sep 24, 2024
790940d
Refactor MaticX contract
evercoinx Sep 24, 2024
18a17ee
Extend error handling on MaticX contract
evercoinx Sep 24, 2024
de9b837
Update natspec comments for MaticX contract
evercoinx Sep 25, 2024
f19e70b
Upgrade node and python packages
evercoinx Sep 25, 2024
a979259
Add npm commands to analyze contracts with mythril
evercoinx Sep 25, 2024
360dba4
Add echidna support
evercoinx Sep 25, 2024
095f29b
Make improvements and optimizations to MaticX contract
evercoinx Sep 26, 2024
029fa36
Extend error handling on ValidatorRegistry contract
evercoinx Sep 26, 2024
17a2fcf
Rename some test files
evercoinx Sep 26, 2024
0cb2a14
Update error handling on some contracts
evercoinx Sep 26, 2024
ddeeac6
Add new tests for ValidatorRegistry contract
evercoinx Sep 27, 2024
4855461
Update error handling on some contracts
evercoinx Sep 28, 2024
86a30b9
Refactor MaticX contract
evercoinx Sep 29, 2024
a4ee1c4
Update parameter names on ValidatorRegistry contract
evercoinx Sep 29, 2024
2b11895
Update public interfaces of external contracts
evercoinx Sep 29, 2024
6889ca1
Fix pragma and imports for some contracts
evercoinx Sep 30, 2024
afa11fe
Implement task to deploy ValidatorRegistry contract
evercoinx Oct 4, 2024
f0c5846
Move out tasks from hardhat configuration
evercoinx Oct 4, 2024
eaec822
Implement task to deploy MaticX contract
evercoinx Oct 4, 2024
fe1db46
Extend github CI workflow
evercoinx Oct 4, 2024
bf65e14
Implement task to upgrade contract
evercoinx Oct 5, 2024
1b586ed
Fix some scripts
evercoinx Oct 5, 2024
94eb2f6
Implement task to verify contract
evercoinx Oct 5, 2024
e031965
Add new make commands
evercoinx Oct 6, 2024
6c7a933
Update hardhat configuration
evercoinx Oct 6, 2024
00011e0
Add support for amoy and polygon networks
evercoinx Oct 6, 2024
9960b04
Add support for ankr provider
evercoinx Oct 6, 2024
e2cdd42
Update hardhat configuration
evercoinx Oct 6, 2024
85b3035
Implement task to import contract
evercoinx Oct 7, 2024
8bdb5c5
Upgrade node packages
evercoinx Oct 9, 2024
cbe7c49
Replace holesky network with sepolia
evercoinx Oct 9, 2024
274adaf
Add deployment info for sepolia network
evercoinx Oct 9, 2024
514ebfa
Implement task to initialize v2 ValidatorRegistry contract
evercoinx Oct 9, 2024
c1f13d6
Implement task to initialize v2 MaticX contract
evercoinx Oct 9, 2024
08fccd1
Update contract verification mechanism
evercoinx Oct 9, 2024
4f8481e
Update project dependencies
evercoinx Oct 10, 2024
d0f1e98
Deploy MaticX contract into sepolia network
evercoinx Oct 10, 2024
ae75aba
Implement task to deploy FxStateRootTunnel contract
evercoinx Oct 10, 2024
8919b22
Deploy FxStateRootTunnel contract into sepolia network
evercoinx Oct 10, 2024
2ab3a85
Drop support of OZ defender
evercoinx Oct 11, 2024
1bbcbbc
Fix Bailsec Issue_02 and Issue_03
evercoinx Oct 11, 2024
7c0b24a
Fix Bailsec Issue_08, Issue_10 and Issue_24
evercoinx Oct 12, 2024
7da77c0
Fix Bailsec Issue_13
evercoinx Oct 13, 2024
36da08f
Fix Bailsec Issue_12
evercoinx Oct 14, 2024
b8e2aaf
Fix Bailsec Issue_16
evercoinx Oct 14, 2024
8d3dd4b
Update initialization v2 of some contracts
evercoinx Oct 14, 2024
7ec646a
Fix Bailsec Issue_21
evercoinx Oct 19, 2024
3f234e8
Fix Bailsec Issue_19
evercoinx Oct 19, 2024
6f21c33
Fix Bailsec Issue_16
evercoinx Oct 28, 2024
6892fae
Update script to upgrade contract
evercoinx Oct 28, 2024
ac1bc92
Upgrade ValidatorRegistry and MaticX contracts in sepolia network
evercoinx Oct 28, 2024
6beaf00
Implement task to deploy ChildPool contract
evercoinx Nov 3, 2024
14ddee3
Add backward compatibility for instant pool on MaticX contract
evercoinx Nov 3, 2024
dd1a7f4
Upgrade MaticX contract in sepolia network
evercoinx Nov 3, 2024
3b5d779
Implement task to deploy FxStateChildTunnel contract
evercoinx Nov 4, 2024
cf7cf90
Deploy FxStateChildTunnel contract into amoy network
evercoinx Nov 4, 2024
6ae3625
Upgrade hardhat to latest major version
evercoinx Nov 4, 2024
6fc857e
Migrate some tests to ethers v6
evercoinx Nov 4, 2024
81d2359
Implement UChildERC20 contract
evercoinx Nov 4, 2024
32df307
Implement task to deploy UChildERC20 contract
evercoinx Nov 5, 2024
23c9f27
Deploy MaticX and ChildPool contracts into amoy network
evercoinx Nov 5, 2024
a799f8c
Update contract structure
evercoinx Nov 5, 2024
40ad7a1
Migrate some tests to ethers v6
evercoinx Nov 6, 2024
b2799a5
Rename test files
evercoinx Nov 6, 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
15 changes: 15 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
root = true

[*]
charset = utf-8
insert_final_newline = true
end_of_line = lf
indent_style = tab
indent_size = 4
max_line_length = 80

[*.yaml]
indent_size = 2

[Makefile]
indent_style = tab
15 changes: 15 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
RPC_PROVIDER=ankr
SEPOLIA_API_KEY=1234567890ABCDEF1234567890abcdef
AMOY_API_KEY=1234567890ABCDEF1234567890abcdef
ETHEREUM_API_KEY=1234567890ABCDEF1234567890abcdef
POLYGON_API_KEY=1234567890ABCDEF1234567890abcdef
ETHERSCAN_API_KEY=1234567890ABCDEF1234567890abcdef12
POLYGONSCAN_API_KEY=1234567890ABCDEF1234567890abcdef12
FORKING_BLOCK_NUMBER=20700204
COINMARKETCAP_API_KEY=
GAS_REPORTER_NETWORK=ethereum
GAS_PRICE_GWEI=0
REPORT_GAS=false
DEPLOYER_MNEMONIC="test test test test test test test test test test test junk"
DEPLOYER_PASSPHRASE=
DEPLOYER_ADDRESS=0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266
18 changes: 10 additions & 8 deletions .env.test.example
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
DEPLOYER_PRIVATE_KEY=
ETHERSCAN_API_KEY=
ROOT_CHAIN_RPC=
ROOT_GAS_PRICE=
CHILD_CHAIN_RPC=
CHILD_GAS_PRICE=
DEPLOYER_PRIVATE_KEY=1234567890ABCDEF1234567890abcde1234567890ABCDEF1234567890abcdeff
ETHERSCAN_API_KEY=1234567890ABCDEF1234567890abcdef12
ROOT_CHAIN_RPC=https://rpc.ankr.com/eth
ROOT_GAS_PRICE=0
CHILD_CHAIN_RPC=https://rpc.ankr.com/polygon
CHILD_GAS_PRICE=0
STAKE_MANAGER=
MATIC_TOKEN=
MANAGER=
Expand All @@ -12,5 +12,7 @@ TREASURY=
FX_ROOT=
FX_CHILD=
CHECKPOINT_MANAGER=
DEFENDER_TEAM_API_KEY=
DEFENDER_TEAM_API_SECRET_KEY=
DEFENDER_TEAM_API_KEY=1234567890ABCDEF1234567890abcdef
DEFENDER_TEAM_API_SECRET_KEY=1234567890ABCDEF1234567890abcde1234567890ABCDEF1234567890abcdeff
FORKING_ROOT_BLOCK_NUMBER=20700204
blockgroot marked this conversation as resolved.
Show resolved Hide resolved
REPORT_GAS=false
5 changes: 0 additions & 5 deletions .eslintignore

This file was deleted.

46 changes: 0 additions & 46 deletions .eslintrc.js

This file was deleted.

1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
*.sol linguist-language=Solidity
77 changes: 77 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
name: CI
on:
workflow_dispatch:
push:
branches:
- "**"
jobs:
test:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: ["20.15.x"]
python-version: ["3.12"]
solidity-version: ["0.8.7"]
steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Setup node ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: npm

- name: Setup python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
check-latest: true
cache: pip

- name: Install node dependencies
run: npm ci

- name: Install python dependencies
run: |
pip install -U pip setuptools
pip install -q -r requirements.txt

- name: Configure solidity compiler
run: |
solc-select install ${{ matrix.solidity-version }}
solc-select use ${{ matrix.solidity-version }}

- name: Clean artifacts
run: npm run clean

- name: Compile contracts
run: npm run compile

- name: Lint code
run: npm run lint

- name: Check contracts with linter
run: npm run check

- name: Analyze contracts with static analyzer
run: npm run analyze:ci

- name: Run unit tests
run: npm run test:ci

- name: Deploy contracts into hardhat network
run: make hardhat

- name: Save contract artifacts
uses: actions/upload-artifact@v4
with:
name: contracts
path: |
artifacts/contracts/
!artifacts/contracts/**/*.dbg.json
!artifacts/contracts/interfaces/
!artifacts/contracts/libraries/
!artifacts/contracts/mocks/
!artifacts/contracts/state-transfer/
retention-days: 30
31 changes: 31 additions & 0 deletions .github/workflows/wiki.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Wiki
on:
workflow_dispatch:
push:
branches:
- main
- pol-flow
jobs:
wiki:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
path: maticX

- name: Checkout wiki repository
uses: actions/checkout@v4
with:
repository: stader-labs/maticX.wiki
path: maticX.wiki

- name: Mirror docs to wiki
run: |
cd $GITHUB_WORKSPACE/maticX.wiki
git config user.name Actions
git config user.email [email protected]
cp $GITHUB_WORKSPACE/maticX/docs/*.md $GITHUB_WORKSPACE/maticX.wiki
git add .
git diff-index --quiet HEAD -- || git commit -m "Mirror docs to wiki"
git push
26 changes: 13 additions & 13 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
node_modules
.idea/
.vscode/
artifacts/
cache/
coverage/
crytic-corpus/
crytic-export/
node_modules/
typechain-types/
.DS_Store
.env
.env.test

#Hardhat files
cache
artifacts
typechain

.openzeppelin

.idea

#test coverage logs
.solcx-lock-*
coverage.json
coverage/
mochaOutput.json
testMatrix.json
1 change: 1 addition & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
npm run format && npm run lint && npm run check && npm test
Loading