diff --git a/src/chain.rs b/src/chain.rs index 9a0d139..d6d0587 100644 --- a/src/chain.rs +++ b/src/chain.rs @@ -1,22 +1,14 @@ -use std::sync::Arc; - -// use alloy_primitives::{address, Address, Bytes}; -// use alloy_provider::Provider; -// use alloy_rpc_types::{Filter, TransactionInput, TransactionRequest}; -// use alloy_sol_macro::sol; -// use alloy_sol_types::{SolCall, SolEvent}; +use crate::chain_list::{ChainListProvider, CHAINS}; +use crate::controller::{ControllerCommands, ControllerInterface}; +use crate::premints::zora_premint_v2::types::PREMINT_FACTORY_ADDR; +use crate::types::{InclusionClaim, Premint, PremintTypes}; use alloy::primitives::{address, Address, Bytes, TxKind}; use alloy::providers::Provider; use alloy::rpc::types::eth::{BlockId, Filter, TransactionInput, TransactionRequest}; use alloy::sol; use alloy::sol_types::{SolCall, SolEvent}; - use futures_util::StreamExt; - -use crate::chain_list::{ChainListProvider, CHAINS}; -use crate::controller::{ControllerCommands, ControllerInterface}; -use crate::premints::zora_premint_v2::types::PREMINT_FACTORY_ADDR; -use crate::types::{InclusionClaim, Premint, PremintTypes}; +use std::sync::Arc; /// Helper function for calling view functions for SolCall types pub async fn view_contract_call( diff --git a/src/chain_list.rs b/src/chain_list.rs index 6025d5a..563a494 100644 --- a/src/chain_list.rs +++ b/src/chain_list.rs @@ -1,21 +1,14 @@ -use std::sync::Arc; -use std::time::Duration; - -use alloy::network::{Ethereum, Network}; -// use alloy::providers::layers; -use alloy::providers::fillers::{ChainIdFiller, FillProvider, GasFiller, JoinFill, NonceFiller}; -use alloy::providers::{Identity, ProviderBuilder, RootProvider}; +use alloy::network::Network; +use alloy::providers::{ProviderBuilder, RootProvider}; use alloy::pubsub::PubSubFrontend; use alloy::rpc::client::WsConnect; - -// use alloy_provider::layers::{GasEstimatorProvider, ManagedNonceProvider}; -// use alloy_provider::{Identity, ProviderBuilder, RootProvider}; -// use alloy_rpc_client::WsConnect; use eyre::ContextCompat; use mini_moka::sync::Cache; use once_cell::sync::Lazy; use regex::Regex; use serde::{Deserialize, Serialize}; +use std::sync::Arc; +use std::time::Duration; const CHAINS_JSON: &str = include_str!("../data/chains.json"); @@ -82,14 +75,7 @@ impl Chains { Some(provider) => Ok(provider), None => { let conn = WsConnect::new(url); - let provider = ProviderBuilder::new() - // .with_recommended_fillers() - .on_ws(conn) - .await?; - // let provider: ChainListProvider = ProviderBuilder::::default() - // .with_recommended_layers() - // .on_ws(conn) - // .await?; + let provider = ProviderBuilder::new().on_ws(conn).await?; let arc = Arc::new(provider); diff --git a/src/premints/zora_premint_v2/rules.rs b/src/premints/zora_premint_v2/rules.rs index 07861ea..0ce62fd 100644 --- a/src/premints/zora_premint_v2/rules.rs +++ b/src/premints/zora_premint_v2/rules.rs @@ -1,10 +1,3 @@ -use std::str::FromStr; - -// use alloy_primitives::Signature; -// use alloy_sol_types::SolStruct; -use alloy::primitives::Signature; -use alloy::sol_types::SolStruct; - use crate::chain::view_contract_call; use crate::premints::zora_premint_v2::types::{ IZoraPremintV2, ZoraPremintV2, PREMINT_FACTORY_ADDR, @@ -14,6 +7,9 @@ use crate::rules::{Evaluation, Rule, RuleContext}; use crate::storage::Reader; use crate::types::PremintTypes; use crate::{ignore, reject, typed_rule}; +use alloy::primitives::Signature; +use alloy::sol_types::SolStruct; +use std::str::FromStr; // create premint v2 rule implementations here diff --git a/src/storage.rs b/src/storage.rs index 398a446..de27e99 100644 --- a/src/storage.rs +++ b/src/storage.rs @@ -1,6 +1,5 @@ -use std::str::FromStr; - -// use alloy_primitives::Address; +use crate::config::Config; +use crate::types::{InclusionClaim, Premint, PremintName, PremintTypes}; use alloy::primitives::Address; use async_trait::async_trait; use eyre::WrapErr; @@ -8,9 +7,7 @@ use serde::{Deserialize, Serialize}; use sqlx::sqlite::SqliteConnectOptions; use sqlx::Row; use sqlx::{QueryBuilder, Sqlite, SqlitePool}; - -use crate::config::Config; -use crate::types::{InclusionClaim, Premint, PremintName, PremintTypes}; +use std::str::FromStr; async fn init_db(config: &Config) -> SqlitePool { let expect_msg =