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:AAIFAAAAAAAAABIIAhIDCgEIEgMKAQESBAoCAQEAAAAHAAAAAAlzZXBhcmF0b3ICAAAAAV8AAAAAD3NlY29uZFNlcGFyYXRvcgIAAAABLwEAAAAWZ2V0QWRkclRvSW50TWFwcGluZ0tleQAAAAIAAAALbWFwcGluZ05hbWUAAAAEYWRkcgkABLkAAAACCQAETAAAAAIFAAAAC21hcHBpbmdOYW1lCQAETAAAAAIFAAAABGFkZHIFAAAAA25pbAUAAAAJc2VwYXJhdG9yAQAAAA9nZXRMaXN0T2ZBcnJheXMAAAACAAAAC21hcHBpbmdOYW1lAAAABGFkZHIJAAS1AAAAAgkBAAAAEUBleHRyTmF0aXZlKDEwNTMpAAAAAgUAAAAEdGhpcwkBAAAAFmdldEFkZHJUb0ludE1hcHBpbmdLZXkAAAACBQAAAAttYXBwaW5nTmFtZQUAAAAEYWRkcgUAAAAJc2VwYXJhdG9yAQAAABhnZXRBZGRyVG9JbnRNYXBwaW5nSW5kZXgAAAACAAAAC21hcHBpbmdOYW1lAAAABGFkZHIJAAGQAAAAAQkBAAAAD2dldExpc3RPZkFycmF5cwAAA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cnJheQAAAAIAAAAFaW5kZXgAAAAHaW5kZXhJbgMJAABnAAAAAgkBAAAAGmdldEFkZHJUb0ludE1hcHBpbmdJbmRleEluAAAAAQUAAAAHaW5kZXhJbgUAAAAHaW5kZXhJbgkABEwAAAACCQEAAAALU3RyaW5nRW50cnkAAAACAgAAAAEyCQABkQAAAAIJAAS1AAAAAgkAAZEAAAACCQEAAAAPZ2V0TGlzdE9mQXJyYXlzAAAAAgIAAAAJbWFwU3RyaW5nCQAEJQAAAAEFAAAABHRoaXMFAAAABWluZGV4BQAAAA9zZWNvbmRTZXBhcmF0b3IFAAAAB2luZGV4SW4FAAAAA25pbAkAAAIAAAABAgAAAAxvdXQgb2YgcmFuZ2UAAAAAWU7fiw==", "height": 2120382, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: DfKHoJipuSxSrnZxtWh8hgZgnM8XKEPrH1zz8bPnAJn1 Next: DNmMCHxseYyDRjJRbYwghUvEDNco42Hc3rEBRsXvCFon Diff:
OldNewDifferences
55
66 let secondSeparator = "/"
77
8-func getMappingKey (mappingName,addr,separator) = makeString([mappingName, addr], separator)
8+func getAddrToIntMappingKey (mappingName,addr) = makeString([mappingName, addr], separator)
99
1010
11-func getElements (mappingName,addr,separator) = getStringValue(this, getMappingKey(mappingName, addr, separator))
11+func getListOfArrays (mappingName,addr) = split(getStringValue(this, getAddrToIntMappingKey(mappingName, addr)), separator)
1212
1313
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))
1815
1916
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)
2222 else throw("overcrowded")
2323
2424
2525 @Callable(i)
26-func setMap () = [setAddrToIntMappingValue("mapString", toString(this))]
26+func setStruct (valueInt) = [setAddrToIntMappingValue("mapString", toString(this), valueInt)]
2727
2828
2929
3030 @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")
3234
3335
3436
3537 @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")
4241
4342
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 5 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 let separator = "_"
55
66 let secondSeparator = "/"
77
8-func getMappingKey (mappingName,addr,separator) = makeString([mappingName, addr], separator)
8+func getAddrToIntMappingKey (mappingName,addr) = makeString([mappingName, addr], separator)
99
1010
11-func getElements (mappingName,addr,separator) = getStringValue(this, getMappingKey(mappingName, addr, separator))
11+func getListOfArrays (mappingName,addr) = split(getStringValue(this, getAddrToIntMappingKey(mappingName, addr)), separator)
1212
1313
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))
1815
1916
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)
2222 else throw("overcrowded")
2323
2424
2525 @Callable(i)
26-func setMap () = [setAddrToIntMappingValue("mapString", toString(this))]
26+func setStruct (valueInt) = [setAddrToIntMappingValue("mapString", toString(this), valueInt)]
2727
2828
2929
3030 @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")
3234
3335
3436
3537 @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")
4241
4342

github/deemru/w8io/169f3d6 
26.46 ms