Closed pi0neerpat closed 6 years ago
If you deploy the same contract on local ganache-cli, then there is no error!
pragma solidity ^0.5.0;
contract Sacrific3d {
mapping(address => uint256) private playerVault;
constructor()
public
{
playerVault[0x1EEEe046f7722b0C7F04eCc457Dc5CF69f4fbA99]=100;
}
function myEarnings()
external
view
returns(uint256)
{
return playerVault[msg.sender];
}
}
Even weirder is it works on Ropsten, but not on Mainnet ropsten: http://oneclickdapp.com/vampire-common/ mainnet: http://oneclickdapp.com/bison-career/
This seems to be an issue with the ABI not having a name for the output for a view function. I fixed this by setting outputs[0].name to "earnings" in the the ABI, and creating a new dApp with this ABI.
All, please add a name to your outputs in your ABI, until a fix is implemented to add it automatically upon creation
{
"constant": true,
"inputs": [],
"name": "myEarnings",
"outputs": [
{
"name": "earnings",
"type": "uint256"
}
],
"payable": false,
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"payable": false,
"stateMutability": "nonpayable",
"type": "constructor"
}
This has been fixed in commit 5061a41 Now, all unnamed outputs in all view functions are automatically given a name.
Example: myEarnings() on http://oneclickdapp.com/camel-join/
Error message
Unhandled promise rejection Error: "Returned values aren't valid, did it run Out of Gas?"