6 | | - | let b = base58'5bXgvADuVoFdhtF5uKZAEiVdAo7ZCWw151L4yyf1PiES' |
---|
7 | | - | |
---|
8 | | - | let c = base58'EzwaF58ssALcUCZ9FbyeD1GTSteoZAQZEDTqBAXHfq8y' |
---|
9 | | - | |
---|
10 | | - | let d = base58'EB4CUQH4fHzzQt9YjcHtA6T7uosHNH9RnQKHgBdZHPCB' |
---|
11 | | - | |
---|
12 | | - | let e = base58'6Z73KxcX3sugpiStpSRXxKxTmWqCaLVwFeM6kwyiKVDR' |
---|
13 | | - | |
---|
14 | | - | let f = base58'8d4zGuTjT3h67Z4DatzMXdXXW1GvoQhMTjwCGFxJuene' |
---|
15 | | - | |
---|
16 | | - | let g = base58'J3cAptAPQxVqpEz6Rch57JeKpbns48s1a6HoeQG9aX4J' |
---|
17 | | - | |
---|
18 | | - | let h = base58'8d4zGuTjT3h67Z4DatzMXdXXW1GvoQhMTjwCGFxJuene' |
---|
19 | | - | |
---|
20 | | - | let i = base58'3EeUjFz9BEjsqDnCjw5UeuZsjBTuKBQmbCiAw53phxrR' |
---|
21 | | - | |
---|
22 | | - | @Callable(j) |
---|
23 | | - | func Liquidate () = { |
---|
24 | | - | let k = toBase58String(j.callerPublicKey) |
---|
25 | | - | let l = value(j.payments[0]) |
---|
26 | | - | let m = getIntegerValue(this, "Total_Issued_A4A:") |
---|
27 | | - | let n = getIntegerValue(this, "Total_Burned_A4A:") |
---|
28 | | - | let o = (m - l.amount) |
---|
29 | | - | let p = (n + l.amount) |
---|
30 | | - | let q = getIntegerValue(this, "Total_A4A_Reserve_In_TN:") |
---|
31 | | - | let r = getIntegerValue(this, "A4A_Backup_Value_In_TN:") |
---|
32 | | - | let s = fraction(r, l.amount, 100000) |
---|
33 | | - | let t = (q - s) |
---|
34 | | - | let u = fraction(100000, t, o) |
---|
35 | | - | if ((l.assetId != a)) |
---|
36 | | - | then throw("Kindly Deposit Only 8hdsVCxPBVEmVUZyyX8Sd98Z9hU7Fny26W96sjKiTw8g (A4A).") |
---|
37 | | - | else if ((100000 > l.amount)) |
---|
38 | | - | then throw("Attach Amount must be greater than 0.001 A4A.") |
---|
39 | | - | else [Burn(a, l.amount), IntegerEntry("Total_Issued_A4A:", o), IntegerEntry("Total_Burned_A4A:", p), IntegerEntry("Total_A4A_Reserve_In_TN:", t), IntegerEntry("A4A_Backup_Value_In_TN:", u), StringEntry("message", "<h1>A4A Liquidated Successfully!</h1><br>"), ScriptTransfer(j.caller, ((s * 990) / 1000), unit), ScriptTransfer(addressFromPublicKey(e), ((s * 9) / 1000), unit), ScriptTransfer(addressFromPublicKey(f), ((s * 1) / 1000), unit)] |
---|
| 6 | + | @Callable(b) |
---|
| 7 | + | func Issue_SWRM () = { |
---|
| 8 | + | let c = Issue("SWRM", "SWRM is a decentralized approach to building and utilizing the Reddcoin Blockchain Technology where SWRM works on a reserve system of RDD as layer solution on RDD Network to mint and Burn SWRM on both side as a proof. An independent project or Token having no direct partnership relation or development connection with Reddcoin Core Team outside the use of the RDD currency for transactions.", 1, 6, true) |
---|
| 9 | + | let d = calculateAssetId(c) |
---|
| 10 | + | if ((b.caller != a)) |
---|
| 11 | + | then throw((("This Address is not Authorized. Only " + toString(a)) + " is Authorized Address to Sign it.")) |
---|
| 12 | + | else [c, Burn(d, 1), StringEntry("SWRM_Asset_ID", toBase58String(d))] |
---|
43 | | - | |
---|
44 | | - | @Callable(j) |
---|
45 | | - | func Withdraw () = { |
---|
46 | | - | let k = toBase58String(j.caller.bytes) |
---|
47 | | - | let v = getIntegerValue(this, ("Deposit_Amount_Of_" + k)) |
---|
48 | | - | let w = getIntegerValue(this, "Staked_Amount") |
---|
49 | | - | let x = 1000000 |
---|
50 | | - | let y = fraction(v, x, w) |
---|
51 | | - | let z = (w - v) |
---|
52 | | - | let A = (getIntegerValue(this, ("Total_Lock_Blocks_Of_" + k)) - getIntegerValue(this, ("Deposit_height_Of_" + k))) |
---|
53 | | - | let B = { |
---|
54 | | - | let C = getInteger(this, "Total_USDC_Claimed:") |
---|
55 | | - | if ($isInstanceOf(C, "Int")) |
---|
56 | | - | then { |
---|
57 | | - | let D = C |
---|
58 | | - | D |
---|
59 | | - | } |
---|
60 | | - | else 0 |
---|
61 | | - | } |
---|
62 | | - | let E = (B + getIntegerValue(this, ("Rewards_Of_" + k))) |
---|
63 | | - | if ((getIntegerValue(this, ("Total_Lock_Blocks_Of_" + k)) > height)) |
---|
64 | | - | then throw((((("Your " + toString(getIntegerValue(this, ("Deposit_Amount_Of_" + k)))) + " A4A are Under Lock. Consider last 8 digits as value after Decimals. Token will be Unlocked after ") + toString((getIntegerValue(this, ("Total_Lock_Blocks_Of_" + k)) - height))) + " blocks.")) |
---|
65 | | - | else if ((v == 0)) |
---|
66 | | - | then throw("You Have Already Withdraw your Amount.") |
---|
67 | | - | else if (if ((1200000000000 > v)) |
---|
68 | | - | then (A == 129600) |
---|
69 | | - | else false) |
---|
70 | | - | then [ScriptTransfer(j.caller, getIntegerValue(this, ("Deposit_Amount_Of_" + k)), a), ScriptTransfer(j.caller, fraction(assetBalance(this, b), y, x), b), ScriptTransfer(j.caller, fraction(assetBalance(this, c), y, x), c), ScriptTransfer(j.caller, ((v * 3) / 1000), d), StringEntry(("Tier_Of_" + k), "NONE"), IntegerEntry(("Deposit_height_Of_" + k), 0), IntegerEntry("Staked_Amount", z), IntegerEntry(("Deposit_Amount_Of_" + k), 0), IntegerEntry(("Total_Lock_Blocks_Of_" + k), 0), StringEntry(("Lock_Status_Of_" + k), "UNLOCK"), IntegerEntry(("Rewards_Of_" + k), 0), IntegerEntry("Total_USDC_Claimed:", E)] |
---|
71 | | - | else if (if ((v >= 1200000000000)) |
---|
72 | | - | then (A == 129600) |
---|
73 | | - | else false) |
---|
74 | | - | then [ScriptTransfer(j.caller, getIntegerValue(this, ("Deposit_Amount_Of_" + k)), a), ScriptTransfer(j.caller, fraction(assetBalance(this, b), y, x), b), ScriptTransfer(j.caller, fraction(assetBalance(this, c), y, x), c), ScriptTransfer(j.caller, ((1200000000000 * 3) / 1000), d), StringEntry(("Tier_Of_" + k), "NONE"), IntegerEntry(("Deposit_height_Of_" + k), 0), IntegerEntry("Staked_Amount", z), IntegerEntry(("Deposit_Amount_Of_" + k), 0), IntegerEntry(("Total_Lock_Blocks_Of_" + k), 0), StringEntry(("Lock_Status_Of_" + k), "UNLOCK"), IntegerEntry(("Rewards_Of_" + k), 0), IntegerEntry("Total_USDC_Claimed:", E)] |
---|
75 | | - | else [ScriptTransfer(j.caller, getIntegerValue(this, ("Deposit_Amount_Of_" + k)), a), ScriptTransfer(j.caller, fraction(assetBalance(this, b), y, x), b), ScriptTransfer(j.caller, fraction(assetBalance(this, c), y, x), c), StringEntry(("Tier_Of_" + k), "NONE"), IntegerEntry(("Deposit_height_Of_" + k), 0), IntegerEntry("Staked_Amount", z), IntegerEntry(("Deposit_Amount_Of_" + k), 0), IntegerEntry(("Total_Lock_Blocks_Of_" + k), 0), StringEntry(("Lock_Status_Of_" + k), "UNLOCK"), IntegerEntry(("Rewards_Of_" + k), 0), IntegerEntry("Total_USDC_Claimed:", E)] |
---|
76 | | - | } |
---|
77 | | - | |
---|
| 16 | + | @Verifier(e) |
---|
| 17 | + | func f () = sigVerify(e.bodyBytes, e.proofs[0], e.senderPublicKey) |
---|