tx · 6dTMKXHrBZVXcD91DkV44XSr7zN8HHZtTsgbv1G5tG5Y
3N3v2zVJyynhzc39qG5wrE244prmxQ4bgV4: -0.14000000 Waves
2023.03.22 16:22 [2501276] smart account 3N3v2zVJyynhzc39qG5wrE244prmxQ4bgV4 > SELF 0.00000000 Waves
{
"type": 13,
"id": "6dTMKXHrBZVXcD91DkV44XSr7zN8HHZtTsgbv1G5tG5Y",
"fee": 14000000,
"feeAssetId": null,
"timestamp": 1679491297515,
"version": 2,
"chainId": 84,
"sender": "3N3v2zVJyynhzc39qG5wrE244prmxQ4bgV4",
"senderPublicKey": "B9tjfxvdWuoHAvWusCmsxYMGHa4o2uzQmod3uHjLmF5G",
"proofs": [
"2bKtoDGKmneNwG3z2uPVGW7BCA9nLnU2GjFStVjjxzscgmCohKVXTCDcJgBYDhrfQfd6bTnnk7CFkhh99mthd59f",
"2PwZ1FrBsUYEL8d7Ew6SQuDFdBvHJV4mye7B4dhiznPaA4ihyuAjK4HPg7VEX9oU93rVWNpbGsAnYDU3S2sDRT9H"
],
"script": "base64:BgICCAINAAZvcmFjbGUJAQdBZGRyZXNzAQEaAVRIE5cMwNMzzCUygLYp96dkaICr48x7S5kBE2dldEJhc2U1OEZyb21PcmFjbGUBA2tleQQHJG1hdGNoMAkAnQgCBQZvcmFjbGUFA2tleQMJAAECBQckbWF0Y2gwAgZTdHJpbmcEBnN0cmluZwUHJG1hdGNoMAkA2QQBBQZzdHJpbmcEB25vdGhpbmcFByRtYXRjaDAJAAIBCQCsAgIFA2tleQIIaXMgZW1wdHkADWtBZG1pblB1YktleTECC2FkbWluX3B1Yl8xAA1rQWRtaW5QdWJLZXkyAgthZG1pbl9wdWJfMgANa0FkbWluUHViS2V5MwILYWRtaW5fcHViXzMAEmtBZG1pbkludm9rZVB1YktleQIQYWRtaW5faW52b2tlX3B1YgAMa1JvdXRpbmdBZGRyAg9yb3V0aW5nX2FkZHJlc3MADGFkbWluUHViS2V5MQkBE2dldEJhc2U1OEZyb21P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HlCeXRlcwkAkQMCCAUCdHgGcHJvb2ZzAAIFDGFkbWluUHViS2V5MwABAAAJAGcCCQBkAgkAZAIFEmFkbWluUHViS2V5MVNpZ25lZAUSYWRtaW5QdWJLZXkyU2lnbmVkBRJhZG1pblB1YktleTNTaWduZWQAAniM00o=",
"height": 2501276,
"applicationStatus": "succeeded",
"spentComplexity": 0
}
View: original | compacted
Prev: FK1mseFSZGYNv7aNaDDWh9sMDem5s66bMp7BeSREj4yV
Next: 2MGWf8kASDBFKUQTMB7KUktLecyYePGwJ8nffCZj8Qin
Diff:
Old | New | | Differences |
---|
17 | 17 | | |
---|
18 | 18 | | let kAdminPubKey3 = "admin_pub_3" |
---|
19 | 19 | | |
---|
| 20 | + | let kAdminInvokePubKey = "admin_invoke_pub" |
---|
| 21 | + | |
---|
20 | 22 | | let kRoutingAddr = "routing_address" |
---|
21 | 23 | | |
---|
22 | 24 | | let adminPubKey1 = getBase58FromOracle(kAdminPubKey1) |
---|
|
24 | 26 | | let adminPubKey2 = getBase58FromOracle(kAdminPubKey2) |
---|
25 | 27 | | |
---|
26 | 28 | | let adminPubKey3 = getBase58FromOracle(kAdminPubKey3) |
---|
| 29 | + | |
---|
| 30 | + | let adminInvoke = getBase58FromOracle(kAdminInvokePubKey) |
---|
27 | 31 | | |
---|
28 | 32 | | let routingAddress = Address(getBase58FromOracle(kRoutingAddr)) |
---|
29 | 33 | | |
---|
|
47 | 51 | | let isExchangeCall = if (isDefined(getString(oracle, (keyPrefixPoolName + toString(addressFromRecipient(inv.dApp)))))) |
---|
48 | 52 | | then (inv.function == "exchange") |
---|
49 | 53 | | else false |
---|
50 | | - | if (if (if (if (if (isExchangeCall) |
---|
| 54 | + | let adminPubKey1Signed = if (sigVerify(tx.bodyBytes, tx.proofs[0], adminPubKey1)) |
---|
| 55 | + | then 1 |
---|
| 56 | + | else 0 |
---|
| 57 | + | let adminPubKey2Signed = if (sigVerify(tx.bodyBytes, tx.proofs[0], adminPubKey2)) |
---|
| 58 | + | then 1 |
---|
| 59 | + | else 0 |
---|
| 60 | + | let adminPubKey3Signed = if (sigVerify(tx.bodyBytes, tx.proofs[0], adminPubKey3)) |
---|
| 61 | + | then 1 |
---|
| 62 | + | else 0 |
---|
| 63 | + | let adminPubKeyInvokeSigned = if (sigVerify(tx.bodyBytes, tx.proofs[0], adminInvoke)) |
---|
| 64 | + | then 1 |
---|
| 65 | + | else 0 |
---|
| 66 | + | let signedByOneAdmin = ((((adminPubKey1Signed + adminPubKey2Signed) + adminPubKey3Signed) + adminPubKeyInvokeSigned) >= 1) |
---|
| 67 | + | if (if (if (if (if (if (isExchangeCall) |
---|
51 | 68 | | then true |
---|
52 | 69 | | else isExchangeCallCPMM) |
---|
53 | 70 | | then true |
---|
|
57 | 74 | | then sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey) |
---|
58 | 75 | | else false) |
---|
59 | 76 | | then isRightFee |
---|
| 77 | + | else false) |
---|
| 78 | + | then signedByOneAdmin |
---|
60 | 79 | | else false |
---|
61 | 80 | | case _ => |
---|
62 | 81 | | let adminPubKey1Signed = if (sigVerify(tx.bodyBytes, tx.proofs[0], adminPubKey1)) |
---|
Full:
Old | New | | Differences |
---|
1 | 1 | | {-# STDLIB_VERSION 6 #-} |
---|
2 | 2 | | {-# SCRIPT_TYPE ACCOUNT #-} |
---|
3 | 3 | | {-# CONTENT_TYPE DAPP #-} |
---|
4 | 4 | | let oracle = Address(base58'3MvVBtsXroQpy1tsPw21TU2ET9A8WfmrNjz') |
---|
5 | 5 | | |
---|
6 | 6 | | func getBase58FromOracle (key) = match getString(oracle, key) { |
---|
7 | 7 | | case string: String => |
---|
8 | 8 | | fromBase58String(string) |
---|
9 | 9 | | case nothing => |
---|
10 | 10 | | throw((key + "is empty")) |
---|
11 | 11 | | } |
---|
12 | 12 | | |
---|
13 | 13 | | |
---|
14 | 14 | | let kAdminPubKey1 = "admin_pub_1" |
---|
15 | 15 | | |
---|
16 | 16 | | let kAdminPubKey2 = "admin_pub_2" |
---|
17 | 17 | | |
---|
18 | 18 | | let kAdminPubKey3 = "admin_pub_3" |
---|
19 | 19 | | |
---|
| 20 | + | let kAdminInvokePubKey = "admin_invoke_pub" |
---|
| 21 | + | |
---|
20 | 22 | | let kRoutingAddr = "routing_address" |
---|
21 | 23 | | |
---|
22 | 24 | | let adminPubKey1 = getBase58FromOracle(kAdminPubKey1) |
---|
23 | 25 | | |
---|
24 | 26 | | let adminPubKey2 = getBase58FromOracle(kAdminPubKey2) |
---|
25 | 27 | | |
---|
26 | 28 | | let adminPubKey3 = getBase58FromOracle(kAdminPubKey3) |
---|
| 29 | + | |
---|
| 30 | + | let adminInvoke = getBase58FromOracle(kAdminInvokePubKey) |
---|
27 | 31 | | |
---|
28 | 32 | | let routingAddress = Address(getBase58FromOracle(kRoutingAddr)) |
---|
29 | 33 | | |
---|
30 | 34 | | let keyPrefixPoolName = "pool_" |
---|
31 | 35 | | |
---|
32 | 36 | | |
---|
33 | 37 | | @Verifier(tx) |
---|
34 | 38 | | func verify () = match tx { |
---|
35 | 39 | | case inv: InvokeScriptTransaction => |
---|
36 | 40 | | let isRightFee = if ((inv.fee == 900000)) |
---|
37 | 41 | | then (inv.feeAssetId == unit) |
---|
38 | 42 | | else false |
---|
39 | 43 | | let isRoutingCall = if ((inv.dApp == routingAddress)) |
---|
40 | 44 | | then (inv.function == "routingTrade") |
---|
41 | 45 | | else false |
---|
42 | 46 | | let isExchangeCallCPMM = if (if (isDefined(getString(oracle, (keyPrefixPoolName + toString(addressFromRecipient(inv.dApp)))))) |
---|
43 | 47 | | then (inv.function == "callFunction") |
---|
44 | 48 | | else false) |
---|
45 | 49 | | then (inv.args[0] == "exchange") |
---|
46 | 50 | | else false |
---|
47 | 51 | | let isExchangeCall = if (isDefined(getString(oracle, (keyPrefixPoolName + toString(addressFromRecipient(inv.dApp)))))) |
---|
48 | 52 | | then (inv.function == "exchange") |
---|
49 | 53 | | else false |
---|
50 | | - | if (if (if (if (if (isExchangeCall) |
---|
| 54 | + | let adminPubKey1Signed = if (sigVerify(tx.bodyBytes, tx.proofs[0], adminPubKey1)) |
---|
| 55 | + | then 1 |
---|
| 56 | + | else 0 |
---|
| 57 | + | let adminPubKey2Signed = if (sigVerify(tx.bodyBytes, tx.proofs[0], adminPubKey2)) |
---|
| 58 | + | then 1 |
---|
| 59 | + | else 0 |
---|
| 60 | + | let adminPubKey3Signed = if (sigVerify(tx.bodyBytes, tx.proofs[0], adminPubKey3)) |
---|
| 61 | + | then 1 |
---|
| 62 | + | else 0 |
---|
| 63 | + | let adminPubKeyInvokeSigned = if (sigVerify(tx.bodyBytes, tx.proofs[0], adminInvoke)) |
---|
| 64 | + | then 1 |
---|
| 65 | + | else 0 |
---|
| 66 | + | let signedByOneAdmin = ((((adminPubKey1Signed + adminPubKey2Signed) + adminPubKey3Signed) + adminPubKeyInvokeSigned) >= 1) |
---|
| 67 | + | if (if (if (if (if (if (isExchangeCall) |
---|
51 | 68 | | then true |
---|
52 | 69 | | else isExchangeCallCPMM) |
---|
53 | 70 | | then true |
---|
54 | 71 | | else isRoutingCall) |
---|
55 | 72 | | then (size(inv.payments) == 1) |
---|
56 | 73 | | else false) |
---|
57 | 74 | | then sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey) |
---|
58 | 75 | | else false) |
---|
59 | 76 | | then isRightFee |
---|
| 77 | + | else false) |
---|
| 78 | + | then signedByOneAdmin |
---|
60 | 79 | | else false |
---|
61 | 80 | | case _ => |
---|
62 | 81 | | let adminPubKey1Signed = if (sigVerify(tx.bodyBytes, tx.proofs[0], adminPubKey1)) |
---|
63 | 82 | | then 1 |
---|
64 | 83 | | else 0 |
---|
65 | 84 | | let adminPubKey2Signed = if (sigVerify(tx.bodyBytes, tx.proofs[1], adminPubKey2)) |
---|
66 | 85 | | then 1 |
---|
67 | 86 | | else 0 |
---|
68 | 87 | | let adminPubKey3Signed = if (sigVerify(tx.bodyBytes, tx.proofs[2], adminPubKey3)) |
---|
69 | 88 | | then 1 |
---|
70 | 89 | | else 0 |
---|
71 | 90 | | (((adminPubKey1Signed + adminPubKey2Signed) + adminPubKey3Signed) >= 2) |
---|
72 | 91 | | } |
---|
73 | 92 | | |
---|