You are using event log overloading and arrays in the event log.
From superficial testing, I found it works as expected if you drop either of those features.
If you comment out the logs that aren't actually used in this test then things improve.
pragma solidity >=0.5.6;
contract EventTest {
//event marketCreated(address[] virtualShareAddresses, address market, uint256 indexed endTime, string description, string extraInfo);//categorical
event marketCreated(address[2] virtualShareAddresses, address market, uint256 indexed endTime, string description, string extraInfo);//binary
//event marketCreated(address market, uint256 indexed endTime, string description, string extraInfo, int256 _minPrice, int256 _maxPrice, uint256 _numTicks);//scalar
function createYesNoMarket(
uint256 _endTime,
string memory _description,
string memory _extraInfo
) public payable returns (bool)
{
address[2] memory virtualShareAddresses;
address newMarket = address(0);
virtualShareAddresses[0] = address(1);
virtualShareAddresses[1] = address(2);
emit marketCreated(virtualShareAddresses, address(newMarket), _endTime, _description, _extraInfo);
return true;
}
}
In Remix the log is exactly as expected:
[
{
"from": "0xba8dc1a692093d8abd34e12aa05a4fe691121bb6",
"topic": "0x723cfaf3d6cd591c1439c0b9b08b74eaa46598df92bd434a707f33f48fa8bbd8",
"event": "marketCreated",
"args": {
"0": [
"0x0000000000000000000000000000000000000001",
"0x0000000000000000000000000000000000000002"
],
"1": "0x0000000000000000000000000000000000000000",
"2": "1575158400",
"3": "Will it rain on Friday in Sacramento California?",
"4": "foo",
"virtualShareAddresses": [
"0x0000000000000000000000000000000000000001",
"0x0000000000000000000000000000000000000002"
],
"market": "0x0000000000000000000000000000000000000000",
"endTime": "1575158400",
"description": "Will it rain on Friday in Sacramento California?",
"extraInfo": "foo",
"length": 5
}
}
]
With event overloading, there seems to be difficulty interpreting the log:
[
{
"from": "0x9876e235a87f520c827317a8987c9e1fde804485",
"data": "0x00000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000a00000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000003057696c6c206974207261696e206f6e2046726964617920696e2053616372616d656e746f2043616c69666f726e69613f000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000003666f6f0000000000000000000000000000000000000000000000000000000000",
"topics": [
"0x723cfaf3d6cd591c1439c0b9b08b74eaa46598df92bd434a707f33f48fa8bbd8",
"0x000000000000000000000000000000000000000000000000000000005de30280"
]
}
]
Event overloading should work. It can be shown to work if the array element is removed:
contract EventTest {
// event marketCreated(address market, uint256 indexed endTime, string description, string extraInfo);//categorical
event marketCreated(address market, uint256 indexed endTime, string description, string extraInfo);//binary
event marketCreated(address market, uint256 indexed endTime, string description, string extraInfo, int256 _minPrice, int256 _maxPrice, uint256 _numTicks);//scalar
function createYesNoMarket( ...
emit marketCreated(address(newMarket), _endTime, _description, _extraInfo);
That also works as expected:
[
{
"from": "0xde6a66562c299052b1cfd24abc1dc639d429e1d6",
"topic": "0x0d1dda2dfb9ffa94623e4da9d1b79c3d2f94286cf597898c7cb8551e2971b988",
"event": "marketCreated",
"args": {
"0": "0x0000000000000000000000000000000000000000",
"1": "1575158400",
"2": "Will it rain on Friday in Sacramento California?",
"3": "foo",
"market": "0x0000000000000000000000000000000000000000",
"endTime": "1575158400",
"description": "Will it rain on Friday in Sacramento California?",
"extraInfo": "foo",
"length": 4
}
}
]
So, even though arrays are okay, and even though event overloading is okay, there does appear to be a problem using those features together. This is possibly a candidate for an issue report, or possibly someone will chime in with a known reason why these features are mutually exclusive.
Hope it helps.
indexed
for each important parameter. You can use it at most 3 times per event declaration, so choose wisely.