If I have a payable function that is called through a standard SRC-14 proxy contract, does the proxy or impl contract receive the funds? This is relevant because if I have a impl with a payable function that’s been called before, there will be a balance on either the proxy or the impl. If it’s on the impl, and I plan to withdrawal or otherwise manipulate the balance in the future, I’ll need to remember to go back and do that on previous impls in the case that I have upgraded the contract.
If the balance is stored on the proxy however, I should be fine to forget about previous impls, as the balance will effectively carry over through upgrades.
Hey @HenryMBaldwin, for the SRC-14 upgradeable proxy standard, the proxy contract receives and holds the funds, not the impl contract.
SRC-14 proxies on FuelVM use the LDC instruction, which is similar to EVM’s delegatecall. This means that when a function is called through the proxy, the storage and balance context is that of the proxy contract, not the implementation contract.
The proxy delegates execution to the implementation, but all state changes, including balance changes happen in the proxy’s context