tx · 5dM3Un2sVffF77vZPsfFKM9L7YUvnox1FW8iMLGKNoE5 3N34Zi5VD4m9az4kEXWDJngkMHMTpqLcoqo: -0.01400000 Waves 2021.10.14 20:11 [1746224] smart account 3N34Zi5VD4m9az4kEXWDJngkMHMTpqLcoqo > SELF 0.00000000 Waves
{ "type": 13, "id": "5dM3Un2sVffF77vZPsfFKM9L7YUvnox1FW8iMLGKNoE5", "fee": 1400000, "feeAssetId": null, "timestamp": 1634231599488, "version": 2, "chainId": 84, "sender": "3N34Zi5VD4m9az4kEXWDJngkMHMTpqLcoqo", "senderPublicKey": "AmXrJ1inc5jpKhf6D9aDcRU8QWHZXBJdBBvz9VsKDe9x", "proofs": [ "2vUV3ayBhFzdGdbiK9RtqsHDSQrs1A6GPhj2UveQjEtTGcbuJTYnH49WGfe2XWbvRJQ2byXToAKcsT3snTx3unaN" ], "script": "base64:AAIEAAAAAAAAAAkIAhIDCgEBEgAAAAAKAAAAAAtDT0RFQXNzZXRJRAEAAAAgkmB2qfKrqGeDE5s+bUmRW9TL3ErNp4dEODxuXgzu+JEAAAAAC1N0YXJ0SGVpZ2h0AAAAAAAAGqH4AAAAAAZvbmVkYXkAAAAAAAAABaAAAAAAD21pbmltdW1sb2NrZGF5cwAAAAAAAAAABgAAAAAPbWF4aW11bWxvY2tkYXlzAAAAAAAAAAAHAAAAAAlibG9ja2RpZmYJAABlAAAAAgUAAAAGaGVpZ2h0BQAAAAtTdGFydEhlaWdodAAAAAALSW5mbGF0aW9uTm8JAABkAAAAAgkAAGsAAAADAAAAAAJUC+QAAAAAAAAAAAABBQAAAAlibG9ja2RpZmYAAAAAAAAAF3AAAAAAC1N0YWtpbmdEYXBwAQAAACCjtaSeUVhAbk0T+akFnLGoDh+X4aR50o/42ilEuU4EFgAAAAAKRmVlQWRkcmVzcwEAAAAgUoPZoIvXkJI7M+XgQERyG3Ox4PxeH5gdLMWeskjH4iAAAAAACmRldkFkZHJlc3MBAAAAIHE/Oe1BrsJepSkes1ESh96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0NPREVfQ2xhaW1lZDoFAAAAEnRvdGFscmV3YXJkY2xhaW1lZAUAAAADbmlsAAAAAQAAAAJ0eAEAAAAGdmVyaWZ5AAAAAAkAAfQAAAADCAUAAAACdHgAAAAJYm9keUJ5dGVzCQABkQAAAAIIBQAAAAJ0eAAAAAZwcm9vZnMAAAAAAAAAAAAIBQAAAAJ0eAAAAA9zZW5kZXJQdWJsaWNLZXnvwnkP", "height": 1746224, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: BtzgpFskaDufiskqgYxyhGmQVmoQu7ZVsR4cUVbjf8Ej Next: 6cQ22RxzPFz91h1UDDEXPGoCR1tz1tW2Fz6o1dqVWjb6 Diff:
Old | New | Differences | |
---|---|---|---|
85 | 85 | 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)))) | |
86 | 86 | else if ((checkdepositvalue == 0)) | |
87 | 87 | then throw("You Have Already Withdraw your CODE Amount.") | |
88 | - | else [Reissue(CODEAssetID, getIntegerValue(this, ("Rewards_Of_" + currentKey)), true), 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)] | |
88 | + | else [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)] | |
89 | 89 | } | |
90 | 90 | ||
91 | 91 |
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 PreviousIssuedCODE = getIntegerValue(this, "Total_Issued_CODE:") | |
35 | 35 | let TotalIssuedCODE = (PreviousIssuedCODE + UserClaimAmount) | |
36 | 36 | let PreviousBurnedCODE = getIntegerValue(this, "Total_Burned_CODE:") | |
37 | 37 | let TotalBurnedCODE = (PreviousBurnedCODE + pmt.amount) | |
38 | 38 | let PreviousTxnsCODE = getIntegerValue(this, "Total_Txns:") | |
39 | 39 | let TotalTxnsCODE = (PreviousTxnsCODE + 1) | |
40 | 40 | let fetchuserstakeheight = valueOrErrorMessage(getInteger(addressFromPublicKey(StakingDapp), ("Deposit_height_Of_" + currentKey)), "Your Address not Found on Staking DApp") | |
41 | 41 | let fetchusermatureheight = valueOrErrorMessage(getInteger(addressFromPublicKey(StakingDapp), ("Total_Lock_Blocks_Of_" + currentKey)), "Your Address not Found on Staking DApp") | |
42 | 42 | let gapofheight = (fetchusermatureheight - fetchuserstakeheight) | |
43 | 43 | let StakedCODEAmount = match getInteger(this, "Staked_Amount") { | |
44 | 44 | case a: Int => | |
45 | 45 | a | |
46 | 46 | case _ => | |
47 | 47 | 0 | |
48 | 48 | } | |
49 | 49 | let newStakedCODEAmount = (StakedCODEAmount + pmt.amount) | |
50 | 50 | let currentCODEAmount = match getInteger(this, ("Deposit_Amount_Of_" + currentKey)) { | |
51 | 51 | case a: Int => | |
52 | 52 | a | |
53 | 53 | case _ => | |
54 | 54 | 0 | |
55 | 55 | } | |
56 | 56 | let newCODEAmount = (currentCODEAmount + pmt.amount) | |
57 | 57 | if ((StartHeight > height)) | |
58 | 58 | then throw((("DApp is Not Started Yet please Wait until " + toString((StartHeight - height))) + " blocks")) | |
59 | 59 | else if ((pmt.assetId != CODEAssetID)) | |
60 | 60 | then throw(("Incorrect asset attached, please attach " + toBase58String(CODEAssetID))) | |
61 | 61 | else if ((minimumlockdays >= days)) | |
62 | 62 | then throw(((("Choose Locking days in between " + toString((minimumlockdays + 1))) + " to ") + toString(maximumlockdays))) | |
63 | 63 | else if ((days > maximumlockdays)) | |
64 | 64 | then throw(((((("You Entered days to " + toString(days)) + ", Please Enter no. of days in between ") + toString((minimumlockdays + 1))) + " to ") + toString(maximumlockdays))) | |
65 | 65 | else if ((100000 > pmt.amount)) | |
66 | 66 | then throw("Please Attach minimum 0.001 CODE To Issue CODE Asset.") | |
67 | 67 | else if ((pmt.amount > allowdedpymt)) | |
68 | 68 | then throw((("You can attach maximum " + toString(allowdedpymt)) + "/10^8 CODE.")) | |
69 | 69 | else if ((gapofheight != 129600)) | |
70 | 70 | then throw("You are Not Eligible to Mint CODE. It need minimum 90 Days Staking.") | |
71 | 71 | else [Burn(CODEAssetID, pmt.amount), IntegerEntry("Total_Issued_CODE:", TotalIssuedCODE), 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>")] | |
72 | 72 | } | |
73 | 73 | ||
74 | 74 | ||
75 | 75 | ||
76 | 76 | @Callable(i) | |
77 | 77 | func Withdraw () = { | |
78 | 78 | let currentKey = toBase58String(i.caller.bytes) | |
79 | 79 | let checkdepositvalue = getIntegerValue(this, ("Deposit_Amount_Of_" + currentKey)) | |
80 | 80 | let checkstakedvalue = getIntegerValue(this, "Staked_Amount") | |
81 | 81 | let newstakedvalue = (checkstakedvalue - checkdepositvalue) | |
82 | 82 | let fetchRewardData = getIntegerValue(this, "Total_CODE_Claimed:") | |
83 | 83 | let totalrewardclaimed = (fetchRewardData + getIntegerValue(this, ("Rewards_Of_" + currentKey))) | |
84 | 84 | if ((getIntegerValue(this, ("Total_Lock_Blocks_Of_" + currentKey)) > height)) | |
85 | 85 | 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)))) | |
86 | 86 | else if ((checkdepositvalue == 0)) | |
87 | 87 | then throw("You Have Already Withdraw your CODE Amount.") | |
88 | - | else [Reissue(CODEAssetID, getIntegerValue(this, ("Rewards_Of_" + currentKey)), true), 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)] | |
88 | + | else [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)] | |
89 | 89 | } | |
90 | 90 | ||
91 | 91 | ||
92 | 92 | @Verifier(tx) | |
93 | 93 | func verify () = sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey) | |
94 | 94 |
github/deemru/w8io/169f3d6 38.07 ms ◑