I have a problem like this. I am very new to solidity. I have tried an example that I was found by a Google Search in the remix editor. But I was unable to get any output like in the example.This is the tutorial that I followed
According to the tutorial, I create a two solidity file called Callee.sol and caller.sol. Here I am providing that callee.sol contract.
contract Callee {
uint[] public values;
function getValue(uint initial) returns(uint) {
return initial + 150;
}
function storeValue(uint value) {
values.push(value);
}
function getValues() returns(uint) {
return values.length;
}
}
And my caller.sol is looked like this.
pragma solidity ^0.4.6;
contract Caller {
function someAction(address addr) returns(uint) {
Callee c = Callee(addr);
return c.getValue(100);
}
function storeAction(address addr) returns(uint) {
Callee c = Callee(addr);
c.storeValue(100);
return c.getValues();
}
function someUnsafeAction(address addr) {
addr.call(bytes4(keccak256("storeValue(uint256)")), 100);
}
}
contract Callee {
function getValue(uint initialValue) returns(uint);
function storeValue(uint value);
function getValues() returns(uint);
}
Firstly I deployed The callee.sol contract
Then I deployed the contract call caller.sol.
Then I copy the address of callee contract and call the function of caller contract like this but it gave a nothing as output.
Can someone help me to make this work? Thank you very much.