So here's the contract that I deployed on Ropsten Network. I took code refer from here.
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;
uint256 public myData;
constructor(uint256 number) public payable{
scheduleMyfucntion(number);
myData = 1;
}
function scheduleMyfucntion(uint256 number) public {
aion = Aion(0xFcFB45679539667f7ed55FA59A15c8Cad73d9a4E);
bytes memory data = abi.encodeWithSelector(bytes4(keccak256('myfucntion(uint256)')),number);
uint callCost = 200000*1e9 + aion.serviceFee();
aion.ScheduleCall.value(callCost)( block.timestamp + 10 minutes, address(this), 0, 200000, 1e9, data, true);
}
function myfucntion(uint256 number) public {
// do your task here and call again the function to schedule
myData = myData+1;
scheduleMyfucntion(number);
}
function getMyData() view public returns (uint256) {
return myData;
}
function () public payable {}
}
The purpose of this contract is to schedule a call in every 10 minutes.
Expectations: myData variable should be incremented by one in every 10 minutes.
Actual: Unable to see any new transaction after successful deployment. Nor able to see the variable being incremented ever.