web3js調用獲取當前賬戶

個人博客原文

https://www.b2bchain.cn/

 

web3js調用獲取當前賬戶

記得加

, from: web3.eth.accounts[0]}

 

    VotingContract.deployed().then(function(instance){
      instance.giveRightToVote(address,{gas: 140000, from: web3.eth.accounts[0]}).then(function(result){
        $("#msg2").html("<p>已授權</p>")
      })
    }).catch(function(err){ 
      console.error("ERROR! " + err.message)
    })

公衆號每週推送區塊鏈技術文章

個人踩坑日記

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章