Skip to content
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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/friendly-donuts-kiss.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@eth-optimism/contracts-bedrock': patch
---

Remove unnecessary DefaultValues library

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import { L2OutputOracle_Initializer } from "./L2OutputOracle.t.sol";

/* Libraries */
import { AddressAliasHelper } from "../vendor/AddressAliasHelper.sol";
import { DefaultValues } from "../libraries/DefaultValues.sol";
import { PredeployAddresses } from "../libraries/PredeployAddresses.sol";
import { CrossDomainUtils } from "../libraries/CrossDomainUtils.sol";
import { WithdrawalVerifier } from "../libraries/WithdrawalVerifier.sol";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ import { L2OutputOracle } from "../L1/L2OutputOracle.sol";
import { L2CrossDomainMessenger } from "../L2/L2CrossDomainMessenger.sol";
import { L1CrossDomainMessenger } from "../L1/L1CrossDomainMessenger.sol";
import { CrossDomainHashing } from "../libraries/CrossDomainHashing.sol";
import { DefaultValues } from "../libraries/DefaultValues.sol";

contract L2CrossDomainMessenger_Test is Messenger_Initializer {
// Receiver address for testing
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ import {
ReentrancyGuardUpgradeable
} from "@openzeppelin/contracts-upgradeable/security/ReentrancyGuardUpgradeable.sol";
import { ExcessivelySafeCall } from "excessively-safe-call/src/ExcessivelySafeCall.sol";
import { DefaultValues } from "../libraries/DefaultValues.sol";
import { CrossDomainHashing } from "../libraries/CrossDomainHashing.sol";

/**
Expand Down Expand Up @@ -83,6 +82,13 @@ abstract contract CrossDomainMessenger is
*/
uint256 internal constant RELAY_GAS_BUFFER = RELAY_GAS_REQUIRED - 5000;

/**
* @notice Initial value for the xDomainMsgSender variable. We set this to a non-zero value
* because performing an SSTORE on a non-zero value is significantly cheaper than on a
* zero value.
*/
address internal constant DEFAULT_XDOMAIN_SENDER = 0x000000000000000000000000000000000000dEaD;

/**
* @notice Mapping of message hashes to boolean receipt values. Note that a message will only
* be present in this mapping if it failed to be relayed on this chain at least once.
Expand Down Expand Up @@ -152,10 +158,7 @@ abstract contract CrossDomainMessenger is
* @return Address of the sender of the currently executing message on the other chain.
*/
function xDomainMessageSender() external view returns (address) {
require(
xDomainMsgSender != DefaultValues.DEFAULT_XDOMAIN_SENDER,
"xDomainMessageSender is not set"
);
require(xDomainMsgSender != DEFAULT_XDOMAIN_SENDER, "xDomainMessageSender is not set");

return xDomainMsgSender;
}
Expand Down Expand Up @@ -287,7 +290,7 @@ abstract contract CrossDomainMessenger is
0,
_message
);
xDomainMsgSender = DefaultValues.DEFAULT_XDOMAIN_SENDER;
xDomainMsgSender = DEFAULT_XDOMAIN_SENDER;

if (success == true) {
successfulMessages[versionedHash] = true;
Expand All @@ -312,7 +315,7 @@ abstract contract CrossDomainMessenger is
function _initialize(address _otherMessenger, address[] memory _blockedSystemAddresses)
internal
{
xDomainMsgSender = DefaultValues.DEFAULT_XDOMAIN_SENDER;
xDomainMsgSender = DEFAULT_XDOMAIN_SENDER;
otherMessenger = _otherMessenger;

for (uint256 i = 0; i < _blockedSystemAddresses.length; i++) {
Expand Down