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
d58b0a39
Unverified
Commit
d58b0a39
authored
Nov 01, 2022
by
Kelvin Fichter
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix(ctb): clear remaining lint warnings
Clears remaining contracts-bedrock lint warnings.
parent
c1ebc959
Changes
14
Show whitespace changes
Inline
Side-by-side
Showing
14 changed files
with
71 additions
and
73 deletions
+71
-73
large-actors-leave.md
.changeset/large-actors-leave.md
+5
-0
l2erc721bridge_more.go
op-bindings/bindings/l2erc721bridge_more.go
+1
-1
optimismmintableerc721factory_more.go
op-bindings/bindings/optimismmintableerc721factory_more.go
+1
-1
.solhint.json
packages/contracts-bedrock/.solhint.json
+1
-0
L2OutputOracle.sol
packages/contracts-bedrock/contracts/L1/L2OutputOracle.sol
+1
-5
OptimismPortal.sol
packages/contracts-bedrock/contracts/L1/OptimismPortal.sol
+1
-2
BaseSystemDictator.sol
...racts-bedrock/contracts/deployment/BaseSystemDictator.sol
+8
-8
MigrationSystemDictator.sol
...-bedrock/contracts/deployment/MigrationSystemDictator.sol
+1
-1
PortalSender.sol
...s/contracts-bedrock/contracts/deployment/PortalSender.sol
+1
-1
ERC721Bridge.sol
...es/contracts-bedrock/contracts/universal/ERC721Bridge.sol
+15
-15
IOptimismMintableERC721.sol
...s-bedrock/contracts/universal/IOptimismMintableERC721.sol
+15
-15
OptimismMintableERC721.sol
...ts-bedrock/contracts/universal/OptimismMintableERC721.sol
+8
-8
OptimismMintableERC721Factory.sol
...ock/contracts/universal/OptimismMintableERC721Factory.sol
+13
-13
Semver.sol
packages/contracts-bedrock/contracts/universal/Semver.sol
+0
-3
No files found.
.changeset/large-actors-leave.md
0 → 100644
View file @
d58b0a39
---
'
@eth-optimism/contracts-bedrock'
:
patch
---
Cleans up remaining lint warnings
op-bindings/bindings/l2erc721bridge_more.go
View file @
d58b0a39
...
@@ -9,7 +9,7 @@ import (
...
@@ -9,7 +9,7 @@ import (
"github.com/ethereum-optimism/optimism/op-bindings/solc"
"github.com/ethereum-optimism/optimism/op-bindings/solc"
)
)
const
L2ERC721BridgeStorageLayoutJSON
=
"{
\"
storage
\"
:[{
\"
astId
\"
:262
6
1,
\"
contract
\"
:
\"
contracts/L2/L2ERC721Bridge.sol:L2ERC721Bridge
\"
,
\"
label
\"
:
\"
__gap
\"
,
\"
offset
\"
:0,
\"
slot
\"
:
\"
0
\"
,
\"
type
\"
:
\"
t_array(t_uint256)49_storage
\"
}],
\"
types
\"
:{
\"
t_array(t_uint256)49_storage
\"
:{
\"
encoding
\"
:
\"
inplace
\"
,
\"
label
\"
:
\"
uint256[49]
\"
,
\"
numberOfBytes
\"
:
\"
1568
\"
},
\"
t_uint256
\"
:{
\"
encoding
\"
:
\"
inplace
\"
,
\"
label
\"
:
\"
uint256
\"
,
\"
numberOfBytes
\"
:
\"
32
\"
}}}"
const
L2ERC721BridgeStorageLayoutJSON
=
"{
\"
storage
\"
:[{
\"
astId
\"
:262
3
1,
\"
contract
\"
:
\"
contracts/L2/L2ERC721Bridge.sol:L2ERC721Bridge
\"
,
\"
label
\"
:
\"
__gap
\"
,
\"
offset
\"
:0,
\"
slot
\"
:
\"
0
\"
,
\"
type
\"
:
\"
t_array(t_uint256)49_storage
\"
}],
\"
types
\"
:{
\"
t_array(t_uint256)49_storage
\"
:{
\"
encoding
\"
:
\"
inplace
\"
,
\"
label
\"
:
\"
uint256[49]
\"
,
\"
numberOfBytes
\"
:
\"
1568
\"
},
\"
t_uint256
\"
:{
\"
encoding
\"
:
\"
inplace
\"
,
\"
label
\"
:
\"
uint256
\"
,
\"
numberOfBytes
\"
:
\"
32
\"
}}}"
var
L2ERC721BridgeStorageLayout
=
new
(
solc
.
StorageLayout
)
var
L2ERC721BridgeStorageLayout
=
new
(
solc
.
StorageLayout
)
...
...
op-bindings/bindings/optimismmintableerc721factory_more.go
View file @
d58b0a39
...
@@ -9,7 +9,7 @@ import (
...
@@ -9,7 +9,7 @@ import (
"github.com/ethereum-optimism/optimism/op-bindings/solc"
"github.com/ethereum-optimism/optimism/op-bindings/solc"
)
)
const
OptimismMintableERC721FactoryStorageLayoutJSON
=
"{
\"
storage
\"
:[{
\"
astId
\"
:270
13
,
\"
contract
\"
:
\"
contracts/universal/OptimismMintableERC721Factory.sol:OptimismMintableERC721Factory
\"
,
\"
label
\"
:
\"
isOptimismMintableERC721
\"
,
\"
offset
\"
:0,
\"
slot
\"
:
\"
0
\"
,
\"
type
\"
:
\"
t_mapping(t_address,t_bool)
\"
}],
\"
types
\"
:{
\"
t_address
\"
:{
\"
encoding
\"
:
\"
inplace
\"
,
\"
label
\"
:
\"
address
\"
,
\"
numberOfBytes
\"
:
\"
20
\"
},
\"
t_bool
\"
:{
\"
encoding
\"
:
\"
inplace
\"
,
\"
label
\"
:
\"
bool
\"
,
\"
numberOfBytes
\"
:
\"
1
\"
},
\"
t_mapping(t_address,t_bool)
\"
:{
\"
encoding
\"
:
\"
mapping
\"
,
\"
label
\"
:
\"
mapping(address =
\u003e
bool)
\"
,
\"
numberOfBytes
\"
:
\"
32
\"
,
\"
key
\"
:
\"
t_address
\"
,
\"
value
\"
:
\"
t_bool
\"
}}}"
const
OptimismMintableERC721FactoryStorageLayoutJSON
=
"{
\"
storage
\"
:[{
\"
astId
\"
:270
04
,
\"
contract
\"
:
\"
contracts/universal/OptimismMintableERC721Factory.sol:OptimismMintableERC721Factory
\"
,
\"
label
\"
:
\"
isOptimismMintableERC721
\"
,
\"
offset
\"
:0,
\"
slot
\"
:
\"
0
\"
,
\"
type
\"
:
\"
t_mapping(t_address,t_bool)
\"
}],
\"
types
\"
:{
\"
t_address
\"
:{
\"
encoding
\"
:
\"
inplace
\"
,
\"
label
\"
:
\"
address
\"
,
\"
numberOfBytes
\"
:
\"
20
\"
},
\"
t_bool
\"
:{
\"
encoding
\"
:
\"
inplace
\"
,
\"
label
\"
:
\"
bool
\"
,
\"
numberOfBytes
\"
:
\"
1
\"
},
\"
t_mapping(t_address,t_bool)
\"
:{
\"
encoding
\"
:
\"
mapping
\"
,
\"
label
\"
:
\"
mapping(address =
\u003e
bool)
\"
,
\"
numberOfBytes
\"
:
\"
32
\"
,
\"
key
\"
:
\"
t_address
\"
,
\"
value
\"
:
\"
t_bool
\"
}}}"
var
OptimismMintableERC721FactoryStorageLayout
=
new
(
solc
.
StorageLayout
)
var
OptimismMintableERC721FactoryStorageLayout
=
new
(
solc
.
StorageLayout
)
...
...
packages/contracts-bedrock/.solhint.json
View file @
d58b0a39
...
@@ -16,6 +16,7 @@
...
@@ -16,6 +16,7 @@
"event-name-camelcase"
:
"off"
,
"event-name-camelcase"
:
"off"
,
"reason-string"
:
"off"
,
"reason-string"
:
"off"
,
"avoid-tx-origin"
:
"off"
,
"avoid-tx-origin"
:
"off"
,
"var-name-mixedcase"
:
"off"
,
"func-visibility"
:
[
"warn"
,
{
"ignoreConstructors"
:
true
}]
"func-visibility"
:
[
"warn"
,
{
"ignoreConstructors"
:
true
}]
}
}
}
}
packages/contracts-bedrock/contracts/L1/L2OutputOracle.sol
View file @
d58b0a39
...
@@ -19,31 +19,26 @@ contract L2OutputOracle is OwnableUpgradeable, Semver {
...
@@ -19,31 +19,26 @@ contract L2OutputOracle is OwnableUpgradeable, Semver {
/**
/**
* @notice The interval in L2 blocks at which checkpoints must be submitted.
* @notice The interval in L2 blocks at which checkpoints must be submitted.
*/
*/
// solhint-disable-next-line var-name-mixedcase
uint256 public immutable SUBMISSION_INTERVAL;
uint256 public immutable SUBMISSION_INTERVAL;
/**
/**
* @notice The number of blocks in the chain before the first block in this contract.
* @notice The number of blocks in the chain before the first block in this contract.
*/
*/
// solhint-disable-next-line var-name-mixedcase
uint256 public immutable HISTORICAL_TOTAL_BLOCKS;
uint256 public immutable HISTORICAL_TOTAL_BLOCKS;
/**
/**
* @notice The number of the first L2 block recorded in this contract.
* @notice The number of the first L2 block recorded in this contract.
*/
*/
// solhint-disable-next-line var-name-mixedcase
uint256 public immutable STARTING_BLOCK_NUMBER;
uint256 public immutable STARTING_BLOCK_NUMBER;
/**
/**
* @notice The timestamp of the first L2 block recorded in this contract.
* @notice The timestamp of the first L2 block recorded in this contract.
*/
*/
// solhint-disable-next-line var-name-mixedcase
uint256 public immutable STARTING_TIMESTAMP;
uint256 public immutable STARTING_TIMESTAMP;
/**
/**
* @notice The time between L2 blocks in seconds.
* @notice The time between L2 blocks in seconds.
*/
*/
// solhint-disable-next-line var-name-mixedcase
uint256 public immutable L2_BLOCK_TIME;
uint256 public immutable L2_BLOCK_TIME;
/**
/**
...
@@ -170,6 +165,7 @@ contract L2OutputOracle is OwnableUpgradeable, Semver {
...
@@ -170,6 +165,7 @@ contract L2OutputOracle is OwnableUpgradeable, Semver {
*
*
* @param _proposal Represents the output proposal to delete
* @param _proposal Represents the output proposal to delete
*/
*/
// solhint-disable-next-line ordering
function deleteL2Output(Types.OutputProposal memory _proposal) external onlyOwner {
function deleteL2Output(Types.OutputProposal memory _proposal) external onlyOwner {
Types.OutputProposal memory outputToDelete = l2Outputs[latestBlockNumber];
Types.OutputProposal memory outputToDelete = l2Outputs[latestBlockNumber];
...
...
packages/contracts-bedrock/contracts/L1/OptimismPortal.sol
View file @
d58b0a39
...
@@ -32,13 +32,11 @@ contract OptimismPortal is Initializable, ResourceMetering, Semver {
...
@@ -32,13 +32,11 @@ contract OptimismPortal is Initializable, ResourceMetering, Semver {
/**
/**
* @notice Minimum time (in seconds) that must elapse before a withdrawal can be finalized.
* @notice Minimum time (in seconds) that must elapse before a withdrawal can be finalized.
*/
*/
// solhint-disable-next-line var-name-mixedcase
uint256 public immutable FINALIZATION_PERIOD_SECONDS;
uint256 public immutable FINALIZATION_PERIOD_SECONDS;
/**
/**
* @notice Address of the L2OutputOracle.
* @notice Address of the L2OutputOracle.
*/
*/
// solhint-disable-next-line var-name-mixedcase
L2OutputOracle public immutable L2_ORACLE;
L2OutputOracle public immutable L2_ORACLE;
/**
/**
...
@@ -113,6 +111,7 @@ contract OptimismPortal is Initializable, ResourceMetering, Semver {
...
@@ -113,6 +111,7 @@ contract OptimismPortal is Initializable, ResourceMetering, Semver {
* function for EOAs. Contracts should call the depositTransaction() function directly
* function for EOAs. Contracts should call the depositTransaction() function directly
* otherwise any deposited funds will be lost due to address aliasing.
* otherwise any deposited funds will be lost due to address aliasing.
*/
*/
// solhint-disable-next-line ordering
receive() external payable {
receive() external payable {
depositTransaction(msg.sender, msg.value, RECEIVE_DEFAULT_GAS_LIMIT, false, bytes(""));
depositTransaction(msg.sender, msg.value, RECEIVE_DEFAULT_GAS_LIMIT, false, bytes(""));
}
}
...
...
packages/contracts-bedrock/contracts/deployment/BaseSystemDictator.sol
View file @
d58b0a39
...
@@ -19,14 +19,6 @@ contract BaseSystemDictator is Ownable {
...
@@ -19,14 +19,6 @@ contract BaseSystemDictator is Ownable {
*/
*/
uint256 public currentStep = 1;
uint256 public currentStep = 1;
/**
* @param _config System configuration.
*/
constructor(SystemConfig memory _config) Ownable() {
config = _config;
_transferOwnership(config.globalConfig.controller);
}
/**
/**
* @notice Checks that the current step is the expected step, then bumps the current step.
* @notice Checks that the current step is the expected step, then bumps the current step.
*
*
...
@@ -37,4 +29,12 @@ contract BaseSystemDictator is Ownable {
...
@@ -37,4 +29,12 @@ contract BaseSystemDictator is Ownable {
_;
_;
currentStep++;
currentStep++;
}
}
/**
* @param _config System configuration.
*/
constructor(SystemConfig memory _config) Ownable() {
config = _config;
_transferOwnership(config.globalConfig.controller);
}
}
}
packages/contracts-bedrock/contracts/deployment/MigrationSystemDictator.sol
View file @
d58b0a39
...
@@ -134,7 +134,7 @@ contract MigrationSystemDictator is BaseSystemDictator {
...
@@ -134,7 +134,7 @@ contract MigrationSystemDictator is BaseSystemDictator {
config.globalConfig.proxyAdmin.upgradeAndCall(
config.globalConfig.proxyAdmin.upgradeAndCall(
payable(config.proxyAddressConfig.l1StandardBridgeProxy),
payable(config.proxyAddressConfig.l1StandardBridgeProxy),
address(config.implementationAddressConfig.portalSenderImpl),
address(config.implementationAddressConfig.portalSenderImpl),
abi.encodeCall(PortalSender.
send
, ())
abi.encodeCall(PortalSender.
donate
, ())
);
);
// Upgrade the L1StandardBridge (no initializer).
// Upgrade the L1StandardBridge (no initializer).
...
...
packages/contracts-bedrock/contracts/deployment/PortalSender.sol
View file @
d58b0a39
...
@@ -24,7 +24,7 @@ contract PortalSender {
...
@@ -24,7 +24,7 @@ contract PortalSender {
/**
/**
* @notice Sends balance of this contract to the OptimismPortal.
* @notice Sends balance of this contract to the OptimismPortal.
*/
*/
function
send
() public {
function
donate
() public {
portal.donateETH{ value: address(this).balance }();
portal.donateETH{ value: address(this).balance }();
}
}
}
}
packages/contracts-bedrock/contracts/universal/ERC721Bridge.sol
View file @
d58b0a39
...
@@ -9,6 +9,21 @@ import { Address } from "@openzeppelin/contracts/utils/Address.sol";
...
@@ -9,6 +9,21 @@ import { Address } from "@openzeppelin/contracts/utils/Address.sol";
* @notice ERC721Bridge is a base contract for the L1 and L2 ERC721 bridges.
* @notice ERC721Bridge is a base contract for the L1 and L2 ERC721 bridges.
*/
*/
abstract contract ERC721Bridge {
abstract contract ERC721Bridge {
/**
* @notice Messenger contract on this domain.
*/
CrossDomainMessenger public immutable messenger;
/**
* @notice Address of the bridge on the other network.
*/
address public immutable otherBridge;
/**
* @notice Reserve extra slots (to a total of 50) in the storage layout for future upgrades.
*/
uint256[49] private __gap;
/**
/**
* @notice Emitted when an ERC721 bridge to the other network is initiated.
* @notice Emitted when an ERC721 bridge to the other network is initiated.
*
*
...
@@ -47,21 +62,6 @@ abstract contract ERC721Bridge {
...
@@ -47,21 +62,6 @@ abstract contract ERC721Bridge {
bytes extraData
bytes extraData
);
);
/**
* @notice Messenger contract on this domain.
*/
CrossDomainMessenger public immutable messenger;
/**
* @notice Address of the bridge on the other network.
*/
address public immutable otherBridge;
/**
* @notice Reserve extra slots (to a total of 50) in the storage layout for future upgrades.
*/
uint256[49] private __gap;
/**
/**
* @notice Ensures that the caller is a cross-chain message from the other bridge.
* @notice Ensures that the caller is a cross-chain message from the other bridge.
*/
*/
...
...
packages/contracts-bedrock/contracts/universal/IOptimismMintableERC721.sol
View file @
d58b0a39
...
@@ -27,21 +27,6 @@ interface IOptimismMintableERC721 is IERC721Enumerable {
...
@@ -27,21 +27,6 @@ interface IOptimismMintableERC721 is IERC721Enumerable {
*/
*/
event Burn(address indexed account, uint256 tokenId);
event Burn(address indexed account, uint256 tokenId);
/**
* @notice Chain ID of the chain where the remote token is deployed.
*/
function remoteChainId() external view returns (uint256);
/**
* @notice Address of the token on the remote domain.
*/
function remoteToken() external view returns (address);
/**
* @notice Address of the ERC721 bridge on this network.
*/
function bridge() external view returns (address);
/**
/**
* @notice Mints some token ID for a user, checking first that contract recipients
* @notice Mints some token ID for a user, checking first that contract recipients
* are aware of the ERC721 protocol to prevent tokens from being forever locked.
* are aware of the ERC721 protocol to prevent tokens from being forever locked.
...
@@ -58,4 +43,19 @@ interface IOptimismMintableERC721 is IERC721Enumerable {
...
@@ -58,4 +43,19 @@ interface IOptimismMintableERC721 is IERC721Enumerable {
* @param _tokenId Token ID to burn.
* @param _tokenId Token ID to burn.
*/
*/
function burn(address _from, uint256 _tokenId) external;
function burn(address _from, uint256 _tokenId) external;
/**
* @notice Chain ID of the chain where the remote token is deployed.
*/
function remoteChainId() external view returns (uint256);
/**
* @notice Address of the token on the remote domain.
*/
function remoteToken() external view returns (address);
/**
* @notice Address of the ERC721 bridge on this network.
*/
function bridge() external view returns (address);
}
}
packages/contracts-bedrock/contracts/universal/OptimismMintableERC721.sol
View file @
d58b0a39
...
@@ -36,6 +36,14 @@ contract OptimismMintableERC721 is ERC721Enumerable, IOptimismMintableERC721 {
...
@@ -36,6 +36,14 @@ contract OptimismMintableERC721 is ERC721Enumerable, IOptimismMintableERC721 {
*/
*/
string public baseTokenURI;
string public baseTokenURI;
/**
* @notice Modifier that prevents callers other than the bridge from calling the function.
*/
modifier onlyBridge() {
require(msg.sender == bridge, "OptimismMintableERC721: only bridge can call this function");
_;
}
/**
/**
* @param _bridge Address of the bridge on this network.
* @param _bridge Address of the bridge on this network.
* @param _remoteChainId Chain ID where the remote token is deployed.
* @param _remoteChainId Chain ID where the remote token is deployed.
...
@@ -74,14 +82,6 @@ contract OptimismMintableERC721 is ERC721Enumerable, IOptimismMintableERC721 {
...
@@ -74,14 +82,6 @@ contract OptimismMintableERC721 is ERC721Enumerable, IOptimismMintableERC721 {
);
);
}
}
/**
* @notice Modifier that prevents callers other than the bridge from calling the function.
*/
modifier onlyBridge() {
require(msg.sender == bridge, "OptimismMintableERC721: only bridge can call this function");
_;
}
/**
/**
* @inheritdoc IOptimismMintableERC721
* @inheritdoc IOptimismMintableERC721
*/
*/
...
...
packages/contracts-bedrock/contracts/universal/OptimismMintableERC721Factory.sol
View file @
d58b0a39
...
@@ -9,19 +9,6 @@ import { Semver } from "./Semver.sol";
...
@@ -9,19 +9,6 @@ import { Semver } from "./Semver.sol";
* @notice Factory contract for creating OptimismMintableERC721 contracts.
* @notice Factory contract for creating OptimismMintableERC721 contracts.
*/
*/
contract OptimismMintableERC721Factory is Semver {
contract OptimismMintableERC721Factory is Semver {
/**
* @notice Emitted whenever a new OptimismMintableERC721 contract is created.
*
* @param localToken Address of the token on the this domain.
* @param remoteToken Address of the token on the remote domain.
* @param deployer Address of the initiator of the deployment
*/
event OptimismMintableERC721Created(
address indexed localToken,
address indexed remoteToken,
address deployer
);
/**
/**
* @notice Address of the ERC721 bridge on this network.
* @notice Address of the ERC721 bridge on this network.
*/
*/
...
@@ -37,6 +24,19 @@ contract OptimismMintableERC721Factory is Semver {
...
@@ -37,6 +24,19 @@ contract OptimismMintableERC721Factory is Semver {
*/
*/
mapping(address => bool) public isOptimismMintableERC721;
mapping(address => bool) public isOptimismMintableERC721;
/**
* @notice Emitted whenever a new OptimismMintableERC721 contract is created.
*
* @param localToken Address of the token on the this domain.
* @param remoteToken Address of the token on the remote domain.
* @param deployer Address of the initiator of the deployment
*/
event OptimismMintableERC721Created(
address indexed localToken,
address indexed remoteToken,
address deployer
);
/**
/**
* @custom:semver 1.0.0
* @custom:semver 1.0.0
*
*
...
...
packages/contracts-bedrock/contracts/universal/Semver.sol
View file @
d58b0a39
...
@@ -11,19 +11,16 @@ contract Semver {
...
@@ -11,19 +11,16 @@ contract Semver {
/**
/**
* @notice Contract version number (major).
* @notice Contract version number (major).
*/
*/
// solhint-disable-next-line var-name-mixedcase
uint256 private immutable MAJOR_VERSION;
uint256 private immutable MAJOR_VERSION;
/**
/**
* @notice Contract version number (minor).
* @notice Contract version number (minor).
*/
*/
// solhint-disable-next-line var-name-mixedcase
uint256 private immutable MINOR_VERSION;
uint256 private immutable MINOR_VERSION;
/**
/**
* @notice Contract version number (patch).
* @notice Contract version number (patch).
*/
*/
// solhint-disable-next-line var-name-mixedcase
uint256 private immutable PATCH_VERSION;
uint256 private immutable PATCH_VERSION;
/**
/**
...
...
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