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
110b5332
Commit
110b5332
authored
May 15, 2023
by
Mark Tyneway
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
contracts-bedrock: dedupe code for constants
parent
41c2ee31
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
21 additions
and
24 deletions
+21
-24
017-SystemConfigImpl.ts
packages/contracts-bedrock/deploy/017-SystemConfigImpl.ts
+5
-13
019-SystemDictatorInit.ts
packages/contracts-bedrock/deploy/019-SystemDictatorInit.ts
+3
-11
constants.ts
packages/contracts-bedrock/src/constants.ts
+13
-0
No files found.
packages/contracts-bedrock/deploy/017-SystemConfigImpl.ts
View file @
110b5332
...
...
@@ -2,27 +2,19 @@ import assert from 'assert'
import
{
DeployFunction
}
from
'
hardhat-deploy/dist/types
'
import
'
@eth-optimism/hardhat-deploy-config
'
import
{
ethers
,
BigNumber
}
from
'
ethers
'
import
{
BigNumber
}
from
'
ethers
'
import
{
defaultResourceConfig
}
from
'
../src/constants
'
import
{
assertContractVariable
,
deploy
}
from
'
../src/deploy-utils
'
const
uint128Max
=
ethers
.
BigNumber
.
from
(
'
0xffffffffffffffffffffffffffffffff
'
)
const
defaultResourceConfig
=
{
maxResourceLimit
:
20
_000_000
,
elasticityMultiplier
:
10
,
baseFeeMaxChangeDenominator
:
8
,
minimumBaseFee
:
ethers
.
utils
.
parseUnits
(
'
1
'
,
'
gwei
'
),
systemTxMaxGas
:
1
_000_000
,
maximumBaseFee
:
uint128Max
,
}
const
deployFn
:
DeployFunction
=
async
(
hre
)
=>
{
const
batcherHash
=
hre
.
ethers
.
utils
.
hexZeroPad
(
hre
.
deployConfig
.
batchSenderAddress
,
32
)
.
toLowerCase
()
const
l2GenesisBlockGasLimit
=
hre
.
deployConfig
.
l2GenesisBlockGasLimit
const
l2GenesisBlockGasLimit
=
BigNumber
.
from
(
hre
.
deployConfig
.
l2GenesisBlockGasLimit
)
const
l2GasLimitLowerBound
=
BigNumber
.
from
(
defaultResourceConfig
.
systemTxMaxGas
+
defaultResourceConfig
.
maxResourceLimit
...
...
packages/contracts-bedrock/deploy/019-SystemDictatorInit.ts
View file @
110b5332
import
assert
from
'
assert
'
import
{
ethers
,
BigNumber
}
from
'
ethers
'
import
{
ethers
}
from
'
ethers
'
import
{
DeployFunction
}
from
'
hardhat-deploy/dist/types
'
import
{
awaitCondition
}
from
'
@eth-optimism/core-utils
'
import
'
@eth-optimism/hardhat-deploy-config
'
...
...
@@ -10,6 +10,7 @@ import {
getContractsFromArtifacts
,
getDeploymentAddress
,
}
from
'
../src/deploy-utils
'
import
{
defaultResourceConfig
}
from
'
../src/constants
'
const
deployFn
:
DeployFunction
=
async
(
hre
)
=>
{
const
{
deployer
}
=
await
hre
.
getNamedAccounts
()
...
...
@@ -102,16 +103,7 @@ const deployFn: DeployFunction = async (hre) => {
unsafeBlockSigner
:
hre
.
deployConfig
.
p2pSequencerAddress
,
// The resource config is not exposed to the end user
// to simplify deploy config. It may be introduced in the future.
resourceConfig
:
{
maxResourceLimit
:
20
_000_000
,
elasticityMultiplier
:
10
,
baseFeeMaxChangeDenominator
:
8
,
minimumBaseFee
:
ethers
.
utils
.
parseUnits
(
'
1
'
,
'
gwei
'
),
systemTxMaxGas
:
1
_000_000
,
maximumBaseFee
:
BigNumber
.
from
(
'
0xffffffffffffffffffffffffffffffff
'
).
toString
(),
},
resourceConfig
:
defaultResourceConfig
,
},
}
...
...
packages/contracts-bedrock/src/constants.ts
View file @
110b5332
import
{
ethers
}
from
'
ethers
'
/**
* Predeploys are Solidity contracts that are injected into the initial L2 state and provide
* various useful functions.
...
...
@@ -26,3 +28,14 @@ export const predeploys = {
BaseFeeVault
:
'
0x4200000000000000000000000000000000000019
'
,
L1FeeVault
:
'
0x420000000000000000000000000000000000001a
'
,
}
const
uint128Max
=
ethers
.
BigNumber
.
from
(
'
0xffffffffffffffffffffffffffffffff
'
)
export
const
defaultResourceConfig
=
{
maxResourceLimit
:
20
_000_000
,
elasticityMultiplier
:
10
,
baseFeeMaxChangeDenominator
:
8
,
minimumBaseFee
:
ethers
.
utils
.
parseUnits
(
'
1
'
,
'
gwei
'
),
systemTxMaxGas
:
1
_000_000
,
maximumBaseFee
:
uint128Max
,
}
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