-
Notifications
You must be signed in to change notification settings - Fork 3.9k
style[contracts]: Various minor stylistic improvements #574
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -19,9 +19,9 @@ import { Abs_BaseCrossDomainMessenger } from "./Abs_BaseCrossDomainMessenger.sol | |
|
|
||
| /** | ||
| * @title OVM_L1CrossDomainMessenger | ||
| * @dev The L1 Cross Domain Messenger contract sends messages from L1 to L2, and relays messages from L2 onto L1. | ||
| * In the event that a message sent from L1 to L2 is rejected for exceeding the L2 epoch gas limit, it can be resubmitted | ||
| * via this contract's replay function. | ||
| * @dev The L1 Cross Domain Messenger contract sends messages from L1 to L2, and relays messages | ||
| * from L2 onto L1. In the event that a message sent from L1 to L2 is rejected for exceeding the L2 | ||
| * epoch gas limit, it can be resubmitted via this contract's replay function. | ||
| * | ||
| * Compiler used: solc | ||
| * Runtime target: EVM | ||
|
|
@@ -39,26 +39,14 @@ contract OVM_L1CrossDomainMessenger is iOVM_L1CrossDomainMessenger, Abs_BaseCros | |
| Lib_AddressResolver(address(0)) | ||
| {} | ||
|
|
||
| /** | ||
| * @param _libAddressManager Address of the Address Manager. | ||
| */ | ||
| function initialize( | ||
| address _libAddressManager | ||
| ) | ||
| public | ||
| { | ||
| require(address(libAddressManager) == address(0), "L1CrossDomainMessenger already intialized."); | ||
| libAddressManager = Lib_AddressManager(_libAddressManager); | ||
| xDomainMsgSender = DEFAULT_XDOMAIN_SENDER; | ||
| } | ||
|
|
||
|
|
||
| /********************** | ||
| * Function Modifiers * | ||
| **********************/ | ||
|
|
||
| /** | ||
| * Modifier to enforce that, if configured, only the OVM_L2MessageRelayer contract may successfully call a method. | ||
| * Modifier to enforce that, if configured, only the OVM_L2MessageRelayer contract may | ||
| * successfully call a method. | ||
| */ | ||
| modifier onlyRelayer() { | ||
| address relayer = resolve("OVM_L2MessageRelayer"); | ||
|
|
@@ -76,6 +64,23 @@ contract OVM_L1CrossDomainMessenger is iOVM_L1CrossDomainMessenger, Abs_BaseCros | |
| * Public Functions * | ||
| ********************/ | ||
|
|
||
| /** | ||
| * @param _libAddressManager Address of the Address Manager. | ||
| */ | ||
| function initialize( | ||
| address _libAddressManager | ||
| ) | ||
| public | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This could be
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yeah, although I didn't want to touch visibility because I wasn't sure if that would have an impact somewhere else :-/. |
||
| { | ||
| require( | ||
| address(libAddressManager) == address(0), | ||
| "L1CrossDomainMessenger already intialized." | ||
| ); | ||
|
|
||
| libAddressManager = Lib_AddressManager(_libAddressManager); | ||
| xDomainMsgSender = DEFAULT_XDOMAIN_SENDER; | ||
| } | ||
|
|
||
| /** | ||
| * Relays a cross domain message to a contract. | ||
| * @inheritdoc iOVM_L1CrossDomainMessenger | ||
|
|
@@ -207,7 +212,9 @@ contract OVM_L1CrossDomainMessenger is iOVM_L1CrossDomainMessenger, Abs_BaseCros | |
| bool | ||
| ) | ||
| { | ||
| iOVM_StateCommitmentChain ovmStateCommitmentChain = iOVM_StateCommitmentChain(resolve("OVM_StateCommitmentChain")); | ||
| iOVM_StateCommitmentChain ovmStateCommitmentChain = iOVM_StateCommitmentChain( | ||
| resolve("OVM_StateCommitmentChain") | ||
| ); | ||
|
|
||
| return ( | ||
| ovmStateCommitmentChain.insideFraudProofWindow(_proof.stateRootBatchHeader) == false | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just so I know, are you going for a line length < 100?
Is that just with docstrings?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah I've been aiming for 100 as the max line length in general, but primarily for doc strings.