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

Develop #247

Merged
merged 29 commits into from
Jun 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
9a93376
Update README.md
bap2pecs Feb 6, 2024
7b67bbd
update contract generated with buildsetup v6.0.0-rc.1-fork.9
zkronos73 Mar 24, 2024
0155417
update previosu verifiers
invocamanman Mar 24, 2024
18112de
update
invocamanman Mar 24, 2024
5def95e
new upgrade info
invocamanman Mar 24, 2024
97c9c02
Merge pull request #221 from 0xPolygonHermez/feature/verifier-v6.0.0-…
invocamanman Mar 25, 2024
1187308
update jsons
invocamanman Mar 25, 2024
25f4432
Update README
Stefan-Ethernal Mar 25, 2024
9844e68
Merge pull request #222 from 0xPolygonHermez/feat/update-readme-param…
invocamanman Mar 25, 2024
8222986
Merge pull request #190 from bap2pecs/patch-3
invocamanman Mar 25, 2024
a4a678e
fix: wrong variable name in verify script
JacksonRGB Mar 26, 2024
a38e68b
Merge pull request #223 from JacksonRGB/fix-variable-name
invocamanman Mar 26, 2024
5ed0104
Remove duplicated test case
gavfu Mar 26, 2024
e898062
fix: `forge build` on linux/arm
leovct Mar 27, 2024
e3ec44c
fix: compilation errors
leovct Mar 27, 2024
6bf2c00
Merge pull request #226 from leovct/fix/forge-build-on-linux-arm
invocamanman Mar 27, 2024
171129d
Add possibility to override origin check for the native token on sove…
gretzke Mar 28, 2024
f6da4f6
update Verify deployment on Mainnet document
zkronos73 Apr 1, 2024
6c2be0f
Merge pull request #231 from 0xPolygonHermez/update-doc-verifydeploy-…
invocamanman Apr 2, 2024
54f58c8
Merge pull request #225 from gavfu/develop
invocamanman Apr 7, 2024
b297fd5
compilation fix
gretzke Apr 19, 2024
65f9481
Merge pull request #230 from 0xPolygonHermez/feat/origin-check-override
invocamanman Apr 19, 2024
83b69d7
Use the newer go-ethereum Docker image
Stefan-Ethernal Apr 26, 2024
78490a9
udpate claim compressor
invocamanman May 7, 2024
658f154
Merge pull request #255 from 0xPolygonHermez/feature/updateClaimCompr…
invocamanman May 7, 2024
1a07c5f
Use the Geth v1.14.3
Stefan-Ethernal May 16, 2024
6552d78
Merge pull request #250 from 0xPolygonHermez/feat/use-go-ethereum-ima…
invocamanman May 21, 2024
e4cd5cf
add sigpaudit
invocamanman Jun 17, 2024
9cfe119
Merge pull request #267 from 0xPolygonHermez/addSigPAudit
invocamanman Jun 17, 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
Binary file not shown.
2 changes: 1 addition & 1 deletion contracts/mocks/DaiMock.sol
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
*/

// hevm: flattened sources of /nix/store/8xb41r4qd0cjb63wcrxf1qmfg88p0961-dss-6fd7de0/src/dai.sol
pragma solidity =0.5.12;
pragma solidity <=0.5.12;

// Copeid DAi for testing porpuses. The notes are removed from this contract as it does not work correctly woith the
// coverage solidity compiler
Expand Down
49 changes: 27 additions & 22 deletions contracts/v2/lib/PolygonRollupBaseEtrog.sol
Original file line number Diff line number Diff line change
Expand Up @@ -302,29 +302,8 @@ abstract contract PolygonRollupBaseEtrog is
string memory sequencerURL,
string memory _networkName
) external virtual onlyRollupManager initializer {
bytes memory gasTokenMetadata;
bytes memory gasTokenMetadata = _verifyOrigin(_gasTokenAddress);

if (_gasTokenAddress != address(0)) {
// Ask for token metadata, the same way is enconded in the bridge
// Note that this function will revert if the token is not in this network
// Note that this could be a possible reentrant call, but cannot make changes on the state since are static call
gasTokenMetadata = bridgeAddress.getTokenMetadata(_gasTokenAddress);

// Check gas token address on the bridge
(
uint32 originWrappedNetwork,
address originWrappedAddress
) = bridgeAddress.wrappedTokenToTokenInfo(_gasTokenAddress);

if (originWrappedNetwork != 0) {
// It's a wrapped token, get the wrapped parameters
gasTokenAddress = originWrappedAddress;
gasTokenNetwork = originWrappedNetwork;
} else {
// gasTokenNetwork will be mainnet, for instance 0
gasTokenAddress = _gasTokenAddress;
}
}
// Sequence transaction to initilize the bridge

// Calculate transaction to initialize the bridge
Expand Down Expand Up @@ -948,4 +927,30 @@ abstract contract PolygonRollupBaseEtrog is

return transaction;
}

function _verifyOrigin(
address _gasTokenAddress
) internal virtual returns (bytes memory gasTokenMetadata) {
if (_gasTokenAddress != address(0)) {
// Ask for token metadata, the same way is enconded in the bridge
// Note that this function will revert if the token is not in this network
// Note that this could be a possible reentrant call, but cannot make changes on the state since are static call
gasTokenMetadata = bridgeAddress.getTokenMetadata(_gasTokenAddress);

// Check gas token address on the bridge
(
uint32 originWrappedNetwork,
address originWrappedAddress
) = bridgeAddress.wrappedTokenToTokenInfo(_gasTokenAddress);

if (originWrappedNetwork != 0) {
// It's a wrapped token, get the wrapped parameters
gasTokenAddress = originWrappedAddress;
gasTokenNetwork = originWrappedNetwork;
} else {
// gasTokenNetwork will be mainnet, for instance 0
gasTokenAddress = _gasTokenAddress;
}
}
}
}
6 changes: 5 additions & 1 deletion contracts/v2/utils/ClaimCompressor.sol
Original file line number Diff line number Diff line change
Expand Up @@ -516,9 +516,13 @@ contract ClaimCompressor {
add(metadataLen, mod(sub(32, mod(metadataLen, 32)), 32))
)

if lt(gas(), 2500000) {
revert(0, 0)
}

// SHould i limit the gas TODO of the call
let success := call(
gas(), // gas
2000000, // gas // TODO gas Limited to 2M, could be better to check if it's created the token or not and limit later
bridgeAddress, // address
0, // value
0, // args offset
Expand Down
4 changes: 2 additions & 2 deletions contracts/verifiers/FflonkVerifier.sol
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,8 @@ contract FflonkVerifier {
uint256 constant w8_7 = 8613538655231327379234925296132678673308827349856085326283699237864372525723;

// Verifier preprocessed input C_0(x)·[1]_1
uint256 constant C0x = 21160666715172434637225720476256763871501363117729999199262494595796582644427;
uint256 constant C0y = 15161784655278302587190494591488856640885304569426835678458555890947087546457;
uint256 constant C0x = 19531210301294568511992648735135291982401633864004026433715722115099857739632;
uint256 constant C0y = 16913517370715546973488219367119174715262034757907912789481968159710930517904;

// Verifier preprocessed input x·[1]_2
uint256 constant X2x1 = 21831381940315734285607113342023901060522397560371972897001948545212302161822;
Expand Down
Loading
Loading