tx · 2WWAvn3YXGpRKjNtUerDTfDE5rgSqfaDhvim4R1kytqY 3MvuveAR1Z4LmsKiNvjDKDNdUwhRY1peZcX: -0.01400000 Waves 2020.05.23 02:24 [1010145] smart account 3MvuveAR1Z4LmsKiNvjDKDNdUwhRY1peZcX > SELF 0.00000000 Waves
{ "type": 13, "id": "2WWAvn3YXGpRKjNtUerDTfDE5rgSqfaDhvim4R1kytqY", "fee": 1400000, "feeAssetId": null, "timestamp": 1590189844016, "version": 1, "sender": "3MvuveAR1Z4LmsKiNvjDKDNdUwhRY1peZcX", "senderPublicKey": "ATKvASNMrYVF14RZZmQE1XB1SEL2JSn7EVZMr9XcG4ho", "proofs": [ "4rAqP2UjTNYCfGTycc6Qiw7jZQy95DC7poT1vvx2j9aUpK7gerX5eSefdQFHZdLZgxfMAkTJtvYNEK8D1KatSFSj" ], "script": "base64:AAIDAAAAAAAAABEIARIHCgUICAgICBIECgIICAAAAAYAAAAABE5PTkUCAAAABG5vbmUAAAAACWFkbVB1YktleQEAAAAgjHesJPp5xIuoKzJYyBWRN6te3+eZKpca/z07LlUeq3IBAAAADmdldE51bWJlckJ5S2V5AAAAAQAAAANrZXkEAAAAA251bQQAAAAHJG1hdGNoMAkABBoAAAACBQAAAAR0aGlzBQAAAANrZXkDCQAAAQAAAAIFAAAAByRtYXRjaDACAAAAA0ludAQAAAABYQUAAAAHJG1hdGNoMAUAAAABYQAAAAAAAAAAAAUAAAADbnVtAQAAAAtnZXRTdHJCeUtleQAAAAEAAAADa2V5BAAAAANzdHIEAAAAByRtYXRjaDAJAAQdAAAAAgUAAAAEdGhpcwUAAAADa2V5AwkAAAEAAAACBQAAAAckbWF0Y2gwAgAAAAZTdHJpbmcEAAAAAWEFAAAAByRtYXRjaDAFAAAAAWEFAAAABE5PTkUFAAAAA3N0cgEAAAANZ2V0U2VjdXJlSGFzaAAAAAEAAAADa2V5CQACWAAAAAEJAAH1AAAAAQkAAfYAAAABCQABmwAAAAEFAAAAA2tleQEAAAALZ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prev: EbUncTbqSj4FkzKbEmkUh6WGVPgoFEykxdwCM2VEZEf2 Next: 31X97VH8cQuaeWheH8NXKBYNZLaS2E6HVizTHWvTJhk1 Diff:
Old | New | Differences | |
---|---|---|---|
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let NONE = "none" | |
5 | 5 | ||
6 | - | let admPubKey = base58' | |
6 | + | let admPubKey = base58'ATKvASNMrYVF14RZZmQE1XB1SEL2JSn7EVZMr9XcG4ho' | |
7 | 7 | ||
8 | 8 | func getNumberByKey (key) = { | |
9 | 9 | let num = match getInteger(this, key) { |
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 | - | let admPubKey = base58' | |
6 | + | let admPubKey = base58'ATKvASNMrYVF14RZZmQE1XB1SEL2JSn7EVZMr9XcG4ho' | |
7 | 7 | ||
8 | 8 | func getNumberByKey (key) = { | |
9 | 9 | let num = match getInteger(this, key) { | |
10 | 10 | case a: Int => | |
11 | 11 | a | |
12 | 12 | case _ => | |
13 | 13 | 0 | |
14 | 14 | } | |
15 | 15 | num | |
16 | 16 | } | |
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 getSecureHash (key) = toBase58String(keccak256(blake2b256(toBytes(key)))) | |
31 | 31 | ||
32 | 32 | ||
33 | 33 | func getExternal (payment,multiplier) = { | |
34 | 34 | let pay = extract(payment) | |
35 | 35 | if ((isDefined(pay) == false)) | |
36 | 36 | then throw("You need pay at least 2 waves for this operation") | |
37 | 37 | else if (if ((isDefined(extract(pay.assetId)) == true)) | |
38 | 38 | then true | |
39 | 39 | else ((2000000 * (multiplier + 1)) >= pay.amount)) | |
40 | 40 | then throw("Need at least 2 Waves for auth change password") | |
41 | 41 | else TransferSet([ScriptTransfer(addressFromStringValue("3MpBUJbYZVA8iwoesCYaSytA82dVPyzVpmW"), 15000000, pay.assetId)]) | |
42 | 42 | } | |
43 | 43 | ||
44 | 44 | ||
45 | 45 | @Callable(i) | |
46 | 46 | func addOp (opEmail,opPass,opPubKey,opSign,opLevel) = { | |
47 | 47 | let pubKey = toBase58String(i.callerPublicKey) | |
48 | 48 | let secEmail = getSecureHash(opEmail) | |
49 | 49 | let secPass = getSecureHash(opPass) | |
50 | 50 | if ((pubKey != toBase58String(admPubKey))) | |
51 | 51 | then throw("Not auth to add operator") | |
52 | 52 | else if ((getStrByKey(secEmail) != NONE)) | |
53 | 53 | then throw("This operator already added") | |
54 | 54 | else if ((addressFromPublicKey(i.callerPublicKey) != this)) | |
55 | 55 | then getExternal(i.payment, 5) | |
56 | 56 | else if ((sigVerify(toBytes((opEmail + opPass)), fromBase58String(opSign), fromBase58String(pubKey)) == false)) | |
57 | 57 | then throw("Sign not verified") | |
58 | 58 | else WriteSet([DataEntry(secEmail, secPass), DataEntry((secEmail + "_opKey"), opPubKey), DataEntry((secEmail + "_opId"), toBase58String(i.transactionId)), DataEntry((secEmail + "_opLevel"), opLevel), DataEntry((secEmail + "_opAuth"), ("Allow,0," + toString(lastBlock.height)))]) | |
59 | 59 | } | |
60 | 60 | ||
61 | 61 | ||
62 | 62 | ||
63 | 63 | @Callable(i) | |
64 | 64 | func resetOp (opEmail,resetKey) = { | |
65 | 65 | let pubKey = toBase58String(i.callerPublicKey) | |
66 | 66 | let pay = extract(i.payment) | |
67 | 67 | let secEmail = getSecureHash(opEmail) | |
68 | 68 | if ((getStrByKey(secEmail) == NONE)) | |
69 | 69 | then throw("This operator does not exist") | |
70 | 70 | else { | |
71 | 71 | let auth = split(getStrByKey((secEmail + "_opAuth")), ",") | |
72 | 72 | if (((getStrByKey(secEmail) + "_opKey") != pubKey)) | |
73 | 73 | then getExternal(extract(i.payment), parseIntValue(auth[1])) | |
74 | 74 | else if ((parseIntValue(auth[2]) >= height)) | |
75 | 75 | then throw((("There is already a request delivered to your email, wait " + toString((parseIntValue(auth[2]) - height))) + " minutes")) | |
76 | 76 | else if (if (if ((auth[0] == "Allow")) | |
77 | 77 | then true | |
78 | 78 | else (auth[0] != "Recovery")) | |
79 | 79 | then if ((auth[0] != "Allow")) | |
80 | 80 | then true | |
81 | 81 | else (auth[0] == "Recovery") | |
82 | 82 | else false) | |
83 | 83 | then throw("Request not allowed") | |
84 | 84 | else if ((auth[0] == "Recovery")) | |
85 | 85 | then { | |
86 | 86 | let multi = parseIntValue(auth[1]) | |
87 | 87 | WriteSet([DataEntry((secEmail + "_opAuth"), ((("Recovery," + toString((multi + 1))) + ",") + toString((lastBlock.height + (multi * 60)))))]) | |
88 | 88 | } | |
89 | 89 | else WriteSet([DataEntry(secEmail, resetKey), DataEntry((secEmail + "_opAuth"), ("Recovery,1," + toString((lastBlock.height + 60))))]) | |
90 | 90 | } | |
91 | 91 | } | |
92 | 92 | ||
93 | 93 |
github/deemru/w8io/026f985 26.27 ms ◑