Skip to content

Commit

Permalink
zks fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
kelemeno committed Oct 3, 2024
1 parent a271fc5 commit 12271b9
Show file tree
Hide file tree
Showing 6 changed files with 25 additions and 22 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -306,7 +306,7 @@ abstract contract AssetRouterBase is IAssetRouterBase, Ownable2StepUpgradeable,
bytes32 _assetId,
bytes memory _assetData
) public view virtual returns (bytes memory);

/// @notice Ensures that token is registered with native token vault.
/// @dev Only used when deposit is made with legacy data encoding format.
/// @param _token The native token address which should be registered with native token vault.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -309,7 +309,7 @@ contract L2AssetRouter is AssetRouterBase, IL2AssetRouter {
uint256 _amount,
bytes calldata _data
) external {
// onlyAssetRouterCounterpart(L1_CHAIN_ID) {
// onlyAssetRouterCounterpart(L1_CHAIN_ID) {
_translateLegacyFinalizeDeposit({
_l1Sender: _l1Sender,
_l2Receiver: _l2Receiver,
Expand Down
6 changes: 4 additions & 2 deletions l1-contracts/contracts/bridgehub/Bridgehub.sol
Original file line number Diff line number Diff line change
Expand Up @@ -468,7 +468,8 @@ contract Bridgehub is IBridgehub, ReentrancyGuard, Ownable2StepUpgradeable, Paus
// the transaction will revert on `bridgehubRequestL2Transaction` as call to zero address.
{
bytes32 tokenAssetId = baseTokenAssetId[_request.chainId];
if (tokenAssetId == ETH_TOKEN_ASSET_ID || tokenAssetId == bytes32(0)) { // kl todo
if (tokenAssetId == ETH_TOKEN_ASSET_ID || tokenAssetId == bytes32(0)) {
// kl todo
if (msg.value != _request.mintValue) {
revert MsgValueMismatch(_request.mintValue, msg.value);
}
Expand Down Expand Up @@ -525,7 +526,8 @@ contract Bridgehub is IBridgehub, ReentrancyGuard, Ownable2StepUpgradeable, Paus
{
bytes32 tokenAssetId = baseTokenAssetId[_request.chainId];
uint256 baseTokenMsgValue;
if (tokenAssetId == ETH_TOKEN_ASSET_ID || tokenAssetId == bytes32(0)) { // kl todo
if (tokenAssetId == ETH_TOKEN_ASSET_ID || tokenAssetId == bytes32(0)) {
// kl todo
if (msg.value != _request.mintValue + _request.secondBridgeValue) {
revert MsgValueMismatch(_request.mintValue + _request.secondBridgeValue, msg.value);
}
Expand Down
26 changes: 14 additions & 12 deletions l1-contracts/test/foundry/l2/unit/interop/InteropTest.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -25,16 +25,18 @@ contract InteropTest is Test {
IBridgehub internal bridgehub;
function setUp() public {
bridgehub = IBridgehub(L2_BRIDGEHUB_ADDR);
L2Utils.initSystemContracts(SystemContractsArgs({
l1ChainId: 1,
eraChainId: 2,
l1AssetRouter: address(1),
legacySharedBridge: address(2),
l2TokenBeacon: address(3),
l2TokenProxyBytecodeHash: bytes32(uint256(4)),
aliasedOwner: address(5),
contractsDeployedAlready: false
}));
L2Utils.initSystemContracts(
SystemContractsArgs({
l1ChainId: 1,
eraChainId: 2,
l1AssetRouter: address(1),
legacySharedBridge: address(2),
l2TokenBeacon: address(3),
l2TokenProxyBytecodeHash: bytes32(uint256(4)),
aliasedOwner: address(5),
contractsDeployedAlready: false
})
);
}

function test_interop() public {
Expand All @@ -51,6 +53,6 @@ contract InteropTest is Test {
secondBridgeValue: secondBridgeValue,
secondBridgeCalldata: new bytes(0)
});
bridgehub.requestL2TransactionTwoBridges{value:mintValue + secondBridgeValue}(request);
bridgehub.requestL2TransactionTwoBridges{value: mintValue + secondBridgeValue}(request);
}
}
}
6 changes: 1 addition & 5 deletions l2-contracts/contracts/verifier/Verifier.sol
Original file line number Diff line number Diff line change
Expand Up @@ -375,11 +375,7 @@ contract Verifier is IVerifier {
/// @dev Performs modular exponentiation using the formula (value ^ power) mod R_MOD.
function modexp(value, power) -> res {
res := 1
for {

} gt(power, 0) {

} {
for {} gt(power, 0) {} {
if mod(power, 2) {
res := mulmod(res, value, R_MOD)
}
Expand Down
5 changes: 4 additions & 1 deletion system-contracts/contracts/BootloaderUtilities.sol
Original file line number Diff line number Diff line change
Expand Up @@ -351,7 +351,10 @@ contract BootloaderUtilities is IBootloaderUtilities {
// kl todo verify the proof here, get return values
// emit TestEvent(_proofData);
// uint256 chainId = abi.decode(_proofData, (uint256));
(uint256 chainId, uint256 batchNumber, uint256 leafProofMask, bytes32 leaf) = abi.decode(_proofData, (uint256, uint256, uint256, bytes32));
(uint256 chainId, uint256 batchNumber, uint256 leafProofMask, bytes32 leaf) = abi.decode(
_proofData,
(uint256, uint256, uint256, bytes32)
);
// (uint256 chainId, uint256 batchNumber, uint256 leafProofMask, bytes32 leaf, bytes32[] memory proof ) = abi.decode(_proofData, (uint256, uint256, uint256, bytes32, bytes32[]));
// ProofVerificationResult memory result = MessageHashing.hashProof(
// chainId,
Expand Down

0 comments on commit 12271b9

Please sign in to comment.