Skip to content

Commit

Permalink
Add post condition to SelfDestruct. see #517
Browse files Browse the repository at this point in the history
  • Loading branch information
franck44 committed Jan 31, 2023
1 parent 370b681 commit f260ff2
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/dafny/bytecode.dfy
Original file line number Diff line number Diff line change
Expand Up @@ -1879,6 +1879,11 @@ module Bytecode {
requires st.IsExecuting()
ensures st'.RETURNS? || st' == INVALID(STACK_UNDERFLOW) || st' == INVALID(WRITE_PROTECTION_VIOLATED)
ensures st'.RETURNS? <==> st.Operands() >= 1 && st.WritesPermitted()
ensures st'.RETURNS? ==>
var a := st.evm.context.address;
a in st'.world.accounts
&& st'.world.accounts[a] == st.evm.world.accounts[a].(balance := 0)
&& a in st'.substate.selfDestruct
ensures st' == INVALID(STACK_UNDERFLOW) <==> st.Operands() < 1
ensures st' == INVALID(WRITE_PROTECTION_VIOLATED) <==> st.Operands() >= 1 && !st.WritesPermitted()
{
Expand Down

0 comments on commit f260ff2

Please sign in to comment.