The fastVM is currently not handling the CALLCODE and DELEGATECALL opcodes correctly. Some small changes were made inside Callbackto fix the issue. A bunch of test cases accompany the fix.
CALL makes an internal transaction from the calling contract to the address being called. The callee's contract code is run on its own storage.
CALLCODE makes an internal transaction from the calling contract to itself (there is still a distinct callee but the internal tx doesn't record it). The callee's contract code is run on the caller's storage (this is why the internal tx looks like it is the contract to itself).
DELEGATECALL makes an internal transaction from the original transaction's deployer (the address that made a tx that calls the contract that is using this opcode) to the calling contract. Like CALLCODE, the callee is hidden. The callee's contract code is run on the caller's storage. The only difference between this and CALLCODE is that the internal transaction looks like it was from the original caller rather than the caller (the contract that calls the callee via the opcode).
The fastVM is currently not handling the CALLCODE and DELEGATECALL opcodes correctly. Some small changes were made inside
Callback
to fix the issue. A bunch of test cases accompany the fix.See this PR for the aion side of things.
The main difference between the opcodes: