【发布时间】:2019-10-24 03:26:43
【问题描述】:
- 我从我的 javascript 发送交易
- Metamask 打开传输对话框
- 我确认
我在 metamask (inpage.js:1 MetaMask - RPC Error: Error: Error: [ethjs-rpc] rpc error with payload {"id":3801695059583,"jsonrpc":"2.0"," PARAMS “:[” 0xf8ac098504a817c80082753094bd212f85764be5ecdb5d0ca44ed46ac866b352c781c8b844d0679d3400000000000000000000000058f9015d8b36eacbd4d105cb79872992c073583f0000000000000000000000000000000000000000000000000000000000000000822d45a028d2355a1149fac93070742fc4e14213f441d4a8dfd97611b4de238f1ef70ffaa048f0eed65a9c495ce42229d569d156a7ff4cc206efced1f25e1c779c53f24485 “],” 方法 “:” eth_sendRawTransaction“}错误:VM异常而处理事务:复归)
我在 metamask-setting 中重置了账户的交易历史
**关于我的 html 中的帐户的信息 ************************* 硬币:(obj/adr/data):[object Object]/0xBd212f85764Be5ecDB5d0ca44ed46AC866B352c7/undefined CoinContract: (obj/adr/data):[object Object]/undefined/undefined 硬币anzeigen Minter:0x6d8c98f8eb01f8f7ee55d25bf01e30fa64333940 Coin erzeugen Account1 0x6d8C98f8eb01F8f7ee55D25Bf01e30Fa64333940 Saldo1 65764158165999998600 金额:0.37 投币账户2 0x58f9015d8B36EAcBD4d105CB79872992C073583F Saldo2 30997031680000000000 金额:0.37 投币账户3 0xBd212f85764Be5ecDB5d0ca44ed46AC866B352c7 Saldo3 0 金额:0.37
************从container.js调用事务**************
function CoinSenden (data,adressat) {
console.log("投币:" + adressat);
试试{
//
// Code für ändern ????
//
var param1=data.amount;
var myContract = web3.eth.contract(CoinABI);
var myContractInstance = myContract.at(CoinContractADR);
console.log("contract/contractinstanz:" + myContract + "/" + myContractInstance);
console.log("contract/contractinstanz:" + myContract.address + "/" + myContractInstance.address);
console.log("para:" + param1 + "/" + "adr:" + ContainerAccount2);
myContractInstance.send(
ContainerAccount2,param1,
{from : ContainerAccount2, value: 200, gas: 30000, gasPriceInWei : 1000},
function(err, myContract){
if(!err) {
// NOTE: The callback will fire twice!
// Once the contract has the transactionHash property set and once its deployed on an address.
// e.g. check tx hash on the first call (transaction send)
if(!myContract.address) {
console.log("Phase1- " + myContract.transactionHash) // The hash of the transaction, which deploys the contract
// check address on the second call (contract deployed)
} else {
console.log("Phase2- " + myContract.address) // the contract address
}
// Note that the returned "myContractReturned" === "myContract",
// so the returned "myContractReturned" object will also get the address set.
}
else {
console.log("Fehler in der Methode beim Coin senden: " + err);
}
});
console.log("Coin senden fertig.")
} 捕捉(错误){
console.log("Fehler beim Coin senden: " + err);
}
}
嗯,不多。我想看看它是否有效: 1. ganache 中的已提交事务 2.账户的新余额
【问题讨论】:
-
好像跟金额有关....类型不对?