To calculate holder's points based on pzETH's USDC value, there are two circuits involved.
The first is MellowRewardsCircuit, which uses holder's initial pzETH amount and Deposit/Withdraw receipts to calculate time-weighted pzETH amount. Each receipts will be used to add/sub holders' pzETH amount iff event emitted with holder's address.
The MellowRewards2Circuit is the simplified implementation for the first one. It will be used for holders who didn't submit deposit transaction nor withdrawal request. On such condition, we assume that pzETH amount will not change during this period of time because point accumulation rate will change upon Deposit or WithdrawalRequested event.
For simplicity, pzETH's USDC value is hardcoded inside the Demo Circuit and it will be replaced with on-chain oracle's storage value.
The contract logic is so straightforward that it receives BrevisRequest contract callback with each holder's point and emits events after decoding the callback data.