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
ef9eba97
Commit
ef9eba97
authored
Aug 02, 2023
by
Mark Tyneway
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
contracts-bedrock: fixup
parent
d9d3c738
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
27 additions
and
15 deletions
+27
-15
Deploy.s.sol
packages/contracts-bedrock/scripts/Deploy.s.sol
+1
-1
semver-lock.json
packages/contracts-bedrock/semver-lock.json
+2
-2
L1ERC721Bridge.sol
packages/contracts-bedrock/src/L1/L1ERC721Bridge.sol
+1
-1
L2ERC721Bridge.sol
packages/contracts-bedrock/src/L2/L2ERC721Bridge.sol
+1
-1
ERC721Bridge.sol
packages/contracts-bedrock/src/universal/ERC721Bridge.sol
+22
-10
No files found.
packages/contracts-bedrock/scripts/Deploy.s.sol
View file @
ef9eba97
...
...
@@ -574,7 +574,7 @@ contract Deploy is Deployer {
_implementation: l1ERC721Bridge,
_data: abi.encodeCall(
L1ERC721Bridge.initialize,
(CrossDomainMessenger(l1CrossDomainMessengerProxy))
(
L1
CrossDomainMessenger(l1CrossDomainMessengerProxy))
)
});
...
...
packages/contracts-bedrock/semver-lock.json
View file @
ef9eba97
{
"src/L1/L1CrossDomainMessenger.sol"
:
"0x2b276f14475869cfd81868b03dc72b91dd726a787c9568caf4849fe34830b207"
,
"src/L1/L1ERC721Bridge.sol"
:
"0x
ac9d8e236a1b35c358f9800834f65375cf4270155e817cf3d0f2bac1968f9107
"
,
"src/L1/L1ERC721Bridge.sol"
:
"0x
73de5c7f4a8064c134b4651480d83dbaa0768feb083bcd7602411c1efd2b07d5
"
,
"src/L1/L1StandardBridge.sol"
:
"0xa35dc0ab143043063c3bff73c8b065e401c23296a2017258ce8a87f4a4da9416"
,
"src/L1/L2OutputOracle.sol"
:
"0x8f32ccb4c5cb63a459a0e79ee412177dc03fd279fdaaf1dac69e8c714902e857"
,
"src/L1/OptimismPortal.sol"
:
"0xeaa47a63e8a3bcfdb7dfd3e6c8608369e34e362d9de82f3acf13cbc27c070bf7"
,
...
...
@@ -10,7 +10,7 @@
"src/L2/L1Block.sol"
:
"0x7fbfc8b4da630386636c665570321fdec287b0867dbe0f91c2e7cd5b7697c220"
,
"src/L2/L1FeeVault.sol"
:
"0x62bfe739ff939fc68f90916399ac4160936d31eb37749cb014dd9d0c5dd4183a"
,
"src/L2/L2CrossDomainMessenger.sol"
:
"0xc9641981f7aa79f44b5925100027098d8f76c6178c65aca99fafa859289182be"
,
"src/L2/L2ERC721Bridge.sol"
:
"0x
2b30a48241787580918a6ce4263823c036a21bde9cd80cc38d9beb6626c4f93b
"
,
"src/L2/L2ERC721Bridge.sol"
:
"0x
edae9ef45b0742a7f488ebcc9d30550aca79624597cd452facc480ff63e100a7
"
,
"src/L2/L2StandardBridge.sol"
:
"0x67e202bc6751807b20a98b88b0b65bdff30420bf1e71f2c1c7948de448cfcdc0"
,
"src/L2/L2ToL1MessagePasser.sol"
:
"0xed800b600cb3f67e18a1ab10750e3934a8b3e42178f422bcacfde770a6e8e8bd"
,
"src/L2/SequencerFeeVault.sol"
:
"0xd57c143b1f042400430b991b806bf971628e6980406c751e82d19ae80eeb4e8d"
,
...
...
packages/contracts-bedrock/src/L1/L1ERC721Bridge.sol
View file @
ef9eba97
...
...
@@ -100,7 +100,7 @@ contract L1ERC721Bridge is ERC721Bridge, Semver {
IERC721(_localToken).transferFrom(_from, address(this), _tokenId);
// Send calldata into L2
MESSENGER.sendMessage(
OTHER_BRIDGE, message, _minGasLimit);
_MESSENGER.sendMessage(_
OTHER_BRIDGE, message, _minGasLimit);
emit ERC721BridgeInitiated(_localToken, _remoteToken, _from, _to, _tokenId, _extraData);
}
}
packages/contracts-bedrock/src/L2/L2ERC721Bridge.sol
View file @
ef9eba97
...
...
@@ -119,7 +119,7 @@ contract L2ERC721Bridge is ERC721Bridge, Semver {
// Send message to L1 bridge
// slither-disable-next-line reentrancy-events
MESSENGER.sendMessage(
OTHER_BRIDGE, message, _minGasLimit);
_MESSENGER.sendMessage(_
OTHER_BRIDGE, message, _minGasLimit);
// slither-disable-next-line reentrancy-events
emit ERC721BridgeInitiated(_localToken, remoteToken, _from, _to, _tokenId, _extraData);
...
...
packages/contracts-bedrock/src/universal/ERC721Bridge.sol
View file @
ef9eba97
...
...
@@ -9,10 +9,11 @@ import { Initializable } from "@openzeppelin/contracts/proxy/utils/Initializable
/// @notice ERC721Bridge is a base contract for the L1 and L2 ERC721 bridges.
abstract contract ERC721Bridge is Initializable {
/// @notice Messenger contract on this domain.
CrossDomainMessenger public MESSENGER;
/// @custom:network-specific
CrossDomainMessenger internal _MESSENGER;
/// @notice Address of the bridge on the other network.
address
public immutable
OTHER_BRIDGE;
address
internal _
OTHER_BRIDGE;
/// @notice Reserve extra slots (to a total of 50) in the storage layout for future upgrades.
uint256[48] private __gap;
...
...
@@ -52,7 +53,7 @@ abstract contract ERC721Bridge is Initializable {
/// @notice Ensures that the caller is a cross-chain message from the other bridge.
modifier onlyOtherBridge() {
require(
msg.sender == address(
MESSENGER) && MESSENGER.xDomainMessageSender() ==
OTHER_BRIDGE,
msg.sender == address(
_MESSENGER) && _MESSENGER.xDomainMessageSender() == _
OTHER_BRIDGE,
"ERC721Bridge: function can only be called from the other bridge"
);
_;
...
...
@@ -62,27 +63,38 @@ abstract contract ERC721Bridge is Initializable {
/// @param _otherBridge Address of the ERC721 bridge on the other network.
constructor(address _otherBridge) {
require(_otherBridge != address(0), "ERC721Bridge: other bridge cannot be address(0)");
OTHER_BRIDGE = _otherBridge;
_
OTHER_BRIDGE = _otherBridge;
}
// @notice Initializes the contract.
/// @param _messenger Address of the CrossDomainMessenger on this network.
function __ERC721Bridge_init(CrossDomainMessenger _messenger) internal onlyInitializing {
MESSENGER = _messenger;
_
MESSENGER = _messenger;
}
/// @custom:legacy
/// @notice Legacy getter for messenger contract.
/// @notice Getter for messenger contract.
/// @return Messenger contract on this domain.
function messenger() external view returns (CrossDomainMessenger) {
return MESSENGER;
return
_
MESSENGER;
}
/// @custom:legacy
/// @notice Legacy getter for other bridge address.
/// @notice Getter for messenger contract.
function MESSENGER() external view returns (CrossDomainMessenger) {
return _MESSENGER;
}
/// @notice Getter for other bridge address.
/// @return Address of the bridge on the other network.
function otherBridge() external view returns (address) {
return OTHER_BRIDGE;
return _OTHER_BRIDGE;
}
/// @custom:legacy
/// @notice Getter for other bridge address.
/// @return Address of the bridge on the other network.
function OTHER_BRIDGE() external view returns (address) {
return _OTHER_BRIDGE;
}
/// @notice Initiates a bridge of an NFT to the caller's account on the other chain. Note 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