I have used Aion smart contracts to facilitate scheduling a ETH transaction. It works fine, but when it comes to making those transactions periodically (Scheduling multiple transactions), it throws an error.
What I am trying to say is that I have made one specific function that is responsible for taking two arguments ( nonce = number of payments, period = duration between payments ) beside my main scheduleTransaction() which is responsible for a single transaction scheduling, and I want to set up a group of automatic ETH transactions based on these characteristics. I'm going to attach my code. my loop seems fine, but it gives an error.
I would be thankful if anyone gives me a suggestion why whenever I try to execute scheduleMultipleTransaction(), it throws an error?
function scheduleTransaction(uint256 _fromNow) public {
aion = AionContract(0x2fC197cD7897f41957F72e8E390d5a7cF2858CBF);
uint256 callCost = 10e16 + 800000*100e9 + aion.serviceFee();
aion.ScheduleCall.value(callCost)( block.timestamp + _fromNow, Reciever, 10e16, 800000, 100e9, hex"00", true);
}
function scheduleMultipleTransactions(uint _period, uint _nonce) public {
for(uint i=0; i<=_period*(_nonce-1); i+_period) {
scheduleTransaction(i);
}
}
function () public payable {}
Lastly, I have to add that i had provided enough ETH to the contract prior to execution of these functions