This repository for freeton contest for running this contract you need: solc, tvm_linker, tonos-cli
solc main.sol
tvm_linker compile --lib stdlib_sol.tvm --abi-json main.abi.json main.code
tonos-cli genaddr <main>.tvc main.abi.json --genkey timer.keys.json
tonos-cli call <address> createTimer '{"_payload":"<payload in int64>","_time":<time in seconds>}' --abi main.abi.json --sign timer.keys.json
or
tonos-cli call <address> createHandler '{"_payload":"<payload in int64>","_time":<time in seconds>}' --abi main.abi.json --sign timer.keys.json
Yes, createTimer create handler nowtime + your time. Its useful for users. And createHandler set only your time.
Its simple. You can watch the test.sol
contract timer {
function createHandler(uint _payload,uint64 _time) public {}
function createTimer(uint _payload,uint64 _time) public {}
}
address timerAddress;
function changeAddress(address _adr) public onlyOwnerAndAccept {
timerAddress = _adr;
}
function _timer_handler(uint payload) public {
require(timerAddress == msg.sender,100,'Unauthorized');
<Your code>
}
timer(timerAddress).createTimer(100,60);
You can use payload to diffent things, for instance delay send.
By commaster1