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

Feature/ongoing pp #354

Open
wants to merge 210 commits into
base: develop
Choose a base branch
from
Open
Changes from 3 commits
Commits
Show all changes
210 commits
Select commit Hold shift + click to select a range
bbe1b35
ongoing
invocamanman Jul 3, 2024
81fe6c9
ongoing
invocamanman Jul 8, 2024
1f723c3
ongoing
invocamanman Jul 8, 2024
e6111ee
wip update polygonRollupManager
laisolizq Jul 11, 2024
45912c5
wip new polygon consensus contract
laisolizq Jul 11, 2024
3b3fcd7
review
laisolizq Jul 15, 2024
55029f8
review consensus contract
laisolizq Jul 15, 2024
5136a6c
review PR
laisolizq Jul 15, 2024
1e3c96c
small fixes to compile
invocamanman Jul 16, 2024
0520738
Implement PP at add new rollupType
ignasirv Jul 16, 2024
f0a993c
ongoign
invocamanman Jul 17, 2024
81a372a
now compiles
invocamanman Jul 17, 2024
3ee556c
hi
invocamanman Jul 17, 2024
9ad9c33
wip
krlosMata Jul 17, 2024
a267651
empty commit signed
invocamanman Jul 17, 2024
4c12976
verify PP
krlosMata Jul 18, 2024
591a6ca
rollup.verifier --> address type. Load interface depending on verify …
krlosMata Jul 18, 2024
116454f
fixes
invocamanman Jul 19, 2024
d80cd1e
mini updates
laisolizq Jul 18, 2024
87e91ac
review PR
laisolizq Jul 19, 2024
a3fc69f
fix compilation
invocamanman Jul 20, 2024
7473921
Update events for PP
ignasirv Jul 18, 2024
f9eca7b
sudo in docker script. Comments PR
krlosMata Jul 22, 2024
b19aafd
fix dockerv2 sudo
laisolizq Jul 22, 2024
77dc579
update scripts deploy-docker
laisolizq Jul 23, 2024
c70866c
update docs-compiledcontracts
krlosMata Jul 23, 2024
1ffa27a
ongoing
invocamanman Jul 3, 2024
089288a
ongoing
invocamanman Jul 8, 2024
70519e3
ongoing
invocamanman Jul 8, 2024
3fab639
wip update polygonRollupManager
laisolizq Jul 11, 2024
6be961b
wip new polygon consensus contract
laisolizq Jul 11, 2024
ff3220c
review
laisolizq Jul 15, 2024
c552eea
review consensus contract
laisolizq Jul 15, 2024
a268254
review PR
laisolizq Jul 15, 2024
1597d8f
small fixes to compile
invocamanman Jul 16, 2024
81d3c5c
Implement PP at add new rollupType
ignasirv Jul 16, 2024
b0ef71c
ongoign
invocamanman Jul 17, 2024
9c34d74
now compiles
invocamanman Jul 17, 2024
2324b1a
hi
invocamanman Jul 17, 2024
36ed20c
wip
krlosMata Jul 17, 2024
794e10d
empty commit signed
invocamanman Jul 17, 2024
60725a2
verify PP
krlosMata Jul 18, 2024
2cb2e20
rollup.verifier --> address type. Load interface depending on verify …
krlosMata Jul 18, 2024
942c65a
fixes
invocamanman Jul 19, 2024
f8c33cf
mini updates
laisolizq Jul 18, 2024
d48660c
review PR
laisolizq Jul 19, 2024
b15cacf
fix compilation
invocamanman Jul 20, 2024
77a9b46
Update events for PP
ignasirv Jul 18, 2024
e412d4b
sudo in docker script. Comments PR
krlosMata Jul 22, 2024
1f93373
fix dockerv2 sudo
laisolizq Jul 22, 2024
c4ee4ab
update scripts deploy-docker
laisolizq Jul 23, 2024
82f59ad
update docs + fox zeroAddress
krlosMata Jul 23, 2024
eb1e9af
update contracts tests
laisolizq Jul 24, 2024
1b328ce
ignore PolygonRollupManagerUpgrade test
laisolizq Jul 25, 2024
7a61a94
WIP
krlosMata Jul 25, 2024
f696419
test full pesismistic
krlosMata Jul 26, 2024
ae107da
new getters rollupData. All tests passing
krlosMata Jul 26, 2024
fdda2b3
rename _legacy... to _
krlosMata Jul 30, 2024
5225b1f
increase coverage
krlosMata Jul 30, 2024
da25752
add edge case
krlosMata Jul 30, 2024
3c7d6c8
all coverage
krlosMata Jul 31, 2024
fcf9142
fix eslint
krlosMata Jul 31, 2024
cebd5b8
add rollupID as a public input
krlosMata Aug 1, 2024
a1dd5a1
remove incorrect comment
krlosMata Aug 1, 2024
b3c3101
missing checkout on gha docker-build
krlosMata Aug 2, 2024
9735b85
returnData V2
krlosMata Aug 2, 2024
f508836
fix build docker
krlosMata Aug 2, 2024
0ae4063
mini thingds
invocamanman Aug 5, 2024
1a3fc82
move function
invocamanman Aug 5, 2024
e077054
mini fix
invocamanman Aug 18, 2024
65f9710
compiled and docs
invocamanman Aug 18, 2024
4fb1711
udpate PP
invocamanman Aug 18, 2024
00216b5
Spellcheck
ignasirv Aug 20, 2024
a2384a5
Add rollupManager initializer versioning
ignasirv Aug 22, 2024
cceaa7a
Add version in constant
ignasirv Aug 27, 2024
ad20201
github comments
ignasirv Aug 29, 2024
f8fcc1d
Move to constants
ignasirv Aug 29, 2024
c9cb821
selecterGER --> l1InfoTreeLeafCount
krlosMata Aug 29, 2024
0b9e04f
add _disableInitializers();
krlosMata Aug 30, 2024
9f7b676
hidden typo
krlosMata Aug 30, 2024
f0ba99b
Setup for sp1 e2e testing
ignasirv Sep 9, 2024
e52f54e
fix build dockerv2:contracts
laisolizq Sep 12, 2024
acf1d85
update forkID=11 docker build
laisolizq Sep 13, 2024
67ae71b
fix lint
laisolizq Sep 13, 2024
5c48e01
token wrapped bridge contract
invocamanman Sep 13, 2024
df75d51
get ABI from compiled-contracts
krlosMata Sep 15, 2024
713ef56
rename to TokenWrappedBridge
krlosMata Sep 15, 2024
5aaa318
fix test
krlosMata Sep 15, 2024
533f053
minor fixes on tools
krlosMata Sep 5, 2024
095fdf2
cherry-pick 4af640cfb84b4841450d335dc5a5c0cd4d800cea
krlosMata Sep 15, 2024
25d847d
disable initializer=false
krlosMata Sep 23, 2024
48b7bbc
Merge pull request #340 from 0xPolygonHermez/feature/fix-initilaize
invocamanman Sep 26, 2024
d05367e
audit remediations
krlosMata Oct 3, 2024
289b8ad
support deployment real sp1 verifier & update tools
krlosMata Oct 6, 2024
d5de496
Merge pull request #341 from 0xPolygonHermez/feature/audit-changes
invocamanman Oct 7, 2024
f57c655
PR review
krlosMata Oct 7, 2024
d0b44f2
Merge pull request #342 from 0xPolygonHermez/feature/real-sp1-verifier
invocamanman Oct 7, 2024
d947b94
Update e2e with l1InfoTree + upgrade verifier to v2
ignasirv Oct 7, 2024
82d3577
Merge pull request #343 from 0xPolygonHermez/feature/sp1-e2e-update
invocamanman Oct 7, 2024
2b044eb
Recover reference url comments
ignasirv Oct 7, 2024
f5a359b
Bridge implementation for sovereign chains + tests
ignasirv Sep 12, 2024
a612420
finish injected batch data for pessimisic consensus
krlosMata Oct 11, 2024
0440e6c
Internal audit fixes + new coverage
ignasirv Oct 21, 2024
8f5e753
Add weth at genesis + other review improvements
ignasirv Oct 22, 2024
2a3ebd7
Improve WETH comments at bridge contract
ignasirv Oct 24, 2024
29023ea
typos
ignasirv Oct 24, 2024
f1227e4
Review fixes
ignasirv Oct 29, 2024
ddfd159
Remove system address from final genesis state
ignasirv Nov 5, 2024
63a89fe
Merge pull request #330 from 0xPolygonHermez/feature/sovereign-bridge
ignasirv Nov 5, 2024
967376e
Upgrade sp1 verifier to v3 + improve comment at bridgev2
ignasirv Oct 29, 2024
3157872
Merge pull request #353 from 0xPolygonHermez/feature/missing-changes-sov
ignasirv Nov 5, 2024
1b569f5
Merge branch 'develop' into feature/ongoingPP
krlosMata Nov 5, 2024
44c089d
fix pp info upgrade
invocamanman Nov 5, 2024
db4c974
update gastTOkens
invocamanman Nov 5, 2024
f9c1d0d
update gastTOkens
invocamanman Nov 5, 2024
99a473b
Clean PolygonRollupManagerNotUpgraded
ignasirv Nov 5, 2024
c8659e6
Merge pull request #355 from 0xPolygonHermez/feature/fixUpgradePPInfo
krlosMata Nov 5, 2024
a2f3d21
Remediation + tests bug gerCount
ignasirv Nov 18, 2024
e27a05d
Informational fixes
ignasirv Nov 18, 2024
948ef96
Add setGlobalExitRootUpdater function
ignasirv Nov 18, 2024
42e97e8
Fix tests + review
ignasirv Nov 19, 2024
ce1d428
WIP: Add feature unset claimMap
ignasirv Nov 21, 2024
eac43cd
Bytecode optimizations
ignasirv Nov 22, 2024
3395410
Remove mocked prev ler for sp1 e2e testing + updated input
ignasirv Nov 26, 2024
09369cd
Merge pull request #362 from 0xPolygonHermez/fefature/unmock-e2e
ignasirv Nov 26, 2024
2b279bb
PR review remediations
ignasirv Dec 2, 2024
8198e92
add tool generateInitializeTransaction
laisolizq Dec 2, 2024
b869481
Script to create sovereign genesis with hardhat
ignasirv Nov 5, 2024
43b0f16
Change comment about token address
ignasirv Nov 7, 2024
54db483
Finish script sovereign genesis with hardhat
ignasirv Nov 7, 2024
7bd2995
Script sovereign bridge with hardhat small fixes
ignasirv Nov 18, 2024
9e2a492
Script create new rollup, first iteration
ignasirv Nov 19, 2024
a67a670
Update create rollup script with last fixes
ignasirv Nov 22, 2024
e38fc43
Improved comments and readme
ignasirv Nov 25, 2024
f988f1c
krlos review remediations
ignasirv Nov 28, 2024
4f1636b
Add type param al create rollup script
ignasirv Nov 29, 2024
664b0a1
More review remediations
ignasirv Dec 2, 2024
bcc4f01
Small fixes
ignasirv Dec 2, 2024
959a81a
add tool to change minDelay timelock
laisolizq Dec 5, 2024
8fa4f45
review tool change minDelay
laisolizq Dec 5, 2024
ff1ebfa
add decodedScheduleData tool change delay timelock
laisolizq Dec 5, 2024
429aa37
minor fixes
krlosMata Dec 10, 2024
1f1c18b
Merge pull request #361 from 0xPolygonHermez/feature/create-new-rollup
invocamanman Dec 12, 2024
e11be4b
add comment on bridge
invocamanman Dec 24, 2024
8b4d221
add comment on bridge
invocamanman Dec 24, 2024
c40411d
Merge pull request #359 from 0xPolygonHermez/feature/audit-remediations
invocamanman Dec 24, 2024
3195aa5
Create testing for create rollup tool
ignasirv Dec 31, 2024
3df27b9
Created testing for add rollup type tooling
ignasirv Dec 31, 2024
2eeaea5
Improved docker readme
ignasirv Jan 3, 2025
22e1bfb
update sp1 to v4
invocamanman Jan 10, 2025
641f71b
mini fixes docker script
invocamanman Jan 10, 2025
1b7ce49
trap dockers
invocamanman Jan 13, 2025
1e0da8d
renaming
invocamanman Jan 13, 2025
d5fb183
Merge pull request #383 from 0xPolygonHermez/feature/updateSp1v4
invocamanman Jan 13, 2025
817effc
Add comment bridge Manager
ignasirv Jan 14, 2025
f448f90
Merge pull request #384 from 0xPolygonHermez/feature/audit-remediations
invocamanman Jan 14, 2025
52b73bf
Add test for rempaing tokens with different decimals
ignasirv Jan 14, 2025
bbfb358
Add audit sigma prime
ignasirv Jan 16, 2025
b763545
Merge pull request #385 from 0xPolygonHermez/feature/test-decimals
invocamanman Jan 16, 2025
e2dc3c2
add pp upgrade mainnet
krlosMata Jan 16, 2025
d49361a
Merge pull request #387 from 0xPolygonHermez/feature/pp-mainnet-info
ignasirv Jan 17, 2025
5359245
Update e2e sp1 test to v4
ignasirv Jan 17, 2025
3f8d16b
add info rollupType 9 mainnet
krlosMata Jan 17, 2025
71676bb
Update tool updateRollup: type and several rollups
laisolizq Jan 17, 2025
f94b21a
Merge pull request #388 from 0xPolygonHermez/feature/add-rollup-type-…
krlosMata Jan 27, 2025
c2ccd08
add standlone to create sovereign genesis
krlosMata Jan 27, 2025
1857570
Support different naming
krlosMata Jan 27, 2025
53417f9
Small fix
ignasirv Jan 27, 2025
96ccc3a
add implementation to contract names
ignasirv Jan 27, 2025
50fb2eb
minor fixes
krlosMata Jan 27, 2025
e8f10d5
Merge pull request #390 from 0xPolygonHermez/feature/create-sovereign…
krlosMata Jan 28, 2025
b0846c1
Update create genesis contract naming
ignasirv Jan 29, 2025
9521339
Merge pull request #391 from 0xPolygonHermez/feature/naming-fix
krlosMata Jan 29, 2025
17bb90d
Merge pull request #364 from 0xPolygonHermez/feature/add-tool-change-…
invocamanman Jan 29, 2025
202f52d
comments and interfaces
invocamanman Jan 29, 2025
a512a25
Merge pull request #393 from 0xPolygonHermez/feature/comments_and_int…
krlosMata Jan 29, 2025
c759a8c
WIP
krlosMata Nov 16, 2024
916b055
update addRollupType tool
laisolizq Dec 5, 2024
ec81ed6
update createGenesis tool
laisolizq Dec 5, 2024
4564f52
update deployClaimCompressor & deployDataCommittee
laisolizq Dec 5, 2024
2fd1ed1
update tool deployVerifier
laisolizq Dec 5, 2024
5c9b600
update tool getRollupData & grantRole
laisolizq Dec 5, 2024
7ee9608
rename tool createGenesis -> upgradePreEtrogGenesis
laisolizq Jan 30, 2025
458714e
Merge pull request #377 from 0xPolygonHermez/feature/tools-tests
ignasirv Feb 3, 2025
85eb975
fix mandatory parameters
laisolizq Feb 3, 2025
371718d
add forge selectors
laisolizq Feb 4, 2025
12a5140
review generateInitializeTransaction
laisolizq Feb 4, 2025
4e29138
fix review
laisolizq Feb 4, 2025
b2a5154
update dir periphery
laisolizq Feb 4, 2025
8f68568
review changes
laisolizq Feb 4, 2025
0d9ce6a
review changes
laisolizq Feb 4, 2025
5127665
review changes
laisolizq Feb 4, 2025
5dd1b4e
improve tool create sovereign genesis
krlosMata Feb 4, 2025
00587a7
add hardhat-switch-network
laisolizq Feb 5, 2025
98e9a84
fix review 2
laisolizq Feb 5, 2025
613b7f2
review comments
krlosMata Feb 5, 2025
1a0a789
Merge pull request #395 from 0xPolygonHermez/feature/add-selectors
krlosMata Feb 5, 2025
5d5195b
fix review 3
laisolizq Feb 5, 2025
1f02a09
fix
laisolizq Feb 5, 2025
ff300c9
timelock changes
laisolizq Feb 6, 2025
1111b26
update decode scheduleData
laisolizq Feb 6, 2025
51370a0
review comments ignasi
krlosMata Feb 6, 2025
9a1be8d
Merge pull request #396 from 0xPolygonHermez/feature/improve-create-g…
krlosMata Feb 6, 2025
258cf5f
Merge pull request #389 from 0xPolygonHermez/feature/update-several-r…
krlosMata Feb 6, 2025
d6c58a1
Merge branch 'feature/ongoingPP' into feature/add-batchL2DataCreatedr…
krlosMata Feb 6, 2025
284db90
Merge pull request #363 from 0xPolygonHermez/feature/add-batchL2DataC…
krlosMata Feb 6, 2025
f27ebca
Merge branch 'feature/ongoingPP' into feature/improve-tools
krlosMata Feb 6, 2025
98b8b1f
Merge pull request #365 from 0xPolygonHermez/feature/improve-tools
krlosMata Feb 6, 2025
e1aaf8e
Merge branch 'develop' into feature/merge-develop
krlosMata Feb 14, 2025
1aaf95b
Merge pull request #404 from 0xPolygonHermez/feature/merge-develop
krlosMata Feb 14, 2025
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
Binary file not shown.
136 changes: 136 additions & 0 deletions contracts/mocks/ERC20Decimals.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,136 @@
// SPDX-License-Identifier: AGPL-3.0

pragma solidity 0.8.20;

import "@openzeppelin/contracts/token/ERC20/ERC20.sol";

contract ERC20Decimals is ERC20 {
uint8 private _decimals;

constructor(
string memory name,
string memory symbol,
address initialAccount,
uint256 initialBalance,
uint8 decimals_
) payable ERC20(name, symbol) {
_mint(initialAccount, initialBalance);
NAME_HASH = keccak256(bytes(name));
_decimals = decimals_;
}

function decimals() public view virtual override returns (uint8) {
return _decimals;
}

function mint(address account, uint256 amount) public {
_mint(account, amount);
}

function burn(uint256 amount) public {
_burn(msg.sender, amount);
}

function transferInternal(address from, address to, uint256 value) public {
_transfer(from, to, value);
}

function approveInternal(
address owner,
address spender,
uint256 value
) public {
_approve(owner, spender, value);
}

// erc20 permit
mapping(address => uint256) public nonces;

bytes32 public constant PERMIT_TYPEHASH =
keccak256(
"Permit(address owner,address spender,uint256 value,uint256 nonce,uint256 deadline)"
);

bytes32 public NAME_HASH;

// bytes32 public constant VERSION_HASH =
// keccak256("1")
bytes32 public constant VERSION_HASH =
0xc89efdaa54c0f20c7adf612882df0950f5a951637e0307cdcb4c672f298b8bc6;

// bytes32 public constant EIP712DOMAIN_HASH =
// keccak256("EIP712Domain(string name,string version,uint256 chainId,address verifyingContract)")
bytes32 public constant EIP712DOMAIN_HASH =
0x8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f;

function _validateSignedData(
address signer,
bytes32 encodeData,
uint8 v,
bytes32 r,
bytes32 s
) internal view {
bytes32 domainSeparator = keccak256(
abi.encode(
EIP712DOMAIN_HASH,
NAME_HASH,
VERSION_HASH,
getChainId(),
address(this)
)
);

bytes32 digest = keccak256(
abi.encodePacked("\x19\x01", domainSeparator, encodeData)
);
address recoveredAddress = ecrecover(digest, v, r, s);
// Explicitly disallow authorizations for address(0) as ecrecover returns address(0) on malformed messages
require(
recoveredAddress != address(0) && recoveredAddress == signer,
"HEZ::_validateSignedData: INVALID_SIGNATURE"
);
}

function getChainId() public view returns (uint256 chainId) {
assembly {
chainId := chainid()
}
}

function permit(
address owner,
address spender,
uint256 value,
uint256 deadline,
uint8 v,
bytes32 r,
bytes32 s
) external {
require(deadline >= block.timestamp, "HEZ::permit: AUTH_EXPIRED");
bytes32 encodeData = keccak256(
abi.encode(
PERMIT_TYPEHASH,
owner,
spender,
value,
nonces[owner]++,
deadline
)
);
_validateSignedData(owner, encodeData, v, r, s);
_approve(owner, spender, value);
}

function DOMAIN_SEPARATOR() external view returns (bytes32) {
return
keccak256(
abi.encode(
EIP712DOMAIN_HASH,
NAME_HASH,
VERSION_HASH,
getChainId(),
address(this)
)
);
}
}
Loading
Loading