1

我的 node.js dapp 中有一个与智能合约交互的按钮,该按钮是为没有 eth 或 metamask 的人创建的。

当其他人使用我的私钥按下该 btn 时,我如何从我的帐户中支付 gas 费用?

例子:

     onSubmit = async (event) => {
        const mypublickey = "0x1";
        const myprivatekey = "xyz"
        const addr = this.state.theContract;
        const theContract = GetContrat(addr);
        await theContract.methods
           UserVote()
           .send({
            from:mypublickey,
            privatekey:myprivatekey
        }); 
};
4

0 回答 0