People who code: we want your input. Take the Survey

Hot answers tagged

2

Is transactionIndex a reliable indication of which transaction came first? Is transactionIndex = 1 executed before transactionIndex = 2? Or otherway around? Yes. Miners decides which transactions goes to the block they mined and the order. Or does EVM even operate in a conventional atomic way (I would assume that this is needed)? Yes. Everything is ...


2

You need to use The actual ABI of the implementation instead of the ABI file of the proxy contract Address of the proxy contract from brownie import Box, TransparentUpgradeableProxy, Contract account = accounts[0] proxy = TransparentUpgradeableProxy[-1] proxy_box = Contract.from_abi("Box", proxy.address, Box.abi) print(proxy_box.retrieve())


1

What they may be implementing is called a contract factory pattern. One would have a deployed contract, the "factory", responsible for calling the constructor of the new contracts and then keeping track of their addresses. Helpful (and short) article: https://research.csiro.au/blockchainpatterns/general-patterns/contract-structural-patterns/...


1

i moved web3 initialization to settings file, now it it's initialize one time and i get the web3-result already for Celery: settings/production.py: from web3 import Web3 from web3.gas_strategies.rpc import rpc_gas_price_strategy from web3.providers.auto import load_provider_from_uri from django.conf import settings from eth_watcher.web3 import ...


1

account = w3.eth.account.create() I can't immediately see that this method exists in Web3.py (I can't see it in the docs). In Web3.js it returns the following: web3.eth.accounts.create(); > { address: "0xb8CE9ab6943e0eCED004cDe8e3bBed6568B2Fa01", privateKey: "0x348ce564d427a3311b6536bbcff9390d69395b06ed6c486954e971d960fe8709", ...


1

You need the token's ABI and utilize the function balanceOf. Example snippet below: token = w3.eth.contract(address={token address}, abi={token abi}) # declaring the token contract token_balance = token.functions.balanceOf({your address}).call() # returns int with balance, without decimals You can find the token ABI from the block explorer, from the code ...


1

Infura does not support 56 nor 97 chain ids. These are for BSC, infura only supports Ethereum I suggest using Binance official node url for BSC Mainnet (56): https://bsc-dataseed.binance.org/ Or chainId 97 BSC Testnet: https://data-seed-prebsc-1-s1.binance.org:8545/


Only top voted, non community-wiki answers of a minimum length are eligible