tx · DXBW166gve43DXNXfwcCnxAzt9LzN5fknNDYmweqESVv 3NBBWfzZtZtszaXbitTKnrB2xXwv26Bn7H9: -0.01400000 Waves 2021.05.31 11:22 [1549607] smart account 3NBBWfzZtZtszaXbitTKnrB2xXwv26Bn7H9 > SELF 0.00000000 Waves
{ "type": 13, "id": "DXBW166gve43DXNXfwcCnxAzt9LzN5fknNDYmweqESVv", "fee": 1400000, "feeAssetId": null, "timestamp": 1622449375301, "version": 2, "chainId": 84, "sender": "3NBBWfzZtZtszaXbitTKnrB2xXwv26Bn7H9", "senderPublicKey": "D1X9WatF6ARMCmm3jC4Ex5Wd5VQ3LY8i1xbHNqeHqeAa", "proofs": [ "3dDLpMtVss7RNw1Le5befhsdH3Hh5HyL4syPAgCeC9XF233evbUzxvJay53mjgCVAU7hXfMELFgMooCQuHrz5GjH" ], "script": "base64:AAIEAAAAAAAAAA4IAhIECgIICBIECgIICAAAAAoAAAAADGFkbWluUHViS2V5MQEAAAAgBM915WTQwQ9OZ7kfE2TEGg3qhCRCMX0zkF1AWAqdk0oAAAAADGFkbWluUHViS2V5MgEAAAAgBM915WTQwQ9OZ7kfE2TEGg3qhCRCMX0zkF1AWAqdk0oAAAAADGFkbWluUHViS2V5MwEAAAAgBM915WTQwQ9OZ7kfE2TEGg3qhCRCMX0zkF1AWAqdk0oAAAAAEGtleVBvb2xzTGlzdE5hbWUCAAAABXBvb2xzAAAAABFrZXlQcmVmaXhQb29sTmFtZQIAAAAFcG9vbF8AAAAAEmtleVByZWZpeFBvb2xJbmRleAIAAAAGaW5kZXhfAAAAAAVwb29scwQAAAAHJG1hdGNoMAkABB0AAAACBQAAAAR0aGlzBQAAABBrZXlQb29sc0xpc3ROYW1lAwkAAAEAAAACBQAAAAckbWF0Y2gwAgAAAAZTdHJpbmcEAAAABnN0cmluZwUAAAAHJG1hdGNoMAkABLUAAAACBQAAAAZzdHJpbmcCAAAAASwEAAAAB25vdGhpbmcFAAAAByRtYXRjaDAFAAAAA25pbAEA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oMAIAAAASUmVpc3N1ZVRyYW5zYWN0aW9uCQAB9AAAAAMIBQAAAAJ0eAAAAAlib2R5Qnl0ZXMJAAGRAAAAAggFAAAAAnR4AAAABnByb29mcwAAAAAAAAAAAAgFAAAAAnR4AAAAD3NlbmRlclB1YmxpY0tleQkAAAIAAAABAgAAAAtNYXRjaCBlcnJvcgie9tM=", "height": 1549607, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 1UP1bZuHHQasVvsREKGMJemyN5r9qVxkRUtadTsq9XJ Next: 9YRENuSipaY15PJviXKxVJ6xcfBs5Q8Z14Pp1zpUGs8m Full:
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 4 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let adminPubKey1 = base58'Kn7NpzaG12dLZgcHf2ipUftU6hbJygmrhFqQYE4B7ZK' | |
5 | 5 | ||
6 | 6 | let adminPubKey2 = base58'Kn7NpzaG12dLZgcHf2ipUftU6hbJygmrhFqQYE4B7ZK' | |
7 | 7 | ||
8 | 8 | let adminPubKey3 = base58'Kn7NpzaG12dLZgcHf2ipUftU6hbJygmrhFqQYE4B7ZK' | |
9 | 9 | ||
10 | 10 | let keyPoolsListName = "pools" | |
11 | 11 | ||
12 | 12 | let keyPrefixPoolName = "pool_" | |
13 | 13 | ||
14 | 14 | let keyPrefixPoolIndex = "index_" | |
15 | 15 | ||
16 | 16 | let pools = match getString(this, keyPoolsListName) { | |
17 | 17 | case string: String => | |
18 | 18 | split(string, ",") | |
19 | 19 | case nothing => | |
20 | 20 | nil | |
21 | 21 | } | |
22 | 22 | ||
23 | 23 | func isSelfCall (i) = if ((i.caller == this)) | |
24 | 24 | then unit | |
25 | 25 | else throw("Only the Oracle itself can invoke this function") | |
26 | 26 | ||
27 | 27 | ||
28 | 28 | func getPoolNameIfValid (poolName) = { | |
29 | 29 | let underscoreIndex = valueOrElse(indexOf(poolName, "_"), -1) | |
30 | 30 | let underscoreLastIndex = valueOrElse(lastIndexOf(poolName, "_"), -1) | |
31 | 31 | let hasSingleUnderscore = if (if ((underscoreIndex == underscoreLastIndex)) | |
32 | 32 | then (underscoreIndex > 0) | |
33 | 33 | else false) | |
34 | 34 | then (underscoreIndex != (size(poolName) - 1)) | |
35 | 35 | else false | |
36 | 36 | if (hasSingleUnderscore) | |
37 | 37 | then poolName | |
38 | 38 | else throw("Pool name must consist of two asset names separated by an underscore character") | |
39 | 39 | } | |
40 | 40 | ||
41 | 41 | ||
42 | 42 | func getAddressIfValid (address) = toString(valueOrErrorMessage(addressFromString(address), (("Can't parse \"" + address) + "\" as address"))) | |
43 | 43 | ||
44 | 44 | ||
45 | 45 | @Callable(i) | |
46 | 46 | func addPool (poolAddress,poolName) = valueOrElse(isSelfCall(i), { | |
47 | 47 | let validatedAddress = getAddressIfValid(poolAddress) | |
48 | 48 | let keyName = (keyPrefixPoolName + validatedAddress) | |
49 | 49 | let keyIndex = (keyPrefixPoolIndex + validatedAddress) | |
50 | 50 | let possiblyAlreadyAddedPool = getString(this, keyName) | |
51 | 51 | if (isDefined(possiblyAlreadyAddedPool)) | |
52 | 52 | then throw((((("Pool with address \"" + validatedAddress) + "\" is already defined with name \"") + value(possiblyAlreadyAddedPool)) + "\"")) | |
53 | 53 | else [IntegerEntry(keyIndex, size(pools)), StringEntry(keyName, getPoolNameIfValid(poolName)), StringEntry(keyPoolsListName, makeString((pools :+ validatedAddress), ","))] | |
54 | 54 | }) | |
55 | 55 | ||
56 | 56 | ||
57 | 57 | ||
58 | 58 | @Callable(i) | |
59 | 59 | func renamePool (poolAddress,newPoolName) = valueOrElse(isSelfCall(i), { | |
60 | 60 | let validatedAddress = getAddressIfValid(poolAddress) | |
61 | 61 | let keyName = (keyPrefixPoolName + validatedAddress) | |
62 | 62 | let possiblyAlreadyAddedPool = getString(this, keyName) | |
63 | 63 | if (isDefined(possiblyAlreadyAddedPool)) | |
64 | 64 | then [StringEntry(keyName, getPoolNameIfValid(newPoolName))] | |
65 | 65 | else throw((("Pool with address \"" + validatedAddress) + "\" has not yet been added")) | |
66 | 66 | }) | |
67 | 67 | ||
68 | 68 | ||
69 | 69 | @Verifier(tx) | |
70 | 70 | func verify () = match tx { | |
71 | 71 | case invoke: InvokeScriptTransaction => | |
72 | 72 | let isSelfInvoke = if ((invoke.dApp == this)) | |
73 | 73 | then containsElement(["addPool", "renamePool"], invoke.function) | |
74 | 74 | else false | |
75 | 75 | if ((size(invoke.payments) == 0)) | |
76 | 76 | then isSelfInvoke | |
77 | 77 | else false | |
78 | 78 | case _: Order|DataTransaction|SponsorFeeTransaction|SetScriptTransaction|CreateAliasTransaction|LeaseCancelTransaction|LeaseTransaction|IssueTransaction|UpdateAssetInfoTransaction|InvokeScriptTransaction|SetAssetScriptTransaction|TransferTransaction|ExchangeTransaction|MassTransferTransaction|BurnTransaction|ReissueTransaction => | |
79 | 79 | sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey) | |
80 | 80 | case _ => | |
81 | 81 | throw("Match error") | |
82 | 82 | } | |
83 | 83 |
github/deemru/w8io/169f3d6 56.20 ms ◑