gpt4 book ai didi

ethereum - 未处理拒绝错误: This contract object doesn't have address set yet,请先设置一个地址

转载 作者:行者123 更新时间:2023-12-02 14:42:22 25 4
gpt4 key购买 nike

我目前正在尝试使用 Infura 通过 Web3 在我的计算机上运行。当我设置运行我的 node index.js 文件时,出现以下错误:

Unhandled rejection Error: This contract object doesn't have address set yet, please set an address first.
at Object._processExecuteArguments (/Users/Oso.Lu/cryptokitty-miner/node_modules/web3-eth-contract/src/index.js:739:15)
at Object._executeMethod (/Users/Oso.Lu/cryptokitty-miner/node_modules/web3-eth-contract/src/index.js:760:54


var helpers = require("./helpers.js")

var Web3 = require('web3');
var Tx = require('ethereumjs-tx');

// You should be running a local Eth node or use Infura.
var web3 = new Web3(new Web3.providers.HttpProvider("https://mainnet.infura.io:443"));
var prompt = require('prompt');


var sendingAddress = "********************" // with your sending ETH address
var pKey = "******************************"; // This will store the corresponding private key. we'll be getting the private key for this Eth address from a command prompt


// Keep track of kitties we'll mine to avoid double-mining
var kittyArray = []

var theNonce = "";
// Gas price. Todo: Use Eth gas station Oracle to predict gas prices
var gwei = '26'

// Track # of received
var num_requested = 0
var num_received = 0

我认为问题可能出在 Infura 端口 443 上。

最佳答案

Simple solution

Voting.options.address = "0x6ee9957aef5f4073c6af71441ec7962527c37671"

其中投票是我的智能合约实例名称

0x6ee9957aef5f4073c6af71441ec7962527c37671”是部署的智能联系人地址

我的 web3.js 版本 “web3”:“^1.0.0-beta.31”,

关于ethereum - 未处理拒绝错误: This contract object doesn't have address set yet,请先设置一个地址,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48609913/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com