VirtualRewardTracking

Constructor

  • constructor(pool: address) Stores the address of a subscriptionPool/pool contract (likely the only authorized controller for sensitive ops).


Function-by-function (EN)

  • adjustBalance(account, newBalance) (nonpayable) Manually sets account’s token balance to newBalance. Typically restricted to the pool/authorized caller; reverts with UnauthorizedCaller if not.

  • allowance(owner, spender) β†’ uint256 (view) Standard ERC-20: current approved amount spender can spend from owner.

  • approve(spender, value) β†’ bool (nonpayable) Standard ERC-20 approval. This token may block approvals in some modes and revert with ApproveNotAllowed or with ERC-20 errors on invalid addresses.

  • balanceOf(account) β†’ uint256 (view) Standard ERC-20 balance query.

  • decimals() β†’ uint8 (view) Token decimals.

  • getScaledUserBalanceAndSupply(user) β†’ (uint256 userScaled, uint256 totalScaled) (view) Returns a scaled balance for user and the scaled total supply. Scaled values are usually before applying an index/accumulator (e.g., interest index).

  • name() β†’ string (view) Token name.

  • scaledTotalSupply() β†’ uint256 (view) Total supply in scaled units (pre-index).

  • subscriptionPool() β†’ address (view) Address of the associated pool/controller.

  • symbol() β†’ string (view) Token symbol.

  • totalSupply() β†’ uint256 (view) Current total token supply (actual units).

  • transfer(to, value) β†’ bool (nonpayable) Standard ERC-20 transfer. May be restricted and revert with TransferNotAllowed (e.g., if token is non-transferable/soulbound in some contexts).

  • transferFrom(from, to, value) β†’ bool (nonpayable) Standard ERC-20 delegated transfer. Enforces allowance and may also hit TransferNotAllowed.


Events

  • Approval(owner, spender, value) β€” Emitted on successful approve.

  • Transfer(from, to, value) β€” Emitted on balance movements (transfer, transferFrom, or internal balance changes if implemented that way).


Custom errors (behavioral hints)

  • ApproveNotAllowed β€” Approvals disabled under current policy.

  • TransferNotAllowed β€” Transfers disabled (token may be non-transferable except for privileged flows).

  • UnauthorizedCaller β€” Caller lacks permission (e.g., for adjustBalance).

  • ERC20InsufficientAllowance / ERC20InsufficientBalance β€” Standard ERC-20 safety checks.

  • ERC20Invalid{Sender,Receiver,Approver,Spender} β€” Zero/invalid address or policy-violating address arguments.

Last updated

Was this helpful?