Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
N
nebula
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
exchain
nebula
Commits
6f380e2b
Commit
6f380e2b
authored
Nov 12, 2020
by
Karl Floersch
Committed by
GitHub
Nov 12, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add events to xDomain messengers (#61)
parent
fc07158e
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
19 additions
and
4 deletions
+19
-4
OVM_BaseCrossDomainMessenger.sol
...stic-ethereum/OVM/bridge/OVM_BaseCrossDomainMessenger.sol
+2
-0
OVM_L1CrossDomainMessenger.sol
...mistic-ethereum/OVM/bridge/OVM_L1CrossDomainMessenger.sol
+5
-2
OVM_L2CrossDomainMessenger.sol
...mistic-ethereum/OVM/bridge/OVM_L2CrossDomainMessenger.sol
+5
-2
iOVM_BaseCrossDomainMessenger.sol
...ic-ethereum/iOVM/bridge/iOVM_BaseCrossDomainMessenger.sol
+7
-0
No files found.
packages/contracts/contracts/optimistic-ethereum/OVM/bridge/OVM_BaseCrossDomainMessenger.sol
View file @
6f380e2b
...
...
@@ -50,6 +50,8 @@ contract OVM_BaseCrossDomainMessenger is iOVM_BaseCrossDomainMessenger {
messageNonce += 1;
sentMessages[keccak256(xDomainCalldata)] = true;
emit SentMessage(xDomainCalldata);
}
/**********************
...
...
packages/contracts/contracts/optimistic-ethereum/OVM/bridge/OVM_L1CrossDomainMessenger.sol
View file @
6f380e2b
...
...
@@ -78,8 +78,10 @@ contract OVM_L1CrossDomainMessenger is iOVM_L1CrossDomainMessenger, OVM_BaseCros
"Provided message could not be verified."
);
bytes32 xDomainCalldataHash = keccak256(xDomainCalldata);
require(
successfulMessages[
keccak256(xDomainCalldata)
] == false,
successfulMessages[
xDomainCalldataHash
] == false,
"Provided message has already been received."
);
...
...
@@ -89,7 +91,8 @@ contract OVM_L1CrossDomainMessenger is iOVM_L1CrossDomainMessenger, OVM_BaseCros
// Mark the message as received if the call was successful. Ensures that a message can be
// relayed multiple times in the case that the call reverted.
if (success == true) {
successfulMessages[keccak256(xDomainCalldata)] = true;
successfulMessages[xDomainCalldataHash] = true;
emit RelayedMessage(xDomainCalldataHash);
}
// Store an identifier that can be used to prove that the given message was relayed by some
...
...
packages/contracts/contracts/optimistic-ethereum/OVM/bridge/OVM_L2CrossDomainMessenger.sol
View file @
6f380e2b
...
...
@@ -60,8 +60,10 @@ contract OVM_L2CrossDomainMessenger is iOVM_L2CrossDomainMessenger, OVM_BaseCros
_messageNonce
);
bytes32 xDomainCalldataHash = keccak256(xDomainCalldata);
require(
successfulMessages[
keccak256(xDomainCalldata)
] == false,
successfulMessages[
xDomainCalldataHash
] == false,
"Provided message has already been received."
);
...
...
@@ -71,7 +73,8 @@ contract OVM_L2CrossDomainMessenger is iOVM_L2CrossDomainMessenger, OVM_BaseCros
// Mark the message as received if the call was successful. Ensures that a message can be
// relayed multiple times in the case that the call reverted.
if (success == true) {
successfulMessages[keccak256(xDomainCalldata)] = true;
successfulMessages[xDomainCalldataHash] = true;
emit RelayedMessage(xDomainCalldataHash);
}
// Store an identifier that can be used to prove that the given message was relayed by some
...
...
packages/contracts/contracts/optimistic-ethereum/iOVM/bridge/iOVM_BaseCrossDomainMessenger.sol
View file @
6f380e2b
...
...
@@ -6,6 +6,13 @@ pragma experimental ABIEncoderV2;
* @title iOVM_BaseCrossDomainMessenger
*/
interface iOVM_BaseCrossDomainMessenger {
/**********
* Events *
**********/
event SentMessage(bytes message);
event RelayedMessage(bytes32 msgHash);
/**********************
* Contract Variables *
**********************/
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment