INNER CODE UNIT · Rust

get_contract

yourarj/token-listing-sniper-bot · src/util/mod.rs:25

    pub fn get_contract(
        contract_address: &Address,
        abi_path: &str,
        provider: Arc<Provider<Http>>,
    ) -> Contract<Provider<Http>> {
        let file =
            std::fs::read_to_string(abi_path).expect("something went wrong while reading abi file");

        Contract::new(
            *contract_address,
            serde_json::from_str::<Abi>(&file).expect(""),
            provider,
        )
    }

    #[instrument]
    pub async fn do_prerequisites(
        token_contract: &Bep20Token,

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…