tx · 6NZdgrg9xY4bMyuc9dB4f1bxSbrirGmzws3XiEKccUR4

3N9R7u449Z1b76QpJp9u3gzPjMYQYnp3V7r:  -0.04000000 Waves

2022.02.11 03:34 [1918241] smart account 3N9R7u449Z1b76QpJp9u3gzPjMYQYnp3V7r > SELF 0.00000000 Waves

{ "type": 13, "id": "6NZdgrg9xY4bMyuc9dB4f1bxSbrirGmzws3XiEKccUR4", "fee": 4000000, "feeAssetId": null, "timestamp": 1644539657137, "version": 2, "chainId": 84, "sender": "3N9R7u449Z1b76QpJp9u3gzPjMYQYnp3V7r", "senderPublicKey": "GUHw1jkstNWTs9SX1KM3pMtq9HXjupvxiTd1urNhNoyY", "proofs": [ "GPatLXo9hQQUjzyW7hbR5S6tN1WHYFihD7DwtFKVTkucq6oBp6A3DYoBYv845D1xsTDTbLqkdfRkrL4juUkFqP9" ], "script": "base64:AAIFAAAAAAAAAA4IAhIFCgMICAESAwoBCAAAAAQAAAAAEmhvbGRpbmdzQWRkcmVzc1N0cgIAAAAjM045Ujd1NDQ5WjFiNzZRcEpwOXUzZ3pQak1ZUVlucDNWN3IAAAAAEWhvbGRpbmdzUHVibGljS2V5AQAAACDl3SFFs6PsR+lqN3lF13al6d4vKwj2w7NM+AGJl9DbbwAAAAAPaG9sZGluZ3NBZGRyZXNzCQEAAAAUYWRkcmVzc0Zyb21QdWJsaWNLZXkAAAABBQAAABFob2xkaW5nc1B1YmxpY0tleQAAAAAPdHJhbnNmZXJDb3N0UGN0AAAAAAAAAAAoAAAAAgAAAAFpAQAAABFhZGRPd25lckFuZEFtb3VudAAAAAMAAAAHb3duZXJJZAAAAAdhc3NldElkAAAABmFtb3VudAkABEwAAAACCQEAAAALU3RyaW5nRW50cnkAAAACCQABLAAAAAIJAAEsAAAAAgIAAAAFc2FsZV8FAAAAB2Fzc2V0SWQCAAAADl9vcmlnaW5hbE93bmVyBQAAAAdvd25lcklkCQAETAAAAAIJAQAAAAxJbnRlZ2VyRW50cnkAAAACCQABLAAAAA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ICAAAAM1BheW1lbnQgYW5kIGFtb3VudCBkbyBub3QgbWF0Y2guIFRoaXMgYXNzZXRzIGNvc3RzIAkAAaQAAAABBQAAAAZhbW91bnQCAAAADWJ1dCB5b3Ugc2VudCAJAAGkAAAAAQUAAAANcGF5bWVudEFtb3VudAQAAAAIdHJhbnNmZXIJAARMAAAAAgkBAAAADlNjcmlwdFRyYW5zZmVyAAAAAwgFAAAAAWkAAAAGY2FsbGVyAAAAAAAAAAABCQACWQAAAAEFAAAAB2Fzc2V0SWQFAAAAA25pbAMJAQAAAAIhPQAAAAIFAAAAB293bmVySWQFAAAAEmhvbGRpbmdzQWRkcmVzc1N0cgQAAAAYYW1vdW50VG9SZW1haW5JbkhvbGRpbmdzCQAAaQAAAAIFAAAADXBheW1lbnRBbW91bnQFAAAAD3RyYW5zZmVyQ29zdFBjdAkAAAIAAAABCQABLAAAAAIJAAEsAAAAAgkAASwAAAACCQABLAAAAAIJAAEsAAAAAgIAAAAOcGF5bWVudEFtb3VudCAJAAGkAAAAAQUAAAANcGF5bWVudEFtb3VudAIAAAAcIHwgYW1vdW50VG9SZW1haW5JbkhvbGRpbmdzIAkAAaQAAAABBQAAABhhbW91bnRUb1JlbWFpbkluSG9sZGluZ3MCAAAAEyB8IHRyYW5zZmVyQ29zdFBjdCAJAAGkAAAAAQkAAGkAAAACBQAAAA90cmFuc2ZlckNvc3RQY3QAAAAAAAAAA+gFAAAACHRyYW5zZmVyAAAAAQAAAAJ0eAEAAAAGdmVyaWZ5AAAAAAbxSyGk", "height": 1918241, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: DAWfUpCma4E2FJK7hJ95XXC2wwMRUh6ZjcB3rzUNxaEb Next: 6Wz5EEnKDyXkcdgShmSwswPVks8U5kR5EZthz2XumizB Diff:
OldNewDifferences
4545 let transfer = [ScriptTransfer(i.caller, 1, fromBase58String(assetId))]
4646 if ((ownerId != holdingsAddressStr))
4747 then {
48- let amountToRemainInHoldings = (paymentAmount * transferCostPct)
48+ let amountToRemainInHoldings = (paymentAmount / transferCostPct)
4949 throw(((((("paymentAmount " + toString(paymentAmount)) + " | amountToRemainInHoldings ") + toString(amountToRemainInHoldings)) + " | transferCostPct ") + toString((transferCostPct / 1000))))
5050 }
5151 else transfer
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 = 40
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)
1818 func buyFromHoldings (assetId) = {
1919 let ownerId = match getString(this, (("sale_" + assetId) + "_originalOwner")) {
2020 case _: Unit =>
2121 "unset"
2222 case x: String =>
2323 x
2424 case _ =>
2525 throw("Match error")
2626 }
2727 let paymentAmount = valueOrElse(i.payments[0].amount, 0)
2828 let amount = match getInteger(this, (("sale_" + assetId) + "_amount")) {
2929 case _: Unit =>
3030 0
3131 case x: Int =>
3232 x
3333 case _ =>
3434 throw("Match error")
3535 }
3636 if (if ((ownerId == "unset"))
3737 then true
3838 else (ownerId == ""))
3939 then throw("Original owner not found ")
4040 else if (if ((amount == 0))
4141 then true
4242 else (amount > paymentAmount))
4343 then throw(((("Payment and amount do not match. This assets costs " + toString(amount)) + "but you sent ") + toString(paymentAmount)))
4444 else {
4545 let transfer = [ScriptTransfer(i.caller, 1, fromBase58String(assetId))]
4646 if ((ownerId != holdingsAddressStr))
4747 then {
48- let amountToRemainInHoldings = (paymentAmount * transferCostPct)
48+ let amountToRemainInHoldings = (paymentAmount / transferCostPct)
4949 throw(((((("paymentAmount " + toString(paymentAmount)) + " | amountToRemainInHoldings ") + toString(amountToRemainInHoldings)) + " | transferCostPct ") + toString((transferCostPct / 1000))))
5050 }
5151 else transfer
5252 }
5353 }
5454
5555
5656 @Verifier(tx)
5757 func verify () = true
5858

github/deemru/w8io/169f3d6 
109.36 ms