tx · HrL59jhyMdywjxtmgBVmeBWdmnHgymd1FTZ8fC2SDATD 3N2eueE5vLLKe8jXuBDbdbKcPaH36yG1Had: -0.14000000 Waves 2022.10.18 11:52 [2277616] smart account 3N2eueE5vLLKe8jXuBDbdbKcPaH36yG1Had > SELF 0.00000000 Waves
{ "type": 13, "id": "HrL59jhyMdywjxtmgBVmeBWdmnHgymd1FTZ8fC2SDATD", "fee": 14000000, "feeAssetId": null, "timestamp": 1666083173649, "version": 2, "chainId": 84, "sender": "3N2eueE5vLLKe8jXuBDbdbKcPaH36yG1Had", "senderPublicKey": "EAmZF2D2BbfoPsrMGFAs2UCv8ScAXxhAZRzFpkveca8G", "proofs": [ "3Lr2AF5yQrZUttZ2XiwekxS9CmX1e2VzESA9sWjgyGnzw9eeZd13SVHwp73aQvs5maWBgLjkk2TVv8UduYBFtrDK" ], "script": "base64:BgICCAIRAAZvcmFjbGUJAQdBZGRyZXNzAQEaAVTpRaoekC86rvG6DuYumpJfGpiE4fNiswgBE2dldEJhc2U1OEZyb21PcmFjbGUBA2tleQQHJG1hdGNoMAkAnQgCBQZvcmFjbGUFA2tleQMJAAECBQckbWF0Y2gwAgZTdHJpbmcEBnN0cmluZwUHJG1hdGNoMAkA2QQBBQZzdHJpbmcEB25vdGhpbmcFByRtYXRjaDAJAAIBCQCsAgIFA2tleQIIaXMgZW1wdHkADWtBZG1pblB1YktleTECC2FkbWluX3B1Yl8xAA1rQWRtaW5QdWJLZXkyAgthZG1pbl9wdWJfMgANa0FkbWluUHViS2V5MwILYWRtaW5fcHViXzMAEmtBZG1pbkludm9rZVB1YktleQIQYWRtaW5faW52b2tlX3B1YgALa0dvdkFkZHJlc3MCEmdvdmVybmFuY2VfYWRkcmVzcwAMa0Zhcm1BZGRyZXNzAg9mYXJtaW5nX2FkZHJlc3MAD2tTdXJ2ZXlzQWRkcmVzcwIPc3VydmV5c19hZGRyZXNzAAxhZG1pblB1YktleTEJARNnZXRCYXNlNThGcm9tT3JhY2xlAQUNa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JEDAggFAnR4BnByb29mcwACBQxhZG1pblB1YktleTMAAQAACQBnAgkAZAIJAGQCBRJhZG1pblB1YktleTFTaWduZWQFEmFkbWluUHViS2V5MlNpZ25lZAUSYWRtaW5QdWJLZXkzU2lnbmVkAAKb8yRA", "height": 2277616, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: CaEbTUc8A8wezb6bTgM4Uimws9MuA7LoFiukLhF1Bway Next: 2zadmMsuon6e28robCmJzR2pZJYo6wbuPnpGFkHJ4Ko5 Diff:
Old | New | Differences | |
---|---|---|---|
1 | - | {-# STDLIB_VERSION | |
1 | + | {-# STDLIB_VERSION 6 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | - | let oracle = Address(base58' | |
4 | + | let oracle = Address(base58'3NBBWfzZtZtszaXbitTKnrB2xXwv26Bn7H9') | |
5 | 5 | ||
6 | 6 | func getBase58FromOracle (key) = match getString(oracle, key) { | |
7 | 7 | case string: String => | |
42 | 42 | let keyPrefixPoolName = "pool_" | |
43 | 43 | ||
44 | 44 | ||
45 | + | @Verifier(tx) | |
46 | + | func verify () = match tx { | |
47 | + | case inv: InvokeScriptTransaction => | |
48 | + | let isExchangeCall = if (if (isDefined(getString(oracle, (keyPrefixPoolName + toString(addressFromRecipient(inv.dApp)))))) | |
49 | + | then (inv.function == "callFunction") | |
50 | + | else false) | |
51 | + | then (inv.args[0] == "exchange") | |
52 | + | else false | |
53 | + | let isAirdropCall = if ((inv.dApp == governanceAddress)) | |
54 | + | then (inv.function == "airDrop") | |
55 | + | else false | |
56 | + | let isUpdateWeightsCall = if ((inv.dApp == governanceAddress)) | |
57 | + | then (inv.function == "updateWeights") | |
58 | + | else false | |
59 | + | let isUpdatePoolInterest = if ((inv.dApp == farmingAddress)) | |
60 | + | then (inv.function == "updatePoolInterest") | |
61 | + | else false | |
62 | + | let isTakenIntoAccount = if (if (isDefined(getString(oracle, (keyPrefixPoolName + toString(addressFromRecipient(inv.dApp)))))) | |
63 | + | then (inv.function == "callFunction") | |
64 | + | else false) | |
65 | + | then (inv.args[0] == "takeIntoAccountExtraFunds") | |
66 | + | else false | |
67 | + | let isWriteTotal = if ((inv.dApp == surveysAddress)) | |
68 | + | then (inv.function == "writeTotals") | |
69 | + | else false | |
70 | + | let signedByAdmin = sigVerify(tx.bodyBytes, tx.proofs[0], adminInvoke) | |
71 | + | if (if (if (if (isExchangeCall) | |
72 | + | then true | |
73 | + | else isAirdropCall) | |
74 | + | then (size(inv.payments) == 1) | |
75 | + | else false) | |
76 | + | then true | |
77 | + | else if (if (if (if (isUpdateWeightsCall) | |
78 | + | then true | |
79 | + | else isUpdatePoolInterest) | |
80 | + | then true | |
81 | + | else isTakenIntoAccount) | |
82 | + | then true | |
83 | + | else isWriteTotal) | |
84 | + | then (size(inv.payments) == 0) | |
85 | + | else false) | |
86 | + | then signedByAdmin | |
87 | + | else false | |
88 | + | case _ => | |
89 | + | let adminPubKey1Signed = if (sigVerify(tx.bodyBytes, tx.proofs[0], adminPubKey1)) | |
90 | + | then 1 | |
91 | + | else 0 | |
92 | + | let adminPubKey2Signed = if (sigVerify(tx.bodyBytes, tx.proofs[1], adminPubKey2)) | |
93 | + | then 1 | |
94 | + | else 0 | |
95 | + | let adminPubKey3Signed = if (sigVerify(tx.bodyBytes, tx.proofs[2], adminPubKey3)) | |
96 | + | then 1 | |
97 | + | else 0 | |
98 | + | (((adminPubKey1Signed + adminPubKey2Signed) + adminPubKey3Signed) >= 2) | |
99 | + | } | |
100 | + |
Old | New | Differences | |
---|---|---|---|
1 | - | {-# STDLIB_VERSION | |
1 | + | {-# STDLIB_VERSION 6 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | - | let oracle = Address(base58' | |
4 | + | let oracle = Address(base58'3NBBWfzZtZtszaXbitTKnrB2xXwv26Bn7H9') | |
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 | + | @Verifier(tx) | |
46 | + | func verify () = match tx { | |
47 | + | case inv: InvokeScriptTransaction => | |
48 | + | let isExchangeCall = if (if (isDefined(getString(oracle, (keyPrefixPoolName + toString(addressFromRecipient(inv.dApp)))))) | |
49 | + | then (inv.function == "callFunction") | |
50 | + | else false) | |
51 | + | then (inv.args[0] == "exchange") | |
52 | + | else false | |
53 | + | let isAirdropCall = if ((inv.dApp == governanceAddress)) | |
54 | + | then (inv.function == "airDrop") | |
55 | + | else false | |
56 | + | let isUpdateWeightsCall = if ((inv.dApp == governanceAddress)) | |
57 | + | then (inv.function == "updateWeights") | |
58 | + | else false | |
59 | + | let isUpdatePoolInterest = if ((inv.dApp == farmingAddress)) | |
60 | + | then (inv.function == "updatePoolInterest") | |
61 | + | else false | |
62 | + | let isTakenIntoAccount = if (if (isDefined(getString(oracle, (keyPrefixPoolName + toString(addressFromRecipient(inv.dApp)))))) | |
63 | + | then (inv.function == "callFunction") | |
64 | + | else false) | |
65 | + | then (inv.args[0] == "takeIntoAccountExtraFunds") | |
66 | + | else false | |
67 | + | let isWriteTotal = if ((inv.dApp == surveysAddress)) | |
68 | + | then (inv.function == "writeTotals") | |
69 | + | else false | |
70 | + | let signedByAdmin = sigVerify(tx.bodyBytes, tx.proofs[0], adminInvoke) | |
71 | + | if (if (if (if (isExchangeCall) | |
72 | + | then true | |
73 | + | else isAirdropCall) | |
74 | + | then (size(inv.payments) == 1) | |
75 | + | else false) | |
76 | + | then true | |
77 | + | else if (if (if (if (isUpdateWeightsCall) | |
78 | + | then true | |
79 | + | else isUpdatePoolInterest) | |
80 | + | then true | |
81 | + | else isTakenIntoAccount) | |
82 | + | then true | |
83 | + | else isWriteTotal) | |
84 | + | then (size(inv.payments) == 0) | |
85 | + | else false) | |
86 | + | then signedByAdmin | |
87 | + | else false | |
88 | + | case _ => | |
89 | + | let adminPubKey1Signed = if (sigVerify(tx.bodyBytes, tx.proofs[0], adminPubKey1)) | |
90 | + | then 1 | |
91 | + | else 0 | |
92 | + | let adminPubKey2Signed = if (sigVerify(tx.bodyBytes, tx.proofs[1], adminPubKey2)) | |
93 | + | then 1 | |
94 | + | else 0 | |
95 | + | let adminPubKey3Signed = if (sigVerify(tx.bodyBytes, tx.proofs[2], adminPubKey3)) | |
96 | + | then 1 | |
97 | + | else 0 | |
98 | + | (((adminPubKey1Signed + adminPubKey2Signed) + adminPubKey3Signed) >= 2) | |
99 | + | } | |
100 | + |
github/deemru/w8io/169f3d6 27.28 ms ◑