11 | | - | let PricePerBallet = getIntegerValue(this, "BALLET/TN") |
---|
12 | | - | let NewBalletToUser = fraction(100000, pmt.amount, PricePerBallet) |
---|
13 | | - | let PreviousIssuedBallet = getIntegerValue(this, "Total_Issued_Ballet:") |
---|
14 | | - | let TotalIssuedBallet = (PreviousIssuedBallet + NewBalletToUser) |
---|
15 | | - | let PreviousBalletReserveValue = getIntegerValue(this, "Total_Ballet_Reserve_In_TN:") |
---|
16 | | - | let BalletReserveValue = (PreviousBalletReserveValue + pmt.amount) |
---|
17 | | - | let PreviousBalletBackupPrice = getIntegerValue(this, "Ballet_Backup_Value_In_TN:") |
---|
18 | | - | let BalletBackupPrice = fraction(100000, BalletReserveValue, TotalIssuedBallet) |
---|
19 | | - | let FeeAddress = base58'8d4zGuTjT3h67Z4DatzMXdXXW1GvoQhMTjwCGFxJuene' |
---|
20 | | - | if (isDefined(pmt.assetId)) |
---|
21 | | - | then throw("Incorrect asset attached, please attach TN.") |
---|
22 | | - | else if ((5000000 > pmt.amount)) |
---|
23 | | - | then throw("Please Attach minimum 0.05 TN To Issue Ballet Asset.") |
---|
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 | | - | } |
---|
26 | | - | |
---|
27 | | - | |
---|
28 | | - | |
---|
29 | | - | @Callable(i) |
---|
30 | | - | func Liquidate () = { |
---|
31 | | - | let currentKey = toBase58String(i.callerPublicKey) |
---|
32 | | - | let pmt = value(i.payments[0]) |
---|
33 | | - | let BalletAssetID = base58'44Mq8KqUhM94t93MiBq3S22iiuGczMxpKmse5dBy2w5y' |
---|
34 | | - | let PreviousIssuedBallet = getIntegerValue(this, "Total_Issued_Ballet:") |
---|
35 | | - | let TotalIssuedBallet = (PreviousIssuedBallet - pmt.amount) |
---|
36 | | - | let PreviousBalletReserveValue = getIntegerValue(this, "Total_Ballet_Reserve_In_TN:") |
---|
37 | | - | let PreviousBalletBackupPrice = getIntegerValue(this, "Ballet_Backup_Value_In_TN:") |
---|
38 | | - | let calculateburnvalue = fraction(PreviousBalletBackupPrice, pmt.amount, 100000) |
---|
39 | | - | let BalletReserveValue = (PreviousBalletReserveValue - calculateburnvalue) |
---|
40 | | - | let BalletBackupPrice = fraction(100000, BalletReserveValue, TotalIssuedBallet) |
---|
41 | | - | if ((pmt.assetId != BalletAssetID)) |
---|
42 | | - | then throw("Kindly Deposit Only 44Mq8KqUhM94t93MiBq3S22iiuGczMxpKmse5dBy2w5y (Ballet).") |
---|
43 | | - | else if ((100000 > pmt.amount)) |
---|
44 | | - | then throw("Attach Amount must be greater than 0.001 Ballet.") |
---|
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)] |
---|
| 17 | + | let USDTAssetID = base58'7RB3BWayeCVPq3kkpkeJZAFv2DYCB5gEwnutEpRofaw4' |
---|
| 18 | + | let VotingPairExist = checkVotingPair(AssetID1) |
---|
| 19 | + | if ((VotingPairExist != "NONE")) |
---|
| 20 | + | then throw("This Voting Pair already Exist") |
---|
| 21 | + | else if ((size(AssetID1) > 44)) |
---|
| 22 | + | then throw("Wrong AssetID1 is Entered for Voting. Please Enter a Valid AssetID1") |
---|
| 23 | + | else if ((pmt.assetId != BalletAssetID)) |
---|
| 24 | + | then throw("Incorrect asset attached for Voting, please attach Ballet Token only.") |
---|
| 25 | + | else { |
---|
| 26 | + | let currentKey = toBase58String(i.caller.bytes) |
---|
| 27 | + | ScriptResult(WriteSet(nil), TransferSet(nil)) |
---|
| 28 | + | } |
---|