tx · 9pWnevesuhW7nJvUnum4rcgj52azfEDFtyyv4R3AZjfL 3MvCKDNrXFLCPCMjLTQXzfiHYejGf5QST42: -0.00200000 Waves 2022.06.29 15:15 [2117713] smart account 3MvCKDNrXFLCPCMjLTQXzfiHYejGf5QST42 > SELF 0.00000000 Waves
{ "type": 13, "id": "9pWnevesuhW7nJvUnum4rcgj52azfEDFtyyv4R3AZjfL", "fee": 200000, "feeAssetId": null, "timestamp": 1656504995429, "version": 2, "chainId": 84, "sender": "3MvCKDNrXFLCPCMjLTQXzfiHYejGf5QST42", "senderPublicKey": "Bm8NA6cDADuRW1tDcjPsFdpsoUGwdxSD16MjDxtar9JB", "proofs": [ "2g6UimNvn8gye1TWkaipC3w75ebBUuuWN9uVsKfXyxYhnY5hFynQfju4pBQPPqjxdptsAF5V1j42B7JiqYebGo5" ], "script": "base64:AAIFAAAAAAAAABIIAhIDCgEIEgMKAQESBAoCAQEAAAAGAAAAAAlzZXBhcmF0b3ICAAAAAV8BAAAAFmdldEFkZHJUb0ludE1hcHBpbmdLZXkAAAACAAAAC21hcHBpbmdOYW1lAAAABGFkZHIJAAS5AAAAAgkABEwAAAACBQAAAAttYXBwaW5nTmFtZQkABEwAAAACBQAAAARhZGRyBQAAAANuaWwFAAAACXNlcGFyYXRvcgEAAAAYZ2V0QWRkclRvSW50TWFwcGluZ1ZhbHVlAAAAAgAAAAttYXBwaW5nTmFtZQAAAARhZGRyCQAEtQAAAAIJAQAAABFAZXh0ck5hdGl2ZSgxMDUzKQAAAAIFAAAABHRoaXMJAQAAABZnZXRBZGRyVG9JbnRNYXBwaW5nS2V5AAAAAgUAAAALbWFwcGluZ05hbWUFAAAABGFkZHICAAAAAV8BAAAAGGdldEFkZHJUb0ludE1hcHBpbmdJbmRleAAAAAIAAAALbWFwcGluZ05hbWUAAAAEYWRkcgkAAGQAAAACCQABkAAAAAEJAQAAABhnZXRBZGRyVG9JbnRNYXBwaW5nVmFsdWUAAAACAgAAAAltYXBTdHJpbmcFA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RBZGRyVG9JbnRNYXBwaW5nSW5kZXhJbgAAAAEFAAAAB2luZGV4SW4JAAACAAAAAQIAAAAMb3V0IG9mIHJhbmdlCQAETAAAAAIJAQAAAAtTdHJpbmdFbnRyeQAAAAICAAAAATIJAAGRAAAAAgkABLUAAAACCQABkQAAAAIJAQAAABhnZXRBZGRyVG9JbnRNYXBwaW5nVmFsdWUAAAACAgAAAAltYXBTdHJpbmcJAAQlAAAAAQUAAAAEdGhpcwUAAAAFaW5kZXgCAAAAAS8FAAAAB2luZGV4SW4FAAAAA25pbAAAAABeNeW3", "height": 2117713, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 97ogfXiBXeTKZSCzfzwgpL2AGAvraF3fZkH87GvTsvNR Next: 61tHnvuhJH7d6dL7dQu7jgopyzvd2yF9asp949KyhwfW Diff:
Old | New | Differences | |
---|---|---|---|
24 | 24 | ||
25 | 25 | ||
26 | 26 | @Callable(i) | |
27 | - | func getArrayFromStruct (index) = [StringEntry("1", getAddrToIntMappingValue("mapString", toString(this))[index])] | |
27 | + | func getArrayFromStruct (index) = if ((index > getAddrToIntMappingIndex("mapString", toString(this)))) | |
28 | + | then throw("out of range") | |
29 | + | else [StringEntry("1", getAddrToIntMappingValue("mapString", toString(this))[index])] | |
28 | 30 | ||
29 | 31 | ||
30 | 32 | ||
31 | 33 | @Callable(i) | |
32 | - | func getElementFromArray (index,indexIn) = [StringEntry("2", split(getAddrToIntMappingValue("mapString", toString(this))[index], "/")[indexIn])] | |
34 | + | func getElementFromArray (index,indexIn) = if ((indexIn > getAddrToIntMappingIndexIn(indexIn))) | |
35 | + | then throw("out of range") | |
36 | + | else [StringEntry("2", split(getAddrToIntMappingValue("mapString", toString(this))[index], "/")[indexIn])] | |
33 | 37 | ||
34 | 38 |
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 | func getAddrToIntMappingKey (mappingName,addr) = makeString([mappingName, addr], separator) | |
7 | 7 | ||
8 | 8 | ||
9 | 9 | func getAddrToIntMappingValue (mappingName,addr) = split(getStringValue(this, getAddrToIntMappingKey(mappingName, addr)), "_") | |
10 | 10 | ||
11 | 11 | ||
12 | 12 | func getAddrToIntMappingIndex (mappingName,addr) = (size(getAddrToIntMappingValue("mapString", addr)) + 1) | |
13 | 13 | ||
14 | 14 | ||
15 | 15 | func getAddrToIntMappingIndexIn (indexIn) = size(split(getAddrToIntMappingValue("mapString", toString(this))[indexIn], "/")) | |
16 | 16 | ||
17 | 17 | ||
18 | 18 | func setAddrToIntMappingValue (mappingName,addr,val) = StringEntry(getAddrToIntMappingKey("mapString", addr), val) | |
19 | 19 | ||
20 | 20 | ||
21 | 21 | @Callable(i) | |
22 | 22 | func setStruct (valueInt) = [setAddrToIntMappingValue("mapString", toString(this), valueInt)] | |
23 | 23 | ||
24 | 24 | ||
25 | 25 | ||
26 | 26 | @Callable(i) | |
27 | - | func getArrayFromStruct (index) = [StringEntry("1", getAddrToIntMappingValue("mapString", toString(this))[index])] | |
27 | + | func getArrayFromStruct (index) = if ((index > getAddrToIntMappingIndex("mapString", toString(this)))) | |
28 | + | then throw("out of range") | |
29 | + | else [StringEntry("1", getAddrToIntMappingValue("mapString", toString(this))[index])] | |
28 | 30 | ||
29 | 31 | ||
30 | 32 | ||
31 | 33 | @Callable(i) | |
32 | - | func getElementFromArray (index,indexIn) = [StringEntry("2", split(getAddrToIntMappingValue("mapString", toString(this))[index], "/")[indexIn])] | |
34 | + | func getElementFromArray (index,indexIn) = if ((indexIn > getAddrToIntMappingIndexIn(indexIn))) | |
35 | + | then throw("out of range") | |
36 | + | else [StringEntry("2", split(getAddrToIntMappingValue("mapString", toString(this))[index], "/")[indexIn])] | |
33 | 37 | ||
34 | 38 |
github/deemru/w8io/169f3d6 44.29 ms ◑