tx · FBFkzHV3S1QYVS3HuPtFvWJaJCGh4MSeQLbZ4DrjMzhP

3N9R7u449Z1b76QpJp9u3gzPjMYQYnp3V7r:  -0.04000000 Waves

2022.02.15 03:39 [1924032] smart account 3N9R7u449Z1b76QpJp9u3gzPjMYQYnp3V7r > SELF 0.00000000 Waves

{ "type": 13, "id": "FBFkzHV3S1QYVS3HuPtFvWJaJCGh4MSeQLbZ4DrjMzhP", "fee": 4000000, "feeAssetId": null, "timestamp": 1644885671482, "version": 2, "chainId": 84, "sender": "3N9R7u449Z1b76QpJp9u3gzPjMYQYnp3V7r", "senderPublicKey": "GUHw1jkstNWTs9SX1KM3pMtq9HXjupvxiTd1urNhNoyY", "proofs": [ "ggd3aKUrLrbrFxUyeBnyjWi3hwHuyjHoSSRgkjWM8Q9b1qpy2QiVEEDbNdke3nt9RqszdDftC9s5nkUr9dSLG9G" ], "script": "base64:AAIFAAAAAAAAABMIAhIFCgMICAESAwoBCBIDCgEIAAAABAAAAAASaG9sZGluZ3NBZGRyZXNzU3RyAgAAACMzTjlSN3U0NDlaMWI3NlFwSnA5dTNnelBqTVlRWW5wM1Y3cgAAAAARaG9sZGluZ3NQdWJsaWNLZXkBAAAAIOXdIUWzo+xH6Wo3eUXXdqXp3i8rCPbDs0z4AYmX0NtvAAAAAA9ob2xkaW5nc0FkZHJlc3MJAQAAABRhZGRyZXNzRnJvbVB1YmxpY0tleQAAAAEFAAAAEWhvbGRpbmdzUHVibGljS2V5AAAAAA90cmFuc2ZlckNvc3RQY3QAAAAAAAAAADIAAAADAAAAAWkBAAAAEWFkZE93bmVyQW5kQW1vdW50AAAAAwAAAAdvd25lcklkAAAAB2Fzc2V0SWQAAAAGYW1vdW50CQAETAAAAAIJAQAAAAtTdHJpbmdFbnRyeQAAAAIJAAEsAAAAAgkAASwAAAACAgAAAAVzYWxlXwUAAAAHYXNzZXRJZAIAAAAOX29yaWdpbmFsT3duZXIFAAAAB293bmVySWQJAARMAAAAAgkBAAAADEludGVnZXJF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ABLAAAAAIJAAEsAAAAAgIAAAAFc2FsZV8FAAAAB2Fzc2V0SWQCAAAAB19hbW91bnQAAAAAAAAAAAAFAAAAA25pbAMJAQAAAAIhPQAAAAIFAAAAB293bmVySWQFAAAAEmhvbGRpbmdzQWRkcmVzc1N0cgQAAAAYYW1vdW50VG9SZW1haW5JbkhvbGRpbmdzCQAAaQAAAAIFAAAADXBheW1lbnRBbW91bnQFAAAAD3RyYW5zZmVyQ29zdFBjdAQAAAAXYW1vdW50VG9UcmFuc2ZlclRvT3duZXIJAABlAAAAAgUAAAANcGF5bWVudEFtb3VudAUAAAAYYW1vdW50VG9SZW1haW5JbkhvbGRpbmdzBAAAAAxvd25lckFkZHJlc3MJAQAAAAdBZGRyZXNzAAAAAQkAAlkAAAABBQAAAAdvd25lcklkCQAETgAAAAIFAAAACHRyYW5zZmVyCQAETAAAAAIJAQAAAA5TY3JpcHRUcmFuc2ZlcgAAAAMFAAAADG93bmVyQWRkcmVzcwUAAAAXYW1vdW50VG9UcmFuc2ZlclRvT3duZXIFAAAABHVuaXQFAAAAA25pbAUAAAAIdHJhbnNmZXIAAAABAAAAAnR4AQAAAAZ2ZXJpZnkAAAAABu4++44=", "height": 1924032, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 3y8JopqfPXXGyjWpykJ9f8yDTkoA66Qw1W7nrbboYmf5 Next: GogCgj5geErfEwGCbWqwpq6E72SLtFhzDLrQzWVEikyr Diff:
OldNewDifferences
1515
1616
1717 @Callable(i)
18-func removeForSale (assetId) = {
18+func revokeForSale (assetId) = {
1919 let callerId = toBase58String(i.caller.bytes)
2020 let ownerId = match getString(this, (("sale_" + assetId) + "_originalOwner")) {
2121 case _: Unit =>
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 5 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 let holdingsAddressStr = "3N9R7u449Z1b76QpJp9u3gzPjMYQYnp3V7r"
55
66 let holdingsPublicKey = base58'GUHw1jkstNWTs9SX1KM3pMtq9HXjupvxiTd1urNhNoyY'
77
88 let holdingsAddress = addressFromPublicKey(holdingsPublicKey)
99
1010 let transferCostPct = 50
1111
1212 @Callable(i)
1313 func addOwnerAndAmount (ownerId,assetId,amount) = [StringEntry((("sale_" + assetId) + "_originalOwner"), ownerId), IntegerEntry((("sale_" + assetId) + "_amount"), amount)]
1414
1515
1616
1717 @Callable(i)
18-func removeForSale (assetId) = {
18+func revokeForSale (assetId) = {
1919 let callerId = toBase58String(i.caller.bytes)
2020 let ownerId = match getString(this, (("sale_" + assetId) + "_originalOwner")) {
2121 case _: Unit =>
2222 "unset"
2323 case x: String =>
2424 x
2525 case _ =>
2626 throw("Match error")
2727 }
2828 if ((callerId != ownerId))
2929 then throw("Owners do not match")
3030 else [ScriptTransfer(i.caller, 1, fromBase58String(assetId))]
3131 }
3232
3333
3434
3535 @Callable(i)
3636 func buyFromHoldings (assetId) = {
3737 let ownerId = match getString(this, (("sale_" + assetId) + "_originalOwner")) {
3838 case _: Unit =>
3939 "unset"
4040 case x: String =>
4141 x
4242 case _ =>
4343 throw("Match error")
4444 }
4545 let paymentAmount = valueOrElse(i.payments[0].amount, 0)
4646 let amount = match getInteger(this, (("sale_" + assetId) + "_amount")) {
4747 case _: Unit =>
4848 0
4949 case x: Int =>
5050 x
5151 case _ =>
5252 throw("Match error")
5353 }
5454 if (if ((ownerId == "unset"))
5555 then true
5656 else (ownerId == ""))
5757 then throw("Original owner not found ")
5858 else if (if ((amount == 0))
5959 then true
6060 else (amount > paymentAmount))
6161 then throw(((("Payment and amount do not match. This assets costs " + toString(amount)) + "but you sent ") + toString(paymentAmount)))
6262 else {
6363 let transfer = [ScriptTransfer(i.caller, 1, fromBase58String(assetId)), StringEntry((("sale_" + assetId) + "_originalOwner"), ""), IntegerEntry((("sale_" + assetId) + "_amount"), 0)]
6464 if ((ownerId != holdingsAddressStr))
6565 then {
6666 let amountToRemainInHoldings = (paymentAmount / transferCostPct)
6767 let amountToTransferToOwner = (paymentAmount - amountToRemainInHoldings)
6868 let ownerAddress = Address(fromBase58String(ownerId))
6969 (transfer ++ [ScriptTransfer(ownerAddress, amountToTransferToOwner, unit)])
7070 }
7171 else transfer
7272 }
7373 }
7474
7575
7676 @Verifier(tx)
7777 func verify () = true
7878

github/deemru/w8io/169f3d6 
26.47 ms