tx · ARdfPBYdCpUnJCCJQcAWmgPUcP7wDjS1ELof96dPRULV 3Mrnje6z2xa3xuXyU2Lk6ynKy8tsRnnt4Bv: -0.01400000 Waves 2021.08.09 10:01 [1650474] smart account 3Mrnje6z2xa3xuXyU2Lk6ynKy8tsRnnt4Bv > SELF 0.00000000 Waves
{ "type": 13, "id": "ARdfPBYdCpUnJCCJQcAWmgPUcP7wDjS1ELof96dPRULV", "fee": 1400000, "feeAssetId": null, "timestamp": 1628492540034, "version": 2, "chainId": 84, "sender": "3Mrnje6z2xa3xuXyU2Lk6ynKy8tsRnnt4Bv", "senderPublicKey": "28sGn7FYnmxceAmnGYiDiKuMK1QyXiqX8zQXfKDnrc8t", "proofs": [ "5BGXyeAeboo1gi7m7AT4h8m9SguKEZyheZrNdS3qJw8MyJ5QHDtf6HKEJJh1pMGBMrjiUfUW277wqeS59N99L3Gd" ], "script": "base64:AAIEAAAAAAAAAAYIAhIAEgAAAAAAAAAAAgAAAAFpAQAAAAtJc3N1ZUJhbGxldAAAAAAEAAAAA3BtdAkBAAAABXZhbHVlAAAAAQkAAZEAAAACCAUAAAABaQAAAAhwYXltZW50cwAAAAAAAAAAAAQAAAAKY3VycmVudEtleQkAAlgAAAABCAgFAAAAAWkAAAAGY2FsbGVyAAAABWJ5dGVzBAAAAA1CYWxsZXRBc3NldElEAQAAACAtb1sBuZ3lSm8ahGink+4TF5YYAu/xRHYwe1h195OooAQAAAAOUHJpY2VQZXJCYWxsZXQJAQAAABFAZXh0ck5hdGl2ZSgxMDUwKQAAAAIFAAAABHRoaXMCAAAACUJBTExFVC9UTgQAAAAPTmV3QmFsbGV0VG9Vc2VyCQAAawAAAAMAAAAAAAABhqAIBQAAAANwbXQAAAAGYW1vdW50BQAAAA5QcmljZVBlckJhbGxldAQAAAAUUHJldmlvdXNJc3N1ZWRCYWxsZXQJAQAAABFAZXh0ck5hdGl2ZSgxMDUwKQAAAAIFAAAABHRoaXMCAAAAFFRvdGFsX0lzc3VlZF9CYWx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AADUJhbGxldEFzc2V0SUQIBQAAAANwbXQAAAAGYW1vdW50CQAETAAAAAIJAQAAAAxJbnRlZ2VyRW50cnkAAAACAgAAABRUb3RhbF9Jc3N1ZWRfQmFsbGV0OgUAAAARVG90YWxJc3N1ZWRCYWxsZXQJAARMAAAAAgkBAAAADEludGVnZXJFbnRyeQAAAAICAAAAG1RvdGFsX0JhbGxldF9SZXNlcnZlX0luX1ROOgUAAAASQmFsbGV0UmVzZXJ2ZVZhbHVlCQAETAAAAAIJAQAAAAxJbnRlZ2VyRW50cnkAAAACAgAAABpCYWxsZXRfQmFja3VwX1ZhbHVlX0luX1ROOgUAAAARQmFsbGV0QmFja3VwUHJpY2UJAARMAAAAAgkBAAAADlNjcmlwdFRyYW5zZmVyAAAAAwgFAAAAAWkAAAAGY2FsbGVyBQAAABJjYWxjdWxhdGVidXJudmFsdWUFAAAABHVuaXQFAAAAA25pbAAAAAEAAAACdHgBAAAABnZlcmlmeQAAAAAJAAH0AAAAAwgFAAAAAnR4AAAACWJvZHlCeXRlcwkAAZEAAAACCAUAAAACdHgAAAAGcHJvb2ZzAAAAAAAAAAAACAUAAAACdHgAAAAPc2VuZGVyUHVibGljS2V5JG6jqg==", "height": 1650474, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 4uAYGdnBbVjFBhwQtubB72mofsuoByC7HJUgMGEdEV4F Next: BnD6je8YQg5BCFX5tegRxjZWkmgqLX8Y5x68W6Y2UmE2 Diff:
Old | New | Differences | |
---|---|---|---|
9 | 9 | let currentKey = toBase58String(i.caller.bytes) | |
10 | 10 | let BalletAssetID = base58'44Mq8KqUhM94t93MiBq3S22iiuGczMxpKmse5dBy2w5y' | |
11 | 11 | let PricePerBallet = getIntegerValue(this, "BALLET/TN") | |
12 | - | let NewBalletToUser = fraction( | |
12 | + | let NewBalletToUser = fraction(100000, pmt.amount, PricePerBallet) | |
13 | 13 | let PreviousIssuedBallet = getIntegerValue(this, "Total_Issued_Ballet:") | |
14 | 14 | let TotalIssuedBallet = (PreviousIssuedBallet + NewBalletToUser) | |
15 | 15 | let PreviousBalletReserveValue = getIntegerValue(this, "Total_Ballet_Reserve_In_TN:") | |
16 | 16 | let BalletReserveValue = (PreviousBalletReserveValue + pmt.amount) | |
17 | 17 | let PreviousBalletBackupPrice = getIntegerValue(this, "Ballet_Backup_Value_In_TN:") | |
18 | - | let BalletBackupPrice = fraction( | |
18 | + | let BalletBackupPrice = fraction(100000, BalletReserveValue, TotalIssuedBallet) | |
19 | 19 | let FeeAddress = base58'8d4zGuTjT3h67Z4DatzMXdXXW1GvoQhMTjwCGFxJuene' | |
20 | 20 | if (isDefined(pmt.assetId)) | |
21 | 21 | then throw("Incorrect asset attached, please attach TN.") | |
35 | 35 | let TotalIssuedBallet = (PreviousIssuedBallet - pmt.amount) | |
36 | 36 | let PreviousBalletReserveValue = getIntegerValue(this, "Total_Ballet_Reserve_In_TN:") | |
37 | 37 | let PreviousBalletBackupPrice = getIntegerValue(this, "Ballet_Backup_Value_In_TN:") | |
38 | - | let calculateburnvalue = fraction(PreviousBalletBackupPrice, pmt.amount, | |
38 | + | let calculateburnvalue = fraction(PreviousBalletBackupPrice, pmt.amount, 100000) | |
39 | 39 | let BalletReserveValue = (PreviousBalletReserveValue - calculateburnvalue) | |
40 | - | let BalletBackupPrice = fraction( | |
40 | + | let BalletBackupPrice = fraction(100000, BalletReserveValue, TotalIssuedBallet) | |
41 | 41 | if ((pmt.assetId != BalletAssetID)) | |
42 | 42 | then throw("Kindly Deposit Only 44Mq8KqUhM94t93MiBq3S22iiuGczMxpKmse5dBy2w5y (Ballet).") | |
43 | 43 | else if ((100000 > pmt.amount)) |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 4 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | ||
5 | 5 | ||
6 | 6 | @Callable(i) | |
7 | 7 | func IssueBallet () = { | |
8 | 8 | let pmt = value(i.payments[0]) | |
9 | 9 | let currentKey = toBase58String(i.caller.bytes) | |
10 | 10 | let BalletAssetID = base58'44Mq8KqUhM94t93MiBq3S22iiuGczMxpKmse5dBy2w5y' | |
11 | 11 | let PricePerBallet = getIntegerValue(this, "BALLET/TN") | |
12 | - | let NewBalletToUser = fraction( | |
12 | + | let NewBalletToUser = fraction(100000, pmt.amount, PricePerBallet) | |
13 | 13 | let PreviousIssuedBallet = getIntegerValue(this, "Total_Issued_Ballet:") | |
14 | 14 | let TotalIssuedBallet = (PreviousIssuedBallet + NewBalletToUser) | |
15 | 15 | let PreviousBalletReserveValue = getIntegerValue(this, "Total_Ballet_Reserve_In_TN:") | |
16 | 16 | let BalletReserveValue = (PreviousBalletReserveValue + pmt.amount) | |
17 | 17 | let PreviousBalletBackupPrice = getIntegerValue(this, "Ballet_Backup_Value_In_TN:") | |
18 | - | let BalletBackupPrice = fraction( | |
18 | + | let BalletBackupPrice = fraction(100000, BalletReserveValue, TotalIssuedBallet) | |
19 | 19 | let FeeAddress = base58'8d4zGuTjT3h67Z4DatzMXdXXW1GvoQhMTjwCGFxJuene' | |
20 | 20 | if (isDefined(pmt.assetId)) | |
21 | 21 | then throw("Incorrect asset attached, please attach TN.") | |
22 | 22 | else if ((5000000 > pmt.amount)) | |
23 | 23 | then throw("Please Attach minimum 0.05 TN To Issue Ballet Asset.") | |
24 | 24 | else [IntegerEntry("Total_Issued_Ballet:", TotalIssuedBallet), IntegerEntry("Total_Ballet_Reserve_In_TN:", BalletReserveValue), IntegerEntry("Ballet_Backup_Value_In_TN:", BalletBackupPrice), StringEntry("message", "<h1>Ballet Issued Successfully!</h1><br>"), Reissue(BalletAssetID, NewBalletToUser, true), ScriptTransfer(i.caller, ((NewBalletToUser * 99) / 100), BalletAssetID), ScriptTransfer(addressFromPublicKey(FeeAddress), ((NewBalletToUser * 1) / 100), BalletAssetID)] | |
25 | 25 | } | |
26 | 26 | ||
27 | 27 | ||
28 | 28 | ||
29 | 29 | @Callable(i) | |
30 | 30 | func Liquidate () = { | |
31 | 31 | let currentKey = toBase58String(i.callerPublicKey) | |
32 | 32 | let pmt = value(i.payments[0]) | |
33 | 33 | let BalletAssetID = base58'44Mq8KqUhM94t93MiBq3S22iiuGczMxpKmse5dBy2w5y' | |
34 | 34 | let PreviousIssuedBallet = getIntegerValue(this, "Total_Issued_Ballet:") | |
35 | 35 | let TotalIssuedBallet = (PreviousIssuedBallet - pmt.amount) | |
36 | 36 | let PreviousBalletReserveValue = getIntegerValue(this, "Total_Ballet_Reserve_In_TN:") | |
37 | 37 | let PreviousBalletBackupPrice = getIntegerValue(this, "Ballet_Backup_Value_In_TN:") | |
38 | - | let calculateburnvalue = fraction(PreviousBalletBackupPrice, pmt.amount, | |
38 | + | let calculateburnvalue = fraction(PreviousBalletBackupPrice, pmt.amount, 100000) | |
39 | 39 | let BalletReserveValue = (PreviousBalletReserveValue - calculateburnvalue) | |
40 | - | let BalletBackupPrice = fraction( | |
40 | + | let BalletBackupPrice = fraction(100000, BalletReserveValue, TotalIssuedBallet) | |
41 | 41 | if ((pmt.assetId != BalletAssetID)) | |
42 | 42 | then throw("Kindly Deposit Only 44Mq8KqUhM94t93MiBq3S22iiuGczMxpKmse5dBy2w5y (Ballet).") | |
43 | 43 | else if ((100000 > pmt.amount)) | |
44 | 44 | then throw("Attach Amount must be greater than 0.001 Ballet.") | |
45 | 45 | else [Burn(BalletAssetID, pmt.amount), IntegerEntry("Total_Issued_Ballet:", TotalIssuedBallet), IntegerEntry("Total_Ballet_Reserve_In_TN:", BalletReserveValue), IntegerEntry("Ballet_Backup_Value_In_TN:", BalletBackupPrice), ScriptTransfer(i.caller, calculateburnvalue, unit)] | |
46 | 46 | } | |
47 | 47 | ||
48 | 48 | ||
49 | 49 | @Verifier(tx) | |
50 | 50 | func verify () = sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey) | |
51 | 51 |
github/deemru/w8io/169f3d6 29.86 ms ◑