tx · BM1susiGXguobSUZ5Emheg6z1AUVNHLYEjjevqFBFNSk 3N2eueE5vLLKe8jXuBDbdbKcPaH36yG1Had: -0.00700000 Waves 2023.02.02 11:25 [2431758] smart account 3N2eueE5vLLKe8jXuBDbdbKcPaH36yG1Had > SELF 0.00000000 Waves
{ "type": 13, "id": "BM1susiGXguobSUZ5Emheg6z1AUVNHLYEjjevqFBFNSk", "fee": 700000, "feeAssetId": null, "timestamp": 1675326400031, "version": 2, "chainId": 84, "sender": "3N2eueE5vLLKe8jXuBDbdbKcPaH36yG1Had", "senderPublicKey": "EAmZF2D2BbfoPsrMGFAs2UCv8ScAXxhAZRzFpkveca8G", "proofs": [ "4C8jEyMrWB8RPp82iNTx9mUM9gyJFnxuFU9JN2D7yBuyWMiRVNCEzzg5B5THjdAuiHJtW5RxAQwLDagrnbhLRvAT", "3ZcqFAWCZhEvkcVpmUiypcb3ZdZMN7FZovpQxtdJV8yk4i7uY419Ue8yfu2EQTzZmNxtRQhpJfbVFGuCL4fmyuhc" ], "script": "base64:BgICCAITAAZvcmFjbGUJAQdBZGRyZXNzAQEaAVRIE5cMwNMzzCUygLYp96dkaICr48x7S5kBE2dldEJhc2U1OEZyb21PcmFjbGUBA2tleQQHJG1hdGNoMAkAnQgCBQZvcmFjbGUFA2tleQMJAAECBQckbWF0Y2gwAgZTdHJpbmcEBnN0cmluZwUHJG1hdGNoMAkA2QQBBQZzdHJpbmcEB25vdGhpbmcFByRtYXRjaDAJAAIBCQCsAgIFA2tleQIIaXMgZW1wdHkADWtBZG1pblB1YktleTECC2FkbWluX3B1Yl8xAA1rQWRtaW5QdWJLZXkyAgthZG1pbl9wdWJfMgANa0FkbWluUHViS2V5MwILYWRtaW5fcHViXzMAEmtBZG1pbkludm9rZVB1YktleQIQYWRtaW5faW52b2tlX3B1YgALa0dvdkFkZHJlc3MCEmdvdmVybmFuY2VfYWRkcmVzcwAMa0Zhcm1BZGRyZXNzAg9mYXJtaW5nX2FkZHJlc3MAD2tTdXJ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JhZG1pblB1YktleTJTaWduZWQDCQD0AwMIBQJ0eAlib2R5Qnl0ZXMJAJEDAggFAnR4BnByb29mcwABBQxhZG1pblB1YktleTIAAQAABBJhZG1pblB1YktleTNTaWduZWQDCQD0AwMIBQJ0eAlib2R5Qnl0ZXMJAJEDAggFAnR4BnByb29mcwACBQxhZG1pblB1YktleTMAAQAACQBnAgkAZAIJAGQCBRJhZG1pblB1YktleTFTaWduZWQFEmFkbWluUHViS2V5MlNpZ25lZAUSYWRtaW5QdWJLZXkzU2lnbmVkAALCnp71", "height": 2431758, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 7iJcWi3AabCt369fUA5gNMFkpmKX8fan5Ltdx7Mzaqds Next: 4euGcv6X318gndURAhGkuTPGUFDeBi5QBP58zHhp6Fqn 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 | 20 | let kAdminInvokePubKey = "admin_invoke_pub" | |
21 | 21 | ||
22 | 22 | let kGovAddress = "governance_address" | |
23 | 23 | ||
24 | 24 | let kFarmAddress = "farming_address" | |
25 | 25 | ||
26 | 26 | let kSurveysAddress = "surveys_address" | |
27 | 27 | ||
28 | 28 | let kRoutingAddr = "routing_address" | |
29 | 29 | ||
30 | 30 | let adminPubKey1 = getBase58FromOracle(kAdminPubKey1) | |
31 | 31 | ||
32 | 32 | let adminPubKey2 = getBase58FromOracle(kAdminPubKey2) | |
33 | 33 | ||
34 | 34 | let adminPubKey3 = getBase58FromOracle(kAdminPubKey3) | |
35 | 35 | ||
36 | 36 | let adminInvoke = getBase58FromOracle(kAdminInvokePubKey) | |
37 | 37 | ||
38 | 38 | let governanceAddress = Address(getBase58FromOracle(kGovAddress)) | |
39 | 39 | ||
40 | 40 | let farmingAddress = Address(getBase58FromOracle(kFarmAddress)) | |
41 | 41 | ||
42 | 42 | let surveysAddress = Address(getBase58FromOracle(kSurveysAddress)) | |
43 | 43 | ||
44 | 44 | let routingAddress = Address(getBase58FromOracle(kRoutingAddr)) | |
45 | 45 | ||
46 | 46 | let keyPrefixPoolName = "pool_" | |
47 | 47 | ||
48 | 48 | ||
49 | 49 | @Verifier(tx) | |
50 | 50 | func verify () = match tx { | |
51 | 51 | case inv: InvokeScriptTransaction => | |
52 | 52 | let isRightFee = if ((inv.fee == 900000)) | |
53 | 53 | then (inv.feeAssetId == unit) | |
54 | 54 | else false | |
55 | 55 | let isRoutingCall = if ((inv.dApp == routingAddress)) | |
56 | 56 | then (inv.function == "routingTrade") | |
57 | 57 | else false | |
58 | 58 | let isExchangeCallCPMM = if (if (isDefined(getString(oracle, (keyPrefixPoolName + toString(addressFromRecipient(inv.dApp)))))) | |
59 | 59 | then (inv.function == "callFunction") | |
60 | 60 | else false) | |
61 | 61 | then (inv.args[0] == "exchange") | |
62 | 62 | else false | |
63 | 63 | let isExchangeCall = if (isDefined(getString(oracle, (keyPrefixPoolName + toString(addressFromRecipient(inv.dApp)))))) | |
64 | 64 | then (inv.function == "exchange") | |
65 | 65 | else false | |
66 | 66 | let isAirdropCall = if ((inv.dApp == governanceAddress)) | |
67 | 67 | then (inv.function == "airDrop") | |
68 | 68 | else false | |
69 | 69 | let isUpdateWeightsCall = if ((inv.dApp == governanceAddress)) | |
70 | 70 | then (inv.function == "updateWeights") | |
71 | 71 | else false | |
72 | 72 | let isTakenIntoAccountCPMM = if (if (isDefined(getString(oracle, (keyPrefixPoolName + toString(addressFromRecipient(inv.dApp)))))) | |
73 | 73 | then (inv.function == "callFunction") | |
74 | 74 | else false) | |
75 | 75 | then (inv.args[0] == "takeIntoAccountExtraFunds") | |
76 | 76 | else false | |
77 | 77 | let isTakenIntoAccount = if (isDefined(getString(oracle, (keyPrefixPoolName + toString(addressFromRecipient(inv.dApp)))))) | |
78 | 78 | then (inv.function == "takeIntoAccountExtraFunds") | |
79 | 79 | else false | |
80 | 80 | let isWriteTotal = if ((inv.dApp == surveysAddress)) | |
81 | 81 | then (inv.function == "writeTotals") | |
82 | 82 | else false | |
83 | 83 | let adminPubKey1Signed = if (sigVerify(tx.bodyBytes, tx.proofs[0], adminPubKey1)) | |
84 | 84 | then 1 | |
85 | 85 | else 0 | |
86 | 86 | let adminPubKey2Signed = if (sigVerify(tx.bodyBytes, tx.proofs[0], adminPubKey2)) | |
87 | 87 | then 1 | |
88 | 88 | else 0 | |
89 | 89 | let adminPubKey3Signed = if (sigVerify(tx.bodyBytes, tx.proofs[0], adminPubKey3)) | |
90 | 90 | then 1 | |
91 | 91 | else 0 | |
92 | 92 | let adminPubKeyInvokeSigned = if (sigVerify(tx.bodyBytes, tx.proofs[0], adminInvoke)) | |
93 | 93 | then 1 | |
94 | 94 | else 0 | |
95 | 95 | let signedByOneAdmin = ((((adminPubKey1Signed + adminPubKey2Signed) + adminPubKey3Signed) + adminPubKeyInvokeSigned) >= 1) | |
96 | 96 | if (if (if (if (if (if (if (isExchangeCall) | |
97 | 97 | then true | |
98 | 98 | else isExchangeCallCPMM) | |
99 | 99 | then true | |
100 | 100 | else isAirdropCall) | |
101 | 101 | then true | |
102 | 102 | else isRoutingCall) | |
103 | 103 | then (size(inv.payments) == 1) | |
104 | 104 | else false) | |
105 | 105 | then true | |
106 | 106 | else if (if (if (if (isUpdateWeightsCall) | |
107 | 107 | then true | |
108 | 108 | else isTakenIntoAccount) | |
109 | 109 | then true | |
110 | 110 | else isTakenIntoAccountCPMM) | |
111 | 111 | then true | |
112 | 112 | else isWriteTotal) | |
113 | 113 | then (size(inv.payments) == 0) | |
114 | 114 | else false) | |
115 | 115 | then signedByOneAdmin | |
116 | 116 | else false) | |
117 | 117 | then isRightFee | |
118 | 118 | else false | |
119 | 119 | case _ => | |
120 | 120 | let adminPubKey1Signed = if (sigVerify(tx.bodyBytes, tx.proofs[0], adminPubKey1)) | |
121 | 121 | then 1 | |
122 | 122 | else 0 | |
123 | 123 | let adminPubKey2Signed = if (sigVerify(tx.bodyBytes, tx.proofs[1], adminPubKey2)) | |
124 | 124 | then 1 | |
125 | 125 | else 0 | |
126 | 126 | let adminPubKey3Signed = if (sigVerify(tx.bodyBytes, tx.proofs[2], adminPubKey3)) | |
127 | 127 | then 1 | |
128 | 128 | else 0 | |
129 | 129 | (((adminPubKey1Signed + adminPubKey2Signed) + adminPubKey3Signed) >= 2) | |
130 | 130 | } | |
131 | 131 |
github/deemru/w8io/026f985 47.71 ms ◑