Skip to content

Instantly share code, notes, and snippets.

@yidongw
Created December 20, 2018 23:37
Show Gist options
  • Save yidongw/2dadb2cdd5c90a6d96ffd4e159aaf721 to your computer and use it in GitHub Desktop.
Save yidongw/2dadb2cdd5c90a6d96ffd4e159aaf721 to your computer and use it in GitHub Desktop.
Perun13
function VCAlreadyClosed(uint vid, bytes sig) AliceOrBob public {
require((msg.sender != virtual[vid].Ingrid && (virtual[vid].status == VCStatus.Closing || virtual[vid].status == VCStatus.ClosingFinal)) ||
(msg.sender == virtual[vid].Ingrid && virtual[vid].status == VCStatus.Timeouted));
bytes32 msgHash = keccak256(vid, alreadyClosed);
require(libSignatures.verify(Other(msg.sender, alice.id, bob.id), msgHash, sig));
EventClosed();
selfdestruct(msg.sender);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment