tx · AgMHbHJaZuitT99dBfvrpeMs9TbYzsaAyjJ85MUhQtAG

3Mpv2qZ8P3tXj3uKwmw8ULr9yxANxbadQEW:  -0.01400000 Waves

2021.12.13 15:45 [1832499] smart account 3Mpv2qZ8P3tXj3uKwmw8ULr9yxANxbadQEW > SELF 0.00000000 Waves

{ "type": 13, "id": "AgMHbHJaZuitT99dBfvrpeMs9TbYzsaAyjJ85MUhQtAG", "fee": 1400000, "feeAssetId": null, "timestamp": 1639399536248, "version": 2, "chainId": 84, "sender": "3Mpv2qZ8P3tXj3uKwmw8ULr9yxANxbadQEW", "senderPublicKey": "J7yipDGS56f1CWQUaHM6k8TXt1iWw3DrzeqjSEUqL4Uv", "proofs": [ "3g7nx6PSZZpdXWYX9SAkfkHNjRk4mAwGCSaGteDikGMXRJ4owwqrefTYxtcTeJZ4VdFtnmTmQvfMH7SfHRkG9brJ" ], "script": "base64:AAIFAAAAAAAAAA4IAhIDCgEIEgUKAwgBCAAAAAEBAAAAC2lzUGF5bWVudE9rAAAAAgAAAAFpAAAABXByaWNlBAAAABFhY2NlcHRhYmxlQXNzZXRJZAEAAAAgBi7WREUMKdJnPRpCCOky/DKzvRQlW1GeENSHUVBimooDCQAAAAAAAAIJAAGQAAAAAQgFAAAAAWkAAAAIcGF5bWVudHMAAAAAAAAAAAAJAAACAAAAAQIAAAAUUGF5bWVudCBub3QgYXR0YWNoZWQEAAAAAXAJAAGRAAAAAggFAAAAAWkAAAAIcGF5bWVudHMAAAAAAAAAAAAEAAAAByRtYXRjaDAIBQAAAAFwAAAAB2Fzc2V0SWQDCQAAAQAAAAIFAAAAByRtYXRjaDACAAAACkJ5dGVWZWN0b3IEAAAAB2Fzc2V0SWQFAAAAByRtYXRjaDADCQAAAAAAAAIFAAAAB2Fzc2V0SWQFAAAAEWFjY2VwdGFibGVBc3NldElkCQAAZwAAAAIIBQAAAAFwAAAABmFtb3VudAUAAAAFcHJpY2UHCQAAAgAAAAECAAAAE0JhZCBhc3NldCBvciBhb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GlzdAUAAAALbW9uZXlhcnRpc3QFAAAABm1kc3RpZAkABEwAAAACCQEAAAAOU2NyaXB0VHJhbnNmZXIAAAADBQAAAAt3YWxsZXRvd25lcgUAAAAKbW9uZXlvd25lcgUAAAAGbWRzdGlkBQAAAANuaWwJAAACAAAAAQIAAAAdV3JvbmcgcGF5bWVudCBhbW91bnQgb3IgYXNzZXQAAAABAAAAAnR4AQAAAAZ2ZXJpZnkAAAAACQAB9AAAAAMIBQAAAAJ0eAAAAAlib2R5Qnl0ZXMJAAGRAAAAAggFAAAAAnR4AAAABnByb29mcwAAAAAAAAAAAAgFAAAAAnR4AAAAD3NlbmRlclB1YmxpY0tleUqZG4U=", "height": 1832499, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: HGuL4D683NzonbtFTSEZ96EtKSfFVQmGRgHHKx3bBMXY Next: XdUmQYfF8iYiBFP84GLkYWr4uSAt7WZomKr37o11EZF Diff:
OldNewDifferences
5353 let spliturl = split(y[5], "=")
5454 let newurl = ((spliturl[0] + "=") + newid)
5555 let z = ((((((((((((((((((((((y[0] + ",") + y[1]) + ",") + y[2]) + ",") + y[3]) + ",") + y[4]) + ",") + newurl) + "',") + y[6]) + ",") + "false") + ",") + y[8]) + ",") + y[9]) + ",") + st) + ",") + y[11])
56- let price = y[8]
56+ let price = parseIntValue(y[8])
5757 let money = (size(i.payments) * 10000)
58- let moneyartist = (money / 2)
59- let moneyowner = (money / 4)
60- let moneyus = (money / 4)
58+ let moneyartist = (price / 2)
59+ let moneyowner = (price / 4)
60+ let moneyus = (price / 4)
6161 let mdstid = base58'R8sQUmwwAENBL6B5ejGztDh3RzJ3MbKRqK7GtspFxKT'
62- let stxx = base58'3MzXqo2rBxc3XEKPVcYHDrsgP7jmE6cGg6C'
6362 let adr1 = drop(y[0], 1)
6463 let adr11 = dropRight(adr1, 1)
6564 let adr2 = drop(y[2], 1)
7372 then (maxcnt != 0)
7473 else false)
7574 then throw("Mint impossible, max NFT amount exceeded")
76- else if (isPaymentOk(i, money))
75+ else if (isPaymentOk(i, price))
7776 then [issue, ScriptTransfer(i.caller, 1, id), ScriptTransfer(walletartist, moneyartist, mdstid), ScriptTransfer(walletowner, moneyowner, mdstid)]
7877 else throw("Wrong payment amount or asset")
7978 }
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 5 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 func isPaymentOk (i,price) = {
55 let acceptableAssetId = base58'R8sQUmwwAENBL6B5ejGztDh3RzJ3MbKRqK7GtspFxKT'
66 if ((size(i.payments) == 0))
77 then throw("Payment not attached")
88 else {
99 let p = i.payments[0]
1010 match p.assetId {
1111 case assetId: ByteVector =>
1212 if ((assetId == acceptableAssetId))
1313 then (p.amount >= price)
1414 else false
1515 case _ =>
1616 throw("Bad asset or amount")
1717 }
1818 }
1919 }
2020
2121
2222 @Callable(i)
2323 func mintme (info) = {
2424 let counter = match getInteger(this, "counter") {
2525 case a: Int =>
2626 (a + 1)
2727 case _ =>
2828 0
2929 }
3030 let st = toString(counter)
3131 let name = "MDST-NFT #"
3232 let fname = (name + st)
3333 let issue = Issue(fname, info, 1, 0, false)
3434 let id = calculateAssetId(issue)
3535 [issue, ScriptTransfer(i.caller, issue.quantity, id), IntegerEntry("counter", counter)]
3636 }
3737
3838
3939
4040 @Callable(i)
4141 func buynft (idnftx,cnt,newid) = {
4242 let st = toString(cnt)
4343 let fname = ("MDST-COPY#" + st)
4444 let info = "kiki bikit"
4545 let idnft = fromBase58String(idnftx)
4646 let x = match assetInfo(idnft) {
4747 case asset: Asset =>
4848 asset.description
4949 case _ =>
5050 throw("Can't find this NFT")
5151 }
5252 let y = split(x, ",")
5353 let spliturl = split(y[5], "=")
5454 let newurl = ((spliturl[0] + "=") + newid)
5555 let z = ((((((((((((((((((((((y[0] + ",") + y[1]) + ",") + y[2]) + ",") + y[3]) + ",") + y[4]) + ",") + newurl) + "',") + y[6]) + ",") + "false") + ",") + y[8]) + ",") + y[9]) + ",") + st) + ",") + y[11])
56- let price = y[8]
56+ let price = parseIntValue(y[8])
5757 let money = (size(i.payments) * 10000)
58- let moneyartist = (money / 2)
59- let moneyowner = (money / 4)
60- let moneyus = (money / 4)
58+ let moneyartist = (price / 2)
59+ let moneyowner = (price / 4)
60+ let moneyus = (price / 4)
6161 let mdstid = base58'R8sQUmwwAENBL6B5ejGztDh3RzJ3MbKRqK7GtspFxKT'
62- let stxx = base58'3MzXqo2rBxc3XEKPVcYHDrsgP7jmE6cGg6C'
6362 let adr1 = drop(y[0], 1)
6463 let adr11 = dropRight(adr1, 1)
6564 let adr2 = drop(y[2], 1)
6665 let adr22 = dropRight(adr2, 1)
6766 let walletartist = addressFromStringValue(adr11)
6867 let walletowner = addressFromStringValue(adr22)
6968 let issue = Issue(fname, z, 1, 0, false)
7069 let id = calculateAssetId(issue)
7170 let maxcnt = parseIntValue(y[9])
7271 if (if ((cnt > maxcnt))
7372 then (maxcnt != 0)
7473 else false)
7574 then throw("Mint impossible, max NFT amount exceeded")
76- else if (isPaymentOk(i, money))
75+ else if (isPaymentOk(i, price))
7776 then [issue, ScriptTransfer(i.caller, 1, id), ScriptTransfer(walletartist, moneyartist, mdstid), ScriptTransfer(walletowner, moneyowner, mdstid)]
7877 else throw("Wrong payment amount or asset")
7978 }
8079
8180
8281 @Verifier(tx)
8382 func verify () = sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey)
8483

github/deemru/w8io/c3f4982 
32.33 ms