Commit f09a411e authored by OptimismBot's avatar OptimismBot Committed by GitHub

Merge pull request #6910 from ethereum-optimism/refcell/contract-styling

chore: DisputeGameFactory Styling Touchups
parents b327c69a daede556
This diff is collapsed.
...@@ -83,7 +83,7 @@ contract DisputeGameFactory is OwnableUpgradeable, IDisputeGameFactory, Semver { ...@@ -83,7 +83,7 @@ contract DisputeGameFactory is OwnableUpgradeable, IDisputeGameFactory, Semver {
bytes calldata _extraData bytes calldata _extraData
) )
external external
returns (IDisputeGame proxy) returns (IDisputeGame proxy_)
{ {
// Grab the implementation contract for the given `GameType`. // Grab the implementation contract for the given `GameType`.
IDisputeGame impl = gameImpls[_gameType]; IDisputeGame impl = gameImpls[_gameType];
...@@ -92,8 +92,8 @@ contract DisputeGameFactory is OwnableUpgradeable, IDisputeGameFactory, Semver { ...@@ -92,8 +92,8 @@ contract DisputeGameFactory is OwnableUpgradeable, IDisputeGameFactory, Semver {
if (address(impl) == address(0)) revert NoImplementation(_gameType); if (address(impl) == address(0)) revert NoImplementation(_gameType);
// Clone the implementation contract and initialize it with the given parameters. // Clone the implementation contract and initialize it with the given parameters.
proxy = IDisputeGame(address(impl).clone(abi.encodePacked(_rootClaim, _extraData))); proxy_ = IDisputeGame(address(impl).clone(abi.encodePacked(_rootClaim, _extraData)));
proxy.initialize(); proxy_.initialize();
// Compute the unique identifier for the dispute game. // Compute the unique identifier for the dispute game.
Hash uuid = getGameUUID(_gameType, _rootClaim, _extraData); Hash uuid = getGameUUID(_gameType, _rootClaim, _extraData);
...@@ -101,12 +101,12 @@ contract DisputeGameFactory is OwnableUpgradeable, IDisputeGameFactory, Semver { ...@@ -101,12 +101,12 @@ contract DisputeGameFactory is OwnableUpgradeable, IDisputeGameFactory, Semver {
// If a dispute game with the same UUID already exists, revert. // If a dispute game with the same UUID already exists, revert.
if (GameId.unwrap(_disputeGames[uuid]) != bytes32(0)) revert GameAlreadyExists(uuid); if (GameId.unwrap(_disputeGames[uuid]) != bytes32(0)) revert GameAlreadyExists(uuid);
GameId id = LibGameId.pack(_gameType, Timestamp.wrap(uint64(block.timestamp)), proxy); GameId id = LibGameId.pack(_gameType, Timestamp.wrap(uint64(block.timestamp)), proxy_);
// Store the dispute game id in the mapping & emit the `DisputeGameCreated` event. // Store the dispute game id in the mapping & emit the `DisputeGameCreated` event.
_disputeGames[uuid] = id; _disputeGames[uuid] = id;
_disputeGameList.push(id); _disputeGameList.push(id);
emit DisputeGameCreated(address(proxy), _gameType, _rootClaim); emit DisputeGameCreated(address(proxy_), _gameType, _rootClaim);
} }
/// @inheritdoc IDisputeGameFactory /// @inheritdoc IDisputeGameFactory
...@@ -117,7 +117,7 @@ contract DisputeGameFactory is OwnableUpgradeable, IDisputeGameFactory, Semver { ...@@ -117,7 +117,7 @@ contract DisputeGameFactory is OwnableUpgradeable, IDisputeGameFactory, Semver {
) )
public public
pure pure
returns (Hash _uuid) returns (Hash uuid_)
{ {
assembly { assembly {
// Grab the offsets of the other memory locations we will need to temporarily overwrite. // Grab the offsets of the other memory locations we will need to temporarily overwrite.
...@@ -141,7 +141,7 @@ contract DisputeGameFactory is OwnableUpgradeable, IDisputeGameFactory, Semver { ...@@ -141,7 +141,7 @@ contract DisputeGameFactory is OwnableUpgradeable, IDisputeGameFactory, Semver {
let hashLen := and(add(mload(_extraData), 0x9F), not(0x1F)) let hashLen := and(add(mload(_extraData), 0x9F), not(0x1F))
// Hash the memory to produce the UUID digest // Hash the memory to produce the UUID digest
_uuid := keccak256(gameTypeOffset, hashLen) uuid_ := keccak256(gameTypeOffset, hashLen)
// Restore the memory prior to `extraData` // Restore the memory prior to `extraData`
mstore(gameTypeOffset, tempA) mstore(gameTypeOffset, tempA)
......
...@@ -26,16 +26,16 @@ interface IDisputeGameFactory { ...@@ -26,16 +26,16 @@ interface IDisputeGameFactory {
/// @notice `games` queries an internal mapping that maps the hash of /// @notice `games` queries an internal mapping that maps the hash of
/// `gameType ++ rootClaim ++ extraData` to the deployed `DisputeGame` clone. /// `gameType ++ rootClaim ++ extraData` to the deployed `DisputeGame` clone.
/// @dev `++` equates to concatenation. /// @dev `++` equates to concatenation.
/// @param gameType The type of the DisputeGame - used to decide the proxy implementation /// @param _gameType The type of the DisputeGame - used to decide the proxy implementation
/// @param rootClaim The root claim of the DisputeGame. /// @param _rootClaim The root claim of the DisputeGame.
/// @param extraData Any extra data that should be provided to the created dispute game. /// @param _extraData Any extra data that should be provided to the created dispute game.
/// @return proxy_ The clone of the `DisputeGame` created with the given parameters. /// @return proxy_ The clone of the `DisputeGame` created with the given parameters.
/// Returns `address(0)` if nonexistent. /// Returns `address(0)` if nonexistent.
/// @return timestamp_ The timestamp of the creation of the dispute game. /// @return timestamp_ The timestamp of the creation of the dispute game.
function games( function games(
GameType gameType, GameType _gameType,
Claim rootClaim, Claim _rootClaim,
bytes calldata extraData bytes calldata _extraData
) )
external external
view view
...@@ -56,9 +56,9 @@ interface IDisputeGameFactory { ...@@ -56,9 +56,9 @@ interface IDisputeGameFactory {
/// @notice `gameImpls` is a mapping that maps `GameType`s to their respective /// @notice `gameImpls` is a mapping that maps `GameType`s to their respective
/// `IDisputeGame` implementations. /// `IDisputeGame` implementations.
/// @param _gameType The type of the dispute game. /// @param _gameType The type of the dispute game.
/// @return _impl The address of the implementation of the game type. /// @return impl_ The address of the implementation of the game type.
/// Will be cloned on creation of a new dispute game with the given `gameType`. /// Will be cloned on creation of a new dispute game with the given `gameType`.
function gameImpls(GameType _gameType) external view returns (IDisputeGame _impl); function gameImpls(GameType _gameType) external view returns (IDisputeGame impl_);
/// @notice Creates a new DisputeGame proxy contract. /// @notice Creates a new DisputeGame proxy contract.
/// @param _gameType The type of the DisputeGame - used to decide the proxy implementation. /// @param _gameType The type of the DisputeGame - used to decide the proxy implementation.
...@@ -85,7 +85,7 @@ interface IDisputeGameFactory { ...@@ -85,7 +85,7 @@ interface IDisputeGameFactory {
/// @param _gameType The type of the DisputeGame. /// @param _gameType The type of the DisputeGame.
/// @param _rootClaim The root claim of the DisputeGame. /// @param _rootClaim The root claim of the DisputeGame.
/// @param _extraData Any extra data that should be provided to the created dispute game. /// @param _extraData Any extra data that should be provided to the created dispute game.
/// @return _uuid The unique identifier for the given dispute game parameters. /// @return uuid_ The unique identifier for the given dispute game parameters.
function getGameUUID( function getGameUUID(
GameType _gameType, GameType _gameType,
Claim _rootClaim, Claim _rootClaim,
...@@ -93,5 +93,5 @@ interface IDisputeGameFactory { ...@@ -93,5 +93,5 @@ interface IDisputeGameFactory {
) )
external external
pure pure
returns (Hash _uuid); returns (Hash uuid_);
} }
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