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:BgICCAITAAZvcmFjbGUJAQdBZGRyZXNzAQEaAVRIE5cMwNMzzCUygLYp96dkaICr48x7S5kBE2dldEJhc2U1OEZyb21PcmFjbGUBA2tleQQHJG1hdGNoMAkAnQgCBQZvcmFjbGUFA2tleQMJAAECBQckbWF0Y2gwAgZTdHJpbmcEBnN0cmluZwUHJG1hdGNoMAkA2QQBBQZzdHJpbmcEB25vdGhpbmcFByRtYXRjaDAJAAIBCQCsAgIFA2tleQIIaXMgZW1wdHkADWtBZG1pblB1YktleTECC2FkbWluX3B1Yl8xAA1rQWRtaW5QdWJLZXkyAgthZG1pbl9wdWJfMgANa0FkbWluUHViS2V5MwILYWRtaW5fcHViXzMAEmtBZG1pbkludm9rZVB1YktleQIQYWRtaW5faW52b2tlX3B1YgALa0dvdkFkZHJlc3MCEmdvdmVybmFuY2VfYWRkcmVzcwAMa0Zhcm1BZGRyZXNzAg9mYXJtaW5nX2FkZHJlc3MAD2tTd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ZHlCeXRlcwkAkQMCCAUCdHgGcHJvb2ZzAAAFC2FkbWluSW52b2tlAwMDAwMDBQ5pc0V4Y2hhbmdlQ2FsbAYFEmlzRXhjaGFuZ2VDYWxsQ1BNTQYFDWlzQWlyZHJvcENhbGwGBQ1pc1JvdXRpbmdDYWxsCQAAAgkAkAMBCAUDaW52CHBheW1lbnRzAAEHBgMDAwMFE2lzVXBkYXRlV2VpZ2h0c0NhbGwGBRJpc1Rha2VuSW50b0FjY291bnQGBRZpc1Rha2VuSW50b0FjY291bnRDUE1NBgUMaXNXcml0ZVRvdGFsCQAAAgkAkAMBCAUDaW52CHBheW1lbnRzAAAHBQ1zaWduZWRCeUFkbWluBwQSYWRtaW5QdWJLZXkxU2lnbmVkAwkA9AMDCAUCdHgJYm9keUJ5dGVzCQCRAwIIBQJ0eAZwcm9vZnMAAAUMYWRtaW5QdWJLZXkxAAEAAAQSYWRtaW5QdWJLZXkyU2lnbmVkAwkA9AMDCAUCdHgJYm9keUJ5dGVzCQCRAwIIBQJ0eAZwcm9vZnMAAQUMYWRtaW5QdWJLZXkyAAEAAAQSYWRtaW5QdWJLZXkzU2lnbmVkAwkA9AMDCAUCdHgJYm9keUJ5dGVzCQCRAwIIBQJ0eAZwcm9vZnMAAgUMYWRtaW5QdWJLZXkzAAEAAAkAZwIJAGQCCQBkAgUSYWRtaW5QdWJLZXkxU2lnbmVkBRJhZG1pblB1YktleTJTaWduZWQFEmFkbWluUHViS2V5M1NpZ25lZAAC/nBvoQ==", "height": 2348292, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: BkSbowoKDG625JsvrEkE8g9ZnPMwNWSDjN59dTTsjP6w Next: 8z1mRHTvsEt2AzVUG8QDkdwCAdXGiZEaDJVzURqWkxV1 Diff:
OldNewDifferences
2525
2626 let kSurveysAddress = "surveys_address"
2727
28+let kRoutingAddr = "routing_address"
29+
2830 let adminPubKey1 = getBase58FromOracle(kAdminPubKey1)
2931
3032 let adminPubKey2 = getBase58FromOracle(kAdminPubKey2)
3941
4042 let surveysAddress = Address(getBase58FromOracle(kSurveysAddress))
4143
44+let routingAddress = Address(getBase58FromOracle(kRoutingAddr))
45+
4246 let keyPrefixPoolName = "pool_"
4347
4448
4549 @Verifier(tx)
4650 func verify () = match tx {
4751 case inv: InvokeScriptTransaction =>
52+ let isRoutingCall = if ((inv.dApp == routingAddress))
53+ then (inv.function == "routingTrade")
54+ else false
4855 let isExchangeCallCPMM = if (if (isDefined(getString(oracle, (keyPrefixPoolName + toString(addressFromRecipient(inv.dApp))))))
4956 then (inv.function == "callFunction")
5057 else false)
5966 let isUpdateWeightsCall = if ((inv.dApp == governanceAddress))
6067 then (inv.function == "updateWeights")
6168 else false
62- let isUpdatePoolInterest = if ((inv.dApp == farmingAddress))
63- then (inv.function == "updatePoolInterest")
64- else false
6569 let isTakenIntoAccountCPMM = if (if (isDefined(getString(oracle, (keyPrefixPoolName + toString(addressFromRecipient(inv.dApp))))))
6670 then (inv.function == "callFunction")
6771 else false)
7478 then (inv.function == "writeTotals")
7579 else false
7680 let signedByAdmin = sigVerify(tx.bodyBytes, tx.proofs[0], adminInvoke)
77- if (if (if (if (if (isExchangeCall)
81+ if (if (if (if (if (if (isExchangeCall)
7882 then true
7983 else isExchangeCallCPMM)
8084 then true
8185 else isAirdropCall)
86+ then true
87+ else isRoutingCall)
8288 then (size(inv.payments) == 1)
8389 else false)
8490 then true
85- else if (if (if (if (if (isUpdateWeightsCall)
86- then true
87- else isUpdatePoolInterest)
91+ else if (if (if (if (isUpdateWeightsCall)
8892 then true
8993 else isTakenIntoAccount)
9094 then true
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 6 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 let oracle = Address(base58'3MvVBtsXroQpy1tsPw21TU2ET9A8WfmrNjz')
55
66 func getBase58FromOracle (key) = match getString(oracle, key) {
77 case string: String =>
88 fromBase58String(string)
99 case nothing =>
1010 throw((key + "is empty"))
1111 }
1212
1313
1414 let kAdminPubKey1 = "admin_pub_1"
1515
1616 let kAdminPubKey2 = "admin_pub_2"
1717
1818 let kAdminPubKey3 = "admin_pub_3"
1919
2020 let kAdminInvokePubKey = "admin_invoke_pub"
2121
2222 let kGovAddress = "governance_address"
2323
2424 let kFarmAddress = "farming_address"
2525
2626 let kSurveysAddress = "surveys_address"
2727
28+let kRoutingAddr = "routing_address"
29+
2830 let adminPubKey1 = getBase58FromOracle(kAdminPubKey1)
2931
3032 let adminPubKey2 = getBase58FromOracle(kAdminPubKey2)
3133
3234 let adminPubKey3 = getBase58FromOracle(kAdminPubKey3)
3335
3436 let adminInvoke = getBase58FromOracle(kAdminInvokePubKey)
3537
3638 let governanceAddress = Address(getBase58FromOracle(kGovAddress))
3739
3840 let farmingAddress = Address(getBase58FromOracle(kFarmAddress))
3941
4042 let surveysAddress = Address(getBase58FromOracle(kSurveysAddress))
4143
44+let routingAddress = Address(getBase58FromOracle(kRoutingAddr))
45+
4246 let keyPrefixPoolName = "pool_"
4347
4448
4549 @Verifier(tx)
4650 func verify () = match tx {
4751 case inv: InvokeScriptTransaction =>
52+ let isRoutingCall = if ((inv.dApp == routingAddress))
53+ then (inv.function == "routingTrade")
54+ else false
4855 let isExchangeCallCPMM = if (if (isDefined(getString(oracle, (keyPrefixPoolName + toString(addressFromRecipient(inv.dApp))))))
4956 then (inv.function == "callFunction")
5057 else false)
5158 then (inv.args[0] == "exchange")
5259 else false
5360 let isExchangeCall = if (isDefined(getString(oracle, (keyPrefixPoolName + toString(addressFromRecipient(inv.dApp))))))
5461 then (inv.function == "exchange")
5562 else false
5663 let isAirdropCall = if ((inv.dApp == governanceAddress))
5764 then (inv.function == "airDrop")
5865 else false
5966 let isUpdateWeightsCall = if ((inv.dApp == governanceAddress))
6067 then (inv.function == "updateWeights")
6168 else false
62- let isUpdatePoolInterest = if ((inv.dApp == farmingAddress))
63- then (inv.function == "updatePoolInterest")
64- else false
6569 let isTakenIntoAccountCPMM = if (if (isDefined(getString(oracle, (keyPrefixPoolName + toString(addressFromRecipient(inv.dApp))))))
6670 then (inv.function == "callFunction")
6771 else false)
6872 then (inv.args[0] == "takeIntoAccountExtraFunds")
6973 else false
7074 let isTakenIntoAccount = if (isDefined(getString(oracle, (keyPrefixPoolName + toString(addressFromRecipient(inv.dApp))))))
7175 then (inv.function == "takeIntoAccountExtraFunds")
7276 else false
7377 let isWriteTotal = if ((inv.dApp == surveysAddress))
7478 then (inv.function == "writeTotals")
7579 else false
7680 let signedByAdmin = sigVerify(tx.bodyBytes, tx.proofs[0], adminInvoke)
77- if (if (if (if (if (isExchangeCall)
81+ if (if (if (if (if (if (isExchangeCall)
7882 then true
7983 else isExchangeCallCPMM)
8084 then true
8185 else isAirdropCall)
86+ then true
87+ else isRoutingCall)
8288 then (size(inv.payments) == 1)
8389 else false)
8490 then true
85- else if (if (if (if (if (isUpdateWeightsCall)
86- then true
87- else isUpdatePoolInterest)
91+ else if (if (if (if (isUpdateWeightsCall)
8892 then true
8993 else isTakenIntoAccount)
9094 then true
9195 else isTakenIntoAccountCPMM)
9296 then true
9397 else isWriteTotal)
9498 then (size(inv.payments) == 0)
9599 else false)
96100 then signedByAdmin
97101 else false
98102 case _ =>
99103 let adminPubKey1Signed = if (sigVerify(tx.bodyBytes, tx.proofs[0], adminPubKey1))
100104 then 1
101105 else 0
102106 let adminPubKey2Signed = if (sigVerify(tx.bodyBytes, tx.proofs[1], adminPubKey2))
103107 then 1
104108 else 0
105109 let adminPubKey3Signed = if (sigVerify(tx.bodyBytes, tx.proofs[2], adminPubKey3))
106110 then 1
107111 else 0
108112 (((adminPubKey1Signed + adminPubKey2Signed) + adminPubKey3Signed) >= 2)
109113 }
110114

github/deemru/w8io/169f3d6 
34.60 ms