Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/kontrol/kdist/cheatcodes.md
Original file line number Diff line number Diff line change
Expand Up @@ -1392,7 +1392,7 @@ We don't care about the values because they will be processed in the `custom_ste
rule <k> #setCode ACCTID CODE => .K ... </k>
<account>
<acctID> ACCTID </acctID>
<code> _ => #if #asWord(CODE) ==Int 0 #then .Bytes #else CODE #fi </code>
<code> _ => #if lengthBytes(CODE) ==Int 0 #then .Bytes #else CODE #fi </code>
...
</account>
```
Expand Down
1 change: 1 addition & 0 deletions src/tests/integration/test-data/foundry-prove-all
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
AccountParamsTest.testDealConcrete()
AccountParamsTest.testDealSymbolic(uint256)
AccountParamsTest.testEtchConcrete()
AccountParamsTest.testEtchEmptyAndZero()
AccountParamsTest.testEtchSymbolic(bytes)
AccountParamsTest.testFail_GetNonce_false()
AccountParamsTest.testFail_GetNonce_true()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,21 @@ contract AccountParamsTest is Test {
assertEq(address(124).code, code);
}

function testEtchEmptyAndZero() public {
address emptyAddress = address(124);
address zeroAddress = address(125);
bytes memory emptyCode = bytes("");
bytes memory zeroCode = hex"00";

vm.etch(emptyAddress, emptyCode);
vm.etch(zeroAddress, zeroCode);

assertEq(emptyAddress.code, emptyCode);
assertEq(emptyAddress.code.length, 0);
assertEq(zeroAddress.code, zeroCode);
assertEq(zeroAddress.code.length, 1);
}

function testEtchSymbolic(bytes calldata code) public {
vm.etch(address(124), code);
assertEq(address(124).code, code);
Expand Down