I am trying to create a staking protocols where rewards and staking are separate. But there are multiple tokens that get rewarded and I need to update each of them in a loop. Now, my question is how good of a practice is it to call function for calculation of rewards in the reward contract for each token in a loop from a staking contract.
I have seen few contracts that actually does this but is it gas efficient and secure. I want to modularize the contract as much as possible.