Skip to content

Commit 3947ada

Browse files
committed
support for building andromeda testnet on local
accomplishes this by detecting the chain id of the currently building network. if its local, it replaces problematic oracle nodes with constant nodes otherwise, the deployed network extremely closely resembles what is actually deployed to testnet, even after upgrades. this would be suitable for building a non-fork sandbox of any network (although right now its only tested with andromeda testnet)
1 parent 64a6ff5 commit 3947ada

File tree

4 files changed

+9
-9
lines changed

4 files changed

+9
-9
lines changed

tomls/oracles/perps-keeper-cost.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,10 @@ options.salt = "<%= settings.salt %>"
99
target = ["system.oracle_manager.Proxy"]
1010
func = "registerNode"
1111
args = [
12-
# 2 = external node
13-
2,
12+
# 2 = external node, 8 = constant node
13+
"<%= chainId == 13370 ? 8 : 2 %>",
1414
# 7 parameters: 1 is the external node contract address, 2 to 7 gas units
15-
"<%= defaultAbiCoder.encode(['address', 'uint256', 'uint256', 'uint256', 'uint256', 'uint256', 'uint256'], [imports.perps_gas_oracle_node.contracts.OpGasPriceOracle.address, settings.perps_keeper_l1_cost_settle_gas_units, settings.perps_keeper_l2_cost_settle_gas_units, settings.perps_keeper_l1_cost_flag_gas_units, settings.perps_keeper_l2_cost_flag_gas_units, settings.perps_keeper_l1_cost_liquidate_gas_units, settings.perps_keeper_l2_cost_liquidate_gas_units]) %>",
15+
"<%= chainId == 13370 ? defaultAbiCoder.encode(['uint256'], [parseEther('0.001')]) : defaultAbiCoder.encode(['address', 'uint256', 'uint256', 'uint256', 'uint256', 'uint256', 'uint256'], [imports.perps_gas_oracle_node.contracts.OpGasPriceOracle.address, settings.perps_keeper_l1_cost_settle_gas_units, settings.perps_keeper_l2_cost_settle_gas_units, settings.perps_keeper_l1_cost_flag_gas_units, settings.perps_keeper_l2_cost_flag_gas_units, settings.perps_keeper_l1_cost_liquidate_gas_units, settings.perps_keeper_l2_cost_liquidate_gas_units]) %>",
1616
[]
1717
]
1818
extra.perps_keeper_cost_eth_oracle_id.event = "NodeRegistered"

tomls/oracles/pyth-btc.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ include = ["../core.toml"]
66
target = ["system.oracle_manager.Proxy"]
77
func = "registerNode"
88
args = [
9-
5, # 5 = pyth aggregator type
10-
"<%= defaultAbiCoder.encode(['address', 'bytes32', 'bool'], [settings.pyth_price_verification_address, settings.pythBtcFeedId, false]) %>",
9+
"<%= chainId == 13370 ? 8 : 5 %>", # 5 = pyth aggregator type, 8 = constant node
10+
"<%= chainId == 13370 ? defaultAbiCoder.encode(['uint256'], [parseEther('1')]) : defaultAbiCoder.encode(['address', 'bytes32', 'bool'], [settings.pyth_price_verification_address, settings.pythBtcFeedId, false]) %>",
1111
[]
1212
]
1313
extra.btc_pyth_oracle_id.event = "NodeRegistered"

tomls/oracles/pyth-eth.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ include = ["../core.toml"]
66
target = ["system.oracle_manager.Proxy"]
77
func = "registerNode"
88
args = [
9-
5, # 5 = pyth aggregator type
10-
"<%= defaultAbiCoder.encode(['address', 'bytes32', 'bool'], [settings.pyth_price_verification_address, settings.pythEthFeedId, false]) %>",
9+
"<%= chainId == 13370 ? 8 : 5 %>", # 5 = pyth aggregator type, 8 = constant node
10+
"<%= chainId == 13370 ? defaultAbiCoder.encode(['uint256'], [parseEther('1')]) : defaultAbiCoder.encode(['address', 'bytes32', 'bool'], [settings.pyth_price_verification_address, settings.pythEthFeedId, false]) %>",
1111
[]
1212
]
1313
extra.eth_pyth_oracle_id.event = "NodeRegistered"

tomls/oracles/pyth-snx.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ include = ["../core.toml"]
66
target = ["system.oracle_manager.Proxy"]
77
func = "registerNode"
88
args = [
9-
5, # 5 = pyth aggregator type
10-
"<%= defaultAbiCoder.encode(['address', 'bytes32', 'bool'], [settings.pyth_price_verification_address, settings.pythSnxFeedId, false]) %>",
9+
"<%= chainId == 13370 ? 8 : 5 %>", # 5 = pyth aggregator type, 8 = constant node
10+
"<%= chainId == 13370 ? defaultAbiCoder.encode(['uint256'], [parseEther('1')]) : defaultAbiCoder.encode(['address', 'bytes32', 'bool'], [settings.pyth_price_verification_address, settings.pythSnxFeedId, false]) %>",
1111
[]
1212
]
1313
extra.snx_pyth_oracle_id.event = "NodeRegistered"

0 commit comments

Comments
 (0)