Skip to content

Commit

Permalink
update: new zenith addr (#4)
Browse files Browse the repository at this point in the history
* new zenith addr

* switch bindings to json file

fix: Zenith name

fix: re-export

fix: imports
  • Loading branch information
anna-carroll authored and prestwich committed May 2, 2024
1 parent b2503e0 commit 2e67e9c
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 903 deletions.
6 changes: 3 additions & 3 deletions crates/builder/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ use alloy_primitives::{address, Address};
use alloy_provider::ProviderBuilder;
use std::borrow::Cow;
use tokio::select;
use zenith_types::ZenithContract;
use zenith_types::Zenith;

use crate::service::serve_builder_with_span;

Expand Down Expand Up @@ -44,7 +44,7 @@ const HOLESKY: ChainConfig = ChainConfig {
host_chain_id: 17000,
ru_chain_id: 17001,
confirmation_buffer: 60 * 20,
zenith: address!("74ae65DF20cB0e3BF8c022051d0Cdd79cc60890C"),
zenith: address!("97C0E40c6B5bb5d4fa3e2AA1C6b8bC7EA5ECAe31"),
quincey_url: Cow::Borrowed("http://quincey.swanny.wtf:8080/signBlock"),
rpc_url: Cow::Borrowed("https://ethereum-holesky-rpc.publicnode.com"),
local_sequencer_signer: None,
Expand Down Expand Up @@ -72,7 +72,7 @@ async fn main() -> eyre::Result<()> {
.signer(EthereumSigner::from(wallet))
.on_builtin(&config.rpc_url)
.await?;
let zenith = ZenithContract::new(config.zenith, provider.clone());
let zenith = Zenith::new(config.zenith, provider.clone());

let build = tasks::block::BlockBuilder { wait_secs: 5 };
let submit = tasks::submit::SubmitTask {
Expand Down
14 changes: 7 additions & 7 deletions crates/builder/src/tasks/submit.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ use alloy_transport::BoxTransport;
use tokio::{sync::mpsc, task::JoinHandle, try_join};
use zenith_types::SignRequest;

use crate::ZenithContract::{self, ZenithContractInstance};
use crate::Zenith::{self, ZenithInstance};

use super::block::InProgressBlock;

Expand All @@ -19,7 +19,7 @@ pub struct SubmitTask<P> {
pub provider: P,

/// Zenity
pub zenith: ZenithContractInstance<BoxTransport, P>,
pub zenith: ZenithInstance<BoxTransport, P>,

/// Reqwest
pub client: reqwest::Client,
Expand Down Expand Up @@ -98,13 +98,13 @@ where

fn build_blob_tx(
&self,
header: ZenithContract::BlockHeader,
header: Zenith::BlockHeader,
v: u8,
r: FixedBytes<32>,
s: FixedBytes<32>,
in_progress: &InProgressBlock,
) -> TransactionRequest {
let data = ZenithContract::submitBlockCall {
let data = Zenith::submitBlockCall {
header,
blockDataHash: in_progress.contents_hash(),
v,
Expand All @@ -120,13 +120,13 @@ where

fn build_calldata_tx(
&self,
header: ZenithContract::BlockHeader,
header: Zenith::BlockHeader,
v: u8,
r: FixedBytes<32>,
s: FixedBytes<32>,
in_progress: &InProgressBlock,
) -> TransactionRequest {
let data = ZenithContract::submitBlockCall {
let data = Zenith::submitBlockCall {
header,
blockDataHash: in_progress.contents_hash(),
v,
Expand All @@ -148,7 +148,7 @@ where
let r: FixedBytes<32> = signature.r().into();
let s: FixedBytes<32> = signature.s().into();

let header = ZenithContract::BlockHeader {
let header = Zenith::BlockHeader {
rollupChainId: U256::from(self.config.ru_chain_id),
sequence: sig_request.sequence,
gasLimit: sig_request.gas_limit,
Expand Down
1 change: 1 addition & 0 deletions crates/types/abi/zenith.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
[{"inputs":[{"internalType":"uint256","name":"defaultRollupChainId","type":"uint256"},{"internalType":"address","name":"admin","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"AccessControlBadConfirmation","type":"error"},{"inputs":[{"internalType":"uint48","name":"schedule","type":"uint48"}],"name":"AccessControlEnforcedDefaultAdminDelay","type":"error"},{"inputs":[],"name":"AccessControlEnforcedDefaultAdminRules","type":"error"},{"inputs":[{"internalType":"address","name":"defaultAdmin","type":"address"}],"name":"AccessControlInvalidDefaultAdmin","type":"error"},{"inputs":[{"internalType":"address","name":"account","type":"address"},{"internalType":"bytes32","name":"neededRole","type":"bytes32"}],"name":"AccessControlUnauthorizedAccount","type":"error"},{"inputs":[{"internalType":"uint256","name":"expected","type":"uint256"}],"name":"BadSequence","type":"error"},{"inputs":[{"internalType":"address","name":"derivedSequencer","type":"address"}],"name":"BadSignature","type":"error"},{"inputs":[],"name":"BlockExpired","type":"error"},{"inputs":[],"name":"OneRollupBlockPerHostBlock","type":"error"},{"inputs":[],"name":"OrderExpired","type":"error"},{"inputs":[{"internalType":"uint8","name":"bits","type":"uint8"},{"internalType":"uint256","name":"value","type":"uint256"}],"name":"SafeCastOverflowedUintDowncast","type":"error"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"bytes","name":"blockData","type":"bytes"}],"name":"BlockData","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"sequencer","type":"address"},{"components":[{"internalType":"uint256","name":"rollupChainId","type":"uint256"},{"internalType":"uint256","name":"sequence","type":"uint256"},{"internalType":"uint256","name":"confirmBy","type":"uint256"},{"internalType":"uint256","name":"gasLimit","type":"uint256"},{"internalType":"address","name":"rewardAddress","type":"address"}],"indexed":true,"internalType":"struct Zenith.BlockHeader","name":"header","type":"tuple"},{"indexed":false,"internalType":"bytes32","name":"blockDataHash","type":"bytes32"}],"name":"BlockSubmitted","type":"event"},{"anonymous":false,"inputs":[],"name":"DefaultAdminDelayChangeCanceled","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint48","name":"newDelay","type":"uint48"},{"indexed":false,"internalType":"uint48","name":"effectSchedule","type":"uint48"}],"name":"DefaultAdminDelayChangeScheduled","type":"event"},{"anonymous":false,"inputs":[],"name":"DefaultAdminTransferCanceled","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"newAdmin","type":"address"},{"indexed":false,"internalType":"uint48","name":"acceptSchedule","type":"uint48"}],"name":"DefaultAdminTransferScheduled","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"rollupChainId","type":"uint256"},{"indexed":true,"internalType":"address","name":"token","type":"address"},{"indexed":true,"internalType":"address","name":"rollupRecipient","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"Enter","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"rollupChainId","type":"uint256"},{"indexed":true,"internalType":"address","name":"token","type":"address"},{"indexed":true,"internalType":"address","name":"hostRecipient","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"ExitFilled","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"bytes32","name":"previousAdminRole","type":"bytes32"},{"indexed":true,"internalType":"bytes32","name":"newAdminRole","type":"bytes32"}],"name":"RoleAdminChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"sender","type":"address"}],"name":"RoleGranted","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"sender","type":"address"}],"name":"RoleRevoked","type":"event"},{"stateMutability":"payable","type":"fallback"},{"inputs":[],"name":"DEFAULT_ADMIN_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"SEQUENCER_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"acceptDefaultAdminTransfer","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newAdmin","type":"address"}],"name":"beginDefaultAdminTransfer","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"components":[{"internalType":"uint256","name":"rollupChainId","type":"uint256"},{"internalType":"uint256","name":"sequence","type":"uint256"},{"internalType":"uint256","name":"confirmBy","type":"uint256"},{"internalType":"uint256","name":"gasLimit","type":"uint256"},{"internalType":"address","name":"rewardAddress","type":"address"}],"internalType":"struct Zenith.BlockHeader","name":"header","type":"tuple"},{"internalType":"bytes32","name":"blockDataHash","type":"bytes32"}],"name":"blockCommitment","outputs":[{"internalType":"bytes32","name":"commit","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"cancelDefaultAdminTransfer","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint48","name":"newDelay","type":"uint48"}],"name":"changeDefaultAdminDelay","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"defaultAdmin","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"defaultAdminDelay","outputs":[{"internalType":"uint48","name":"","type":"uint48"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"defaultAdminDelayIncreaseWait","outputs":[{"internalType":"uint48","name":"","type":"uint48"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"rollupChainId","type":"uint256"},{"internalType":"address","name":"rollupRecipient","type":"address"},{"internalType":"address","name":"token","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"enter","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"uint256","name":"rollupChainId","type":"uint256"},{"internalType":"address","name":"rollupRecipient","type":"address"}],"name":"enter","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"components":[{"internalType":"uint256","name":"rollupChainId","type":"uint256"},{"internalType":"address","name":"token","type":"address"},{"internalType":"address","name":"recipient","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"internalType":"struct Passage.ExitOrder[]","name":"orders","type":"tuple[]"}],"name":"fulfillExits","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"}],"name":"getRoleAdmin","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"grantRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"hasRole","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"lastSubmittedAtBlock","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"nextSequence","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pendingDefaultAdmin","outputs":[{"internalType":"address","name":"newAdmin","type":"address"},{"internalType":"uint48","name":"schedule","type":"uint48"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pendingDefaultAdminDelay","outputs":[{"internalType":"uint48","name":"newDelay","type":"uint48"},{"internalType":"uint48","name":"schedule","type":"uint48"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"renounceRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"revokeRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"rollbackDefaultAdminDelay","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"components":[{"internalType":"uint256","name":"rollupChainId","type":"uint256"},{"internalType":"uint256","name":"sequence","type":"uint256"},{"internalType":"uint256","name":"confirmBy","type":"uint256"},{"internalType":"uint256","name":"gasLimit","type":"uint256"},{"internalType":"address","name":"rewardAddress","type":"address"}],"internalType":"struct Zenith.BlockHeader","name":"header","type":"tuple"},{"internalType":"bytes32","name":"blockDataHash","type":"bytes32"},{"internalType":"uint8","name":"v","type":"uint8"},{"internalType":"bytes32","name":"r","type":"bytes32"},{"internalType":"bytes32","name":"s","type":"bytes32"},{"internalType":"bytes","name":"blockData","type":"bytes"}],"name":"submitBlock","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes4","name":"interfaceId","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"stateMutability":"payable","type":"receive"}]
Loading

0 comments on commit 2e67e9c

Please sign in to comment.