* Fix reward check conditions and add attestation precondition * Refactor to redunce number of for loops