/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’ve run into a perplexing issue with my Ethereum arbitrage transactions, and I’m hoping to get some insights from the community.
Currently, I’m executing arbitrage strategies by sending transactions through Flashbots bundles directly to private nodes (such as beaverbuild.org). Recently, I encountered a situation where one of my arbitrage orders, which was supposed to be handled exclusively by private nodes, reverted but still got included in the blockchain.
Here’s the setup:
I use an increased gas price to pay the bribe, meaning that even if the transaction reverts, the node still receives some compensation.
My understanding was that if a transaction reverts, it should not be included in a block, especially when using private nodes for MEV purposes.
However, contrary to this assumption, a reverted transaction was still included on-chain, and I’m trying to figure out why.
My questions are:
1 . Is this a configuration issue with the node operator, or is it something that can occur when using Flashbots to send bundles?
2 . What strategies can I implement to avoid this situation? Should I add extra validation logic in my contract?
Has anyone else experienced similar issues, particularly when using beaverbuild.org or other similar nodes?
Hi all,
Please excuse my ignorance and if the question is silly, but I am new to layer 2, I used to use Infura to listen for transactions, now I want to do the same with Base, but base.org doesn't seem to have a websocket url, am I missing something?
My application needs do certain things when a user makes a deposit, how can I achieve this?
TIA
Im implementing division logic in my smart contract where i take an amount of tokens and divide it by a number up to 120. There are cases where the result's decimal places are more than the token's decimal places. example: A token that only has 6 decimal places. 0.123456 / 100 = 0.00123456 the result has 8 decimals while the token only allows 6. In other coding languages we can count the number of characters after the dot and work with it. This is not possible with soldity. Is there any way to know how many decimal places a uint256 will be. The amount is variable could be any amount, and the division amount is between 1-120.
We recently (from 14th August to 21 August 2024) dug into some fascinating data surrounding blockchain networks and their associated financial metrics, focusing on staking, pooled investments, and borrowing. Here’s what we found:
Ethereum's Commanding Presence:
Top Holdings:
Major Borrowers:
Cross-Chain Activity:
Staking Insights:
Mantra DAO exhibits a diverse staking strategy with substantial figures across Polygon, Binance, and Ethereum.
The data underscores Ethereum's dominance in the blockchain space, particularly in staking and borrowing. For a more detailed analysis or to track trends over time, historical data would be necessary. Stay tuned as we continue to explore these financial movements and their implications on the DeFi ecosystem.
🔗 Join the conversation below and let us know your thoughts! How do you see these trends evolving? For more information, you can visit us at https://verified.network/ or reach out to us at https://x.com/veridefi
Has anyone here used any fiat to subscriptions method that doesn't use Stripe, I've been looking for a fiat on-ramp solution which charges the card every months sends it out in crypto
I'm a backend developer with experience in higher-level blockchain technologies, such as smart contracts and web3 integration. However, I'm interested in transitioning to a more low-level role in distributed systems. I've been studying technologies like libp2p and CometBFT, but I've noticed that many positions in this area require not just theoretical knowledge of the Ethereum Virtual Machine (EVM), but also practical experience. How can I best prepare myself for such a role?
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.26;
import "@uniswap/v2-periphery/contracts/interfaces/IUniswapV2Router02.sol";
import "@uniswap/v2-periphery/contracts/interfaces/IWETH.sol";
import "@openzeppelin/contracts/security/ReentrancyGuard.sol";
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
interface ISushiSwapRouter {
function swapExactTokensForTokens(
uint amountIn,
uint amountOutMin,
address[] calldata path,
address to,
uint deadline
) external returns (uint[] memory amounts);
function getAmountsOut(uint amountIn, address[] calldata path) external view returns (uint[] memory amounts);
}
contract Arbitrage is ReentrancyGuard {
address public owner;
IUniswapV2Router02 public uniswapRouter;
ISushiSwapRouter public sushiswapRouter;
IWETH public weth;
address public fixedTokenAddress;
bool public running;
bool public paused;
event ArbitrageStarted();
event ArbitrageStopped();
event TokensWithdrawn(address token, uint256 amount);
event ArbitrageExecuted(address[] path, uint amountIn, uint amountOutMin, bool isUniswapToSushiswap);
modifier onlyOwner() {
require(msg.sender == owner, "Not the contract owner");
_;
}
modifier whenNotPaused() {
require(!paused, "Contract is paused");
_;
}
constructor(
) {
owner = msg.sender;
uniswapRouter = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); // Uniswap V2 Router address on Ethereum Mainnet
sushiswapRouter = ISushiSwapRouter(0x6B3595068778DD592e39A122f4f5a5cF09C90fE2); // Sushiswap Router address on Ethereum Mainnet
weth = IWETH(0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2); // WETH address on Ethereum Mainnet
fixedTokenAddress = 0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2; // WETH as the fixed token
running = false;
paused = false;
}
function start() external onlyOwner {
running = true;
emit ArbitrageStarted();
}
function stop() external onlyOwner {
running = false;
emit ArbitrageStopped();
}
function pause() external onlyOwner {
paused = true;
}
function unpause() external onlyOwner {
paused = false;
}
address public constant TOKEN_ADDRESS = 0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2; // Define the token address
function withdraw() external onlyOwner {
uint256 balance = IERC20(TOKEN_ADDRESS).balanceOf(address(this));
require(balance > 0, "Insufficient token balance");
IERC20(TOKEN_ADDRESS).transfer(owner, balance);
emit TokensWithdrawn(TOKEN_ADDRESS, balance);
}
function approveToken(address token, address spender, uint256 amount) external onlyOwner {
IERC20(token).approve(spender, amount);
}
function wrapETH() external payable onlyOwner {
weth.deposit{value: msg.value}();
}
function unwrapWETH(uint256 amount) external onlyOwner {
weth.withdraw(amount);
}
function executeArbitrage(
address[] calldata path,
uint amountIn,
uint amountOutMin,
uint deadline,
bool isUniswapToSushiswap
) external onlyOwner nonReentrant whenNotPaused {
require(running, "Arbitrage is not running");
require(path.length >= 2, "Invalid path length");
uint initialBalance = IERC20(path[0]).balanceOf(address(this));
_executeSwap(path, amountIn, amountOutMin, deadline, isUniswapToSushiswap);
uint finalBalance = IERC20(path[0]).balanceOf(address(this));
require(finalBalance > initialBalance, "Arbitrage not profitable");
emit ArbitrageExecuted(path, amountIn, amountOutMin, isUniswapToSushiswap);
}
function _executeSwap(
address[] calldata path,
uint amountIn,
uint amountOutMin,
uint deadline,
bool isUniswapToSushiswap
) internal {
uint[] memory amountsOut;
address[] memory reversedPath;
if (isUniswapToSushiswap) {
// Swap on Uniswap first
amountsOut = uniswapRouter.getAmountsOut(amountIn, path);
require(amountsOut[amountsOut.length - 1] >= amountOutMin, "Slippage too high");
uniswapRouter.swapExactTokensForTokens(amountIn, amountOutMin, path, address(this), deadline);
// Reverse path for Sushiswap
reversedPath = reversePath(path);
amountsOut = sushiswapRouter.getAmountsOut(amountsOut[amountsOut.length - 1], reversedPath);
require(amountsOut[amountsOut.length - 1] >= amountOutMin, "Slippage too high");
sushiswapRouter.swapExactTokensForTokens(amountsOut[amountsOut.length - 1], amountOutMin, reversedPath, address(this), deadline);
} else {
// Swap on Sushiswap first
amountsOut = sushiswapRouter.getAmountsOut(amountIn, path);
require(amountsOut[amountsOut.length - 1] >= amountOutMin, "Slippage too high");
sushiswapRouter.swapExactTokensForTokens(amountIn, amountOutMin, path, address(this), deadline);
// Reverse path for Uniswap
reversedPath = reversePath(path);
amountsOut = uniswapRouter.getAmountsOut(amountsOut[amountsOut.length - 1], reversedPath);
require(amountsOut[amountsOut.length - 1] >= amountOutMin, "Slippage too high");
uniswapRouter.swapExactTokensForTokens(amountsOut[amountsOut.length - 1], amountOutMin, reversedPath, address(this), deadline);
}
}
function reversePath(address[] calldata path) internal pure returns (address[] memory) {
uint length = path.length;
address[] memory reversed = new address[](length);
for (uint i = 0; i < length; i++) {
reversed[i] = path[length - 1 - i];
}
return reversed;
}
function emergencyWithdraw() external onlyOwner {
uint256 balance = IERC20(fixedTokenAddress).balanceOf(address(this));
require(balance > 0, "Insufficient token balance");
IERC20(fixedTokenAddress).transfer(owner, balance);
emit TokensWithdrawn(fixedTokenAddress, balance);
}
function fundGas() external payable onlyOwner {
// Function to fund the contract with ETH for gas fees.
}
// To receive ETH
receive() external payable {}
}
Hey all,
We are building a Liquid Restaking Token (LRT) and Strategy Manager for EigenLayer (and other assets) and are looking for a technically experienced and motivated CTO candidate with a passion for blockchain technology and ideally DeFi to take join the team.
The ideal candidate will be a detail-oriented developer with a passion for delivering high-quality, scalable solutions and a strong curiosity for innovation in the DeFi space. In this role you will be developing the Back-end and Frontend Application, creating new smart-contracts and integrating smart-contracts to our protocol, be responsible for all back-end integrations (e.g. with other DeFi protocols, node operators, AVSs, etc.) and more. You will also have the opportunity to shape the technical and product roadmap.
Stage: Testnet is 90% done - the new CTO will need to finish it fully and add the next product will need to be built before we do the fundraising.
If you would be interested or know someone, please shoot me a DM.
Much appreciated, Thank you.
I'm writing a browser extension where you (an X user) can write notes about other users and view those notes later. This can help users keep track of who people are that are in their feed, and remind themselves of anything relevant they think that they should know about that user. I am curious if there is any good web3 functionality that I could implement for this, beyond the obvious like allowing users to connect their EVM accounts for sending and receiving or displaying NFTs owned by a user who connects / registers their account with our system.
I may take a look into soul-bound tokens but I was curious if there is any web3 functionality that I could add to the extension to make the tool more useful. What do you guys think?
Explore this exciting new building opportunity! Unleash the power of secure and immutable data delivery with Chronicle Oracles, combined with Cartesi Rollups running complex computations off-chain in a Linux environment.
A step-by-step guide is provided for developers leveraging oracle data in their Cartesi Rollup applications. A reusable template is included in the article to help you deliver your own applications. Building explorations just keep getting better, don't they?
For example Today i do hardhat ignition ... When i run hardhat node
Is the contract and the data in the block chain still persist?
I'm a newbie dev to blockchain and I was wondering that, is there any way to live sync fork with hardhat or ganache ?
Hello everyone,
I’m currently working on a smart contract project and I need to integrate an existing token interface from another contract. I’m fairly new to this and would appreciate if someone could guide me through the process step by step.
Here’s what I’m trying to do:
• I want to interact with an existing token contract to perform operations like transferring tokens and checking balances within my contract.
• I’m not sure how to correctly import and implement the interface of this existing token into my smart contract.
Could someone please explain how to:
1. Import the token contract interface into my smart contract.
2. Call functions from the token contract within my contract.
3. Handle any permissions or approvals that might be necessary.
Any examples or resources you could share would be extremely helpful
Reasonably Decentralized
"Exocore should be architecturally designed to be reasonably decentralized from inception."
From its technical architecture to its governance structure, Exocore is committed to real decentralization. It shouldn't be an afterthought added later.
Protocol Agnostic (Omnichain design)
"In unity, there’s strength."
As an L1 for omnichain restaking, Exocore extends an olive branch to all blockchain networks and ecosystems and embraces technological diversity.
Good design is intentional. All of Exocore's design decisions were guided by the first principles laid out in the Exocore Manifesto.
Here are three key principles from the Manifesto that explain the WHY of Exocore's design: Security first, Resonably decentralized and Protocol Agnostic.
Hey guys, I wanted to know if its possible to start an archive node from a specific block number (eg, block number from 1 year ago).
From what i read, there is partial/full archive.
partial archive can be done with snap sync but ill start from latest 128 blocks and act as archive from now on.
full archive starts from genesis.
But is it possible to configure geth to start partial archive from x block number or somewhere close to x instead of now?
Week of 8/12-8/18:
Grants 🏅
-Coinbase Developer Platform Introduces AI Builder Program
Research 🧑🔬
-nero_eth Analyzes Timing Games on Ethereum's Consensus
Infra 🏗️
-OP Labs Plans to Bring Native Interoperability to the OP Stack
and more 👀
"Developers just want to build the thing, launch it, and have it available everywhere... restaking provides the crypto-economic security for this to happen... the web3 equivalent of AWS will be powered by restaking."
Listen to Warpaul, the co-founder of Exocore's thoughts about this: https://twitter.com/ExocoreNetwork/status/1824594746104484292?ref_src=twsrc%5Egoogle%7Ctwcamp%5Eserp%7Ctwgr%5Etweet
web3jobPortal .com
I am going to create a postgresql database for the purpose of making a NFT trading bot. The bot should be horizontally scalable, expecting it to accommodate to various NFT collections on active trading.
My question is should I set up the db to house all NFT from NFT collections of should each NFT collection be of its own db? If all in one db, will it slow down runtime?
What type of ethereum client should I use so I can iterate through every Ethereum smart contract on the ethereum network? A Geth full node?
Blur doesn't have any public API/SDK, so how does Opensea Pro get their real-time listing information? Is it from web-scraping?
We are launching our devnet for an EVM based chain. I was curious if i can ask for developer participation here?
These are the components if anyone is interested:
Golden Age Compatible Devnet: Semi-closed devnet with a public RPC for developers to build & test before launch.
Quaiscan explorer: Major updates in UI, indexing, and support for the Golden Age devnet & Qi ledger.
Pelagus wallet: New Chrome extension with a sleek UI & full Golden Age support. Note: New addresses required!
Quais SDK: Completely overhauled with Golden Age Quai & Qi support.
Faucet: Redesigned to support Golden Age Quai token drips with added sybil resistance.
Not production-ready, so bugs may occur. If you find any, reach out via our Discord or Telegram. Users can seek support at Quai Network.
Please let me know if this is allowed here? I am willing to take down the post if not allowed.