Commit b35f0936 authored by Mark Tyneway's avatar Mark Tyneway Committed by Maurelian

contracts-bedrock: more

parent 1e159c7e
......@@ -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(),
......
......@@ -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
......
......@@ -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.
......
......@@ -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());
}
}
......@@ -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:
......
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