tx · 2S5ypuTZoB4dr4abieFTgnV4yHgawWp6ozULcbNLiyUq 3MvuveAR1Z4LmsKiNvjDKDNdUwhRY1peZcX: -0.01400000 Waves 2020.05.23 02:34 [1010153] smart account 3MvuveAR1Z4LmsKiNvjDKDNdUwhRY1peZcX > SELF 0.00000000 Waves
{ "type": 13, "id": "2S5ypuTZoB4dr4abieFTgnV4yHgawWp6ozULcbNLiyUq", "fee": 1400000, "feeAssetId": null, "timestamp": 1590190488340, "version": 1, "sender": "3MvuveAR1Z4LmsKiNvjDKDNdUwhRY1peZcX", "senderPublicKey": "ATKvASNMrYVF14RZZmQE1XB1SEL2JSn7EVZMr9XcG4ho", "proofs": [ "2Xipyejf4N5v8TzTY2hHXR2i6JACNrPeucPaEST6WSN9rsZ3PZiWpB7eUjMetLqbr2M59rT4NZHrgRryoiY1DFVw" ], "script": "base64:AAIDAAAAAAAAABEIARIHCgUICAgICBIECgIICAAAAAYAAAAABE5PTkUCAAAABG5vbmUAAAAACWFkbVB1YktleQEAAAAgjHesJPp5xIuoKzJYyBWRN6te3+eZKpca/z07LlUeq3IBAAAADmdldE51bWJlckJ5S2V5AAAAAQAAAANrZXkEAAAAA251bQQAAAAHJG1hdGNoMAkABBoAAAACBQAAAAR0aGlzBQAAAANrZXkDCQAAAQAAAAIFAAAAByRtYXRjaDACAAAAA0ludAQAAAABYQUAAAAHJG1hdGNoMAUAAAABYQAAAAAAAAAAAAUAAAADbnVtAQAAAAtnZXRTdHJCeUtleQAAAAEAAAADa2V5BAAAAANzdHIEAAAAByRtYXRjaDAJAAQdAAAAAgUAAAAEdGhpcwUAAAADa2V5AwkAAAEAAAACBQAAAAckbWF0Y2gwAgAAAAZTdHJpbmcEAAAAAWEFAAAAByRtYXRjaDAFAAAAAWEFAAAABE5PTkUFAAAAA3N0cgEAAAANZ2V0U2VjdXJlSGFzaAAAAAEAAAADa2V5CQACWAAAAAEJAAH1AAAAAQkAAfYAAAABCQABmwAAAAEFAAAAA2tleQEAAAALZ2V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ARhdXRoAAAAAAAAAAAAAgAAAAVBbGxvdwYJAQAAAAIhPQAAAAIJAAGRAAAAAgUAAAAEYXV0aAAAAAAAAAAAAAIAAAAIUmVjb3ZlcnkDCQEAAAACIT0AAAACCQABkQAAAAIFAAAABGF1dGgAAAAAAAAAAAACAAAABUFsbG93BgkAAAAAAAACCQABkQAAAAIFAAAABGF1dGgAAAAAAAAAAAACAAAACFJlY292ZXJ5BwkAAAIAAAABAgAAABNSZXF1ZXN0IG5vdCBhbGxvd2VkAwkAAAAAAAACCQABkQAAAAIFAAAABGF1dGgAAAAAAAAAAAACAAAACFJlY292ZXJ5BAAAAAVtdWx0aQkBAAAADXBhcnNlSW50VmFsdWUAAAABCQABkQAAAAIFAAAABGF1dGgAAAAAAAAAAAEJAQAAAAhXcml0ZVNldAAAAAEJAARMAAAAAgkBAAAACURhdGFFbnRyeQAAAAIJAAEsAAAAAgUAAAAIc2VjRW1haWwCAAAAB19vcEF1dGgJAAEsAAAAAgkAASwAAAACCQABLAAAAAICAAAACVJlY292ZXJ5LAkAAaQAAAABCQAAZAAAAAIFAAAABW11bHRpAAAAAAAAAAABAgAAAAEsCQABpAAAAAEJAABkAAAAAggFAAAACWxhc3RCbG9jawAAAAZoZWlnaHQJAABoAAAAAgUAAAAFbXVsdGkAAAAAAAAAADwFAAAAA25pbAkBAAAACFdyaXRlU2V0AAAAAQkABEwAAAACCQEAAAAJRGF0YUVudHJ5AAAAAgUAAAAIc2VjRW1haWwFAAAACHJlc2V0S2V5CQAETAAAAAIJAQAAAAlEYXRhRW50cnkAAAACCQABLAAAAAIFAAAACHNlY0VtYWlsAgAAAAdfb3BBdXRoCQABLAAAAAICAAAAC1JlY292ZXJ5LDEsCQABpAAAAAEJAABkAAAAAggFAAAACWxhc3RCbG9jawAAAAZoZWlnaHQAAAAAAAAAADwFAAAAA25pbAAAAAAkQPTn", "chainId": 84, "height": 1010153, "spentComplexity": 0 } View: original | compacted Prev: JCoKbUviEAZd4FNPTxSoA9hUCdGW5MyS5vbxSNNxrN98 Next: YKszNacE2SrGV5xo6YTN4qEJQaPFtnf3FrizwX7nouY Diff:
Old | New | Differences | |
---|---|---|---|
30 | 30 | func getSecureHash (key) = toBase58String(keccak256(blake2b256(toBytes(key)))) | |
31 | 31 | ||
32 | 32 | ||
33 | - | func getExternal (payment,multiplier) = if ((isDefined( | |
33 | + | func getExternal (payment,multiplier) = if ((isDefined(payment) == false)) | |
34 | 34 | then throw("You need pay at least 2 waves for this operation") | |
35 | 35 | else { | |
36 | 36 | let pay = extract(payment) |
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 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 | - | func getExternal (payment,multiplier) = if ((isDefined( | |
33 | + | func getExternal (payment,multiplier) = if ((isDefined(payment) == false)) | |
34 | 34 | then throw("You need pay at least 2 waves for this operation") | |
35 | 35 | else { | |
36 | 36 | let pay = extract(payment) | |
37 | 37 | if (if ((isDefined(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"), (pay.amount - 1500000), 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 getExternal(i.payment, 3) | |
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, 10) | |
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 28.12 ms ◑