tx · 8FAeXkdHd5SvuNoHy3NV94kkZaL84iPwjdWGWKu5tLf8

3MwPsLy9F1mUQrdP37sCAKvHuE5HvPE674Y:  -0.04000000 Waves

2022.04.20 23:44 [2017362] smart account 3MwPsLy9F1mUQrdP37sCAKvHuE5HvPE674Y > SELF 0.00000000 Waves

{ "type": 13, "id": "8FAeXkdHd5SvuNoHy3NV94kkZaL84iPwjdWGWKu5tLf8", "fee": 4000000, "feeAssetId": null, "timestamp": 1650487480915, "version": 2, "chainId": 84, "sender": "3MwPsLy9F1mUQrdP37sCAKvHuE5HvPE674Y", "senderPublicKey": "AyAwWbMPM7a4VYkn1bhEBftC5WZgfvUXgrYDe98mvLsv", "proofs": [ "229KKXD2a8WRG5qUs55WkB494kiVj4JZHsupjFmeRwMeJ52qw78MLsBjg1qZGsecy4aukXjunxWv6smBWGak22AV" ], "script": "base64:AAIFAAAAAAAAABQIAhIFCgMICAESAwoBCBIECgIICAAAAAcAAAAADmRBcHBBZGRyZXNzU3RyAgAAACMzTjdKNm1NTWtqVlZpQlJFejl5NTNKbWNYN3I3S1pSWFFwTAAAAAANZEFwcFB1YmxpY0tleQEAAAAg4E0GBThq1MEYfFmmGqeo/4C7LQeIY32usou9fP1kmiwAAAAAC2RBcHBBZGRyZXNzCQEAAAAUYWRkcmVzc0Zyb21QdWJsaWNLZXkAAAABBQAAAA1kQXBwUHVibGljS2V5AAAAABJob2xkaW5nc0FkZHJlc3NTdHICAAAAIzNNd1BzTHk5RjFtVVFyZFAzN3NDQUt2SHVFNUh2UEU2NzRZAAAAABFob2xkaW5nc1B1YmxpY0tleQEAAAAglBzyV4xUmSoXuJ30kRKUuu+++tBDAlbcf9TnEbwlqh0AAAAAD2hvbGRpbmdzQWRkcmVzcwkBAAAAFGFkZHJlc3NGcm9tUHVibGljS2V5AAAAAQUAAAARaG9sZGluZ3NQdWJsaWNLZXkAAAAAD3RyYW5zZmVyQ29zdFBjdAAAAAAAAAAAMgAAAAMAAAABaQEAAAARYWRkT3du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AAAADXBheW1lbnRBbW91bnQFAAAAGGFtb3VudFRvUmVtYWluSW5Ib2xkaW5ncwQAAAAMb3duZXJBZGRyZXNzCQEAAAAHQWRkcmVzcwAAAAEJAAJZAAAAAQUAAAAHb3duZXJJZAkABE4AAAACBQAAAAh0cmFuc2ZlcgkABEwAAAACCQEAAAAOU2NyaXB0VHJhbnNmZXIAAAADBQAAAAxvd25lckFkZHJlc3MFAAAAF2Ftb3VudFRvVHJhbnNmZXJUb093bmVyBQAAAAR1bml0BQAAAANuaWwFAAAACHRyYW5zZmVyCQAAAgAAAAECAAAAJFN0cmljdCB2YWx1ZSBpcyBub3QgZXF1YWwgdG8gaXRzZWxmLgAAAAEAAAACdHgBAAAABnZlcmlmeQAAAAADAwkAAfQAAAADCAUAAAACdHgAAAAJYm9keUJ5dGVzCQABkQAAAAIIBQAAAAJ0eAAAAAZwcm9vZnMAAAAAAAAAAAAIBQAAAAJ0eAAAAA9zZW5kZXJQdWJsaWNLZXkGCQAAAAAAAAIJAQAAABRhZGRyZXNzRnJvbVB1YmxpY0tleQAAAAEIBQAAAAJ0eAAAAA9zZW5kZXJQdWJsaWNLZXkFAAAAD2hvbGRpbmdzQWRkcmVzcwYJAAAAAAAAAgkBAAAAFGFkZHJlc3NGcm9tUHVibGljS2V5AAAAAQgFAAAAAnR4AAAAD3NlbmRlclB1YmxpY0tleQUAAAALZEFwcEFkZHJlc3Nf+iJW", "height": 2017362, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: HGo8PjgK91ozEKMtFJn78118KLJNTA3ktFxW6jr1GPQo Next: none Diff:
OldNewDifferences
8585 }
8686
8787
88-
89-@Callable(i)
90-func burnTest (assetId) = [Burn(fromBase58String(assetId), 1)]
91-
92-
9388 @Verifier(tx)
9489 func verify () = if (if (sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey))
9590 then true
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 5 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 let dAppAddressStr = "3N7J6mMMkjVViBREz9y53JmcX7r7KZRXQpL"
55
66 let dAppPublicKey = base58'G6aSmaqLJ4p7jzm7BnQcZuqa2NRRLVtzqdYNjYErnEZZ'
77
88 let dAppAddress = addressFromPublicKey(dAppPublicKey)
99
1010 let holdingsAddressStr = "3MwPsLy9F1mUQrdP37sCAKvHuE5HvPE674Y"
1111
1212 let holdingsPublicKey = base58'AyAwWbMPM7a4VYkn1bhEBftC5WZgfvUXgrYDe98mvLsv'
1313
1414 let holdingsAddress = addressFromPublicKey(holdingsPublicKey)
1515
1616 let transferCostPct = 50
1717
1818 @Callable(i)
1919 func addOwnerAndAmount (ownerId,assetId,amount) = [StringEntry((("sale_" + assetId) + "_originalOwner"), ownerId), IntegerEntry((("sale_" + assetId) + "_amount"), amount)]
2020
2121
2222
2323 @Callable(i)
2424 func revokeForSale (assetId) = {
2525 let callerId = toBase58String(i.caller.bytes)
2626 let ownerId = match getString(this, (("sale_" + assetId) + "_originalOwner")) {
2727 case _: Unit =>
2828 "unset"
2929 case x: String =>
3030 x
3131 case _ =>
3232 throw("Match error")
3333 }
3434 if ((callerId != ownerId))
3535 then throw("Owners do not match")
3636 else [StringEntry((("sale_" + assetId) + "_originalOwner"), ""), IntegerEntry((("sale_" + assetId) + "_amount"), 0), ScriptTransfer(i.caller, 1, fromBase58String(assetId))]
3737 }
3838
3939
4040
4141 @Callable(i)
4242 func buyFromHoldings (assetId,userText) = {
4343 let ownerId = match getString(this, (("sale_" + assetId) + "_originalOwner")) {
4444 case _: Unit =>
4545 "unset"
4646 case x: String =>
4747 x
4848 case _ =>
4949 throw("Match error")
5050 }
5151 let paymentAmount = valueOrElse(i.payments[0].amount, 0)
5252 let amount = match getInteger(this, (("sale_" + assetId) + "_amount")) {
5353 case _: Unit =>
5454 0
5555 case x: Int =>
5656 x
5757 case _ =>
5858 throw("Match error")
5959 }
6060 if (if ((ownerId == "unset"))
6161 then true
6262 else (ownerId == ""))
6363 then throw("Original owner not found ")
6464 else if (if ((amount == 0))
6565 then true
6666 else (amount > paymentAmount))
6767 then throw(((("Payment and amount do not match. This assets costs " + toString(amount)) + "but you sent ") + toString(paymentAmount)))
6868 else {
6969 let callerId = toBase58String(i.caller.bytes)
7070 let res = invoke(dAppAddress, "finalizeSale", [assetId, callerId, userText], [AttachedPayment(unit, 0)])
7171 if ((res == res))
7272 then {
7373 let transfer = [ScriptTransfer(i.caller, 1, fromBase58String(assetId)), StringEntry((("sale_" + assetId) + "_originalOwner"), ""), IntegerEntry((("sale_" + assetId) + "_amount"), 0)]
7474 if ((ownerId != holdingsAddressStr))
7575 then {
7676 let amountToRemainInHoldings = (paymentAmount / transferCostPct)
7777 let amountToTransferToOwner = (paymentAmount - amountToRemainInHoldings)
7878 let ownerAddress = Address(fromBase58String(ownerId))
7979 (transfer ++ [ScriptTransfer(ownerAddress, amountToTransferToOwner, unit)])
8080 }
8181 else transfer
8282 }
8383 else throw("Strict value is not equal to itself.")
8484 }
8585 }
8686
8787
88-
89-@Callable(i)
90-func burnTest (assetId) = [Burn(fromBase58String(assetId), 1)]
91-
92-
9388 @Verifier(tx)
9489 func verify () = if (if (sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey))
9590 then true
9691 else (addressFromPublicKey(tx.senderPublicKey) == holdingsAddress))
9792 then true
9893 else (addressFromPublicKey(tx.senderPublicKey) == dAppAddress)
9994

github/deemru/w8io/169f3d6 
30.51 ms