Skip to content

Commit

Permalink
Correct example for recurrent calls
Browse files Browse the repository at this point in the history
  • Loading branch information
jfdelgad authored Nov 6, 2018
1 parent 4598185 commit 7644902
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ contract MyContract{
### 3. Recurrent calls:

This examples show how to schedule a recurrent call. (every one day in this example).
```
```Solidity
pragma solidity ^0.4.24;
// interface Aion
Expand All @@ -154,15 +154,15 @@ contract MyContract{
uint256 public sqrtValue;
Aion aion;
constructor(uint256 number) public {
constructor(uint256 number) public payable {
scheduleMyfucntion(number);
}
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 + 1 day, address(this), 0, 200000, 1e9, data, true);
aion.ScheduleCall.value(callCost)( block.timestamp + 1 days, address(this), 0, 200000, 1e9, data, true);
}
function myfucntion(uint256 number) public {
Expand All @@ -173,6 +173,7 @@ contract MyContract{
function () public payable {}
}
```

## Fees:
Expand Down

0 comments on commit 7644902

Please sign in to comment.