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
b35f0936
Unverified
Commit
b35f0936
authored
Dec 01, 2023
by
Mark Tyneway
Committed by
Maurelian
Dec 05, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
contracts-bedrock: more
parent
1e159c7e
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
35 additions
and
7 deletions
+35
-7
config.go
op-chain-ops/genesis/config.go
+4
-0
ChainAssertions.sol
packages/contracts-bedrock/scripts/ChainAssertions.sol
+6
-1
L2ERC721Bridge.sol
packages/contracts-bedrock/src/L2/L2ERC721Bridge.sol
+7
-1
ExtendedPause.t.sol
packages/contracts-bedrock/test/ExtendedPause.t.sol
+2
-5
Initializable.t.sol
packages/contracts-bedrock/test/vendor/Initializable.t.sol
+16
-0
No files found.
op-chain-ops/genesis/config.go
View file @
b35f0936
...
...
@@ -834,6 +834,10 @@ func NewL2StorageConfig(config *DeployConfig, block *types.Block) (state.Storage
"_initialized"
:
1
,
"_initializing"
:
false
,
}
storage
[
"L2ERC721Bridge"
]
=
state
.
StorageValues
{
"_initialized"
:
1
,
"_initializing"
:
false
,
}
storage
[
"L1Block"
]
=
state
.
StorageValues
{
"number"
:
block
.
Number
(),
"timestamp"
:
block
.
Time
(),
...
...
packages/contracts-bedrock/scripts/ChainAssertions.sol
View file @
b35f0936
...
...
@@ -137,12 +137,17 @@ library ChainAssertions {
}
/// @notice Asserts that the L1ERC721Bridge is setup correctly
function checkL1ERC721Bridge(Types.ContractSet memory _contracts) internal view {
function checkL1ERC721Bridge(Types.ContractSet memory _contracts
, bool _isProxy
) internal view {
L1ERC721Bridge bridge = L1ERC721Bridge(_contracts.L1ERC721Bridge);
require(address(bridge.MESSENGER()) == _contracts.L1CrossDomainMessenger);
require(address(bridge.messenger()) == _contracts.L1CrossDomainMessenger);
require(bridge.OTHER_BRIDGE() == Predeploys.L2_ERC721_BRIDGE);
require(bridge.otherBridge() == Predeploys.L2_ERC721_BRIDGE);
if (_isProxy) {
require(address(bridge.superChainConfig()) == _contracts.SuperchainConfig);
} else {
require(address(bridge.superChainConfig()) == address(0));
}
}
/// @notice Asserts the OptimismPortal is setup correctly
...
...
packages/contracts-bedrock/src/L2/L2ERC721Bridge.sol
View file @
b35f0936
...
...
@@ -26,7 +26,13 @@ contract L2ERC721Bridge is ERC721Bridge, ISemver {
/// @notice Constructs the L2ERC721Bridge contract.
/// @param _messenger Address of the CrossDomainMessenger on this network.
/// @param _otherBridge Address of the ERC721 bridge on the other network.
constructor(address _messenger, address _otherBridge) ERC721Bridge(_messenger, _otherBridge) { }
constructor(address _messenger, address _otherBridge) ERC721Bridge(_messenger, _otherBridge) {
initialize();
}
/// @notice Initializes the contract. This is a noop in the implementation but included to ensure that
/// the contract cannot be initialized a second time.
function initialize() public initializer { }
/// @notice Completes an ERC721 bridge from the other domain and sends the ERC721 token to the
/// recipient on this domain.
...
...
packages/contracts-bedrock/test/ExtendedPause.t.sol
View file @
b35f0936
...
...
@@ -21,10 +21,7 @@ contract ExtendedPause_Test is CommonTest {
assertTrue(l1StandardBridge.paused());
assertEq(l1StandardBridge.paused(), superchainConfig.paused());
try SuperchainConfig(address(l1ERC721Bridge)).paused() {
revert("The L1ERC721Bridge has a paused() function, but is not tested as part of the ExtendedPause");
} catch (bytes memory) {
assertTrue(true);
}
assertTrue(l1ERC721Bridge.paused());
assertEq(l1ERC721Bridge.paused(), superchainConfig.paused());
}
}
packages/contracts-bedrock/test/vendor/Initializable.t.sol
View file @
b35f0936
...
...
@@ -119,6 +119,22 @@ contract Initializer_Test is Bridge_Initializer {
initializedSlotVal: deploy.loadInitializedSlot("L2CrossDomainMessenger", false)
})
);
// L1ERC721Bridge
contracts.push(
InitializeableContract({
target: address(l1ERC721Bridge),
initCalldata: abi.encodeCall(l1ERC721Bridge.initialize, (superchainConfig)),
initializedSlotVal: deploy.loadInitializedSlot("L1ERC721Bridge", true)
})
);
// L2ERC721Bridge
contracts.push(
InitializeableContract({
target: address(l2ERC721Bridge),
initCalldata: abi.encodeCall(l2ERC721Bridge.initialize, ()),
initializedSlotVal: deploy.loadInitializedSlot("L2ERC721Bridge", false)
})
);
}
/// @notice Tests that:
...
...
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