New answers tagged

0 votes

What is the best practice of a Dapp development mixed with Python/Django?

You can use web3.py to connect your smart contract to your backend. web3.py quick start: Link and also you can check this walk through article to create a Python Dapp: Link
user avatar
0 votes

eth-brownie: Unable to expand environment variable in host setting

if you are sure you set the .env correctly you can try sourcing your .env file in the terminal: source .env and then try running your script again.
user avatar
0 votes

Uniswap web3 python

This code should help you. It is a complete swap transaction from Uniswap. from web3 import Web3 import json import time # Define the node URL and connection node_url = "YOUR_NODE_URL" ...
user avatar
  • 366
0 votes

Failed token purchase transactions on uniswap with web3.py

I think the problem is that you are using the factory contract instead of the router. Take a look at this code, with comments! Note that I did not specify the token to buy, and this is based on ...
user avatar
  • 366
0 votes

web3.py: contract.events.Transfer().processReceipt - Buy vs Sell?

This cracked the case: from web3 import Web3 from web3.logs import DISCARD EIP20_ABI = '[{"constant":true,"inputs":[],"name":"name","outputs":[{"...
user avatar
0 votes

web3.py: contract.events.Transfer().processReceipt - Buy vs Sell?

There is no concept of buy and sell on trade level. Both of the below are equivalent: Buying SIMPLE with USDC Selling USDC for SIMPLE For the human readable buy and sell labels, you need to come up ...
user avatar
0 votes

How the centralized exchanges handle deposits?

I guess using CREATE2 opcode and using selfdestruct() after every deposit is more cost efficient than creating a bulk of contracts when gas price is low.
user avatar
0 votes

Failed token purchase transactions on uniswap with web3.py

Try this code : Contract_Address = 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D from web3 import Web3 import json from dotenv import load_dotenv import time import os from web3.middleware import ...
user avatar
  • 1
0 votes

web3py The method eth_getRawTransactionByHash does not exist/is not available

This method is not supported by the Infura API according to this thread in their forums https://community.infura.io/t/the-method-eth-getrawtransactionbyhash-does-not-exist/3821/2
user avatar
  • 33
0 votes

raise ValueError("Explorer API not set for this network") ValueError: Explorer API not set for this network

you need to set publish_source = False if on a mock network so that it does not try verify an API that does not really exist. see this video 5h25! (its a long video) https://www.youtube.com/watch?v=...
user avatar
  • 1
0 votes

AttributeError: 'NoneType' object has no attribute 'retrieve' #1195

Rahool, waiting your transaction should be simple_storage.wait(1) on next line and remove . tx.wait(1)
user avatar
0 votes

In Brownie, Do you need always need .address to use a contract as an contract address variable

I think you can do it both ways and no, I don't think the ".address" part is a necessity and as far as deployment, I don't think there will be any difference in the usage of gas >>> ...
user avatar
1 vote

How to get NFT data with web3 or etherscan api?

As referenced in this answer, one super easy way is to use the Alchemy SDK and NFT API: npm install @alch/alchemy-sdk and then in your code: // Initializing the alchemy config object import { ...
user avatar

Top 50 recent answers are included