tx · Gm8JB9YSrucif8a1X7rGkWvFp4WvTpU4yStdyxKeenVr

3MwPsLy9F1mUQrdP37sCAKvHuE5HvPE674Y:  -0.04000000 Waves

2022.04.20 01:07 [2016019] smart account 3MwPsLy9F1mUQrdP37sCAKvHuE5HvPE674Y > SELF 0.00000000 Waves

{ "type": 13, "id": "Gm8JB9YSrucif8a1X7rGkWvFp4WvTpU4yStdyxKeenVr", "fee": 4000000, "feeAssetId": null, "timestamp": 1650406143073, "version": 2, "chainId": 84, "sender": "3MwPsLy9F1mUQrdP37sCAKvHuE5HvPE674Y", "senderPublicKey": "AyAwWbMPM7a4VYkn1bhEBftC5WZgfvUXgrYDe98mvLsv", "proofs": [ "4QKRqfE4MbFFgwVVgRHD68Nxq8Sh41kH4gebyeRP6SFXa4SNW3a13YAsLWJHrrUuSbKie1boywRMLFt4E27cKmrx" ], "script": "base64:AAIFAAAAAAAAABkIAhIFCgMICAESAwoBCBIECgIICBIDCgEIAAAABwAAAAAOZEFwcEFkZHJlc3NTdHICAAAAIzNON0o2bU1Na2pWVmlCUkV6OXk1M0ptY1g3cjdLWlJYUXBMAAAAAA1kQXBwUHVibGljS2V5AQAAACDgTQYFOGrUwRh8WaYap6j/gLstB4hjfa6yi718/WSaLAAAAAALZEFwcEFkZHJlc3MJAQAAABRhZGRyZXNzRnJvbVB1YmxpY0tleQAAAAEFAAAADWRBcHBQdWJsaWNLZXkAAAAAEmhvbGRpbmdzQWRkcmVzc1N0cgIAAAAjM013UHNMeTlGMW1VUXJkUDM3c0NBS3ZIdUU1SHZQRTY3NFkAAAAAEWhvbGRpbmdzUHVibGljS2V5AQAAACCUHPJXjFSZKhe4nfSREpS677760EMCVtx/1OcRvCWqHQAAAAAPaG9sZGluZ3NBZGRyZXNzCQEAAAAUYWRkcmVzc0Zyb21QdWJsaWNLZXkAAAABBQAAABFob2xkaW5nc1B1YmxpY0tleQAAAAAPdHJhbnNmZXJDb3N0UGN0AAAAAAAAAAAyAAAABAAAAAFpAQAAABF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IJAABlAAAAAgUAAAANcGF5bWVudEFtb3VudAUAAAAYYW1vdW50VG9SZW1haW5JbkhvbGRpbmdzBAAAAAxvd25lckFkZHJlc3MJAQAAAAdBZGRyZXNzAAAAAQkAAlkAAAABBQAAAAdvd25lcklkCQAETgAAAAIFAAAACHRyYW5zZmVyCQAETAAAAAIJAQAAAA5TY3JpcHRUcmFuc2ZlcgAAAAMFAAAADG93bmVyQWRkcmVzcwUAAAAXYW1vdW50VG9UcmFuc2ZlclRvT3duZXIFAAAABHVuaXQFAAAAA25pbAUAAAAIdHJhbnNmZXIJAAACAAAAAQIAAAAkU3RyaWN0IHZhbHVlIGlzIG5vdCBlcXVhbCB0byBpdHNlbGYuAAAAAWkBAAAACGJ1cm5UZXN0AAAAAQAAAAdhc3NldElkCQAETAAAAAIJAQAAAARCdXJuAAAAAgkAAlkAAAABBQAAAAdhc3NldElkAAAAAAAAAAABBQAAAANuaWwAAAABAAAAAnR4AQAAAAZ2ZXJpZnkAAAAAAwMJAAH0AAAAAwgFAAAAAnR4AAAACWJvZHlCeXRlcwkAAZEAAAACCAUAAAACdHgAAAAGcHJvb2ZzAAAAAAAAAAAACAUAAAACdHgAAAAPc2VuZGVyUHVibGljS2V5BgkAAAAAAAACCQEAAAAUYWRkcmVzc0Zyb21QdWJsaWNLZXkAAAABCAUAAAACdHgAAAAPc2VuZGVyUHVibGljS2V5BQAAAA9ob2xkaW5nc0FkZHJlc3MGCQAAAAAAAAIJAQAAABRhZGRyZXNzRnJvbVB1YmxpY0tleQAAAAEIBQAAAAJ0eAAAAA9zZW5kZXJQdWJsaWNLZXkFAAAAC2RBcHBBZGRyZXNzhouzbQ==", "height": 2016019, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: DMibyBZMRGk66oggK4vnxES3tiNV4MizkjYN7i6kvLa3 Next: 9tih9QUyoYcE4Upfv9Eq3z3T4d1EVnt1rEcgTy7GLCvX Diff:
OldNewDifferences
8585 }
8686
8787
88+
89+@Callable(i)
90+func burnTest (assetId) = [Burn(fromBase58String(assetId), 1)]
91+
92+
8893 @Verifier(tx)
8994 func verify () = if (if (sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey))
9095 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+
8893 @Verifier(tx)
8994 func verify () = if (if (sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey))
9095 then true
9196 else (addressFromPublicKey(tx.senderPublicKey) == holdingsAddress))
9297 then true
9398 else (addressFromPublicKey(tx.senderPublicKey) == dAppAddress)
9499

github/deemru/w8io/169f3d6 
25.09 ms