New answers tagged

0

The major issue here is that the HTTP request returns a dict containing 3 keys, one of which holds the value: {"status":"0", "message":"NOTOK", "result":"Maximum rate limit reached"} There are two minor issues: If the "status" key in the response holds the value "0", it indicates that you have exceeded your request limit of 1 request per second (only ...


0

I think you need first to verify your smart contract here, then you need also to provide your API KEY https://api.etherscan.io/api?module=contract&action=getabi&address=0xC12D1c73eE7DC3615BA4e37E4ABFdbDDFA38907E&apikey=YOUR_API_KEY_HERE


0

Try limiting the amount of blocks to 1000 https://community.infura.io/t/getlogs-error-query-returned-more-than-1000-results/358/6 A infura dev mentions: We currently limit response to blocks of 1000 responses, https://infura.io/docs/ethereum/json-rpc/eth_getLogs 90, the limitations are outlined in this doc. Limiting the amount of blocks worked for me.


0

Fixed code const fs = require("fs"); const os = require("os"); const Web3 = require("web3"); const net = require('net'); const NODE_ADDRESS = "IPC"; const SEND_ACCOUNT = "ACC"; const PRIVATE_KEY = "PRI"; const INPUT_FILE = "CSV"; async function run() { const web3 = new Web3(NODE_ADDRESS, net); let nonce_count = await web3.eth....


1

You can do it like so: const promises = []; for (const line of lines) { ... promises.push(web3.eth.sendSignedTransaction(signed.rawTransaction)); nonce_count++; } await Promise.all(promises);


0

Here is my fixed code const fs = require("fs"); const os = require("os"); const Web3 = require("web3"); const net = require('net'); const NODE_ADDRESS = "IPC"; const SEND_ACCOUNT = "ACC"; const PRIVATE_KEY = "PRI"; const INPUT_FILE = "CSV"; async function run() { const web3 = new Web3(NODE_ADDRESS, net); let nonce_count = await web3....


1

Try this (tested with web3.js v1.2.1): const fs = require("fs"); const os = require("os"); const Web3 = require("web3"); const NODE_ADDRESS = "YourNodeAddress"; const PRIVATE_KEY = "0x4c0883a69102937d6231471b5dbb6204fe5129617082792ae468d01a3f362318"; const INPUT_FILE = "test.txt"; async function scan(message) { process.stdout.write(message); ...


1

Web3 provides a Contract.encodeABI class method: https://web3py.readthedocs.io/en/stable/contracts.html#web3.contract.Contract.encodeABI.


0

I tried the contracts on remix.ethereum.org and they work as expected Since your call is recursive at some point it will run out of gas and it will log NotEnoughFunds and the recursion will stop. Some suggestions: Make the initial funding with more than 1 ether. Generate an event for a successful withdraw


0

Try tme=einstance.call().getTime().


4

With Brownie Brownie allows you to generate calldata using the ContractTx.encode_input method: >>> token <Token Contract object '0x79447c97b6543F6eFBC91613C655977806CB18b0'> >>> token.transfer.encode_input(accounts[0], 1000) ...


1

You can do: contract = web3.eth.contract(abi=abi,address=address) See the official documentation here.


1

Calling web3.eth.contract in web3.py uses the following syntax: from web3 import Web3 w3 = Web3() # modify these values abi = {} address = "0x00..." contract = w3.eth.contract(address=address, abi=abi) The returned value is a Contract object.


0

Assuming instance is a Contract object, classes for calling contract functions are found inside the Contract.function member. The correct syntax for what you wish to do is: contract_function = instance.functions.fundit(instance2.address) tx_hash = contract_function.transact({"from": w3.eth.accounts[0], "value": 1}) In the first line, you invoke the ...


Top 50 recent answers are included