diff --git a/bindings/BalanceTracker.go b/bindings/BalanceTracker.go index 3e294bd..87271d2 100644 --- a/bindings/BalanceTracker.go +++ b/bindings/BalanceTracker.go @@ -31,7 +31,7 @@ var ( // BalanceTrackerMetaData contains all meta data concerning the BalanceTracker contract. var BalanceTrackerMetaData = &bind.MetaData{ - ABI: "[{\"inputs\":[{\"internalType\":\"addresspayable\",\"name\":\"_profitWallet\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint8\",\"name\":\"version\",\"type\":\"uint8\"}],\"name\":\"Initialized\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"_systemAddress\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"bool\",\"name\":\"_success\",\"type\":\"bool\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_balanceNeeded\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_balanceSent\",\"type\":\"uint256\"}],\"name\":\"ProcessedFunds\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"_sender\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_amount\",\"type\":\"uint256\"}],\"name\":\"ReceivedFunds\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"_profitWallet\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"bool\",\"name\":\"_success\",\"type\":\"bool\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_balanceSent\",\"type\":\"uint256\"}],\"name\":\"SentProfit\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"MAX_SYSTEM_ADDRESS_COUNT\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"PROFIT_WALLET\",\"outputs\":[{\"internalType\":\"addresspayable\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"addresspayable[]\",\"name\":\"_systemAddresses\",\"type\":\"address[]\"},{\"internalType\":\"uint256[]\",\"name\":\"_targetBalances\",\"type\":\"uint256[]\"}],\"name\":\"initialize\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"processFees\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"name\":\"systemAddresses\",\"outputs\":[{\"internalType\":\"addresspayable\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"name\":\"targetBalances\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"stateMutability\":\"payable\",\"type\":\"receive\"}]", + ABI: "[{\"inputs\":[{\"internalType\":\"address payable\",\"name\":\"_profitWallet\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint8\",\"name\":\"version\",\"type\":\"uint8\"}],\"name\":\"Initialized\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"_systemAddress\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"bool\",\"name\":\"_success\",\"type\":\"bool\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_balanceNeeded\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_balanceSent\",\"type\":\"uint256\"}],\"name\":\"ProcessedFunds\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"_sender\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_amount\",\"type\":\"uint256\"}],\"name\":\"ReceivedFunds\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"_profitWallet\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"bool\",\"name\":\"_success\",\"type\":\"bool\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_balanceSent\",\"type\":\"uint256\"}],\"name\":\"SentProfit\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"MAX_SYSTEM_ADDRESS_COUNT\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"PROFIT_WALLET\",\"outputs\":[{\"internalType\":\"addresspayable\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"addresspayable[]\",\"name\":\"_systemAddresses\",\"type\":\"address[]\"},{\"internalType\":\"uint256[]\",\"name\":\"_targetBalances\",\"type\":\"uint256[]\"}],\"name\":\"initialize\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"processFees\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"name\":\"systemAddresses\",\"outputs\":[{\"internalType\":\"addresspayable\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"name\":\"targetBalances\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"stateMutability\":\"payable\",\"type\":\"receive\"}]", } // BalanceTrackerABI is the input ABI used to generate the binding from. @@ -188,10 +188,10 @@ func (_BalanceTracker *BalanceTrackerCaller) MAXSYSTEMADDRESSCOUNT(opts *bind.Ca err := _BalanceTracker.contract.Call(opts, &out, "MAX_SYSTEM_ADDRESS_COUNT") if err != nil { - return *new(*big.Int), err + return new(big.Int).Set(out0), err } - out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + out0 := abi.ConvertType(out[0], new(big.Int)).(*big.Int) return out0, err diff --git a/script/deploy/l1/tests/TestDeposits.s.sol b/script/deploy/l1/tests/TestDeposits.s.sol index c5139c0..5a55afe 100644 --- a/script/deploy/l1/tests/TestDeposits.s.sol +++ b/script/deploy/l1/tests/TestDeposits.s.sol @@ -15,7 +15,7 @@ import {L1ERC721Bridge} from "@eth-optimism-bedrock/src/L1/L1ERC721Bridge.sol"; contract DeployTestContracts is Script { function run( address _tester, - address payable _l1StandardBirdge, + address payable _l1StandardBridge, address _l1erc721Bridge, address payable _l1erc20, address _l1erc721, @@ -23,12 +23,12 @@ contract DeployTestContracts is Script { address _l2erc721 ) public { vm.startBroadcast(_tester); - ERC20PresetMinterPauser(_l1erc20).approve(_l1StandardBirdge, 1_000_000 ether); + ERC20PresetMinterPauser(_l1erc20).approve(_l1StandardBridge, 1_000_000 ether); ERC721PresetMinterPauserAutoId(_l1erc721).approve(_l1erc721Bridge, 0); console.log("Approvals to bridge contracts complete"); - L1StandardBridge(_l1StandardBirdge).depositERC20(_l1erc20, _l2erc20, 1_000_000 ether, 200_000, bytes("")); + L1StandardBridge(_l1StandardBridge).depositERC20(_l1erc20, _l2erc20, 1_000_000 ether, 200_000, bytes("")); console.log("L1StandardBridge erc20 deposit complete"); diff --git a/script/universal/MultisigBase.sol b/script/universal/MultisigBase.sol index d2d79d6..26bfa06 100644 --- a/script/universal/MultisigBase.sol +++ b/script/universal/MultisigBase.sol @@ -98,7 +98,7 @@ abstract contract MultisigBase is CommonBase { bytes32 hash = _getTransactionHash(_safe, data); _signatures = Signatures.prepareSignatures(_safe, hash, _signatures); - bytes memory simData = _execTransationCalldata(_safe, data, _signatures); + bytes memory simData = _execTransactionCalldata(_safe, data, _signatures); Simulation.logSimulationLink({_to: _safe, _from: msg.sender, _data: simData}); vm.startStateDiffRecording(); @@ -142,7 +142,7 @@ abstract contract MultisigBase is CommonBase { }); } - function _execTransationCalldata(address _safe, bytes memory _data, bytes memory _signatures) + function _execTransactionCalldata(address _safe, bytes memory _data, bytes memory _signatures) internal pure returns (bytes memory) diff --git a/script/universal/MultisigBuilder.sol b/script/universal/MultisigBuilder.sol index 7601e58..f64e391 100644 --- a/script/universal/MultisigBuilder.sol +++ b/script/universal/MultisigBuilder.sol @@ -146,7 +146,7 @@ abstract contract MultisigBuilder is MultisigBase { Simulation.StateOverride[] memory overrides = _overrides(_safe); - bytes memory txData = _execTransationCalldata(_safe, data, Signatures.genPrevalidatedSignature(msg.sender)); + bytes memory txData = _execTransactionCalldata(_safe, data, Signatures.genPrevalidatedSignature(msg.sender)); Simulation.logSimulationLink({_to: _safe, _data: txData, _from: msg.sender, _overrides: overrides}); // Forge simulation of the data logged in the link. If the simulation fails diff --git a/script/universal/NestedMultisigBuilder.sol b/script/universal/NestedMultisigBuilder.sol index c977885..9ca33b7 100644 --- a/script/universal/NestedMultisigBuilder.sol +++ b/script/universal/NestedMultisigBuilder.sol @@ -90,7 +90,7 @@ abstract contract NestedMultisigBuilder is MultisigBase { * Step 1.1 (optional) * ====== * Verify the signatures generated from step 1 are valid. - * This allow transactions to be pre-signed and stored safely before execution. + * This allows transactions to be pre-signed and stored safely before execution. */ function verify(address _signerSafe, bytes memory _signatures) public view { IMulticall3.Call3[] memory nestedCalls = _buildCalls(); @@ -202,13 +202,13 @@ abstract contract NestedMultisigBuilder is MultisigBase { ) ) ); - bytes memory approveHashExec = _execTransationCalldata( + bytes memory approveHashExec = _execTransactionCalldata( _signerSafe, approveHashData, Signatures.genPrevalidatedSignature(MULTICALL3_ADDRESS) ); calls[0] = IMulticall3.Call3({target: _signerSafe, allowFailure: false, callData: approveHashExec}); // simulate the final state changes tx, so that signer can verify the final results - bytes memory finalExec = _execTransationCalldata(_safe, _data, Signatures.genPrevalidatedSignature(_signerSafe)); + bytes memory finalExec = _execTransactionCalldata(_safe, _data, Signatures.genPrevalidatedSignature(_signerSafe)); calls[1] = IMulticall3.Call3({target: _safe, allowFailure: false, callData: finalExec}); return calls; diff --git a/script/universal/Signatures.sol b/script/universal/Signatures.sol index 42efd0b..cff87a2 100644 --- a/script/universal/Signatures.sol +++ b/script/universal/Signatures.sol @@ -70,7 +70,7 @@ library Signatures { * @param dataHash Hash that is signed. * @param threshold Number of signatures required to approve the transaction. * @param dynamicOffset Offset to add to the `s` value of any EIP-1271 signature. - * Can be used to accomodate any additional signatures prepended to the array. + * Can be used to accommodate any additional signatures prepended to the array. * If prevalidated signatures were prepended, this should be the length of those signatures. */ function sortUniqueSignatures(bytes memory _signatures, bytes32 dataHash, uint256 threshold, uint256 dynamicOffset) diff --git a/src/Challenger1of2.sol b/src/Challenger1of2.sol index 64d5b5f..474a6a9 100644 --- a/src/Challenger1of2.sol +++ b/src/Challenger1of2.sol @@ -17,12 +17,12 @@ contract Challenger1of2 { CONSTANTS //////////////////////////////////////////////////////////////*/ /** - * @dev The address of Optimism's signer (likely a multisig) + * @dev The address of Optimism's signer (likely a multi-signature wallet) */ address public immutable OP_SIGNER; /** - * @dev The address of counter party's signer (likely a multisig) + * @dev The address of the counterparty's signer (likely a multi-signature wallet) */ address public immutable OTHER_SIGNER; @@ -48,7 +48,7 @@ contract Challenger1of2 { /** * @dev Constructor to set the values of the constants. * @param _opSigner Address of Optimism signer. - * @param _otherSigner Address of counter party signer. + * @param _otherSigner Address of counterparty signer. * @param _l2OutputOracleProxy Address of the L2OutputOracleProxy contract. */ constructor(address _opSigner, address _otherSigner, address _l2OutputOracleProxy) { @@ -66,7 +66,7 @@ contract Challenger1of2 { //////////////////////////////////////////////////////////////*/ /** * @dev Executes a call as the Challenger (must be called by - * Optimism or counter party signer). + * Optimism or counterparty signer). * @param _data Data for function call. */ function execute(bytes memory _data) external { diff --git a/src/fee-vault-fixes/FeeVault.sol b/src/fee-vault-fixes/FeeVault.sol index bf6b0ec..24153bc 100644 --- a/src/fee-vault-fixes/FeeVault.sol +++ b/src/fee-vault-fixes/FeeVault.sol @@ -3,7 +3,7 @@ pragma solidity 0.8.15; /// @title FeeVault /// @notice The FeeVault contract is intended to: -/// 1. Be upgraded to by the Base FeeVault contracts +/// 1. Be upgraded by the Base FeeVault contracts /// 2. Set `totalProcessed` to the correct value /// 3. Be upgraded from to back to Optimism's FeeVault contract FeeVault { diff --git a/src/revenue-share/BalanceTracker.sol b/src/revenue-share/BalanceTracker.sol index df867b1..a0bc22f 100644 --- a/src/revenue-share/BalanceTracker.sol +++ b/src/revenue-share/BalanceTracker.sol @@ -96,17 +96,17 @@ contract BalanceTracker is ReentrancyGuardUpgradeable { external reinitializer(2) { - uint256 systemAddresesLength = _systemAddresses.length; - require(systemAddresesLength > 0, "BalanceTracker: systemAddresses cannot have a length of zero"); + uint256 systemAddressesLength = _systemAddresses.length; + require(systemAddressesLength > 0, "BalanceTracker: systemAddresses cannot have a length of zero"); require( - systemAddresesLength <= MAX_SYSTEM_ADDRESS_COUNT, + systemAddressesLength <= MAX_SYSTEM_ADDRESS_COUNT, "BalanceTracker: systemAddresses cannot have a length greater than 20" ); require( - systemAddresesLength == _targetBalances.length, + systemAddressesLength == _targetBalances.length, "BalanceTracker: systemAddresses and targetBalances length must be equal" ); - for (uint256 i; i < systemAddresesLength;) { + for (uint256 i; i < systemAddressesLength;) { require(_systemAddresses[i] != address(0), "BalanceTracker: systemAddresses cannot contain address(0)"); require(_targetBalances[i] > 0, "BalanceTracker: targetBalances cannot contain 0 target"); unchecked { @@ -125,10 +125,10 @@ contract BalanceTracker is ReentrancyGuardUpgradeable { * */ function processFees() external nonReentrant { - uint256 systemAddresesLength = systemAddresses.length; - require(systemAddresesLength > 0, "BalanceTracker: systemAddresses cannot have a length of zero"); - // Refills balances of systems addresses up to their target balances - for (uint256 i; i < systemAddresesLength;) { + uint256 systemAddressesLength = systemAddresses.length; + require(systemAddressesLength > 0, "BalanceTracker: systemAddresses cannot have a length of zero"); + // Refills balances of system addresses up to their target balances + for (uint256 i; i < systemAddressesLength;) { refillBalanceIfNeeded(systemAddresses[i], targetBalances[i]); unchecked { i++; diff --git a/src/revenue-share/FeeDisburser.sol b/src/revenue-share/FeeDisburser.sol index 892f3b5..032643c 100644 --- a/src/revenue-share/FeeDisburser.sol +++ b/src/revenue-share/FeeDisburser.sol @@ -61,7 +61,7 @@ contract FeeDisburser { uint256 public lastDisbursementTime; /** * @dev Tracks aggregate net fee revenue which is the sum of sequencer and base fees. - * @dev Explicity tracking Net Revenue is required to seperate L1FeeVault initiated + * @dev Explicitly tracking Net Revenue is required to separate L1FeeVault initiated * withdrawals from Net Revenue calculations. */ uint256 public netFeeRevenue;