as we can see, the code use realitio.resultForOnceSettled,
but the code return answer formatted as a bytes32
/// @notice Return the final answer to the specified question, or revert if there isn't one
/// @param question_id The ID of the question
/// @return The answer formatted as a bytes32
function resultFor(bytes32 question_id)
stateFinalized(question_id)
public view returns (bytes32) {
return questions[question_id].best_answer;
}
Attack Scenario\
Code should convert the best answer bytes32 format to payout format
Github username: -- Twitter username: -- Submission hash (on-chain): 0x4a2d4ff3fbd671921a0da95770db945ae697bd2e43e74f4ab71ce2aaf568af79 Severity: high
Description: Description\
In RealityProxy, the contract is used to resolve the answer.
In ResolveMultiScalarMarket, the code does not convert the answer to payout
https://gnosisscan.io/address/0xE78996A233895bE74a66F451f1019cA9734205cc#code#L607
as we can see, the code use realitio.resultForOnceSettled,
but the code return answer formatted as a bytes32
Attack Scenario\
Code should convert the best answer bytes32 format to payout format
Attachments
Proof of Concept (PoC) File
Revised Code File (Optional)