Function: deposit(address token, address to, uint256 amount)
This function deposits native or ERC-20 tokens to to
’s account (using balance before/after for fee-on-transfer tokens) and records the actual amount received.
Inputs
token
Control: Fully controlled by the caller.
Constraints: If native,
msg.value
must equal the amount; if ERC-20,msg.value
must be 0.Impact: Selects native vs ERC-20 deposit path.
to
Control: Fully controlled by the caller.
Constraints: Must be nonzero.
Impact: Account to credit with the deposit.
amount
Control: Fully controlled by the caller.
Constraints: If native,
msg.value
must equal the amount; if ERC-20,msg.value
must be 0.Impact: Nominal amount to deposit (actual amount may be reduced by fee-on-transfer tokens).
Branches and code coverage
Intended branches
Native token path.
ERC-20 token path (fee-on-transfer supported).