tx · 87dQbPkFdsaPgsoJMt9K8kdqQjAwyjCmtrcb9ZeQZ1fX 3N2eueE5vLLKe8jXuBDbdbKcPaH36yG1Had: -0.01000000 Waves 2022.10.11 11:46 [2267461] smart account 3N2eueE5vLLKe8jXuBDbdbKcPaH36yG1Had > SELF 0.00000000 Waves
{ "type": 13, "id": "87dQbPkFdsaPgsoJMt9K8kdqQjAwyjCmtrcb9ZeQZ1fX", "fee": 1000000, "feeAssetId": null, "timestamp": 1665478016068, "version": 2, "chainId": 84, "sender": "3N2eueE5vLLKe8jXuBDbdbKcPaH36yG1Had", "senderPublicKey": "EAmZF2D2BbfoPsrMGFAs2UCv8ScAXxhAZRzFpkveca8G", "proofs": [ "4ViWNoJsK5otPRXiX3nFGJT88V2hoUWbFGAxPko4obEodNYJ4CkgQSsiTheMfdhJ1kPFUFcwRsM4aBF3wj2wdSDk" ], "script": "base64:AAIFAAAAAAAAAAIIAgAAABEAAAAABm9yYWNsZQkBAAAAB0FkZHJlc3MAAAABAQAAABoBVEgTlwzA0zPMJTKAtin3p2RogKvjzHtLmQEAAAATZ2V0QmFzZTU4RnJvbU9yYWNsZQAAAAEAAAADa2V5BAAAAAckbWF0Y2gwCQAEHQAAAAIFAAAABm9yYWNsZQUAAAADa2V5AwkAAAEAAAACBQAAAAckbWF0Y2gwAgAAAAZTdHJpbmcEAAAABnN0cmluZwUAAAAHJG1hdGNoMAkAAlkAAAABBQAAAAZzdHJpbmcEAAAAB25vdGhpbmcFAAAAByRtYXRjaDAJAAACAAAAAQkAASwAAAACBQAAAANrZXkCAAAACGlzIGVtcHR5AAAAAA1rQWRtaW5QdWJLZXkxAgAAAAthZG1pbl9wdWJfMQAAAAANa0FkbWluUHViS2V5MgIAAAALYWRtaW5fcHViXzIAAAAADWtBZG1pblB1YktleTMCAAAAC2FkbWluX3B1Yl8zAAAAABJrQWRtaW5JbnZva2VQdWJLZXkCAAAAEGFkbWluX2ludm9rZV9wdWIAAAAAC2tHb3ZBZGRyZXNzAgA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exity": 0 } View: original | compacted Prev: none Next: H8aBgzdKdyNsiarKxTdEnBj1NXnNwEPgdW4MX4kMB8th Full:
Old | New | Differences | |
---|---|---|---|
1 | - | # no script | |
1 | + | {-# STDLIB_VERSION 5 #-} | |
2 | + | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | + | {-# CONTENT_TYPE DAPP #-} | |
4 | + | let oracle = Address(base58'3MvVBtsXroQpy1tsPw21TU2ET9A8WfmrNjz') | |
5 | + | ||
6 | + | func getBase58FromOracle (key) = match getString(oracle, key) { | |
7 | + | case string: String => | |
8 | + | fromBase58String(string) | |
9 | + | case nothing => | |
10 | + | throw((key + "is empty")) | |
11 | + | } | |
12 | + | ||
13 | + | ||
14 | + | let kAdminPubKey1 = "admin_pub_1" | |
15 | + | ||
16 | + | let kAdminPubKey2 = "admin_pub_2" | |
17 | + | ||
18 | + | let kAdminPubKey3 = "admin_pub_3" | |
19 | + | ||
20 | + | let kAdminInvokePubKey = "admin_invoke_pub" | |
21 | + | ||
22 | + | let kGovAddress = "governance_address" | |
23 | + | ||
24 | + | let kFarmAddress = "farming_address" | |
25 | + | ||
26 | + | let kSurveysAddress = "surveys_address" | |
27 | + | ||
28 | + | let adminPubKey1 = getBase58FromOracle(kAdminPubKey1) | |
29 | + | ||
30 | + | let adminPubKey2 = getBase58FromOracle(kAdminPubKey2) | |
31 | + | ||
32 | + | let adminPubKey3 = getBase58FromOracle(kAdminPubKey3) | |
33 | + | ||
34 | + | let adminInvoke = getBase58FromOracle(kAdminInvokePubKey) | |
35 | + | ||
36 | + | let governanceAddress = Address(getBase58FromOracle(kGovAddress)) | |
37 | + | ||
38 | + | let farmingAddress = Address(getBase58FromOracle(kFarmAddress)) | |
39 | + | ||
40 | + | let surveysAddress = Address(getBase58FromOracle(kSurveysAddress)) | |
41 | + | ||
42 | + | let keyPrefixPoolName = "pool_" | |
43 | + | ||
44 | + | ||
45 | + | @Verifier(tx) | |
46 | + | func verify () = match tx { | |
47 | + | case inv: InvokeScriptTransaction => | |
48 | + | let isExchangeCall = if (isDefined(getString(oracle, (keyPrefixPoolName + toString(addressFromRecipient(inv.dApp)))))) | |
49 | + | then (inv.function == "exchange") | |
50 | + | else false | |
51 | + | let isAirdropCall = if ((inv.dApp == governanceAddress)) | |
52 | + | then (inv.function == "airDrop") | |
53 | + | else false | |
54 | + | let isUpdateWeightsCall = if ((inv.dApp == governanceAddress)) | |
55 | + | then (inv.function == "updateWeights") | |
56 | + | else false | |
57 | + | let isUpdatePoolInterest = if ((inv.dApp == farmingAddress)) | |
58 | + | then (inv.function == "updatePoolInterest") | |
59 | + | else false | |
60 | + | let isTakenIntoAccount = if (isDefined(getString(oracle, (keyPrefixPoolName + toString(addressFromRecipient(inv.dApp)))))) | |
61 | + | then (inv.function == "takeIntoAccountExtraFunds") | |
62 | + | else false | |
63 | + | let isWriteTotal = if ((inv.dApp == surveysAddress)) | |
64 | + | then (inv.function == "writeTotals") | |
65 | + | else false | |
66 | + | let signedByAdmin = sigVerify(tx.bodyBytes, tx.proofs[0], adminInvoke) | |
67 | + | if (if (if (if (isExchangeCall) | |
68 | + | then true | |
69 | + | else isAirdropCall) | |
70 | + | then (size(inv.payments) == 1) | |
71 | + | else false) | |
72 | + | then true | |
73 | + | else if (if (if (if (isUpdateWeightsCall) | |
74 | + | then true | |
75 | + | else isUpdatePoolInterest) | |
76 | + | then true | |
77 | + | else isTakenIntoAccount) | |
78 | + | then true | |
79 | + | else isWriteTotal) | |
80 | + | then (size(inv.payments) == 0) | |
81 | + | else false) | |
82 | + | then signedByAdmin | |
83 | + | else false | |
84 | + | case _ => | |
85 | + | let adminPubKey1Signed = if (sigVerify(tx.bodyBytes, tx.proofs[0], adminPubKey1)) | |
86 | + | then 1 | |
87 | + | else 0 | |
88 | + | let adminPubKey2Signed = if (sigVerify(tx.bodyBytes, tx.proofs[1], adminPubKey2)) | |
89 | + | then 1 | |
90 | + | else 0 | |
91 | + | let adminPubKey3Signed = if (sigVerify(tx.bodyBytes, tx.proofs[2], adminPubKey3)) | |
92 | + | then 1 | |
93 | + | else 0 | |
94 | + | (((adminPubKey1Signed + adminPubKey2Signed) + adminPubKey3Signed) >= 2) | |
95 | + | } | |
96 | + |
github/deemru/w8io/169f3d6 24.77 ms ◑