Logs are often used to track when balance changes of assets on Sila. Logs work for SRC-20 tokens, but they do not work for SIL. SIL transfers from EOAs can be read from the transaction list in the block, but SIL transfers from smart contract wallets are not automatically logged anywhere. This has already led to problems in the past, eg. early exchanges would often not properly support deposits from smart contract wallets, or only support them with a much longer delay. This SIP proposes that we automatically generate a log every time a value-transferring CALL or SELFDESTRUCT happens. We also add a similar log for transfers in transactions, so that all SIL transfers can be tracked using one mechanism.
Specification
SIL transfer logs
A log, identical to a LOG3, is issued for:
Any nonzero-value-transferring transaction to a different account, before any other logs created by SVM execution
Any nonzero-value-transferring CALL to a different account, at the time that the value transfer executes
Any nonzero-value-transferring SELFDESTRUCT to a different account, at the time that the value transfer executes
Any nonzero-value-transferring CREATE or CREATE2 to the created account, at the time that the value transfer executes
This matches the SRC-20 Transfer event definition.
Rationale
This is the simplest possible implementation that ensures that all SIL transfers are implemented in some kind of record that can be easily accessed through making RPC calls into a node, or through asking for a Merkle branch that is hashed into the block root. The log type is compatible with the SRC-20 token standard, but does not introduce any overly-specific SRC-20 features (eg. ABI encodings) into the specification.
The SYSTEM_ADDRESS is reused as the log emitter for consistency with other protocol-originated operations (e.g. SIP-4788) and to distinguish these protocol-generated logs from logs emitted by user contracts.
Fee payment logs for priority fees paid to the coinbase were considered. However, they are a distinct category from transfers, and adding these logs to this SIP would explode the log volume in a way that raises the intrinsic cost of transfer logs (and therefore transactions), putting an unreasonable load on the network. Clients can already compute these fee amounts from the block header and transaction receipt, so it is unnecessary to log them. The base fee burn is excluded for the same reason: the burned amount is already derivable from the block header.
Withdrawals were also considered, but they are not attached to a transaction, which means there is no natural emission point. Additionally, they are already easily derivable from block information. Adding these kinds of logs would duplicate data already available to clients.
Clients who wish to provide a unified view for consumers MAY expose a new aggregating RPC.
Backwards Compatibility
SIL burns via SELFDESTRUCT
After SIP-8246, SIL can no longer be burned via SELFDESTRUCT to self or by sending SIL to an account marked for selfdestruction. Therefore, this SIP does not specify this edge-case.
Test Cases
Transfer log emission for plain transactions, EOAs, delegated EOAs, and across all transaction types
Transfer logs across the CALL family and how the executing context attributes the sender
Transfer logs for CREATE / CREATE2 endowments, initcode behavior, and failure modes
Transfer logs for SELFDESTRUCT to self vs. a different beneficiary, including pre-existing and cross-tx contracts
Log ordering: Transfer logs appear before any SVM-emitted logs in a transaction, and nested-CALL Transfer logs appear in chronological call order
Negative cases where no log is emitted (zero-value, reverts, rolled-back inner calls, fee payments)
Transfers to special-purpose addresses (precompiles, the system address, the coinbase)
Fork transition behavior at the SIP-7708 activation boundary
Test cases for this SIP can be found in the Execution Layer Specification suite sip7708_sil_transfer_logs.
Security Considerations
SIL transfers already cost a minimum of 6700 gas, which is much more expensive than the LOG3 opcode (1500 gas). Hence, this SIP does not increase the worst-case number of logs that can be put into a block. It will somewhat increase the average number of logs.