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