tx · 884RyWSPRNaXVEcyDhYL5Gq4qdqWRk9645Dr5rfv7L2N
3MvCKDNrXFLCPCMjLTQXzfiHYejGf5QST42: -0.00200000 Waves
2022.07.01 12:03 [2120382] smart account 3MvCKDNrXFLCPCMjLTQXzfiHYejGf5QST42 > SELF 0.00000000 Waves
{
"type": 13,
"id": "884RyWSPRNaXVEcyDhYL5Gq4qdqWRk9645Dr5rfv7L2N",
"fee": 200000,
"feeAssetId": null,
"timestamp": 1656666236147,
"version": 2,
"chainId": 84,
"sender": "3MvCKDNrXFLCPCMjLTQXzfiHYejGf5QST42",
"senderPublicKey": "Bm8NA6cDADuRW1tDcjPsFdpsoUGwdxSD16MjDxtar9JB",
"proofs": [
"5kvdPHpsqasgnN7vECTW1vNofDNQZkua67yihPxMuhzLX8pP7a1NptFoKH3ixZdYrRCDeTT5qfdn4etSWRBH6xfi"
],
"script": "base64:AAIFAAAAAAAAABIIAhIDCgEIEgMKAQESBAoCAQEAAAAHAAAAAAlzZXBhcmF0b3ICAAAAAV8AAAAAD3NlY29uZFNlcGFyYXRvcgIAAAABLwEAAAAWZ2V0QWRkclRvSW50TWFwcGluZ0tleQAAAAIAAAALbWFwcGluZ05hbWUAAAAEYWRkcgkABLkAAAACCQAETAAAAAIFAAAAC21hcHBpbmdOYW1lCQAETAAAAAIFAAAABGFkZHIFAAAAA25pbAUAAAAJc2VwYXJhdG9yAQAAAA9nZXRMaXN0T2ZBcnJheXMAAAACAAAAC21hcHBpbmdOYW1lAAAABGFkZHIJAAS1AAAAAgkBAAAAEUBleHRyTmF0aXZlKDEwNTMpAAAAAgUAAAAEdGhpcwkBAAAAFmdldEFkZHJUb0ludE1hcHBpbmdLZXkAAAACBQAAAAttYXBwaW5nTmFtZQUAAAAEYWRkcgUAAAAJc2VwYXJhdG9yAQAAABhnZXRBZGRyVG9JbnRNYXBwaW5nSW5kZXgAAAACAAAAC21hcHBpbmdOYW1lAAAABGFkZHIJAAGQAAAAAQkBAAAAD2dldExpc3RPZkF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WVudEZyb21BcnJheQAAAAIAAAAFaW5kZXgAAAAHaW5kZXhJbgMJAABnAAAAAgkBAAAAGmdldEFkZHJUb0ludE1hcHBpbmdJbmRleEluAAAAAQUAAAAHaW5kZXhJbgUAAAAHaW5kZXhJbgkABEwAAAACCQEAAAALU3RyaW5nRW50cnkAAAACAgAAAAEyCQABkQAAAAIJAAS1AAAAAgkAAZEAAAACCQEAAAAPZ2V0TGlzdE9mQXJyYXlzAAAAAgIAAAAJbWFwU3RyaW5nCQAEJQAAAAEFAAAABHRoaXMFAAAABWluZGV4BQAAAA9zZWNvbmRTZXBhcmF0b3IFAAAAB2luZGV4SW4FAAAAA25pbAkAAAIAAAABAgAAAAxvdXQgb2YgcmFuZ2UAAAAAWU7fiw==",
"height": 2120382,
"applicationStatus": "succeeded",
"spentComplexity": 0
}
View: original | compacted
Prev: DfKHoJipuSxSrnZxtWh8hgZgnM8XKEPrH1zz8bPnAJn1
Next: DNmMCHxseYyDRjJRbYwghUvEDNco42Hc3rEBRsXvCFon
Diff:
Old | New | | Differences |
---|
5 | 5 | | |
---|
6 | 6 | | let secondSeparator = "/" |
---|
7 | 7 | | |
---|
8 | | - | func getMappingKey (mappingName,addr,separator) = makeString([mappingName, addr], separator) |
---|
| 8 | + | func getAddrToIntMappingKey (mappingName,addr) = makeString([mappingName, addr], separator) |
---|
9 | 9 | | |
---|
10 | 10 | | |
---|
11 | | - | func getElements (mappingName,addr,separator) = getStringValue(this, getMappingKey(mappingName, addr, separator)) |
---|
| 11 | + | func getListOfArrays (mappingName,addr) = split(getStringValue(this, getAddrToIntMappingKey(mappingName, addr)), separator) |
---|
12 | 12 | | |
---|
13 | 13 | | |
---|
14 | | - | func setAddrToIntMappingValue (mappingName,addr) = { |
---|
15 | | - | let secondKey = getMappingKey(mappingName, addr, secondSeparator) |
---|
16 | | - | StringEntry(getMappingKey("mapString", addr, separator), secondKey) |
---|
17 | | - | } |
---|
| 14 | + | func getAddrToIntMappingIndex (mappingName,addr) = size(getListOfArrays("mapString", addr)) |
---|
18 | 15 | | |
---|
19 | 16 | | |
---|
20 | | - | func setAddrToIntMappingValueSecond (mappingName,addr,val) = if ((150 >= size(val))) |
---|
21 | | - | then StringEntry(getMappingKey("mapString", addr, secondSeparator), val) |
---|
| 17 | + | func getAddrToIntMappingIndexIn (indexIn) = size(split(getListOfArrays("mapString", toString(this))[indexIn], secondSeparator)) |
---|
| 18 | + | |
---|
| 19 | + | |
---|
| 20 | + | func setAddrToIntMappingValue (mappingName,addr,val) = if ((150 >= size(val))) |
---|
| 21 | + | then StringEntry(getAddrToIntMappingKey("mapString", addr), val) |
---|
22 | 22 | | else throw("overcrowded") |
---|
23 | 23 | | |
---|
24 | 24 | | |
---|
25 | 25 | | @Callable(i) |
---|
26 | | - | func setMap () = [setAddrToIntMappingValue("mapString", toString(this))] |
---|
| 26 | + | func setStruct (valueInt) = [setAddrToIntMappingValue("mapString", toString(this), valueInt)] |
---|
27 | 27 | | |
---|
28 | 28 | | |
---|
29 | 29 | | |
---|
30 | 30 | | @Callable(i) |
---|
31 | | - | func setMapInMap (valueInt) = [setAddrToIntMappingValueSecond("mapString", toString(this), valueInt)] |
---|
| 31 | + | func getArrayFromStruct (index) = if ((getAddrToIntMappingIndex("mapString", toString(this)) >= index)) |
---|
| 32 | + | then [StringEntry("1", getListOfArrays("mapString", toString(this))[index])] |
---|
| 33 | + | else throw("out of range") |
---|
32 | 34 | | |
---|
33 | 35 | | |
---|
34 | 36 | | |
---|
35 | 37 | | @Callable(i) |
---|
36 | | - | func getArrayFromStruct () = [StringEntry("1", getElements("mapString", toString(this), separator))] |
---|
37 | | - | |
---|
38 | | - | |
---|
39 | | - | |
---|
40 | | - | @Callable(i) |
---|
41 | | - | func getElementFromArray () = [StringEntry("2", getElements("mapString", toString(this), secondSeparator))] |
---|
| 38 | + | func getElementFromArray (index,indexIn) = if ((getAddrToIntMappingIndexIn(indexIn) >= indexIn)) |
---|
| 39 | + | then [StringEntry("2", split(getListOfArrays("mapString", toString(this))[index], secondSeparator)[indexIn])] |
---|
| 40 | + | else throw("out of range") |
---|
42 | 41 | | |
---|
43 | 42 | | |
---|
Full:
Old | New | | Differences |
---|
1 | 1 | | {-# STDLIB_VERSION 5 #-} |
---|
2 | 2 | | {-# SCRIPT_TYPE ACCOUNT #-} |
---|
3 | 3 | | {-# CONTENT_TYPE DAPP #-} |
---|
4 | 4 | | let separator = "_" |
---|
5 | 5 | | |
---|
6 | 6 | | let secondSeparator = "/" |
---|
7 | 7 | | |
---|
8 | | - | func getMappingKey (mappingName,addr,separator) = makeString([mappingName, addr], separator) |
---|
| 8 | + | func getAddrToIntMappingKey (mappingName,addr) = makeString([mappingName, addr], separator) |
---|
9 | 9 | | |
---|
10 | 10 | | |
---|
11 | | - | func getElements (mappingName,addr,separator) = getStringValue(this, getMappingKey(mappingName, addr, separator)) |
---|
| 11 | + | func getListOfArrays (mappingName,addr) = split(getStringValue(this, getAddrToIntMappingKey(mappingName, addr)), separator) |
---|
12 | 12 | | |
---|
13 | 13 | | |
---|
14 | | - | func setAddrToIntMappingValue (mappingName,addr) = { |
---|
15 | | - | let secondKey = getMappingKey(mappingName, addr, secondSeparator) |
---|
16 | | - | StringEntry(getMappingKey("mapString", addr, separator), secondKey) |
---|
17 | | - | } |
---|
| 14 | + | func getAddrToIntMappingIndex (mappingName,addr) = size(getListOfArrays("mapString", addr)) |
---|
18 | 15 | | |
---|
19 | 16 | | |
---|
20 | | - | func setAddrToIntMappingValueSecond (mappingName,addr,val) = if ((150 >= size(val))) |
---|
21 | | - | then StringEntry(getMappingKey("mapString", addr, secondSeparator), val) |
---|
| 17 | + | func getAddrToIntMappingIndexIn (indexIn) = size(split(getListOfArrays("mapString", toString(this))[indexIn], secondSeparator)) |
---|
| 18 | + | |
---|
| 19 | + | |
---|
| 20 | + | func setAddrToIntMappingValue (mappingName,addr,val) = if ((150 >= size(val))) |
---|
| 21 | + | then StringEntry(getAddrToIntMappingKey("mapString", addr), val) |
---|
22 | 22 | | else throw("overcrowded") |
---|
23 | 23 | | |
---|
24 | 24 | | |
---|
25 | 25 | | @Callable(i) |
---|
26 | | - | func setMap () = [setAddrToIntMappingValue("mapString", toString(this))] |
---|
| 26 | + | func setStruct (valueInt) = [setAddrToIntMappingValue("mapString", toString(this), valueInt)] |
---|
27 | 27 | | |
---|
28 | 28 | | |
---|
29 | 29 | | |
---|
30 | 30 | | @Callable(i) |
---|
31 | | - | func setMapInMap (valueInt) = [setAddrToIntMappingValueSecond("mapString", toString(this), valueInt)] |
---|
| 31 | + | func getArrayFromStruct (index) = if ((getAddrToIntMappingIndex("mapString", toString(this)) >= index)) |
---|
| 32 | + | then [StringEntry("1", getListOfArrays("mapString", toString(this))[index])] |
---|
| 33 | + | else throw("out of range") |
---|
32 | 34 | | |
---|
33 | 35 | | |
---|
34 | 36 | | |
---|
35 | 37 | | @Callable(i) |
---|
36 | | - | func getArrayFromStruct () = [StringEntry("1", getElements("mapString", toString(this), separator))] |
---|
37 | | - | |
---|
38 | | - | |
---|
39 | | - | |
---|
40 | | - | @Callable(i) |
---|
41 | | - | func getElementFromArray () = [StringEntry("2", getElements("mapString", toString(this), secondSeparator))] |
---|
| 38 | + | func getElementFromArray (index,indexIn) = if ((getAddrToIntMappingIndexIn(indexIn) >= indexIn)) |
---|
| 39 | + | then [StringEntry("2", split(getListOfArrays("mapString", toString(this))[index], secondSeparator)[indexIn])] |
---|
| 40 | + | else throw("out of range") |
---|
42 | 41 | | |
---|
43 | 42 | | |
---|