tx · DTuE8qFTa4S12zaMdkw3uvG61z74N2FA4Sa398P5EU3b 3N8iygiXd1v34PPaMSQb34SSrBwGxT2DpGK: -0.01400000 Waves 2022.08.15 01:10 [2184724] smart account 3N8iygiXd1v34PPaMSQb34SSrBwGxT2DpGK > SELF 0.00000000 Waves
{ "type": 13, "id": "DTuE8qFTa4S12zaMdkw3uvG61z74N2FA4Sa398P5EU3b", "fee": 1400000, "feeAssetId": null, "timestamp": 1660515040690, "version": 2, "chainId": 84, "sender": "3N8iygiXd1v34PPaMSQb34SSrBwGxT2DpGK", "senderPublicKey": "FshLkkgzcLs6iQJ1Z8Nnfhm494tC8xZQczf9iXpZep3Y", "proofs": [ "2rNm7SyLp84TXwwZzCM3f2koir49wDGJmgVAC4yTQDEYgzRqEH4bjdT1VaVDdF36ossJHvErjAeL4tcuAyigSvAE" ], "script": "base64:AAIFAAAAAAAAAAYIAhIAEgAAAAAFAAAAAApCVENBc3NldElEAQAAACD0NPJEoKaVcLA62QAal819hhYdQl83FUDxF7HRh6LUlwAAAAALU0FUU0Fzc2V0SUQBAAAAIIQVHLyAa6peOQxN4R+aXTT73bjvUy7OZLsC9igQULD7AAAAAAhUcmVhc3VyeQkBAAAAFGFkZHJlc3NGcm9tUHVibGljS2V5AAAAAQEAAAAgUoPZoIvXkJI7M+XgQERyG3Ox4PxeH5gdLMWeskjH4iAAAAAABHR4bnMEAAAAByRtYXRjaDAJAAQaAAAAAgUAAAAEdGhpcwIAAAAJVG90YWx0eG5zAwkAAAEAAAACBQAAAAckbWF0Y2gwAgAAAANJbnQEAAAAAWEFAAAAByRtYXRjaDAFAAAAAWEAAAAAAAAAAAAAAAAACXRvdGFsdHhucwkAAGQAAAACBQAAAAR0eG5zAAAAAAAAAAABAAAAAgAAAAFpAQAAAAlJc3N1ZVNBVFMAAAAABAAAAANwbXQDCQAAAAAAAAIJAAGQAAAAAQgFAAAAAWkAAAAIcGF5bWVudHMAAAAAAAAAAAEJAAGRAAAAAggFAAAAAWkAAA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Pbmx5IAkAAlgAAAABBQAAAAtTQVRTQXNzZXRJRAIAAAAIIFtTQVRTXS4DCQAAZgAAAAIAAAAAAAAAE4gIBQAAAANwbXQAAAAGYW1vdW50CQAAAgAAAAECAAAALUF0dGFjaCBBbW91bnQgbXVzdCBiZSBncmVhdGVyIHRoYW4gNTAwMCBTQVRTLgkABEwAAAACCQEAAAAEQnVybgAAAAIFAAAAC1NBVFNBc3NldElECAUAAAADcG10AAAABmFtb3VudAkABEwAAAACCQEAAAAMSW50ZWdlckVudHJ5AAAAAgIAAAAJVG90YWx0eG5zBQAAAAl0b3RhbHR4bnMJAARMAAAAAgkBAAAADEludGVnZXJFbnRyeQAAAAICAAAAElRvdGFsX0lzc3VlZF9TQVRTOgUAAAAPVG90YWxJc3N1ZWRTQVRTCQAETAAAAAIJAQAAAAtTdHJpbmdFbnRyeQAAAAICAAAAB21lc3NhZ2UCAAAAKjxoMT5TQVRTIExpcXVpZGF0ZWQgU3VjY2Vzc2Z1bGx5ITwvaDE+PGJyPgkABEwAAAACCQEAAAAOU2NyaXB0VHJhbnNmZXIAAAADCAUAAAABaQAAAAZjYWxsZXIFAAAAEmNhbGN1bGF0ZWJ1cm52YWx1ZQUAAAAKQlRDQXNzZXRJRAUAAAADbmlsAAAAAQAAAAJ0eAEAAAAGdmVyaWZ5AAAAAAQAAAAHJG1hdGNoMAUAAAACdHgJAAH0AAAAAwgFAAAAAnR4AAAACWJvZHlCeXRlcwkAAZEAAAACCAUAAAACdHgAAAAGcHJvb2ZzAAAAAAAAAAAACAUAAAACdHgAAAAPc2VuZGVyUHVibGljS2V5PT23YQ==", "height": 2184724, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 9jr8QPwJ3orWdvsudhczG1Q1oUBFPJrcaQg5ZyerP6jq Next: ygk7jEhcbGU8N97MWcf3TaxAS4QqWgQhoFqi4UgGr2g Diff:
Old | New | Differences | |
---|---|---|---|
5 | 5 | ||
6 | 6 | let SATSAssetID = base58'9tbVJFXNxWGtZefTnuH9yojcYEPHwXGxhDvY4UK4qf2z' | |
7 | 7 | ||
8 | - | let | |
8 | + | let Treasury = addressFromPublicKey(base58'6Z73KxcX3sugpiStpSRXxKxTmWqCaLVwFeM6kwyiKVDR') | |
9 | 9 | ||
10 | 10 | let txns = match getInteger(this, "Totaltxns") { | |
11 | 11 | case a: Int => | |
30 | 30 | then throw((("Incorrect asset attached, please attach [BTC] - " + toBase58String(BTCAssetID)) + " only.")) | |
31 | 31 | else if ((5000 > pmt.amount)) | |
32 | 32 | then throw("Please Attach minimum 5000 Satoshi's To Issue SATS Asset.") | |
33 | - | else [IntegerEntry("Total_Issued_SATS:", TotalIssuedSATS), IntegerEntry("Totaltxns", totaltxns), StringEntry("message", "<h1>SATS Issued Successfully!</h1><br>"), Reissue(SATSAssetID, NewSATSToUser, true), ScriptTransfer(i.caller, (NewSATSToUser - FeesCharged), SATSAssetID), ScriptTransfer( | |
33 | + | else [IntegerEntry("Total_Issued_SATS:", TotalIssuedSATS), IntegerEntry("Totaltxns", totaltxns), StringEntry("message", "<h1>SATS Issued Successfully!</h1><br>"), Reissue(SATSAssetID, NewSATSToUser, true), ScriptTransfer(i.caller, (NewSATSToUser - FeesCharged), SATSAssetID), ScriptTransfer(Treasury, FeesCharged, SATSAssetID)] | |
34 | 34 | } | |
35 | 35 | ||
36 | 36 | ||
40 | 40 | let currentKey = toBase58String(i.callerPublicKey) | |
41 | 41 | let pmt = value(i.payments[0]) | |
42 | 42 | let PreviousIssuedSATS = getIntegerValue(this, "Total_Issued_SATS:") | |
43 | - | let PreviousBurnedSATS = getIntegerValue(this, "Total_Burned_SATS:") | |
44 | - | let SATSCurrentCap = getIntegerValue(this, "SATSCurrentCap") | |
45 | 43 | let TotalIssuedSATS = (PreviousIssuedSATS - pmt.amount) | |
46 | - | let TotalBurnedSATS = (PreviousBurnedSATS + pmt.amount) | |
47 | - | let PendingMinting = (SATSCurrentCap - TotalIssuedSATS) | |
48 | - | let PreviousSATSReserveValue = getIntegerValue(this, "Total_SATS_Reserve_In_BTC:") | |
49 | - | let PreviousSATSBackupPrice = getIntegerValue(this, "SATS_Backup_Value_In_BTC:") | |
50 | - | let calculateburnvalue = fraction(PreviousSATSBackupPrice, pmt.amount, 100000) | |
51 | - | let SATSReserveValue = (PreviousSATSReserveValue - calculateburnvalue) | |
52 | - | let SATSBackupPrice = fraction(100000000, SATSReserveValue, TotalIssuedSATS) | |
44 | + | let calculateburnvalue = fraction(pmt.amount, 1, 1000000) | |
53 | 45 | if ((pmt.assetId != SATSAssetID)) | |
54 | 46 | then throw((("Kindly Deposit Only " + toBase58String(SATSAssetID)) + " [SATS].")) | |
55 | 47 | else if ((5000 > pmt.amount)) | |
56 | 48 | then throw("Attach Amount must be greater than 5000 SATS.") | |
57 | - | else [Burn(SATSAssetID, pmt.amount), IntegerEntry("Totaltxns", totaltxns), IntegerEntry("Total_Issued_SATS:", TotalIssuedSATS), | |
49 | + | else [Burn(SATSAssetID, pmt.amount), IntegerEntry("Totaltxns", totaltxns), IntegerEntry("Total_Issued_SATS:", TotalIssuedSATS), StringEntry("message", "<h1>SATS Liquidated Successfully!</h1><br>"), ScriptTransfer(i.caller, calculateburnvalue, BTCAssetID)] | |
58 | 50 | } | |
59 | 51 | ||
60 | 52 |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 5 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let BTCAssetID = base58'HSHJecCLGF7DEPA23dJe6WwroaLeDnik5eptjxEJYvwY' | |
5 | 5 | ||
6 | 6 | let SATSAssetID = base58'9tbVJFXNxWGtZefTnuH9yojcYEPHwXGxhDvY4UK4qf2z' | |
7 | 7 | ||
8 | - | let | |
8 | + | let Treasury = addressFromPublicKey(base58'6Z73KxcX3sugpiStpSRXxKxTmWqCaLVwFeM6kwyiKVDR') | |
9 | 9 | ||
10 | 10 | let txns = match getInteger(this, "Totaltxns") { | |
11 | 11 | case a: Int => | |
12 | 12 | a | |
13 | 13 | case _ => | |
14 | 14 | 0 | |
15 | 15 | } | |
16 | 16 | ||
17 | 17 | let totaltxns = (txns + 1) | |
18 | 18 | ||
19 | 19 | @Callable(i) | |
20 | 20 | func IssueSATS () = { | |
21 | 21 | let pmt = if ((size(i.payments) == 1)) | |
22 | 22 | then i.payments[0] | |
23 | 23 | else throw((("No Payments attached please attach [BTC] - " + toBase58String(BTCAssetID)) + " Asset Only.")) | |
24 | 24 | let currentKey = toBase58String(i.caller.bytes) | |
25 | 25 | let NewSATSToUser = fraction(1000000, pmt.amount, 1) | |
26 | 26 | let PreviousIssuedSATS = getIntegerValue(this, "Total_Issued_SATS:") | |
27 | 27 | let TotalIssuedSATS = (PreviousIssuedSATS + NewSATSToUser) | |
28 | 28 | let FeesCharged = 1000000 | |
29 | 29 | if ((pmt.assetId != BTCAssetID)) | |
30 | 30 | then throw((("Incorrect asset attached, please attach [BTC] - " + toBase58String(BTCAssetID)) + " only.")) | |
31 | 31 | else if ((5000 > pmt.amount)) | |
32 | 32 | then throw("Please Attach minimum 5000 Satoshi's To Issue SATS Asset.") | |
33 | - | else [IntegerEntry("Total_Issued_SATS:", TotalIssuedSATS), IntegerEntry("Totaltxns", totaltxns), StringEntry("message", "<h1>SATS Issued Successfully!</h1><br>"), Reissue(SATSAssetID, NewSATSToUser, true), ScriptTransfer(i.caller, (NewSATSToUser - FeesCharged), SATSAssetID), ScriptTransfer( | |
33 | + | else [IntegerEntry("Total_Issued_SATS:", TotalIssuedSATS), IntegerEntry("Totaltxns", totaltxns), StringEntry("message", "<h1>SATS Issued Successfully!</h1><br>"), Reissue(SATSAssetID, NewSATSToUser, true), ScriptTransfer(i.caller, (NewSATSToUser - FeesCharged), SATSAssetID), ScriptTransfer(Treasury, FeesCharged, SATSAssetID)] | |
34 | 34 | } | |
35 | 35 | ||
36 | 36 | ||
37 | 37 | ||
38 | 38 | @Callable(i) | |
39 | 39 | func Liquidate () = { | |
40 | 40 | let currentKey = toBase58String(i.callerPublicKey) | |
41 | 41 | let pmt = value(i.payments[0]) | |
42 | 42 | let PreviousIssuedSATS = getIntegerValue(this, "Total_Issued_SATS:") | |
43 | - | let PreviousBurnedSATS = getIntegerValue(this, "Total_Burned_SATS:") | |
44 | - | let SATSCurrentCap = getIntegerValue(this, "SATSCurrentCap") | |
45 | 43 | let TotalIssuedSATS = (PreviousIssuedSATS - pmt.amount) | |
46 | - | let TotalBurnedSATS = (PreviousBurnedSATS + pmt.amount) | |
47 | - | let PendingMinting = (SATSCurrentCap - TotalIssuedSATS) | |
48 | - | let PreviousSATSReserveValue = getIntegerValue(this, "Total_SATS_Reserve_In_BTC:") | |
49 | - | let PreviousSATSBackupPrice = getIntegerValue(this, "SATS_Backup_Value_In_BTC:") | |
50 | - | let calculateburnvalue = fraction(PreviousSATSBackupPrice, pmt.amount, 100000) | |
51 | - | let SATSReserveValue = (PreviousSATSReserveValue - calculateburnvalue) | |
52 | - | let SATSBackupPrice = fraction(100000000, SATSReserveValue, TotalIssuedSATS) | |
44 | + | let calculateburnvalue = fraction(pmt.amount, 1, 1000000) | |
53 | 45 | if ((pmt.assetId != SATSAssetID)) | |
54 | 46 | then throw((("Kindly Deposit Only " + toBase58String(SATSAssetID)) + " [SATS].")) | |
55 | 47 | else if ((5000 > pmt.amount)) | |
56 | 48 | then throw("Attach Amount must be greater than 5000 SATS.") | |
57 | - | else [Burn(SATSAssetID, pmt.amount), IntegerEntry("Totaltxns", totaltxns), IntegerEntry("Total_Issued_SATS:", TotalIssuedSATS), | |
49 | + | else [Burn(SATSAssetID, pmt.amount), IntegerEntry("Totaltxns", totaltxns), IntegerEntry("Total_Issued_SATS:", TotalIssuedSATS), StringEntry("message", "<h1>SATS Liquidated Successfully!</h1><br>"), ScriptTransfer(i.caller, calculateburnvalue, BTCAssetID)] | |
58 | 50 | } | |
59 | 51 | ||
60 | 52 | ||
61 | 53 | @Verifier(tx) | |
62 | 54 | func verify () = match tx { | |
63 | 55 | case _ => | |
64 | 56 | sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey) | |
65 | 57 | } | |
66 | 58 |
github/deemru/w8io/169f3d6 32.26 ms ◑