tx · 3JGejpD9VKQ6YLDtBh9pYXDZ4GymzwT2mG9YSJmzhAaE

3NC2gxrsMW5rEBsJCVMjJwBhcB3nnBrUG4f:  -0.01000000 Waves

2023.11.30 02:08 [2865337] smart account 3NC2gxrsMW5rEBsJCVMjJwBhcB3nnBrUG4f > SELF 0.00000000 Waves

{ "type": 13, "id": "3JGejpD9VKQ6YLDtBh9pYXDZ4GymzwT2mG9YSJmzhAaE", "fee": 1000000, "feeAssetId": null, "timestamp": 1701299321136, "version": 2, "chainId": 84, "sender": "3NC2gxrsMW5rEBsJCVMjJwBhcB3nnBrUG4f", "senderPublicKey": "E1AzspvmVgU66Pn9sgPQTc586F4eJ4nnWDadbPWyqqXN", "proofs": [ "t67fyQ5uDqtSyC6aEz6X4wmFV2WLP3KbqkiACzdDqdxSJarXXghHpZ2f9nSfLw9MEXRTBAkFKwTdfBMBzcdGkyP" ], "script": "base64:BgIUCAISBQoDCAgCEgQKAggCEgMKAQgBAAZGSVZFX0sJAGgCAAUAgAgDAWkBD2lzc3VlQW5kU2F2ZU5mdAMEbmFtZQtkZXNjcmlwdGlvbgdjb250ZW50BAVpc3N1ZQkAwggFBQRuYW1lBQtkZXNjcmlwdGlvbgABAAAHBAJpZAkA2AQBCQC4CAEFBWlzc3VlAwkAZgIJAMgBAQUHY29udGVudAkAaAIAAwUGRklWRV9LCQACAQIedG9vIGJpZyBjb250ZW50LCBtYXggMTVLIGJ5dGVzBAJjMAMJAGYCCQDIAQEFB2NvbnRlbnQJAGgCAAIFBkZJVkVfSwQLcGFydFJlc3VsdDEJAPwHBAUEdGhpcwIIc2F2ZVBhcnQJAMwIAgkArAICBQJpZAICXzEJAMwIAgkAyQECCQDKAQIFB2NvbnRlbnQFBkZJVkVfSwUGRklWRV9LBQNuaWwFA25pbAMJAAACBQtwYXJ0UmVzdWx0MQULcGFydFJlc3VsdDEEC3BhcnRSZXN1bHQyCQD8BwQFBHRoaXMCCHNhdmVQYXJ0CQDMCAIJAKwCAgUCaWQCA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"spentComplexity": 0 } View: original | compacted Prev: 9QHYnCp1MV4EcZZd9fZxFZhRfhA4LP1FukHWVCsGY3Pq Next: none Full:
OldNewDifferences
11 {-# STDLIB_VERSION 6 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
4-
4+let FIVE_K = (5 * 1024)
55
66 @Callable(i)
77 func issueAndSaveNft (name,description,content) = {
88 let issue = Issue(name, description, 1, 0, false)
99 let id = toBase58String(calculateAssetId(issue))
10- if ((size(content) > (15 * 1024)))
10+ if ((size(content) > (3 * FIVE_K)))
1111 then throw("too big content, max 15K bytes")
12- else $Tuple2([issue, BinaryEntry(id, content)], id)
12+ else {
13+ let c0 = if ((size(content) > (2 * FIVE_K)))
14+ then {
15+ let partResult1 = invoke(this, "savePart", [(id + "_1"), take(drop(content, FIVE_K), FIVE_K)], nil)
16+ if ((partResult1 == partResult1))
17+ then {
18+ let partResult2 = invoke(this, "savePart", [(id + "_2"), drop(content, (2 * FIVE_K))], nil)
19+ if ((partResult2 == partResult2))
20+ then take(content, FIVE_K)
21+ else throw("Strict value is not equal to itself.")
22+ }
23+ else throw("Strict value is not equal to itself.")
24+ }
25+ else if ((size(content) > FIVE_K))
26+ then {
27+ let partResult1 = invoke(this, "savePart", [(id + "_1"), drop(content, FIVE_K)], nil)
28+ if ((partResult1 == partResult1))
29+ then take(content, FIVE_K)
30+ else throw("Strict value is not equal to itself.")
31+ }
32+ else content
33+ $Tuple2([issue, BinaryEntry((id + "_0"), c0)], id)
34+ }
1335 }
1436
1537
1638
1739 @Callable(i)
18-func getNftREADONLY (assetId) = $Tuple2(nil, getBinary(assetId))
40+func savePart (key,part) = if ((i.caller != this))
41+ then throw("permission denied")
42+ else $Tuple2([BinaryEntry(key, part)], key)
43+
44+
45+
46+@Callable(i)
47+func getNftREADONLY (assetId) = {
48+ let c0 = getBinaryValue((assetId + "_0"))
49+ let c1 = valueOrElse(getBinary((assetId + "_1")), base58'')
50+ let c2 = valueOrElse(getBinary((assetId + "_2")), base58'')
51+ $Tuple2(nil, ((c0 + c1) + c2))
52+ }
1953
2054

github/deemru/w8io/026f985 
23.51 ms