Skip to content

Commit

Permalink
Use .Bytes to represent all calls being allowed
Browse files Browse the repository at this point in the history
  • Loading branch information
palinatolmach committed Jan 17, 2025
1 parent c412328 commit ab78122
Showing 1 changed file with 2 additions and 10 deletions.
12 changes: 2 additions & 10 deletions src/kontrol/kdist/cheatcodes.md
Original file line number Diff line number Diff line change
Expand Up @@ -973,7 +973,7 @@ If the address is not in the whitelist `WLIST` then `KEVM` goes into an error st
<allowedCallsList> WLIST </allowedCallsList>
...
</whitelist>
requires notBool ({ACCTTO|CALLDATA} in WLIST orBool {ACCTTO|b"*"} in WLIST)
requires notBool ({ACCTTO|CALLDATA} in WLIST orBool {ACCTTO|.Bytes} in WLIST)
[priority(40)]
```

Expand Down Expand Up @@ -1006,7 +1006,7 @@ Adds an account address to the whitelist. The execution of the modified KEVM wil
rule [foundry.allowAllCallsToAddress]:
<k> #cheatcode_call SELECTOR ARGS
=> #loadAccount #asWord(ARGS)
~> #setAllowedAllCalls #asWord(ARGS) ... </k>
~> #setAllowedCall #asWord(ARGS) .Bytes ... </k>
requires SELECTOR ==Int selector("allowCallsToAddress(address)")
```

Expand Down Expand Up @@ -1646,21 +1646,13 @@ If the flag is false, it skips comparison, assuming success; otherwise, it compa

```k
syntax KItem ::= "#setAllowedCall" Account Bytes [symbol(foundry_setAllowedCall)]
| "#setAllowedAllCalls" Account [symbol(foundry_setAllowedAllCalls)]
// -----------------------------------------------------------------------------------
rule <k> #setAllowedCall ALLOWEDACCOUNT ALLOWEDCALLDATA => .K ... </k>
<whitelist>
<isCallWhitelistActive> _ => true </isCallWhitelistActive>
<allowedCallsList> ALLOWEDCALLS => ALLOWEDCALLS ListItem({ALLOWEDACCOUNT|ALLOWEDCALLDATA}) </allowedCallsList>
...
</whitelist>
rule <k> #setAllowedAllCalls ALLOWEDACCOUNT => .K ... </k>
<whitelist>
<isCallWhitelistActive> _ => true </isCallWhitelistActive>
<allowedCallsList> ALLOWEDCALLS => ALLOWEDCALLS ListItem({ALLOWEDACCOUNT|b"*"}) </allowedCallsList>
...
</whitelist>
```

- `#setMockCall MOCKADDRESS MOCKCALLDATA MOCKRETURN` will update the `<mockcalls>` mapping for the given account.
Expand Down

0 comments on commit ab78122

Please sign in to comment.