For those keeping track at home, the function hash of a function named ccccvKygDv()
is 0xffffffff
, the same as a null address.
pragma solidity ^0.4.0;
contract NullFunction {
function ccccvKygDv() public pure { }
}
contract NormalFunction {
function NothingWrongHere() public pure { }
}
When I look at the opcodes of the two functions listed above, I get:
NothingWrongHere()
47 PUSH4 0xffffffff
52 AND
53 DUP1
54 PUSH4 0xb1f6260f
ccccvKygDv()
47 PUSH4 0xffffffff
52 AND
53 DUP1
54 PUSH4 0xffffffff
It looks like the data being pushed to the stack will overwrite some of the data needed for the function itself.
Is this a silly question? Absolutely, but I'm asking it so that I can understand how contracts work on the opcode level a bit better.
0xffffffff
isn't just a bit mask? I'd need to see more of the assembly, but that would be my first guess. – user19510 Mar 21 '18 at 2:38