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

Initial release #4

Merged
merged 90 commits into from
Dec 9, 2023
Merged
Show file tree
Hide file tree
Changes from 87 commits
Commits
Show all changes
90 commits
Select commit Hold shift + click to select a range
9127bf4
chore: forge init
gretzke Oct 23, 2023
31acb27
forge install: forge-std
gretzke Oct 23, 2023
c7d88c5
Update foundry.toml
gretzke Oct 23, 2023
db65789
forge install: openzeppelin-contracts
gretzke Oct 24, 2023
af3db4f
forge install: openzeppelin-contracts-upgradeable
gretzke Oct 24, 2023
fa788fd
Add remappings
gretzke Oct 24, 2023
b2445eb
Create CODEOWNERS
gretzke Oct 24, 2023
1141ec9
Update .gitignore
gretzke Oct 24, 2023
c936b83
Create .nvmrc
gretzke Oct 24, 2023
8d9e347
Create .prettierrc
gretzke Oct 24, 2023
b3fb07b
Create .prettierignore
gretzke Oct 24, 2023
b4d6c1c
Create .env.example
gretzke Oct 24, 2023
7d9fd43
Create SECURITY.md
gretzke Oct 24, 2023
80c8e79
Create slither.config.json
gretzke Oct 24, 2023
4a32396
Add MIT License
gretzke Oct 24, 2023
9aa8163
Implement best practices
gretzke Oct 24, 2023
8733bac
Add deployment scripts
gretzke Oct 24, 2023
97cb875
add pre commit hooks for documentation and formatting
gretzke Nov 3, 2023
b77f93b
Run tests on PRs, only trigger docs when content changed
gretzke Nov 3, 2023
cdf98d8
rename directory for autogenerated docs
gretzke Nov 3, 2023
0cb7b9a
readme draft
simonDos Nov 3, 2023
f7d1865
create PR template
simonDos Nov 3, 2023
9427497
chore: update foundry.toml
ZeroEkkusu Nov 3, 2023
feee8bf
feat: change Counter
ZeroEkkusu Nov 3, 2023
60aa7f7
script: add deployer generator
ZeroEkkusu Nov 3, 2023
2679d55
script: add Deploy script
ZeroEkkusu Nov 3, 2023
a9f2dec
test: add basic tests
ZeroEkkusu Nov 3, 2023
06cb743
Run pre-commit
gretzke Nov 3, 2023
04498da
script: add ScriptHelpers
ZeroEkkusu Nov 3, 2023
6309130
chore: remove Counter script
ZeroEkkusu Nov 3, 2023
204ad2b
test: add complete tests
ZeroEkkusu Nov 3, 2023
1982945
feat: use solc 0.8.22
ZeroEkkusu Nov 3, 2023
68d1a29
Add formatter options, run pre-compile
gretzke Nov 4, 2023
cb433f2
small fixes
gretzke Nov 4, 2023
284d7cf
Update Readme & Contributing
gretzke Nov 4, 2023
281cb55
chore: fix misc
ZeroEkkusu Nov 5, 2023
a6e4ff8
Update README.md
gretzke Nov 6, 2023
6f92d1c
Update README.md
gretzke Nov 6, 2023
8ebe47a
docs: update `README`
ZeroEkkusu Nov 6, 2023
9805774
small fixes
gretzke Nov 6, 2023
35e8151
feat: storage checker V1
ZeroEkkusu Nov 7, 2023
d98b6a1
fix: correct path
ZeroEkkusu Nov 7, 2023
d51791f
check whether PR into main is from staging
gretzke Nov 8, 2023
1d24fdd
echo branches
gretzke Nov 8, 2023
f86fd2a
Add code style guideline
gretzke Nov 10, 2023
1a4b53a
forge install: solady
gretzke Nov 10, 2023
3982c56
fix: make compatible with OZ 5.0
ZeroEkkusu Nov 22, 2023
2b8045b
rm: storage checker program
ZeroEkkusu Nov 22, 2023
07212e5
forge install: storage-layout-checker
ZeroEkkusu Nov 22, 2023
fc8464f
revert: forge install
ZeroEkkusu Nov 22, 2023
2230b5b
feat: add extractor.js
ZeroEkkusu Nov 24, 2023
b20ef6c
wait for artifacts to build
gretzke Nov 25, 2023
eee3aec
chore: force trailing comma
DhairyaSethi Nov 27, 2023
13bada3
feat(extract.js): rm input section, add inputs with new spec
DhairyaSethi Nov 27, 2023
ddcb44b
fix: disable initializers
ZeroEkkusu Nov 27, 2023
f929f8b
feat: robust extractor
ZeroEkkusu Nov 27, 2023
0721cfa
script: json -> sol
ZeroEkkusu Nov 27, 2023
254805b
test: update tests
ZeroEkkusu Nov 27, 2023
594f16a
chore: rename to extractAndSaveJson
DhairyaSethi Nov 28, 2023
2074901
fix: use extractAndSaveJson, add initializationTxn link
DhairyaSethi Nov 28, 2023
575ecf6
chore: isolate md generation
DhairyaSethi Nov 28, 2023
c5bf6ad
feat: md gen, add dynamic projectmetadata
DhairyaSethi Nov 28, 2023
d7e9dd6
feat: skipJsonFlag
DhairyaSethi Nov 28, 2023
47d0207
fix: rm fetch usage
DhairyaSethi Nov 28, 2023
dbcc0d9
docs: correct docs
ZeroEkkusu Nov 28, 2023
cf02f53
chore: clean up
ZeroEkkusu Nov 28, 2023
c7c2f5c
fix: simplify 1/2
ZeroEkkusu Nov 28, 2023
177d6ff
forge install: deployment-log-generator
ZeroEkkusu Nov 28, 2023
a2c8114
forge install: storage-layout-checker
ZeroEkkusu Nov 28, 2023
2d36094
forge install: contract-deployer-template
ZeroEkkusu Nov 28, 2023
4a06535
add features in Readme
simonDos Nov 29, 2023
8bb2c11
fix(script): make inputs safer
ZeroEkkusu Nov 29, 2023
e3be09e
adjust nvmrc and fix link
gretzke Nov 30, 2023
eda6f3a
fix pre-commit
gretzke Dec 1, 2023
40c6b99
forge install: contract-deployer-template
gretzke Dec 2, 2023
0b5490d
Update scripts and tests for new deployer template
gretzke Dec 2, 2023
61bc3a7
bump solidity version
gretzke Dec 3, 2023
e78768d
do not format autogenerated deployment logs
gretzke Dec 3, 2023
cabbe16
update libs
gretzke Dec 5, 2023
572f355
MIT + Apache 2 License
gretzke Dec 7, 2023
379ebee
Update documentation
gretzke Dec 7, 2023
27d52d2
forge install: deployment-log-generator
gretzke Dec 7, 2023
6856cba
fix links
gretzke Dec 7, 2023
3cf4270
update libraries
gretzke Dec 7, 2023
1b170ac
license update
gretzke Dec 7, 2023
332407d
update libraries
gretzke Dec 8, 2023
535607e
Merge pull request #1 from 0xPolygon/dev
gretzke Dec 8, 2023
3f41ae6
remove unused file
gretzke Dec 8, 2023
6fb9a14
Add .password to gitignore in case of wallet management using cast
gretzke Dec 8, 2023
b696fdf
forge install: storage-layout-checker
gretzke Dec 9, 2023
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
5 changes: 5 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
PRIVATE_KEY=
INFURA_KEY=
ETHERSCAN_API_KEY=
POLYGONSCAN_API_KEY=
POLYGONSCAN_ZKEVM_API_KEY=
4 changes: 4 additions & 0 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# This group is setup to ensure a security review is always required for PRs
/src/ @0xPolygon/internal-security
/script/**/*.sol @0xPolygon/internal-security
/deployments/ @0xPolygon/internal-security
48 changes: 48 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
# Pull Request

## Description

Please include a summary of the change and which feature was implemented or which issue was fixed. Also, include relevant motivation and context. List any dependencies that are required for this change.

Fixes # (issue)

### How Has This Been Tested?

Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration.

# Checklist:

Before deployment

- [ ] 100% test and branch coverage
- [ ] check slither for severe issues
- [ ] fuzz and invariant tests (when applicable)
- [ ] formal verification (when applicable)
- [ ] deployment or upgrade scripts ready
- [ ] version management agreed upon and implemented
- [ ] internal team review
- [ ] **Security Team review**

After deployment

- [ ] transfer ownership after deployments (when applicable)
- [ ] complete upgrade (when applicable)
- [ ] generate deployment/upgrade log files
- [ ] update [static](https://github.com/maticnetwork/static/tree/master/network) with new contract address and/or version

---

### Considerations

- I have followed the [contributing guidelines](../CONTRIBUTING.md).
- My code follows the style guidelines of this project and I have run `forge fmt` and prettier to ensure the code style is valid
- I have performed a self-review of my own code
- I have commented my code, particularly in hard-to-understand areas
- I have made corresponding changes to the documentation
- My changes generate no new warnings
- I have added tests that prove my fix is effective or that my feature works
- New and existing unit tests pass locally with my changes

### Additional context

Add any other context about the pull request here.
24 changes: 24 additions & 0 deletions .github/workflows/pr-check.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: Source branch check
on:
pull_request:
branches: [main]
types:
- opened
- reopened
- synchronize
- edited
jobs:
check-main:
if: github.base_ref == 'main'
runs-on: ubuntu-latest
steps:
- name: Log
run: |
echo "Base ref: ${{ github.base_ref }}"
echo "Head ref: ${{ github.head_ref }}"
- name: Check branches
run: |
if [ ${{ github.head_ref }} != "staging" ]; then
echo "Merge requests to main branch are only allowed from staging branch."
exit 1
fi
21 changes: 21 additions & 0 deletions .github/workflows/pre-commit.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# checks that pre-commit hooks pass before allowing to merge a PR

name: pre-commit
on:
pull_request:
branches: [main, master, staging, dev, feat/**, fix/**]

jobs:
pre-commit:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v2
with:
submodules: recursive
- name: Install Foundry
uses: foundry-rs/foundry-toolchain@v1
- name: Install pre-commit
run: pip install pre-commit
- name: Run pre-commit
run: pre-commit run --all-files
36 changes: 36 additions & 0 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: test

on:
pull_request:
branches: [main, master, staging, dev, feat/**, fix/**]

env:
FOUNDRY_PROFILE: ci

jobs:
check:
strategy:
fail-fast: true

name: Foundry project
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
submodules: recursive

- name: Install Foundry
uses: foundry-rs/foundry-toolchain@v1
with:
version: nightly

- name: Run Forge build
run: |
forge --version
forge build --sizes
id: build

- name: Run Forge tests
run: |
forge test -vvv
id: test
14 changes: 14 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
/target
/out
/cache
/coverage
lcov.info
.DS_Store
.env
.vscode

broadcast/*/31337
deployments/**/31337.*

script/util/storage_check_cache
script/util/storage_check_report
18 changes: 18 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
[submodule "lib/forge-std"]
path = lib/forge-std
url = https://github.com/foundry-rs/forge-std
[submodule "lib/openzeppelin-contracts"]
path = lib/openzeppelin-contracts
url = https://github.com/openzeppelin/openzeppelin-contracts
[submodule "lib/openzeppelin-contracts-upgradeable"]
path = lib/openzeppelin-contracts-upgradeable
url = https://github.com/openzeppelin/openzeppelin-contracts-upgradeable
[submodule "lib/solady"]
path = lib/solady
url = https://github.com/vectorized/solady
[submodule "lib/deployment-log-generator"]
path = lib/deployment-log-generator
url = https://github.com/0xPolygon/deployment-log-generator
[submodule "lib/contract-deployer-template"]
path = lib/contract-deployer-template
url = https://github.com/0xPolygon/contract-deployer-template
1 change: 1 addition & 0 deletions .nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
18
30 changes: 30 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.5.0
hooks:
- id: mixed-line-ending
args: ["--fix=lf"]
description: Forces to replace line ending by the UNIX 'lf' character.
exclude: "^docs/autogen"
- repo: local
hooks:
- id: format
name: Format solidity code
description: Format solidity code with `forge fmt`
language: system
entry: forge fmt
exclude: "^lib/"
pass_filenames: true
- id: doc
name: Generate documentation
description: Generate docs with `forge doc`
language: system
# 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
entry: "script/util/doc_gen.sh"
pass_filenames: false
- repo: https://github.com/pre-commit/mirrors-prettier
rev: "v3.0.3"
hooks:
- id: prettier
name: Format non solidity files with prettier
exclude: "^docs/autogen"
7 changes: 7 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
foundry.toml
out
lib/
cache/
docs/autogenerated
*.sol
deployments/
26 changes: 26 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
{
"printWidth": 120,
"tabWidth": 2,
"useTabs": false,
"singleQuote": false,
"bracketSpacing": true,
"trailingComma": "all",
"overrides": [
{
"files": "*.sol",
"options": {
"printWidth": 120,
"tabWidth": 4,
"useTabs": false,
"singleQuote": false,
"bracketSpacing": false
}
},
{
"files": "*.json",
"options": {
"tabWidth": 4
}
}
]
}
Loading
Loading