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
f28d13bb
Commit
f28d13bb
authored
Mar 23, 2023
by
Mark Tyneway
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
contracts-bedrock: more cleanup
parent
50131bc1
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
32 additions
and
3 deletions
+32
-3
layer_one_test.go
op-chain-ops/genesis/layer_one_test.go
+19
-0
OptimismPortal.sol
packages/contracts-bedrock/contracts/L1/OptimismPortal.sol
+2
-1
ResourceMetering.sol
packages/contracts-bedrock/contracts/L1/ResourceMetering.sol
+2
-1
SystemConfig.sol
packages/contracts-bedrock/contracts/L1/SystemConfig.sol
+9
-1
No files found.
op-chain-ops/genesis/layer_one_test.go
View file @
f28d13bb
...
...
@@ -8,6 +8,7 @@ import (
"testing"
"time"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/common/hexutil"
"github.com/ethereum-optimism/optimism/op-bindings/bindings"
...
...
@@ -105,6 +106,24 @@ func TestBuildL1DeveloperGenesis(t *testing.T) {
cfg
,
err
:=
sysCfg
.
ResourceConfig
(
&
bind
.
CallOpts
{})
require
.
NoError
(
t
,
err
)
require
.
Equal
(
t
,
cfg
,
defaultResourceConfig
)
owner
,
err
=
sysCfg
.
Owner
(
&
bind
.
CallOpts
{})
require
.
NoError
(
t
,
err
)
require
.
Equal
(
t
,
owner
,
config
.
FinalSystemOwner
)
overhead
,
err
:=
sysCfg
.
Overhead
(
&
bind
.
CallOpts
{})
require
.
NoError
(
t
,
err
)
require
.
Equal
(
t
,
overhead
.
Uint64
(),
config
.
GasPriceOracleOverhead
)
scalar
,
err
:=
sysCfg
.
Scalar
(
&
bind
.
CallOpts
{})
require
.
NoError
(
t
,
err
)
require
.
Equal
(
t
,
scalar
.
Uint64
(),
config
.
GasPriceOracleScalar
)
batcherHash
,
err
:=
sysCfg
.
BatcherHash
(
&
bind
.
CallOpts
{})
require
.
NoError
(
t
,
err
)
require
.
Equal
(
t
,
common
.
Hash
(
batcherHash
),
config
.
BatchSenderAddress
.
Hash
())
gasLimit
,
err
:=
sysCfg
.
GasLimit
(
&
bind
.
CallOpts
{})
require
.
NoError
(
t
,
err
)
require
.
Equal
(
t
,
gasLimit
,
uint64
(
config
.
L2GenesisBlockGasLimit
))
unsafeBlockSigner
,
err
:=
sysCfg
.
UnsafeBlockSigner
(
&
bind
.
CallOpts
{})
require
.
NoError
(
t
,
err
)
require
.
Equal
(
t
,
unsafeBlockSigner
,
config
.
P2PSequencerAddress
)
// test that we can do deposits, etc.
priv
,
err
:=
crypto
.
HexToECDSA
(
"ac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80"
)
...
...
packages/contracts-bedrock/contracts/L1/OptimismPortal.sol
View file @
f28d13bb
...
...
@@ -207,7 +207,8 @@ contract OptimismPortal is Initializable, ResourceMetering, Semver {
}
/**
* @notice
* @notice Getter for the resource config. Used internally by the ResourceMetering
* contract. The SystemConfig is the source of truth for the resource config.
*/
function _resourceConfig() internal view override returns (SystemConfig.ResourceConfig memory) {
return SYSTEM_CONFIG.resourceConfig();
...
...
packages/contracts-bedrock/contracts/L1/ResourceMetering.sol
View file @
f28d13bb
...
...
@@ -135,7 +135,8 @@ abstract contract ResourceMetering is Initializable {
}
/**
* @notice
* @notice Virtual function that returns the resource config. Contracts that inherit this
* contract must implement this function.
*/
function _resourceConfig() internal virtual returns (SystemConfig.ResourceConfig memory);
...
...
packages/contracts-bedrock/contracts/L1/SystemConfig.sol
View file @
f28d13bb
...
...
@@ -136,7 +136,15 @@ contract SystemConfig is OwnableUpgradeable, Semver {
address _unsafeBlockSigner,
ResourceConfig memory _config
) Semver(1, 1, 0) {
initialize(_owner, _overhead, _scalar, _batcherHash, _gasLimit, _unsafeBlockSigner, _config);
initialize({
_owner: _owner,
_overhead: _overhead,
_scalar: _scalar,
_batcherHash: _batcherHash,
_gasLimit: _gasLimit,
_unsafeBlockSigner: _unsafeBlockSigner,
_config: _config
});
}
/**
...
...
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