The Solidity verifier contracts (ScrvusdVerifierV1
and ScrvusdVerifierV2
) incorrectly calculate the storage slot for the balance_of_self
parameter. The current implementation uses keccak256(abi.encode(18, SCRVUSD))
, which reverses the order of arguments required by Solidity's storage layout rules. This results in reading from an incorrect storage location, leading to inaccurate data retrieval and potentially compromising the oracle's functionality.
Solidity calculates storage slots for mappings as
key
: The mapping key (here, SCRVUSD
, the contract’s own address).
mapping_slot
: The declared storage slot of the mapping (here, 18
).
The verifier incorrectly reverses the order:
This computes a non-existent storage slot, causing the oracle to read arbitrary data from an unintended location.
Assume:
SCRVUSD = 0x...123
(contract address).
Correct slot: keccak256(abi.encode(0x...123, 18))
.
Current slot: keccak256(abi.encode(18, 0x...123))
→ Produces a different hash.
The verifier will read balance_of_self
from a slot unrelated to the actual value, leading to corrupted data.
The verifier reads the balance_of_self
value from an incorrect storage slot, leading to inaccurate data.
Manual Code Review
Fix the Storage Slot Calculation:
Update the PARAM_SLOTS
array to use the correct order of arguments:
- Per sponsor comments, verified slot is vyper, solidity contract only verifies it. - Vyper computes storage slots different from solidity as seen [here](https://ethereum.stackexchange.com/questions/149311/storage-collision-in-vyper-hashmap)
The contest is live. Earn rewards by submitting a finding.
This is your time to appeal against judgements on your submissions.
Appeals are being carefully reviewed by our judges.