let 账户地址="0xbD2D24c6Cd5dcA79F743f02F2313152e13191539";
let 账户私钥='c33ba308cae4a832e5dde4c85262a34d07d2d0fc6efb4c9f01bbd67b53aa043d';
this.web3.eth.getTransactionCount(账户地址).then(res=>{
var 该账户交易数 = (res).toString(16);
var 函数参数 = this.abi专用转16进制工具.rawEncode(
["string"], [this.input]
).toString('hex');
var 一条交易 = new this.包装成一条交易Tx({
nonce: '0x'+该账户交易数,
gasPrice: '0x77359400',
gasLimit: '0x295f05',
to: this.合约地址,
value: '0x0',
data: '0xfc36e15b'+函数参数
});
一条交易.sign(new Buffer(账户私钥, 'hex'));
this.web3.eth.sendSignedTransaction('0x' + 一条交易.serialize().toString('hex')).then(res=>{
console.log(res)
});
|