tx · peBmeVniwLN5sM8pg4iMPqs87GrdRhiTqR42KoMeTfX 3N9HxpGzNtqg7cnyi3YKqNWn3Pg455qhC1v: -0.01400000 Waves 2019.10.12 11:32 [716436] smart account 3N9HxpGzNtqg7cnyi3YKqNWn3Pg455qhC1v > SELF 0.00000000 Waves
{ "type": 13, "id": "peBmeVniwLN5sM8pg4iMPqs87GrdRhiTqR42KoMeTfX", "fee": 1400000, "feeAssetId": null, "timestamp": 1570865446367, "version": 1, "sender": "3N9HxpGzNtqg7cnyi3YKqNWn3Pg455qhC1v", "senderPublicKey": "BCJkAYn3SnMBve19dS2bsMJvfp9rHcLgFYtZRJJqLVxh", "proofs": [ "29EajiRB3nVJANvqdXDKZPYjcsdPX31RbZLGV9vNgk6naXb4AjUSaYWRDaTRSrHBpRM1TEsgrmjnF6htosbG8cfu" ], "script": "base64:AAIDAAAAAAAAABUIARIFCgMIAQgSBAoCCAgSBAoCCAgAAAAUAAAAAAROT05FAgAAAARub25lAAAAAAhGRUFUVVJFRAIAAAAIZmVhdHVyZWQAAAAABERBUFACAAAAAAAAAAAKTElTVElOR0ZFRQkAAGgAAAACAAAAAAAAAAABAAAAAAAF9eEAAAAAAAVXSEFMRQIAAAAFd2hhbGUAAAAAC1dISVRFTElTVEVEAgAAAApyZWdpc3RlcmVkAQAAAA5nZXRLZXlJdGVtRGF0YQAAAAEAAAAEaXRlbQkAASwAAAACAgAAAAlkYXRhanNvbl8FAAAABGl0ZW0BAAAAC2dldFN0ckJ5S2V5AAAAAQAAAANrZXkEAAAAA3N0cgQAAAAHJG1hdGNoMAkABB0AAAACBQAAAAR0aGlzBQAAAANrZXkDCQAAAQAAAAIFAAAAByRtYXRjaDACAAAABlN0cmluZwQAAAABYQUAAAAHJG1hdGNoMAUAAAABYQUAAAAETk9ORQUAAAADc3RyAQAAAA5nZXROdW1iZXJCeUtleQAAAAEAAAADa2V5BAAAAANudW0EAAAAByRtYXRjaDAJAAQaAAAAAgUAAAAEdGhpcwUAAAADa2V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hdGUAAAACAAAABGl0ZW0AAAAEZGF0YQQAAAAHYWNjb3VudAkAAlgAAAABCAgFAAAAAWkAAAAGY2FsbGVyAAAABWJ5dGVzAwkBAAAAAiE9AAAAAgkBAAAAEmdldFZhbHVlSXRlbUF1dGhvcgAAAAEFAAAABGl0ZW0FAAAAB2FjY291bnQJAAACAAAAAQIAAAARWW91J3JlIG5vdCBhdXRob3IJAQAAAAhXcml0ZVNldAAAAAEJAARMAAAAAgkBAAAACURhdGFFbnRyeQAAAAIJAQAAAA5nZXRLZXlJdGVtRGF0YQAAAAEFAAAABGl0ZW0FAAAABGRhdGEFAAAAA25pbAAAAAAb/0Da", "chainId": 84, "height": 716436, "spentComplexity": 0 } View: original | compacted Prev: 5xhCx2LV7jTSBH7pPmABpnstVNhHiBrvnsoWQgX7Xfe6 Next: FPfEfdxu3Ns9RiAcPUVDPUAFEgsKgif3uGqBb4BSy7bh Diff:
Old | New | Differences | |
---|---|---|---|
97 | 97 | } | |
98 | 98 | ||
99 | 99 | ||
100 | + | ||
101 | + | @Callable(i) | |
102 | + | func taskUpdate (item,data) = { | |
103 | + | let account = toBase58String(i.caller.bytes) | |
104 | + | if ((getValueItemAuthor(item) != account)) | |
105 | + | then throw("You're not author") | |
106 | + | else WriteSet([DataEntry(getKeyItemData(item), data)]) | |
107 | + | } | |
108 | + | ||
109 | + |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 3 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let NONE = "none" | |
5 | 5 | ||
6 | 6 | let FEATURED = "featured" | |
7 | 7 | ||
8 | 8 | let DAPP = "" | |
9 | 9 | ||
10 | 10 | let LISTINGFEE = (1 * 100000000) | |
11 | 11 | ||
12 | 12 | let WHALE = "whale" | |
13 | 13 | ||
14 | 14 | let WHITELISTED = "registered" | |
15 | 15 | ||
16 | 16 | func getKeyItemData (item) = ("datajson_" + item) | |
17 | 17 | ||
18 | 18 | ||
19 | 19 | func getStrByKey (key) = { | |
20 | 20 | let str = match getString(this, key) { | |
21 | 21 | case a: String => | |
22 | 22 | a | |
23 | 23 | case _ => | |
24 | 24 | NONE | |
25 | 25 | } | |
26 | 26 | str | |
27 | 27 | } | |
28 | 28 | ||
29 | 29 | ||
30 | 30 | func getNumberByKey (key) = { | |
31 | 31 | let num = match getInteger(this, key) { | |
32 | 32 | case a: Int => | |
33 | 33 | a | |
34 | 34 | case _ => | |
35 | 35 | 0 | |
36 | 36 | } | |
37 | 37 | num | |
38 | 38 | } | |
39 | 39 | ||
40 | 40 | ||
41 | 41 | func getKeyItemAuthor (item) = ("author_" + item) | |
42 | 42 | ||
43 | 43 | ||
44 | 44 | func getValueItemAuthor (item) = getStrByKey(getKeyItemAuthor(item)) | |
45 | 45 | ||
46 | 46 | ||
47 | 47 | func getKeyItemBlock (item) = ("block_" + item) | |
48 | 48 | ||
49 | 49 | ||
50 | 50 | func getKeyItemBank (item) = ("bank_" + item) | |
51 | 51 | ||
52 | 52 | ||
53 | 53 | func getKeyItemStatus (item) = ("status_" + item) | |
54 | 54 | ||
55 | 55 | ||
56 | 56 | func getKeyItemExpiration (item) = ("expiration_block_" + item) | |
57 | 57 | ||
58 | 58 | ||
59 | 59 | func getKeyWhitelistBio (account) = ("d1_bio_" + account) | |
60 | 60 | ||
61 | 61 | ||
62 | 62 | func getKeyWhitelistStatus (account) = ("d1_sts_" + account) | |
63 | 63 | ||
64 | 64 | ||
65 | 65 | func getValueWhitelistStatus (account) = getStrByKey(getKeyWhitelistStatus(account)) | |
66 | 66 | ||
67 | 67 | ||
68 | 68 | func getKeyWhitelistBlock (account) = ("d1_blk_" + account) | |
69 | 69 | ||
70 | 70 | ||
71 | 71 | func getValueWhitelistBio (account) = getStrByKey(getKeyWhitelistBio(account)) | |
72 | 72 | ||
73 | 73 | ||
74 | 74 | @Callable(i) | |
75 | 75 | func createTask (item,expiration,data) = { | |
76 | 76 | let account = toBase58String(i.caller.bytes) | |
77 | 77 | let pmt = extract(i.payment) | |
78 | 78 | if (isDefined(pmt.assetId)) | |
79 | 79 | then throw("can use waves only at the moment") | |
80 | 80 | else if ((pmt.amount != LISTINGFEE)) | |
81 | 81 | then throw(((("Please pay exact amount for the listing: " + toString(LISTINGFEE)) + ", actual payment is: ") + toString(pmt.amount))) | |
82 | 82 | else if ((getValueItemAuthor(item) != NONE)) | |
83 | 83 | then throw("Task already exist") | |
84 | 84 | else WriteSet([DataEntry(getKeyItemAuthor(item), account), DataEntry(getKeyItemBlock(item), height), DataEntry(getKeyItemExpiration(item), (height + expiration)), DataEntry(getKeyItemBank(item), LISTINGFEE), DataEntry(getKeyItemStatus(item), FEATURED), DataEntry(getKeyItemData(item), data)]) | |
85 | 85 | } | |
86 | 86 | ||
87 | 87 | ||
88 | 88 | ||
89 | 89 | @Callable(i) | |
90 | 90 | func signUp (data,type) = { | |
91 | 91 | let account = toBase58String(i.caller.bytes) | |
92 | 92 | if ((getValueWhitelistBio(account) == NONE)) | |
93 | 93 | then WriteSet([DataEntry(getKeyWhitelistBio(account), data), DataEntry(getKeyWhitelistBlock(account), height), DataEntry(getKeyWhitelistStatus(account), if ((type == WHALE)) | |
94 | 94 | then WHALE | |
95 | 95 | else WHITELISTED)]) | |
96 | 96 | else throw("User already exist") | |
97 | 97 | } | |
98 | 98 | ||
99 | 99 | ||
100 | + | ||
101 | + | @Callable(i) | |
102 | + | func taskUpdate (item,data) = { | |
103 | + | let account = toBase58String(i.caller.bytes) | |
104 | + | if ((getValueItemAuthor(item) != account)) | |
105 | + | then throw("You're not author") | |
106 | + | else WriteSet([DataEntry(getKeyItemData(item), data)]) | |
107 | + | } | |
108 | + | ||
109 | + |
github/deemru/w8io/026f985 94.89 ms ◑