-
-
Save et4te/4dea46b77c001423d6b9a6e275ab67f6 to your computer and use it in GitHub Desktop.
Trusted Identity Contracts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[%%version 0.3] | |
(* Identity Domain *) | |
type storage = | |
{ version : string; | |
owner : address; | |
domain : (address, bool) map; | |
} | |
type action = | |
SetMember of address * bool | |
let%entry main (parameter : action) (storage : storage) = | |
match parameter with | |
SetMember (id, value) -> | |
if Current.source () = storage.owner then | |
let m = Map.add id value storage.domain in | |
( ([] : operation list), { | |
version = storage.version; | |
owner = storage.owner; | |
domain = m; | |
} ) | |
else | |
Current.failwith (Current.source ()) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment