tx · 42wzerQZueCmxXMhLkK9UkRzUPCYGtEnMWoRonniuMt8 3N34Zi5VD4m9az4kEXWDJngkMHMTpqLcoqo: -0.01400000 Waves 2021.10.14 20:53 [1746269] smart account 3N34Zi5VD4m9az4kEXWDJngkMHMTpqLcoqo > SELF 0.00000000 Waves
{ "type": 13, "id": "42wzerQZueCmxXMhLkK9UkRzUPCYGtEnMWoRonniuMt8", "fee": 1400000, "feeAssetId": null, "timestamp": 1634234062496, "version": 2, "chainId": 84, "sender": "3N34Zi5VD4m9az4kEXWDJngkMHMTpqLcoqo", "senderPublicKey": "AmXrJ1inc5jpKhf6D9aDcRU8QWHZXBJdBBvz9VsKDe9x", "proofs": [ "4jpxrENVQfCHCi46G4DVoiVHmoop28gm6cveE3xGh6SpAfF3G15if7ZJjK3VBYuqKspwLL96fQ9Ufdh6QLZSCTZM" ], "script": "base64:AAIEAAAAAAAAAAkIAhIDCgEBEgAAAAAKAAAAAAtDT0RFQXNzZXRJRAEAAAAgkmB2qfKrqGeDE5s+bUmRW9TL3ErNp4dEODxuXgzu+JEAAAAAC1N0YXJ0SGVpZ2h0AAAAAAAAGqH4AAAAAAZvbmVkYXkAAAAAAAAABaAAAAAAD21pbmltdW1sb2NrZGF5cwAAAAAAAAAABgAAAAAPbWF4aW11bWxvY2tkYXlzAAAAAAAAAAAHAAAAAAlibG9ja2RpZmYJAABlAAAAAgUAAAAGaGVpZ2h0BQAAAAtTdGFydEhlaWdodAAAAAALSW5mbGF0aW9uTm8JAABkAAAAAgkAAGsAAAADAAAAAAJUC+QAAAAAAAAAAAABBQAAAAlibG9ja2RpZmYAAAAAAAAAF3AAAAAAC1N0YWtpbmdEYXBwAQAAACCjtaSeUVhAbk0T+akFnLGoDh+X4aR50o/42ilEuU4EFgAAAAAKRmVlQWRkcmVzcwEAAAAgUoPZoIvXkJI7M+XgQERyG3Ox4PxeH5gdLMWeskjH4iAAAAAACmRldkFkZHJlc3MBAAAAIHE/Oe1BrsJepSkes1ESh96Qyq2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AIJAAEsAAAAAgIAAAAPTG9ja19TdGF0dXNfT2ZfBQAAAApjdXJyZW50S2V5AgAAAAZVTkxPQ0sJAARMAAAAAgkBAAAADEludGVnZXJFbnRyeQAAAAIJAAEsAAAAAgIAAAALUmV3YXJkc19PZl8FAAAACmN1cnJlbnRLZXkAAAAAAAAAAAAJAARMAAAAAgkBAAAADEludGVnZXJFbnRyeQAAAAICAAAAE1RvdGFsX0NPREVfQ2xhaW1lZDoFAAAAEnRvdGFscmV3YXJkY2xhaW1lZAUAAAADbmlsAAAAAQAAAAJ0eAEAAAAGdmVyaWZ5AAAAAAkAAfQAAAADCAUAAAACdHgAAAAJYm9keUJ5dGVzCQABkQAAAAIIBQAAAAJ0eAAAAAZwcm9vZnMAAAAAAAAAAAAIBQAAAAJ0eAAAAA9zZW5kZXJQdWJsaWNLZXnhyp7A", "height": 1746269, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 6cQ22RxzPFz91h1UDDEXPGoCR1tz1tW2Fz6o1dqVWjb6 Next: 94K27WJccbM8GAexGbXWWZFZcLdjN9GJbMWbF52CmrpX Diff:
Old | New | Differences | |
---|---|---|---|
87 | 87 | then throw(((("Your " + toString(getIntegerValue(this, ("Deposit_Amount_Of_" + currentKey)))) + " CODE are Under Lock. Consider last 8 digits as value after Decimals. Token will be Unlocked after ") + toString((getIntegerValue(this, ("Total_Lock_Blocks_Of_" + currentKey)) - height)))) | |
88 | 88 | else if ((checkdepositvalue == 0)) | |
89 | 89 | then throw("You Have Already Withdraw your CODE Amount.") | |
90 | - | else [IntegerEntry("Total_Issued_CODE:", TotalIssuedCODE), Reissue(CODEAssetID, getIntegerValue(this, ("Rewards_Of_" + currentKey)), true), ScriptTransfer(i.caller, getIntegerValue(this, ("Rewards_Of_" + currentKey)), CODEAssetID), IntegerEntry(("Deposit_height_Of_" + currentKey), 0), IntegerEntry("Staked_Amount", newstakedvalue), IntegerEntry(("Deposit_Amount_Of_" + currentKey), 0), IntegerEntry(("Total_Lock_Blocks_Of_" + currentKey), 0), StringEntry(("Lock_Status_Of_" + currentKey), "UNLOCK"), IntegerEntry(("Rewards_Of_" + currentKey), 0), IntegerEntry("Total_CODE_Claimed:", totalrewardclaimed)] | |
90 | + | else [IntegerEntry("Total_Issued_CODE:", TotalIssuedCODE), Reissue(CODEAssetID, getIntegerValue(this, ("Rewards_Of_" + currentKey)), true), ScriptTransfer(i.caller, getIntegerValue(this, ("Rewards_Of_" + currentKey)), CODEAssetID), IntegerEntry("Total_Txns:", TotalTxnsCODE), IntegerEntry(("Deposit_height_Of_" + currentKey), 0), IntegerEntry("Staked_Amount", newstakedvalue), IntegerEntry(("Deposit_Amount_Of_" + currentKey), 0), IntegerEntry(("Total_Lock_Blocks_Of_" + currentKey), 0), StringEntry(("Lock_Status_Of_" + currentKey), "UNLOCK"), IntegerEntry(("Rewards_Of_" + currentKey), 0), IntegerEntry("Total_CODE_Claimed:", totalrewardclaimed)] | |
91 | 91 | } | |
92 | 92 | ||
93 | 93 |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 4 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let CODEAssetID = base58'ArPqXguhFLjJt5XwcNwhXMnCv2zSumrM19y5WgT34yRi' | |
5 | 5 | ||
6 | 6 | let StartHeight = 1745400 | |
7 | 7 | ||
8 | 8 | let oneday = 1440 | |
9 | 9 | ||
10 | 10 | let minimumlockdays = 6 | |
11 | 11 | ||
12 | 12 | let maximumlockdays = 7 | |
13 | 13 | ||
14 | 14 | let blockdiff = (height - StartHeight) | |
15 | 15 | ||
16 | 16 | let InflationNo = (fraction(10000000000, 1, blockdiff) + 6000) | |
17 | 17 | ||
18 | 18 | let StakingDapp = base58'C246qxhuyo9DBk1pjMzEQSVAWmiqYupG2swGkxTeAvLV' | |
19 | 19 | ||
20 | 20 | let FeeAddress = base58'6Z73KxcX3sugpiStpSRXxKxTmWqCaLVwFeM6kwyiKVDR' | |
21 | 21 | ||
22 | 22 | let devAddress = base58'8d4zGuTjT3h67Z4DatzMXdXXW1GvoQhMTjwCGFxJuene' | |
23 | 23 | ||
24 | 24 | @Callable(i) | |
25 | 25 | func Deposit (days) = { | |
26 | 26 | let pmt = if ((size(i.payments) == 1)) | |
27 | 27 | then i.payments[0] | |
28 | 28 | else throw("No Payments Attached Please Attach CODE Asset Only.") | |
29 | 29 | let currentKey = toBase58String(i.caller.bytes) | |
30 | 30 | let UserClaimAmount = ((((InflationNo * pmt.amount) * days) / 365) / 1000) | |
31 | 31 | let allowdedpymt = (blockdiff * 100000) | |
32 | 32 | let actualblocks = (oneday * days) | |
33 | 33 | let totallockblocks = (height + actualblocks) | |
34 | 34 | let PreviousBurnedCODE = getIntegerValue(this, "Total_Burned_CODE:") | |
35 | 35 | let TotalBurnedCODE = (PreviousBurnedCODE + pmt.amount) | |
36 | 36 | let PreviousTxnsCODE = getIntegerValue(this, "Total_Txns:") | |
37 | 37 | let TotalTxnsCODE = (PreviousTxnsCODE + 1) | |
38 | 38 | let fetchuserstakeheight = valueOrErrorMessage(getInteger(addressFromPublicKey(StakingDapp), ("Deposit_height_Of_" + currentKey)), "Your Address not Found on Staking DApp") | |
39 | 39 | let fetchusermatureheight = valueOrErrorMessage(getInteger(addressFromPublicKey(StakingDapp), ("Total_Lock_Blocks_Of_" + currentKey)), "Your Address not Found on Staking DApp") | |
40 | 40 | let gapofheight = (fetchusermatureheight - fetchuserstakeheight) | |
41 | 41 | let StakedCODEAmount = match getInteger(this, "Staked_Amount") { | |
42 | 42 | case a: Int => | |
43 | 43 | a | |
44 | 44 | case _ => | |
45 | 45 | 0 | |
46 | 46 | } | |
47 | 47 | let newStakedCODEAmount = (StakedCODEAmount + pmt.amount) | |
48 | 48 | let currentCODEAmount = match getInteger(this, ("Deposit_Amount_Of_" + currentKey)) { | |
49 | 49 | case a: Int => | |
50 | 50 | a | |
51 | 51 | case _ => | |
52 | 52 | 0 | |
53 | 53 | } | |
54 | 54 | let newCODEAmount = (currentCODEAmount + pmt.amount) | |
55 | 55 | if ((StartHeight > height)) | |
56 | 56 | then throw((("DApp is Not Started Yet please Wait until " + toString((StartHeight - height))) + " blocks")) | |
57 | 57 | else if ((pmt.assetId != CODEAssetID)) | |
58 | 58 | then throw(("Incorrect asset attached, please attach " + toBase58String(CODEAssetID))) | |
59 | 59 | else if ((minimumlockdays >= days)) | |
60 | 60 | then throw(((("Choose Locking days in between " + toString((minimumlockdays + 1))) + " to ") + toString(maximumlockdays))) | |
61 | 61 | else if ((days > maximumlockdays)) | |
62 | 62 | then throw(((((("You Entered days to " + toString(days)) + ", Please Enter no. of days in between ") + toString((minimumlockdays + 1))) + " to ") + toString(maximumlockdays))) | |
63 | 63 | else if ((100000 > pmt.amount)) | |
64 | 64 | then throw("Please Attach minimum 0.001 CODE To Issue CODE Asset.") | |
65 | 65 | else if ((pmt.amount > allowdedpymt)) | |
66 | 66 | then throw((("You can attach maximum " + toString(allowdedpymt)) + "/10^8 CODE.")) | |
67 | 67 | else if ((gapofheight != 129600)) | |
68 | 68 | then throw("You are Not Eligible to Mint CODE. It need minimum 90 Days Staking.") | |
69 | 69 | else [Burn(CODEAssetID, pmt.amount), IntegerEntry("Total_Burned_CODE:", TotalBurnedCODE), IntegerEntry("Staked_Amount", newStakedCODEAmount), IntegerEntry("Total_Txns:", TotalTxnsCODE), IntegerEntry("Inflation", InflationNo), IntegerEntry(("Deposit_height_Of_" + currentKey), height), IntegerEntry(("Deposit_Amount_Of_" + currentKey), newCODEAmount), IntegerEntry(("Total_Lock_Blocks_Of_" + currentKey), totallockblocks), IntegerEntry(("Rewards_Of_" + currentKey), UserClaimAmount), StringEntry("message", "<h1>CODE Staked Successfully!</h1><br>")] | |
70 | 70 | } | |
71 | 71 | ||
72 | 72 | ||
73 | 73 | ||
74 | 74 | @Callable(i) | |
75 | 75 | func Withdraw () = { | |
76 | 76 | let currentKey = toBase58String(i.caller.bytes) | |
77 | 77 | let checkdepositvalue = getIntegerValue(this, ("Deposit_Amount_Of_" + currentKey)) | |
78 | 78 | let checkstakedvalue = getIntegerValue(this, "Staked_Amount") | |
79 | 79 | let newstakedvalue = (checkstakedvalue - checkdepositvalue) | |
80 | 80 | let fetchRewardData = getIntegerValue(this, "Total_CODE_Claimed:") | |
81 | 81 | let totalrewardclaimed = (fetchRewardData + getIntegerValue(this, ("Rewards_Of_" + currentKey))) | |
82 | 82 | let PreviousIssuedCODE = getIntegerValue(this, "Total_Issued_CODE:") | |
83 | 83 | let TotalIssuedCODE = (PreviousIssuedCODE + checkdepositvalue) | |
84 | 84 | let PreviousTxnsCODE = getIntegerValue(this, "Total_Txns:") | |
85 | 85 | let TotalTxnsCODE = (PreviousTxnsCODE + 1) | |
86 | 86 | if ((getIntegerValue(this, ("Total_Lock_Blocks_Of_" + currentKey)) > height)) | |
87 | 87 | then throw(((("Your " + toString(getIntegerValue(this, ("Deposit_Amount_Of_" + currentKey)))) + " CODE are Under Lock. Consider last 8 digits as value after Decimals. Token will be Unlocked after ") + toString((getIntegerValue(this, ("Total_Lock_Blocks_Of_" + currentKey)) - height)))) | |
88 | 88 | else if ((checkdepositvalue == 0)) | |
89 | 89 | then throw("You Have Already Withdraw your CODE Amount.") | |
90 | - | else [IntegerEntry("Total_Issued_CODE:", TotalIssuedCODE), Reissue(CODEAssetID, getIntegerValue(this, ("Rewards_Of_" + currentKey)), true), ScriptTransfer(i.caller, getIntegerValue(this, ("Rewards_Of_" + currentKey)), CODEAssetID), IntegerEntry(("Deposit_height_Of_" + currentKey), 0), IntegerEntry("Staked_Amount", newstakedvalue), IntegerEntry(("Deposit_Amount_Of_" + currentKey), 0), IntegerEntry(("Total_Lock_Blocks_Of_" + currentKey), 0), StringEntry(("Lock_Status_Of_" + currentKey), "UNLOCK"), IntegerEntry(("Rewards_Of_" + currentKey), 0), IntegerEntry("Total_CODE_Claimed:", totalrewardclaimed)] | |
90 | + | else [IntegerEntry("Total_Issued_CODE:", TotalIssuedCODE), Reissue(CODEAssetID, getIntegerValue(this, ("Rewards_Of_" + currentKey)), true), ScriptTransfer(i.caller, getIntegerValue(this, ("Rewards_Of_" + currentKey)), CODEAssetID), IntegerEntry("Total_Txns:", TotalTxnsCODE), IntegerEntry(("Deposit_height_Of_" + currentKey), 0), IntegerEntry("Staked_Amount", newstakedvalue), IntegerEntry(("Deposit_Amount_Of_" + currentKey), 0), IntegerEntry(("Total_Lock_Blocks_Of_" + currentKey), 0), StringEntry(("Lock_Status_Of_" + currentKey), "UNLOCK"), IntegerEntry(("Rewards_Of_" + currentKey), 0), IntegerEntry("Total_CODE_Claimed:", totalrewardclaimed)] | |
91 | 91 | } | |
92 | 92 | ||
93 | 93 | ||
94 | 94 | @Verifier(tx) | |
95 | 95 | func verify () = sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey) | |
96 | 96 |
github/deemru/w8io/169f3d6 35.77 ms ◑