Open hats-bug-reporter[bot] opened 1 week ago
Keep in mind that the conditional token framework was developed by Gnosis, not Seer. So them supporting 256 outcomes doesn't mean that Seer intends to support this number (and yes it's lower as we do make positions ERC20 tokens which is more gas intensif than using ERC1115). Here it looks more like a feature request (allow more outcomes) than a report of vulnerabilities.
Github username: -- Twitter username: -- Submission hash (on-chain): 0x17bcaaa20a77924a362e4efcb1a52e092582841fc73b25363603029bafda745e Severity: medium
Description:
Summary
The current limit to max outcomes is set to
256
, usually256
would be rare, however currently its not possible to even reach75,
which would be quite useful in cases where we have many possible outcomes like in Political Elections, Sports Tournaments, Gaming Tournaments, Oscars/Academy Awards where we could easily have more than75
possible outcomes.Vulnerability details
In prepareCondition() we set the max possible outcomeSlotCount:
This issue occurs because we will reach the limit per block of 30M gas around
75
set outcomes, which mean that this transaction won't be able to be executed as it won't fit in a single block, as the usual hard limit is30 M
.If in
constants.ts
you add more possible outcomes:And then run a test with gasReporter on, for example
npx hardhat test --grep "resolves a multi categorical market"
you will get28255005
gas for the createMultiCategoricalMarketImpact
The max set outcomes cannot be reached and some events won't be possible to put markets on Seer.