Clean dirty addresses and booleans (#5195)

Co-authored-by: Hadrien Croubois <hadrien.croubois@gmail.com>
This commit is contained in:
cairo
2024-09-18 18:21:17 +02:00
committed by GitHub
parent 809ded806f
commit 3f901696f7
7 changed files with 50 additions and 7 deletions

View File

@ -225,4 +225,24 @@ contract SlotDerivationTest is Test, SymTest {
assertEq(baseSlot.deriveMapping(key), derivedSlot);
}
function testSymbolicDeriveMappingBooleanDirty(bytes32 dirtyKey) public {
bool key;
assembly {
key := dirtyKey
}
// run the "normal" test using a potentially dirty value
testSymbolicDeriveMappingBoolean(key);
}
function testSymbolicDeriveMappingAddressDirty(bytes32 dirtyKey) public {
address key;
assembly {
key := dirtyKey
}
// run the "normal" test using a potentially dirty value
testSymbolicDeriveMappingAddress(key);
}
}