I’m working on an upgradeable contract that uses fallback
functions with inline assembly
delegatecall
and call
calls (using calldatacopy
and returndatacopy
) to route internal and external function calls . Function calls often get routed through three fallback functions before executed. I have a decent set of tests and everything passes successfully. However if I emit an event in the initial fallback function, contract execution stops with a brownie.exceptions.VirtualMachineError: revert
on chained fallback
calls. Once the emit is removed the test suite passes again without issue.
Any ideas what's going wrong here or how I can troubleshoot this? I have layered calldata, do events impact that in some way? This brings back memories of uninitialized pointers…