Skip to content

A repo to showcase how rust can be used to work with EVM contracts

Notifications You must be signed in to change notification settings

Ankvik-Tech-Labs/rust_evm_examples

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🌐 Rust EVM Contracts Interactions

A Rust application to fetch and display Uniswap V2 factory pair addresses using the ethers library and the Uniswap V2 Factory smart contract. The main objective of this repository is to showcase how rust can be used to interact with EVM based smart contracts.

🚀 Features

  • Fetches the total number of pools from the Uniswap V2 Factory contract.
  • Retrieves pair addresses up to a specified limit.
  • Displays results with colorful output.

🛠️ Prerequisites

📦 Dependencies

Add the following dependencies to your Cargo.toml file:

[dependencies]
ethers = "0.10.2"
eyre = "0.6"
tokio = { version = "1", features = ["full"] }
toml = "0.5"
colored = "2.0"

📂 Project Structure

.
├── Cargo.lock
├── Cargo.toml
├── config.toml
├── contracts
│   └── IUniswapV2Factory.sol
├── src
│   └── main.rs

⚙️ Configuration

Create a config.toml file with your RPC endpoint:

[rpc]
web3_endpoints = [
"https://eth-mainnet.g.alchemy.com/v2/your_api_key",
]

🏃‍♂️ Running the Application

Clone the repository and navigate to the project directory:

git clone https://github.com/Aviksaikat/uniswap-v2-factory-pairs-fetcher.git
cd uniswap-v2-factory-pairs-fetcher

Run the application:

cargo run

👩‍💻 Usage

The application will fetch and display Uniswap V2 pair addresses with colorful output, helping you visualize the data easily.

📜 License

This project is licensed under the MIT License - see the LICENSE file for details.

🙏 Acknowledgements

About

A repo to showcase how rust can be used to work with EVM contracts

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published