tx · C8pTU5ToujsuEratAAbT5NQc6qFiHByYGyWg7nc42KUk 3NAxi4ijrbVmR2AVeKTeJ1L3P4ebbXk7YDY: -0.01400000 Waves 2021.12.16 13:46 [1836710] smart account 3NAxi4ijrbVmR2AVeKTeJ1L3P4ebbXk7YDY > SELF 0.00000000 Waves
{ "type": 13, "id": "C8pTU5ToujsuEratAAbT5NQc6qFiHByYGyWg7nc42KUk", "fee": 1400000, "feeAssetId": null, "timestamp": 1639651641536, "version": 2, "chainId": 84, "sender": "3NAxi4ijrbVmR2AVeKTeJ1L3P4ebbXk7YDY", "senderPublicKey": "6w6geQvkvMqffnrYsamvmS9TjKjjePjFPWLY9qDbNddX", "proofs": [ "Xc1ApLoCz8sEX7iavEKnatsGaeRm7iKVWb9NJwTtAsGKgCp8nRuECXzPKBTAt43VxuGkrKa9SUeh1ADoA1LZinT" ], "script": "base64:AAIEAAAAAAAAAAYIAhIAEgAAAAACAAAAAAtmc1ROQXNzZXRJRAEAAAAgnvVzUNkaAZFSSO4nPxeRoS4zrUxu6jad0qWebNIZFHoAAAAAE0lzc3VlZnNUTkZlZUFkZHJlc3MJAQAAABRhZGRyZXNzRnJvbVB1YmxpY0tleQAAAAEBAAAAIOOt17LUijbWojwDE5tgFkw1Y8cwIr3jselcewpp7rwjAAAAAgAAAAFpAQAAAAlJc3N1ZWZzVE4AAAAABAAAAANwbXQJAQAAAAV2YWx1ZQAAAAEJAAGRAAAAAggFAAAAAWkAAAAIcGF5bWVudHMAAAAAAAAAAAAEAAAACmN1cnJlbnRLZXkJAAJYAAAAAQgIBQAAAAFpAAAABmNhbGxlcgAAAAVieXRlcwQAAAAMUHJpY2VQZXJmc1ROCQEAAAARQGV4dHJOYXRpdmUoMTA1MCkAAAACBQAAAAR0aGlzAgAAAAdmc1ROL1ROBAAAAA1OZXdmc1ROVG9Vc2VyCQAAawAAAAMAAAAAAAABhqAIBQAAAANwbXQAAAAGYW1vdW50BQAAAAxQcmljZVBlcmZzVE4EAAAAElByZX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AAAGVRvdGFsX2ZzVE5fUmVzZXJ2ZV9Jbl9UTjoFAAAAEGZzVE5SZXNlcnZlVmFsdWUJAARMAAAAAgkBAAAADEludGVnZXJFbnRyeQAAAAICAAAAGGZzVE5fQmFja3VwX1ZhbHVlX0luX1ROOgUAAAAPZnNUTkJhY2t1cFByaWNlCQAETAAAAAIJAQAAAAtTdHJpbmdFbnRyeQAAAAICAAAAB21lc3NhZ2UCAAAAKjxoMT5mc1ROIExpcXVpZGF0ZWQgU3VjY2Vzc2Z1bGx5ITwvaDE+PGJyPgkABEwAAAACCQEAAAAOU2NyaXB0VHJhbnNmZXIAAAADCAUAAAABaQAAAAZjYWxsZXIFAAAAEmNhbGN1bGF0ZWJ1cm52YWx1ZQUAAAAEdW5pdAUAAAADbmlsAAAAAQAAAAJ0eAEAAAAGdmVyaWZ5AAAAAAQAAAAHJG1hdGNoMAUAAAACdHgJAAH0AAAAAwgFAAAAAnR4AAAACWJvZHlCeXRlcwkAAZEAAAACCAUAAAACdHgAAAAGcHJvb2ZzAAAAAAAAAAAACAUAAAACdHgAAAAPc2VuZGVyUHVibGljS2V5io0Mpg==", "height": 1836710, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: B1J7Dk6mbWUc9xCs7L8MKbojn9ENSuUtiwMffBmiocpU Next: ER9trjjaDpwAgmmEcsKbxF8f5d9twbVGVrdzETZ2HCS9 Diff:
Old | New | Differences | |
---|---|---|---|
17 | 17 | let fsTNReserveValue = (PreviousfsTNReserveValue + pmt.amount) | |
18 | 18 | let PreviousfsTNBackupPrice = getIntegerValue(this, "fsTN_Backup_Value_In_TN:") | |
19 | 19 | let fsTNBackupPrice = fraction(100000, fsTNReserveValue, TotalIssuedfsTN) | |
20 | - | let FeePercentage = 1 | |
21 | - | let BalanceTokensReturnedToUser = (100 - FeePercentage) | |
20 | + | let FeesCharged = 100000000 | |
22 | 21 | if (isDefined(pmt.assetId)) | |
23 | 22 | then throw("Incorrect asset attached, please attach TN.") | |
24 | - | else if (( | |
25 | - | then throw("Please Attach minimum | |
26 | - | else [IntegerEntry("Total_Issued_fsTN:", TotalIssuedfsTN), IntegerEntry("Total_fsTN_Reserve_In_TN:", fsTNReserveValue), IntegerEntry("fsTN_Backup_Value_In_TN:", fsTNBackupPrice), StringEntry("message", "<h1>fsTN Issued Successfully!</h1><br>"), Reissue(fsTNAssetID, NewfsTNToUser, true), ScriptTransfer(i.caller, ( | |
23 | + | else if ((200000000 > pmt.amount)) | |
24 | + | then throw("Please Attach minimum 2 TN To Issue fsTN Asset.") | |
25 | + | else [IntegerEntry("Total_Issued_fsTN:", TotalIssuedfsTN), IntegerEntry("Total_fsTN_Reserve_In_TN:", fsTNReserveValue), IntegerEntry("fsTN_Backup_Value_In_TN:", fsTNBackupPrice), StringEntry("message", "<h1>fsTN Issued Successfully!</h1><br>"), Reissue(fsTNAssetID, NewfsTNToUser, true), ScriptTransfer(i.caller, (NewfsTNToUser - FeesCharged), fsTNAssetID), ScriptTransfer(IssuefsTNFeeAddress, FeesCharged, fsTNAssetID)] | |
27 | 26 | } | |
28 | 27 | ||
29 | 28 |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 4 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let fsTNAssetID = base58'BhWVeP6JGPGvzHtLa4r6Hypuyx4kKyPXC6sFnW3gzNhX' | |
5 | 5 | ||
6 | 6 | let IssuefsTNFeeAddress = addressFromPublicKey(base58'GKmJ6BchUgQfwKp4mp5eX8Y9xLioYRm6e1gDfFgdAcCr') | |
7 | 7 | ||
8 | 8 | @Callable(i) | |
9 | 9 | func IssuefsTN () = { | |
10 | 10 | let pmt = value(i.payments[0]) | |
11 | 11 | let currentKey = toBase58String(i.caller.bytes) | |
12 | 12 | let PricePerfsTN = getIntegerValue(this, "fsTN/TN") | |
13 | 13 | let NewfsTNToUser = fraction(100000, pmt.amount, PricePerfsTN) | |
14 | 14 | let PreviousIssuedfsTN = getIntegerValue(this, "Total_Issued_fsTN:") | |
15 | 15 | let TotalIssuedfsTN = (PreviousIssuedfsTN + NewfsTNToUser) | |
16 | 16 | let PreviousfsTNReserveValue = getIntegerValue(this, "Total_fsTN_Reserve_In_TN:") | |
17 | 17 | let fsTNReserveValue = (PreviousfsTNReserveValue + pmt.amount) | |
18 | 18 | let PreviousfsTNBackupPrice = getIntegerValue(this, "fsTN_Backup_Value_In_TN:") | |
19 | 19 | let fsTNBackupPrice = fraction(100000, fsTNReserveValue, TotalIssuedfsTN) | |
20 | - | let FeePercentage = 1 | |
21 | - | let BalanceTokensReturnedToUser = (100 - FeePercentage) | |
20 | + | let FeesCharged = 100000000 | |
22 | 21 | if (isDefined(pmt.assetId)) | |
23 | 22 | then throw("Incorrect asset attached, please attach TN.") | |
24 | - | else if (( | |
25 | - | then throw("Please Attach minimum | |
26 | - | else [IntegerEntry("Total_Issued_fsTN:", TotalIssuedfsTN), IntegerEntry("Total_fsTN_Reserve_In_TN:", fsTNReserveValue), IntegerEntry("fsTN_Backup_Value_In_TN:", fsTNBackupPrice), StringEntry("message", "<h1>fsTN Issued Successfully!</h1><br>"), Reissue(fsTNAssetID, NewfsTNToUser, true), ScriptTransfer(i.caller, ( | |
23 | + | else if ((200000000 > pmt.amount)) | |
24 | + | then throw("Please Attach minimum 2 TN To Issue fsTN Asset.") | |
25 | + | else [IntegerEntry("Total_Issued_fsTN:", TotalIssuedfsTN), IntegerEntry("Total_fsTN_Reserve_In_TN:", fsTNReserveValue), IntegerEntry("fsTN_Backup_Value_In_TN:", fsTNBackupPrice), StringEntry("message", "<h1>fsTN Issued Successfully!</h1><br>"), Reissue(fsTNAssetID, NewfsTNToUser, true), ScriptTransfer(i.caller, (NewfsTNToUser - FeesCharged), fsTNAssetID), ScriptTransfer(IssuefsTNFeeAddress, FeesCharged, fsTNAssetID)] | |
27 | 26 | } | |
28 | 27 | ||
29 | 28 | ||
30 | 29 | ||
31 | 30 | @Callable(i) | |
32 | 31 | func Liquidate () = { | |
33 | 32 | let currentKey = toBase58String(i.callerPublicKey) | |
34 | 33 | let pmt = value(i.payments[0]) | |
35 | 34 | let PreviousIssuedfsTN = getIntegerValue(this, "Total_Issued_fsTN:") | |
36 | 35 | let TotalIssuedfsTN = (PreviousIssuedfsTN - pmt.amount) | |
37 | 36 | let PreviousfsTNReserveValue = getIntegerValue(this, "Total_fsTN_Reserve_In_TN:") | |
38 | 37 | let PreviousfsTNBackupPrice = getIntegerValue(this, "fsTN_Backup_Value_In_TN:") | |
39 | 38 | let calculateburnvalue = fraction(PreviousfsTNBackupPrice, pmt.amount, 100000) | |
40 | 39 | let fsTNReserveValue = (PreviousfsTNReserveValue - calculateburnvalue) | |
41 | 40 | let fsTNBackupPrice = fraction(100000, fsTNReserveValue, TotalIssuedfsTN) | |
42 | 41 | if ((pmt.assetId != fsTNAssetID)) | |
43 | 42 | then throw((("Kindly Deposit Only " + toBase58String(fsTNAssetID)) + " (fsTN).")) | |
44 | 43 | else if ((100000 > pmt.amount)) | |
45 | 44 | then throw("Attach Amount must be greater than 0.001 fsTN.") | |
46 | 45 | else [Burn(fsTNAssetID, pmt.amount), IntegerEntry("Total_Issued_fsTN:", TotalIssuedfsTN), IntegerEntry("Total_fsTN_Reserve_In_TN:", fsTNReserveValue), IntegerEntry("fsTN_Backup_Value_In_TN:", fsTNBackupPrice), StringEntry("message", "<h1>fsTN Liquidated Successfully!</h1><br>"), ScriptTransfer(i.caller, calculateburnvalue, unit)] | |
47 | 46 | } | |
48 | 47 | ||
49 | 48 | ||
50 | 49 | @Verifier(tx) | |
51 | 50 | func verify () = match tx { | |
52 | 51 | case _ => | |
53 | 52 | sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey) | |
54 | 53 | } | |
55 | 54 |
github/deemru/w8io/026f985 24.55 ms ◑