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

fix: [N-06] TODO Comments #325

Merged
merged 3 commits into from
Jul 28, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 0 additions & 3 deletions contracts/ZkSync_SpokePool.sol
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,6 @@ interface ZkBridgeLike {
) external;
}

// TODO: Find the mainnet source code, can't seem to find it in here:
// https://github.com/matter-labs/era-contracts/blob/6391c0d7bf6184d7f6718060e3991ba6f0efe4a7/zksync/contracts
// https://github.com/matter-labs/v2-testnet-contracts/blob/main/l2/system-contracts/L2EthToken.sol#L74
interface IL2ETH {
function withdraw(address _l1Receiver) external payable;
}
Expand Down
3 changes: 1 addition & 2 deletions contracts/chain-adapters/ZkSync_Adapter.sol
Original file line number Diff line number Diff line change
Expand Up @@ -72,28 +72,27 @@
// goes live. For now, we'll hardcode these and use aggressive values to ensure inclusion.

// Limit on L2 gas to spend.
uint256 public constant l2GasLimit = 300_000;

Check warning on line 75 in contracts/chain-adapters/ZkSync_Adapter.sol

View workflow job for this annotation

GitHub Actions / Solhint (16)

Constant name must be in capitalized SNAKE_CASE

// How much gas is required to publish a byte of data from L1 to L2. 800 is the required value
// as set here https://github.com/matter-labs/era-contracts/blob/6391c0d7bf6184d7f6718060e3991ba6f0efe4a7/ethereum/contracts/zksync/facets/Mailbox.sol#L226
// Note, this value can change and will require an updated adapter.
uint256 public constant l1GasToL2GasPerPubDataLimit = 800;

Check warning on line 80 in contracts/chain-adapters/ZkSync_Adapter.sol

View workflow job for this annotation

GitHub Actions / Solhint (16)

Constant name must be in capitalized SNAKE_CASE

// This address receives any remaining fee after an L1 to L2 transaction completes.
// If refund recipient = address(0) then L2 msg.sender is used, unelss msg.sender is a contract then its address
// gets aliased.
address public constant l2RefundAddress = 0x428AB2BA90Eba0a4Be7aF34C9Ac451ab061AC010;

Check warning on line 85 in contracts/chain-adapters/ZkSync_Adapter.sol

View workflow job for this annotation

GitHub Actions / Solhint (16)

Constant name must be in capitalized SNAKE_CASE

// Hardcode the following ZkSync system contract addresses to save gas on construction. This adapter can be
// redeployed in the event that the following addresses change.

// Main contract used to send L1 --> L2 messages. Fetchable via `zks_getMainContract` method on JSON RPC.
ZkSyncInterface public constant zkSync = ZkSyncInterface(0x32400084C286CF3E17e7B677ea9583e60a000324);

Check warning on line 91 in contracts/chain-adapters/ZkSync_Adapter.sol

View workflow job for this annotation

GitHub Actions / Solhint (16)

Constant name must be in capitalized SNAKE_CASE
// Bridges to send ERC20 and ETH to L2. Fetchable via `zks_getBridgeContracts` method on JSON RPC.
ZkBridgeLike public constant zkErc20Bridge = ZkBridgeLike(0x57891966931Eb4Bb6FB81430E6cE0A03AAbDe063);

// Set l1Weth at construction time to make testing easier. TODO: Think of some way to be able to hardcode this
// while keeping unit tests easy to write with custom WETH that we can mint/transfer.
// Set l1Weth at construction time to make testing easier.
WETH9Interface public immutable l1Weth;

event ZkSyncMessageRelayed(bytes32 canonicalTxHash);
Expand Down