Using .call()
or .delegatecall()
we can call functions, similar to the data
field in a sendTransaction
However, the function name being called must be encoded in hex so the first four bytes can be read as the function name. To do this, we use <address>.delegatecall(bytes4(keccak256("functionName()")))
.
contract LogTest {
event LogIt(string _text);
//constructor
function LogTest() public {
emit LogIt("Log Me!!!!");
}
}