Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
N
nebula
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
exchain
nebula
Commits
5bce421e
Unverified
Commit
5bce421e
authored
May 23, 2023
by
OptimismBot
Committed by
GitHub
May 23, 2023
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #5761 from ethereum-optimism/fix/factory-type-events
contracts-bedrock: dispute game factory event
parents
81e467bc
5bd5acd2
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
14 additions
and
1 deletion
+14
-1
.gas-snapshot
packages/contracts-bedrock/.gas-snapshot
+1
-1
DisputeGameFactory.sol
...ontracts-bedrock/contracts/dispute/DisputeGameFactory.sol
+1
-0
IDisputeGameFactory.sol
...ntracts-bedrock/contracts/dispute/IDisputeGameFactory.sol
+7
-0
DisputeGameFactory.t.sol
...contracts-bedrock/contracts/test/DisputeGameFactory.t.sol
+5
-0
No files found.
packages/contracts-bedrock/.gas-snapshot
View file @
5bce421e
...
@@ -29,7 +29,7 @@ DeployerWhitelist_Test:test_owner_succeeds() (gas: 7582)
...
@@ -29,7 +29,7 @@ DeployerWhitelist_Test:test_owner_succeeds() (gas: 7582)
DeployerWhitelist_Test:test_storageSlots_succeeds() (gas: 33395)
DeployerWhitelist_Test:test_storageSlots_succeeds() (gas: 33395)
DisputeGameFactory_Test:test_owner_succeeds() (gas: 7582)
DisputeGameFactory_Test:test_owner_succeeds() (gas: 7582)
DisputeGameFactory_Test:test_setImplementation_notOwner_reverts() (gas: 11191)
DisputeGameFactory_Test:test_setImplementation_notOwner_reverts() (gas: 11191)
DisputeGameFactory_Test:test_setImplementation_succeeds() (gas: 3
263
5)
DisputeGameFactory_Test:test_setImplementation_succeeds() (gas: 3
876
5)
DisputeGameFactory_Test:test_transferOwnership_notOwner_reverts() (gas: 10979)
DisputeGameFactory_Test:test_transferOwnership_notOwner_reverts() (gas: 10979)
DisputeGameFactory_Test:test_transferOwnership_succeeds() (gas: 13180)
DisputeGameFactory_Test:test_transferOwnership_succeeds() (gas: 13180)
FeeVault_Test:test_constructor_succeeds() (gas: 10736)
FeeVault_Test:test_constructor_succeeds() (gas: 10736)
...
...
packages/contracts-bedrock/contracts/dispute/DisputeGameFactory.sol
View file @
5bce421e
...
@@ -113,6 +113,7 @@ contract DisputeGameFactory is Ownable, IDisputeGameFactory {
...
@@ -113,6 +113,7 @@ contract DisputeGameFactory is Ownable, IDisputeGameFactory {
*/
*/
function setImplementation(GameType gameType, IDisputeGame impl) external onlyOwner {
function setImplementation(GameType gameType, IDisputeGame impl) external onlyOwner {
gameImpls[gameType] = impl;
gameImpls[gameType] = impl;
emit ImplementationSet(address(impl), gameType);
}
}
/**
/**
...
...
packages/contracts-bedrock/contracts/dispute/IDisputeGameFactory.sol
View file @
5bce421e
...
@@ -23,6 +23,13 @@ interface IDisputeGameFactory {
...
@@ -23,6 +23,13 @@ interface IDisputeGameFactory {
Claim indexed rootClaim
Claim indexed rootClaim
);
);
/**
* @notice Emitted when a new game implementation added to the factory
* @param impl The implementation contract for the given `GameType`.
* @param gameType The type of the DisputeGame.
*/
event ImplementationSet(address indexed impl, GameType indexed gameType);
/**
/**
* @notice `games` queries an internal a mapping that maps the hash of
* @notice `games` queries an internal a mapping that maps the hash of
* `gameType ++ rootClaim ++ extraData` to the deployed `DisputeGame` clone.
* `gameType ++ rootClaim ++ extraData` to the deployed `DisputeGame` clone.
...
...
packages/contracts-bedrock/contracts/test/DisputeGameFactory.t.sol
View file @
5bce421e
...
@@ -18,6 +18,8 @@ contract DisputeGameFactory_Test is Test {
...
@@ -18,6 +18,8 @@ contract DisputeGameFactory_Test is Test {
Claim indexed rootClaim
Claim indexed rootClaim
);
);
event ImplementationSet(address indexed impl, GameType indexed gameType);
function setUp() public {
function setUp() public {
factory = new DisputeGameFactory(address(this));
factory = new DisputeGameFactory(address(this));
fakeClone = new FakeClone();
fakeClone = new FakeClone();
...
@@ -105,6 +107,9 @@ contract DisputeGameFactory_Test is Test {
...
@@ -105,6 +107,9 @@ contract DisputeGameFactory_Test is Test {
// There should be no implementation for the `GameType.FAULT` enum value, it has not been set.
// There should be no implementation for the `GameType.FAULT` enum value, it has not been set.
assertEq(address(factory.gameImpls(GameType.FAULT)), address(0));
assertEq(address(factory.gameImpls(GameType.FAULT)), address(0));
vm.expectEmit(true, true, true, true, address(factory));
emit ImplementationSet(address(1), GameType.FAULT);
// Set the implementation for the `GameType.FAULT` enum value.
// Set the implementation for the `GameType.FAULT` enum value.
factory.setImplementation(GameType.FAULT, IDisputeGame(address(1)));
factory.setImplementation(GameType.FAULT, IDisputeGame(address(1)));
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment