tx · EtgAuHSS2sxcWufC5n3kfXc4g4Ybh6WmDx5JRsAMArRb 3N2eueE5vLLKe8jXuBDbdbKcPaH36yG1Had: -0.14000000 Waves 2022.12.15 15:59 [2361454] smart account 3N2eueE5vLLKe8jXuBDbdbKcPaH36yG1Had > SELF 0.00000000 Waves
{ "type": 13, "id": "EtgAuHSS2sxcWufC5n3kfXc4g4Ybh6WmDx5JRsAMArRb", "fee": 14000000, "feeAssetId": null, "timestamp": 1671109201486, "version": 2, "chainId": 84, "sender": "3N2eueE5vLLKe8jXuBDbdbKcPaH36yG1Had", "senderPublicKey": "EAmZF2D2BbfoPsrMGFAs2UCv8ScAXxhAZRzFpkveca8G", "proofs": [ "2gxN7GFuwgp3kJrjqJ3VWnXyafn2gSn4aBPBc84Bs1BXvecQjmhbaxWsTGdApW2RenneUbi3n3VkxSmfer8J96e5", "4Ni9eJWnutDDUDn3kEWXoGkhb4EBVMNsFZjwUpejjdzZwDGdoet4xtvJMSjnUgSfJYq25pEQD2LScu2ARjiLYHRr" ], "script": "base64:BgICCAITAAZvcmFjbGUJAQdBZGRyZXNzAQEaAVRIE5cMwNMzzCUygLYp96dkaICr48x7S5kBE2dldEJhc2U1OEZyb21PcmFjbGUBA2tleQQHJG1hdGNoMAkAnQgCBQZvcmFjbGUFA2tleQMJAAECBQckbWF0Y2gwAgZTdHJpbmcEBnN0cmluZwUHJG1hdGNoMAkA2QQBBQZzdHJpbmcEB25vdGhpbmcFByRtYXRjaDAJAAIBCQCsAgIFA2tleQIIaXMgZW1wdHkADWtBZG1pblB1YktleTECC2FkbWluX3B1Yl8xAA1rQWRtaW5QdWJLZXkyAgthZG1pbl9wdWJfMgANa0FkbWluUHViS2V5MwILYWRtaW5fcHViXzMAEmtBZG1pbkludm9rZVB1YktleQIQYWRtaW5faW52b2tlX3B1YgALa0dvdkFkZHJlc3MCEmdvdmVybmFuY2VfYWRkcmVzcwAMa0Zhcm1BZGRyZXNzAg9mYXJtaW5nX2FkZHJlc3MAD2tT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AABBJhZG1pblB1YktleTJTaWduZWQDCQD0AwMIBQJ0eAlib2R5Qnl0ZXMJAJEDAggFAnR4BnByb29mcwABBQxhZG1pblB1YktleTIAAQAABBJhZG1pblB1YktleTNTaWduZWQDCQD0AwMIBQJ0eAlib2R5Qnl0ZXMJAJEDAggFAnR4BnByb29mcwACBQxhZG1pblB1YktleTMAAQAACQBnAgkAZAIJAGQCBRJhZG1pblB1YktleTFTaWduZWQFEmFkbWluUHViS2V5MlNpZ25lZAUSYWRtaW5QdWJLZXkzU2lnbmVkAALCnp71", "height": 2361454, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 8z1mRHTvsEt2AzVUG8QDkdwCAdXGiZEaDJVzURqWkxV1 Next: 2kQGcAeM3CnGwHJ7Y1PtYtreWBkC4iki6WZKycgGA1n4 Diff:
Old | New | Differences | |
---|---|---|---|
47 | 47 | ||
48 | 48 | ||
49 | 49 | @Verifier(tx) | |
50 | - | func verify () = { | |
51 | - | let adminPubKey1Signed = if (sigVerify(tx.bodyBytes, tx.proofs[0], adminPubKey1)) | |
52 | - | then 1 | |
53 | - | else 0 | |
54 | - | let adminPubKey2Signed = if (sigVerify(tx.bodyBytes, tx.proofs[1], adminPubKey2)) | |
55 | - | then 1 | |
56 | - | else 0 | |
57 | - | let adminPubKey3Signed = if (sigVerify(tx.bodyBytes, tx.proofs[2], adminPubKey3)) | |
58 | - | then 1 | |
59 | - | else 0 | |
60 | - | let adminPubKeyInvokeSigned = if (sigVerify(tx.bodyBytes, tx.proofs[2], adminInvoke)) | |
61 | - | then 1 | |
62 | - | else 0 | |
63 | - | match tx { | |
64 | - | case inv: InvokeScriptTransaction => | |
65 | - | let isRightFee = if ((inv.fee == 900000)) | |
66 | - | then (inv.feeAssetId == unit) | |
67 | - | else false | |
68 | - | let isRoutingCall = if ((inv.dApp == routingAddress)) | |
69 | - | then (inv.function == "routingTrade") | |
70 | - | else false | |
71 | - | let isExchangeCallCPMM = if (if (isDefined(getString(oracle, (keyPrefixPoolName + toString(addressFromRecipient(inv.dApp)))))) | |
72 | - | then (inv.function == "callFunction") | |
50 | + | func verify () = match tx { | |
51 | + | case inv: InvokeScriptTransaction => | |
52 | + | let isRightFee = if ((inv.fee == 900000)) | |
53 | + | then (inv.feeAssetId == unit) | |
54 | + | else false | |
55 | + | let isRoutingCall = if ((inv.dApp == routingAddress)) | |
56 | + | then (inv.function == "routingTrade") | |
57 | + | else false | |
58 | + | let isExchangeCallCPMM = if (if (isDefined(getString(oracle, (keyPrefixPoolName + toString(addressFromRecipient(inv.dApp)))))) | |
59 | + | then (inv.function == "callFunction") | |
60 | + | else false) | |
61 | + | then (inv.args[0] == "exchange") | |
62 | + | else false | |
63 | + | let isExchangeCall = if (isDefined(getString(oracle, (keyPrefixPoolName + toString(addressFromRecipient(inv.dApp)))))) | |
64 | + | then (inv.function == "exchange") | |
65 | + | else false | |
66 | + | let isAirdropCall = if ((inv.dApp == governanceAddress)) | |
67 | + | then (inv.function == "airDrop") | |
68 | + | else false | |
69 | + | let isUpdateWeightsCall = if ((inv.dApp == governanceAddress)) | |
70 | + | then (inv.function == "updateWeights") | |
71 | + | else false | |
72 | + | let isTakenIntoAccountCPMM = if (if (isDefined(getString(oracle, (keyPrefixPoolName + toString(addressFromRecipient(inv.dApp)))))) | |
73 | + | then (inv.function == "callFunction") | |
74 | + | else false) | |
75 | + | then (inv.args[0] == "takeIntoAccountExtraFunds") | |
76 | + | else false | |
77 | + | let isTakenIntoAccount = if (isDefined(getString(oracle, (keyPrefixPoolName + toString(addressFromRecipient(inv.dApp)))))) | |
78 | + | then (inv.function == "takeIntoAccountExtraFunds") | |
79 | + | else false | |
80 | + | let isWriteTotal = if ((inv.dApp == surveysAddress)) | |
81 | + | then (inv.function == "writeTotals") | |
82 | + | else false | |
83 | + | let adminPubKey1Signed = if (sigVerify(tx.bodyBytes, tx.proofs[0], adminPubKey1)) | |
84 | + | then 1 | |
85 | + | else 0 | |
86 | + | let adminPubKey2Signed = if (sigVerify(tx.bodyBytes, tx.proofs[0], adminPubKey2)) | |
87 | + | then 1 | |
88 | + | else 0 | |
89 | + | let adminPubKey3Signed = if (sigVerify(tx.bodyBytes, tx.proofs[0], adminPubKey3)) | |
90 | + | then 1 | |
91 | + | else 0 | |
92 | + | let adminPubKeyInvokeSigned = if (sigVerify(tx.bodyBytes, tx.proofs[0], adminInvoke)) | |
93 | + | then 1 | |
94 | + | else 0 | |
95 | + | let signedByOneAdmin = ((((adminPubKey1Signed + adminPubKey2Signed) + adminPubKey3Signed) + adminPubKeyInvokeSigned) >= 1) | |
96 | + | if (if (if (if (if (if (if (isExchangeCall) | |
97 | + | then true | |
98 | + | else isExchangeCallCPMM) | |
99 | + | then true | |
100 | + | else isAirdropCall) | |
101 | + | then true | |
102 | + | else isRoutingCall) | |
103 | + | then (size(inv.payments) == 1) | |
104 | + | else false) | |
105 | + | then true | |
106 | + | else if (if (if (if (isUpdateWeightsCall) | |
107 | + | then true | |
108 | + | else isTakenIntoAccount) | |
109 | + | then true | |
110 | + | else isTakenIntoAccountCPMM) | |
111 | + | then true | |
112 | + | else isWriteTotal) | |
113 | + | then (size(inv.payments) == 0) | |
73 | 114 | else false) | |
74 | - | then (inv.args[0] == "exchange") | |
75 | - | else false | |
76 | - | let isExchangeCall = if (isDefined(getString(oracle, (keyPrefixPoolName + toString(addressFromRecipient(inv.dApp)))))) | |
77 | - | then (inv.function == "exchange") | |
78 | - | else false | |
79 | - | let isAirdropCall = if ((inv.dApp == governanceAddress)) | |
80 | - | then (inv.function == "airDrop") | |
81 | - | else false | |
82 | - | let isUpdateWeightsCall = if ((inv.dApp == governanceAddress)) | |
83 | - | then (inv.function == "updateWeights") | |
84 | - | else false | |
85 | - | let isTakenIntoAccountCPMM = if (if (isDefined(getString(oracle, (keyPrefixPoolName + toString(addressFromRecipient(inv.dApp)))))) | |
86 | - | then (inv.function == "callFunction") | |
87 | - | else false) | |
88 | - | then (inv.args[0] == "takeIntoAccountExtraFunds") | |
89 | - | else false | |
90 | - | let isTakenIntoAccount = if (isDefined(getString(oracle, (keyPrefixPoolName + toString(addressFromRecipient(inv.dApp)))))) | |
91 | - | then (inv.function == "takeIntoAccountExtraFunds") | |
92 | - | else false | |
93 | - | let isWriteTotal = if ((inv.dApp == surveysAddress)) | |
94 | - | then (inv.function == "writeTotals") | |
95 | - | else false | |
96 | - | let signedByOneAdmin = ((((adminPubKey1Signed + adminPubKey2Signed) + adminPubKey3Signed) + adminPubKeyInvokeSigned) >= 1) | |
97 | - | if (if (if (if (if (if (if (isExchangeCall) | |
98 | - | then true | |
99 | - | else isExchangeCallCPMM) | |
100 | - | then true | |
101 | - | else isAirdropCall) | |
102 | - | then true | |
103 | - | else isRoutingCall) | |
104 | - | then (size(inv.payments) == 1) | |
105 | - | else false) | |
106 | - | then true | |
107 | - | else if (if (if (if (isUpdateWeightsCall) | |
108 | - | then true | |
109 | - | else isTakenIntoAccount) | |
110 | - | then true | |
111 | - | else isTakenIntoAccountCPMM) | |
112 | - | then true | |
113 | - | else isWriteTotal) | |
114 | - | then (size(inv.payments) == 0) | |
115 | - | else false) | |
116 | - | then signedByOneAdmin | |
117 | - | else false) | |
118 | - | then isRightFee | |
119 | - | else false | |
120 | - | case _ => | |
121 | - | (((adminPubKey1Signed + adminPubKey2Signed) + adminPubKey3Signed) >= 2) | |
122 | - | } | |
123 | - | } | |
115 | + | then signedByOneAdmin | |
116 | + | else false) | |
117 | + | then isRightFee | |
118 | + | else false | |
119 | + | case _ => | |
120 | + | let adminPubKey1Signed = if (sigVerify(tx.bodyBytes, tx.proofs[0], adminPubKey1)) | |
121 | + | then 1 | |
122 | + | else 0 | |
123 | + | let adminPubKey2Signed = if (sigVerify(tx.bodyBytes, tx.proofs[1], adminPubKey2)) | |
124 | + | then 1 | |
125 | + | else 0 | |
126 | + | let adminPubKey3Signed = if (sigVerify(tx.bodyBytes, tx.proofs[2], adminPubKey3)) | |
127 | + | then 1 | |
128 | + | else 0 | |
129 | + | (((adminPubKey1Signed + adminPubKey2Signed) + adminPubKey3Signed) >= 2) | |
130 | + | } | |
124 | 131 |
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 | - | func verify () = { | |
51 | - | let adminPubKey1Signed = if (sigVerify(tx.bodyBytes, tx.proofs[0], adminPubKey1)) | |
52 | - | then 1 | |
53 | - | else 0 | |
54 | - | let adminPubKey2Signed = if (sigVerify(tx.bodyBytes, tx.proofs[1], adminPubKey2)) | |
55 | - | then 1 | |
56 | - | else 0 | |
57 | - | let adminPubKey3Signed = if (sigVerify(tx.bodyBytes, tx.proofs[2], adminPubKey3)) | |
58 | - | then 1 | |
59 | - | else 0 | |
60 | - | let adminPubKeyInvokeSigned = if (sigVerify(tx.bodyBytes, tx.proofs[2], adminInvoke)) | |
61 | - | then 1 | |
62 | - | else 0 | |
63 | - | match tx { | |
64 | - | case inv: InvokeScriptTransaction => | |
65 | - | let isRightFee = if ((inv.fee == 900000)) | |
66 | - | then (inv.feeAssetId == unit) | |
67 | - | else false | |
68 | - | let isRoutingCall = if ((inv.dApp == routingAddress)) | |
69 | - | then (inv.function == "routingTrade") | |
70 | - | else false | |
71 | - | let isExchangeCallCPMM = if (if (isDefined(getString(oracle, (keyPrefixPoolName + toString(addressFromRecipient(inv.dApp)))))) | |
72 | - | then (inv.function == "callFunction") | |
50 | + | func verify () = match tx { | |
51 | + | case inv: InvokeScriptTransaction => | |
52 | + | let isRightFee = if ((inv.fee == 900000)) | |
53 | + | then (inv.feeAssetId == unit) | |
54 | + | else false | |
55 | + | let isRoutingCall = if ((inv.dApp == routingAddress)) | |
56 | + | then (inv.function == "routingTrade") | |
57 | + | else false | |
58 | + | let isExchangeCallCPMM = if (if (isDefined(getString(oracle, (keyPrefixPoolName + toString(addressFromRecipient(inv.dApp)))))) | |
59 | + | then (inv.function == "callFunction") | |
60 | + | else false) | |
61 | + | then (inv.args[0] == "exchange") | |
62 | + | else false | |
63 | + | let isExchangeCall = if (isDefined(getString(oracle, (keyPrefixPoolName + toString(addressFromRecipient(inv.dApp)))))) | |
64 | + | then (inv.function == "exchange") | |
65 | + | else false | |
66 | + | let isAirdropCall = if ((inv.dApp == governanceAddress)) | |
67 | + | then (inv.function == "airDrop") | |
68 | + | else false | |
69 | + | let isUpdateWeightsCall = if ((inv.dApp == governanceAddress)) | |
70 | + | then (inv.function == "updateWeights") | |
71 | + | else false | |
72 | + | let isTakenIntoAccountCPMM = if (if (isDefined(getString(oracle, (keyPrefixPoolName + toString(addressFromRecipient(inv.dApp)))))) | |
73 | + | then (inv.function == "callFunction") | |
74 | + | else false) | |
75 | + | then (inv.args[0] == "takeIntoAccountExtraFunds") | |
76 | + | else false | |
77 | + | let isTakenIntoAccount = if (isDefined(getString(oracle, (keyPrefixPoolName + toString(addressFromRecipient(inv.dApp)))))) | |
78 | + | then (inv.function == "takeIntoAccountExtraFunds") | |
79 | + | else false | |
80 | + | let isWriteTotal = if ((inv.dApp == surveysAddress)) | |
81 | + | then (inv.function == "writeTotals") | |
82 | + | else false | |
83 | + | let adminPubKey1Signed = if (sigVerify(tx.bodyBytes, tx.proofs[0], adminPubKey1)) | |
84 | + | then 1 | |
85 | + | else 0 | |
86 | + | let adminPubKey2Signed = if (sigVerify(tx.bodyBytes, tx.proofs[0], adminPubKey2)) | |
87 | + | then 1 | |
88 | + | else 0 | |
89 | + | let adminPubKey3Signed = if (sigVerify(tx.bodyBytes, tx.proofs[0], adminPubKey3)) | |
90 | + | then 1 | |
91 | + | else 0 | |
92 | + | let adminPubKeyInvokeSigned = if (sigVerify(tx.bodyBytes, tx.proofs[0], adminInvoke)) | |
93 | + | then 1 | |
94 | + | else 0 | |
95 | + | let signedByOneAdmin = ((((adminPubKey1Signed + adminPubKey2Signed) + adminPubKey3Signed) + adminPubKeyInvokeSigned) >= 1) | |
96 | + | if (if (if (if (if (if (if (isExchangeCall) | |
97 | + | then true | |
98 | + | else isExchangeCallCPMM) | |
99 | + | then true | |
100 | + | else isAirdropCall) | |
101 | + | then true | |
102 | + | else isRoutingCall) | |
103 | + | then (size(inv.payments) == 1) | |
104 | + | else false) | |
105 | + | then true | |
106 | + | else if (if (if (if (isUpdateWeightsCall) | |
107 | + | then true | |
108 | + | else isTakenIntoAccount) | |
109 | + | then true | |
110 | + | else isTakenIntoAccountCPMM) | |
111 | + | then true | |
112 | + | else isWriteTotal) | |
113 | + | then (size(inv.payments) == 0) | |
73 | 114 | else false) | |
74 | - | then (inv.args[0] == "exchange") | |
75 | - | else false | |
76 | - | let isExchangeCall = if (isDefined(getString(oracle, (keyPrefixPoolName + toString(addressFromRecipient(inv.dApp)))))) | |
77 | - | then (inv.function == "exchange") | |
78 | - | else false | |
79 | - | let isAirdropCall = if ((inv.dApp == governanceAddress)) | |
80 | - | then (inv.function == "airDrop") | |
81 | - | else false | |
82 | - | let isUpdateWeightsCall = if ((inv.dApp == governanceAddress)) | |
83 | - | then (inv.function == "updateWeights") | |
84 | - | else false | |
85 | - | let isTakenIntoAccountCPMM = if (if (isDefined(getString(oracle, (keyPrefixPoolName + toString(addressFromRecipient(inv.dApp)))))) | |
86 | - | then (inv.function == "callFunction") | |
87 | - | else false) | |
88 | - | then (inv.args[0] == "takeIntoAccountExtraFunds") | |
89 | - | else false | |
90 | - | let isTakenIntoAccount = if (isDefined(getString(oracle, (keyPrefixPoolName + toString(addressFromRecipient(inv.dApp)))))) | |
91 | - | then (inv.function == "takeIntoAccountExtraFunds") | |
92 | - | else false | |
93 | - | let isWriteTotal = if ((inv.dApp == surveysAddress)) | |
94 | - | then (inv.function == "writeTotals") | |
95 | - | else false | |
96 | - | let signedByOneAdmin = ((((adminPubKey1Signed + adminPubKey2Signed) + adminPubKey3Signed) + adminPubKeyInvokeSigned) >= 1) | |
97 | - | if (if (if (if (if (if (if (isExchangeCall) | |
98 | - | then true | |
99 | - | else isExchangeCallCPMM) | |
100 | - | then true | |
101 | - | else isAirdropCall) | |
102 | - | then true | |
103 | - | else isRoutingCall) | |
104 | - | then (size(inv.payments) == 1) | |
105 | - | else false) | |
106 | - | then true | |
107 | - | else if (if (if (if (isUpdateWeightsCall) | |
108 | - | then true | |
109 | - | else isTakenIntoAccount) | |
110 | - | then true | |
111 | - | else isTakenIntoAccountCPMM) | |
112 | - | then true | |
113 | - | else isWriteTotal) | |
114 | - | then (size(inv.payments) == 0) | |
115 | - | else false) | |
116 | - | then signedByOneAdmin | |
117 | - | else false) | |
118 | - | then isRightFee | |
119 | - | else false | |
120 | - | case _ => | |
121 | - | (((adminPubKey1Signed + adminPubKey2Signed) + adminPubKey3Signed) >= 2) | |
122 | - | } | |
123 | - | } | |
115 | + | then signedByOneAdmin | |
116 | + | else false) | |
117 | + | then isRightFee | |
118 | + | else false | |
119 | + | case _ => | |
120 | + | let adminPubKey1Signed = if (sigVerify(tx.bodyBytes, tx.proofs[0], adminPubKey1)) | |
121 | + | then 1 | |
122 | + | else 0 | |
123 | + | let adminPubKey2Signed = if (sigVerify(tx.bodyBytes, tx.proofs[1], adminPubKey2)) | |
124 | + | then 1 | |
125 | + | else 0 | |
126 | + | let adminPubKey3Signed = if (sigVerify(tx.bodyBytes, tx.proofs[2], adminPubKey3)) | |
127 | + | then 1 | |
128 | + | else 0 | |
129 | + | (((adminPubKey1Signed + adminPubKey2Signed) + adminPubKey3Signed) >= 2) | |
130 | + | } | |
124 | 131 |
github/deemru/w8io/169f3d6 26.52 ms ◑