-
Notifications
You must be signed in to change notification settings - Fork 970
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
14 changed files
with
918 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 3 additions & 0 deletions
3
...tectors/snapshots/detectors__detector_UnusedImport_0_8_16_CrossDomainMessenger_sol__0.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
The following unused import(s) in tests/e2e/detectors/test_data/unused-import/0.8.16/CrossDomainMessenger.sol should be removed: | ||
-import "./utils/console.sol"; (tests/e2e/detectors/test_data/unused-import/0.8.16/CrossDomainMessenger.sol#6) | ||
|
53 changes: 53 additions & 0 deletions
53
tests/e2e/detectors/test_data/unused-import/0.8.16/Constants.sol
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
// SPDX-License-Identifier: MIT | ||
pragma solidity ^0.8.16; | ||
|
||
import { ResourceMetering } from "./lib/ResourceMetering.sol"; | ||
|
||
/// @title Constants | ||
/// @notice Constants is a library for storing constants. Simple! Don't put everything in here, just | ||
/// the stuff used in multiple contracts. Constants that only apply to a single contract | ||
/// should be defined in that contract instead. | ||
library Constants { | ||
/// @notice Special address to be used as the tx origin for gas estimation calls in the | ||
/// OptimismPortal and CrossDomainMessenger calls. You only need to use this address if | ||
/// the minimum gas limit specified by the user is not actually enough to execute the | ||
/// given message and you're attempting to estimate the actual necessary gas limit. We | ||
/// use address(1) because it's the ecrecover precompile and therefore guaranteed to | ||
/// never have any code on any EVM chain. | ||
address internal constant ESTIMATION_ADDRESS = address(1); | ||
|
||
/// @notice Value used for the L2 sender storage slot in both the OptimismPortal and the | ||
/// CrossDomainMessenger contracts before an actual sender is set. This value is | ||
/// non-zero to reduce the gas cost of message passing transactions. | ||
address internal constant DEFAULT_L2_SENDER = 0x000000000000000000000000000000000000dEaD; | ||
|
||
/// @notice The storage slot that holds the address of a proxy implementation. | ||
/// @dev `bytes32(uint256(keccak256('eip1967.proxy.implementation')) - 1)` | ||
bytes32 internal constant PROXY_IMPLEMENTATION_ADDRESS = | ||
0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc; | ||
|
||
/// @notice The storage slot that holds the address of the owner. | ||
/// @dev `bytes32(uint256(keccak256('eip1967.proxy.admin')) - 1)` | ||
bytes32 internal constant PROXY_OWNER_ADDRESS = 0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103; | ||
|
||
/// @notice The address that represents ether when dealing with ERC20 token addresses. | ||
address internal constant ETHER = 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE; | ||
|
||
/// @notice The address that represents the system caller responsible for L1 attributes | ||
/// transactions. | ||
address internal constant DEPOSITOR_ACCOUNT = 0xDeaDDEaDDeAdDeAdDEAdDEaddeAddEAdDEAd0001; | ||
|
||
/// @notice Returns the default values for the ResourceConfig. These are the recommended values | ||
/// for a production network. | ||
function DEFAULT_RESOURCE_CONFIG() internal pure returns (ResourceMetering.ResourceConfig memory) { | ||
ResourceMetering.ResourceConfig memory config = ResourceMetering.ResourceConfig({ | ||
maxResourceLimit: 20_000_000, | ||
elasticityMultiplier: 10, | ||
baseFeeMaxChangeDenominator: 8, | ||
minimumBaseFee: 1 gwei, | ||
systemTxMaxGas: 1_000_000, | ||
maximumBaseFee: type(uint128).max | ||
}); | ||
return config; | ||
} | ||
} |
Oops, something went wrong.