Commit d8cb523d authored by smartcontracts's avatar smartcontracts Committed by GitHub

fix(ct): correct input and return argument formatting (#12131)

Standardizes the input and return argument formatting everywhere.
parent c6d3adf6
...@@ -19,9 +19,25 @@ tests/ ...@@ -19,9 +19,25 @@ tests/
.semgrep_logs/ .semgrep_logs/
op-chain-ops/script/testdata op-chain-ops/script/testdata
op-chain-ops/script/testdata/scripts/ScriptExample.s.sol
packages/*/node_modules packages/*/node_modules
packages/*/test packages/*/test
# Autogenerated solidity library # TODO: Define these exclusions inside of the semgrep rules once those rules
# are all defined locally in the repository instead of the semgrep app.
# Contracts: autogenerated solidity library
packages/contracts-bedrock/scripts/libraries/Solarray.sol packages/contracts-bedrock/scripts/libraries/Solarray.sol
# Contracts: vendor interfaces
packages/contracts-bedrock/scripts/interfaces/IGnosisSafe.sol
packages/contracts-bedrock/src/EAS/
# Contracts: deliberate exclusions
packages/contracts-bedrock/src/universal/WETH98.sol
packages/contracts-bedrock/src/universal/interfaces/IWETH.sol
packages/contracts-bedrock/src/L2/SuperchainWETH.sol
packages/contracts-bedrock/src/L2/interfaces/ISuperchainWETH.sol
packages/contracts-bedrock/src/governance/GovernanceToken.sol
packages/contracts-bedrock/src/governance/interfaces/IGovernanceToken.sol
...@@ -49,8 +49,8 @@ contract DeployAuthSystemInput is CommonBase { ...@@ -49,8 +49,8 @@ contract DeployAuthSystemInput is CommonBase {
contract DeployAuthSystemOutput is CommonBase { contract DeployAuthSystemOutput is CommonBase {
Safe internal _safe; Safe internal _safe;
function set(bytes4 sel, address _address) public { function set(bytes4 _sel, address _address) public {
if (sel == this.safe.selector) _safe = Safe(payable(_address)); if (_sel == this.safe.selector) _safe = Safe(payable(_address));
else revert("DeployAuthSystemOutput: unknown selector"); else revert("DeployAuthSystemOutput: unknown selector");
} }
......
...@@ -64,41 +64,41 @@ contract DeployImplementationsInput is BaseDeployIO { ...@@ -64,41 +64,41 @@ contract DeployImplementationsInput is BaseDeployIO {
string internal _standardVersionsToml; string internal _standardVersionsToml;
function set(bytes4 sel, uint256 _value) public { function set(bytes4 _sel, uint256 _value) public {
require(_value != 0, "DeployImplementationsInput: cannot set zero value"); require(_value != 0, "DeployImplementationsInput: cannot set zero value");
if (sel == this.withdrawalDelaySeconds.selector) { if (_sel == this.withdrawalDelaySeconds.selector) {
_withdrawalDelaySeconds = _value; _withdrawalDelaySeconds = _value;
} else if (sel == this.minProposalSizeBytes.selector) { } else if (_sel == this.minProposalSizeBytes.selector) {
_minProposalSizeBytes = _value; _minProposalSizeBytes = _value;
} else if (sel == this.challengePeriodSeconds.selector) { } else if (_sel == this.challengePeriodSeconds.selector) {
require(_value <= type(uint64).max, "DeployImplementationsInput: challengePeriodSeconds too large"); require(_value <= type(uint64).max, "DeployImplementationsInput: challengePeriodSeconds too large");
_challengePeriodSeconds = _value; _challengePeriodSeconds = _value;
} else if (sel == this.proofMaturityDelaySeconds.selector) { } else if (_sel == this.proofMaturityDelaySeconds.selector) {
_proofMaturityDelaySeconds = _value; _proofMaturityDelaySeconds = _value;
} else if (sel == this.disputeGameFinalityDelaySeconds.selector) { } else if (_sel == this.disputeGameFinalityDelaySeconds.selector) {
_disputeGameFinalityDelaySeconds = _value; _disputeGameFinalityDelaySeconds = _value;
} else { } else {
revert("DeployImplementationsInput: unknown selector"); revert("DeployImplementationsInput: unknown selector");
} }
} }
function set(bytes4 sel, string memory _value) public { function set(bytes4 _sel, string memory _value) public {
require(!LibString.eq(_value, ""), "DeployImplementationsInput: cannot set empty string"); require(!LibString.eq(_value, ""), "DeployImplementationsInput: cannot set empty string");
if (sel == this.release.selector) _release = _value; if (_sel == this.release.selector) _release = _value;
else if (sel == this.standardVersionsToml.selector) _standardVersionsToml = _value; else if (_sel == this.standardVersionsToml.selector) _standardVersionsToml = _value;
else revert("DeployImplementationsInput: unknown selector"); else revert("DeployImplementationsInput: unknown selector");
} }
function set(bytes4 sel, address _addr) public { function set(bytes4 _sel, address _addr) public {
require(_addr != address(0), "DeployImplementationsInput: cannot set zero address"); require(_addr != address(0), "DeployImplementationsInput: cannot set zero address");
if (sel == this.superchainConfigProxy.selector) _superchainConfigProxy = SuperchainConfig(_addr); if (_sel == this.superchainConfigProxy.selector) _superchainConfigProxy = SuperchainConfig(_addr);
else if (sel == this.protocolVersionsProxy.selector) _protocolVersionsProxy = ProtocolVersions(_addr); else if (_sel == this.protocolVersionsProxy.selector) _protocolVersionsProxy = ProtocolVersions(_addr);
else revert("DeployImplementationsInput: unknown selector"); else revert("DeployImplementationsInput: unknown selector");
} }
function set(bytes4 sel, bytes32 _value) public { function set(bytes4 _sel, bytes32 _value) public {
if (sel == this.salt.selector) _salt = _value; if (_sel == this.salt.selector) _salt = _value;
else revert("DeployImplementationsInput: unknown selector"); else revert("DeployImplementationsInput: unknown selector");
} }
...@@ -179,22 +179,22 @@ contract DeployImplementationsOutput is BaseDeployIO { ...@@ -179,22 +179,22 @@ contract DeployImplementationsOutput is BaseDeployIO {
OptimismMintableERC20Factory internal _optimismMintableERC20FactoryImpl; OptimismMintableERC20Factory internal _optimismMintableERC20FactoryImpl;
DisputeGameFactory internal _disputeGameFactoryImpl; DisputeGameFactory internal _disputeGameFactoryImpl;
function set(bytes4 sel, address _addr) public { function set(bytes4 _sel, address _addr) public {
require(_addr != address(0), "DeployImplementationsOutput: cannot set zero address"); require(_addr != address(0), "DeployImplementationsOutput: cannot set zero address");
// forgefmt: disable-start // forgefmt: disable-start
if (sel == this.opcmProxy.selector) _opcmProxy = OPContractsManager(payable(_addr)); if (_sel == this.opcmProxy.selector) _opcmProxy = OPContractsManager(payable(_addr));
else if (sel == this.opcmImpl.selector) _opcmImpl = OPContractsManager(payable(_addr)); else if (_sel == this.opcmImpl.selector) _opcmImpl = OPContractsManager(payable(_addr));
else if (sel == this.optimismPortalImpl.selector) _optimismPortalImpl = OptimismPortal2(payable(_addr)); else if (_sel == this.optimismPortalImpl.selector) _optimismPortalImpl = OptimismPortal2(payable(_addr));
else if (sel == this.delayedWETHImpl.selector) _delayedWETHImpl = DelayedWETH(payable(_addr)); else if (_sel == this.delayedWETHImpl.selector) _delayedWETHImpl = DelayedWETH(payable(_addr));
else if (sel == this.preimageOracleSingleton.selector) _preimageOracleSingleton = PreimageOracle(_addr); else if (_sel == this.preimageOracleSingleton.selector) _preimageOracleSingleton = PreimageOracle(_addr);
else if (sel == this.mipsSingleton.selector) _mipsSingleton = MIPS(_addr); else if (_sel == this.mipsSingleton.selector) _mipsSingleton = MIPS(_addr);
else if (sel == this.systemConfigImpl.selector) _systemConfigImpl = SystemConfig(_addr); else if (_sel == this.systemConfigImpl.selector) _systemConfigImpl = SystemConfig(_addr);
else if (sel == this.l1CrossDomainMessengerImpl.selector) _l1CrossDomainMessengerImpl = L1CrossDomainMessenger(_addr); else if (_sel == this.l1CrossDomainMessengerImpl.selector) _l1CrossDomainMessengerImpl = L1CrossDomainMessenger(_addr);
else if (sel == this.l1ERC721BridgeImpl.selector) _l1ERC721BridgeImpl = L1ERC721Bridge(_addr); else if (_sel == this.l1ERC721BridgeImpl.selector) _l1ERC721BridgeImpl = L1ERC721Bridge(_addr);
else if (sel == this.l1StandardBridgeImpl.selector) _l1StandardBridgeImpl = L1StandardBridge(payable(_addr)); else if (_sel == this.l1StandardBridgeImpl.selector) _l1StandardBridgeImpl = L1StandardBridge(payable(_addr));
else if (sel == this.optimismMintableERC20FactoryImpl.selector) _optimismMintableERC20FactoryImpl = OptimismMintableERC20Factory(_addr); else if (_sel == this.optimismMintableERC20FactoryImpl.selector) _optimismMintableERC20FactoryImpl = OptimismMintableERC20Factory(_addr);
else if (sel == this.disputeGameFactoryImpl.selector) _disputeGameFactoryImpl = DisputeGameFactory(_addr); else if (_sel == this.disputeGameFactoryImpl.selector) _disputeGameFactoryImpl = DisputeGameFactory(_addr);
else revert("DeployImplementationsOutput: unknown selector"); else revert("DeployImplementationsOutput: unknown selector");
// forgefmt: disable-end // forgefmt: disable-end
} }
......
...@@ -164,24 +164,24 @@ contract DeployOPChainOutput is BaseDeployIO { ...@@ -164,24 +164,24 @@ contract DeployOPChainOutput is BaseDeployIO {
DelayedWETH internal _delayedWETHPermissionedGameProxy; DelayedWETH internal _delayedWETHPermissionedGameProxy;
DelayedWETH internal _delayedWETHPermissionlessGameProxy; DelayedWETH internal _delayedWETHPermissionlessGameProxy;
function set(bytes4 sel, address _addr) public { function set(bytes4 _sel, address _addr) public {
require(_addr != address(0), "DeployOPChainOutput: cannot set zero address"); require(_addr != address(0), "DeployOPChainOutput: cannot set zero address");
// forgefmt: disable-start // forgefmt: disable-start
if (sel == this.opChainProxyAdmin.selector) _opChainProxyAdmin = ProxyAdmin(_addr) ; if (_sel == this.opChainProxyAdmin.selector) _opChainProxyAdmin = ProxyAdmin(_addr) ;
else if (sel == this.addressManager.selector) _addressManager = AddressManager(_addr) ; else if (_sel == this.addressManager.selector) _addressManager = AddressManager(_addr) ;
else if (sel == this.l1ERC721BridgeProxy.selector) _l1ERC721BridgeProxy = L1ERC721Bridge(_addr) ; else if (_sel == this.l1ERC721BridgeProxy.selector) _l1ERC721BridgeProxy = L1ERC721Bridge(_addr) ;
else if (sel == this.systemConfigProxy.selector) _systemConfigProxy = SystemConfig(_addr) ; else if (_sel == this.systemConfigProxy.selector) _systemConfigProxy = SystemConfig(_addr) ;
else if (sel == this.optimismMintableERC20FactoryProxy.selector) _optimismMintableERC20FactoryProxy = OptimismMintableERC20Factory(_addr) ; else if (_sel == this.optimismMintableERC20FactoryProxy.selector) _optimismMintableERC20FactoryProxy = OptimismMintableERC20Factory(_addr) ;
else if (sel == this.l1StandardBridgeProxy.selector) _l1StandardBridgeProxy = L1StandardBridge(payable(_addr)) ; else if (_sel == this.l1StandardBridgeProxy.selector) _l1StandardBridgeProxy = L1StandardBridge(payable(_addr)) ;
else if (sel == this.l1CrossDomainMessengerProxy.selector) _l1CrossDomainMessengerProxy = L1CrossDomainMessenger(_addr) ; else if (_sel == this.l1CrossDomainMessengerProxy.selector) _l1CrossDomainMessengerProxy = L1CrossDomainMessenger(_addr) ;
else if (sel == this.optimismPortalProxy.selector) _optimismPortalProxy = OptimismPortal2(payable(_addr)) ; else if (_sel == this.optimismPortalProxy.selector) _optimismPortalProxy = OptimismPortal2(payable(_addr)) ;
else if (sel == this.disputeGameFactoryProxy.selector) _disputeGameFactoryProxy = DisputeGameFactory(_addr) ; else if (_sel == this.disputeGameFactoryProxy.selector) _disputeGameFactoryProxy = DisputeGameFactory(_addr) ;
else if (sel == this.anchorStateRegistryProxy.selector) _anchorStateRegistryProxy = AnchorStateRegistry(_addr) ; else if (_sel == this.anchorStateRegistryProxy.selector) _anchorStateRegistryProxy = AnchorStateRegistry(_addr) ;
else if (sel == this.anchorStateRegistryImpl.selector) _anchorStateRegistryImpl = AnchorStateRegistry(_addr) ; else if (_sel == this.anchorStateRegistryImpl.selector) _anchorStateRegistryImpl = AnchorStateRegistry(_addr) ;
else if (sel == this.faultDisputeGame.selector) _faultDisputeGame = FaultDisputeGame(_addr) ; else if (_sel == this.faultDisputeGame.selector) _faultDisputeGame = FaultDisputeGame(_addr) ;
else if (sel == this.permissionedDisputeGame.selector) _permissionedDisputeGame = PermissionedDisputeGame(_addr) ; else if (_sel == this.permissionedDisputeGame.selector) _permissionedDisputeGame = PermissionedDisputeGame(_addr) ;
else if (sel == this.delayedWETHPermissionedGameProxy.selector) _delayedWETHPermissionedGameProxy = DelayedWETH(payable(_addr)) ; else if (_sel == this.delayedWETHPermissionedGameProxy.selector) _delayedWETHPermissionedGameProxy = DelayedWETH(payable(_addr)) ;
else if (sel == this.delayedWETHPermissionlessGameProxy.selector) _delayedWETHPermissionlessGameProxy = DelayedWETH(payable(_addr)) ; else if (_sel == this.delayedWETHPermissionlessGameProxy.selector) _delayedWETHPermissionlessGameProxy = DelayedWETH(payable(_addr)) ;
else revert("DeployOPChainOutput: unknown selector"); else revert("DeployOPChainOutput: unknown selector");
// forgefmt: disable-end // forgefmt: disable-end
} }
......
...@@ -164,13 +164,13 @@ contract DeploySuperchainOutput is BaseDeployIO { ...@@ -164,13 +164,13 @@ contract DeploySuperchainOutput is BaseDeployIO {
// This method lets each field be set individually. The selector of an output's getter method // This method lets each field be set individually. The selector of an output's getter method
// is used to determine which field to set. // is used to determine which field to set.
function set(bytes4 sel, address _address) public { function set(bytes4 _sel, address _address) public {
require(_address != address(0), "DeploySuperchainOutput: cannot set zero address"); require(_address != address(0), "DeploySuperchainOutput: cannot set zero address");
if (sel == this.superchainProxyAdmin.selector) _superchainProxyAdmin = ProxyAdmin(_address); if (_sel == this.superchainProxyAdmin.selector) _superchainProxyAdmin = ProxyAdmin(_address);
else if (sel == this.superchainConfigImpl.selector) _superchainConfigImpl = SuperchainConfig(_address); else if (_sel == this.superchainConfigImpl.selector) _superchainConfigImpl = SuperchainConfig(_address);
else if (sel == this.superchainConfigProxy.selector) _superchainConfigProxy = SuperchainConfig(_address); else if (_sel == this.superchainConfigProxy.selector) _superchainConfigProxy = SuperchainConfig(_address);
else if (sel == this.protocolVersionsImpl.selector) _protocolVersionsImpl = ProtocolVersions(_address); else if (_sel == this.protocolVersionsImpl.selector) _protocolVersionsImpl = ProtocolVersions(_address);
else if (sel == this.protocolVersionsProxy.selector) _protocolVersionsProxy = ProtocolVersions(_address); else if (_sel == this.protocolVersionsProxy.selector) _protocolVersionsProxy = ProtocolVersions(_address);
else revert("DeploySuperchainOutput: unknown selector"); else revert("DeploySuperchainOutput: unknown selector");
} }
......
...@@ -16,7 +16,7 @@ temp_dir=$(mktemp -d) ...@@ -16,7 +16,7 @@ temp_dir=$(mktemp -d)
trap 'rm -rf "$temp_dir"' EXIT trap 'rm -rf "$temp_dir"' EXIT
# Exit early if semver-lock.json has not changed. # Exit early if semver-lock.json has not changed.
if ! git diff origin/develop...HEAD --name-only | grep -q "$SEMVER_LOCK"; then if ! { git diff origin/develop...HEAD --name-only; git diff --name-only; git diff --cached --name-only; } | grep -q "$SEMVER_LOCK"; then
echo "No changes detected in semver-lock.json" echo "No changes detected in semver-lock.json"
exit 0 exit 0
fi fi
...@@ -71,9 +71,12 @@ for contract in $changed_contracts; do ...@@ -71,9 +71,12 @@ for contract in $changed_contracts; do
has_errors=true has_errors=true
fi fi
# TODO: Use an existing semver comparison function since this will only
# check if the version has changed at all and not that the version has
# increased properly.
# Check if the version changed. # Check if the version changed.
if [ "$old_version" = "$new_version" ]; then if [ "$old_version" = "$new_version" ]; then
echo "❌ Error: src/$contract has changes in semver-lock.json but no version change" echo "❌ Error: $contract has changes in semver-lock.json but no version change"
echo " Old version: $old_version" echo " Old version: $old_version"
echo " New version: $new_version" echo " New version: $new_version"
has_errors=true has_errors=true
......
...@@ -281,11 +281,11 @@ contract Deploy is Deployer { ...@@ -281,11 +281,11 @@ contract Deploy is Deployer {
/// @notice Deploy a new OP Chain using an existing SuperchainConfig and ProtocolVersions /// @notice Deploy a new OP Chain using an existing SuperchainConfig and ProtocolVersions
/// @param _superchainConfigProxy Address of the existing SuperchainConfig proxy /// @param _superchainConfigProxy Address of the existing SuperchainConfig proxy
/// @param _protocolVersionsProxy Address of the existing ProtocolVersions proxy /// @param _protocolVersionsProxy Address of the existing ProtocolVersions proxy
/// @param includeDump Whether to include a state dump after deployment /// @param _includeDump Whether to include a state dump after deployment
function runWithSuperchain( function runWithSuperchain(
address payable _superchainConfigProxy, address payable _superchainConfigProxy,
address payable _protocolVersionsProxy, address payable _protocolVersionsProxy,
bool includeDump bool _includeDump
) )
public public
{ {
...@@ -306,7 +306,7 @@ contract Deploy is Deployer { ...@@ -306,7 +306,7 @@ contract Deploy is Deployer {
_run(false); _run(false);
if (includeDump) { if (_includeDump) {
vm.dumpState(Config.stateDumpPath("")); vm.dumpState(Config.stateDumpPath(""));
} }
} }
......
...@@ -94,8 +94,8 @@ contract DeployConfig is Script { ...@@ -94,8 +94,8 @@ contract DeployConfig is Script {
function read(string memory _path) public { function read(string memory _path) public {
console.log("DeployConfig: reading file %s", _path); console.log("DeployConfig: reading file %s", _path);
try vm.readFile(_path) returns (string memory data) { try vm.readFile(_path) returns (string memory data_) {
_json = data; _json = data_;
} catch { } catch {
require(false, string.concat("Cannot find deploy config file at ", _path)); require(false, string.concat("Cannot find deploy config file at ", _path));
} }
...@@ -191,14 +191,14 @@ contract DeployConfig is Script { ...@@ -191,14 +191,14 @@ contract DeployConfig is Script {
} }
function l1StartingBlockTag() public returns (bytes32) { function l1StartingBlockTag() public returns (bytes32) {
try vm.parseJsonBytes32(_json, "$.l1StartingBlockTag") returns (bytes32 tag) { try vm.parseJsonBytes32(_json, "$.l1StartingBlockTag") returns (bytes32 tag_) {
return tag; return tag_;
} catch { } catch {
try vm.parseJsonString(_json, "$.l1StartingBlockTag") returns (string memory tag) { try vm.parseJsonString(_json, "$.l1StartingBlockTag") returns (string memory tag_) {
return _getBlockByTag(tag); return _getBlockByTag(tag_);
} catch { } catch {
try vm.parseJsonUint(_json, "$.l1StartingBlockTag") returns (uint256 tag) { try vm.parseJsonUint(_json, "$.l1StartingBlockTag") returns (uint256 tag_) {
return _getBlockByTag(vm.toString(tag)); return _getBlockByTag(vm.toString(tag_));
} catch { } } catch { }
} }
} }
...@@ -266,32 +266,48 @@ contract DeployConfig is Script { ...@@ -266,32 +266,48 @@ contract DeployConfig is Script {
return abi.decode(res, (bytes32)); return abi.decode(res, (bytes32));
} }
function _readOr(string memory json, string memory key, bool defaultValue) internal view returns (bool) { function _readOr(string memory _jsonInp, string memory _key, bool _defaultValue) internal view returns (bool) {
return vm.keyExistsJson(json, key) ? json.readBool(key) : defaultValue; return vm.keyExistsJson(_jsonInp, _key) ? _jsonInp.readBool(_key) : _defaultValue;
} }
function _readOr(string memory json, string memory key, uint256 defaultValue) internal view returns (uint256) { function _readOr(
return (vm.keyExistsJson(json, key) && !_isNull(json, key)) ? json.readUint(key) : defaultValue; string memory _jsonInp,
string memory _key,
uint256 _defaultValue
)
internal
view
returns (uint256)
{
return (vm.keyExistsJson(_jsonInp, _key) && !_isNull(_json, _key)) ? _jsonInp.readUint(_key) : _defaultValue;
} }
function _readOr(string memory json, string memory key, address defaultValue) internal view returns (address) { function _readOr(
return vm.keyExistsJson(json, key) ? json.readAddress(key) : defaultValue; string memory _jsonInp,
string memory _key,
address _defaultValue
)
internal
view
returns (address)
{
return vm.keyExistsJson(_jsonInp, _key) ? _jsonInp.readAddress(_key) : _defaultValue;
} }
function _isNull(string memory json, string memory key) internal pure returns (bool) { function _isNull(string memory _jsonInp, string memory _key) internal pure returns (bool) {
string memory value = json.readString(key); string memory value = _jsonInp.readString(_key);
return (keccak256(bytes(value)) == keccak256(bytes("null"))); return (keccak256(bytes(value)) == keccak256(bytes("null")));
} }
function _readOr( function _readOr(
string memory json, string memory _jsonInp,
string memory key, string memory _key,
string memory defaultValue string memory _defaultValue
) )
internal internal
view view
returns (string memory) returns (string memory)
{ {
return vm.keyExists(json, key) ? json.readString(key) : defaultValue; return vm.keyExists(_jsonInp, _key) ? _jsonInp.readString(_key) : _defaultValue;
} }
} }
...@@ -65,45 +65,45 @@ library Config { ...@@ -65,45 +65,45 @@ library Config {
/// @notice Returns the path on the local filesystem where the deployment artifact is /// @notice Returns the path on the local filesystem where the deployment artifact is
/// written to disk after doing a deployment. /// written to disk after doing a deployment.
function deploymentOutfile() internal view returns (string memory _env) { function deploymentOutfile() internal view returns (string memory env_) {
_env = vm.envOr( env_ = vm.envOr(
"DEPLOYMENT_OUTFILE", "DEPLOYMENT_OUTFILE",
string.concat(vm.projectRoot(), "/deployments/", vm.toString(block.chainid), "-deploy.json") string.concat(vm.projectRoot(), "/deployments/", vm.toString(block.chainid), "-deploy.json")
); );
} }
/// @notice Returns the path on the local filesystem where the deploy config is /// @notice Returns the path on the local filesystem where the deploy config is
function deployConfigPath() internal view returns (string memory _env) { function deployConfigPath() internal view returns (string memory env_) {
if (vm.isContext(VmSafe.ForgeContext.TestGroup)) { if (vm.isContext(VmSafe.ForgeContext.TestGroup)) {
_env = string.concat(vm.projectRoot(), "/deploy-config/hardhat.json"); env_ = string.concat(vm.projectRoot(), "/deploy-config/hardhat.json");
} else { } else {
_env = vm.envOr("DEPLOY_CONFIG_PATH", string("")); env_ = vm.envOr("DEPLOY_CONFIG_PATH", string(""));
require(bytes(_env).length > 0, "Config: must set DEPLOY_CONFIG_PATH to filesystem path of deploy config"); require(bytes(env_).length > 0, "Config: must set DEPLOY_CONFIG_PATH to filesystem path of deploy config");
} }
} }
/// @notice Returns the chainid from the EVM context or the value of the CHAIN_ID env var as /// @notice Returns the chainid from the EVM context or the value of the CHAIN_ID env var as
/// an override. /// an override.
function chainID() internal view returns (uint256 _env) { function chainID() internal view returns (uint256 env_) {
_env = vm.envOr("CHAIN_ID", block.chainid); env_ = vm.envOr("CHAIN_ID", block.chainid);
} }
/// @notice Returns the value of the env var CONTRACT_ADDRESSES_PATH which is a JSON key/value /// @notice Returns the value of the env var CONTRACT_ADDRESSES_PATH which is a JSON key/value
/// pair of contract names and their addresses. Each key/value pair is passed to `save` /// pair of contract names and their addresses. Each key/value pair is passed to `save`
/// which then backs the `getAddress` function. /// which then backs the `getAddress` function.
function contractAddressesPath() internal view returns (string memory _env) { function contractAddressesPath() internal view returns (string memory env_) {
_env = vm.envOr("CONTRACT_ADDRESSES_PATH", string("")); env_ = vm.envOr("CONTRACT_ADDRESSES_PATH", string(""));
} }
/// @notice The CREATE2 salt to be used when deploying the implementations. /// @notice The CREATE2 salt to be used when deploying the implementations.
function implSalt() internal view returns (string memory _env) { function implSalt() internal view returns (string memory env_) {
_env = vm.envOr("IMPL_SALT", string("ethers phoenix")); env_ = vm.envOr("IMPL_SALT", string("ethers phoenix"));
} }
/// @notice Returns the path that the state dump file should be written to or read from /// @notice Returns the path that the state dump file should be written to or read from
/// on the local filesystem. /// on the local filesystem.
function stateDumpPath(string memory _suffix) internal view returns (string memory _env) { function stateDumpPath(string memory _suffix) internal view returns (string memory env_) {
_env = vm.envOr( env_ = vm.envOr(
"STATE_DUMP_PATH", "STATE_DUMP_PATH",
string.concat(vm.projectRoot(), "/state-dump-", vm.toString(block.chainid), _suffix, ".json") string.concat(vm.projectRoot(), "/state-dump-", vm.toString(block.chainid), _suffix, ".json")
); );
...@@ -112,13 +112,13 @@ library Config { ...@@ -112,13 +112,13 @@ library Config {
/// @notice Returns the name of the file that the forge deployment artifact is written to on the local /// @notice Returns the name of the file that the forge deployment artifact is written to on the local
/// filesystem. By default, it is the name of the deploy script with the suffix `-latest.json`. /// filesystem. By default, it is the name of the deploy script with the suffix `-latest.json`.
/// This was useful for creating hardhat deploy style artifacts and will be removed in a future release. /// This was useful for creating hardhat deploy style artifacts and will be removed in a future release.
function deployFile(string memory _sig) internal view returns (string memory _env) { function deployFile(string memory _sig) internal view returns (string memory env_) {
_env = vm.envOr("DEPLOY_FILE", string.concat(_sig, "-latest.json")); env_ = vm.envOr("DEPLOY_FILE", string.concat(_sig, "-latest.json"));
} }
/// @notice Returns the private key that is used to configure drippie. /// @notice Returns the private key that is used to configure drippie.
function drippieOwnerPrivateKey() internal view returns (uint256 _env) { function drippieOwnerPrivateKey() internal view returns (uint256 env_) {
_env = vm.envUint("DRIPPIE_OWNER_PRIVATE_KEY"); env_ = vm.envUint("DRIPPIE_OWNER_PRIVATE_KEY");
} }
/// @notice Returns the OutputMode for genesis allocs generation. /// @notice Returns the OutputMode for genesis allocs generation.
...@@ -139,8 +139,8 @@ library Config { ...@@ -139,8 +139,8 @@ library Config {
} }
/// @notice Returns true if multithreaded Cannon is used for the deployment. /// @notice Returns true if multithreaded Cannon is used for the deployment.
function useMultithreadedCannon() internal view returns (bool _enabled) { function useMultithreadedCannon() internal view returns (bool enabled_) {
_enabled = vm.envOr("USE_MT_CANNON", false); enabled_ = vm.envOr("USE_MT_CANNON", false);
} }
/// @notice Returns the latest fork to use for genesis allocs generation. /// @notice Returns the latest fork to use for genesis allocs generation.
......
...@@ -268,13 +268,13 @@ library ForgeArtifacts { ...@@ -268,13 +268,13 @@ library ForgeArtifacts {
/// @notice Returns the function ABIs of all L1 contracts. /// @notice Returns the function ABIs of all L1 contracts.
function getContractFunctionAbis( function getContractFunctionAbis(
string memory path, string memory _path,
string[] memory pathExcludes string[] memory _pathExcludes
) )
internal internal
returns (Abi[] memory abis_) returns (Abi[] memory abis_)
{ {
string[] memory contractNames = getContractNames(path, pathExcludes); string[] memory contractNames = getContractNames(_path, _pathExcludes);
abis_ = new Abi[](contractNames.length); abis_ = new Abi[](contractNames.length);
for (uint256 i; i < contractNames.length; i++) { for (uint256 i; i < contractNames.length; i++) {
......
...@@ -40,8 +40,8 @@ contract PeripheryDeployConfig is Script { ...@@ -40,8 +40,8 @@ contract PeripheryDeployConfig is Script {
constructor(string memory _path) { constructor(string memory _path) {
console.log("PeripheryDeployConfig: reading file %s", _path); console.log("PeripheryDeployConfig: reading file %s", _path);
try vm.readFile(_path) returns (string memory data) { try vm.readFile(_path) returns (string memory data_) {
_json = data; _json = data_;
} catch { } catch {
console.log("Warning: unable to read config. Do not deploy unless you are not using config."); console.log("Warning: unable to read config. Do not deploy unless you are not using config.");
return; return;
......
...@@ -66,8 +66,8 @@ contract DrippieConfig is Script { ...@@ -66,8 +66,8 @@ contract DrippieConfig is Script {
constructor(string memory _path) { constructor(string memory _path) {
// Load the configuration file. // Load the configuration file.
console.log("DrippieConfig: reading file %s", _path); console.log("DrippieConfig: reading file %s", _path);
try vm.readFile(_path) returns (string memory data) { try vm.readFile(_path) returns (string memory data_) {
_json = data; _json = data_;
} catch { } catch {
console.log("WARNING: unable to read config, do not deploy unless you are not using config"); console.log("WARNING: unable to read config, do not deploy unless you are not using config");
return; return;
......
...@@ -103,14 +103,14 @@ contract ManageDrippie is Script { ...@@ -103,14 +103,14 @@ contract ManageDrippie is Script {
/// @notice Generates the data for a Gelato task that would trigger a drip. /// @notice Generates the data for a Gelato task that would trigger a drip.
/// @param _drippie The drippie contract. /// @param _drippie The drippie contract.
/// @param _name The name of the drip. /// @param _name The name of the drip.
/// @return _taskData Gelato task data. /// @return taskData_ Gelato task data.
function _makeGelatoDripTaskData( function _makeGelatoDripTaskData(
Drippie _drippie, Drippie _drippie,
string memory _name string memory _name
) )
internal internal
view view
returns (GelatoTaskData memory _taskData) returns (GelatoTaskData memory taskData_)
{ {
// Get the drip interval. // Get the drip interval.
uint256 dripInterval = _drippie.getDripInterval(_name); uint256 dripInterval = _drippie.getDripInterval(_name);
...@@ -131,7 +131,7 @@ contract ManageDrippie is Script { ...@@ -131,7 +131,7 @@ contract ManageDrippie is Script {
args[1] = abi.encode(uint128(GelatoDataTypes.TriggerType.TIME), abi.encode(uint128(0), interval)); args[1] = abi.encode(uint128(GelatoDataTypes.TriggerType.TIME), abi.encode(uint128(0), interval));
// Create the task data. // Create the task data.
_taskData = GelatoTaskData({ taskData_ = GelatoTaskData({
taskCreator: msg.sender, taskCreator: msg.sender,
execAddress: address(_drippie), execAddress: address(_drippie),
execData: abi.encodeCall(Drippie.drip, (_name)), execData: abi.encodeCall(Drippie.drip, (_name)),
...@@ -158,7 +158,7 @@ contract ManageDrippie is Script { ...@@ -158,7 +158,7 @@ contract ManageDrippie is Script {
/// @param _gelato The gelato contract. /// @param _gelato The gelato contract.
/// @param _drippie The drippie contract. /// @param _drippie The drippie contract.
/// @param _name The name of the drip being triggered. /// @param _name The name of the drip being triggered.
/// @return _active True if the task is active, false otherwise. /// @return active_ True if the task is active, false otherwise.
function _isGelatoDripTaskActive( function _isGelatoDripTaskActive(
IGelato _gelato, IGelato _gelato,
Drippie _drippie, Drippie _drippie,
...@@ -166,7 +166,7 @@ contract ManageDrippie is Script { ...@@ -166,7 +166,7 @@ contract ManageDrippie is Script {
) )
internal internal
view view
returns (bool _active) returns (bool active_)
{ {
GelatoTaskData memory taskData = _makeGelatoDripTaskData({ _drippie: _drippie, _name: _name }); GelatoTaskData memory taskData = _makeGelatoDripTaskData({ _drippie: _drippie, _name: _name });
bytes32 taskId = GelatoTaskId.getTaskId({ bytes32 taskId = GelatoTaskId.getTaskId({
...@@ -181,7 +181,7 @@ contract ManageDrippie is Script { ...@@ -181,7 +181,7 @@ contract ManageDrippie is Script {
bytes32[] memory taskIds = _gelato.getTaskIdsByUser(taskData.taskCreator); bytes32[] memory taskIds = _gelato.getTaskIdsByUser(taskData.taskCreator);
for (uint256 i = 0; i < taskIds.length; i++) { for (uint256 i = 0; i < taskIds.length; i++) {
if (taskIds[i] == taskId) { if (taskIds[i] == taskId) {
_active = true; active_ = true;
} }
} }
} }
......
...@@ -8,16 +8,16 @@ ...@@ -8,16 +8,16 @@
"sourceCodeHash": "0x9ec99e63a991691e8756a663edf2ccfbe9b91161c134e24f38298da61ecd66dd" "sourceCodeHash": "0x9ec99e63a991691e8756a663edf2ccfbe9b91161c134e24f38298da61ecd66dd"
}, },
"src/L1/DataAvailabilityChallenge.sol": { "src/L1/DataAvailabilityChallenge.sol": {
"initCodeHash": "0xcc96cf2e4d841adb7ecb9dd84abeb0893dd62d913c0d47ab5b66a893c6e47e88", "initCodeHash": "0xbd00d6568abab3e7fc211c40d682862242f25493010a4a097bd1f3b45c8c87c3",
"sourceCodeHash": "0xce01773740f4d50ac77f868343d654f6ca24f85d2770eb7e4043e98f609b1c15" "sourceCodeHash": "0x58b587034a67b4bb718abbaded8ac23b082c0971105874bcc42c23f051c67f6e"
}, },
"src/L1/DelayedVetoable.sol": { "src/L1/DelayedVetoable.sol": {
"initCodeHash": "0xd504ab0568719a0fb960ebe73d0437645f5c4bd8f6619219858209ef002516dd", "initCodeHash": "0x9fe8ade6f6332262ff1f3539ac0bf57660edbad3cf4c4cb230c2ddac18aa0a3f",
"sourceCodeHash": "0x60af558156543d639a0a92e983ad0f045aac1f9ac4c3adaa1d4d97b37175e03a" "sourceCodeHash": "0x30e83a535ef27b2e900c831c4e1a4ec2750195350011c4fdacda1da9db2d167b"
}, },
"src/L1/L1CrossDomainMessenger.sol": { "src/L1/L1CrossDomainMessenger.sol": {
"initCodeHash": "0x48db42620b9f16e0dec2355f4076314f82fd0f60ef04c10cdbc266eac9472515", "initCodeHash": "0x2e9cb3ceb5e55341b311f0666ef7655df4fafae75afdfbcd701cd9c9b2b017d5",
"sourceCodeHash": "0xb77342e6b55b835e9597f7a1c4a2d52ddd56f5cfb7cd38da0bcc488c79a9011e" "sourceCodeHash": "0x848ec3774be17bcc8ba65a23d08e35e979b3f39f9d2ac8a810188f945c69c9ea"
}, },
"src/L1/L1ERC721Bridge.sol": { "src/L1/L1ERC721Bridge.sol": {
"initCodeHash": "0xfb8b3c51e1790a0b951eaba05ed7368309fbfc7ddc558b4ce1de29da087fb4bd", "initCodeHash": "0xfb8b3c51e1790a0b951eaba05ed7368309fbfc7ddc558b4ce1de29da087fb4bd",
...@@ -32,8 +32,8 @@ ...@@ -32,8 +32,8 @@
"sourceCodeHash": "0xde4df0f9633dc0cdb1c9f634003ea5b0f7c5c1aebc407bc1b2f44c0ecf938649" "sourceCodeHash": "0xde4df0f9633dc0cdb1c9f634003ea5b0f7c5c1aebc407bc1b2f44c0ecf938649"
}, },
"src/L1/OPContractsManager.sol": { "src/L1/OPContractsManager.sol": {
"initCodeHash": "0x7903f225091334a1910470bb1b5c111f13f6f2572faf03e0c74ad625e4c0d6f5", "initCodeHash": "0x08be0367ee031ee292b74aa9b6fc86c5d65cbbdadd455bb8120748eec79cf2d8",
"sourceCodeHash": "0x3a25b0ac70b1d434773c86f46b1f2a995722e33d3273762fd5abbb541bffa7db" "sourceCodeHash": "0x84fd2b583ddf44e900c58861ddda103f7bea793d71fb845f76ed28afd1e757bc"
}, },
"src/L1/OptimismPortal.sol": { "src/L1/OptimismPortal.sol": {
"initCodeHash": "0xbe2c0c81b3459014f287d8c89cdc0d27dde5d1f44e5d024fa1e4773ddc47c190", "initCodeHash": "0xbe2c0c81b3459014f287d8c89cdc0d27dde5d1f44e5d024fa1e4773ddc47c190",
...@@ -112,20 +112,20 @@ ...@@ -112,20 +112,20 @@
"sourceCodeHash": "0xd08a2e6514dbd44e16aa312a1b27b2841a9eab5622cbd05a39c30f543fad673c" "sourceCodeHash": "0xd08a2e6514dbd44e16aa312a1b27b2841a9eab5622cbd05a39c30f543fad673c"
}, },
"src/L2/L2ToL2CrossDomainMessenger.sol": { "src/L2/L2ToL2CrossDomainMessenger.sol": {
"initCodeHash": "0x3e4337542234c732a55e60fc20dcb1ad639ff2fb378e3f29e94b4059df9a637b", "initCodeHash": "0x2ec4cdf62baf9dfb2c4c211d8b914f3dd1e0c0133c15c739ff81c5a2504d4359",
"sourceCodeHash": "0x4b806cc85cead74c8df34ab08f4b6c6a95a1a387a335ec8a7cb2de4ea4e1cf41" "sourceCodeHash": "0x54dfffed789dafe11b7f7bb16dfb29988713a19da5209452119c5d6539e48c48"
}, },
"src/L2/OptimismSuperchainERC20.sol": { "src/L2/OptimismSuperchainERC20.sol": {
"initCodeHash": "0x4fd71b5352b78d51d39625b6defa77a75be53067b32f3cba86bd17a46917adf9", "initCodeHash": "0x192bb3abd2a103832172d913f548e36bcf6f2c0220cd224a83f8420e2e86b4ec",
"sourceCodeHash": "0xad3934ea533544b3c130c80be26201354af85f9166cb2ce54d96e5e383ebb5c1" "sourceCodeHash": "0x09d3367612dee674e3708da1c70eebbd0c6835fbcbba339780e678338bdfd3ca"
}, },
"src/L2/OptimismSuperchainERC20Beacon.sol": { "src/L2/OptimismSuperchainERC20Beacon.sol": {
"initCodeHash": "0x99ce8095b23c124850d866cbc144fee6cee05dbc6bb5d83acadfe00b90cf42c7", "initCodeHash": "0x99ce8095b23c124850d866cbc144fee6cee05dbc6bb5d83acadfe00b90cf42c7",
"sourceCodeHash": "0x5e58b7c867fafa49fe39d68d83875425e9cf94f05f2835bdcdaa08fc8bc6b68e" "sourceCodeHash": "0x5e58b7c867fafa49fe39d68d83875425e9cf94f05f2835bdcdaa08fc8bc6b68e"
}, },
"src/L2/OptimismSuperchainERC20Factory.sol": { "src/L2/OptimismSuperchainERC20Factory.sol": {
"initCodeHash": "0x98011045722178751e4a1112892f7d9a11bc1f5e42ac18205b6d30a1f1476d24", "initCodeHash": "0x524bc58927ca60ba2fbc4b036ad00c5055758d5c5b2ebb3d75cb9b996175f2cb",
"sourceCodeHash": "0x9e72b2a77d82fcf3963734232ba9faff9d63962594a032041c2561f0a9f1b0b5" "sourceCodeHash": "0x155a4b22ff8e266560d1fae72e1db7fc164afd84b8a81afb74c69414e0d5438e"
}, },
"src/L2/SequencerFeeVault.sol": { "src/L2/SequencerFeeVault.sol": {
"initCodeHash": "0x2e6551705e493bacba8cffe22e564d5c401ae5bb02577a5424e0d32784e13e74", "initCodeHash": "0x2e6551705e493bacba8cffe22e564d5c401ae5bb02577a5424e0d32784e13e74",
...@@ -144,8 +144,8 @@ ...@@ -144,8 +144,8 @@
"sourceCodeHash": "0xba4674e1846afbbc708877332a38dfabd4b8d1e48ce07d8ebf0a45c9f27f16b0" "sourceCodeHash": "0xba4674e1846afbbc708877332a38dfabd4b8d1e48ce07d8ebf0a45c9f27f16b0"
}, },
"src/cannon/MIPS2.sol": { "src/cannon/MIPS2.sol": {
"initCodeHash": "0x67fb4107e25561ffcb3a9b6653f695e125773408d626a92036ea4b0814797021", "initCodeHash": "0xbb8c2370460e66274210d16ae527a29cb432bb646ebdccc0db0b21e53a4e428c",
"sourceCodeHash": "0x5f4851e04dc9369552c94fb23aee8e8ca4ea9a9602917f0abb3b5f1347460bd5" "sourceCodeHash": "0x50ed780b621521047ed36ffb260032f2e5ec287f3e1ab3d742c7de45febb280d"
}, },
"src/cannon/PreimageOracle.sol": { "src/cannon/PreimageOracle.sol": {
"initCodeHash": "0x801e52f9c8439fcf7089575fa93272dfb874641dbfc7d82f36d979c987271c0b", "initCodeHash": "0x801e52f9c8439fcf7089575fa93272dfb874641dbfc7d82f36d979c987271c0b",
...@@ -200,8 +200,8 @@ ...@@ -200,8 +200,8 @@
"sourceCodeHash": "0xde1a289c1cb0bf92138daf8f3db7457be2f84bedaa111b536f646dd6e121718c" "sourceCodeHash": "0xde1a289c1cb0bf92138daf8f3db7457be2f84bedaa111b536f646dd6e121718c"
}, },
"src/safe/LivenessGuard.sol": { "src/safe/LivenessGuard.sol": {
"initCodeHash": "0xfd74ff89e7b689b38ab97515d64429ffaf6c0cd1ea6488c6a4743a0665419c85", "initCodeHash": "0x9ac0b039b1591f7c00cf11cb758d118c9b42e6e08250b619d6b6fd605a43d5ee",
"sourceCodeHash": "0xa40ea6472d9c7e124791489c0899822d6f6b19b16e583d3b437674c615e4bac3" "sourceCodeHash": "0xc1a968b0c6fbc4d82c2821c917b273feaaa224d258886b394416e84ee250d026"
}, },
"src/safe/LivenessModule.sol": { "src/safe/LivenessModule.sol": {
"initCodeHash": "0xcfccdd9e423c95a0ddc6e09ccb6333d5fc8429ed2b8fc872f1290d392ae13aad", "initCodeHash": "0xcfccdd9e423c95a0ddc6e09ccb6333d5fc8429ed2b8fc872f1290d392ae13aad",
...@@ -224,7 +224,7 @@ ...@@ -224,7 +224,7 @@
"sourceCodeHash": "0x1c4bc4727f08d80e8364561b49397ee57bb485072cb004b7a430559cbfa019a6" "sourceCodeHash": "0x1c4bc4727f08d80e8364561b49397ee57bb485072cb004b7a430559cbfa019a6"
}, },
"src/universal/StorageSetter.sol": { "src/universal/StorageSetter.sol": {
"initCodeHash": "0x00b8b883597e67e5c3548e7ba4139ed720893c0acb217dd170bec520cefdfab5", "initCodeHash": "0x21b3059e9b13b330f76d02b61f61dcfa3abf3517a0b56afa0895c4b8291740bf",
"sourceCodeHash": "0xf63aff9c38f4c5e9cdbd1f910bc002e16008a592d26c0dcc67929e0024638edd" "sourceCodeHash": "0xc1ea12a87e3a7ef9c950f0a41a4e35b60d4d9c4c816ff671dbfca663861c16f4"
} }
} }
\ No newline at end of file
...@@ -44,12 +44,12 @@ ...@@ -44,12 +44,12 @@
"inputs": [ "inputs": [
{ {
"internalType": "uint256", "internalType": "uint256",
"name": "challengedBlockNumber", "name": "_challengedBlockNumber",
"type": "uint256" "type": "uint256"
}, },
{ {
"internalType": "bytes", "internalType": "bytes",
"name": "challengedCommitment", "name": "_challengedCommitment",
"type": "bytes" "type": "bytes"
} }
], ],
...@@ -95,12 +95,12 @@ ...@@ -95,12 +95,12 @@
"inputs": [ "inputs": [
{ {
"internalType": "uint256", "internalType": "uint256",
"name": "challengedBlockNumber", "name": "_challengedBlockNumber",
"type": "uint256" "type": "uint256"
}, },
{ {
"internalType": "bytes", "internalType": "bytes",
"name": "challengedCommitment", "name": "_challengedCommitment",
"type": "bytes" "type": "bytes"
} }
], ],
...@@ -141,12 +141,12 @@ ...@@ -141,12 +141,12 @@
"inputs": [ "inputs": [
{ {
"internalType": "uint256", "internalType": "uint256",
"name": "challengedBlockNumber", "name": "_challengedBlockNumber",
"type": "uint256" "type": "uint256"
}, },
{ {
"internalType": "bytes", "internalType": "bytes",
"name": "challengedCommitment", "name": "_challengedCommitment",
"type": "bytes" "type": "bytes"
} }
], ],
...@@ -218,17 +218,17 @@ ...@@ -218,17 +218,17 @@
"inputs": [ "inputs": [
{ {
"internalType": "uint256", "internalType": "uint256",
"name": "challengedBlockNumber", "name": "_challengedBlockNumber",
"type": "uint256" "type": "uint256"
}, },
{ {
"internalType": "bytes", "internalType": "bytes",
"name": "challengedCommitment", "name": "_challengedCommitment",
"type": "bytes" "type": "bytes"
}, },
{ {
"internalType": "bytes", "internalType": "bytes",
"name": "resolveData", "name": "_resolveData",
"type": "bytes" "type": "bytes"
} }
], ],
...@@ -306,12 +306,12 @@ ...@@ -306,12 +306,12 @@
"inputs": [ "inputs": [
{ {
"internalType": "uint256", "internalType": "uint256",
"name": "challengedBlockNumber", "name": "_challengedBlockNumber",
"type": "uint256" "type": "uint256"
}, },
{ {
"internalType": "bytes", "internalType": "bytes",
"name": "challengedCommitment", "name": "_challengedCommitment",
"type": "bytes" "type": "bytes"
} }
], ],
...@@ -324,7 +324,7 @@ ...@@ -324,7 +324,7 @@
"inputs": [ "inputs": [
{ {
"internalType": "bytes", "internalType": "bytes",
"name": "commitment", "name": "_commitment",
"type": "bytes" "type": "bytes"
} }
], ],
......
...@@ -3,22 +3,22 @@ ...@@ -3,22 +3,22 @@
"inputs": [ "inputs": [
{ {
"internalType": "address", "internalType": "address",
"name": "vetoer_", "name": "_vetoer",
"type": "address" "type": "address"
}, },
{ {
"internalType": "address", "internalType": "address",
"name": "initiator_", "name": "_initiator",
"type": "address" "type": "address"
}, },
{ {
"internalType": "address", "internalType": "address",
"name": "target_", "name": "_target",
"type": "address" "type": "address"
}, },
{ {
"internalType": "uint256", "internalType": "uint256",
"name": "operatingDelay_", "name": "_operatingDelay",
"type": "uint256" "type": "uint256"
} }
], ],
...@@ -59,7 +59,7 @@ ...@@ -59,7 +59,7 @@
"inputs": [ "inputs": [
{ {
"internalType": "bytes32", "internalType": "bytes32",
"name": "callHash", "name": "_callHash",
"type": "bytes32" "type": "bytes32"
} }
], ],
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
"outputs": [ "outputs": [
{ {
"internalType": "address", "internalType": "address",
"name": "_sender", "name": "sender_",
"type": "address" "type": "address"
} }
], ],
...@@ -18,7 +18,7 @@ ...@@ -18,7 +18,7 @@
"outputs": [ "outputs": [
{ {
"internalType": "uint256", "internalType": "uint256",
"name": "_source", "name": "source_",
"type": "uint256" "type": "uint256"
} }
], ],
......
...@@ -32,57 +32,57 @@ ...@@ -32,57 +32,57 @@
"inputs": [ "inputs": [
{ {
"internalType": "address", "internalType": "address",
"name": "to", "name": "_to",
"type": "address" "type": "address"
}, },
{ {
"internalType": "uint256", "internalType": "uint256",
"name": "value", "name": "_value",
"type": "uint256" "type": "uint256"
}, },
{ {
"internalType": "bytes", "internalType": "bytes",
"name": "data", "name": "_data",
"type": "bytes" "type": "bytes"
}, },
{ {
"internalType": "enum Enum.Operation", "internalType": "enum Enum.Operation",
"name": "operation", "name": "_operation",
"type": "uint8" "type": "uint8"
}, },
{ {
"internalType": "uint256", "internalType": "uint256",
"name": "safeTxGas", "name": "_safeTxGas",
"type": "uint256" "type": "uint256"
}, },
{ {
"internalType": "uint256", "internalType": "uint256",
"name": "baseGas", "name": "_baseGas",
"type": "uint256" "type": "uint256"
}, },
{ {
"internalType": "uint256", "internalType": "uint256",
"name": "gasPrice", "name": "_gasPrice",
"type": "uint256" "type": "uint256"
}, },
{ {
"internalType": "address", "internalType": "address",
"name": "gasToken", "name": "_gasToken",
"type": "address" "type": "address"
}, },
{ {
"internalType": "address payable", "internalType": "address payable",
"name": "refundReceiver", "name": "_refundReceiver",
"type": "address" "type": "address"
}, },
{ {
"internalType": "bytes", "internalType": "bytes",
"name": "signatures", "name": "_signatures",
"type": "bytes" "type": "bytes"
}, },
{ {
"internalType": "address", "internalType": "address",
"name": "msgSender", "name": "_msgSender",
"type": "address" "type": "address"
} }
], ],
......
...@@ -26,7 +26,7 @@ ...@@ -26,7 +26,7 @@
"outputs": [ "outputs": [
{ {
"internalType": "address", "internalType": "address",
"name": "_superchainERC20", "name": "superchainERC20_",
"type": "address" "type": "address"
} }
], ],
......
...@@ -127,7 +127,7 @@ ...@@ -127,7 +127,7 @@
} }
], ],
"internalType": "struct StorageSetter.Slot[]", "internalType": "struct StorageSetter.Slot[]",
"name": "slots", "name": "_slots",
"type": "tuple[]" "type": "tuple[]"
} }
], ],
......
...@@ -69,21 +69,21 @@ contract DelayedVetoable is ISemver { ...@@ -69,21 +69,21 @@ contract DelayedVetoable is ISemver {
} }
/// @notice Semantic version. /// @notice Semantic version.
/// @custom:semver 1.0.1-beta.1 /// @custom:semver 1.0.1-beta.2
string public constant version = "1.0.1-beta.1"; string public constant version = "1.0.1-beta.2";
/// @notice Sets the target admin during contract deployment. /// @notice Sets the target admin during contract deployment.
/// @param vetoer_ Address of the vetoer. /// @param _vetoer Address of the vetoer.
/// @param initiator_ Address of the initiator. /// @param _initiator Address of the initiator.
/// @param target_ Address of the target. /// @param _target Address of the target.
/// @param operatingDelay_ Time to delay when the system is operational. /// @param _operatingDelay Time to delay when the system is operational.
constructor(address vetoer_, address initiator_, address target_, uint256 operatingDelay_) { constructor(address _vetoer, address _initiator, address _target, uint256 _operatingDelay) {
// Note that the _delay value is not set here. Having an initial delay of 0 is helpful // Note that the _delay value is not set here. Having an initial delay of 0 is helpful
// during the deployment of a new system. // during the deployment of a new system.
VETOER = vetoer_; VETOER = _vetoer;
INITIATOR = initiator_; INITIATOR = _initiator;
TARGET = target_; TARGET = _target;
OPERATING_DELAY = operatingDelay_; OPERATING_DELAY = _operatingDelay;
} }
/// @notice Gets the initiator /// @notice Gets the initiator
...@@ -111,10 +111,10 @@ contract DelayedVetoable is ISemver { ...@@ -111,10 +111,10 @@ contract DelayedVetoable is ISemver {
} }
/// @notice Gets entries in the _queuedAt mapping. /// @notice Gets entries in the _queuedAt mapping.
/// @param callHash The hash of the call data. /// @param _callHash The hash of the call data.
/// @return queuedAt_ The time the callHash was recorded. /// @return queuedAt_ The time the callHash was recorded.
function queuedAt(bytes32 callHash) external readOrHandle returns (uint256 queuedAt_) { function queuedAt(bytes32 _callHash) external readOrHandle returns (uint256 queuedAt_) {
queuedAt_ = _queuedAt[callHash]; queuedAt_ = _queuedAt[_callHash];
} }
/// @notice Used for all calls that pass data to the contract. /// @notice Used for all calls that pass data to the contract.
...@@ -176,9 +176,9 @@ contract DelayedVetoable is ISemver { ...@@ -176,9 +176,9 @@ contract DelayedVetoable is ISemver {
} }
/// @notice Forwards the call to the target and halts the call frame. /// @notice Forwards the call to the target and halts the call frame.
function _forwardAndHalt(bytes32 callHash) internal { function _forwardAndHalt(bytes32 _callHash) internal {
// Forward the call // Forward the call
emit Forwarded(callHash, msg.data); emit Forwarded(_callHash, msg.data);
(bool success, bytes memory returndata) = TARGET.call(msg.data); (bool success, bytes memory returndata) = TARGET.call(msg.data);
if (success == true) { if (success == true) {
assembly { assembly {
......
...@@ -30,8 +30,8 @@ contract L1CrossDomainMessenger is CrossDomainMessenger, ISemver { ...@@ -30,8 +30,8 @@ contract L1CrossDomainMessenger is CrossDomainMessenger, ISemver {
ISystemConfig public systemConfig; ISystemConfig public systemConfig;
/// @notice Semantic version. /// @notice Semantic version.
/// @custom:semver 2.4.1-beta.1 /// @custom:semver 2.4.1-beta.2
string public constant version = "2.4.1-beta.1"; string public constant version = "2.4.1-beta.2";
/// @notice Constructs the L1CrossDomainMessenger contract. /// @notice Constructs the L1CrossDomainMessenger contract.
constructor() CrossDomainMessenger() { constructor() CrossDomainMessenger() {
...@@ -61,8 +61,8 @@ contract L1CrossDomainMessenger is CrossDomainMessenger, ISemver { ...@@ -61,8 +61,8 @@ contract L1CrossDomainMessenger is CrossDomainMessenger, ISemver {
} }
/// @inheritdoc CrossDomainMessenger /// @inheritdoc CrossDomainMessenger
function gasPayingToken() internal view override returns (address _addr, uint8 _decimals) { function gasPayingToken() internal view override returns (address addr_, uint8 decimals_) {
(_addr, _decimals) = systemConfig.gasPayingToken(); (addr_, decimals_) = systemConfig.gasPayingToken();
} }
/// @notice Getter function for the OptimismPortal contract on this chain. /// @notice Getter function for the OptimismPortal contract on this chain.
......
...@@ -124,8 +124,8 @@ contract OPContractsManager is ISemver, Initializable { ...@@ -124,8 +124,8 @@ contract OPContractsManager is ISemver, Initializable {
// -------- Constants and Variables -------- // -------- Constants and Variables --------
/// @custom:semver 1.0.0-beta.7 /// @custom:semver 1.0.0-beta.8
string public constant version = "1.0.0-beta.7"; string public constant version = "1.0.0-beta.8";
/// @notice Represents the interface version so consumers know how to decode the DeployOutput struct /// @notice Represents the interface version so consumers know how to decode the DeployOutput struct
/// that's emitted in the `Deployed` event. Whenever that struct changes, a new version should be used. /// that's emitted in the `Deployed` event. Whenever that struct changes, a new version should be used.
...@@ -432,7 +432,7 @@ contract OPContractsManager is ISemver, Initializable { ...@@ -432,7 +432,7 @@ contract OPContractsManager is ISemver, Initializable {
/// @notice Helper method for encoding the SystemConfig initializer data. /// @notice Helper method for encoding the SystemConfig initializer data.
function encodeSystemConfigInitializer( function encodeSystemConfigInitializer(
bytes4 selector, bytes4 _selector,
DeployInput memory _input, DeployInput memory _input,
DeployOutput memory _output DeployOutput memory _output
) )
...@@ -442,10 +442,10 @@ contract OPContractsManager is ISemver, Initializable { ...@@ -442,10 +442,10 @@ contract OPContractsManager is ISemver, Initializable {
returns (bytes memory) returns (bytes memory)
{ {
(ResourceMetering.ResourceConfig memory referenceResourceConfig, SystemConfig.Addresses memory opChainAddrs) = (ResourceMetering.ResourceConfig memory referenceResourceConfig, SystemConfig.Addresses memory opChainAddrs) =
defaultSystemConfigParams(selector, _input, _output); defaultSystemConfigParams(_selector, _input, _output);
return abi.encodeWithSelector( return abi.encodeWithSelector(
selector, _selector,
_input.roles.systemConfigOwner, _input.roles.systemConfigOwner,
_input.basefeeScalar, _input.basefeeScalar,
_input.blobBasefeeScalar, _input.blobBasefeeScalar,
......
...@@ -20,7 +20,7 @@ contract OPContractsManagerInterop is OPContractsManager { ...@@ -20,7 +20,7 @@ contract OPContractsManagerInterop is OPContractsManager {
// The `SystemConfigInterop` contract has an extra `address _dependencyManager` argument // The `SystemConfigInterop` contract has an extra `address _dependencyManager` argument
// that we must account for. // that we must account for.
function encodeSystemConfigInitializer( function encodeSystemConfigInitializer(
bytes4 selector, bytes4 _selector,
DeployInput memory _input, DeployInput memory _input,
DeployOutput memory _output DeployOutput memory _output
) )
...@@ -31,7 +31,7 @@ contract OPContractsManagerInterop is OPContractsManager { ...@@ -31,7 +31,7 @@ contract OPContractsManagerInterop is OPContractsManager {
returns (bytes memory) returns (bytes memory)
{ {
(ResourceMetering.ResourceConfig memory referenceResourceConfig, SystemConfig.Addresses memory opChainAddrs) = (ResourceMetering.ResourceConfig memory referenceResourceConfig, SystemConfig.Addresses memory opChainAddrs) =
defaultSystemConfigParams(selector, _input, _output); defaultSystemConfigParams(_selector, _input, _output);
// TODO For now we assume that the dependency manager is the same as the proxy admin owner. // TODO For now we assume that the dependency manager is the same as the proxy admin owner.
// This is currently undefined since it's not part of the standard config, so we may need // This is currently undefined since it's not part of the standard config, so we may need
...@@ -41,7 +41,7 @@ contract OPContractsManagerInterop is OPContractsManager { ...@@ -41,7 +41,7 @@ contract OPContractsManagerInterop is OPContractsManager {
address dependencyManager = address(_input.roles.opChainProxyAdminOwner); address dependencyManager = address(_input.roles.opChainProxyAdminOwner);
return abi.encodeWithSelector( return abi.encodeWithSelector(
selector, _selector,
_input.roles.systemConfigOwner, _input.roles.systemConfigOwner,
_input.basefeeScalar, _input.basefeeScalar,
_input.blobBasefeeScalar, _input.blobBasefeeScalar,
......
...@@ -44,20 +44,20 @@ interface IDataAvailabilityChallenge { ...@@ -44,20 +44,20 @@ interface IDataAvailabilityChallenge {
function balances(address) external view returns (uint256); function balances(address) external view returns (uint256);
function bondSize() external view returns (uint256); function bondSize() external view returns (uint256);
function challenge(uint256 challengedBlockNumber, bytes memory challengedCommitment) external payable; function challenge(uint256 _challengedBlockNumber, bytes memory _challengedCommitment) external payable;
function challengeWindow() external view returns (uint256); function challengeWindow() external view returns (uint256);
function deposit() external payable; function deposit() external payable;
function fixedResolutionCost() external view returns (uint256); function fixedResolutionCost() external view returns (uint256);
function getChallenge( function getChallenge(
uint256 challengedBlockNumber, uint256 _challengedBlockNumber,
bytes memory challengedCommitment bytes memory _challengedCommitment
) )
external external
view view
returns (Challenge memory); returns (Challenge memory);
function getChallengeStatus( function getChallengeStatus(
uint256 challengedBlockNumber, uint256 _challengedBlockNumber,
bytes memory challengedCommitment bytes memory _challengedCommitment
) )
external external
view view
...@@ -73,18 +73,18 @@ interface IDataAvailabilityChallenge { ...@@ -73,18 +73,18 @@ interface IDataAvailabilityChallenge {
function owner() external view returns (address); function owner() external view returns (address);
function renounceOwnership() external; function renounceOwnership() external;
function resolve( function resolve(
uint256 challengedBlockNumber, uint256 _challengedBlockNumber,
bytes memory challengedCommitment, bytes memory _challengedCommitment,
bytes memory resolveData bytes memory _resolveData
) )
external; external;
function resolveWindow() external view returns (uint256); function resolveWindow() external view returns (uint256);
function resolverRefundPercentage() external view returns (uint256); function resolverRefundPercentage() external view returns (uint256);
function setBondSize(uint256 _bondSize) external; function setBondSize(uint256 _bondSize) external;
function setResolverRefundPercentage(uint256 _resolverRefundPercentage) external; function setResolverRefundPercentage(uint256 _resolverRefundPercentage) external;
function transferOwnership(address newOwner) external; function transferOwnership(address newOwner) external; // nosemgrep
function unlockBond(uint256 challengedBlockNumber, bytes memory challengedCommitment) external; function unlockBond(uint256 _challengedBlockNumber, bytes memory _challengedCommitment) external;
function validateCommitment(bytes memory commitment) external pure; function validateCommitment(bytes memory _commitment) external pure;
function variableResolutionCost() external view returns (uint256); function variableResolutionCost() external view returns (uint256);
function variableResolutionCostPrecision() external view returns (uint256); function variableResolutionCostPrecision() external view returns (uint256);
function version() external view returns (string memory); function version() external view returns (string memory);
......
...@@ -14,10 +14,10 @@ interface IDelayedVetoable { ...@@ -14,10 +14,10 @@ interface IDelayedVetoable {
function delay() external returns (uint256 delay_); function delay() external returns (uint256 delay_);
function initiator() external returns (address initiator_); function initiator() external returns (address initiator_);
function queuedAt(bytes32 callHash) external returns (uint256 queuedAt_); function queuedAt(bytes32 _callHash) external returns (uint256 queuedAt_);
function target() external returns (address target_); function target() external returns (address target_);
function version() external view returns (string memory); function version() external view returns (string memory);
function vetoer() external returns (address vetoer_); function vetoer() external returns (address vetoer_);
function __constructor__(address vetoer_, address initiator_, address target_, uint256 operatingDelay_) external; function __constructor__(address _vetoer, address _initiator, address _target, uint256 _operatingDelay) external;
} }
...@@ -65,7 +65,7 @@ interface IOptimismPortal { ...@@ -65,7 +65,7 @@ interface IOptimismPortal {
function l2Oracle() external view returns (IL2OutputOracle); function l2Oracle() external view returns (IL2OutputOracle);
function l2Sender() external view returns (address); function l2Sender() external view returns (address);
function minimumGasLimit(uint64 _byteCount) external pure returns (uint64); function minimumGasLimit(uint64 _byteCount) external pure returns (uint64);
function params() external view returns (uint128 prevBaseFee, uint64 prevBoughtGas, uint64 prevBlockNum); function params() external view returns (uint128 prevBaseFee, uint64 prevBoughtGas, uint64 prevBlockNum); // nosemgrep
function paused() external view returns (bool paused_); function paused() external view returns (bool paused_);
function proveWithdrawalTransaction( function proveWithdrawalTransaction(
Types.WithdrawalTransaction memory _tx, Types.WithdrawalTransaction memory _tx,
...@@ -77,7 +77,7 @@ interface IOptimismPortal { ...@@ -77,7 +77,7 @@ interface IOptimismPortal {
function provenWithdrawals(bytes32) function provenWithdrawals(bytes32)
external external
view view
returns (bytes32 outputRoot, uint128 timestamp, uint128 l2OutputIndex); returns (bytes32 outputRoot, uint128 timestamp, uint128 l2OutputIndex); // nosemgrep
function setGasPayingToken(address _token, uint8 _decimals, bytes32 _name, bytes32 _symbol) external; function setGasPayingToken(address _token, uint8 _decimals, bytes32 _name, bytes32 _symbol) external;
function superchainConfig() external view returns (ISuperchainConfig); function superchainConfig() external view returns (ISuperchainConfig);
function systemConfig() external view returns (ISystemConfig); function systemConfig() external view returns (ISystemConfig);
......
...@@ -88,7 +88,7 @@ interface IOptimismPortal2 { ...@@ -88,7 +88,7 @@ interface IOptimismPortal2 {
function l2Sender() external view returns (address); function l2Sender() external view returns (address);
function minimumGasLimit(uint64 _byteCount) external pure returns (uint64); function minimumGasLimit(uint64 _byteCount) external pure returns (uint64);
function numProofSubmitters(bytes32 _withdrawalHash) external view returns (uint256); function numProofSubmitters(bytes32 _withdrawalHash) external view returns (uint256);
function params() external view returns (uint128 prevBaseFee, uint64 prevBoughtGas, uint64 prevBlockNum); function params() external view returns (uint128 prevBaseFee, uint64 prevBoughtGas, uint64 prevBlockNum); // nosemgrep
function paused() external view returns (bool); function paused() external view returns (bool);
function proofMaturityDelaySeconds() external view returns (uint256); function proofMaturityDelaySeconds() external view returns (uint256);
function proofSubmitters(bytes32, uint256) external view returns (address); function proofSubmitters(bytes32, uint256) external view returns (address);
...@@ -105,7 +105,7 @@ interface IOptimismPortal2 { ...@@ -105,7 +105,7 @@ interface IOptimismPortal2 {
) )
external external
view view
returns (IDisputeGame disputeGameProxy, uint64 timestamp); returns (IDisputeGame disputeGameProxy, uint64 timestamp); // nosemgrep
function respectedGameType() external view returns (GameType); function respectedGameType() external view returns (GameType);
function respectedGameTypeUpdatedAt() external view returns (uint64); function respectedGameTypeUpdatedAt() external view returns (uint64);
function setGasPayingToken(address _token, uint8 _decimals, bytes32 _name, bytes32 _symbol) external; function setGasPayingToken(address _token, uint8 _decimals, bytes32 _name, bytes32 _symbol) external;
......
...@@ -89,7 +89,7 @@ interface IOptimismPortalInterop { ...@@ -89,7 +89,7 @@ interface IOptimismPortalInterop {
function l2Sender() external view returns (address); function l2Sender() external view returns (address);
function minimumGasLimit(uint64 _byteCount) external pure returns (uint64); function minimumGasLimit(uint64 _byteCount) external pure returns (uint64);
function numProofSubmitters(bytes32 _withdrawalHash) external view returns (uint256); function numProofSubmitters(bytes32 _withdrawalHash) external view returns (uint256);
function params() external view returns (uint128 prevBaseFee, uint64 prevBoughtGas, uint64 prevBlockNum); function params() external view returns (uint128 prevBaseFee, uint64 prevBoughtGas, uint64 prevBlockNum); // nosemgrep
function paused() external view returns (bool); function paused() external view returns (bool);
function proofMaturityDelaySeconds() external view returns (uint256); function proofMaturityDelaySeconds() external view returns (uint256);
function proofSubmitters(bytes32, uint256) external view returns (address); function proofSubmitters(bytes32, uint256) external view returns (address);
...@@ -106,7 +106,7 @@ interface IOptimismPortalInterop { ...@@ -106,7 +106,7 @@ interface IOptimismPortalInterop {
) )
external external
view view
returns (IDisputeGame disputeGameProxy, uint64 timestamp); returns (IDisputeGame disputeGameProxy, uint64 timestamp); // nosemgrep
function respectedGameType() external view returns (GameType); function respectedGameType() external view returns (GameType);
function respectedGameTypeUpdatedAt() external view returns (uint64); function respectedGameTypeUpdatedAt() external view returns (uint64);
function setConfig(ConfigType _type, bytes memory _value) external; function setConfig(ConfigType _type, bytes memory _value) external;
......
...@@ -23,7 +23,7 @@ interface IProtocolVersions { ...@@ -23,7 +23,7 @@ interface IProtocolVersions {
function required() external view returns (ProtocolVersion out_); function required() external view returns (ProtocolVersion out_);
function setRecommended(ProtocolVersion _recommended) external; function setRecommended(ProtocolVersion _recommended) external;
function setRequired(ProtocolVersion _required) external; function setRequired(ProtocolVersion _required) external;
function transferOwnership(address newOwner) external; function transferOwnership(address newOwner) external; // nosemgrep
function version() external view returns (string memory); function version() external view returns (string memory);
function __constructor__() external; function __constructor__() external;
......
...@@ -21,5 +21,5 @@ interface IResourceMetering { ...@@ -21,5 +21,5 @@ interface IResourceMetering {
event Initialized(uint8 version); event Initialized(uint8 version);
function params() external view returns (uint128 prevBaseFee, uint64 prevBoughtGas, uint64 prevBlockNum); function params() external view returns (uint128 prevBaseFee, uint64 prevBoughtGas, uint64 prevBlockNum); // nosemgrep
} }
...@@ -75,7 +75,7 @@ interface ISystemConfig { ...@@ -75,7 +75,7 @@ interface ISystemConfig {
function setGasLimit(uint64 _gasLimit) external; function setGasLimit(uint64 _gasLimit) external;
function setUnsafeBlockSigner(address _unsafeBlockSigner) external; function setUnsafeBlockSigner(address _unsafeBlockSigner) external;
function startBlock() external view returns (uint256 startBlock_); function startBlock() external view returns (uint256 startBlock_);
function transferOwnership(address newOwner) external; function transferOwnership(address newOwner) external; // nosemgrep
function unsafeBlockSigner() external view returns (address addr_); function unsafeBlockSigner() external view returns (address addr_);
function version() external pure returns (string memory); function version() external pure returns (string memory);
......
...@@ -59,7 +59,7 @@ interface ISystemConfigInterop { ...@@ -59,7 +59,7 @@ interface ISystemConfigInterop {
function setGasLimit(uint64 _gasLimit) external; function setGasLimit(uint64 _gasLimit) external;
function setUnsafeBlockSigner(address _unsafeBlockSigner) external; function setUnsafeBlockSigner(address _unsafeBlockSigner) external;
function startBlock() external view returns (uint256 startBlock_); function startBlock() external view returns (uint256 startBlock_);
function transferOwnership(address newOwner) external; function transferOwnership(address newOwner) external; // nosemgrep
function unsafeBlockSigner() external view returns (address addr_); function unsafeBlockSigner() external view returns (address addr_);
function addDependency(uint256 _chainId) external; function addDependency(uint256 _chainId) external;
......
...@@ -57,8 +57,8 @@ contract L2ToL2CrossDomainMessenger is IL2ToL2CrossDomainMessenger, ISemver, Tra ...@@ -57,8 +57,8 @@ contract L2ToL2CrossDomainMessenger is IL2ToL2CrossDomainMessenger, ISemver, Tra
uint16 public constant messageVersion = uint16(0); uint16 public constant messageVersion = uint16(0);
/// @notice Semantic version. /// @notice Semantic version.
/// @custom:semver 1.0.0-beta.4 /// @custom:semver 1.0.0-beta.5
string public constant version = "1.0.0-beta.4"; string public constant version = "1.0.0-beta.5";
/// @notice Mapping of message hashes to boolean receipt values. Note that a message will only be present in this /// @notice Mapping of message hashes to boolean receipt values. Note that a message will only be present in this
/// mapping if it has successfully been relayed on this chain, and can therefore not be relayed again. /// mapping if it has successfully been relayed on this chain, and can therefore not be relayed again.
...@@ -78,18 +78,18 @@ contract L2ToL2CrossDomainMessenger is IL2ToL2CrossDomainMessenger, ISemver, Tra ...@@ -78,18 +78,18 @@ contract L2ToL2CrossDomainMessenger is IL2ToL2CrossDomainMessenger, ISemver, Tra
event FailedRelayedMessage(bytes32 indexed messageHash); event FailedRelayedMessage(bytes32 indexed messageHash);
/// @notice Retrieves the sender of the current cross domain message. If not entered, reverts. /// @notice Retrieves the sender of the current cross domain message. If not entered, reverts.
/// @return _sender Address of the sender of the current cross domain message. /// @return sender_ Address of the sender of the current cross domain message.
function crossDomainMessageSender() external view onlyEntered returns (address _sender) { function crossDomainMessageSender() external view onlyEntered returns (address sender_) {
assembly { assembly {
_sender := tload(CROSS_DOMAIN_MESSAGE_SENDER_SLOT) sender_ := tload(CROSS_DOMAIN_MESSAGE_SENDER_SLOT)
} }
} }
/// @notice Retrieves the source of the current cross domain message. If not entered, reverts. /// @notice Retrieves the source of the current cross domain message. If not entered, reverts.
/// @return _source Chain ID of the source of the current cross domain message. /// @return source_ Chain ID of the source of the current cross domain message.
function crossDomainMessageSource() external view onlyEntered returns (uint256 _source) { function crossDomainMessageSource() external view onlyEntered returns (uint256 source_) {
assembly { assembly {
_source := tload(CROSS_DOMAIN_MESSAGE_SOURCE_SLOT) source_ := tload(CROSS_DOMAIN_MESSAGE_SOURCE_SLOT)
} }
} }
......
...@@ -50,9 +50,9 @@ contract OptimismSuperchainERC20 is ...@@ -50,9 +50,9 @@ contract OptimismSuperchainERC20 is
} }
/// @notice Returns the storage for the OptimismSuperchainERC20Metadata. /// @notice Returns the storage for the OptimismSuperchainERC20Metadata.
function _getStorage() private pure returns (OptimismSuperchainERC20Metadata storage _storage) { function _getStorage() private pure returns (OptimismSuperchainERC20Metadata storage storage_) {
assembly { assembly {
_storage.slot := OPTIMISM_SUPERCHAIN_ERC20_METADATA_SLOT storage_.slot := OPTIMISM_SUPERCHAIN_ERC20_METADATA_SLOT
} }
} }
...@@ -63,8 +63,8 @@ contract OptimismSuperchainERC20 is ...@@ -63,8 +63,8 @@ contract OptimismSuperchainERC20 is
} }
/// @notice Semantic version. /// @notice Semantic version.
/// @custom:semver 1.0.0-beta.2 /// @custom:semver 1.0.0-beta.3
string public constant version = "1.0.0-beta.2"; string public constant version = "1.0.0-beta.3";
/// @notice Constructs the OptimismSuperchainERC20 contract. /// @notice Constructs the OptimismSuperchainERC20 contract.
constructor() { constructor() {
......
...@@ -27,15 +27,15 @@ contract OptimismSuperchainERC20Factory is IOptimismERC20Factory, ISemver { ...@@ -27,15 +27,15 @@ contract OptimismSuperchainERC20Factory is IOptimismERC20Factory, ISemver {
); );
/// @notice Semantic version. /// @notice Semantic version.
/// @custom:semver 1.0.0-beta.1 /// @custom:semver 1.0.0-beta.2
string public constant version = "1.0.0-beta.1"; string public constant version = "1.0.0-beta.2";
/// @notice Deploys a OptimismSuperchainERC20 Beacon Proxy using CREATE3. /// @notice Deploys a OptimismSuperchainERC20 Beacon Proxy using CREATE3.
/// @param _remoteToken Address of the remote token. /// @param _remoteToken Address of the remote token.
/// @param _name Name of the OptimismSuperchainERC20. /// @param _name Name of the OptimismSuperchainERC20.
/// @param _symbol Symbol of the OptimismSuperchainERC20. /// @param _symbol Symbol of the OptimismSuperchainERC20.
/// @param _decimals Decimals of the OptimismSuperchainERC20. /// @param _decimals Decimals of the OptimismSuperchainERC20.
/// @return _superchainERC20 Address of the OptimismSuperchainERC20 deployment. /// @return superchainERC20_ Address of the OptimismSuperchainERC20 deployment.
function deploy( function deploy(
address _remoteToken, address _remoteToken,
string memory _name, string memory _name,
...@@ -43,7 +43,7 @@ contract OptimismSuperchainERC20Factory is IOptimismERC20Factory, ISemver { ...@@ -43,7 +43,7 @@ contract OptimismSuperchainERC20Factory is IOptimismERC20Factory, ISemver {
uint8 _decimals uint8 _decimals
) )
external external
returns (address _superchainERC20) returns (address superchainERC20_)
{ {
bytes memory initCallData = bytes memory initCallData =
abi.encodeCall(OptimismSuperchainERC20.initialize, (_remoteToken, _name, _symbol, _decimals)); abi.encodeCall(OptimismSuperchainERC20.initialize, (_remoteToken, _name, _symbol, _decimals));
...@@ -53,10 +53,10 @@ contract OptimismSuperchainERC20Factory is IOptimismERC20Factory, ISemver { ...@@ -53,10 +53,10 @@ contract OptimismSuperchainERC20Factory is IOptimismERC20Factory, ISemver {
); );
bytes32 salt = keccak256(abi.encode(_remoteToken, _name, _symbol, _decimals)); bytes32 salt = keccak256(abi.encode(_remoteToken, _name, _symbol, _decimals));
_superchainERC20 = CREATE3.deploy({ salt: salt, creationCode: creationCode, value: 0 }); superchainERC20_ = CREATE3.deploy({ salt: salt, creationCode: creationCode, value: 0 });
deployments[_superchainERC20] = _remoteToken; deployments[superchainERC20_] = _remoteToken;
emit OptimismSuperchainERC20Created(_superchainERC20, _remoteToken, msg.sender); emit OptimismSuperchainERC20Created(superchainERC20_, _remoteToken, msg.sender);
} }
} }
...@@ -18,24 +18,24 @@ interface ICrossL2Inbox { ...@@ -18,24 +18,24 @@ interface ICrossL2Inbox {
function interopStart() external view returns (uint256 interopStart_); function interopStart() external view returns (uint256 interopStart_);
/// @notice Returns the origin address of the Identifier. /// @notice Returns the origin address of the Identifier.
/// @return _origin The origin address of the Identifier. /// @return origin_ The origin address of the Identifier.
function origin() external view returns (address _origin); function origin() external view returns (address origin_);
/// @notice Returns the block number of the Identifier. /// @notice Returns the block number of the Identifier.
/// @return _blockNumber The block number of the Identifier. /// @return blockNumber_ The block number of the Identifier.
function blockNumber() external view returns (uint256 _blockNumber); function blockNumber() external view returns (uint256 blockNumber_);
/// @notice Returns the log index of the Identifier. /// @notice Returns the log index of the Identifier.
/// @return _logIndex The log index of the Identifier. /// @return logIndex_ The log index of the Identifier.
function logIndex() external view returns (uint256 _logIndex); function logIndex() external view returns (uint256 logIndex_);
/// @notice Returns the timestamp of the Identifier. /// @notice Returns the timestamp of the Identifier.
/// @return _timestamp The timestamp of the Identifier. /// @return timestamp_ The timestamp of the Identifier.
function timestamp() external view returns (uint256 _timestamp); function timestamp() external view returns (uint256 timestamp_);
/// @notice Returns the chain ID of the Identifier. /// @notice Returns the chain ID of the Identifier.
/// @return _chainId The chain ID of the Identifier. /// @return chainId_ The chain ID of the Identifier.
function chainId() external view returns (uint256 _chainId); function chainId() external view returns (uint256 chainId_);
/// @notice Executes a cross chain message on the destination chain. /// @notice Executes a cross chain message on the destination chain.
/// @param _id An Identifier pointing to the initiating message. /// @param _id An Identifier pointing to the initiating message.
......
...@@ -18,12 +18,12 @@ interface IL2ToL2CrossDomainMessenger { ...@@ -18,12 +18,12 @@ interface IL2ToL2CrossDomainMessenger {
function messageNonce() external view returns (uint256); function messageNonce() external view returns (uint256);
/// @notice Retrieves the sender of the current cross domain message. /// @notice Retrieves the sender of the current cross domain message.
/// @return _sender Address of the sender of the current cross domain message. /// @return sender_ Address of the sender of the current cross domain message.
function crossDomainMessageSender() external view returns (address _sender); function crossDomainMessageSender() external view returns (address sender_);
/// @notice Retrieves the source of the current cross domain message. /// @notice Retrieves the source of the current cross domain message.
/// @return _source Chain ID of the source of the current cross domain message. /// @return source_ Chain ID of the source of the current cross domain message.
function crossDomainMessageSource() external view returns (uint256 _source); function crossDomainMessageSource() external view returns (uint256 source_);
/// @notice Sends a message to some target address on a destination chain. Note that if the call /// @notice Sends a message to some target address on a destination chain. Note that if the call
/// always reverts, then the message will be unrelayable, and any ETH sent will be /// always reverts, then the message will be unrelayable, and any ETH sent will be
......
...@@ -7,6 +7,6 @@ pragma solidity ^0.8.0; ...@@ -7,6 +7,6 @@ pragma solidity ^0.8.0;
interface IOptimismERC20Factory { interface IOptimismERC20Factory {
/// @notice Checks if a ERC20 token is deployed by the factory. /// @notice Checks if a ERC20 token is deployed by the factory.
/// @param _localToken The address of the ERC20 token to check the deployment. /// @param _localToken The address of the ERC20 token to check the deployment.
/// @return _remoteToken The address of the remote token if it is deployed or `address(0)` if not. /// @return remoteToken_ The address of the remote token if it is deployed or `address(0)` if not.
function deployments(address _localToken) external view returns (address _remoteToken); function deployments(address _localToken) external view returns (address remoteToken_);
} }
...@@ -57,8 +57,8 @@ contract MIPS2 is ISemver { ...@@ -57,8 +57,8 @@ contract MIPS2 is ISemver {
} }
/// @notice The semantic version of the MIPS2 contract. /// @notice The semantic version of the MIPS2 contract.
/// @custom:semver 1.0.0-beta.11 /// @custom:semver 1.0.0-beta.12
string public constant version = "1.0.0-beta.11"; string public constant version = "1.0.0-beta.12";
/// @notice The preimage oracle contract. /// @notice The preimage oracle contract.
IPreimageOracle internal immutable ORACLE; IPreimageOracle internal immutable ORACLE;
...@@ -595,11 +595,11 @@ contract MIPS2 is ISemver { ...@@ -595,11 +595,11 @@ contract MIPS2 is ISemver {
) )
internal internal
view view
returns (uint32 v0, uint32 v1) returns (uint32 v0_, uint32 v1_)
{ {
bool memUpdated; bool memUpdated;
uint32 memAddr; uint32 memAddr;
(v0, v1, _state.preimageOffset, _state.memRoot, memUpdated, memAddr) = sys.handleSysRead(_args); (v0_, v1_, _state.preimageOffset, _state.memRoot, memUpdated, memAddr) = sys.handleSysRead(_args);
if (memUpdated) { if (memUpdated) {
handleMemoryUpdate(_state, memAddr); handleMemoryUpdate(_state, memAddr);
} }
...@@ -717,7 +717,7 @@ contract MIPS2 is ISemver { ...@@ -717,7 +717,7 @@ contract MIPS2 is ISemver {
) )
internal internal
pure pure
returns (bool _changedDirections) returns (bool changedDirections_)
{ {
// pop thread from the current stack and push to the other stack // pop thread from the current stack and push to the other stack
if (_state.traverseRight) { if (_state.traverseRight) {
...@@ -732,7 +732,7 @@ contract MIPS2 is ISemver { ...@@ -732,7 +732,7 @@ contract MIPS2 is ISemver {
bytes32 current = _state.traverseRight ? _state.rightThreadStack : _state.leftThreadStack; bytes32 current = _state.traverseRight ? _state.rightThreadStack : _state.leftThreadStack;
if (current == EMPTY_THREAD_ROOT) { if (current == EMPTY_THREAD_ROOT) {
_state.traverseRight = !_state.traverseRight; _state.traverseRight = !_state.traverseRight;
_changedDirections = true; changedDirections_ = true;
} }
_state.stepsSinceLastContextSwitch = 0; _state.stepsSinceLastContextSwitch = 0;
} }
...@@ -768,10 +768,10 @@ contract MIPS2 is ISemver { ...@@ -768,10 +768,10 @@ contract MIPS2 is ISemver {
return inactiveStack == EMPTY_THREAD_ROOT && currentStackIsAlmostEmpty; return inactiveStack == EMPTY_THREAD_ROOT && currentStackIsAlmostEmpty;
} }
function computeThreadRoot(bytes32 _currentRoot, ThreadState memory _thread) internal pure returns (bytes32 _out) { function computeThreadRoot(bytes32 _currentRoot, ThreadState memory _thread) internal pure returns (bytes32 out_) {
// w_i = hash(w_0 ++ hash(thread)) // w_i = hash(w_0 ++ hash(thread))
bytes32 threadRoot = outputThreadState(_thread); bytes32 threadRoot = outputThreadState(_thread);
_out = keccak256(abi.encodePacked(_currentRoot, threadRoot)); out_ = keccak256(abi.encodePacked(_currentRoot, threadRoot));
} }
function outputThreadState(ThreadState memory _thread) internal pure returns (bytes32 out_) { function outputThreadState(ThreadState memory _thread) internal pure returns (bytes32 out_) {
......
...@@ -11,8 +11,8 @@ library MIPSState { ...@@ -11,8 +11,8 @@ library MIPSState {
uint32 hi; uint32 hi;
} }
function assertExitedIsValid(uint32 exited) internal pure { function assertExitedIsValid(uint32 _exited) internal pure {
if (exited > 1) { if (_exited > 1) {
revert InvalidExitedValue(); revert InvalidExitedValue();
} }
} }
......
...@@ -18,7 +18,7 @@ interface IAnchorStateRegistry { ...@@ -18,7 +18,7 @@ interface IAnchorStateRegistry {
event Initialized(uint8 version); event Initialized(uint8 version);
function anchors(GameType) external view returns (Hash root, uint256 l2BlockNumber); function anchors(GameType) external view returns (Hash root, uint256 l2BlockNumber); // nosemgrep
function disputeGameFactory() external view returns (IDisputeGameFactory); function disputeGameFactory() external view returns (IDisputeGameFactory);
function initialize( function initialize(
StartingAnchorRoot[] memory _startingAnchorRoots, StartingAnchorRoot[] memory _startingAnchorRoots,
......
...@@ -21,7 +21,7 @@ interface IDelayedWETH is IWETH { ...@@ -21,7 +21,7 @@ interface IDelayedWETH is IWETH {
function initialize(address _owner, ISuperchainConfig _config) external; function initialize(address _owner, ISuperchainConfig _config) external;
function owner() external view returns (address); function owner() external view returns (address);
function recover(uint256 _wad) external; function recover(uint256 _wad) external;
function transferOwnership(address newOwner) external; function transferOwnership(address newOwner) external; // nosemgrep
function renounceOwnership() external; function renounceOwnership() external;
function unlock(address _guy, uint256 _wad) external; function unlock(address _guy, uint256 _wad) external;
function withdraw(address _guy, uint256 _wad) external; function withdraw(address _guy, uint256 _wad) external;
......
...@@ -67,7 +67,7 @@ interface IDisputeGameFactory { ...@@ -67,7 +67,7 @@ interface IDisputeGameFactory {
function renounceOwnership() external; function renounceOwnership() external;
function setImplementation(GameType _gameType, IDisputeGame _impl) external; function setImplementation(GameType _gameType, IDisputeGame _impl) external;
function setInitBond(GameType _gameType, uint256 _initBond) external; function setInitBond(GameType _gameType, uint256 _initBond) external;
function transferOwnership(address newOwner) external; function transferOwnership(address newOwner) external; // nosemgrep
function version() external view returns (string memory); function version() external view returns (string memory);
function __constructor__() external; function __constructor__() external;
......
...@@ -72,7 +72,7 @@ interface IFaultDisputeGame is IDisputeGame { ...@@ -72,7 +72,7 @@ interface IFaultDisputeGame is IDisputeGame {
function claimCredit(address _recipient) external; function claimCredit(address _recipient) external;
function claimData(uint256) function claimData(uint256)
external external
view view // nosemgrep
returns ( returns (
uint32 parentIndex, uint32 parentIndex,
address counteredBy, address counteredBy,
...@@ -100,12 +100,12 @@ interface IFaultDisputeGame is IDisputeGame { ...@@ -100,12 +100,12 @@ interface IFaultDisputeGame is IDisputeGame {
function resolutionCheckpoints(uint256) function resolutionCheckpoints(uint256)
external external
view view
returns (bool initialCheckpointComplete, uint32 subgameIndex, Position leftmostPosition, address counteredBy); returns (bool initialCheckpointComplete, uint32 subgameIndex, Position leftmostPosition, address counteredBy); // nosemgrep
function resolveClaim(uint256 _claimIndex, uint256 _numToResolve) external; function resolveClaim(uint256 _claimIndex, uint256 _numToResolve) external;
function resolvedSubgames(uint256) external view returns (bool); function resolvedSubgames(uint256) external view returns (bool);
function splitDepth() external view returns (uint256 splitDepth_); function splitDepth() external view returns (uint256 splitDepth_);
function startingBlockNumber() external view returns (uint256 startingBlockNumber_); function startingBlockNumber() external view returns (uint256 startingBlockNumber_);
function startingOutputRoot() external view returns (Hash root, uint256 l2BlockNumber); function startingOutputRoot() external view returns (Hash root, uint256 l2BlockNumber); // nosemgrep
function startingRootHash() external view returns (Hash startingRootHash_); function startingRootHash() external view returns (Hash startingRootHash_);
function step(uint256 _claimIndex, bool _isAttack, bytes memory _stateData, bytes memory _proof) external; function step(uint256 _claimIndex, bool _isAttack, bytes memory _stateData, bytes memory _proof) external;
function subgames(uint256, uint256) external view returns (uint256); function subgames(uint256, uint256) external view returns (uint256);
......
...@@ -73,7 +73,7 @@ interface IPermissionedDisputeGame is IDisputeGame { ...@@ -73,7 +73,7 @@ interface IPermissionedDisputeGame is IDisputeGame {
function claimCredit(address _recipient) external; function claimCredit(address _recipient) external;
function claimData(uint256) function claimData(uint256)
external external
view view // nosemgrep
returns ( returns (
uint32 parentIndex, uint32 parentIndex,
address counteredBy, address counteredBy,
...@@ -101,12 +101,12 @@ interface IPermissionedDisputeGame is IDisputeGame { ...@@ -101,12 +101,12 @@ interface IPermissionedDisputeGame is IDisputeGame {
function resolutionCheckpoints(uint256) function resolutionCheckpoints(uint256)
external external
view view
returns (bool initialCheckpointComplete, uint32 subgameIndex, Position leftmostPosition, address counteredBy); returns (bool initialCheckpointComplete, uint32 subgameIndex, Position leftmostPosition, address counteredBy); // nosemgrep
function resolveClaim(uint256 _claimIndex, uint256 _numToResolve) external; function resolveClaim(uint256 _claimIndex, uint256 _numToResolve) external;
function resolvedSubgames(uint256) external view returns (bool); function resolvedSubgames(uint256) external view returns (bool);
function splitDepth() external view returns (uint256 splitDepth_); function splitDepth() external view returns (uint256 splitDepth_);
function startingBlockNumber() external view returns (uint256 startingBlockNumber_); function startingBlockNumber() external view returns (uint256 startingBlockNumber_);
function startingOutputRoot() external view returns (Hash root, uint256 l2BlockNumber); function startingOutputRoot() external view returns (Hash root, uint256 l2BlockNumber); // nosemgrep
function startingRootHash() external view returns (Hash startingRootHash_); function startingRootHash() external view returns (Hash startingRootHash_);
function step(uint256 _claimIndex, bool _isAttack, bytes memory _stateData, bytes memory _proof) external; function step(uint256 _claimIndex, bool _isAttack, bytes memory _stateData, bytes memory _proof) external;
function subgames(uint256, uint256) external view returns (uint256); function subgames(uint256, uint256) external view returns (uint256);
......
...@@ -14,7 +14,7 @@ interface IMintManager { ...@@ -14,7 +14,7 @@ interface IMintManager {
function mintPermittedAfter() external view returns (uint256); function mintPermittedAfter() external view returns (uint256);
function owner() external view returns (address); function owner() external view returns (address);
function renounceOwnership() external; function renounceOwnership() external;
function transferOwnership(address newOwner) external; function transferOwnership(address newOwner) external; // nosemgrep
function upgrade(address _newMintManager) external; function upgrade(address _newMintManager) external;
function __constructor__(address _upgrader, address _governanceToken) external; function __constructor__(address _upgrader, address _governanceToken) external;
......
...@@ -135,25 +135,25 @@ library Encoding { ...@@ -135,25 +135,25 @@ library Encoding {
} }
/// @notice Returns an appropriately encoded call to L1Block.setL1BlockValuesEcotone /// @notice Returns an appropriately encoded call to L1Block.setL1BlockValuesEcotone
/// @param baseFeeScalar L1 base fee Scalar /// @param _baseFeeScalar L1 base fee Scalar
/// @param blobBaseFeeScalar L1 blob base fee Scalar /// @param _blobBaseFeeScalar L1 blob base fee Scalar
/// @param sequenceNumber Number of L2 blocks since epoch start. /// @param _sequenceNumber Number of L2 blocks since epoch start.
/// @param timestamp L1 timestamp. /// @param _timestamp L1 timestamp.
/// @param number L1 blocknumber. /// @param _number L1 blocknumber.
/// @param baseFee L1 base fee. /// @param _baseFee L1 base fee.
/// @param blobBaseFee L1 blob base fee. /// @param _blobBaseFee L1 blob base fee.
/// @param hash L1 blockhash. /// @param _hash L1 blockhash.
/// @param batcherHash Versioned hash to authenticate batcher by. /// @param _batcherHash Versioned hash to authenticate batcher by.
function encodeSetL1BlockValuesEcotone( function encodeSetL1BlockValuesEcotone(
uint32 baseFeeScalar, uint32 _baseFeeScalar,
uint32 blobBaseFeeScalar, uint32 _blobBaseFeeScalar,
uint64 sequenceNumber, uint64 _sequenceNumber,
uint64 timestamp, uint64 _timestamp,
uint64 number, uint64 _number,
uint256 baseFee, uint256 _baseFee,
uint256 blobBaseFee, uint256 _blobBaseFee,
bytes32 hash, bytes32 _hash,
bytes32 batcherHash bytes32 _batcherHash
) )
internal internal
pure pure
...@@ -162,15 +162,15 @@ library Encoding { ...@@ -162,15 +162,15 @@ library Encoding {
bytes4 functionSignature = bytes4(keccak256("setL1BlockValuesEcotone()")); bytes4 functionSignature = bytes4(keccak256("setL1BlockValuesEcotone()"));
return abi.encodePacked( return abi.encodePacked(
functionSignature, functionSignature,
baseFeeScalar, _baseFeeScalar,
blobBaseFeeScalar, _blobBaseFeeScalar,
sequenceNumber, _sequenceNumber,
timestamp, _timestamp,
number, _number,
baseFee, _baseFee,
blobBaseFee, _blobBaseFee,
hash, _hash,
batcherHash _batcherHash
); );
} }
......
...@@ -25,8 +25,8 @@ contract LivenessGuard is ISemver, BaseGuard { ...@@ -25,8 +25,8 @@ contract LivenessGuard is ISemver, BaseGuard {
event OwnerRecorded(address owner); event OwnerRecorded(address owner);
/// @notice Semantic version. /// @notice Semantic version.
/// @custom:semver 1.0.1-beta.1 /// @custom:semver 1.0.1-beta.2
string public constant version = "1.0.1-beta.1"; string public constant version = "1.0.1-beta.2";
/// @notice The safe account for which this contract will be the guard. /// @notice The safe account for which this contract will be the guard.
Safe internal immutable SAFE; Safe internal immutable SAFE;
...@@ -66,21 +66,21 @@ contract LivenessGuard is ISemver, BaseGuard { ...@@ -66,21 +66,21 @@ contract LivenessGuard is ISemver, BaseGuard {
/// @notice Records the most recent time which any owner has signed a transaction. /// @notice Records the most recent time which any owner has signed a transaction.
/// @dev Called by the Safe contract before execution of a transaction. /// @dev Called by the Safe contract before execution of a transaction.
function checkTransaction( function checkTransaction(
address to, address _to,
uint256 value, uint256 _value,
bytes memory data, bytes memory _data,
Enum.Operation operation, Enum.Operation _operation,
uint256 safeTxGas, uint256 _safeTxGas,
uint256 baseGas, uint256 _baseGas,
uint256 gasPrice, uint256 _gasPrice,
address gasToken, address _gasToken,
address payable refundReceiver, address payable _refundReceiver,
bytes memory signatures, bytes memory _signatures,
address msgSender address _msgSender
) )
external external
{ {
msgSender; // silence unused variable warning _msgSender; // silence unused variable warning
_requireOnlySafe(); _requireOnlySafe();
// Cache the set of owners prior to execution. // Cache the set of owners prior to execution.
...@@ -93,21 +93,21 @@ contract LivenessGuard is ISemver, BaseGuard { ...@@ -93,21 +93,21 @@ contract LivenessGuard is ISemver, BaseGuard {
// This call will reenter to the Safe which is calling it. This is OK because it is only reading the // This call will reenter to the Safe which is calling it. This is OK because it is only reading the
// nonce, and using the getTransactionHash() method. // nonce, and using the getTransactionHash() method.
bytes32 txHash = SAFE.getTransactionHash({ bytes32 txHash = SAFE.getTransactionHash({
to: to, to: _to,
value: value, value: _value,
data: data, data: _data,
operation: operation, operation: _operation,
safeTxGas: safeTxGas, safeTxGas: _safeTxGas,
baseGas: baseGas, baseGas: _baseGas,
gasPrice: gasPrice, gasPrice: _gasPrice,
gasToken: gasToken, gasToken: _gasToken,
refundReceiver: refundReceiver, refundReceiver: _refundReceiver,
_nonce: SAFE.nonce() - 1 _nonce: SAFE.nonce() - 1
}); });
uint256 threshold = SAFE.getThreshold(); uint256 threshold = SAFE.getThreshold();
address[] memory signers = address[] memory signers =
SafeSigners.getNSigners({ dataHash: txHash, signatures: signatures, requiredSignatures: threshold }); SafeSigners.getNSigners({ _dataHash: txHash, _signatures: _signatures, _requiredSignatures: threshold });
for (uint256 i = 0; i < signers.length; i++) { for (uint256 i = 0; i < signers.length; i++) {
lastLive[signers[i]] = block.timestamp; lastLive[signers[i]] = block.timestamp;
......
...@@ -8,31 +8,31 @@ library SafeSigners { ...@@ -8,31 +8,31 @@ library SafeSigners {
/// @dev Make sure to perform a bounds check for @param pos, to avoid out of bounds access on @param signatures /// @dev Make sure to perform a bounds check for @param pos, to avoid out of bounds access on @param signatures
/// The signature format is a compact form of {bytes32 r}{bytes32 s}{uint8 v} /// The signature format is a compact form of {bytes32 r}{bytes32 s}{uint8 v}
/// Compact means uint8 is not padded to 32 bytes. /// Compact means uint8 is not padded to 32 bytes.
/// @param pos Which signature to read. /// @param _pos Which signature to read.
/// A prior bounds check of this parameter should be performed, to avoid out of bounds access. /// A prior bounds check of this parameter should be performed, to avoid out of bounds access.
/// @param signatures Concatenated {r, s, v} signatures. /// @param _signatures Concatenated {r, s, v} signatures.
/// @return v Recovery ID or Safe signature type. /// @return v_ Recovery ID or Safe signature type.
/// @return r Output value r of the signature. /// @return r_ Output value r of the signature.
/// @return s Output value s of the signature. /// @return s_ Output value s of the signature.
function signatureSplit( function signatureSplit(
bytes memory signatures, bytes memory _signatures,
uint256 pos uint256 _pos
) )
internal internal
pure pure
returns (uint8 v, bytes32 r, bytes32 s) returns (uint8 v_, bytes32 r_, bytes32 s_)
{ {
assembly { assembly {
let signaturePos := mul(0x41, pos) let signaturePos := mul(0x41, _pos)
r := mload(add(signatures, add(signaturePos, 0x20))) r_ := mload(add(_signatures, add(signaturePos, 0x20)))
s := mload(add(signatures, add(signaturePos, 0x40))) s_ := mload(add(_signatures, add(signaturePos, 0x40)))
/** /**
* Here we are loading the last 32 bytes, including 31 bytes * Here we are loading the last 32 bytes, including 31 bytes
* of 's'. There is no 'mload8' to do this. * of 's'. There is no 'mload8' to do this.
* 'byte' is not working due to the Solidity parser, so lets * 'byte' is not working due to the Solidity parser, so lets
* use the second best option, 'and' * use the second best option, 'and'
*/ */
v := and(mload(add(signatures, add(signaturePos, 0x41))), 0xff) v_ := and(mload(add(_signatures, add(signaturePos, 0x41))), 0xff)
} }
} }
...@@ -43,23 +43,23 @@ library SafeSigners { ...@@ -43,23 +43,23 @@ library SafeSigners {
/// the signatures. /// the signatures.
/// This method therefore simply extracts the addresses from the signatures. /// This method therefore simply extracts the addresses from the signatures.
function getNSigners( function getNSigners(
bytes32 dataHash, bytes32 _dataHash,
bytes memory signatures, bytes memory _signatures,
uint256 requiredSignatures uint256 _requiredSignatures
) )
internal internal
pure pure
returns (address[] memory _owners) returns (address[] memory owners_)
{ {
_owners = new address[](requiredSignatures); owners_ = new address[](_requiredSignatures);
address currentOwner; address currentOwner;
uint8 v; uint8 v;
bytes32 r; bytes32 r;
bytes32 s; bytes32 s;
uint256 i; uint256 i;
for (i = 0; i < requiredSignatures; i++) { for (i = 0; i < _requiredSignatures; i++) {
(v, r, s) = signatureSplit(signatures, i); (v, r, s) = signatureSplit(_signatures, i);
if (v == 0) { if (v == 0) {
// If v is 0 then it is a contract signature // If v is 0 then it is a contract signature
// When handling contract signatures the address of the contract is encoded into r // When handling contract signatures the address of the contract is encoded into r
...@@ -73,13 +73,13 @@ library SafeSigners { ...@@ -73,13 +73,13 @@ library SafeSigners {
// To support eth_sign and similar we adjust v and hash the messageHash with the Ethereum message prefix // To support eth_sign and similar we adjust v and hash the messageHash with the Ethereum message prefix
// before applying ecrecover // before applying ecrecover
currentOwner = currentOwner =
ecrecover(keccak256(abi.encodePacked("\x19Ethereum Signed Message:\n32", dataHash)), v - 4, r, s); ecrecover(keccak256(abi.encodePacked("\x19Ethereum Signed Message:\n32", _dataHash)), v - 4, r, s);
} else { } else {
// Default is the ecrecover flow with the provided data hash // Default is the ecrecover flow with the provided data hash
// Use ecrecover with the messageHash for EOA signatures // Use ecrecover with the messageHash for EOA signatures
currentOwner = ecrecover(dataHash, v, r, s); currentOwner = ecrecover(_dataHash, v, r, s);
} }
_owners[i] = currentOwner; owners_[i] = currentOwner;
} }
} }
} }
...@@ -16,8 +16,8 @@ contract StorageSetter is ISemver { ...@@ -16,8 +16,8 @@ contract StorageSetter is ISemver {
} }
/// @notice Semantic version. /// @notice Semantic version.
/// @custom:semver 1.2.1-beta.1 /// @custom:semver 1.2.1-beta.2
string public constant version = "1.2.1-beta.1"; string public constant version = "1.2.1-beta.2";
/// @notice Stores a bytes32 `_value` at `_slot`. Any storage slots that /// @notice Stores a bytes32 `_value` at `_slot`. Any storage slots that
/// are packed should be set through this interface. /// are packed should be set through this interface.
...@@ -26,10 +26,10 @@ contract StorageSetter is ISemver { ...@@ -26,10 +26,10 @@ contract StorageSetter is ISemver {
} }
/// @notice Stores a bytes32 value at each key in `_slots`. /// @notice Stores a bytes32 value at each key in `_slots`.
function setBytes32(Slot[] calldata slots) public { function setBytes32(Slot[] calldata _slots) public {
uint256 length = slots.length; uint256 length = _slots.length;
for (uint256 i; i < length; i++) { for (uint256 i; i < length; i++) {
Storage.setBytes32(slots[i].key, slots[i].value); Storage.setBytes32(_slots[i].key, _slots[i].value);
} }
} }
......
...@@ -8,5 +8,5 @@ interface IOwnable { ...@@ -8,5 +8,5 @@ interface IOwnable {
function owner() external view returns (address); function owner() external view returns (address);
function renounceOwnership() external; function renounceOwnership() external;
function transferOwnership(address newOwner) external; // nosemgrep: sol-style-input-arg-fmt. function transferOwnership(address newOwner) external; // nosemgrep
} }
...@@ -29,10 +29,10 @@ contract DelayedVetoable_Init is Test { ...@@ -29,10 +29,10 @@ contract DelayedVetoable_Init is Test {
delayedVetoable = IDelayedVetoable( delayedVetoable = IDelayedVetoable(
address( address(
new DelayedVetoable({ new DelayedVetoable({
initiator_: initiator, _initiator: initiator,
vetoer_: vetoer, _vetoer: vetoer,
target_: address(target), _target: address(target),
operatingDelay_: operatingDelay _operatingDelay: operatingDelay
}) })
) )
); );
......
...@@ -71,17 +71,17 @@ contract LivenessGuard_CheckTx_TestFails is LivenessGuard_TestInit { ...@@ -71,17 +71,17 @@ contract LivenessGuard_CheckTx_TestFails is LivenessGuard_TestInit {
function test_checkTransaction_callerIsNotSafe_revert() external { function test_checkTransaction_callerIsNotSafe_revert() external {
vm.expectRevert("LivenessGuard: only Safe can call this function"); vm.expectRevert("LivenessGuard: only Safe can call this function");
livenessGuard.checkTransaction({ livenessGuard.checkTransaction({
to: address(0), _to: address(0),
value: 0, _value: 0,
data: hex"00", _data: hex"00",
operation: Enum.Operation.Call, _operation: Enum.Operation.Call,
safeTxGas: 0, _safeTxGas: 0,
baseGas: 0, _baseGas: 0,
gasPrice: 0, _gasPrice: 0,
gasToken: address(0), _gasToken: address(0),
refundReceiver: payable(address(0)), _refundReceiver: payable(address(0)),
signatures: hex"00", _signatures: hex"00",
msgSender: address(0) _msgSender: address(0)
}); });
} }
} }
......
...@@ -98,7 +98,7 @@ contract SafeSigners_Test is Test, SafeTestTools { ...@@ -98,7 +98,7 @@ contract SafeSigners_Test is Test, SafeTestTools {
// Recover the signatures using the _getNSigners() method. // Recover the signatures using the _getNSigners() method.
address[] memory gotSigners = address[] memory gotSigners =
SafeSigners.getNSigners({ dataHash: digest, signatures: signatures, requiredSignatures: numSigs }); SafeSigners.getNSigners({ _dataHash: digest, _signatures: signatures, _requiredSignatures: numSigs });
// Compare the list of recovered signers to the expected signers. // Compare the list of recovered signers to the expected signers.
assertEq(gotSigners.length, numSigs); assertEq(gotSigners.length, numSigs);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment