MultiversX Tracker is Live!

Interacting with Wrapped ETH contract on Ropsten vs Mainnet

Etherum Reddit

More / Etherum Reddit 208 Views

Hi,

I'm in the process of trying to teach myself a bit more about Smart Contracts and figured a good place to start would be learning how to manually make trades through using the "Write Contract" swapExactETHForTokens function, bypassing various DEX GUIs.

I am playing on Ropsten (because who wants to make an expensive mistake?) and I'm currently just simulating a WETH > Uni trade through the Uniswap router.

I am able to get it to work using these settings:

Contract: 0x7a250d5630b4cf539739df2c5dacb4c659f2488d (Uniswap V2 Router)
Path: 0xc778417e063141139fce010982780140aa0cd5ab,0x1f9840a85d5af5bf1d1762f925bdaddc4201f984

What I don't understand is why it fails using 0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2 for Wrapped ETH, which appears to be what the transactions on the Mainnet use when I trace things through dextools. That CA appears to exist on Ropsten, but when I use it the transaction fails due to a path error, and I have to use 0xc778417e063141139fce010982780140aa0cd5ab for WETH instead.

I'd rather avoid making costly gas errors when I start to try doing actual on mainnet, so I was hoping to understand this discrepancy before going any further.

If anyone can educate me on what's going on here, I'd appreciate it. I was expecting everything to be a mirror between main and test, at least as far as CAs were concerned.

submitted by /u/Eredyn
[link] [comments]
Get BONUS $200 for FREE!

You can get bonuses upto $100 FREE BONUS when you:
πŸ’° Install these recommended apps:
πŸ’² SocialGood - 100% Crypto Back on Everyday Shopping
πŸ’² xPortal - The DeFi For The Next Billion
πŸ’² CryptoTab Browser - Lightweight, fast, and ready to mine!
πŸ’° Register on these recommended exchanges:
🟑 Binance🟑 Bitfinex🟑 Bitmart🟑 Bittrex🟑 Bitget
🟑 CoinEx🟑 Crypto.com🟑 Gate.io🟑 Huobi🟑 Kucoin.



Comments