BSC 测试网 web3.js调用合约的一个需要gas费的函数 报错 。
。
前端代码如下:
const web3 = new Web3("https://data-seed-prebsc-2-s2.binance.org:8545");
const encodeABI = this.WalletInfo.contract.methods
                        .active(web3.utils.toHex(this.WalletInfo.inviteCode), web3.utils.toHex(this.WalletInfo.address)) // 参数
                        .encodeABI();
                    const options = {
                        gas: "4926450",
                        gasPrice: "30000000000",
                        to: this.WalletInfo.tokens[0].contract, // 系统合约地址
                        data: encodeABI,
                    };
                    web3.eth.accounts.signTransaction(options, 私钥).then(res=>{
                        // 发送交易
                        web3.eth.sendSignedTransaction(res.rawTransaction).on('transactionHash', function(hash){
                               // console.log("发送成功,获取交易hash:",hash)
                           }).on('receipt', function(receipt){
                               // console.log("链上结果返回,返回数据:",receipt)
                           }).on('confirmation', function(confirmationNumber, receipt){
                               console.log("链上confirmation结果返回,确认数:",confirmationNumber)
                               console.log("链上confirmation结果返回,返回数据:",receipt)
                           }).on('error', function(error){
                               console.error(error)
                           });
                    })
                }哪位大牛能帮我解决一下嘛?万分感谢!!!