Skip to content

Instantly share code, notes, and snippets.

@NoahMarconi
Created January 30, 2024 17:03
Show Gist options
  • Save NoahMarconi/b51d0732abadba33dc2bf7de779f3f4a to your computer and use it in GitHub Desktop.
Save NoahMarconi/b51d0732abadba33dc2bf7de779f3f4a to your computer and use it in GitHub Desktop.
Bast Out of Scope Findings
# Report
## Gas Optimizations
| |Issue|Instances|
|-|:-|:-:|
| [GAS-1](#GAS-1) | Use `selfbalance()` instead of `address(this).balance` | 10 |
| [GAS-2](#GAS-2) | Use assembly to check for `address(0)` | 44 |
| [GAS-3](#GAS-3) | `array[index] += amount` is cheaper than `array[index] = array[index] + amount` (or related variants) | 2 |
| [GAS-4](#GAS-4) | Using bools for storage incurs overhead | 19 |
| [GAS-5](#GAS-5) | Cache array length outside of loop | 16 |
| [GAS-6](#GAS-6) | State variables should be cached in stack variables rather than re-reading them from storage | 1 |
| [GAS-7](#GAS-7) | Use calldata instead of memory for function arguments that do not get mutated | 53 |
| [GAS-8](#GAS-8) | For Operations that will not overflow, you could use unchecked | 1706 |
| [GAS-9](#GAS-9) | Use Custom Errors | 216 |
| [GAS-10](#GAS-10) | Don't initialize variables with default value | 59 |
| [GAS-11](#GAS-11) | Long revert strings | 156 |
| [GAS-12](#GAS-12) | Functions guaranteed to revert when called by normal users can be marked `payable` | 94 |
| [GAS-13](#GAS-13) | `++i` costs less gas than `i++`, especially when it's used in `for`-loops (`--i`/`i--` too) | 26 |
| [GAS-14](#GAS-14) | Using `private` rather than `public` for constants, saves gas | 72 |
| [GAS-15](#GAS-15) | Use shift Right/Left instead of division/multiplication if possible | 26 |
| [GAS-16](#GAS-16) | Splitting require() statements that use && saves gas | 3 |
| [GAS-17](#GAS-17) | Use != 0 instead of > 0 for unsigned integer comparison | 41 |
| [GAS-18](#GAS-18) | `internal` functions not called by the contract should be removed | 28 |
### <a name="GAS-1"></a>[GAS-1] Use `selfbalance()` instead of `address(this).balance`
Use assembly when getting a contract's balance of ETH.
You can use `selfbalance()` instead of `address(this).balance` when getting your contract's balance of ETH to save gas.
Additionally, you can use `balance(address)` instead of `address.balance()` when getting an external contract's balance of ETH.
*Saves 15 gas when checking internal balance, 6 for external*
*Instances (10)*:
```solidity
File: src/L1/OptimismPortal.sol
370: uint256 etherBalance = address(this).balance;
372: txValueWithDiscount = address(this).balance - etherBalance;
```
```solidity
File: src/L2/L2ToL1MessagePasser.sol
64: uint256 balance = address(this).balance;
```
```solidity
File: src/L2/WETHRebasing.sol
97: uint256 pending = address(this).balance - yieldBearingEth - _totalVoidAndRemainders;
```
```solidity
File: src/legacy/LegacyERC20ETH.sol
25: return address(_who).balance;
```
```solidity
File: src/mainnet-bridge/ETHYieldManager.sol
31: return address(this).balance;
```
```solidity
File: src/mainnet-bridge/yield-providers/LidoYieldProvider.sol
209: uint256 balanceBefore = address(YIELD_MANAGER).balance;
226: claimed = address(YIELD_MANAGER).balance - balanceBefore;
```
```solidity
File: src/universal/FeeVault.sol
63: address(this).balance >= MIN_WITHDRAWAL_AMOUNT,
67: uint256 value = address(this).balance;
```
### <a name="GAS-2"></a>[GAS-2] Use assembly to check for `address(0)`
*Saves 6 gas per instance*
*Instances (44)*:
```solidity
File: src/L1/DelayedVetoable.sol
68: if (msg.sender == address(0)) {
```
```solidity
File: src/L1/L1ERC721Bridge.sol
90: require(_remoteToken != address(0), "L1ERC721Bridge: remote token cannot be address(0)");
```
```solidity
File: src/L1/L2OutputOracle.sol
197: require(_outputRoot != bytes32(0), "L2OutputOracle: L2 output proposal cannot be the zero hash");
199: if (_l1BlockHash != bytes32(0)) {
```
```solidity
File: src/L1/OptimismPortal.sol
422: require(_to == address(0), "OptimismPortal: must send to address(0) when creating a contract");
451: if (msg.sender != yieldManager.blastBridge() || yieldManager.blastBridge() == address(0)) {
```
```solidity
File: src/L2/Blast.sol
77: return governorMap[contractAddress] == address(0);
```
```solidity
File: src/L2/ERC20Rebasing.sol
191: if (recipient == address(0)) {
237: if (from == address(0)) revert TransferFromZeroAddress();
238: if (to == address(0)) revert TransferToZeroAddress();
255: if (owner == address(0)) revert ApproveFromZeroAddress();
256: if (spender == address(0)) revert ApproveToZeroAddress();
```
```solidity
File: src/L2/L2ERC721Bridge.sol
93: require(_remoteToken != address(0), "L2ERC721Bridge: remote token cannot be address(0)");
```
```solidity
File: src/L2/L2StandardBridge.sol
153: if (_l1Token == address(0) && _l2Token == Predeploys.LEGACY_ERC20_ETH) {
```
```solidity
File: src/L2/USDB.sol
103: if (_to == address(0)) {
119: if (_from == address(0)) {
```
```solidity
File: src/governance/MintManager.sol
59: require(_newMintManager != address(0), "MintManager: mint manager cannot be the zero address");
```
```solidity
File: src/legacy/DeployerWhitelist.sol
61: require(_owner != address(0), "DeployerWhitelist: can only be disabled via enableArbitraryContractDeployment");
77: return (owner == address(0) || whitelist[_deployer]);
```
```solidity
File: src/legacy/L1ChugSplashProxy.sol
65: if (msg.sender == _getOwner() || msg.sender == address(0)) {
178: require(implementation != address(0), "L1ChugSplashProxy: implementation is not set yet");
```
```solidity
File: src/legacy/ResolvedDelegateProxy.sol
37: require(target != address(0), "ResolvedDelegateProxy: target address must be initialized");
```
```solidity
File: src/mainnet-bridge/Insurance.sol
52: if (_admin == address(0)) {
```
```solidity
File: src/mainnet-bridge/L1BlastBridge.sol
126: require(token != address(0));
244: require(usdYieldToken.provider != address(0));
266: require(_remoteToken == address(0), "L1BlastBridge: this token can only be bridged to ETH");
271: require(ethYieldToken.provider != address(0));
```
```solidity
File: src/mainnet-bridge/YieldManager.sol
143: require(_admin != address(0));
152: require(_insurance != address(0));
162: require(_blastBridge != address(0));
244: insurance != address(0)
270: insurance != address(0)
315: require(insurance != address(0));
```
```solidity
File: src/mainnet-bridge/withdrawal-queue/WithdrawalQueue.sol
393: if (TOKEN == address(0)) {
```
```solidity
File: src/mainnet-bridge/yield-providers/DSRYieldProvider.sol
87: return YIELD_MANAGER.insurance() != address(0);
```
```solidity
File: src/mainnet-bridge/yield-providers/LidoYieldProvider.sol
100: return YIELD_MANAGER.insurance() != address(0);
```
```solidity
File: src/universal/ERC721Bridge.sol
66: require(_otherBridge != address(0), "ERC721Bridge: other bridge cannot be address(0)");
148: require(_to != address(0), "ERC721Bridge: nft recipient cannot be address(0)");
```
```solidity
File: src/universal/OptimismMintableERC20Factory.sol
107: require(_remoteToken != address(0), "OptimismMintableERC20Factory: must provide remote token address");
```
```solidity
File: src/universal/OptimismMintableERC721.sol
52: require(_bridge != address(0), "OptimismMintableERC721: bridge cannot be address(0)");
54: require(_remoteToken != address(0), "OptimismMintableERC721: remote token cannot be address(0)");
```
```solidity
File: src/universal/OptimismMintableERC721Factory.sol
51: require(_remoteToken != address(0), "OptimismMintableERC721Factory: L1 token address cannot be address(0)");
```
```solidity
File: src/universal/Proxy.sol
27: if (msg.sender == _getAdmin() || msg.sender == address(0)) {
125: require(impl != address(0), "Proxy: implementation not initialized");
```
### <a name="GAS-3"></a>[GAS-3] `array[index] += amount` is cheaper than `array[index] = array[index] + amount` (or related variants)
When updating a value in an array with arithmetic, using `array[index] += amount` is cheaper than `array[index] = array[index] + amount`.
This is because you avoid an additonal `mload` when the array is stored in memory, and an `sload` when the array is stored in storage.
This can be applied for any arithmetic operation including `+=`, `-=`,`/=`,`*=`,`^=`,`&=`, `%=`, `<<=`,`>>=`, and `>>>=`.
This optimization can be particularly significant if the pattern occurs during a loop.
*Saves 28 gas for a storage array, 38 for a memory array*
*Instances (2)*:
```solidity
File: src/universal/StandardBridge.sol
286: deposits[_localToken][_remoteToken] = deposits[_localToken][_remoteToken] - _amount;
355: deposits[_localToken][_remoteToken] = deposits[_localToken][_remoteToken] + _amount;
```
### <a name="GAS-4"></a>[GAS-4] Using bools for storage incurs overhead
Use uint256(1) and uint256(2) for true/false to avoid a Gwarmaccess (100 gas), and to avoid Gsset (20000 gas) when changing from ‘false’ to ‘true’, after having been ‘true’ in the past. See [source](https://github.com/OpenZeppelin/openzeppelin-contracts/blob/58f635312aa21f947cae5f8578638a85aa2519f5/contracts/security/ReentrancyGuard.sol#L23-L27).
*Instances (19)*:
```solidity
File: src/L1/L1ERC721Bridge.sol
19: mapping(address => mapping(address => mapping(uint256 => bool))) public deposits;
```
```solidity
File: src/L1/OptimismPortal.sol
50: mapping(bytes32 => bool) public finalizedWithdrawals;
58: bool public paused;
```
```solidity
File: src/L2/CrossDomainOwnable3.sol
16: bool public isLocal = true;
```
```solidity
File: src/L2/L2ToL1MessagePasser.sol
24: mapping(bytes32 => bool) public sentMessages;
```
```solidity
File: src/cannon/PreimageOracle.sol
16: mapping(bytes32 => mapping(uint256 => bool)) public preimagePartOk;
```
```solidity
File: src/dispute/FaultDisputeGame.sol
76: mapping(ClaimHash => bool) internal claims;
82: bool internal subgameAtRootResolved;
```
```solidity
File: src/legacy/DeployerWhitelist.sol
21: mapping(address => bool) public whitelist;
```
```solidity
File: src/legacy/LegacyMessagePasser.sol
14: mapping(bytes32 => bool) public sentMessages;
```
```solidity
File: src/periphery/faucet/Faucet.sol
56: mapping(bytes32 => mapping(bytes32 => bool)) public nonces;
```
```solidity
File: src/periphery/op-nft/OptimistInviter.sol
85: mapping(address => mapping(bytes32 => bool)) public usedNonces;
```
```solidity
File: src/universal/CrossDomainMessenger.sol
50: bool private spacer_101_0_1;
71: mapping(bytes32 => bool) private spacer_201_0_32;
76: mapping(bytes32 => bool) private spacer_202_0_32;
123: mapping(bytes32 => bool) public successfulMessages;
139: mapping(bytes32 => bool) public failedMessages;
```
```solidity
File: src/universal/OptimismMintableERC721Factory.sol
17: mapping(address => bool) public isOptimismMintableERC721;
```
```solidity
File: src/universal/ProxyAdmin.sol
54: bool internal upgrading;
```
### <a name="GAS-5"></a>[GAS-5] Cache array length outside of loop
If not cached, the solidity compiler will always read the length of the array during each iteration. That is, if it is a storage array, this is an extra sload operation (100 additional extra gas for each iteration except for the first) and if it is a memory array, this is an extra mload operation (3 additional gas for each iteration except for the first).
*Instances (16)*:
```solidity
File: src/Safe/LivenessGuard.sol
49: for (uint256 i = 0; i < owners.length; i++) {
90: for (uint256 i = 0; i < owners.length; i++) {
113: for (uint256 i = 0; i < signers.length; i++) {
131: for (uint256 i = 0; i < ownersAfter.length; i++) {
144: for (uint256 i = 0; i < ownersBeforeCache.length; i++) {
```
```solidity
File: src/Safe/LivenessModule.sol
121: for (uint256 i = 0; i < _previousOwners.length; i++) {
```
```solidity
File: src/dispute/FaultDisputeGame.sol
399: for (uint256 i = 0; i < challengeIndices.length; ++i) {
```
```solidity
File: src/libraries/rlp/RLPWriter.sol
96: for (uint256 j = 0; j < out_.length; j++) {
141: for (; i < _list.length; i++) {
151: for (i = 0; i < _list.length; i++) {
```
```solidity
File: src/libraries/trie/MerkleTrie.sol
77: for (uint256 i = 0; i < proof.length; i++) {
```
```solidity
File: src/mainnet-bridge/withdrawal-queue/WithdrawalQueue.sol
132: for (uint256 i = 0; i < _requestIds.length; ++i) {
147: for (uint256 i = 0; i < _requestIds.length; ++i) {
259: for (uint256 i = 0; i < _requestIds.length; ++i) {
```
```solidity
File: src/mainnet-bridge/yield-providers/LidoYieldProvider.sol
196: for (i = 0; i < statuses.length; i++) {
```
```solidity
File: src/periphery/drippie/Drippie.sol
111: for (uint256 i = 0; i < _config.actions.length; i++) {
```
### <a name="GAS-6"></a>[GAS-6] State variables should be cached in stack variables rather than re-reading them from storage
The instances below point to the second+ access of a state variable within a function. Caching of a state variable replaces each Gwarmaccess (100 gas) with a much cheaper stack read. Other less obvious fixes/optimizations include having local memory caches of state variable structs, or having local caches of state variable contracts/addresses.
*Saves 100 gas per instance*
*Instances (1)*:
```solidity
File: src/mainnet-bridge/YieldManager.sol
283: totalYield -= int256(accumulatedNegativeYields);
```
### <a name="GAS-7"></a>[GAS-7] Use calldata instead of memory for function arguments that do not get mutated
Mark data types as `calldata` instead of `memory` where possible. This makes it so that the data is not automatically loaded into memory. If the data passed into the function does not need to be changed (like updating values in an array), it can be passed in as `calldata`. The one exception to this is if the argument must later be passed into another function that takes an argument that specifies `memory` storage.
*Instances (53)*:
```solidity
File: src/L1/OptimismPortal.sol
217: Types.WithdrawalTransaction memory _tx,
306: function finalizeWithdrawalTransaction(uint256 hintId, Types.WithdrawalTransaction memory _tx) external whenNotPaused {
413: bytes memory _data
```
```solidity
File: src/L1/SystemConfig.sol
162: ResourceMetering.ResourceConfig memory _config,
165: SystemConfig.Addresses memory _addresses
343: function setResourceConfig(ResourceMetering.ResourceConfig memory _config) external onlyOwner {
```
```solidity
File: src/L2/GasPriceOracle.sol
34: function getL1Fee(bytes memory _data) external view returns (uint256) {
86: function getL1GasUsed(bytes memory _data) public view returns (uint256) {
```
```solidity
File: src/L2/L2ToL1MessagePasser.sol
73: function initiateWithdrawal(address _target, uint256 _gasLimit, bytes memory _data) public payable {
```
```solidity
File: src/Safe/LivenessGuard.sol
72: bytes memory data,
79: bytes memory signatures,
```
```solidity
File: src/Safe/LivenessModule.sol
114: function removeOwners(address[] memory _previousOwners, address[] memory _ownersToRemove) external {
114: function removeOwners(address[] memory _previousOwners, address[] memory _ownersToRemove) external {
```
```solidity
File: src/legacy/AddressManager.sol
25: function setAddress(string memory _name, address _address) external onlyOwner {
36: function getAddress(string memory _name) external view returns (address) {
```
```solidity
File: src/legacy/L1ChugSplashProxy.sol
96: function setCode(bytes memory _code) external proxyCallIfNotOwner {
```
```solidity
File: src/legacy/LegacyMessagePasser.sol
22: function passMessageToL1(bytes memory _message) external {
```
```solidity
File: src/legacy/LegacyMintableERC20.sol
30: string memory _name,
31: string memory _symbol
```
```solidity
File: src/legacy/ResolvedDelegateProxy.sol
27: constructor(AddressManager _addressManager, string memory _implementationName) {
```
```solidity
File: src/mainnet-bridge/USDYieldManager.sol
49: bytes memory _extraData
```
```solidity
File: src/periphery/TransferOnion.sol
44: function peel(Layer[] memory _layers) public nonReentrant {
```
```solidity
File: src/periphery/drippie/dripchecks/CheckBalanceHigh.sol
19: function check(bytes memory _params) external view returns (bool execute_) {
```
```solidity
File: src/periphery/drippie/dripchecks/CheckBalanceLow.sol
19: function check(bytes memory _params) external view returns (bool execute_) {
```
```solidity
File: src/periphery/drippie/dripchecks/CheckGelatoLow.sol
24: function check(bytes memory _params) external view returns (bool execute_) {
```
```solidity
File: src/periphery/drippie/dripchecks/CheckTrue.sol
10: function check(bytes memory) external pure returns (bool execute_) {
```
```solidity
File: src/periphery/faucet/Faucet.sol
84: function configure(IFaucetAuthModule _module, ModuleConfig memory _config) public priviledged {
91: function drip(DripParameters memory _params, AuthParameters memory _auth) public {
91: function drip(DripParameters memory _params, AuthParameters memory _auth) public {
```
```solidity
File: src/periphery/faucet/authmodules/AdminFaucetAuthModule.sol
32: constructor(address _admin, string memory _name, string memory _version) EIP712(_name, _version) {
32: constructor(address _admin, string memory _name, string memory _version) EIP712(_name, _version) {
38: Faucet.DripParameters memory _params,
40: bytes memory _proof
```
```solidity
File: src/periphery/faucet/authmodules/IFaucetAuthModule.sol
15: Faucet.DripParameters memory _params,
17: bytes memory _proof
```
```solidity
File: src/periphery/op-nft/AttestationStation.sol
38: function attest(address _about, bytes32 _key, bytes memory _val) public {
```
```solidity
File: src/periphery/op-nft/OptimistInviter.sol
104: function initialize(string memory _name) public initializer {
175: function claimInvite(address _claimer, ClaimableInvite calldata _claimableInvite, bytes memory _signature) public {
```
```solidity
File: src/universal/OptimismMintableERC20.sol
49: string memory _name,
50: string memory _symbol,
```
```solidity
File: src/universal/OptimismMintableERC20Factory.sol
67: string memory _name,
68: string memory _symbol
83: string memory _name,
84: string memory _symbol
100: string memory _name,
101: string memory _symbol,
```
```solidity
File: src/universal/OptimismMintableERC721.sol
47: string memory _name,
48: string memory _symbol
```
```solidity
File: src/universal/OptimismMintableERC721Factory.sol
45: string memory _name,
46: string memory _symbol
```
```solidity
File: src/universal/ProxyAdmin.sol
73: function setImplementationName(address _address, string memory _name) external onlyOwner {
90: function setAddress(string memory _name, address _address) external onlyOwner {
187: bytes memory _data
```
### <a name="GAS-8"></a>[GAS-8] For Operations that will not overflow, you could use unchecked
*Instances (1706)*:
```solidity
File: src/EAS/Common.sol
19: uint8 v; // The recovery ID.
19: uint8 v; // The recovery ID.
20: bytes32 r; // The x-coordinate of the nonce R.
20: bytes32 r; // The x-coordinate of the nonce R.
20: bytes32 r; // The x-coordinate of the nonce R.
21: bytes32 s; // The signature data.
21: bytes32 s; // The signature data.
26: bytes32 uid; // A unique identifier of the attestation.
26: bytes32 uid; // A unique identifier of the attestation.
27: bytes32 schema; // The unique identifier of the schema.
27: bytes32 schema; // The unique identifier of the schema.
28: uint64 time; // The time when the attestation was created (Unix timestamp).
28: uint64 time; // The time when the attestation was created (Unix timestamp).
29: uint64 expirationTime; // The time when the attestation expires (Unix timestamp).
29: uint64 expirationTime; // The time when the attestation expires (Unix timestamp).
30: uint64 revocationTime; // The time when the attestation was revoked (Unix timestamp).
30: uint64 revocationTime; // The time when the attestation was revoked (Unix timestamp).
31: bytes32 refUID; // The UID of the related attestation.
31: bytes32 refUID; // The UID of the related attestation.
32: address recipient; // The recipient of the attestation.
32: address recipient; // The recipient of the attestation.
33: address attester; // The attester/sender of the attestation.
33: address attester; // The attester/sender of the attestation.
33: address attester; // The attester/sender of the attestation.
34: bool revocable; // Whether the attestation is revocable.
34: bool revocable; // Whether the attestation is revocable.
35: bytes data; // Custom attestation data.
35: bytes data; // Custom attestation data.
46: j = i + 1;
```
```solidity
File: src/EAS/EAS.sol
4: import { Address } from "@openzeppelin/contracts/utils/Address.sol";
4: import { Address } from "@openzeppelin/contracts/utils/Address.sol";
4: import { Address } from "@openzeppelin/contracts/utils/Address.sol";
5: import { ISemver } from "src/universal/ISemver.sol";
5: import { ISemver } from "src/universal/ISemver.sol";
6: import { Predeploys } from "src/libraries/Predeploys.sol";
6: import { Predeploys } from "src/libraries/Predeploys.sol";
7: import { EIP1271Verifier } from "src/EAS/eip1271/EIP1271Verifier.sol";
7: import { EIP1271Verifier } from "src/EAS/eip1271/EIP1271Verifier.sol";
7: import { EIP1271Verifier } from "src/EAS/eip1271/EIP1271Verifier.sol";
8: import { ISchemaResolver } from "src/EAS/resolver/ISchemaResolver.sol";
8: import { ISchemaResolver } from "src/EAS/resolver/ISchemaResolver.sol";
8: import { ISchemaResolver } from "src/EAS/resolver/ISchemaResolver.sol";
19: } from "./Common.sol";
34: } from "./IEAS.sol";
36: import { ISchemaRegistry, SchemaRecord } from "./ISchemaRegistry.sol";
39: uint256 usedValue; // Total ETH amount that was sent to resolvers.
39: uint256 usedValue; // Total ETH amount that was sent to resolvers.
40: bytes32[] uids; // UIDs of the new attestations.
40: bytes32[] uids; // UIDs of the new attestations.
80: uint256[MAX_GAP - 3] private __gap;
139: last = i == length - 1;
154: availableValue -= res.usedValue;
159: totalUidsCount += res.uids.length;
191: last = i == length - 1;
221: availableValue -= res.usedValue;
226: totalUidsCount += res.uids.length;
267: last = i == length - 1;
273: availableValue -= _revoke(multiRequest.schema, multiRequest.data, msg.sender, availableValue, last);
295: last = i == length - 1;
321: availableValue -=
451: ++bump;
451: ++bump;
593: availableValue -= value;
674: availableValue -= value;
675: totalUsedValue += value;
770: ++currentIndex;
770: ++currentIndex;
```
```solidity
File: src/EAS/IEAS.sol
4: import { ISchemaRegistry } from "src/EAS/ISchemaRegistry.sol";
4: import { ISchemaRegistry } from "src/EAS/ISchemaRegistry.sol";
5: import { Attestation, Signature } from "src/EAS/Common.sol";
5: import { Attestation, Signature } from "src/EAS/Common.sol";
9: address recipient; // The recipient of the attestation.
9: address recipient; // The recipient of the attestation.
10: uint64 expirationTime; // The time when the attestation expires (Unix timestamp).
10: uint64 expirationTime; // The time when the attestation expires (Unix timestamp).
11: bool revocable; // Whether the attestation is revocable.
11: bool revocable; // Whether the attestation is revocable.
12: bytes32 refUID; // The UID of the related attestation.
12: bytes32 refUID; // The UID of the related attestation.
13: bytes data; // Custom attestation data.
13: bytes data; // Custom attestation data.
14: uint256 value; // An explicit ETH amount to send to the resolver. This is important to prevent accidental user
14: uint256 value; // An explicit ETH amount to send to the resolver. This is important to prevent accidental user
20: bytes32 schema; // The unique identifier of the schema.
20: bytes32 schema; // The unique identifier of the schema.
21: AttestationRequestData data; // The arguments of the attestation request.
21: AttestationRequestData data; // The arguments of the attestation request.
26: bytes32 schema; // The unique identifier of the schema.
26: bytes32 schema; // The unique identifier of the schema.
27: AttestationRequestData data; // The arguments of the attestation request.
27: AttestationRequestData data; // The arguments of the attestation request.
28: Signature signature; // The ECDSA signature data.
28: Signature signature; // The ECDSA signature data.
29: address attester; // The attesting account.
29: address attester; // The attesting account.
30: uint64 deadline; // The deadline of the signature/request.
30: uint64 deadline; // The deadline of the signature/request.
30: uint64 deadline; // The deadline of the signature/request.
35: bytes32 schema; // The unique identifier of the schema.
35: bytes32 schema; // The unique identifier of the schema.
36: AttestationRequestData[] data; // The arguments of the attestation request.
36: AttestationRequestData[] data; // The arguments of the attestation request.
41: bytes32 schema; // The unique identifier of the schema.
41: bytes32 schema; // The unique identifier of the schema.
42: AttestationRequestData[] data; // The arguments of the attestation requests.
42: AttestationRequestData[] data; // The arguments of the attestation requests.
43: Signature[] signatures; // The ECDSA signatures data. Please note that the signatures are assumed to be signed with
43: Signature[] signatures; // The ECDSA signatures data. Please note that the signatures are assumed to be signed with
45: address attester; // The attesting account.
45: address attester; // The attesting account.
46: uint64 deadline; // The deadline of the signature/request.
46: uint64 deadline; // The deadline of the signature/request.
46: uint64 deadline; // The deadline of the signature/request.
51: bytes32 uid; // The UID of the attestation to revoke.
51: bytes32 uid; // The UID of the attestation to revoke.
52: uint256 value; // An explicit ETH amount to send to the resolver. This is important to prevent accidental user
52: uint256 value; // An explicit ETH amount to send to the resolver. This is important to prevent accidental user
58: bytes32 schema; // The unique identifier of the schema.
58: bytes32 schema; // The unique identifier of the schema.
59: RevocationRequestData data; // The arguments of the revocation request.
59: RevocationRequestData data; // The arguments of the revocation request.
64: bytes32 schema; // The unique identifier of the schema.
64: bytes32 schema; // The unique identifier of the schema.
65: RevocationRequestData data; // The arguments of the revocation request.
65: RevocationRequestData data; // The arguments of the revocation request.
66: Signature signature; // The ECDSA signature data.
66: Signature signature; // The ECDSA signature data.
67: address revoker; // The revoking account.
67: address revoker; // The revoking account.
68: uint64 deadline; // The deadline of the signature/request.
68: uint64 deadline; // The deadline of the signature/request.
68: uint64 deadline; // The deadline of the signature/request.
73: bytes32 schema; // The unique identifier of the schema.
73: bytes32 schema; // The unique identifier of the schema.
74: RevocationRequestData[] data; // The arguments of the revocation request.
74: RevocationRequestData[] data; // The arguments of the revocation request.
79: bytes32 schema; // The unique identifier of the schema.
79: bytes32 schema; // The unique identifier of the schema.
80: RevocationRequestData[] data; // The arguments of the revocation requests.
80: RevocationRequestData[] data; // The arguments of the revocation requests.
81: Signature[] signatures; // The ECDSA signatures data. Please note that the signatures are assumed to be signed with
81: Signature[] signatures; // The ECDSA signatures data. Please note that the signatures are assumed to be signed with
83: address revoker; // The revoking account.
83: address revoker; // The revoking account.
84: uint64 deadline; // The deadline of the signature/request.
84: uint64 deadline; // The deadline of the signature/request.
84: uint64 deadline; // The deadline of the signature/request.
```
```solidity
File: src/EAS/ISchemaRegistry.sol
4: import { ISchemaResolver } from "src/EAS/resolver/ISchemaResolver.sol";
4: import { ISchemaResolver } from "src/EAS/resolver/ISchemaResolver.sol";
4: import { ISchemaResolver } from "src/EAS/resolver/ISchemaResolver.sol";
8: bytes32 uid; // The unique identifier of the schema.
8: bytes32 uid; // The unique identifier of the schema.
9: ISchemaResolver resolver; // Optional schema resolver.
9: ISchemaResolver resolver; // Optional schema resolver.
10: bool revocable; // Whether the schema allows revocations explicitly.
10: bool revocable; // Whether the schema allows revocations explicitly.
11: string schema; // Custom specification of the schema (e.g., an ABI).
11: string schema; // Custom specification of the schema (e.g., an ABI).
```
```solidity
File: src/EAS/SchemaRegistry.sol
4: import { ISemver } from "src/universal/ISemver.sol";
4: import { ISemver } from "src/universal/ISemver.sol";
5: import { ISchemaResolver } from "src/EAS/resolver/ISchemaResolver.sol";
5: import { ISchemaResolver } from "src/EAS/resolver/ISchemaResolver.sol";
5: import { ISchemaResolver } from "src/EAS/resolver/ISchemaResolver.sol";
6: import { EMPTY_UID, MAX_GAP } from "src/EAS/Common.sol";
6: import { EMPTY_UID, MAX_GAP } from "src/EAS/Common.sol";
7: import { ISchemaRegistry, SchemaRecord } from "src/EAS/ISchemaRegistry.sol";
7: import { ISchemaRegistry, SchemaRecord } from "src/EAS/ISchemaRegistry.sol";
20: uint256[MAX_GAP - 1] private __gap;
```
```solidity
File: src/EAS/eip1271/EIP1271Verifier.sol
4: import { EIP712 } from "@openzeppelin/contracts/utils/cryptography/draft-EIP712.sol";
4: import { EIP712 } from "@openzeppelin/contracts/utils/cryptography/draft-EIP712.sol";
4: import { EIP712 } from "@openzeppelin/contracts/utils/cryptography/draft-EIP712.sol";
4: import { EIP712 } from "@openzeppelin/contracts/utils/cryptography/draft-EIP712.sol";
4: import { EIP712 } from "@openzeppelin/contracts/utils/cryptography/draft-EIP712.sol";
5: import { SignatureChecker } from "@openzeppelin/contracts/utils/cryptography/SignatureChecker.sol";
5: import { SignatureChecker } from "@openzeppelin/contracts/utils/cryptography/SignatureChecker.sol";
5: import { SignatureChecker } from "@openzeppelin/contracts/utils/cryptography/SignatureChecker.sol";
5: import { SignatureChecker } from "@openzeppelin/contracts/utils/cryptography/SignatureChecker.sol";
6: import { Address } from "@openzeppelin/contracts/utils/Address.sol";
6: import { Address } from "@openzeppelin/contracts/utils/Address.sol";
6: import { Address } from "@openzeppelin/contracts/utils/Address.sol";
13: } from "../IEAS.sol";
23: } from "../Common.sol";
48: uint256[MAX_GAP - 1] private __gap;
126: _nonces[request.attester]++,
126: _nonces[request.attester]++,
153: REVOKE_TYPEHASH, request.schema, data.uid, data.value, _nonces[request.revoker]++, request.deadline
153: REVOKE_TYPEHASH, request.schema, data.uid, data.value, _nonces[request.revoker]++, request.deadline
```
```solidity
File: src/EAS/resolver/ISchemaResolver.sol
4: import { Attestation } from "../Common.sol";
```
```solidity
File: src/EAS/resolver/SchemaResolver.sol
4: import { Semver } from "../../universal/Semver.sol";
4: import { Semver } from "../../universal/Semver.sol";
4: import { Semver } from "../../universal/Semver.sol";
6: import { IEAS, Attestation } from "../IEAS.sol";
7: import { AccessDenied, InvalidEAS, InvalidLength, uncheckedInc } from "../Common.sol";
9: import { ISchemaResolver } from "./ISchemaResolver.sol";
89: remainingValue -= value;
136: remainingValue -= value;
```
```solidity
File: src/L1/DelayedVetoable.sol
4: import { ISemver } from "src/universal/ISemver.sol";
4: import { ISemver } from "src/universal/ISemver.sol";
173: if (_queuedAt[callHash] + _delay < block.timestamp) {
```
```solidity
File: src/L1/L1CrossDomainMessenger.sol
4: import { Predeploys } from "src/libraries/Predeploys.sol";
4: import { Predeploys } from "src/libraries/Predeploys.sol";
5: import { SafeCall } from "src/libraries/SafeCall.sol";
5: import { SafeCall } from "src/libraries/SafeCall.sol";
6: import { Hashing } from "src/libraries/Hashing.sol";
6: import { Hashing } from "src/libraries/Hashing.sol";
7: import { Encoding } from "src/libraries/Encoding.sol";
7: import { Encoding } from "src/libraries/Encoding.sol";
8: import { OptimismPortal } from "src/L1/OptimismPortal.sol";
8: import { OptimismPortal } from "src/L1/OptimismPortal.sol";
9: import { CrossDomainMessenger } from "src/universal/CrossDomainMessenger.sol";
9: import { CrossDomainMessenger } from "src/universal/CrossDomainMessenger.sol";
10: import { ISemver } from "src/universal/ISemver.sol";
10: import { ISemver } from "src/universal/ISemver.sol";
11: import { Constants } from "src/libraries/Constants.sol";
11: import { Constants } from "src/libraries/Constants.sol";
126: !SafeCall.hasMinGas(_minGasLimit, RELAY_RESERVED_GAS + RELAY_GAS_CHECK_BUFFER)
148: bool success = SafeCall.call(_target, gasleft() - RELAY_RESERVED_GAS, _valueWithDiscount, _message);
```
```solidity
File: src/L1/L1ERC721Bridge.sol
4: import { ERC721Bridge } from "src/universal/ERC721Bridge.sol";
4: import { ERC721Bridge } from "src/universal/ERC721Bridge.sol";
5: import { IERC721 } from "@openzeppelin/contracts/token/ERC721/IERC721.sol";
5: import { IERC721 } from "@openzeppelin/contracts/token/ERC721/IERC721.sol";
5: import { IERC721 } from "@openzeppelin/contracts/token/ERC721/IERC721.sol";
5: import { IERC721 } from "@openzeppelin/contracts/token/ERC721/IERC721.sol";
6: import { L2ERC721Bridge } from "src/L2/L2ERC721Bridge.sol";
6: import { L2ERC721Bridge } from "src/L2/L2ERC721Bridge.sol";
7: import { ISemver } from "src/universal/ISemver.sol";
7: import { ISemver } from "src/universal/ISemver.sol";
8: import { Predeploys } from "src/libraries/Predeploys.sol";
8: import { Predeploys } from "src/libraries/Predeploys.sol";
9: import { CrossDomainMessenger } from "src/universal/CrossDomainMessenger.sol";
9: import { CrossDomainMessenger } from "src/universal/CrossDomainMessenger.sol";
10: import { Constants } from "src/libraries/Constants.sol";
10: import { Constants } from "src/libraries/Constants.sol";
```
```solidity
File: src/L1/L1StandardBridge.sol
4: import { Predeploys } from "src/libraries/Predeploys.sol";
4: import { Predeploys } from "src/libraries/Predeploys.sol";
5: import { SafeCall } from "src/libraries/SafeCall.sol";
5: import { SafeCall } from "src/libraries/SafeCall.sol";
6: import { StandardBridge } from "src/universal/StandardBridge.sol";
6: import { StandardBridge } from "src/universal/StandardBridge.sol";
7: import { ISemver } from "src/universal/ISemver.sol";
7: import { ISemver } from "src/universal/ISemver.sol";
8: import { CrossDomainMessenger } from "src/universal/CrossDomainMessenger.sol";
8: import { CrossDomainMessenger } from "src/universal/CrossDomainMessenger.sol";
9: import { Constants } from "src/libraries/Constants.sol";
9: import { Constants } from "src/libraries/Constants.sol";
```
```solidity
File: src/L1/L2OutputOracle.sol
4: import { Initializable } from "@openzeppelin/contracts/proxy/utils/Initializable.sol";
4: import { Initializable } from "@openzeppelin/contracts/proxy/utils/Initializable.sol";
4: import { Initializable } from "@openzeppelin/contracts/proxy/utils/Initializable.sol";
4: import { Initializable } from "@openzeppelin/contracts/proxy/utils/Initializable.sol";
5: import { ISemver } from "src/universal/ISemver.sol";
5: import { ISemver } from "src/universal/ISemver.sol";
6: import { Types } from "src/libraries/Types.sol";
6: import { Types } from "src/libraries/Types.sol";
7: import { Constants } from "src/libraries/Constants.sol";
7: import { Constants } from "src/libraries/Constants.sol";
155: block.timestamp - l2Outputs[_l2OutputIndex].timestamp < FINALIZATION_PERIOD_SECONDS,
251: uint256 mid = (lo + hi) / 2;
251: uint256 mid = (lo + hi) / 2;
253: lo = mid + 1;
275: return l2Outputs.length - 1;
289: return l2Outputs.length == 0 ? startingBlockNumber : l2Outputs[l2Outputs.length - 1].l2BlockNumber;
295: return latestBlockNumber() + SUBMISSION_INTERVAL;
302: return startingTimestamp + ((_l2BlockNumber - startingBlockNumber) * L2_BLOCK_TIME);
302: return startingTimestamp + ((_l2BlockNumber - startingBlockNumber) * L2_BLOCK_TIME);
302: return startingTimestamp + ((_l2BlockNumber - startingBlockNumber) * L2_BLOCK_TIME);
```
```solidity
File: src/L1/OptimismPortal.sol
4: import { Initializable } from "@openzeppelin/contracts/proxy/utils/Initializable.sol";
4: import { Initializable } from "@openzeppelin/contracts/proxy/utils/Initializable.sol";
4: import { Initializable } from "@openzeppelin/contracts/proxy/utils/Initializable.sol";
4: import { Initializable } from "@openzeppelin/contracts/proxy/utils/Initializable.sol";
5: import { SafeCall } from "src/libraries/SafeCall.sol";
5: import { SafeCall } from "src/libraries/SafeCall.sol";
6: import { L2OutputOracle } from "src/L1/L2OutputOracle.sol";
6: import { L2OutputOracle } from "src/L1/L2OutputOracle.sol";
7: import { SystemConfig } from "src/L1/SystemConfig.sol";
7: import { SystemConfig } from "src/L1/SystemConfig.sol";
8: import { Constants } from "src/libraries/Constants.sol";
8: import { Constants } from "src/libraries/Constants.sol";
9: import { Types } from "src/libraries/Types.sol";
9: import { Types } from "src/libraries/Types.sol";
10: import { Hashing } from "src/libraries/Hashing.sol";
10: import { Hashing } from "src/libraries/Hashing.sol";
11: import { SecureMerkleTrie } from "src/libraries/trie/SecureMerkleTrie.sol";
11: import { SecureMerkleTrie } from "src/libraries/trie/SecureMerkleTrie.sol";
11: import { SecureMerkleTrie } from "src/libraries/trie/SecureMerkleTrie.sol";
12: import { AddressAliasHelper } from "src/vendor/AddressAliasHelper.sol";
12: import { AddressAliasHelper } from "src/vendor/AddressAliasHelper.sol";
13: import { ResourceMetering } from "src/L1/ResourceMetering.sol";
13: import { ResourceMetering } from "src/L1/ResourceMetering.sol";
14: import { ISemver } from "src/universal/ISemver.sol";
14: import { ISemver } from "src/universal/ISemver.sol";
15: import { ETHYieldManager } from "src/mainnet-bridge/ETHYieldManager.sol";
15: import { ETHYieldManager } from "src/mainnet-bridge/ETHYieldManager.sol";
15: import { ETHYieldManager } from "src/mainnet-bridge/ETHYieldManager.sol";
16: import { Predeploys } from "src/libraries/Predeploys.sol";
16: import { Predeploys } from "src/libraries/Predeploys.sol";
189: return _byteCount * 16 + 21000;
189: return _byteCount * 16 + 21000;
261: uint256(0) // The withdrawals mapping is at the first slot in the layout.
261: uint256(0) // The withdrawals mapping is at the first slot in the layout.
372: txValueWithDiscount = address(this).balance - etherBalance;
485: return block.timestamp > _timestamp + l2Oracle.FINALIZATION_PERIOD_SECONDS();
```
```solidity
File: src/L1/ProtocolVersions.sol
4: import { OwnableUpgradeable } from "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol";
4: import { OwnableUpgradeable } from "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol";
4: import { OwnableUpgradeable } from "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol";
4: import { OwnableUpgradeable } from "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol";
5: import { ISemver } from "src/universal/ISemver.sol";
5: import { ISemver } from "src/universal/ISemver.sol";
6: import { Storage } from "src/libraries/Storage.sol";
6: import { Storage } from "src/libraries/Storage.sol";
7: import { Constants } from "src/libraries/Constants.sol";
7: import { Constants } from "src/libraries/Constants.sol";
27: bytes32 public constant REQUIRED_SLOT = bytes32(uint256(keccak256("protocolversion.required")) - 1);
30: bytes32 public constant RECOMMENDED_SLOT = bytes32(uint256(keccak256("protocolversion.recommended")) - 1);
```
```solidity
File: src/L1/ResourceMetering.sol
4: import { Initializable } from "@openzeppelin/contracts/proxy/utils/Initializable.sol";
4: import { Initializable } from "@openzeppelin/contracts/proxy/utils/Initializable.sol";
4: import { Initializable } from "@openzeppelin/contracts/proxy/utils/Initializable.sol";
4: import { Initializable } from "@openzeppelin/contracts/proxy/utils/Initializable.sol";
5: import { Math } from "@openzeppelin/contracts/utils/math/Math.sol";
5: import { Math } from "@openzeppelin/contracts/utils/math/Math.sol";
5: import { Math } from "@openzeppelin/contracts/utils/math/Math.sol";
5: import { Math } from "@openzeppelin/contracts/utils/math/Math.sol";
6: import { Burn } from "src/libraries/Burn.sol";
6: import { Burn } from "src/libraries/Burn.sol";
7: import { Arithmetic } from "src/libraries/Arithmetic.sol";
7: import { Arithmetic } from "src/libraries/Arithmetic.sol";
76: uint256 blockDiff = block.number - params.prevBlockNum;
80: int256(uint256(config.maxResourceLimit)) / int256(uint256(config.elasticityMultiplier));
86: int256 gasUsedDelta = int256(uint256(params.prevBoughtGas)) - targetResourceLimit;
87: int256 baseFeeDelta = (int256(uint256(params.prevBaseFee)) * gasUsedDelta)
88: / (targetResourceLimit * int256(uint256(config.baseFeeMaxChangeDenominator)));
88: / (targetResourceLimit * int256(uint256(config.baseFeeMaxChangeDenominator)));
93: _value: int256(uint256(params.prevBaseFee)) + baseFeeDelta,
109: _exponent: int256(blockDiff - 1)
123: params.prevBoughtGas += _amount;
130: uint256 resourceCost = uint256(_amount) * uint256(params.prevBaseFee);
137: uint256 gasCost = resourceCost / Math.max(block.basefee, 1 gwei);
142: uint256 usedGas = _initialGas - gasleft();
144: Burn.gas(gasCost - usedGas);
```
```solidity
File: src/L1/SystemConfig.sol
4: import { OwnableUpgradeable } from "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol";
4: import { OwnableUpgradeable } from "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol";
4: import { OwnableUpgradeable } from "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol";
4: import { OwnableUpgradeable } from "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol";
5: import { ISemver } from "src/universal/ISemver.sol";
5: import { ISemver } from "src/universal/ISemver.sol";
6: import { ResourceMetering } from "src/L1/ResourceMetering.sol";
6: import { ResourceMetering } from "src/L1/ResourceMetering.sol";
7: import { Storage } from "src/libraries/Storage.sol";
7: import { Storage } from "src/libraries/Storage.sol";
8: import { Constants } from "src/libraries/Constants.sol";
8: import { Constants } from "src/libraries/Constants.sol";
54: bytes32(uint256(keccak256("systemconfig.l1crossdomainmessenger")) - 1);
57: bytes32 public constant L1_ERC_721_BRIDGE_SLOT = bytes32(uint256(keccak256("systemconfig.l1erc721bridge")) - 1);
60: bytes32 public constant L1_STANDARD_BRIDGE_SLOT = bytes32(uint256(keccak256("systemconfig.l1standardbridge")) - 1);
63: bytes32 public constant L2_OUTPUT_ORACLE_SLOT = bytes32(uint256(keccak256("systemconfig.l2outputoracle")) - 1);
66: bytes32 public constant OPTIMISM_PORTAL_SLOT = bytes32(uint256(keccak256("systemconfig.optimismportal")) - 1);
70: bytes32(uint256(keccak256("systemconfig.optimismmintableerc20factory")) - 1);
73: bytes32 public constant BATCH_INBOX_SLOT = bytes32(uint256(keccak256("systemconfig.batchinbox")) - 1);
200: return uint64(_resourceConfig.maxResourceLimit) + uint64(_resourceConfig.systemTxMaxGas);
359: require(_config.maxResourceLimit + _config.systemTxMaxGas <= gasLimit, "SystemConfig: gas limit too low");
364: ((_config.maxResourceLimit / _config.elasticityMultiplier) * _config.elasticityMultiplier)
364: ((_config.maxResourceLimit / _config.elasticityMultiplier) * _config.elasticityMultiplier)
```
```solidity
File: src/L2/BaseFeeVault.sol
4: import { ISemver } from "src/universal/ISemver.sol";
4: import { ISemver } from "src/universal/ISemver.sol";
5: import { FeeVault } from "src/universal/FeeVault.sol";
5: import { FeeVault } from "src/universal/FeeVault.sol";
```
```solidity
File: src/L2/Blast.sol
3: import { GasMode, IGas } from "src/L2/Gas.sol";
3: import { GasMode, IGas } from "src/L2/Gas.sol";
```
```solidity
File: src/L2/CrossDomainOwnable.sol
4: import { Ownable } from "@openzeppelin/contracts/access/Ownable.sol";
4: import { Ownable } from "@openzeppelin/contracts/access/Ownable.sol";
4: import { Ownable } from "@openzeppelin/contracts/access/Ownable.sol";
5: import { AddressAliasHelper } from "src/vendor/AddressAliasHelper.sol";
5: import { AddressAliasHelper } from "src/vendor/AddressAliasHelper.sol";
```
```solidity
File: src/L2/CrossDomainOwnable2.sol
4: import { Predeploys } from "src/libraries/Predeploys.sol";
4: import { Predeploys } from "src/libraries/Predeploys.sol";
5: import { L2CrossDomainMessenger } from "src/L2/L2CrossDomainMessenger.sol";
5: import { L2CrossDomainMessenger } from "src/L2/L2CrossDomainMessenger.sol";
6: import { Ownable } from "@openzeppelin/contracts/access/Ownable.sol";
6: import { Ownable } from "@openzeppelin/contracts/access/Ownable.sol";
6: import { Ownable } from "@openzeppelin/contracts/access/Ownable.sol";
```
```solidity
File: src/L2/CrossDomainOwnable3.sol
4: import { Predeploys } from "src/libraries/Predeploys.sol";
4: import { Predeploys } from "src/libraries/Predeploys.sol";
5: import { L2CrossDomainMessenger } from "src/L2/L2CrossDomainMessenger.sol";
5: import { L2CrossDomainMessenger } from "src/L2/L2CrossDomainMessenger.sol";
6: import { Ownable } from "@openzeppelin/contracts/access/Ownable.sol";
6: import { Ownable } from "@openzeppelin/contracts/access/Ownable.sol";
6: import { Ownable } from "@openzeppelin/contracts/access/Ownable.sol";
```
```solidity
File: src/L2/ERC20PermitUpgradeable.sol
6: import "@openzeppelin/contracts-upgradeable/token/ERC20/extensions/IERC20PermitUpgradeable.sol";
6: import "@openzeppelin/contracts-upgradeable/token/ERC20/extensions/IERC20PermitUpgradeable.sol";
6: import "@openzeppelin/contracts-upgradeable/token/ERC20/extensions/IERC20PermitUpgradeable.sol";
6: import "@openzeppelin/contracts-upgradeable/token/ERC20/extensions/IERC20PermitUpgradeable.sol";
6: import "@openzeppelin/contracts-upgradeable/token/ERC20/extensions/IERC20PermitUpgradeable.sol";
6: import "@openzeppelin/contracts-upgradeable/token/ERC20/extensions/IERC20PermitUpgradeable.sol";
7: import "@openzeppelin/contracts-upgradeable/token/ERC20/ERC20Upgradeable.sol";
7: import "@openzeppelin/contracts-upgradeable/token/ERC20/ERC20Upgradeable.sol";
7: import "@openzeppelin/contracts-upgradeable/token/ERC20/ERC20Upgradeable.sol";
7: import "@openzeppelin/contracts-upgradeable/token/ERC20/ERC20Upgradeable.sol";
7: import "@openzeppelin/contracts-upgradeable/token/ERC20/ERC20Upgradeable.sol";
8: import "@openzeppelin/contracts-upgradeable/utils/cryptography/ECDSAUpgradeable.sol";
8: import "@openzeppelin/contracts-upgradeable/utils/cryptography/ECDSAUpgradeable.sol";
8: import "@openzeppelin/contracts-upgradeable/utils/cryptography/ECDSAUpgradeable.sol";
8: import "@openzeppelin/contracts-upgradeable/utils/cryptography/ECDSAUpgradeable.sol";
8: import "@openzeppelin/contracts-upgradeable/utils/cryptography/ECDSAUpgradeable.sol";
9: import "@openzeppelin/contracts-upgradeable/utils/cryptography/EIP712Upgradeable.sol";
9: import "@openzeppelin/contracts-upgradeable/utils/cryptography/EIP712Upgradeable.sol";
9: import "@openzeppelin/contracts-upgradeable/utils/cryptography/EIP712Upgradeable.sol";
9: import "@openzeppelin/contracts-upgradeable/utils/cryptography/EIP712Upgradeable.sol";
9: import "@openzeppelin/contracts-upgradeable/utils/cryptography/EIP712Upgradeable.sol";
10: import "@openzeppelin/contracts-upgradeable/utils/CountersUpgradeable.sol";
10: import "@openzeppelin/contracts-upgradeable/utils/CountersUpgradeable.sol";
10: import "@openzeppelin/contracts-upgradeable/utils/CountersUpgradeable.sol";
10: import "@openzeppelin/contracts-upgradeable/utils/CountersUpgradeable.sol";
11: import "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";
11: import "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";
11: import "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";
11: import "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";
11: import "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";
```
```solidity
File: src/L2/ERC20Rebasing.sol
4: import { Initializable } from "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";
4: import { Initializable } from "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";
4: import { Initializable } from "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";
4: import { Initializable } from "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";
4: import { Initializable } from "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";
5: import { IERC20 } from "@openzeppelin/contracts/interfaces/IERC20.sol";
5: import { IERC20 } from "@openzeppelin/contracts/interfaces/IERC20.sol";
5: import { IERC20 } from "@openzeppelin/contracts/interfaces/IERC20.sol";
7: import { SharesBase } from "src/L2/Shares.sol";
7: import { SharesBase } from "src/L2/Shares.sol";
8: import { YieldMode } from "src/L2/Blast.sol";
8: import { YieldMode } from "src/L2/Blast.sol";
9: import { ERC20PermitUpgradeable } from "src/L2/ERC20PermitUpgradeable.sol";
9: import { ERC20PermitUpgradeable } from "src/L2/ERC20PermitUpgradeable.sol";
103: return price * _totalShares + _totalVoidAndRemainders;
103: return price * _totalShares + _totalVoidAndRemainders;
181: return shareValue - _fixed[account];
201: uint256 claimableAmount = shareValue - _fixed[account];
206: (uint256 newShares, uint256 newRemainder) = _computeSharesAndRemainder(shareValue - amount);
275: _approve(owner, spender, currentAllowance - amount);
284: uint256 balanceAfter = balanceOf(account) + amount;
291: _totalVoidAndRemainders += amount;
305: _setBalance(account, balance - amount, false);
312: _totalVoidAndRemainders -= amount;
341: _totalVoidAndRemainders -= prevFixed;
347: _totalVoidAndRemainders += balance;
373: shareValue = shareValue + amount - _fixed[account];
373: shareValue = shareValue + amount - _fixed[account];
388: _totalShares = _totalShares + newShares - _shares[account];
388: _totalShares = _totalShares + newShares - _shares[account];
389: _totalVoidAndRemainders = _totalVoidAndRemainders + newRemainder - _remainders[account];
389: _totalVoidAndRemainders = _totalVoidAndRemainders + newRemainder - _remainders[account];
403: shares = value / price;
413: return price * shares + remainders;
413: return price * shares + remainders;
```
```solidity
File: src/L2/Gas.sol
3: import { SafeTransferLib } from "solmate/utils/SafeTransferLib.sol";
3: import { SafeTransferLib } from "solmate/utils/SafeTransferLib.sol";
4: import { Math } from "@openzeppelin/contracts/utils/math/Math.sol";
4: import { Math } from "@openzeppelin/contracts/utils/math/Math.sol";
4: import { Math } from "@openzeppelin/contracts/utils/math/Math.sol";
4: import { Math } from "@openzeppelin/contracts/utils/math/Math.sol";
31: uint256 public zeroClaimRate; // bps
31: uint256 public zeroClaimRate; // bps
36: uint256 public baseClaimRate; // bps
36: uint256 public baseClaimRate; // bps
41: uint256 public ceilClaimRate; // bps
41: uint256 public ceilClaimRate; // bps
165: uint256 bipsDiff = minClaimRateBips - baseClaimRate;
166: uint256 secondsDiff = ceilGasSeconds - baseGasSeconds;
167: uint256 rateDiff = ceilClaimRate - baseClaimRate;
168: uint256 minSecondsStaked = baseGasSeconds + Math.ceilDiv(bipsDiff * secondsDiff, rateDiff);
168: uint256 minSecondsStaked = baseGasSeconds + Math.ceilDiv(bipsDiff * secondsDiff, rateDiff);
169: uint256 maxEtherClaimable = etherSeconds / minSecondsStaked;
173: uint256 secondsToConsume = maxEtherClaimable * minSecondsStaked;
211: require(gasToClaim > 0, "must withdraw non-zero amount");
219: uint256 userEther = gasToClaim * claimRate / 10_000;
219: uint256 userEther = gasToClaim * claimRate / 10_000;
220: uint256 penalty = gasToClaim - userEther;
222: _updateGasParams(contractAddress, etherSeconds - gasSecondsToConsumeNormalized, etherBalance - gasToClaim, mode);
222: _updateGasParams(contractAddress, etherSeconds - gasSecondsToConsumeNormalized, etherBalance - gasToClaim, mode);
239: uint256 secondsStaked = gasSecondsToConsume / gasToClaim;
244: uint256 gasToConsumeNormalized = gasToClaim * ceilGasSeconds;
248: uint256 rateDiff = ceilClaimRate - baseClaimRate;
249: uint256 secondsDiff = ceilGasSeconds - baseGasSeconds;
250: uint256 secondsStakedDiff = secondsStaked - baseGasSeconds;
251: uint256 additionalClaimRate = rateDiff * secondsStakedDiff / secondsDiff;
251: uint256 additionalClaimRate = rateDiff * secondsStakedDiff / secondsDiff;
252: uint256 claimRate = baseClaimRate + additionalClaimRate;
278: etherBalance = uint256((packedParams << (1 * 8)) >> ((32 - 12) * 8));
278: etherBalance = uint256((packedParams << (1 * 8)) >> ((32 - 12) * 8));
278: etherBalance = uint256((packedParams << (1 * 8)) >> ((32 - 12) * 8));
279: etherSeconds = uint256((packedParams << ((1 + 12) * 8)) >> ((32 - 15) * 8));
279: etherSeconds = uint256((packedParams << ((1 + 12) * 8)) >> ((32 - 15) * 8));
279: etherSeconds = uint256((packedParams << ((1 + 12) * 8)) >> ((32 - 15) * 8));
279: etherSeconds = uint256((packedParams << ((1 + 12) * 8)) >> ((32 - 15) * 8));
280: lastUpdated = uint256((packedParams << ((1 + 12 + 15) * 8)) >> ((32 - 4) * 8));
280: lastUpdated = uint256((packedParams << ((1 + 12 + 15) * 8)) >> ((32 - 4) * 8));
280: lastUpdated = uint256((packedParams << ((1 + 12 + 15) * 8)) >> ((32 - 4) * 8));
280: lastUpdated = uint256((packedParams << ((1 + 12 + 15) * 8)) >> ((32 - 4) * 8));
280: lastUpdated = uint256((packedParams << ((1 + 12 + 15) * 8)) >> ((32 - 4) * 8));
283: etherSeconds = etherSeconds + etherBalance * (block.timestamp - lastUpdated);
283: etherSeconds = etherSeconds + etherBalance * (block.timestamp - lastUpdated);
283: etherSeconds = etherSeconds + etherBalance * (block.timestamp - lastUpdated);
294: etherBalance >= 1 << (12 * 8) ||
295: etherSeconds >= 1 << (15 * 8)
300: uint256 updatedTimestamp = block.timestamp; // Known to fit in 4 bytes
300: uint256 updatedTimestamp = block.timestamp; // Known to fit in 4 bytes
305: (bytes32(uint256(mode)) << ((12 + 15 + 4) * 8)) | // Shift mode to the most significant byte
305: (bytes32(uint256(mode)) << ((12 + 15 + 4) * 8)) | // Shift mode to the most significant byte
305: (bytes32(uint256(mode)) << ((12 + 15 + 4) * 8)) | // Shift mode to the most significant byte
305: (bytes32(uint256(mode)) << ((12 + 15 + 4) * 8)) | // Shift mode to the most significant byte
305: (bytes32(uint256(mode)) << ((12 + 15 + 4) * 8)) | // Shift mode to the most significant byte
306: (bytes32(etherBalance) << ((15 + 4) * 8)) | // Shift etherBalance to start after 1 byte of mode
306: (bytes32(etherBalance) << ((15 + 4) * 8)) | // Shift etherBalance to start after 1 byte of mode
306: (bytes32(etherBalance) << ((15 + 4) * 8)) | // Shift etherBalance to start after 1 byte of mode
306: (bytes32(etherBalance) << ((15 + 4) * 8)) | // Shift etherBalance to start after 1 byte of mode
307: (bytes32(etherSeconds) << (4 * 8)) | // Shift etherSeconds to start after mode and etherBalance
307: (bytes32(etherSeconds) << (4 * 8)) | // Shift etherSeconds to start after mode and etherBalance
307: (bytes32(etherSeconds) << (4 * 8)) | // Shift etherSeconds to start after mode and etherBalance
308: bytes32(updatedTimestamp) // Keep updatedTimestamp in the least significant bytes
308: bytes32(updatedTimestamp) // Keep updatedTimestamp in the least significant bytes
```
```solidity
File: src/L2/GasPriceOracle.sol
4: import { ISemver } from "src/universal/ISemver.sol";
4: import { ISemver } from "src/universal/ISemver.sol";
5: import { Predeploys } from "src/libraries/Predeploys.sol";
5: import { Predeploys } from "src/libraries/Predeploys.sol";
6: import { L1Block } from "src/L2/L1Block.sol";
6: import { L1Block } from "src/L2/L1Block.sol";
36: uint256 l1Fee = l1GasUsed * l1BaseFee();
37: uint256 divisor = 10 ** DECIMALS;
37: uint256 divisor = 10 ** DECIMALS;
38: uint256 unscaled = l1Fee * scalar();
39: uint256 scaled = unscaled / divisor;
89: for (uint256 i = 0; i < length; i++) {
89: for (uint256 i = 0; i < length; i++) {
91: total += 4;
93: total += 16;
96: uint256 unsigned = total + overhead();
97: return unsigned + (68 * 16);
97: return unsigned + (68 * 16);
```
```solidity
File: src/L2/L1Block.sol
4: import { ISemver } from "src/universal/ISemver.sol";
4: import { ISemver } from "src/universal/ISemver.sol";
```
```solidity
File: src/L2/L1FeeVault.sol
4: import { ISemver } from "src/universal/ISemver.sol";
4: import { ISemver } from "src/universal/ISemver.sol";
5: import { FeeVault } from "src/universal/FeeVault.sol";
5: import { FeeVault } from "src/universal/FeeVault.sol";
```
```solidity
File: src/L2/L2CrossDomainMessenger.sol
4: import { AddressAliasHelper } from "src/vendor/AddressAliasHelper.sol";
4: import { AddressAliasHelper } from "src/vendor/AddressAliasHelper.sol";
5: import { Predeploys } from "src/libraries/Predeploys.sol";
5: import { Predeploys } from "src/libraries/Predeploys.sol";
6: import { CrossDomainMessenger } from "src/universal/CrossDomainMessenger.sol";
6: import { CrossDomainMessenger } from "src/universal/CrossDomainMessenger.sol";
7: import { ISemver } from "src/universal/ISemver.sol";
7: import { ISemver } from "src/universal/ISemver.sol";
8: import { L2ToL1MessagePasser } from "src/L2/L2ToL1MessagePasser.sol";
8: import { L2ToL1MessagePasser } from "src/L2/L2ToL1MessagePasser.sol";
9: import { Constants } from "src/libraries/Constants.sol";
9: import { Constants } from "src/libraries/Constants.sol";
10: import { Blast, YieldMode, GasMode } from "src/L2/Blast.sol";
10: import { Blast, YieldMode, GasMode } from "src/L2/Blast.sol";
35: address(0xdead) /// don't set a governor
35: address(0xdead) /// don't set a governor
35: address(0xdead) /// don't set a governor
```
```solidity
File: src/L2/L2ERC721Bridge.sol
4: import { ERC721Bridge } from "src/universal/ERC721Bridge.sol";
4: import { ERC721Bridge } from "src/universal/ERC721Bridge.sol";
5: import { ERC165Checker } from "@openzeppelin/contracts/utils/introspection/ERC165Checker.sol";
5: import { ERC165Checker } from "@openzeppelin/contracts/utils/introspection/ERC165Checker.sol";
5: import { ERC165Checker } from "@openzeppelin/contracts/utils/introspection/ERC165Checker.sol";
5: import { ERC165Checker } from "@openzeppelin/contracts/utils/introspection/ERC165Checker.sol";
6: import { L1ERC721Bridge } from "src/L1/L1ERC721Bridge.sol";
6: import { L1ERC721Bridge } from "src/L1/L1ERC721Bridge.sol";
7: import { IOptimismMintableERC721 } from "src/universal/IOptimismMintableERC721.sol";
7: import { IOptimismMintableERC721 } from "src/universal/IOptimismMintableERC721.sol";
8: import { CrossDomainMessenger } from "src/universal/CrossDomainMessenger.sol";
8: import { CrossDomainMessenger } from "src/universal/CrossDomainMessenger.sol";
9: import { ISemver } from "src/universal/ISemver.sol";
9: import { ISemver } from "src/universal/ISemver.sol";
10: import { Constants } from "src/libraries/Constants.sol";
10: import { Constants } from "src/libraries/Constants.sol";
11: import { Predeploys } from "src/libraries/Predeploys.sol";
11: import { Predeploys } from "src/libraries/Predeploys.sol";
```
```solidity
File: src/L2/L2StandardBridge.sol
4: import { Predeploys } from "src/libraries/Predeploys.sol";
4: import { Predeploys } from "src/libraries/Predeploys.sol";
5: import { StandardBridge } from "src/universal/StandardBridge.sol";
5: import { StandardBridge } from "src/universal/StandardBridge.sol";
6: import { ISemver } from "src/universal/ISemver.sol";
6: import { ISemver } from "src/universal/ISemver.sol";
7: import { OptimismMintableERC20 } from "src/universal/OptimismMintableERC20.sol";
7: import { OptimismMintableERC20 } from "src/universal/OptimismMintableERC20.sol";
8: import { CrossDomainMessenger } from "src/universal/CrossDomainMessenger.sol";
8: import { CrossDomainMessenger } from "src/universal/CrossDomainMessenger.sol";
9: import { Constants } from "src/libraries/Constants.sol";
9: import { Constants } from "src/libraries/Constants.sol";
10: import { Blast, YieldMode, GasMode } from "src/L2/Blast.sol";
10: import { Blast, YieldMode, GasMode } from "src/L2/Blast.sol";
72: address(0xdead) /// don't set a governor
72: address(0xdead) /// don't set a governor
72: address(0xdead) /// don't set a governor
```
```solidity
File: src/L2/L2ToL1MessagePasser.sol
4: import { Types } from "src/libraries/Types.sol";
4: import { Types } from "src/libraries/Types.sol";
5: import { Hashing } from "src/libraries/Hashing.sol";
5: import { Hashing } from "src/libraries/Hashing.sol";
6: import { Encoding } from "src/libraries/Encoding.sol";
6: import { Encoding } from "src/libraries/Encoding.sol";
7: import { Burn } from "src/libraries/Burn.sol";
7: import { Burn } from "src/libraries/Burn.sol";
8: import { ISemver } from "src/universal/ISemver.sol";
8: import { ISemver } from "src/universal/ISemver.sol";
90: ++msgNonce;
90: ++msgNonce;
```
```solidity
File: src/L2/SequencerFeeVault.sol
4: import { ISemver } from "src/universal/ISemver.sol";
4: import { ISemver } from "src/universal/ISemver.sol";
5: import { FeeVault } from "src/universal/FeeVault.sol";
5: import { FeeVault } from "src/universal/FeeVault.sol";
```
```solidity
File: src/L2/Shares.sol
4: import { Initializable } from "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";
4: import { Initializable } from "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";
4: import { Initializable } from "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";
4: import { Initializable } from "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";
4: import { Initializable } from "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";
6: import { Semver } from "src/universal/Semver.sol";
6: import { Semver } from "src/universal/Semver.sol";
7: import { AddressAliasHelper } from "src/vendor/AddressAliasHelper.sol";
7: import { AddressAliasHelper } from "src/vendor/AddressAliasHelper.sol";
8: import { Predeploys } from "src/libraries/Predeploys.sol";
8: import { Predeploys } from "src/libraries/Predeploys.sol";
9: import { Blast, YieldMode, GasMode } from "src/L2/Blast.sol";
9: import { Blast, YieldMode, GasMode } from "src/L2/Blast.sol";
69: pending += value;
92: price += pending / count();
92: price += pending / count();
122: address(0xdead) /// don't set a governor
122: address(0xdead) /// don't set a governor
122: address(0xdead) /// don't set a governor
```
```solidity
File: src/L2/USDB.sol
4: import { IERC20 } from "@openzeppelin/contracts/interfaces/IERC20.sol";
4: import { IERC20 } from "@openzeppelin/contracts/interfaces/IERC20.sol";
4: import { IERC20 } from "@openzeppelin/contracts/interfaces/IERC20.sol";
5: import { IERC165 } from "@openzeppelin/contracts/utils/introspection/IERC165.sol";
5: import { IERC165 } from "@openzeppelin/contracts/utils/introspection/IERC165.sol";
5: import { IERC165 } from "@openzeppelin/contracts/utils/introspection/IERC165.sol";
5: import { IERC165 } from "@openzeppelin/contracts/utils/introspection/IERC165.sol";
7: import { ERC20Rebasing } from "src/L2/ERC20Rebasing.sol";
7: import { ERC20Rebasing } from "src/L2/ERC20Rebasing.sol";
8: import { SharesBase } from "src/L2/Shares.sol";
8: import { SharesBase } from "src/L2/Shares.sol";
9: import { CrossDomainMessenger } from "src/universal/CrossDomainMessenger.sol";
9: import { CrossDomainMessenger } from "src/universal/CrossDomainMessenger.sol";
10: import { StandardBridge } from "src/universal/StandardBridge.sol";
10: import { StandardBridge } from "src/universal/StandardBridge.sol";
11: import { IOptimismMintableERC20 } from "src/universal/IOptimismMintableERC20.sol";
11: import { IOptimismMintableERC20 } from "src/universal/IOptimismMintableERC20.sol";
12: import { Semver } from "src/universal/Semver.sol";
12: import { Semver } from "src/universal/Semver.sol";
13: import { Blast, YieldMode, GasMode } from "src/L2/Blast.sol";
13: import { Blast, YieldMode, GasMode } from "src/L2/Blast.sol";
14: import { Predeploys } from "src/libraries/Predeploys.sol";
14: import { Predeploys } from "src/libraries/Predeploys.sol";
69: address(0xdead) /// don't set a governor
69: address(0xdead) /// don't set a governor
69: address(0xdead) /// don't set a governor
```
```solidity
File: src/L2/WETHRebasing.sol
4: import { FixedPointMathLib } from "solmate/utils/FixedPointMathLib.sol";
4: import { FixedPointMathLib } from "solmate/utils/FixedPointMathLib.sol";
6: import { Blast, YieldMode } from "src/L2/Blast.sol";
6: import { Blast, YieldMode } from "src/L2/Blast.sol";
7: import { GasMode } from "src/L2/Gas.sol";
7: import { GasMode } from "src/L2/Gas.sol";
8: import { ERC20Rebasing } from "src/L2/ERC20Rebasing.sol";
8: import { ERC20Rebasing } from "src/L2/ERC20Rebasing.sol";
9: import { SharesBase } from "src/L2/Shares.sol";
9: import { SharesBase } from "src/L2/Shares.sol";
10: import { Predeploys } from "src/libraries/Predeploys.sol";
10: import { Predeploys } from "src/libraries/Predeploys.sol";
11: import { Semver } from "src/universal/Semver.sol";
11: import { Semver } from "src/universal/Semver.sol";
60: address(0xdead) /// don't set a governor
60: address(0xdead) /// don't set a governor
60: address(0xdead) /// don't set a governor
96: uint256 yieldBearingEth = price * _totalShares;
97: uint256 pending = address(this).balance - yieldBearingEth - _totalVoidAndRemainders;
97: uint256 pending = address(this).balance - yieldBearingEth - _totalVoidAndRemainders;
102: price += (pending / _totalShares);
102: price += (pending / _totalShares);
```
```solidity
File: src/Safe/LivenessGuard.sol
4: import { Safe } from "safe-contracts/Safe.sol";
4: import { Safe } from "safe-contracts/Safe.sol";
5: import { BaseGuard, GuardManager } from "safe-contracts/base/GuardManager.sol";
5: import { BaseGuard, GuardManager } from "safe-contracts/base/GuardManager.sol";
5: import { BaseGuard, GuardManager } from "safe-contracts/base/GuardManager.sol";
6: import { ModuleManager } from "safe-contracts/base/ModuleManager.sol";
6: import { ModuleManager } from "safe-contracts/base/ModuleManager.sol";
6: import { ModuleManager } from "safe-contracts/base/ModuleManager.sol";
7: import { SafeSigners } from "src/Safe/SafeSigners.sol";
7: import { SafeSigners } from "src/Safe/SafeSigners.sol";
8: import { Enum } from "safe-contracts/common/Enum.sol";
8: import { Enum } from "safe-contracts/common/Enum.sol";
8: import { Enum } from "safe-contracts/common/Enum.sol";
9: import { ISemver } from "src/universal/ISemver.sol";
9: import { ISemver } from "src/universal/ISemver.sol";
10: import { EnumerableSet } from "@openzeppelin/contracts/utils/structs/EnumerableSet.sol";
10: import { EnumerableSet } from "@openzeppelin/contracts/utils/structs/EnumerableSet.sol";
10: import { EnumerableSet } from "@openzeppelin/contracts/utils/structs/EnumerableSet.sol";
10: import { EnumerableSet } from "@openzeppelin/contracts/utils/structs/EnumerableSet.sol";
49: for (uint256 i = 0; i < owners.length; i++) {
49: for (uint256 i = 0; i < owners.length; i++) {
84: msgSender; // silence unused variable warning
84: msgSender; // silence unused variable warning
90: for (uint256 i = 0; i < owners.length; i++) {
90: for (uint256 i = 0; i < owners.length; i++) {
106: _nonce: SAFE.nonce() - 1
113: for (uint256 i = 0; i < signers.length; i++) {
113: for (uint256 i = 0; i < signers.length; i++) {
131: for (uint256 i = 0; i < ownersAfter.length; i++) {
131: for (uint256 i = 0; i < ownersAfter.length; i++) {
144: for (uint256 i = 0; i < ownersBeforeCache.length; i++) {
144: for (uint256 i = 0; i < ownersBeforeCache.length; i++) {
```
```solidity
File: src/Safe/LivenessModule.sol
4: import { Safe, OwnerManager } from "safe-contracts/Safe.sol";
4: import { Safe, OwnerManager } from "safe-contracts/Safe.sol";
5: import { Enum } from "safe-contracts/common/Enum.sol";
5: import { Enum } from "safe-contracts/common/Enum.sol";
5: import { Enum } from "safe-contracts/common/Enum.sol";
6: import { OwnerManager } from "safe-contracts/base/OwnerManager.sol";
6: import { OwnerManager } from "safe-contracts/base/OwnerManager.sol";
6: import { OwnerManager } from "safe-contracts/base/OwnerManager.sol";
7: import { LivenessGuard } from "src/Safe/LivenessGuard.sol";
7: import { LivenessGuard } from "src/Safe/LivenessGuard.sol";
8: import { ISemver } from "src/universal/ISemver.sol";
8: import { ISemver } from "src/universal/ISemver.sol";
68: threshold_ = (_numOwners * 75 + 99) / 100;
68: threshold_ = (_numOwners * 75 + 99) / 100;
68: threshold_ = (_numOwners * 75 + 99) / 100;
106: canRemove_ = LIVENESS_GUARD.lastLive(_owner) + LIVENESS_INTERVAL < block.timestamp;
121: for (uint256 i = 0; i < _previousOwners.length; i++) {
121: for (uint256 i = 0; i < _previousOwners.length; i++) {
132: ownersCount--;
132: ownersCount--;
```
```solidity
File: src/Safe/SafeSigners.sol
62: for (i = 0; i < requiredSignatures; i++) {
62: for (i = 0; i < requiredSignatures; i++) {
77: ecrecover(keccak256(abi.encodePacked("\x19Ethereum Signed Message:\n32", dataHash)), v - 4, r, s);
```
```solidity
File: src/cannon/PreimageOracle.sol
4: import { IPreimageOracle } from "./interfaces/IPreimageOracle.sol";
4: import { IPreimageOracle } from "./interfaces/IPreimageOracle.sol";
5: import { PreimageKeyLib } from "./PreimageKeyLib.sol";
6: import "./libraries/CannonErrors.sol";
6: import "./libraries/CannonErrors.sol";
20: require(preimagePartOk[_key][_offset], "pre-image must exist");
26: if (_offset + 32 >= length + 8) {
26: if (_offset + 32 >= length + 8) {
27: datLen_ = length + 8 - _offset;
27: datLen_ = length + 8 - _offset;
49: if (_partOffset > _size + 8 || _size > 32) {
101: let h := keccak256(ptr, size) // compute preimage keccak256 hash
101: let h := keccak256(ptr, size) // compute preimage keccak256 hash
```
```solidity
File: src/dispute/BlockOracle.sol
4: import "src/libraries/DisputeTypes.sol";
4: import "src/libraries/DisputeTypes.sol";
5: import "src/libraries/DisputeErrors.sol";
5: import "src/libraries/DisputeErrors.sol";
6: import { ISemver } from "src/universal/ISemver.sol";
6: import { ISemver } from "src/universal/ISemver.sol";
43: blockNumber_ = block.number - 1;
```
```solidity
File: src/dispute/DisputeGameFactory.sol
4: import { ClonesWithImmutableArgs } from "@cwia/ClonesWithImmutableArgs.sol";
5: import { OwnableUpgradeable } from "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol";
5: import { OwnableUpgradeable } from "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol";
5: import { OwnableUpgradeable } from "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol";
5: import { OwnableUpgradeable } from "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol";
6: import { ISemver } from "src/universal/ISemver.sol";
6: import { ISemver } from "src/universal/ISemver.sol";
8: import { IDisputeGame } from "src/dispute/interfaces/IDisputeGame.sol";
8: import { IDisputeGame } from "src/dispute/interfaces/IDisputeGame.sol";
8: import { IDisputeGame } from "src/dispute/interfaces/IDisputeGame.sol";
9: import { IDisputeGameFactory } from "src/dispute/interfaces/IDisputeGameFactory.sol";
9: import { IDisputeGameFactory } from "src/dispute/interfaces/IDisputeGameFactory.sol";
9: import { IDisputeGameFactory } from "src/dispute/interfaces/IDisputeGameFactory.sol";
11: import { LibGameId } from "src/dispute/lib/LibGameId.sol";
11: import { LibGameId } from "src/dispute/lib/LibGameId.sol";
11: import { LibGameId } from "src/dispute/lib/LibGameId.sol";
13: import "src/libraries/DisputeTypes.sol";
13: import "src/libraries/DisputeTypes.sol";
14: import "src/libraries/DisputeErrors.sol";
14: import "src/libraries/DisputeErrors.sol";
```
```solidity
File: src/dispute/FaultDisputeGame.sol
4: import { IDisputeGame } from "src/dispute/interfaces/IDisputeGame.sol";
4: import { IDisputeGame } from "src/dispute/interfaces/IDisputeGame.sol";
4: import { IDisputeGame } from "src/dispute/interfaces/IDisputeGame.sol";
5: import { IFaultDisputeGame } from "src/dispute/interfaces/IFaultDisputeGame.sol";
5: import { IFaultDisputeGame } from "src/dispute/interfaces/IFaultDisputeGame.sol";
5: import { IFaultDisputeGame } from "src/dispute/interfaces/IFaultDisputeGame.sol";
6: import { IInitializable } from "src/dispute/interfaces/IInitializable.sol";
6: import { IInitializable } from "src/dispute/interfaces/IInitializable.sol";
6: import { IInitializable } from "src/dispute/interfaces/IInitializable.sol";
7: import { IBondManager } from "src/dispute/interfaces/IBondManager.sol";
7: import { IBondManager } from "src/dispute/interfaces/IBondManager.sol";
7: import { IBondManager } from "src/dispute/interfaces/IBondManager.sol";
8: import { IBigStepper, IPreimageOracle } from "src/dispute/interfaces/IBigStepper.sol";
8: import { IBigStepper, IPreimageOracle } from "src/dispute/interfaces/IBigStepper.sol";
8: import { IBigStepper, IPreimageOracle } from "src/dispute/interfaces/IBigStepper.sol";
9: import { L2OutputOracle } from "src/L1/L2OutputOracle.sol";
9: import { L2OutputOracle } from "src/L1/L2OutputOracle.sol";
10: import { BlockOracle } from "src/dispute/BlockOracle.sol";
10: import { BlockOracle } from "src/dispute/BlockOracle.sol";
12: import { Clone } from "src/libraries/Clone.sol";
12: import { Clone } from "src/libraries/Clone.sol";
13: import { Types } from "src/libraries/Types.sol";
13: import { Types } from "src/libraries/Types.sol";
14: import { ISemver } from "src/universal/ISemver.sol";
14: import { ISemver } from "src/universal/ISemver.sol";
15: import { LibHashing } from "src/dispute/lib/LibHashing.sol";
15: import { LibHashing } from "src/dispute/lib/LibHashing.sol";
15: import { LibHashing } from "src/dispute/lib/LibHashing.sol";
16: import { LibPosition } from "src/dispute/lib/LibPosition.sol";
16: import { LibPosition } from "src/dispute/lib/LibPosition.sol";
16: import { LibPosition } from "src/dispute/lib/LibPosition.sol";
17: import { LibClock } from "src/dispute/lib/LibClock.sol";
17: import { LibClock } from "src/dispute/lib/LibClock.sol";
17: import { LibClock } from "src/dispute/lib/LibClock.sol";
19: import "src/libraries/DisputeTypes.sol";
19: import "src/libraries/DisputeTypes.sol";
20: import "src/libraries/DisputeErrors.sol";
20: import "src/libraries/DisputeErrors.sol";
134: if (stepPos.depth() != MAX_GAME_DEPTH + 1) revert InvalidParent();
146: : findTraceAncestor(Position.wrap(Position.unwrap(parentPos) - 1), parent.parentIndex).claim;
154: postState = findTraceAncestor(Position.wrap(Position.unwrap(parentPos) + 1), parent.parentIndex);
181: bool parentPostAgree = (parentPos.depth() - postState.position.depth()) % 2 == 0;
232: + block.timestamp - Timestamp.unwrap(parent.clock.timestamp())
232: + block.timestamp - Timestamp.unwrap(parent.clock.timestamp())
267: subgames[_challengeIndex].push(claimData.length - 1);
383: Duration.unwrap(parent.clock.duration()) + (block.timestamp - Timestamp.unwrap(parent.clock.timestamp()))
383: Duration.unwrap(parent.clock.duration()) + (block.timestamp - Timestamp.unwrap(parent.clock.timestamp()))
399: for (uint256 i = 0; i < challengeIndices.length; ++i) {
399: for (uint256 i = 0; i < challengeIndices.length; ++i) {
489: Types.OutputProposal memory starting = L2_OUTPUT_ORACLE.getL2Output(proposalIdx - 1);
519: index: uint128(proposalIdx - 1),
```
```solidity
File: src/dispute/lib/LibClock.sol
4: import "src/libraries/DisputeTypes.sol";
4: import "src/libraries/DisputeTypes.sol";
```
```solidity
File: src/dispute/lib/LibGameId.sol
4: import "src/libraries/DisputeTypes.sol";
4: import "src/libraries/DisputeTypes.sol";
5: import "src/dispute/interfaces/IDisputeGame.sol";
5: import "src/dispute/interfaces/IDisputeGame.sol";
5: import "src/dispute/interfaces/IDisputeGame.sol";
```
```solidity
File: src/dispute/lib/LibHashing.sol
4: import "src/libraries/DisputeTypes.sol";
4: import "src/libraries/DisputeTypes.sol";
```
```solidity
File: src/dispute/lib/LibPosition.sol
4: import "src/libraries/DisputeTypes.sol";
4: import "src/libraries/DisputeTypes.sol";
```
```solidity
File: src/governance/GovernanceToken.sol
4: import "@openzeppelin/contracts/token/ERC20/ERC20.sol";
4: import "@openzeppelin/contracts/token/ERC20/ERC20.sol";
4: import "@openzeppelin/contracts/token/ERC20/ERC20.sol";
4: import "@openzeppelin/contracts/token/ERC20/ERC20.sol";
5: import "@openzeppelin/contracts/token/ERC20/extensions/ERC20Burnable.sol";
5: import "@openzeppelin/contracts/token/ERC20/extensions/ERC20Burnable.sol";
5: import "@openzeppelin/contracts/token/ERC20/extensions/ERC20Burnable.sol";
5: import "@openzeppelin/contracts/token/ERC20/extensions/ERC20Burnable.sol";
5: import "@openzeppelin/contracts/token/ERC20/extensions/ERC20Burnable.sol";
6: import "@openzeppelin/contracts/token/ERC20/extensions/ERC20Votes.sol";
6: import "@openzeppelin/contracts/token/ERC20/extensions/ERC20Votes.sol";
6: import "@openzeppelin/contracts/token/ERC20/extensions/ERC20Votes.sol";
6: import "@openzeppelin/contracts/token/ERC20/extensions/ERC20Votes.sol";
6: import "@openzeppelin/contracts/token/ERC20/extensions/ERC20Votes.sol";
7: import "@openzeppelin/contracts/access/Ownable.sol";
7: import "@openzeppelin/contracts/access/Ownable.sol";
7: import "@openzeppelin/contracts/access/Ownable.sol";
```
```solidity
File: src/governance/MintManager.sol
4: import "@openzeppelin/contracts/access/Ownable.sol";
4: import "@openzeppelin/contracts/access/Ownable.sol";
4: import "@openzeppelin/contracts/access/Ownable.sol";
5: import "./GovernanceToken.sol";
18: uint256 public constant MINT_CAP = 20; // 2%
18: uint256 public constant MINT_CAP = 20; // 2%
47: _amount <= (governanceToken.totalSupply() * MINT_CAP) / DENOMINATOR,
47: _amount <= (governanceToken.totalSupply() * MINT_CAP) / DENOMINATOR,
52: mintPermittedAfter = block.timestamp + MINT_PERIOD;
```
```solidity
File: src/legacy/AddressManager.sol
4: import { Ownable } from "@openzeppelin/contracts/access/Ownable.sol";
4: import { Ownable } from "@openzeppelin/contracts/access/Ownable.sol";
4: import { Ownable } from "@openzeppelin/contracts/access/Ownable.sol";
```
```solidity
File: src/legacy/DeployerWhitelist.sol
4: import { ISemver } from "src/universal/ISemver.sol";
4: import { ISemver } from "src/universal/ISemver.sol";
```
```solidity
File: src/legacy/L1BlockNumber.sol
4: import { L1Block } from "src/L2/L1Block.sol";
4: import { L1Block } from "src/L2/L1Block.sol";
5: import { Predeploys } from "src/libraries/Predeploys.sol";
5: import { Predeploys } from "src/libraries/Predeploys.sol";
6: import { ISemver } from "src/universal/ISemver.sol";
6: import { ISemver } from "src/universal/ISemver.sol";
```
```solidity
File: src/legacy/L1ChugSplashProxy.sol
4: import { Constants } from "src/libraries/Constants.sol";
4: import { Constants } from "src/libraries/Constants.sol";
```
```solidity
File: src/legacy/LegacyERC20ETH.sol
4: import { Predeploys } from "src/libraries/Predeploys.sol";
4: import { Predeploys } from "src/libraries/Predeploys.sol";
5: import { OptimismMintableERC20 } from "src/universal/OptimismMintableERC20.sol";
5: import { OptimismMintableERC20 } from "src/universal/OptimismMintableERC20.sol";
```
```solidity
File: src/legacy/LegacyMessagePasser.sol
4: import { ISemver } from "src/universal/ISemver.sol";
4: import { ISemver } from "src/universal/ISemver.sol";
```
```solidity
File: src/legacy/LegacyMintableERC20.sol
4: import { ERC20 } from "@openzeppelin/contracts/token/ERC20/ERC20.sol";
4: import { ERC20 } from "@openzeppelin/contracts/token/ERC20/ERC20.sol";
4: import { ERC20 } from "@openzeppelin/contracts/token/ERC20/ERC20.sol";
4: import { ERC20 } from "@openzeppelin/contracts/token/ERC20/ERC20.sol";
5: import { ILegacyMintableERC20 } from "src/universal/OptimismMintableERC20.sol";
5: import { ILegacyMintableERC20 } from "src/universal/OptimismMintableERC20.sol";
47: bytes4 firstSupportedInterface = bytes4(keccak256("supportsInterface(bytes4)")); // ERC165
47: bytes4 firstSupportedInterface = bytes4(keccak256("supportsInterface(bytes4)")); // ERC165
```
```solidity
File: src/legacy/ResolvedDelegateProxy.sol
4: import { AddressManager } from "src/legacy/AddressManager.sol";
4: import { AddressManager } from "src/legacy/AddressManager.sol";
```
```solidity
File: src/libraries/Arithmetic.sol
4: import { SignedMath } from "@openzeppelin/contracts/utils/math/SignedMath.sol";
4: import { SignedMath } from "@openzeppelin/contracts/utils/math/SignedMath.sol";
4: import { SignedMath } from "@openzeppelin/contracts/utils/math/SignedMath.sol";
4: import { SignedMath } from "@openzeppelin/contracts/utils/math/SignedMath.sol";
5: import { FixedPointMathLib } from "@rari-capital/solmate/src/utils/FixedPointMathLib.sol";
5: import { FixedPointMathLib } from "@rari-capital/solmate/src/utils/FixedPointMathLib.sol";
5: import { FixedPointMathLib } from "@rari-capital/solmate/src/utils/FixedPointMathLib.sol";
5: import { FixedPointMathLib } from "@rari-capital/solmate/src/utils/FixedPointMathLib.sol";
5: import { FixedPointMathLib } from "@rari-capital/solmate/src/utils/FixedPointMathLib.sol";
26: return (_coefficient * (FixedPointMathLib.powWad(1e18 - (1e18 / _denominator), _exponent * 1e18))) / 1e18;
26: return (_coefficient * (FixedPointMathLib.powWad(1e18 - (1e18 / _denominator), _exponent * 1e18))) / 1e18;
26: return (_coefficient * (FixedPointMathLib.powWad(1e18 - (1e18 / _denominator), _exponent * 1e18))) / 1e18;
26: return (_coefficient * (FixedPointMathLib.powWad(1e18 - (1e18 / _denominator), _exponent * 1e18))) / 1e18;
26: return (_coefficient * (FixedPointMathLib.powWad(1e18 - (1e18 / _denominator), _exponent * 1e18))) / 1e18;
```
```solidity
File: src/libraries/Burn.sol
18: while (initialGas - gasleft() < _amount) {
19: ++i;
19: ++i;
```
```solidity
File: src/libraries/Bytes.sol
17: require(_length + 31 >= _length, "slice_overflow");
18: require(_start + _length >= _start, "slice_overflow");
19: require(_bytes.length >= _start + _length, "slice_outOfBounds");
87: return slice(_bytes, _start, _bytes.length - _start);
```
```solidity
File: src/libraries/Clone.sol
50: uint256 offset = _getImmutableArgsOffset() + argOffset;
63: uint256 offset = _getImmutableArgsOffset() + argOffset;
```
```solidity
File: src/libraries/Constants.sol
4: import { ResourceMetering } from "../L1/ResourceMetering.sol";
4: import { ResourceMetering } from "../L1/ResourceMetering.sol";
```
```solidity
File: src/libraries/DisputeErrors.sol
4: import "./DisputeTypes.sol";
```
```solidity
File: src/libraries/DisputeTypes.sol
4: import { LibHashing } from "../dispute/lib/LibHashing.sol";
4: import { LibHashing } from "../dispute/lib/LibHashing.sol";
4: import { LibHashing } from "../dispute/lib/LibHashing.sol";
5: import { LibPosition } from "../dispute/lib/LibPosition.sol";
5: import { LibPosition } from "../dispute/lib/LibPosition.sol";
5: import { LibPosition } from "../dispute/lib/LibPosition.sol";
6: import { LibClock } from "../dispute/lib/LibClock.sol";
6: import { LibClock } from "../dispute/lib/LibClock.sol";
6: import { LibClock } from "../dispute/lib/LibClock.sol";
7: import { LibGameId } from "../dispute/lib/LibGameId.sol";
7: import { LibGameId } from "../dispute/lib/LibGameId.sol";
7: import { LibGameId } from "../dispute/lib/LibGameId.sol";
```
```solidity
File: src/libraries/Encoding.sol
4: import { Types } from "./Types.sol";
5: import { Hashing } from "./Hashing.sol";
6: import { RLPWriter } from "./rlp/RLPWriter.sol";
6: import { RLPWriter } from "./rlp/RLPWriter.sol";
```
```solidity
File: src/libraries/Hashing.sol
4: import { Types } from "./Types.sol";
5: import { Encoding } from "./Encoding.sol";
```
```solidity
File: src/libraries/SafeCall.sol
17: _gas, // gas
17: _gas, // gas
18: _target, // recipient
18: _target, // recipient
19: _value, // ether value
19: _value, // ether value
20: 0, // inloc
20: 0, // inloc
21: 0, // inlen
21: 0, // inlen
22: 0, // outloc
22: 0, // outloc
23: 0 // outlen
23: 0 // outlen
39: _gas, // gas
39: _gas, // gas
40: _target, // recipient
40: _target, // recipient
41: _value, // ether value
41: _value, // ether value
42: add(_calldata, 32), // inloc
42: add(_calldata, 32), // inloc
43: mload(_calldata), // inlen
43: mload(_calldata), // inlen
44: 0, // outloc
44: 0, // outloc
45: 0 // outlen
45: 0 // outlen
131: gas(), // gas
131: gas(), // gas
132: _target, // recipient
132: _target, // recipient
133: _value, // ether value
133: _value, // ether value
134: add(_calldata, 32), // inloc
134: add(_calldata, 32), // inloc
135: mload(_calldata), // inlen
135: mload(_calldata), // inlen
136: 0x00, // outloc
136: 0x00, // outloc
137: 0x00 // outlen
137: 0x00 // outlen
```
```solidity
File: src/libraries/rlp/RLPReader.sol
55: require(listOffset + listLength == _in.length, "RLPReader: list item has an invalid data remainder");
67: RLPItem({ length: _in.length - offset, ptr: MemoryPointer.wrap(MemoryPointer.unwrap(_in.ptr) + offset) })
67: RLPItem({ length: _in.length - offset, ptr: MemoryPointer.wrap(MemoryPointer.unwrap(_in.ptr) + offset) })
73: length: itemLength + itemOffset,
74: ptr: MemoryPointer.wrap(MemoryPointer.unwrap(_in.ptr) + offset)
77: itemCount += 1;
78: offset += itemOffset + itemLength;
78: offset += itemOffset + itemLength;
102: require(_in.length == itemOffset + itemLength, "RLPReader: bytes value contains an invalid remainder");
149: uint256 strLen = prefix - 0x80;
168: uint256 lenOfStrLen = prefix - 0xb7;
192: _in.length > lenOfStrLen + strLen,
196: return (1 + lenOfStrLen, strLen, RLPItemType.DATA_ITEM);
200: uint256 listLen = prefix - 0xc0;
207: uint256 lenOfListLen = prefix - 0xf7;
231: _in.length > lenOfListLen + listLen,
235: return (1 + lenOfListLen, listLen, RLPItemType.LIST_ITEM);
253: uint256 src = MemoryPointer.unwrap(_src) + _offset;
```
```solidity
File: src/libraries/rlp/RLPWriter.sol
65: out_[0] = bytes1(uint8(_len) + uint8(_offset));
69: while (_len / i != 0) {
70: lenLen++;
70: lenLen++;
71: i *= 256;
74: out_ = new bytes(lenLen + 1);
75: out_[0] = bytes1(uint8(lenLen) + uint8(_offset) + 55);
75: out_[0] = bytes1(uint8(lenLen) + uint8(_offset) + 55);
76: for (i = 1; i <= lenLen; i++) {
76: for (i = 1; i <= lenLen; i++) {
77: out_[i] = bytes1(uint8((_len / (256 ** (lenLen - i))) % 256));
77: out_[i] = bytes1(uint8((_len / (256 ** (lenLen - i))) % 256));
77: out_[i] = bytes1(uint8((_len / (256 ** (lenLen - i))) % 256));
77: out_[i] = bytes1(uint8((_len / (256 ** (lenLen - i))) % 256));
89: for (; i < 32; i++) {
89: for (; i < 32; i++) {
95: out_ = new bytes(32 - i);
96: for (uint256 j = 0; j < out_.length; j++) {
96: for (uint256 j = 0; j < out_.length; j++) {
97: out_[j] = b[i++];
97: out_[j] = b[i++];
111: for (; len >= 32; len -= 32) {
115: dest += 32;
116: src += 32;
121: mask = 256 ** (32 - len) - 1;
121: mask = 256 ** (32 - len) - 1;
121: mask = 256 ** (32 - len) - 1;
121: mask = 256 ** (32 - len) - 1;
141: for (; i < _list.length; i++) {
141: for (; i < _list.length; i++) {
142: len += _list[i].length;
151: for (i = 0; i < _list.length; i++) {
151: for (i = 0; i < _list.length; i++) {
160: flattenedPtr += _list[i].length;
```
```solidity
File: src/libraries/trie/MerkleTrie.sol
4: import { Bytes } from "../Bytes.sol";
5: import { RLPReader } from "../rlp/RLPReader.sol";
5: import { RLPReader } from "../rlp/RLPReader.sol";
24: uint256 internal constant BRANCH_NODE_LENGTH = TREE_RADIX + 1;
77: for (uint256 i = 0; i < proof.length; i++) {
77: for (uint256 i = 0; i < proof.length; i++) {
111: require(i == proof.length - 1, "MerkleTrie: value node must be last node in proof (branch)");
120: currentKeyIndex += 1;
125: uint8 offset = 2 - (prefix % 2);
158: require(i == proof.length - 1, "MerkleTrie: value node must be last node in proof (leaf)");
166: currentKeyIndex += sharedNibbleLength;
188: ++i;
188: ++i;
216: ++shared_;
216: ++shared_;
```
```solidity
File: src/libraries/trie/SecureMerkleTrie.sol
4: import { MerkleTrie } from "./MerkleTrie.sol";
```
```solidity
File: src/mainnet-bridge/ETHYieldManager.sol
4: import { YieldManager } from "src/mainnet-bridge/YieldManager.sol";
4: import { YieldManager } from "src/mainnet-bridge/YieldManager.sol";
4: import { YieldManager } from "src/mainnet-bridge/YieldManager.sol";
5: import { OptimismPortal } from "src/L1/OptimismPortal.sol";
5: import { OptimismPortal } from "src/L1/OptimismPortal.sol";