tx · FeD28WiBv5pHQ3TpZnavaaLochRHMASqFnQ972Ai6hKM
3Mz29fiz3zgY9JDbiHKANvHsFgQutdfu4Ua: -0.01400000 Waves
2021.04.01 14:00 [1463274] smart account 3Mz29fiz3zgY9JDbiHKANvHsFgQutdfu4Ua > SELF 0.00000000 Waves
{
"type": 13,
"id": "FeD28WiBv5pHQ3TpZnavaaLochRHMASqFnQ972Ai6hKM",
"fee": 1400000,
"feeAssetId": null,
"timestamp": 1617274836175,
"version": 2,
"chainId": 84,
"sender": "3Mz29fiz3zgY9JDbiHKANvHsFgQutdfu4Ua",
"senderPublicKey": "CTyHhnVTxf16Z4CmGGneAK8WB5g2QyT4MB8kUn8vPPcu",
"proofs": [
"5PBQrfmZ3Fpta8vaBQGvFJQDeN1Uzn5gfHSdnuc7JpRdnkz6zHsDxZjWfJ36VNCbLGyBaWg1BoBbC8WFFzBUviUn"
],
"script": "base64:AAIEAAAAAAAAAAwIAhIDCgEIEgMKAQgAAAACAAAAAAlzZXBhcmF0b3ICAAAAA19fXwAAAAAMa2V5UG9vbHNMaXN0AgAAAApQT09MU19MSVNUAAAAAgAAAAFpAQAAAAdhZGRQb29sAAAAAQAAAAdhc3NldElkAwkBAAAAAiE9AAAAAgUAAAAEdGhpcwgFAAAAAWkAAAAGY2FsbGVyCQAAAgAAAAECAAAADUFjY2VzcyBkZW5pZWQDCQAAAAAAAAIJAQAAAAhjb250YWlucwAAAAIFAAAAB2Fzc2V0SWQFAAAACXNlcGFyYXRvcgYJAAACAAAAAQIAAAAZU2VwYXJhdG9yIGZvdW5kIGluIHN0cmluZwQAAAAJYXNzZXREYXRhCQEAAAATdmFsdWVPckVycm9yTWVzc2FnZQAAAAIJAAPsAAAAAQkAAlkAAAABBQAAAAdhc3NldElkAgAAAA1Vbmtub3duIGFzc2V0BAAAAAlwb29sc0xpc3QJAAS1AAAAAgkBAAAAC3ZhbHVlT3JFbHNlAAAAAgkABB0AAAACBQAAAAR0aGlzBQAAAAxrZXlQb29sc0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RMbheYWBSdUCh5ub32G9mYet1Na2snBtjZ7d6
Next: 8LSkf6ZyTbPrQvhv8Dx5pnu24PmhhRbB3LLQk914w7SJ
Diff:
Old | New | | Differences |
---|
13 | 13 | | else { |
---|
14 | 14 | | let assetData = valueOrErrorMessage(assetInfo(fromBase58String(assetId)), "Unknown asset") |
---|
15 | 15 | | let poolsList = split(valueOrElse(getString(this, keyPoolsList), ""), separator) |
---|
16 | | - | if ((containsElement(poolsList, assetId) == true)) |
---|
17 | | - | then throw("Asset already has a pool") |
---|
18 | | - | else { |
---|
19 | | - | let newPoolsList = makeString(assetId :: poolsList, separator) |
---|
| 16 | + | let newPoolsList = makeString(assetId :: poolsList, separator) |
---|
20 | 17 | | [StringEntry(keyPoolsList, assetData.name)] |
---|
21 | | - | } |
---|
22 | 18 | | } |
---|
23 | 19 | | |
---|
24 | 20 | | |
---|
Full:
Old | New | | Differences |
---|
1 | 1 | | {-# STDLIB_VERSION 4 #-} |
---|
2 | 2 | | {-# SCRIPT_TYPE ACCOUNT #-} |
---|
3 | 3 | | {-# CONTENT_TYPE DAPP #-} |
---|
4 | 4 | | let separator = "___" |
---|
5 | 5 | | |
---|
6 | 6 | | let keyPoolsList = "POOLS_LIST" |
---|
7 | 7 | | |
---|
8 | 8 | | @Callable(i) |
---|
9 | 9 | | func addPool (assetId) = if ((this != i.caller)) |
---|
10 | 10 | | then throw("Access denied") |
---|
11 | 11 | | else if ((contains(assetId, separator) == true)) |
---|
12 | 12 | | then throw("Separator found in string") |
---|
13 | 13 | | else { |
---|
14 | 14 | | let assetData = valueOrErrorMessage(assetInfo(fromBase58String(assetId)), "Unknown asset") |
---|
15 | 15 | | let poolsList = split(valueOrElse(getString(this, keyPoolsList), ""), separator) |
---|
16 | | - | if ((containsElement(poolsList, assetId) == true)) |
---|
17 | | - | then throw("Asset already has a pool") |
---|
18 | | - | else { |
---|
19 | | - | let newPoolsList = makeString(assetId :: poolsList, separator) |
---|
| 16 | + | let newPoolsList = makeString(assetId :: poolsList, separator) |
---|
20 | 17 | | [StringEntry(keyPoolsList, assetData.name)] |
---|
21 | | - | } |
---|
22 | 18 | | } |
---|
23 | 19 | | |
---|
24 | 20 | | |
---|
25 | 21 | | |
---|
26 | 22 | | @Callable(i) |
---|
27 | 23 | | func removePool (assetId) = if ((this != i.caller)) |
---|
28 | 24 | | then throw("Access denied") |
---|
29 | 25 | | else { |
---|
30 | 26 | | let poolsList = split(valueOrErrorMessage(getString(this, keyPoolsList), "No pools"), separator) |
---|
31 | 27 | | let poolIndex = valueOrErrorMessage(indexOf(poolsList, assetId), "No pool for this asset") |
---|
32 | 28 | | let newPoolsList = makeString(removeByIndex(poolsList, poolIndex), separator) |
---|
33 | 29 | | [StringEntry(keyPoolsList, newPoolsList)] |
---|
34 | 30 | | } |
---|
35 | 31 | | |
---|
36 | 32 | | |
---|
37 | 33 | | @Verifier(tx) |
---|
38 | 34 | | func verify () = sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey) |
---|
39 | 35 | | |
---|