I would like to make a task queue in solidity
contract Task{
function shouldExecute() external view returns (bool) {
}
//function Execute()
}
I would like to be able to dynamically pop conditions into this object to be checked e.g store simple functions in byte code like address(this).balance > 1e18
so in practice it would look some thing like
// Create a new task, if the target address balance is greater than a token, call the
// 'ClaimBalance' function on the target address
new Task(targetAddress,abi.ToBytes(`address(targetAddress).balance > 1e18`), 'ClaimBalance')
is there a way I can do this dynamically or will I have to manually make factories for all the options I would like to execute?