I am trying to understand the Aion scheduling system
, so I tried their code example from here.
Below is the code snippet:
pragma solidity ^0.4.24;
// interface Aion
contract Aion {
uint256 public serviceFee;
function ScheduleCall(uint256 blocknumber, address to, uint256 value, uint256 gaslimit, uint256 gasprice, bytes data, bool schedType) public payable returns (uint,address);
}
// Main contract
contract MyContract{
uint256 public sqrtValue;
Aion aion;
function schedule_rqsr(uint256 number) public {
aion = Aion(0xFcFB45679539667f7ed55FA59A15c8Cad73d9a4E);
bytes memory data = abi.encodeWithSelector(bytes4(keccak256('sqrt(uint256)')),number);
uint callCost = 200000*1e9 + aion.serviceFee();
aion.ScheduleCall.value(callCost)( block.number+15, address(this), 0, 200000, 1e9, data, false);
}
function sqrt(uint256 number) public {
sqrtValue = number**2;
}
function () public payable {}
}
The contract is deployed successfully at ropsten address 0x91FDda60342d55B249A05083A5e9cB8102674D05
I am facing an issue while initiating the function schedule_rqsr
. When this function is triggered, I face this error of "Gas Estimation Failed"
Gas Limit: 3,000,000