2

web3.methods.myMethod.send()报错

 2 years ago
source link: https://learnblockchain.cn/question/2527
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
web3.methods.myMethod.send()报错 | 登链社区 | 技术问答

10 web3.methods.myMethod.send()报错

回答问题即可获得 5 经验值,回答被采纳后即可获得 15 学分。
const web3 = new Web3(
"https://data-seed-prebsc-2-s3.binance.org:8545/"
);

`let myContract = new web3.eth.Contract(`abi,`contract_address`)

myContract.methods
.buy_ticket(1)
.send(
{
from: this.$store.state.acount,
to: res.contract_address,
value: value,
},
function (error, result) {
console.log(error);
console.log(result);
}
);

但是购买的时候会报Returned error: unknown account这个错误,能帮忙解决一下吗


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK