tx · BkSbowoKDG625JsvrEkE8g9ZnPMwNWSDjN59dTTsjP6w 3N2eueE5vLLKe8jXuBDbdbKcPaH36yG1Had: -0.14000000 Waves 2022.12.06 10:35 [2348182] smart account 3N2eueE5vLLKe8jXuBDbdbKcPaH36yG1Had > SELF 0.00000000 Waves
{ "type": 13, "id": "BkSbowoKDG625JsvrEkE8g9ZnPMwNWSDjN59dTTsjP6w", "fee": 14000000, "feeAssetId": null, "timestamp": 1670312159164, "version": 2, "chainId": 84, "sender": "3N2eueE5vLLKe8jXuBDbdbKcPaH36yG1Had", "senderPublicKey": "EAmZF2D2BbfoPsrMGFAs2UCv8ScAXxhAZRzFpkveca8G", "proofs": [ "639B1bPniSZmZFC1ZSoQPRmJogRf37ctJdVeH3JqGG6Thhdg58ExjACppyWXkzoKSJn88Ch9dXcrLU41xnmubcHk", "NGTrzGSQMSTkX4Esz4nYEbhRARYZiLGwBRZNbCKK5ycFsdFkXyevkipNhREoHSJXnW4C3ypcwUky7mSuSbGPnDW" ], "script": "base64:BgICCAIRAAZvcmFjbGUJAQdBZGRyZXNzAQEaAVRIE5cMwNMzzCUygLYp96dkaICr48x7S5kBE2dldEJhc2U1OEZyb21PcmFjbGUBA2tleQQHJG1hdGNoMAkAnQgCBQZvcmFjbGUFA2tleQMJAAECBQckbWF0Y2gwAgZTdHJpbmcEBnN0cmluZwUHJG1hdGNoMAkA2QQBBQZzdHJpbmcEB25vdGhpbmcFByRtYXRjaDAJAAIBCQCsAgIFA2tleQIIaXMgZW1wdHkADWtBZG1pblB1YktleTECC2FkbWluX3B1Yl8xAA1rQWRtaW5QdWJLZXkyAgthZG1pbl9wdWJfMgANa0FkbWluUHViS2V5MwILYWRtaW5fcHViXzMAEmtBZG1pbkludm9rZVB1YktleQIQYWRtaW5faW52b2tlX3B1YgALa0dvdkFkZHJlc3MCEmdvdmVybmFuY2VfYWRkcmVzcwAMa0Zhcm1BZGRyZXNzAg9mYXJtaW5nX2FkZHJlc3MAD2tTdXJ2ZX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ENQTU0GBQ1pc0FpcmRyb3BDYWxsCQAAAgkAkAMBCAUDaW52CHBheW1lbnRzAAEHBgMDAwMDBRNpc1VwZGF0ZVdlaWdodHNDYWxsBgUUaXNVcGRhdGVQb29sSW50ZXJlc3QGBRJpc1Rha2VuSW50b0FjY291bnQGBRZpc1Rha2VuSW50b0FjY291bnRDUE1NBgUMaXNXcml0ZVRvdGFsCQAAAgkAkAMBCAUDaW52CHBheW1lbnRzAAAHBQ1zaWduZWRCeUFkbWluBwQSYWRtaW5QdWJLZXkxU2lnbmVkAwkA9AMDCAUCdHgJYm9keUJ5dGVzCQCRAwIIBQJ0eAZwcm9vZnMAAAUMYWRtaW5QdWJLZXkxAAEAAAQSYWRtaW5QdWJLZXkyU2lnbmVkAwkA9AMDCAUCdHgJYm9keUJ5dGVzCQCRAwIIBQJ0eAZwcm9vZnMAAQUMYWRtaW5QdWJLZXkyAAEAAAQSYWRtaW5QdWJLZXkzU2lnbmVkAwkA9AMDCAUCdHgJYm9keUJ5dGVzCQCRAwIIBQJ0eAZwcm9vZnMAAgUMYWRtaW5QdWJLZXkzAAEAAAkAZwIJAGQCCQBkAgUSYWRtaW5QdWJLZXkxU2lnbmVkBRJhZG1pblB1YktleTJTaWduZWQFEmFkbWluUHViS2V5M1NpZ25lZAACyv7zDA==", "height": 2348182, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 3qJQxdYx3rbgQfjtTKtfEdmSTuf5nxs3h1hseBkWmi1V Next: 4mQgv8gFZ6322cVh4C4QX1U7CPaf6irztSsMxkFHQPkd Diff:
Old | New | Differences | |
---|---|---|---|
45 | 45 | @Verifier(tx) | |
46 | 46 | func verify () = match tx { | |
47 | 47 | case inv: InvokeScriptTransaction => | |
48 | - | let | |
48 | + | let isExchangeCallCPMM = if (if (isDefined(getString(oracle, (keyPrefixPoolName + toString(addressFromRecipient(inv.dApp)))))) | |
49 | 49 | then (inv.function == "callFunction") | |
50 | 50 | else false) | |
51 | 51 | then (inv.args[0] == "exchange") | |
52 | + | else false | |
53 | + | let isExchangeCall = if (isDefined(getString(oracle, (keyPrefixPoolName + toString(addressFromRecipient(inv.dApp)))))) | |
54 | + | then (inv.function == "exchange") | |
52 | 55 | else false | |
53 | 56 | let isAirdropCall = if ((inv.dApp == governanceAddress)) | |
54 | 57 | then (inv.function == "airDrop") | |
59 | 62 | let isUpdatePoolInterest = if ((inv.dApp == farmingAddress)) | |
60 | 63 | then (inv.function == "updatePoolInterest") | |
61 | 64 | else false | |
62 | - | let | |
65 | + | let isTakenIntoAccountCPMM = if (if (isDefined(getString(oracle, (keyPrefixPoolName + toString(addressFromRecipient(inv.dApp)))))) | |
63 | 66 | then (inv.function == "callFunction") | |
64 | 67 | else false) | |
65 | 68 | then (inv.args[0] == "takeIntoAccountExtraFunds") | |
69 | + | else false | |
70 | + | let isTakenIntoAccount = if (isDefined(getString(oracle, (keyPrefixPoolName + toString(addressFromRecipient(inv.dApp)))))) | |
71 | + | then (inv.function == "takeIntoAccountExtraFunds") | |
66 | 72 | else false | |
67 | 73 | let isWriteTotal = if ((inv.dApp == surveysAddress)) | |
68 | 74 | then (inv.function == "writeTotals") | |
69 | 75 | else false | |
70 | 76 | let signedByAdmin = sigVerify(tx.bodyBytes, tx.proofs[0], adminInvoke) | |
71 | - | if (if (if (if (isExchangeCall) | |
77 | + | if (if (if (if (if (isExchangeCall) | |
78 | + | then true | |
79 | + | else isExchangeCallCPMM) | |
72 | 80 | then true | |
73 | 81 | else isAirdropCall) | |
74 | 82 | then (size(inv.payments) == 1) | |
75 | 83 | else false) | |
76 | 84 | then true | |
77 | - | else if (if (if (if (isUpdateWeightsCall) | |
85 | + | else if (if (if (if (if (isUpdateWeightsCall) | |
78 | 86 | then true | |
79 | 87 | else isUpdatePoolInterest) | |
80 | 88 | then true | |
81 | 89 | else isTakenIntoAccount) | |
90 | + | then true | |
91 | + | else isTakenIntoAccountCPMM) | |
82 | 92 | then true | |
83 | 93 | else isWriteTotal) | |
84 | 94 | then (size(inv.payments) == 0) |
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 adminPubKey1 = getBase58FromOracle(kAdminPubKey1) | |
29 | 29 | ||
30 | 30 | let adminPubKey2 = getBase58FromOracle(kAdminPubKey2) | |
31 | 31 | ||
32 | 32 | let adminPubKey3 = getBase58FromOracle(kAdminPubKey3) | |
33 | 33 | ||
34 | 34 | let adminInvoke = getBase58FromOracle(kAdminInvokePubKey) | |
35 | 35 | ||
36 | 36 | let governanceAddress = Address(getBase58FromOracle(kGovAddress)) | |
37 | 37 | ||
38 | 38 | let farmingAddress = Address(getBase58FromOracle(kFarmAddress)) | |
39 | 39 | ||
40 | 40 | let surveysAddress = Address(getBase58FromOracle(kSurveysAddress)) | |
41 | 41 | ||
42 | 42 | let keyPrefixPoolName = "pool_" | |
43 | 43 | ||
44 | 44 | ||
45 | 45 | @Verifier(tx) | |
46 | 46 | func verify () = match tx { | |
47 | 47 | case inv: InvokeScriptTransaction => | |
48 | - | let | |
48 | + | let isExchangeCallCPMM = if (if (isDefined(getString(oracle, (keyPrefixPoolName + toString(addressFromRecipient(inv.dApp)))))) | |
49 | 49 | then (inv.function == "callFunction") | |
50 | 50 | else false) | |
51 | 51 | then (inv.args[0] == "exchange") | |
52 | + | else false | |
53 | + | let isExchangeCall = if (isDefined(getString(oracle, (keyPrefixPoolName + toString(addressFromRecipient(inv.dApp)))))) | |
54 | + | then (inv.function == "exchange") | |
52 | 55 | else false | |
53 | 56 | let isAirdropCall = if ((inv.dApp == governanceAddress)) | |
54 | 57 | then (inv.function == "airDrop") | |
55 | 58 | else false | |
56 | 59 | let isUpdateWeightsCall = if ((inv.dApp == governanceAddress)) | |
57 | 60 | then (inv.function == "updateWeights") | |
58 | 61 | else false | |
59 | 62 | let isUpdatePoolInterest = if ((inv.dApp == farmingAddress)) | |
60 | 63 | then (inv.function == "updatePoolInterest") | |
61 | 64 | else false | |
62 | - | let | |
65 | + | let isTakenIntoAccountCPMM = if (if (isDefined(getString(oracle, (keyPrefixPoolName + toString(addressFromRecipient(inv.dApp)))))) | |
63 | 66 | then (inv.function == "callFunction") | |
64 | 67 | else false) | |
65 | 68 | then (inv.args[0] == "takeIntoAccountExtraFunds") | |
69 | + | else false | |
70 | + | let isTakenIntoAccount = if (isDefined(getString(oracle, (keyPrefixPoolName + toString(addressFromRecipient(inv.dApp)))))) | |
71 | + | then (inv.function == "takeIntoAccountExtraFunds") | |
66 | 72 | else false | |
67 | 73 | let isWriteTotal = if ((inv.dApp == surveysAddress)) | |
68 | 74 | then (inv.function == "writeTotals") | |
69 | 75 | else false | |
70 | 76 | let signedByAdmin = sigVerify(tx.bodyBytes, tx.proofs[0], adminInvoke) | |
71 | - | if (if (if (if (isExchangeCall) | |
77 | + | if (if (if (if (if (isExchangeCall) | |
78 | + | then true | |
79 | + | else isExchangeCallCPMM) | |
72 | 80 | then true | |
73 | 81 | else isAirdropCall) | |
74 | 82 | then (size(inv.payments) == 1) | |
75 | 83 | else false) | |
76 | 84 | then true | |
77 | - | else if (if (if (if (isUpdateWeightsCall) | |
85 | + | else if (if (if (if (if (isUpdateWeightsCall) | |
78 | 86 | then true | |
79 | 87 | else isUpdatePoolInterest) | |
80 | 88 | then true | |
81 | 89 | else isTakenIntoAccount) | |
90 | + | then true | |
91 | + | else isTakenIntoAccountCPMM) | |
82 | 92 | then true | |
83 | 93 | else isWriteTotal) | |
84 | 94 | then (size(inv.payments) == 0) | |
85 | 95 | else false) | |
86 | 96 | then signedByAdmin | |
87 | 97 | else false | |
88 | 98 | case _ => | |
89 | 99 | let adminPubKey1Signed = if (sigVerify(tx.bodyBytes, tx.proofs[0], adminPubKey1)) | |
90 | 100 | then 1 | |
91 | 101 | else 0 | |
92 | 102 | let adminPubKey2Signed = if (sigVerify(tx.bodyBytes, tx.proofs[1], adminPubKey2)) | |
93 | 103 | then 1 | |
94 | 104 | else 0 | |
95 | 105 | let adminPubKey3Signed = if (sigVerify(tx.bodyBytes, tx.proofs[2], adminPubKey3)) | |
96 | 106 | then 1 | |
97 | 107 | else 0 | |
98 | 108 | (((adminPubKey1Signed + adminPubKey2Signed) + adminPubKey3Signed) >= 2) | |
99 | 109 | } | |
100 | 110 |
github/deemru/w8io/169f3d6 35.90 ms ◑