tx · 9jr8QPwJ3orWdvsudhczG1Q1oUBFPJrcaQg5ZyerP6jq

3N8iygiXd1v34PPaMSQb34SSrBwGxT2DpGK:  -0.01400000 Waves

2022.08.15 00:56 [2184712] smart account 3N8iygiXd1v34PPaMSQb34SSrBwGxT2DpGK > SELF 0.00000000 Waves

{ "type": 13, "id": "9jr8QPwJ3orWdvsudhczG1Q1oUBFPJrcaQg5ZyerP6jq", "fee": 1400000, "feeAssetId": null, "timestamp": 1660514258818, "version": 2, "chainId": 84, "sender": "3N8iygiXd1v34PPaMSQb34SSrBwGxT2DpGK", "senderPublicKey": "FshLkkgzcLs6iQJ1Z8Nnfhm494tC8xZQczf9iXpZep3Y", "proofs": [ "3o1u3DiKF9zCbZGyc1wBQLYpwuUSbju1W12RCvTs45abBzNs78f7giGJaBzJ5p2fwrcBCJuSyE4DNxZRHUHeVryA" ], "script": "base64:AAIFAAAAAAAAAAYIAhIAEgAAAAAFAAAAAApCVENBc3NldElEAQAAACD0NPJEoKaVcLA62QAal819hhYdQl83FUDxF7HRh6LUlwAAAAALU0FUU0Fzc2V0SUQBAAAAIIQVHLyAa6peOQxN4R+aXTT73bjvUy7OZLsC9igQULD7AAAAABNJc3N1ZWZzVE5GZWVBZGRyZXNzCQEAAAAUYWRkcmVzc0Zyb21QdWJsaWNLZXkAAAABAQAAACBSg9mgi9eQkjsz5eBARHIbc7Hg/F4fmB0sxZ6ySMfiIAAAAAAEdHhucwQAAAAHJG1hdGNoMAkABBoAAAACBQAAAAR0aGlzAgAAAAlUb3RhbHR4bnMDCQAAAQAAAAIFAAAAByRtYXRjaDACAAAAA0ludAQAAAABYQUAAAAHJG1hdGNoMAUAAAABYQAAAAAAAAAAAAAAAAAJdG90YWx0eG5zCQAAZAAAAAIFAAAABHR4bnMAAAAAAAAAAAEAAAACAAAAAWkBAAAACUlzc3VlU0FUUwAAAAAEAAAAA3BtdAMJAAAAAAAAAgkAAZAAAAABCAUAAAABaQAAAAhwYXltZW50cwAAAAAAAAAAA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AAIBQAAAAJ0eAAAAA9zZW5kZXJQdWJsaWNLZXlx0f7L", "height": 2184712, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: DZQZVvEbYi7dnp5eoRJZcGNaT257X8oHjoMRxb3UhSoX Next: DTuE8qFTa4S12zaMdkw3uvG61z74N2FA4Sa398P5EU3b Diff:
OldNewDifferences
2222 then i.payments[0]
2323 else throw((("No Payments attached please attach [BTC] - " + toBase58String(BTCAssetID)) + " Asset Only."))
2424 let currentKey = toBase58String(i.caller.bytes)
25- let PricePerSATS = getIntegerValue(this, "SATS/BTC")
26- let SATSCurrentCap = getIntegerValue(this, "SATSCurrentCap")
27- let NewSATSToUser = fraction(100000000, pmt.amount, PricePerSATS)
25+ let NewSATSToUser = fraction(1000000, pmt.amount, 1)
2826 let PreviousIssuedSATS = getIntegerValue(this, "Total_Issued_SATS:")
2927 let TotalIssuedSATS = (PreviousIssuedSATS + NewSATSToUser)
30- let PendingMinting = (SATSCurrentCap - TotalIssuedSATS)
31- let PreviousSATSReserveValue = getIntegerValue(this, "Total_SATS_Reserve_In_BTC:")
32- let fee = match getInteger(this, "Total_Fee_Collected") {
33- case a: Int =>
34- a
35- case _ =>
36- 0
37- }
3828 let FeesCharged = 1000000
39- let totalfeecollected = (fee + FeesCharged)
40- let SATSReserveValue = (PreviousSATSReserveValue + pmt.amount)
41- let PreviousSATSBackupPrice = getIntegerValue(this, "SATS_Backup_Value_In_BTC:")
42- let SATSBackupPrice = fraction(100000000, SATSReserveValue, TotalIssuedSATS)
4329 if ((pmt.assetId != BTCAssetID))
4430 then throw((("Incorrect asset attached, please attach [BTC] - " + toBase58String(BTCAssetID)) + " only."))
4531 else if ((5000 > pmt.amount))
4632 then throw("Please Attach minimum 5000 Satoshi's To Issue SATS Asset.")
47- else if ((TotalIssuedSATS > SATSCurrentCap))
48- then throw((((((("SATS Minting is about to reach the Cap of " + toString(SATSCurrentCap)) + "/10^6 SATS. Please Reduce your Minting Order by ") + toString(PendingMinting)) + " or put ") + toString((SATSCurrentCap - PreviousIssuedSATS))) + "/10^6"))
49- else [IntegerEntry("Total_Issued_SATS:", TotalIssuedSATS), IntegerEntry("Balance_Minting_SATS:", PendingMinting), IntegerEntry("Total_SATS_Reserve_In_BTC:", SATSReserveValue), IntegerEntry("SATS_Backup_Value_In_BTC:", SATSBackupPrice), IntegerEntry("Total_Fee_Collected", totalfeecollected), IntegerEntry("Totaltxns", totaltxns), StringEntry("message", "<h1>SATS Issued Successfully!</h1><br>"), Reissue(SATSAssetID, NewSATSToUser, true), ScriptTransfer(i.caller, (NewSATSToUser - FeesCharged), SATSAssetID), ScriptTransfer(IssuefsTNFeeAddress, FeesCharged, SATSAssetID)]
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(IssuefsTNFeeAddress, FeesCharged, SATSAssetID)]
5034 }
5135
5236
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 5 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 let BTCAssetID = base58'HSHJecCLGF7DEPA23dJe6WwroaLeDnik5eptjxEJYvwY'
55
66 let SATSAssetID = base58'9tbVJFXNxWGtZefTnuH9yojcYEPHwXGxhDvY4UK4qf2z'
77
88 let IssuefsTNFeeAddress = addressFromPublicKey(base58'6Z73KxcX3sugpiStpSRXxKxTmWqCaLVwFeM6kwyiKVDR')
99
1010 let txns = match getInteger(this, "Totaltxns") {
1111 case a: Int =>
1212 a
1313 case _ =>
1414 0
1515 }
1616
1717 let totaltxns = (txns + 1)
1818
1919 @Callable(i)
2020 func IssueSATS () = {
2121 let pmt = if ((size(i.payments) == 1))
2222 then i.payments[0]
2323 else throw((("No Payments attached please attach [BTC] - " + toBase58String(BTCAssetID)) + " Asset Only."))
2424 let currentKey = toBase58String(i.caller.bytes)
25- let PricePerSATS = getIntegerValue(this, "SATS/BTC")
26- let SATSCurrentCap = getIntegerValue(this, "SATSCurrentCap")
27- let NewSATSToUser = fraction(100000000, pmt.amount, PricePerSATS)
25+ let NewSATSToUser = fraction(1000000, pmt.amount, 1)
2826 let PreviousIssuedSATS = getIntegerValue(this, "Total_Issued_SATS:")
2927 let TotalIssuedSATS = (PreviousIssuedSATS + NewSATSToUser)
30- let PendingMinting = (SATSCurrentCap - TotalIssuedSATS)
31- let PreviousSATSReserveValue = getIntegerValue(this, "Total_SATS_Reserve_In_BTC:")
32- let fee = match getInteger(this, "Total_Fee_Collected") {
33- case a: Int =>
34- a
35- case _ =>
36- 0
37- }
3828 let FeesCharged = 1000000
39- let totalfeecollected = (fee + FeesCharged)
40- let SATSReserveValue = (PreviousSATSReserveValue + pmt.amount)
41- let PreviousSATSBackupPrice = getIntegerValue(this, "SATS_Backup_Value_In_BTC:")
42- let SATSBackupPrice = fraction(100000000, SATSReserveValue, TotalIssuedSATS)
4329 if ((pmt.assetId != BTCAssetID))
4430 then throw((("Incorrect asset attached, please attach [BTC] - " + toBase58String(BTCAssetID)) + " only."))
4531 else if ((5000 > pmt.amount))
4632 then throw("Please Attach minimum 5000 Satoshi's To Issue SATS Asset.")
47- else if ((TotalIssuedSATS > SATSCurrentCap))
48- then throw((((((("SATS Minting is about to reach the Cap of " + toString(SATSCurrentCap)) + "/10^6 SATS. Please Reduce your Minting Order by ") + toString(PendingMinting)) + " or put ") + toString((SATSCurrentCap - PreviousIssuedSATS))) + "/10^6"))
49- else [IntegerEntry("Total_Issued_SATS:", TotalIssuedSATS), IntegerEntry("Balance_Minting_SATS:", PendingMinting), IntegerEntry("Total_SATS_Reserve_In_BTC:", SATSReserveValue), IntegerEntry("SATS_Backup_Value_In_BTC:", SATSBackupPrice), IntegerEntry("Total_Fee_Collected", totalfeecollected), IntegerEntry("Totaltxns", totaltxns), StringEntry("message", "<h1>SATS Issued Successfully!</h1><br>"), Reissue(SATSAssetID, NewSATSToUser, true), ScriptTransfer(i.caller, (NewSATSToUser - FeesCharged), SATSAssetID), ScriptTransfer(IssuefsTNFeeAddress, FeesCharged, SATSAssetID)]
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(IssuefsTNFeeAddress, FeesCharged, SATSAssetID)]
5034 }
5135
5236
5337
5438 @Callable(i)
5539 func Liquidate () = {
5640 let currentKey = toBase58String(i.callerPublicKey)
5741 let pmt = value(i.payments[0])
5842 let PreviousIssuedSATS = getIntegerValue(this, "Total_Issued_SATS:")
5943 let PreviousBurnedSATS = getIntegerValue(this, "Total_Burned_SATS:")
6044 let SATSCurrentCap = getIntegerValue(this, "SATSCurrentCap")
6145 let TotalIssuedSATS = (PreviousIssuedSATS - pmt.amount)
6246 let TotalBurnedSATS = (PreviousBurnedSATS + pmt.amount)
6347 let PendingMinting = (SATSCurrentCap - TotalIssuedSATS)
6448 let PreviousSATSReserveValue = getIntegerValue(this, "Total_SATS_Reserve_In_BTC:")
6549 let PreviousSATSBackupPrice = getIntegerValue(this, "SATS_Backup_Value_In_BTC:")
6650 let calculateburnvalue = fraction(PreviousSATSBackupPrice, pmt.amount, 100000)
6751 let SATSReserveValue = (PreviousSATSReserveValue - calculateburnvalue)
6852 let SATSBackupPrice = fraction(100000000, SATSReserveValue, TotalIssuedSATS)
6953 if ((pmt.assetId != SATSAssetID))
7054 then throw((("Kindly Deposit Only " + toBase58String(SATSAssetID)) + " [SATS]."))
7155 else if ((5000 > pmt.amount))
7256 then throw("Attach Amount must be greater than 5000 SATS.")
7357 else [Burn(SATSAssetID, pmt.amount), IntegerEntry("Totaltxns", totaltxns), IntegerEntry("Total_Issued_SATS:", TotalIssuedSATS), IntegerEntry("Total_Burned_SATS:", TotalBurnedSATS), IntegerEntry("Balance_Minting_SATS:", PendingMinting), IntegerEntry("Total_SATS_Reserve_In_BTC:", SATSReserveValue), IntegerEntry("SATS_Backup_Value_In_BTC:", SATSBackupPrice), StringEntry("message", "<h1>SATS Liquidated Successfully!</h1><br>"), ScriptTransfer(i.caller, calculateburnvalue, BTCAssetID)]
7458 }
7559
7660
7761 @Verifier(tx)
7862 func verify () = match tx {
7963 case _ =>
8064 sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey)
8165 }
8266

github/deemru/w8io/169f3d6 
26.61 ms