function payForTask(uint256 taskId, uint256 reward) public isLastestVersion {
        uint index = safeIndexOfTaskId(taskId);
        if (reward > 0) {
            token.transferFrom(tx.origin, this, reward);
        } else {
            reward = token.balanceOf(this) - totalReward;
        }
        tasks[index].reward += reward;
        totalReward += reward;
        TaskPayed(taskId);
    }