6

前端 web3 怎么调用一个合约中的这个方法,这个合约中的这个方法的参数,分别是什么意...

 3 years ago
source link: https://learnblockchain.cn/question/1915
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 怎么调用一个合约中的这个方法,这个合约中的这个方法的参数,分别是什么意思?

前端 web3 怎么调用一个合约中的这个方法,这个合约中的这个方法的参数,分别是什么意思?

我有一个已经部署在链上的合约,但是,我不知道怎么在前端 web 3 中调用这个方法?

image.png

Tiny熊 - 布道者 12小时前

  擅长:智能合约,以太坊

web3.js 调用合约的代码大概是这样子:

var myContract = new web3.eth.Contract(abi, 合约地址);
myContract.methods.toBid().send({from: '0x...'});

这里有文档: https://learnblockchain.cn/docs/web3.js/web3-eth-contract.html#methods-mymethod-send

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

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK