使用Web3调用智能合约功能

时间:2019-02-18 17:19:43

标签: ethereum solidity smartcontracts web3 web3js

我有以下代码来调用智能合约功能:

async function addManager(){
    const networkId = await web3.eth.net.getId();
    var deployedNetwork = MarketplaceArtifact.networks[networkId];
    var marketplace = new web3.eth.Contract(
        MarketplaceArtifact.abi,
        deployedNetwork.address,
    );

    var address = document.getElementById('addressField').value;

    const { AddManager } = marketplace.methods;
    const response = await AddManager(address, { from: this.account }).call();
    console.log(response);
}

console.log为什么会给我这样的响应?该调用不应该返回智能合约的返回值吗?

enter image description here

0 个答案:

没有答案