Hot answers tagged

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 it like so: const promises = []; for (const line of lines) { ... promises.push(web3.eth.sendSignedTransaction(signed.rawTransaction)); nonce_count++; } await Promise.all(promises);


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.


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.


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