6

web3.js向合约发送交易列子

 3 years ago
source link: https://learnblockchain.cn/question/2492
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.
neoserver,ios ssh client
web3.js向合约发送交易列子 | 登链社区 | 技术问答

web3.js向合约发送交易列子

求一个dapp用web3.js 拉起metamask 向合约发起交易的列子? 我写的拉不起来metamask。

var message = {from: defaultaccount, value: web3js.utils.toWei(amount, 'ether')};

console.log("111111111111",defaultaccount,web3js.utils.toWei(amount, 'ether'),message)
mytoken.methods.contre().send(message, function(error, transactionHash){
console.log(error)
});

image.png

Tiny熊 - 布道者 1天前

  擅长:智能合约,以太坊

js 代码出现错误。

还没有走到 调用合约发起交易就报错了。

解决 js 错误就可以。

您需要登录后才可以回答问题,登录 或者 注册

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK