AUTOMATIC
yield mode, meaning their ETH balances will rebase
automatically. However, when a smart contract is deployed to an address, the account switches to VOID
mode. This
means that smart contract accounts default to VOID
mode, while EOAs (Externally Owned Accounts) default to
AUTOMATIC
mode.
op-geth
(RWALayer-geth
) to represent balances in shares, enabling all
accounts to update as yield is reported. Specifically, RWALayer-geth
modifies the StateAccount
struct to achieve
this:
Flags
field, while the Fixed
, Shares
, and Remainder
fields store the
data required to calculate account balances in each yield mode:
price()
function on this
contract.
eth_getBalanceValues
, to support indexing the flags
, shares
, remainder
,
and fixed
fields for accounts.
eth_getBalanceValues
Requesteth_getBalanceValues
Responseselfdestruct
allows ETH to be sent to a beneficiary address without triggering any code at that
address. As a result, the beneficiary account’s balance changes without there being any call
made. Indexers must
handle this edge case to ensure perfect accounting.
RWALayer introduces a similar edge case that indexers should be aware of. Accounts set to CLAIMABLE
yield mode can
claim accumulated yield to an arbitrary beneficiary address. This claim operation works the same as selfdestruct
in
that it can increase an arbitrary account’s balance without a call
.