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 tonewBalance
. Typically restricted to the pool/authorized caller; reverts withUnauthorizedCaller
if not.allowance(owner, spender) → uint256 (view) Standard ERC-20: current approved amount
spender
can spend fromowner
.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.
[
{ "inputs": [ { "name": "pool", "internalType": "address", "type": "address" } ], "stateMutability": "nonpayable", "type": "constructor" },
{ "inputs": [], "name": "ApproveNotAllowed", "type": "error" },
{ "inputs": [ { "name": "spender", "internalType": "address", "type": "address" }, { "name": "allowance", "internalType": "uint256", "type": "uint256" }, { "name": "needed", "internalType": "uint256", "type": "uint256" } ], "name": "ERC20InsufficientAllowance", "type": "error" },
{ "inputs": [ { "name": "sender", "internalType": "address", "type": "address" }, { "name": "balance", "internalType": "uint256", "type": "uint256" }, { "name": "needed", "internalType": "uint256", "type": "uint256" } ], "name": "ERC20InsufficientBalance", "type": "error" },
{ "inputs": [ { "name": "approver", "internalType": "address", "type": "address" } ], "name": "ERC20InvalidApprover", "type": "error" },
{ "inputs": [ { "name": "receiver", "internalType": "address", "type": "address" } ], "name": "ERC20InvalidReceiver", "type": "error" },
{ "inputs": [ { "name": "sender", "internalType": "address", "type": "address" } ], "name": "ERC20InvalidSender", "type": "error" },
{ "inputs": [ { "name": "spender", "internalType": "address", "type": "address" } ], "name": "ERC20InvalidSpender", "type": "error" },
{ "inputs": [], "name": "TransferNotAllowed", "type": "error" },
{ "inputs": [], "name": "UnauthorizedCaller", "type": "error" },
{ "inputs": [ { "indexed": true, "name": "owner", "internalType": "address", "type": "address" }, { "indexed": true, "name": "spender", "internalType": "address", "type": "address" }, { "indexed": false, "name": "value", "internalType": "uint256", "type": "uint256" } ], "name": "Approval", "anonymous": false, "type": "event" },
{ "inputs": [ { "indexed": true, "name": "from", "internalType": "address", "type": "address" }, { "indexed": true, "name": "to", "internalType": "address", "type": "address" }, { "indexed": false, "name": "value", "internalType": "uint256", "type": "uint256" } ], "name": "Transfer", "anonymous": false, "type": "event" },
{ "outputs": [], "inputs": [ { "name": "account", "internalType": "address", "type": "address" }, { "name": "newBalance", "internalType": "uint256", "type": "uint256" } ], "name": "adjustBalance", "stateMutability": "nonpayable", "type": "function" },
{ "outputs": [ { "name": "", "internalType": "uint256", "type": "uint256" } ], "inputs": [ { "name": "owner", "internalType": "address", "type": "address" }, { "name": "spender", "internalType": "address", "type": "address" } ], "name": "allowance", "stateMutability": "view", "type": "function" },
{ "outputs": [ { "name": "", "internalType": "bool", "type": "bool" } ], "inputs": [ { "name": "spender", "internalType": "address", "type": "address" }, { "name": "value", "internalType": "uint256", "type": "uint256" } ], "name": "approve", "stateMutability": "nonpayable", "type": "function" },
{ "outputs": [ { "name": "", "internalType": "uint256", "type": "uint256" } ], "inputs": [ { "name": "account", "internalType": "address", "type": "address" } ], "name": "balanceOf", "stateMutability": "view", "type": "function" },
{ "outputs": [ { "name": "", "internalType": "uint8", "type": "uint8" } ], "inputs": [], "name": "decimals", "stateMutability": "view", "type": "function" },
{ "outputs": [ { "name": "", "internalType": "uint256", "type": "uint256" }, { "name": "", "internalType": "uint256", "type": "uint256" } ], "inputs": [ { "name": "user", "internalType": "address", "type": "address" } ], "name": "getScaledUserBalanceAndSupply", "stateMutability": "view", "type": "function" },
{ "outputs": [ { "name": "", "internalType": "string", "type": "string" } ], "inputs": [], "name": "name", "stateMutability": "view", "type": "function" },
{ "outputs": [ { "name": "", "internalType": "uint256", "type": "uint256" } ], "inputs": [], "name": "scaledTotalSupply", "stateMutability": "view", "type": "function" },
{ "outputs": [ { "name": "", "internalType": "address", "type": "address" } ], "inputs": [], "name": "subscriptionPool", "stateMutability": "view", "type": "function" },
{ "outputs": [ { "name": "", "internalType": "string", "type": "string" } ], "inputs": [], "name": "symbol", "stateMutability": "view", "type": "function" },
{ "outputs": [ { "name": "", "internalType": "uint256", "type": "uint256" } ], "inputs": [], "name": "totalSupply", "stateMutability": "view", "type": "function" },
{ "outputs": [ { "name": "", "internalType": "bool", "type": "bool" } ], "inputs": [ { "name": "to", "internalType": "address", "type": "address" }, { "name": "value", "internalType": "uint256", "type": "uint256" } ], "name": "transfer", "stateMutability": "nonpayable", "type": "function" },
{ "outputs": [ { "name": "", "internalType": "bool", "type": "bool" } ], "inputs": [ { "name": "from", "internalType": "address", "type": "address" }, { "name": "to", "internalType": "address", "type": "address" }, { "name": "value", "internalType": "uint256", "type": "uint256" } ], "name": "transferFrom", "stateMutability": "nonpayable", "type": "function" }
]
Last updated
Was this helpful?