These are chat archives for ethereum/tutorials

12th
Apr 2018
maniyas
@maniyas
Apr 12 2018 06:49
@maniyas
hi all
can anyone know about exchange platform and its functionalities?
Hira Siddiqui
@HiraSiddiqui
Apr 12 2018 09:51

Hi all

ETHEREUM_BUG??

I am facing a very weird issue.

I cannot access the getter of an address=>uint mapping through an interface. It always returns 0. The other types of mappings work fine

contract Hourglass
{
mapping(address => uint256) public tokenBalanceLedger_;
mapping(uint => uint256) public uintTouint;

 function balanceOf(address _custAddress)
    public
    constant
    returns(uint256)
{
    return tokenBalanceLedger_[_custAddress];
}

 function updateMapping(address _custAddress)
    public
{
    tokenBalanceLedger_[_custAddress] = 1111;
    uintTouint[1] = 3;
}
function balanceOfUintToUint(uint x)
    public
    constant
    returns(uint256)
{
    return uintTouint[x];
}

}

interface wrapper
{
function balanceOf(address _customerAddress) external constant returns(uint256);
function updateMapping(address _customerAddress) external;
function balanceOfUintToUint(uint x) external constant returns(uint256);

}

contract callee
{
wrapper object;
function callee(address addr) public
{
object = wrapper(addr);
}
//RETURNS 0
function balanceOf() constant public returns(uint256)
{
uint x = object.balanceOf(msg.sender);
return x;
}

//RETURNS CORRECT RESULT
 function balanceOfUintToUint() constant public returns(uint256)
{
    uint x = object.balanceOfUintToUint(1);
    return x;
}

function updateMapping(address _customerAddress) public 
  {
      object.updateMapping(_customerAddress);
  }

}

Hi all

ETHEREUM_BUG??

I am facing a very weird issue.

I cannot access the getter of an address=>uint mapping through an interface. It always returns 0. The other types of mappings work fine

contract Hourglass
{
mapping(address => uint256) public tokenBalanceLedger_;
mapping(uint => uint256) public uintTouint;

 function balanceOf(address _custAddress)
    public
    constant
    returns(uint256)
{
    return tokenBalanceLedger_[_custAddress];
}

 function updateMapping(address _custAddress)
    public
{
    tokenBalanceLedger_[_custAddress] = 1111;
    uintTouint[1] = 3;
}
function balanceOfUintToUint(uint x)
    public
    constant
    returns(uint256)
{
    return uintTouint[x];
}

}

interface wrapper
{
function balanceOf(address _customerAddress) external constant returns(uint256);
function updateMapping(address _customerAddress) external;
function balanceOfUintToUint(uint x) external constant returns(uint256);

}

contract callee
{
wrapper object;
function callee(address addr) public
{
object = wrapper(addr);
}
//RETURNS 0
function balanceOf() constant public returns(uint256)
{
uint x = object.balanceOf(msg.sender);
return x;
}

//RETURNS CORRECT RESULT
 function balanceOfUintToUint() constant public returns(uint256)
{
    uint x = object.balanceOfUintToUint(1);
    return x;
}

function updateMapping(address _customerAddress) public 
  {
      object.updateMapping(_customerAddress);
  }

}

ISCRYPTOCOIN
@ISCRYPTOCOIN
Apr 12 2018 10:38
Hi.
I like to know how can I find my funds balance in Ethereum wallet.