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