Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add mocked OVM Gas Oracle #1963

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Use withMock toml
  • Loading branch information
leomassazza committed Dec 7, 2023
commit 46ea00ff6119b2e12e79bcc0b02522877cc9dc09
40 changes: 1 addition & 39 deletions auxiliary/OpGasPriceOracle/cannonfile.test.toml
Original file line number Diff line number Diff line change
@@ -1,40 +1,2 @@
name = "op-gas-price-oracle"
version = "<%= package.version %>-testable"

[setting.baseFee]
defaultValue = "30000000"

[setting.gasPrice]
defaultValue = "30000000"

[setting.l1BaseFee]
defaultValue = "50000000000"

[setting.overhead]
defaultValue = "200"

[setting.scalar]
defaultValue = "684000"

[setting.internall1GasUsed]
defaultValue = "10000"

[setting.internall1Fee]
defaultValue = "1000"

[contract.mockOVMGasPriceOracle]
artifact = "contracts/mocks/MockOVMGasPriceOracle.sol:MockOVMGasPriceOracle"
args = [
"<%= settings.gasPrice %>",
"<%= settings.overhead %>",
"<%= settings.baseFee %>",
"<%= settings.l1BaseFee %>",
"<%= settings.scalar %>",
"<%= settings.internall1GasUsed %>",
"<%= settings.internall1Fee %>"
]

[contract.OpGasPriceOracle]
artifact = "contracts/OpGasPriceOracle.sol:OpGasPriceOracle"
args = ["<%= contracts.mockOVMGasPriceOracle.address %>"]
create2 = true
include = ["cannonfile.toml"]
39 changes: 39 additions & 0 deletions auxiliary/OpGasPriceOracle/cannonfile.withMock.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name = "op-gas-price-oracle-mock"
version = "<%= package.version %>"

[setting.baseFee]
defaultValue = "30000000"

[setting.gasPrice]
defaultValue = "30000000"

[setting.l1BaseFee]
defaultValue = "50000000000"

[setting.overhead]
defaultValue = "200"

[setting.scalar]
defaultValue = "684000"

[setting.internall1GasUsed]
defaultValue = "10000"

[setting.internall1Fee]
defaultValue = "1000"

[contract.mockOVMGasPriceOracle]
artifact = "contracts/mocks/MockOVMGasPriceOracle.sol:MockOVMGasPriceOracle"
args = [
"<%= settings.gasPrice %>",
"<%= settings.overhead %>",
"<%= settings.baseFee %>",
"<%= settings.l1BaseFee %>",
"<%= settings.scalar %>",
"<%= settings.internall1GasUsed %>",
"<%= settings.internall1Fee %>"
]

[contract.OpGasPriceOracle]
artifact = "contracts/OpGasPriceOracle.sol:OpGasPriceOracle"
args = ["<%= contracts.mockOVMGasPriceOracle.address %>"]
1 change: 1 addition & 0 deletions auxiliary/OpGasPriceOracle/package.json
Original file line number Diff line number Diff line change
@@ -12,6 +12,7 @@
"build": "yarn build:contracts",
"build:contracts": "hardhat storage:verify && hardhat cannon:build",
"build-testable": "CANNON_REGISTRY_PRIORITY=local hardhat cannon:build cannonfile.test.toml",
"build-mock": "CANNON_REGISTRY_PRIORITY=local hardhat cannon:build cannonfile.withMock.toml",
"check:storage": "git diff --exit-code storage.dump.sol",
"compile-contracts": "hardhat compile",
"size-contracts": "hardhat compile && hardhat size-contracts",