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
0df27c84
Unverified
Commit
0df27c84
authored
2 years ago
by
Matthew Slipper
Committed by
GitHub
2 years ago
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #4586 from ethereum-optimism/develop
fix(ctb): correct GPO abi and layout (#4582)
parents
26c0c318
89de7ae0
develop
exchain
No related merge requests found
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
71 additions
and
15 deletions
+71
-15
gaspriceoracle.go
op-bindings/bindings/gaspriceoracle.go
+36
-5
gaspriceoracle_more.go
op-bindings/bindings/gaspriceoracle_more.go
+2
-2
.gas-snapshot
packages/contracts-bedrock/.gas-snapshot
+7
-6
.storage-layout
packages/contracts-bedrock/.storage-layout
+2
-0
GasPriceOracle.sol
packages/contracts-bedrock/contracts/L2/GasPriceOracle.sol
+19
-2
GasPriceOracle.t.sol
...ges/contracts-bedrock/contracts/test/GasPriceOracle.t.sol
+5
-0
No files found.
op-bindings/bindings/gaspriceoracle.go
View file @
0df27c84
...
@@ -30,8 +30,8 @@ var (
...
@@ -30,8 +30,8 @@ var (
// GasPriceOracleMetaData contains all meta data concerning the GasPriceOracle contract.
// GasPriceOracleMetaData contains all meta data concerning the GasPriceOracle contract.
var
GasPriceOracleMetaData
=
&
bind
.
MetaData
{
var
GasPriceOracleMetaData
=
&
bind
.
MetaData
{
ABI
:
"[{
\"
inputs
\"
:[],
\"
stateMutability
\"
:
\"
nonpayable
\"
,
\"
type
\"
:
\"
constructor
\"
},{
\"
inputs
\"
:[],
\"
name
\"
:
\"
baseFee
\"
,
\"
outputs
\"
:[{
\"
internalType
\"
:
\"
uint256
\"
,
\"
name
\"
:
\"\"
,
\"
type
\"
:
\"
uint256
\"
}],
\"
stateMutability
\"
:
\"
view
\"
,
\"
type
\"
:
\"
function
\"
},{
\"
inputs
\"
:[],
\"
name
\"
:
\"
decimals
\"
,
\"
outputs
\"
:[{
\"
internalType
\"
:
\"
uint256
\"
,
\"
name
\"
:
\"\"
,
\"
type
\"
:
\"
uint256
\"
}],
\"
stateMutability
\"
:
\"
view
\"
,
\"
type
\"
:
\"
function
\"
},{
\"
inputs
\"
:[],
\"
name
\"
:
\"
gasPrice
\"
,
\"
outputs
\"
:[{
\"
internalType
\"
:
\"
uint256
\"
,
\"
name
\"
:
\"\"
,
\"
type
\"
:
\"
uint256
\"
}],
\"
stateMutability
\"
:
\"
view
\"
,
\"
type
\"
:
\"
function
\"
},{
\"
inputs
\"
:[{
\"
internalType
\"
:
\"
bytes
\"
,
\"
name
\"
:
\"
_data
\"
,
\"
type
\"
:
\"
bytes
\"
}],
\"
name
\"
:
\"
getL1Fee
\"
,
\"
outputs
\"
:[{
\"
internalType
\"
:
\"
uint256
\"
,
\"
name
\"
:
\"\"
,
\"
type
\"
:
\"
uint256
\"
}],
\"
stateMutability
\"
:
\"
view
\"
,
\"
type
\"
:
\"
function
\"
},{
\"
inputs
\"
:[{
\"
internalType
\"
:
\"
bytes
\"
,
\"
name
\"
:
\"
_data
\"
,
\"
type
\"
:
\"
bytes
\"
}],
\"
name
\"
:
\"
getL1GasUsed
\"
,
\"
outputs
\"
:[{
\"
internalType
\"
:
\"
uint256
\"
,
\"
name
\"
:
\"\"
,
\"
type
\"
:
\"
uint256
\"
}],
\"
stateMutability
\"
:
\"
view
\"
,
\"
type
\"
:
\"
function
\"
},{
\"
inputs
\"
:[],
\"
name
\"
:
\"
l1BaseFee
\"
,
\"
outputs
\"
:[{
\"
internalType
\"
:
\"
uint256
\"
,
\"
name
\"
:
\"\"
,
\"
type
\"
:
\"
uint256
\"
}],
\"
stateMutability
\"
:
\"
view
\"
,
\"
type
\"
:
\"
function
\"
},{
\"
inputs
\"
:[],
\"
name
\"
:
\"
overhead
\"
,
\"
outputs
\"
:[{
\"
internalType
\"
:
\"
uint256
\"
,
\"
name
\"
:
\"\"
,
\"
type
\"
:
\"
uint256
\"
}],
\"
stateMutability
\"
:
\"
view
\"
,
\"
type
\"
:
\"
function
\"
},{
\"
inputs
\"
:[],
\"
name
\"
:
\"
scalar
\"
,
\"
outputs
\"
:[{
\"
internalType
\"
:
\"
uint256
\"
,
\"
name
\"
:
\"\"
,
\"
type
\"
:
\"
uint256
\"
}],
\"
stateMutability
\"
:
\"
view
\"
,
\"
type
\"
:
\"
function
\"
},{
\"
inputs
\"
:[],
\"
name
\"
:
\"
version
\"
,
\"
outputs
\"
:[{
\"
internalType
\"
:
\"
string
\"
,
\"
name
\"
:
\"\"
,
\"
type
\"
:
\"
string
\"
}],
\"
stateMutability
\"
:
\"
view
\"
,
\"
type
\"
:
\"
function
\"
}]"
,
ABI
:
"[{
\"
inputs
\"
:[],
\"
stateMutability
\"
:
\"
nonpayable
\"
,
\"
type
\"
:
\"
constructor
\"
},{
\"
inputs
\"
:[],
\"
name
\"
:
\"
DECIMALS
\"
,
\"
outputs
\"
:[{
\"
internalType
\"
:
\"
uint256
\"
,
\"
name
\"
:
\"\"
,
\"
type
\"
:
\"
uint256
\"
}],
\"
stateMutability
\"
:
\"
view
\"
,
\"
type
\"
:
\"
function
\"
},{
\"
inputs
\"
:[],
\"
name
\"
:
\"
baseFee
\"
,
\"
outputs
\"
:[{
\"
internalType
\"
:
\"
uint256
\"
,
\"
name
\"
:
\"\"
,
\"
type
\"
:
\"
uint256
\"
}],
\"
stateMutability
\"
:
\"
view
\"
,
\"
type
\"
:
\"
function
\"
},{
\"
inputs
\"
:[],
\"
name
\"
:
\"
decimals
\"
,
\"
outputs
\"
:[{
\"
internalType
\"
:
\"
uint256
\"
,
\"
name
\"
:
\"\"
,
\"
type
\"
:
\"
uint256
\"
}],
\"
stateMutability
\"
:
\"
pure
\"
,
\"
type
\"
:
\"
function
\"
},{
\"
inputs
\"
:[],
\"
name
\"
:
\"
gasPrice
\"
,
\"
outputs
\"
:[{
\"
internalType
\"
:
\"
uint256
\"
,
\"
name
\"
:
\"\"
,
\"
type
\"
:
\"
uint256
\"
}],
\"
stateMutability
\"
:
\"
view
\"
,
\"
type
\"
:
\"
function
\"
},{
\"
inputs
\"
:[{
\"
internalType
\"
:
\"
bytes
\"
,
\"
name
\"
:
\"
_data
\"
,
\"
type
\"
:
\"
bytes
\"
}],
\"
name
\"
:
\"
getL1Fee
\"
,
\"
outputs
\"
:[{
\"
internalType
\"
:
\"
uint256
\"
,
\"
name
\"
:
\"\"
,
\"
type
\"
:
\"
uint256
\"
}],
\"
stateMutability
\"
:
\"
view
\"
,
\"
type
\"
:
\"
function
\"
},{
\"
inputs
\"
:[{
\"
internalType
\"
:
\"
bytes
\"
,
\"
name
\"
:
\"
_data
\"
,
\"
type
\"
:
\"
bytes
\"
}],
\"
name
\"
:
\"
getL1GasUsed
\"
,
\"
outputs
\"
:[{
\"
internalType
\"
:
\"
uint256
\"
,
\"
name
\"
:
\"\"
,
\"
type
\"
:
\"
uint256
\"
}],
\"
stateMutability
\"
:
\"
view
\"
,
\"
type
\"
:
\"
function
\"
},{
\"
inputs
\"
:[],
\"
name
\"
:
\"
l1BaseFee
\"
,
\"
outputs
\"
:[{
\"
internalType
\"
:
\"
uint256
\"
,
\"
name
\"
:
\"\"
,
\"
type
\"
:
\"
uint256
\"
}],
\"
stateMutability
\"
:
\"
view
\"
,
\"
type
\"
:
\"
function
\"
},{
\"
inputs
\"
:[],
\"
name
\"
:
\"
overhead
\"
,
\"
outputs
\"
:[{
\"
internalType
\"
:
\"
uint256
\"
,
\"
name
\"
:
\"\"
,
\"
type
\"
:
\"
uint256
\"
}],
\"
stateMutability
\"
:
\"
view
\"
,
\"
type
\"
:
\"
function
\"
},{
\"
inputs
\"
:[],
\"
name
\"
:
\"
scalar
\"
,
\"
outputs
\"
:[{
\"
internalType
\"
:
\"
uint256
\"
,
\"
name
\"
:
\"\"
,
\"
type
\"
:
\"
uint256
\"
}],
\"
stateMutability
\"
:
\"
view
\"
,
\"
type
\"
:
\"
function
\"
},{
\"
inputs
\"
:[],
\"
name
\"
:
\"
version
\"
,
\"
outputs
\"
:[{
\"
internalType
\"
:
\"
string
\"
,
\"
name
\"
:
\"\"
,
\"
type
\"
:
\"
string
\"
}],
\"
stateMutability
\"
:
\"
view
\"
,
\"
type
\"
:
\"
function
\"
}]"
,
Bin
:
"0x60e060405234801561001057600080fd5b506000608081905260a052600160c05260805160a05160c051610a
0161004f60003960006102c1015260006102980152600061026f0152610a016000f3fe608060405234801561001057600080fd5b50600436106100a35760003560e01c806354fd4d5011610076578063de26c4a11161005b578063de26c4a114610101578063f45e65d814610114578063fe173b97146100fb57600080fd5b806354fd4d50146100e65780636ef25c3a146100fb57600080fd5b80630c18c162146100a8578063313ce567146100c357806349948e0e146100cb578063519b4bd3146100de575b600080fd5b6100b061011c565b6040519081526020015b60405180910390f35b6100b0600681565b6100b06100d9366004610587565b6101a6565b6100b0610207565b6100ee610268565b6040516100ba9190610686565b486100b0565b6100b061010f366004610587565b61030b565b6100b06103ba565b600073420000000000000000000000000000000000001573ffffffffffffffffffffffffffffffffffffffff16638b239f736040518163ffffffff1660e01b8152600401602060405180830381865afa15801561017d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906101a191906106d7565b905090565b6000806101b28361030b565b905060006101be610207565b6101c8908361071f565b905060006101d86006600a61087e565b905060006101e46103ba565b6101ee908461071f565b905060006101fc83836108c0565b979650505050505050565b600073420000000000000000000000000000000000001573ffffffffffffffffffffffffffffffffffffffff16635cf249696040518163ffffffff1660e01b8152600401602060405180830381865afa15801561017d573d6000803e3d6000fd5b60606102937f000000000000000000000000000000000000000000000000000000000000000061041b565b6102bc7f000000000000000000000000000000000000000000000000000000000000000061041b565b6102e57f000000000000000000000000000000000000000000000000000000000000000061041b565b6040516020016102f7939291906108d4565b604051602081830303815290604052905090565b80516000908190815b8181101561038e5784818151811061032e5761032e61094a565b01602001517fff000000000000000000000000000000000000000000000000000000000000001660000361036e57610367600484610979565b925061037c565b610379601084610979565b92505b8061038681610991565b915050610314565b50600061039961011c565b6103a39084610979565b90506103b181610440610979565b95945050505050565b600073420000000000000000000000000000000000001573ffffffffffffffffffffffffffffffffffffffff16639e8c49666040518163ffffffff1660e01b8152600401602060405180830381865afa15801561017d573d6000803e3d6000fd5b60608160000361045e57505060408051808201909152600181527f3000000000000000000000000000000000000000000000000000000000000000602082015290565b8160005b8115610488578061047281610991565b91506104819050600a836108c0565b9150610462565b60008167ffffffffffffffff8111156104a3576104a3610558565b6040519080825280601f01601f1916602001820160405280156104cd576020820181803683370190505b5090505b8415610550576104e26001836109c9565b91506104ef600a866109e0565b6104fa906030610979565b60f81b81838151811061050f5761050f61094a565b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a905350610549600a866108c0565b94506104d1565b949350505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b60006020828403121561059957600080fd5b813567ffffffffffffffff808211156105b157600080fd5b818401915084601f8301126105c557600080fd5b8135818111156105d7576105d7610558565b604051601f82017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0908116603f0116810190838211818310171561061d5761061d610558565b8160405282815287602084870101111561063657600080fd5b826020860160208301376000928101602001929092525095945050505050565b60005b83811015610671578181015183820152602001610659565b83811115610680576000848401525b50505050565b60208152600082518060208401526106a5816040850160208701610656565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169190910160400192915050565b6000602082840312156106e957600080fd5b5051919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b6000817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0483118215151615610757576107576106f0565b500290565b600181815b808511156107b557817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0482111561079b5761079b6106f0565b808516156107a857918102915b93841c9390800290610761565b509250929050565b6000826107cc57506001610878565b816107d957506000610878565b81600181146107ef57600281146107f957610815565b6001915050610878565b60ff84111561080a5761080a6106f0565b50506001821b610878565b5060208310610133831016604e8410600b8410161715610838575081810a610878565b610842838361075c565b807fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04821115610874576108746106f0565b0290505b92915050565b600061088a83836107bd565b9392505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b6000826108cf576108cf610891565b500490565b600084516108e6818460208901610656565b80830190507f2e000000000000000000000000000000000000000000000000000000000000008082528551610922816001850160208a01610656565b6001920191820152835161093d816002840160208801610656565b0160020195945050505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b6000821982111561098c5761098c6106f0565b500190565b60007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82036109c2576109c26106f0565b5060010190565b6000828210156109db576109db6106f0565b500390565b6000826109ef576109ef610891
565b50069056fea164736f6c634300080f000a"
,
Bin
:
"0x60e060405234801561001057600080fd5b506000608081905260a052600160c05260805160a05160c051610a
2361004f60003960006102e3015260006102ba015260006102910152610a236000f3fe608060405234801561001057600080fd5b50600436106100be5760003560e01c806354fd4d5011610076578063de26c4a11161005b578063de26c4a114610123578063f45e65d814610136578063fe173b971461011d57600080fd5b806354fd4d50146101085780636ef25c3a1461011d57600080fd5b8063313ce567116100a7578063313ce567146100e657806349948e0e146100ed578063519b4bd31461010057600080fd5b80630c18c162146100c35780632e0f2625146100de575b600080fd5b6100cb61013e565b6040519081526020015b60405180910390f35b6100cb600681565b60066100cb565b6100cb6100fb3660046105a9565b6101c8565b6100cb610229565b61011061028a565b6040516100d591906106a8565b486100cb565b6100cb6101313660046105a9565b61032d565b6100cb6103dc565b600073420000000000000000000000000000000000001573ffffffffffffffffffffffffffffffffffffffff16638b239f736040518163ffffffff1660e01b8152600401602060405180830381865afa15801561019f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906101c391906106f9565b905090565b6000806101d48361032d565b905060006101e0610229565b6101ea9083610741565b905060006101fa6006600a6108a0565b905060006102066103dc565b6102109084610741565b9050600061021e83836108e2565b979650505050505050565b600073420000000000000000000000000000000000001573ffffffffffffffffffffffffffffffffffffffff16635cf249696040518163ffffffff1660e01b8152600401602060405180830381865afa15801561019f573d6000803e3d6000fd5b60606102b57f000000000000000000000000000000000000000000000000000000000000000061043d565b6102de7f000000000000000000000000000000000000000000000000000000000000000061043d565b6103077f000000000000000000000000000000000000000000000000000000000000000061043d565b604051602001610319939291906108f6565b604051602081830303815290604052905090565b80516000908190815b818110156103b0578481815181106103505761035061096c565b01602001517fff00000000000000000000000000000000000000000000000000000000000000166000036103905761038960048461099b565b925061039e565b61039b60108461099b565b92505b806103a8816109b3565b915050610336565b5060006103bb61013e565b6103c5908461099b565b90506103d38161044061099b565b95945050505050565b600073420000000000000000000000000000000000001573ffffffffffffffffffffffffffffffffffffffff16639e8c49666040518163ffffffff1660e01b8152600401602060405180830381865afa15801561019f573d6000803e3d6000fd5b60608160000361048057505060408051808201909152600181527f3000000000000000000000000000000000000000000000000000000000000000602082015290565b8160005b81156104aa5780610494816109b3565b91506104a39050600a836108e2565b9150610484565b60008167ffffffffffffffff8111156104c5576104c561057a565b6040519080825280601f01601f1916602001820160405280156104ef576020820181803683370190505b5090505b8415610572576105046001836109eb565b9150610511600a86610a02565b61051c90603061099b565b60f81b8183815181106105315761053161096c565b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a90535061056b600a866108e2565b94506104f3565b949350505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6000602082840312156105bb57600080fd5b813567ffffffffffffffff808211156105d357600080fd5b818401915084601f8301126105e757600080fd5b8135818111156105f9576105f961057a565b604051601f82017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0908116603f0116810190838211818310171561063f5761063f61057a565b8160405282815287602084870101111561065857600080fd5b826020860160208301376000928101602001929092525095945050505050565b60005b8381101561069357818101518382015260200161067b565b838111156106a2576000848401525b50505050565b60208152600082518060208401526106c7816040850160208701610678565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169190910160400192915050565b60006020828403121561070b57600080fd5b5051919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b6000817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff048311821515161561077957610779610712565b500290565b600181815b808511156107d757817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff048211156107bd576107bd610712565b808516156107ca57918102915b93841c9390800290610783565b509250929050565b6000826107ee5750600161089a565b816107fb5750600061089a565b8160018114610811576002811461081b57610837565b600191505061089a565b60ff84111561082c5761082c610712565b50506001821b61089a565b5060208310610133831016604e8410600b841016171561085a575081810a61089a565b610864838361077e565b807fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0482111561089657610896610712565b0290505b92915050565b60006108ac83836107df565b9392505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b6000826108f1576108f16108b3565b500490565b60008451610908818460208901610678565b80830190507f2e000000000000000000000000000000000000000000000000000000000000008082528551610944816001850160208a01610678565b6001920191820152835161095f816002840160208801610678565b0160020195945050505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b600082198211156109ae576109ae610712565b500190565b60007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82036109e4576109e4610712565b5060010190565b6000828210156109fd576109fd610712565b500390565b600082610a1157610a116108b3
565b50069056fea164736f6c634300080f000a"
,
}
}
// GasPriceOracleABI is the input ABI used to generate the binding from.
// GasPriceOracleABI is the input ABI used to generate the binding from.
...
@@ -201,6 +201,37 @@ func (_GasPriceOracle *GasPriceOracleTransactorRaw) Transact(opts *bind.Transact
...
@@ -201,6 +201,37 @@ func (_GasPriceOracle *GasPriceOracleTransactorRaw) Transact(opts *bind.Transact
return
_GasPriceOracle
.
Contract
.
contract
.
Transact
(
opts
,
method
,
params
...
)
return
_GasPriceOracle
.
Contract
.
contract
.
Transact
(
opts
,
method
,
params
...
)
}
}
// DECIMALS is a free data retrieval call binding the contract method 0x2e0f2625.
//
// Solidity: function DECIMALS() view returns(uint256)
func
(
_GasPriceOracle
*
GasPriceOracleCaller
)
DECIMALS
(
opts
*
bind
.
CallOpts
)
(
*
big
.
Int
,
error
)
{
var
out
[]
interface
{}
err
:=
_GasPriceOracle
.
contract
.
Call
(
opts
,
&
out
,
"DECIMALS"
)
if
err
!=
nil
{
return
*
new
(
*
big
.
Int
),
err
}
out0
:=
*
abi
.
ConvertType
(
out
[
0
],
new
(
*
big
.
Int
))
.
(
**
big
.
Int
)
return
out0
,
err
}
// DECIMALS is a free data retrieval call binding the contract method 0x2e0f2625.
//
// Solidity: function DECIMALS() view returns(uint256)
func
(
_GasPriceOracle
*
GasPriceOracleSession
)
DECIMALS
()
(
*
big
.
Int
,
error
)
{
return
_GasPriceOracle
.
Contract
.
DECIMALS
(
&
_GasPriceOracle
.
CallOpts
)
}
// DECIMALS is a free data retrieval call binding the contract method 0x2e0f2625.
//
// Solidity: function DECIMALS() view returns(uint256)
func
(
_GasPriceOracle
*
GasPriceOracleCallerSession
)
DECIMALS
()
(
*
big
.
Int
,
error
)
{
return
_GasPriceOracle
.
Contract
.
DECIMALS
(
&
_GasPriceOracle
.
CallOpts
)
}
// BaseFee is a free data retrieval call binding the contract method 0x6ef25c3a.
// BaseFee is a free data retrieval call binding the contract method 0x6ef25c3a.
//
//
// Solidity: function baseFee() view returns(uint256)
// Solidity: function baseFee() view returns(uint256)
...
@@ -234,7 +265,7 @@ func (_GasPriceOracle *GasPriceOracleCallerSession) BaseFee() (*big.Int, error)
...
@@ -234,7 +265,7 @@ func (_GasPriceOracle *GasPriceOracleCallerSession) BaseFee() (*big.Int, error)
// Decimals is a free data retrieval call binding the contract method 0x313ce567.
// Decimals is a free data retrieval call binding the contract method 0x313ce567.
//
//
// Solidity: function decimals()
view
returns(uint256)
// Solidity: function decimals()
pure
returns(uint256)
func
(
_GasPriceOracle
*
GasPriceOracleCaller
)
Decimals
(
opts
*
bind
.
CallOpts
)
(
*
big
.
Int
,
error
)
{
func
(
_GasPriceOracle
*
GasPriceOracleCaller
)
Decimals
(
opts
*
bind
.
CallOpts
)
(
*
big
.
Int
,
error
)
{
var
out
[]
interface
{}
var
out
[]
interface
{}
err
:=
_GasPriceOracle
.
contract
.
Call
(
opts
,
&
out
,
"decimals"
)
err
:=
_GasPriceOracle
.
contract
.
Call
(
opts
,
&
out
,
"decimals"
)
...
@@ -251,14 +282,14 @@ func (_GasPriceOracle *GasPriceOracleCaller) Decimals(opts *bind.CallOpts) (*big
...
@@ -251,14 +282,14 @@ func (_GasPriceOracle *GasPriceOracleCaller) Decimals(opts *bind.CallOpts) (*big
// Decimals is a free data retrieval call binding the contract method 0x313ce567.
// Decimals is a free data retrieval call binding the contract method 0x313ce567.
//
//
// Solidity: function decimals()
view
returns(uint256)
// Solidity: function decimals()
pure
returns(uint256)
func
(
_GasPriceOracle
*
GasPriceOracleSession
)
Decimals
()
(
*
big
.
Int
,
error
)
{
func
(
_GasPriceOracle
*
GasPriceOracleSession
)
Decimals
()
(
*
big
.
Int
,
error
)
{
return
_GasPriceOracle
.
Contract
.
Decimals
(
&
_GasPriceOracle
.
CallOpts
)
return
_GasPriceOracle
.
Contract
.
Decimals
(
&
_GasPriceOracle
.
CallOpts
)
}
}
// Decimals is a free data retrieval call binding the contract method 0x313ce567.
// Decimals is a free data retrieval call binding the contract method 0x313ce567.
//
//
// Solidity: function decimals()
view
returns(uint256)
// Solidity: function decimals()
pure
returns(uint256)
func
(
_GasPriceOracle
*
GasPriceOracleCallerSession
)
Decimals
()
(
*
big
.
Int
,
error
)
{
func
(
_GasPriceOracle
*
GasPriceOracleCallerSession
)
Decimals
()
(
*
big
.
Int
,
error
)
{
return
_GasPriceOracle
.
Contract
.
Decimals
(
&
_GasPriceOracle
.
CallOpts
)
return
_GasPriceOracle
.
Contract
.
Decimals
(
&
_GasPriceOracle
.
CallOpts
)
}
}
...
...
This diff is collapsed.
Click to expand it.
op-bindings/bindings/gaspriceoracle_more.go
View file @
0df27c84
...
@@ -9,11 +9,11 @@ import (
...
@@ -9,11 +9,11 @@ import (
"github.com/ethereum-optimism/optimism/op-bindings/solc"
"github.com/ethereum-optimism/optimism/op-bindings/solc"
)
)
const
GasPriceOracleStorageLayoutJSON
=
"{
\"
storage
\"
:[{
\"
astId
\"
:1000,
\"
contract
\"
:
\"
contracts/L2/GasPriceOracle.sol:GasPriceOracle
\"
,
\"
label
\"
:
\"
spacer_0_0_20
\"
,
\"
offset
\"
:0,
\"
slot
\"
:
\"
0
\"
,
\"
type
\"
:
\"
t_address
\"
},{
\"
astId
\"
:1001,
\"
contract
\"
:
\"
contracts/L2/GasPriceOracle.sol:GasPriceOracle
\"
,
\"
label
\"
:
\"
spacer_1_0_32
\"
,
\"
offset
\"
:0,
\"
slot
\"
:
\"
1
\"
,
\"
type
\"
:
\"
t_uint256
\"
},{
\"
astId
\"
:1002,
\"
contract
\"
:
\"
contracts/L2/GasPriceOracle.sol:GasPriceOracle
\"
,
\"
label
\"
:
\"
spacer_2_0_32
\"
,
\"
offset
\"
:0,
\"
slot
\"
:
\"
2
\"
,
\"
type
\"
:
\"
t_uint256
\"
},{
\"
astId
\"
:1003,
\"
contract
\"
:
\"
contracts/L2/GasPriceOracle.sol:GasPriceOracle
\"
,
\"
label
\"
:
\"
spacer_3_0_32
\"
,
\"
offset
\"
:0,
\"
slot
\"
:
\"
3
\"
,
\"
type
\"
:
\"
t_uint256
\"
},{
\"
astId
\"
:1004,
\"
contract
\"
:
\"
contracts/L2/GasPriceOracle.sol:GasPriceOracle
\"
,
\"
label
\"
:
\"
spacer_4_0_32
\"
,
\"
offset
\"
:0,
\"
slot
\"
:
\"
4
\"
,
\"
type
\"
:
\"
t_uint256
\"
}],
\"
types
\"
:{
\"
t_address
\"
:{
\"
encoding
\"
:
\"
inplace
\"
,
\"
label
\"
:
\"
address
\"
,
\"
numberOfBytes
\"
:
\"
20
\"
},
\"
t_uint256
\"
:{
\"
encoding
\"
:
\"
inplace
\"
,
\"
label
\"
:
\"
uint256
\"
,
\"
numberOfBytes
\"
:
\"
32
\"
}}}"
const
GasPriceOracleStorageLayoutJSON
=
"{
\"
storage
\"
:[{
\"
astId
\"
:1000,
\"
contract
\"
:
\"
contracts/L2/GasPriceOracle.sol:GasPriceOracle
\"
,
\"
label
\"
:
\"
spacer_0_0_20
\"
,
\"
offset
\"
:0,
\"
slot
\"
:
\"
0
\"
,
\"
type
\"
:
\"
t_address
\"
},{
\"
astId
\"
:1001,
\"
contract
\"
:
\"
contracts/L2/GasPriceOracle.sol:GasPriceOracle
\"
,
\"
label
\"
:
\"
spacer_1_0_32
\"
,
\"
offset
\"
:0,
\"
slot
\"
:
\"
1
\"
,
\"
type
\"
:
\"
t_uint256
\"
},{
\"
astId
\"
:1002,
\"
contract
\"
:
\"
contracts/L2/GasPriceOracle.sol:GasPriceOracle
\"
,
\"
label
\"
:
\"
spacer_2_0_32
\"
,
\"
offset
\"
:0,
\"
slot
\"
:
\"
2
\"
,
\"
type
\"
:
\"
t_uint256
\"
},{
\"
astId
\"
:1003,
\"
contract
\"
:
\"
contracts/L2/GasPriceOracle.sol:GasPriceOracle
\"
,
\"
label
\"
:
\"
spacer_3_0_32
\"
,
\"
offset
\"
:0,
\"
slot
\"
:
\"
3
\"
,
\"
type
\"
:
\"
t_uint256
\"
},{
\"
astId
\"
:1004,
\"
contract
\"
:
\"
contracts/L2/GasPriceOracle.sol:GasPriceOracle
\"
,
\"
label
\"
:
\"
spacer_4_0_32
\"
,
\"
offset
\"
:0,
\"
slot
\"
:
\"
4
\"
,
\"
type
\"
:
\"
t_uint256
\"
}
,{
\"
astId
\"
:1005,
\"
contract
\"
:
\"
contracts/L2/GasPriceOracle.sol:GasPriceOracle
\"
,
\"
label
\"
:
\"
spacer_5_0_32
\"
,
\"
offset
\"
:0,
\"
slot
\"
:
\"
5
\"
,
\"
type
\"
:
\"
t_uint256
\"
}
],
\"
types
\"
:{
\"
t_address
\"
:{
\"
encoding
\"
:
\"
inplace
\"
,
\"
label
\"
:
\"
address
\"
,
\"
numberOfBytes
\"
:
\"
20
\"
},
\"
t_uint256
\"
:{
\"
encoding
\"
:
\"
inplace
\"
,
\"
label
\"
:
\"
uint256
\"
,
\"
numberOfBytes
\"
:
\"
32
\"
}}}"
var
GasPriceOracleStorageLayout
=
new
(
solc
.
StorageLayout
)
var
GasPriceOracleStorageLayout
=
new
(
solc
.
StorageLayout
)
var
GasPriceOracleDeployedBin
=
"0x608060405234801561001057600080fd5b50600436106100
a35760003560e01c806354fd4d5011610076578063de26c4a11161005b578063de26c4a114610101578063f45e65d814610114578063fe173b97146100fb57600080fd5b806354fd4d50146100e65780636ef25c3a146100fb57600080fd5b80630c18c162146100a8578063313ce567146100c357806349948e0e146100cb578063519b4bd3146100de575b600080fd5b6100b061011c565b6040519081526020015b60405180910390f35b6100b0600681565b6100b06100d9366004610587565b6101a6565b6100b0610207565b6100ee610268565b6040516100ba9190610686565b486100b0565b6100b061010f366004610587565b61030b565b6100b06103ba565b600073420000000000000000000000000000000000001573ffffffffffffffffffffffffffffffffffffffff16638b239f736040518163ffffffff1660e01b8152600401602060405180830381865afa15801561017d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906101a191906106d7565b905090565b6000806101b28361030b565b905060006101be610207565b6101c8908361071f565b905060006101d86006600a61087e565b905060006101e46103ba565b6101ee908461071f565b905060006101fc83836108c0565b979650505050505050565b600073420000000000000000000000000000000000001573ffffffffffffffffffffffffffffffffffffffff16635cf249696040518163ffffffff1660e01b8152600401602060405180830381865afa15801561017d573d6000803e3d6000fd5b60606102937f000000000000000000000000000000000000000000000000000000000000000061041b565b6102bc7f000000000000000000000000000000000000000000000000000000000000000061041b565b6102e57f000000000000000000000000000000000000000000000000000000000000000061041b565b6040516020016102f7939291906108d4565b604051602081830303815290604052905090565b80516000908190815b8181101561038e5784818151811061032e5761032e61094a565b01602001517fff000000000000000000000000000000000000000000000000000000000000001660000361036e57610367600484610979565b925061037c565b610379601084610979565b92505b8061038681610991565b915050610314565b50600061039961011c565b6103a39084610979565b90506103b181610440610979565b95945050505050565b600073420000000000000000000000000000000000001573ffffffffffffffffffffffffffffffffffffffff16639e8c49666040518163ffffffff1660e01b8152600401602060405180830381865afa15801561017d573d6000803e3d6000fd5b60608160000361045e57505060408051808201909152600181527f3000000000000000000000000000000000000000000000000000000000000000602082015290565b8160005b8115610488578061047281610991565b91506104819050600a836108c0565b9150610462565b60008167ffffffffffffffff8111156104a3576104a3610558565b6040519080825280601f01601f1916602001820160405280156104cd576020820181803683370190505b5090505b8415610550576104e26001836109c9565b91506104ef600a866109e0565b6104fa906030610979565b60f81b81838151811061050f5761050f61094a565b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a905350610549600a866108c0565b94506104d1565b949350505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b60006020828403121561059957600080fd5b813567ffffffffffffffff808211156105b157600080fd5b818401915084601f8301126105c557600080fd5b8135818111156105d7576105d7610558565b604051601f82017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0908116603f0116810190838211818310171561061d5761061d610558565b8160405282815287602084870101111561063657600080fd5b826020860160208301376000928101602001929092525095945050505050565b60005b83811015610671578181015183820152602001610659565b83811115610680576000848401525b50505050565b60208152600082518060208401526106a5816040850160208701610656565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169190910160400192915050565b6000602082840312156106e957600080fd5b5051919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b6000817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0483118215151615610757576107576106f0565b500290565b600181815b808511156107b557817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0482111561079b5761079b6106f0565b808516156107a857918102915b93841c9390800290610761565b509250929050565b6000826107cc57506001610878565b816107d957506000610878565b81600181146107ef57600281146107f957610815565b6001915050610878565b60ff84111561080a5761080a6106f0565b50506001821b610878565b5060208310610133831016604e8410600b8410161715610838575081810a610878565b610842838361075c565b807fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04821115610874576108746106f0565b0290505b92915050565b600061088a83836107bd565b9392505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b6000826108cf576108cf610891565b500490565b600084516108e6818460208901610656565b80830190507f2e000000000000000000000000000000000000000000000000000000000000008082528551610922816001850160208a01610656565b6001920191820152835161093d816002840160208801610656565b0160020195945050505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b6000821982111561098c5761098c6106f0565b500190565b60007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82036109c2576109c26106f0565b5060010190565b6000828210156109db576109db6106f0565b500390565b6000826109ef576109ef610891
565b50069056fea164736f6c634300080f000a"
var
GasPriceOracleDeployedBin
=
"0x608060405234801561001057600080fd5b50600436106100
be5760003560e01c806354fd4d5011610076578063de26c4a11161005b578063de26c4a114610123578063f45e65d814610136578063fe173b971461011d57600080fd5b806354fd4d50146101085780636ef25c3a1461011d57600080fd5b8063313ce567116100a7578063313ce567146100e657806349948e0e146100ed578063519b4bd31461010057600080fd5b80630c18c162146100c35780632e0f2625146100de575b600080fd5b6100cb61013e565b6040519081526020015b60405180910390f35b6100cb600681565b60066100cb565b6100cb6100fb3660046105a9565b6101c8565b6100cb610229565b61011061028a565b6040516100d591906106a8565b486100cb565b6100cb6101313660046105a9565b61032d565b6100cb6103dc565b600073420000000000000000000000000000000000001573ffffffffffffffffffffffffffffffffffffffff16638b239f736040518163ffffffff1660e01b8152600401602060405180830381865afa15801561019f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906101c391906106f9565b905090565b6000806101d48361032d565b905060006101e0610229565b6101ea9083610741565b905060006101fa6006600a6108a0565b905060006102066103dc565b6102109084610741565b9050600061021e83836108e2565b979650505050505050565b600073420000000000000000000000000000000000001573ffffffffffffffffffffffffffffffffffffffff16635cf249696040518163ffffffff1660e01b8152600401602060405180830381865afa15801561019f573d6000803e3d6000fd5b60606102b57f000000000000000000000000000000000000000000000000000000000000000061043d565b6102de7f000000000000000000000000000000000000000000000000000000000000000061043d565b6103077f000000000000000000000000000000000000000000000000000000000000000061043d565b604051602001610319939291906108f6565b604051602081830303815290604052905090565b80516000908190815b818110156103b0578481815181106103505761035061096c565b01602001517fff00000000000000000000000000000000000000000000000000000000000000166000036103905761038960048461099b565b925061039e565b61039b60108461099b565b92505b806103a8816109b3565b915050610336565b5060006103bb61013e565b6103c5908461099b565b90506103d38161044061099b565b95945050505050565b600073420000000000000000000000000000000000001573ffffffffffffffffffffffffffffffffffffffff16639e8c49666040518163ffffffff1660e01b8152600401602060405180830381865afa15801561019f573d6000803e3d6000fd5b60608160000361048057505060408051808201909152600181527f3000000000000000000000000000000000000000000000000000000000000000602082015290565b8160005b81156104aa5780610494816109b3565b91506104a39050600a836108e2565b9150610484565b60008167ffffffffffffffff8111156104c5576104c561057a565b6040519080825280601f01601f1916602001820160405280156104ef576020820181803683370190505b5090505b8415610572576105046001836109eb565b9150610511600a86610a02565b61051c90603061099b565b60f81b8183815181106105315761053161096c565b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a90535061056b600a866108e2565b94506104f3565b949350505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6000602082840312156105bb57600080fd5b813567ffffffffffffffff808211156105d357600080fd5b818401915084601f8301126105e757600080fd5b8135818111156105f9576105f961057a565b604051601f82017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0908116603f0116810190838211818310171561063f5761063f61057a565b8160405282815287602084870101111561065857600080fd5b826020860160208301376000928101602001929092525095945050505050565b60005b8381101561069357818101518382015260200161067b565b838111156106a2576000848401525b50505050565b60208152600082518060208401526106c7816040850160208701610678565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169190910160400192915050565b60006020828403121561070b57600080fd5b5051919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b6000817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff048311821515161561077957610779610712565b500290565b600181815b808511156107d757817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff048211156107bd576107bd610712565b808516156107ca57918102915b93841c9390800290610783565b509250929050565b6000826107ee5750600161089a565b816107fb5750600061089a565b8160018114610811576002811461081b57610837565b600191505061089a565b60ff84111561082c5761082c610712565b50506001821b61089a565b5060208310610133831016604e8410600b841016171561085a575081810a61089a565b610864838361077e565b807fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0482111561089657610896610712565b0290505b92915050565b60006108ac83836107df565b9392505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b6000826108f1576108f16108b3565b500490565b60008451610908818460208901610678565b80830190507f2e000000000000000000000000000000000000000000000000000000000000008082528551610944816001850160208a01610678565b6001920191820152835161095f816002840160208801610678565b0160020195945050505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b600082198211156109ae576109ae610712565b500190565b60007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82036109e4576109e4610712565b5060010190565b6000828210156109fd576109fd610712565b500390565b600082610a1157610a116108b3
565b50069056fea164736f6c634300080f000a"
func
init
()
{
func
init
()
{
if
err
:=
json
.
Unmarshal
([]
byte
(
GasPriceOracleStorageLayoutJSON
),
GasPriceOracleStorageLayout
);
err
!=
nil
{
if
err
:=
json
.
Unmarshal
([]
byte
(
GasPriceOracleStorageLayoutJSON
),
GasPriceOracleStorageLayout
);
err
!=
nil
{
...
...
This diff is collapsed.
Click to expand it.
packages/contracts-bedrock/.gas-snapshot
View file @
0df27c84
...
@@ -28,13 +28,14 @@ DeployerWhitelist_Test:test_owner_succeeds() (gas: 7538)
...
@@ -28,13 +28,14 @@ DeployerWhitelist_Test:test_owner_succeeds() (gas: 7538)
DeployerWhitelist_Test:test_storageSlots_succeeds() (gas: 33395)
DeployerWhitelist_Test:test_storageSlots_succeeds() (gas: 33395)
FeeVault_Test:test_constructor_succeeds() (gas: 10647)
FeeVault_Test:test_constructor_succeeds() (gas: 10647)
FeeVault_Test:test_minWithdrawalAmount_succeeds() (gas: 10668)
FeeVault_Test:test_minWithdrawalAmount_succeeds() (gas: 10668)
GasPriceOracle_Test:test_baseFee_succeeds() (gas: 8291)
GasPriceOracle_Test:test_baseFee_succeeds() (gas: 8280)
GasPriceOracle_Test:test_decimals_succeeds() (gas: 6145)
GasPriceOracle_Test:test_gasPrice_succeeds() (gas: 8294)
GasPriceOracle_Test:test_gasPrice_succeeds() (gas: 8294)
GasPriceOracle_Test:test_l1BaseFee_succeeds() (gas: 106
56
)
GasPriceOracle_Test:test_l1BaseFee_succeeds() (gas: 106
34
)
GasPriceOracle_Test:test_overhead_succeeds() (gas: 10
546
)
GasPriceOracle_Test:test_overhead_succeeds() (gas: 10
614
)
GasPriceOracle_Test:test_scalar_succeeds() (gas: 106
11
)
GasPriceOracle_Test:test_scalar_succeeds() (gas: 106
55
)
GasPriceOracle_Test:test_setGasPrice_doesNotExist_reverts() (gas: 5
910
)
GasPriceOracle_Test:test_setGasPrice_doesNotExist_reverts() (gas: 5
888
)
GasPriceOracle_Test:test_setL1BaseFee_doesNotExist_reverts() (gas: 5
910
)
GasPriceOracle_Test:test_setL1BaseFee_doesNotExist_reverts() (gas: 5
888
)
GovernanceToken_Test:test_approve_succeeds() (gas: 133293)
GovernanceToken_Test:test_approve_succeeds() (gas: 133293)
GovernanceToken_Test:test_burnFrom_succeeds() (gas: 122733)
GovernanceToken_Test:test_burnFrom_succeeds() (gas: 122733)
GovernanceToken_Test:test_burn_succeeds() (gas: 114610)
GovernanceToken_Test:test_burn_succeeds() (gas: 114610)
...
...
This diff is collapsed.
Click to expand it.
packages/contracts-bedrock/.storage-layout
View file @
0df27c84
...
@@ -154,6 +154,8 @@
...
@@ -154,6 +154,8 @@
| spacer_3_0_32 | uint256 | 3 | 0 | 32 | contracts/L2/GasPriceOracle.sol:GasPriceOracle |
| spacer_3_0_32 | uint256 | 3 | 0 | 32 | contracts/L2/GasPriceOracle.sol:GasPriceOracle |
|---------------+---------+------+--------+-------+------------------------------------------------|
|---------------+---------+------+--------+-------+------------------------------------------------|
| spacer_4_0_32 | uint256 | 4 | 0 | 32 | contracts/L2/GasPriceOracle.sol:GasPriceOracle |
| spacer_4_0_32 | uint256 | 4 | 0 | 32 | contracts/L2/GasPriceOracle.sol:GasPriceOracle |
|---------------+---------+------+--------+-------+------------------------------------------------|
| spacer_5_0_32 | uint256 | 5 | 0 | 32 | contracts/L2/GasPriceOracle.sol:GasPriceOracle |
+---------------+---------+------+--------+-------+------------------------------------------------+
+---------------+---------+------+--------+-------+------------------------------------------------+
=======================
=======================
...
...
This diff is collapsed.
Click to expand it.
packages/contracts-bedrock/contracts/L2/GasPriceOracle.sol
View file @
0df27c84
...
@@ -57,10 +57,17 @@ contract GasPriceOracle is Semver {
...
@@ -57,10 +57,17 @@ contract GasPriceOracle is Semver {
*/
*/
uint256 private spacer_4_0_32;
uint256 private spacer_4_0_32;
/**
* @custom:legacy
* @custom:spacer decimals
* @notice Spacer for backwards compatibility.
*/
uint256 private spacer_5_0_32;
/**
/**
* @notice Number of decimals used in the scalar.
* @notice Number of decimals used in the scalar.
*/
*/
uint256 public constant
decimals
= 6;
uint256 public constant
DECIMALS
= 6;
/**
/**
* @custom:semver 0.0.1
* @custom:semver 0.0.1
...
@@ -78,7 +85,7 @@ contract GasPriceOracle is Semver {
...
@@ -78,7 +85,7 @@ contract GasPriceOracle is Semver {
function getL1Fee(bytes memory _data) external view returns (uint256) {
function getL1Fee(bytes memory _data) external view returns (uint256) {
uint256 l1GasUsed = getL1GasUsed(_data);
uint256 l1GasUsed = getL1GasUsed(_data);
uint256 l1Fee = l1GasUsed * l1BaseFee();
uint256 l1Fee = l1GasUsed * l1BaseFee();
uint256 divisor = 10**
decimals
;
uint256 divisor = 10**
DECIMALS
;
uint256 unscaled = l1Fee * scalar();
uint256 unscaled = l1Fee * scalar();
uint256 scaled = unscaled / divisor;
uint256 scaled = unscaled / divisor;
return scaled;
return scaled;
...
@@ -129,6 +136,16 @@ contract GasPriceOracle is Semver {
...
@@ -129,6 +136,16 @@ contract GasPriceOracle is Semver {
return L1Block(Predeploys.L1_BLOCK_ATTRIBUTES).basefee();
return L1Block(Predeploys.L1_BLOCK_ATTRIBUTES).basefee();
}
}
/**
* @custom:legacy
* @notice Retrieves the number of decimals used in the scalar.
*
* @return Number of decimals used in the scalar.
*/
function decimals() public pure returns (uint256) {
return DECIMALS;
}
/**
/**
* @notice Computes the amount of L1 gas used for a transaction. Adds the overhead which
* @notice Computes the amount of L1 gas used for a transaction. Adds the overhead which
* represents the per-transaction gas overhead of posting the transaction and state
* represents the per-transaction gas overhead of posting the transaction and state
...
...
This diff is collapsed.
Click to expand it.
packages/contracts-bedrock/contracts/test/GasPriceOracle.t.sol
View file @
0df27c84
...
@@ -74,6 +74,11 @@ contract GasPriceOracle_Test is CommonTest {
...
@@ -74,6 +74,11 @@ contract GasPriceOracle_Test is CommonTest {
assertEq(gasOracle.overhead(), l1FeeOverhead);
assertEq(gasOracle.overhead(), l1FeeOverhead);
}
}
function test_decimals_succeeds() external {
assertEq(gasOracle.decimals(), 6);
assertEq(gasOracle.DECIMALS(), 6);
}
// Removed in bedrock
// Removed in bedrock
function test_setGasPrice_doesNotExist_reverts() external {
function test_setGasPrice_doesNotExist_reverts() external {
(bool success, bytes memory returndata) = address(gasOracle).call(
(bool success, bytes memory returndata) = address(gasOracle).call(
...
...
This diff is collapsed.
Click to expand it.
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