我找不到问题所在,有人能帮我
合同
pragma solidity ^0.5.9;
contract certificarProceso {
address public creador;
address emisor;
string informacion;
string informacionHashArchivo;
function escribirInformacion(string memory informacion1, string memory informacionHashArchivo1) public {
informacion = informacion1;
informacionHashArchivo = informacionHashArchivo1;
}
function getInformacion() public view returns (string memory) {
return informacion;
}
function getInformacionArchivoHash() public view returns (string memory) {
return informacionHashArchivo;
}
}错误
> personal.unlockAccount(eth.accounts[0])
Unlock account 0x2fef34e4d5a83a7bd78b2b09eb3619046eb1eaa1
Passphrase:
true
> var abi= [{"constant":false,"inputs":[{"name":"informacion1","type":"string"},{"name":"informacionHashArchivo1","type":"string"}],"name":"escribirInformacion","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"creador","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"getInformacion","outputs":[{"name":"","type":"string"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"getInformacionArchivoHash","outputs":[{"name":"","type":"string"}],"payable":false,"stateMutability":"view","type":"function"}]
undefined
>
> var address ="0x93ba4ede5903c6656060c443255ed4ef569a5144"
undefined
> var contract=eth.contract(abi).at(address)
undefined
> contract.getInformacion()
Error: new BigNumber() not a base 16 number:
at L (bignumber.js:3:2876)
at bignumber.js:3:8435
at a (bignumber.js:3:389)
at web3.js:1110:23
at web3.js:1634:20
at web3.js:826:16
at map (<native code>)
at web3.js:825:12
at web3.js:4080:18
> 发布于 2019-07-06 22:53:45
问题是合同的地址还没有确定。
在控制台中,删除实例化中的关键字var,并保持:
address ="0x93ba4ede5903c6656060c443255ed4ef569a5144"abi也一样..。
之后,您可以通过在控制台中键入变量名来检查所设置的值。
exp
> address
0x93ba4ede5903c6656060c443255ed4ef569a5144https://ethereum.stackexchange.com/questions/72629
复制相似问题