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