/r/ethdev
Ethereum-related dev talk:
Contracts, DApps, Wallets, Clients, Infrastructure, Tooling, UIs, Patterns, and others.
No specific rules are enforced apart from the normal global reddit rules.
Updated faucets for 2022:
https://goerlifaucet.com (new since March)
Updated faucet for 2021:
Older faucets (some might be broken):
For Rinkeby, Ropsten, Kovan, Goerli Testnet Ethers: Get them here and here
For more Görli Testnet Ethers: Get them here
For more Ropsten Testnet Ethers: Get them here
http://ethereum.stackexchange.com/ - The Ethereum Programming Stack Exchange
r/EthDevJobs - To find Jobs, and posting you're Hiring
r/ethereum - Offical sub, for discussion of Tech and Application Development using Ethereum.
r/ethfinance - A community for investors, traders, users, developers, and others to discuss Ethereum and its cryptocurrency ETH.
r/ethtrader - Trading sub, for price discussion of Ether and other cryptocurrencies
r/ethstaker - About staking your ETH: help and guidance
r/EtherMining - Ether Mining discussion.
r/ethereumnoobies - Ethereum for newbies
Others: r/ethtraderpro, r/cryptocurrency
/r/ethdev
I want a bot to do one thing, let me explain:
Normal users, use Metamask in their browser, to interact with Dapps. When they click a button for transaction, the metamask then asks the frontend for "transaction data", then the response will be attack to window.ethereum object, then Metamask use the info to display below page.
Please correct me if my understanding is wrong.
The thing I want to do is, have my NodeJS bot to retrieve transaction data too, so I can base on it to automate transactions, but how can I do that?
Appreciated!
Hi all,
I am learning to build a bot, going auto transaction for me. For me to do this, I need a wallet (I am using metamask) that show me all the transactions details so I can put it in my code to interact with smart contracts. But metamask seems to be horrible at this, is there any wallet recommended?
Hi all,
I am a dev, I want to know how to get the full form of the salt, clicking "?" won't help, this is frustrating.
I’m looking for an Ethereum smart contract developer to assist with a honeypot token issue. $3 million in the token and have confirmed successful transactions exchanging it for WETH on the network. Currently, I’m unable to sell the token, and my goal is to recover my investment. I need someone with experience in custom smart contracts, MEV bots, or alternative transaction routes to facilitate a solution. A generous payment will be offered for a successful resolution. Token details and contract address will be shared privately with qualified candidates. Please provide relevant experience and availability.
One of the major strengths the Internet Computer (ICP) has over other blockchains is its ability to hold Ethereum, Bitcoin, and other assets natively. Not only can ICP smart contracts hold these assets, but they can also interact with smart contracts on other chains.
IC-Alloy is a fork of the Rust-based Ethereum support library Alloy. The goal of IC-Alloy is to vastly simplify interactions with EVM-based blockchains from the Internet Computer.
In this article, we will explore the features of the IC-Alloy library, how you can use it to interact with Ethereum, and what kind of Chain Fusion use cases it enables.
TL;DR:
IC-Alloy extends Alloy with the following features:
IC-Alloy has examples!
Before we dive into the details of IC-Alloy, let's first talk about what we mean when we say that ICP can hold assets natively on other chains.
Basics first, here is a refresher on what it means to hold assets on a blockchain. If you are a seasoned blockchain developer you might consider skipping this section.
When you hold an asset on a blockchain, it means you have a balance connected to an address that you control. The address is derived from a cryptographic hash of a public key, while the balance is simply a number representing the amount of the asset you own.
The balance is recorded on the blockchain’s ledger, and you can transfer it to other addresses by signing transactions with your private key. Whoever controls the private key linked to an address effectively controls the assets at that address.
Each blockchain uses a cryptographic scheme that defines how keys and addresses are generated, how messages are signed, and how signatures are verified.
The key to ICP being able to hold assets natively on other chains is that ICP supports more than one cryptographic scheme! In addition to the scheme used by ICP itself, ICP also supports the following schemes:
ICP supports a powerful cryptographic technology called threshold signatures that allows multiple parties to collaboratively sign messages without exposing their private keys. This technology enables ICP smart contracts to securely derive addresses on behalf of users and sign transactions on other blockchains. Users in turn authenticate and interact with these smart contracts to manage their assets.
To learn more about this, check out my recent article: What the Schnorr?! Threshold Signatures on the Internet Computer.
Alloy is a Rust library providing a comprehensive toolset for encoding, decoding, and constructing various Ethereum-specific data types, including transaction and contract objects. Alloy supports the creation of Ethereum-compatible applications by offering developers a type-safe, performant, and ergonomic API for interfacing with Ethereum’s core primitives and executing tasks like building, signing, and decoding transactions.
Alloy is a great library for Rust developers working with Ethereum, but it lacks built-in support for ICP. This is where IC-Alloy comes in.
Luckily, Alloy is designed to be modular and easily extensible. This makes it possible to fork Alloy and add support for ICP without having to rewrite the entire library from scratch.
Smart contracts on ICP are called "canisters." Canisters are composable and can call each other, making it possible to build complex applications by combining multiple canisters.
To interact with Ethereum, application canisters make calls to the EVM RPC canister. This canister acts as a gateway between the Internet Computer and Ethereum, allowing canisters to send requests to Ethereum's JSON-RPC API and receive responses.
The EVM RPC canister in turn uses another core feature of ICP—HTTPS Outcalls—making it possible for smart contracts to communicate with the outside world.
IC-Alloy adds an ICP Transport Layer to Alloy, abstracting away the complexity of routing requests through the EVM RPC canister or an external RPC proxy. This layer ensures that all requests to Ethereum are routed correctly and that requests and responses are properly typed, serialized, etc.
Alloy signers are responsible for... you guessed it... signing transactions. Alloy offers some built-in signers for using Ledger and Trezor physical wallets, as well as various software signers for signing transactions in memory where the private key is accessible to the program.
IC-Alloy extends Alloy with an ICP Signer that taps into the threshold signature capabilities of ICP. A canister never has direct access to the private keys used to sign transactions. Instead, the canister sends a request to the subnet nodes, which collaboratively generate the signature using a threshold signing protocol.
Alloy providers facilitate the interaction with Ethereum by managing JSON-RPC requests and responses. Providers offer utility functions for common tasks like querying the state of a smart contract, sending transactions, and estimating gas costs.
The ICP Provider in IC-Alloy extends the Alloy provider with ICP-specific functionality. For example, ICP canisters cannot easily work with the popular Rust library Tokio, as it is not fully compatible with the Internet Computer. Instead, ICP canisters have to rely on IC timers to do things like waiting for a transaction to be mined or subscribing to log events.
Let's do a walkthrough of how to use IC-Alloy to get the balance of an ERC-20 token on Ethereum. This should give you a good idea of how IC-Alloy works and how you can use it in your own projects.
You’ll find more docs, examples, etc., on the IC-Alloy website.
To use the ICP-enabled fork of Alloy in your project, add this to Cargo.toml
:
alloy = { git = "https://github.com/ic-alloy/ic-alloy.git", tag = "v0.3.5-icp.0", features = ["icp"]}
One of the greatest features of the Alloy library is the sol!()
macro that lets you read and parse Solidity source code. This means we can head over to Etherscan and just copy the interfaces we are interested in. Alloy does all the heavy lifting, converting the interfaces into Rust code that we can use in our project.
sol!(
#[sol(rpc)]
"sol/IERC20.sol"
);
Before we break down the code, here is the full get_balance
function:
#[ic_cdk::update]
async fn get_balance(address: String) -> Result<String, String> {
let address = address.parse::<Address>().map_err(|e| e.to_string())?;
let rpc_service = RpcService::EthSepolia(EthSepoliaService::Alchemy);
let config = IcpConfig::new(rpc_service);
let provider = ProviderBuilder::new().on_icp(config);
let usdc = IERC20::new(token_address, provider);
let result = usdc.balanceOf(address).call().await;
match result {
Ok(balance) => Ok(balance._0.to_string()),
Err(e) => Err(e.to_string()),
}
}
let address = address.parse::<Address>().map_err(|e| e.to_string())?;
First, we parse the address string into an Alloy Address
type. This ensures that the address is valid and causes the function to return an error if it is not.
let rpc_service = RpcService::EthSepolia(EthSepoliaService::Alchemy);
Next, we create an RpcService
that instructs the EVM RPC canister to use Alchemy as the RPC provider. See the list of RPC providers the EVM RPC canister supports.
let config = IcpConfig::new(rpc_service);
The config object determines the behavior of the ICP provider and transport when making the request. The new
function takes the RpcService
we created in the previous step and uses default values for the other fields.
let provider = ProviderBuilder::new().on_icp(config);
The ProviderBuilder
is a helper that allows you to create a provider with a specific configuration. In this case, we use the on_icp
method to create a provider that uses the ICP transport layer.
let usdc = IERC20::new(token_address, provider);
How great is this!? We can just create an instance of the IERC20 contract by calling the new
method on the IERC20
struct. The new
method takes the address of the contract and the provider we created in the previous step.
Once set up, we have access to all contract methods defined in the IERC20 interface.
let result = usdc.balanceOf(address).call().await;
Finally, we call the balanceOf
method on the contract to get the balance of the address. The method returns a Result
that we can match on to get the balance or an error.
You have seen how the threshold signature technology of ICP together with IC-Alloy makes it super easy to interact with Ethereum from ICP smart contracts.
With Internet Computer lingo, we call these multi chain applications “Chain Fusion” applications. By Chain Fusion, we mean applications that seamlessly fuse together blockchains without the need for intermediaries.
Examples of Chain Fusion use cases include:
IC-Alloy comes with a collection of examples on how to perform common EVM operations, build wallets, and even create autonomous agents:
Let's build!
hi guys can anyone sent me sepolia for testnet project i had search alot but didnt get nothing all the site that i find says i need ETH maint on my wallet but i dont have already so if anyone sent me some sepolia i will be grateful to him that my address : 0x226ECC7C22E7432193A86c66B4Dc948b2371d433
I am writing a new Blockchain and I want it to be able to execute contracts written in solidity. Is it possible to run a compiled solidity smart contract outside the Blockchain ? I want to do it locally without instantiating a local node.
Any suggestions?
Hey, we are looking for a frontend dev with an atleast intermediate level of expertise(f.e. deploying the frontend to Swaps) to help us in a Hackathon we are a part of. The Protocol is already deployed, with a lot of the functions but our main frontend engineer, is busy until the end of the year.
If everything succeeds we want to employ you after the hackathon.
If you have any interest dm me or write here. Thanks in advance for your reply!
I added track and trace functionality to my supply chain dApp, Scalar. The use case is the EU directive on deforestation but it can be applied to similar scenarios.
Video presentation here.
Hey everyone,
I’m building a platform to help open-source Web3 projects get issues resolved faster while helping devs earn some money. The idea is:
We’re focused on solving common issues with existing platforms, like low-value bounties or too much competition for tasks by using a claim system to reduce redundant work and allowing anybody to fund any issue.
Right now, we’re in the early stages and have a coming soon page where you can sign up for updates: bountybolt.com
Would love to get any thoughts on the concept! What features would make this useful for a developer? Anything you’d like to see?
Any feedback is invaluable and could shape how we build this. Thanks in advance for sharing your thoughts 🙏
I was a data analyst, but due to some emergencies at home had to leave my job a year back. I am planning to get back to pace, want to learn web3/blockchain development and at the same time I am a bit skeptical about the job market for the same or how is the freelance market for web3? Please help me out how do I proceed?
Hi,
I’m not promoting my idea but sharing the context:
Context - looking at launching a platform that tokenises investment into startups and patents coming out of top universities. Democratising access to this opportunities + access to ordinary people to invest in them. Already building a team/dev.
Have worked in startups in different sectors before but have no experience in blockchain/know anyone in it.
How easy/difficult was it to build projects and deploy them on Eth? If you have launched a successful project were there issues with scalability etc afterwards?
Curious to hear from anyone with experience working on serious ideas - founders/devs/operators/marketing. New to the dev space so it’s a learning curve.
Helllooo everyone☀️
Me and a team of 4 volunteers from all over the world are building a (not-yet) decentralised user review portal for Crypto & Web3 projects.
We allow users to review their fav crypto & web3 projects, we have a nice gamification system that helps determine user reliability and experience along with AI fake review detection.
We want to:
Help newcomers read peer reviews
Help crypto companies gain more insight from their users
We're now looking for
- A solidity dev who would like to help us take this to the next level and bring reviews on-chain
- Startups interested in using our products
We're super early stage but would love to connect with anyone who might be interested in the project!
Cheers everyone 🚀
Hi everyone,
I'm working on an NFT project called Butterflies, and I'm exploring the idea of allowing NFT holders to set up .butterflies
domains linked to their NFTs.
The concept would be similar to ENS, where each NFT could represent its own unique .butterflies
domain. For example, if someone mints an NFT, they might be able to claim coolname.butterflies
. The use case would be to link the domain to the NFT or perhaps allow the NFT owner to attach metadata like a social profile, website, or custom content.
However, I'm trying to make sense of how this feature would be practical. Unlike ENS, where .eth
names are primarily used for sending/receiving funds, it’s less clear why someone would want to associate a domain name with an NFT.
Has anyone built something like this? Or do you have suggestions for designing such a feature in a way that adds real value to the NFT ecosystem?
I’d love to hear about your experiences or any insights you might have on implementing ENS-style functionality in a project.
Thanks in advance!
function sendmoney(address first, address second) public payable {
uint256 amount = msg.value;
uint256 p1 = amount / 2;
(bool sent, ) = payable(first).call{value: p1}("");
require (sent, "first payment failed");
(sent, ) = payable(second).call{value: amount - p1}("");
require (sent == false, "second payment failed");
}
The above method is straightforward. Two payments are made to addresses first and second before the method fails. Will the payments to first and second be undone and the money refunded to the sender?
Hello everyone,
I am just starting my PhD research in blockchain technology, specifically focusing on Proof-of-Stake (PoS) consensus mechanisms. My work aims to optimize the validator selection process to ensure fairness, increase throughput, and dynamically adapt the system as validators join or leave the network.
Given the challenges faced by PoS systems, such as the “nothing at stake” problem, stake-grinding attacks, and the risk of centralization, I would like to know your opinion on whether optimizing validator selection is considered one of the main challenges for the blockchain community? Furthermore, are there any new solutions or advancements addressing these issues that I should be aware of? I am considering applying combinatorial mathematics to solve these problems,but I'm still thinking about it.
Additionally, I have the opportunity to slightly shift my research focus towards scaling solutions through sharding. What do you think about it?
Any tips, experiences, or references to recent research would be incredibly helpful. Your feedback will help me validate the importance of my work and ensure that I am addressing the most pressing issues in the field.
Thank you very much!
Any advice is helpful. I’m wondering if it’s possible to launch a coin without coding?
I learnt about stablecoins this week. They are complex and very different from other erc20s. Would you elaborate more more on Stablecoins ?
Hello everyone,
I’m a university student currently working on a Solidity-based project for my coursework. To test my smart contracts on the Sepolia testnet, I need 2-3 Sepolia ETH. Unfortunately, the faucets I’ve tried have either been slow or have strict limits, which makes testing difficult.
If anyone could spare a small amount, it would really help me complete this project. My wallet address is:0x086C137F57c6d2916506691DaEF8297d5f6a6025
Thank you so much for supporting student developers!
I do not have any real-money transactions on the web3 yet. So I found only Google's faucet for Sepolia and Holesky which is viable for me. The thing is, the Sepolia faucet gives 0.05 Sepolia ETH per day while the Holesky faucet gives 1 Holesky ETH per day.
So do I have any reason to use Sepolia?
Hello fellas
I am looking to deploy a smart contract using sepolia.
How the hell am i meant to do this?
The only reliable, free faucet I can find is the Google Web3 one, and that limits me massively.
I think I'll need to get 3.0 Sepolia (an overestimation really, i only need 2.6) to get this puppy going.
I don't really want to be buying ETH either to be entirely honest.
Anyone know how I can get this bad boy working without forking out for ETH?
Many thanks lads xoxox
Hey fellow evmers!
I'm about to deploy my p2p wordle betting game thing, I've never really ventured off ethereum and was wondering what you guys would recommend in ways of L2?
Been thinking about optimism or base, mostly been thinking about polygon but the former have some "hype" going on that I'm hoping will bridge into some users on my dapp.
Today I noticed some transactions in my ETH wallet that I didn't make. The common point of these transactions is that they all have the “Execute” method. Can you explain exactly how this happened?
PS: Yesterday I bought a token on a DEX exchange as a test (Morphware (XMW)). However, this token turned out to be a scam and the contract I interacted with gave me fake tokens belonging to another contract. However, Execute transactions happened before and after this purchase. So Execute transactions seem to have nothing to do with this transaction.
Thanks in advance for the explanations.
https://basescan.org/address/0x757fe8694bbb40d0a7d5e393b37287ba1d7423aa#tokentxns
Hey Reddit! 👋 I'm an independent dev, and I wanted to share a project I’ve been working on called FairLottery. The goal was simple: create a transparent, fair, and fun decentralized lottery system that anyone can join using their crypto wallet.
Here’s the concept:
This has been a passion project for me, and it’s still evolving. The system works, and I’m currently maintaining and tweaking it to make it even better. If you’re into crypto or Web3 tech, I’d love to hear your thoughts or ideas for improvement!
P.S. It’s small but functional—perfect for experimenting with decentralized lotteries! 😊
Feel free to ask questions or try it out! 🚀
Hello guys I am new to blockchain dev. I recently saw a really cool blockchain based game which inspired me to create something along that vein.
I am having a hard time deciding whether to choose solana or a layer2 eth chain like polygon.
Keep in mind I know next to nothing about crypto. I have used bitcoin for a long time but never got into defi.
Can you guys tell me the pros/cons developing with polygon vs solana?
The smart contract is actually gonna be pretty simple so my main concern is with the ease of access for players. Is it a big hassle for them to go get polygon via a faucet or something, or is it common and my target audience will likely already have enough for the transaction fees?