current position:Home>If there is a problem with the geth console deployment contract, copy it to the geth console and enter the prompt cannot read property 'deploy' of undefined

If there is a problem with the geth console deployment contract, copy it to the geth console and enter the prompt cannot read property 'deploy' of undefined

2022-02-04 00:23:47 Q & A of Denglian community

Here are remix-ide Contract in details Inside web3depoly Directly copied from , I copied it directly to geth Console deployment , Prompt after enter TypeError: Cannot read property 'deploy' of undefinedat <eval>:1:20(4)

solve , How to solve ? How come other people's paragraphs are contract.new(...) Of , Why am I contract.depoly(...)? Environmental Science :solidity ^0.8.3

var infocontractContract = new web3.eth.Contract([{"inputs":[],"name":"getInfo","outputs":[{"internalType":"string","name":"","type":"string"},{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"string","name":"_name","type":"string"},{"internalType":"uint256","name":"_age","type":"uint256"}],"name":"setInfo","outputs":[],"stateMutability":"nonpayable","type":"function"}]);var infocontract = infocontractContract.deploy({     data: '0x608060....( Too long to omit )',      arguments: [     ]}).send({     from: web3.eth.accounts[0],      gas: '4700000'   }, function (e, contract){    console.log(e, contract);    if (typeof contract.address !== 'undefined') {         console.log('Contract mined! address: ' + contract.address + ' transactionHash: ' + contract.transactionHash);    } })





Other answers 1:


Other answers 2:


Other answers 3:


Other answers 4:

copyright notice
author[Q & A of Denglian community],Please bring the original link to reprint, thank you.
https://en.netfreeman.com/2022/02/202202040023453496.html

Random recommended