tx · GYaQQaRxR2hKeVrKPcWXpV7bzadfcSnsaqWSn6GPkzyf 3N2xqkdTrWSis1QWQnpyeJyL95qjkUyP7Ve: -0.01400000 Waves 2021.09.13 20:41 [1701597] smart account 3N2xqkdTrWSis1QWQnpyeJyL95qjkUyP7Ve > SELF 0.00000000 Waves
{ "type": 13, "id": "GYaQQaRxR2hKeVrKPcWXpV7bzadfcSnsaqWSn6GPkzyf", "fee": 1400000, "feeAssetId": null, "timestamp": 1631554907475, "version": 2, "chainId": 84, "sender": "3N2xqkdTrWSis1QWQnpyeJyL95qjkUyP7Ve", "senderPublicKey": "GixVPmDAUorToWCPYCpBKvBFRBc7qtQSXhL8zWJsfnVN", "proofs": [ "5Pd4xwEDprJp24ALqaz2yHdVPn2yYaig27EdYgzPWTRKxURuPpLeamQrZfEEwKjiuVokTt1ceLiE4jMJGfdvRxy6" ], "script": "base64:AAIEAAAAAAAAAAkIAhIDCgEBEgAAAAACAAAAAApNRENBc3NldElEAQAAACDw+pZ8I6S1gLtz/lhk6hmcqMAiL6CmemymHtjpH9G2wAAAAAALVVNETkFzc2V0SUQBAAAAIFvDtlHjzQ4rRBwVsoNZgb+PxfGh9JbQKOsL87KqrvmdAAAAAgAAAAFpAQAAAAdEZXBvc2l0AAAAAQAAAARkYXlzBAAAAANwbXQDCQAAAAAAAAIJAAGQAAAAAQgFAAAAAWkAAAAIcGF5bWVudHMAAAAAAAAAAAEJAAGRAAAAAggFAAAAAWkAAAAIcGF5bWVudHMAAAAAAAAAAAAJAAACAAAAAQIAAABHTm8gcGF5bWVudCBhdHRhY2hlZCwgUGxlYXNlIEF0dGFjaCBNREMgVG9rZW4gYXMgcGVyIFRJRVIgaW4gcGF5bWVudFsxXS4EAAAACmN1cnJlbnRLZXkJAAJYAAAAAQgIBQAAAAFpAAAABmNhbGxlcgAAAAVieXRlcwQAAAAPbWF4aW11bWxvY2tkYXlzAAAAAAAAAABaBAAAAApsb2Nrc3RhdHVzAgAAAAZMT0NLRUQEAAAAB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wBQAAAAJ0eAkAAfQAAAADCAUAAAACdHgAAAAJYm9keUJ5dGVzCQABkQAAAAIIBQAAAAJ0eAAAAAZwcm9vZnMAAAAAAAAAAAAIBQAAAAJ0eAAAAA9zZW5kZXJQdWJsaWNLZXn6qINw", "height": 1701597, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: wbzQMmyduuMRzzypwrUVe3LnrsYw474pMJo8yUMB2LA Next: n7grXtsyMKWtLDeYYeTqM6NjrX5vbd6QHdVJLBvAom4 Diff:
Old | New | Differences | |
---|---|---|---|
36 | 36 | else if ((j >= e.amount)) | |
37 | 37 | then [StringEntry(("Tier_Of_" + f), "GOLD"), IntegerEntry(("Deposit_height_Of_" + f), height), IntegerEntry(("Deposit_Amount_Of_" + f), e.amount), IntegerEntry(("Total_Lock_Blocks_Of_" + f), n), StringEntry(("Lock_Status_Of_" + f), h), IntegerEntry(("Rewards_Of_" + f), q)] | |
38 | 38 | else if ((e.amount >= k)) | |
39 | - | then [{ | |
39 | + | then [StringEntry(("Tier_Of_" + f), "DIAMOND"), IntegerEntry(("Deposit_height_Of_" + f), height), IntegerEntry(("Deposit_Amount_Of_" + f), e.amount), IntegerEntry(("Total_Lock_Blocks_Of_" + f), n), StringEntry(("Lock_Status_Of_" + f), h), IntegerEntry(("Rewards_Of_" + f), q)] | |
40 | + | else [{ | |
40 | 41 | let s = 20 | |
41 | - | StringEntry(("Tier_Of_" + f), "DIAMOND") | |
42 | - | }, IntegerEntry(("Deposit_height_Of_" + f), height), IntegerEntry(("Deposit_Amount_Of_" + f), e.amount), IntegerEntry(("Total_Lock_Blocks_Of_" + f), n), StringEntry(("Lock_Status_Of_" + f), h), IntegerEntry(("Rewards_Of_" + f), q)] | |
43 | - | else [{ | |
44 | - | let t = 20 | |
45 | 42 | IntegerEntry(("Deposit_height_Of_" + f), height) | |
46 | 43 | }, IntegerEntry(("Deposit_Amount_Of_" + f), e.amount), IntegerEntry(("Total_Lock_Blocks_Of_" + f), n), StringEntry(("Lock_Status_Of_" + f), h)] | |
47 | 44 | } | |
51 | 48 | @Callable(c) | |
52 | 49 | func Withdraw () = { | |
53 | 50 | let f = toBase58String(c.caller.bytes) | |
54 | - | let | |
51 | + | let t = getIntegerValue(this, ("Deposit_Amount_Of_" + f)) | |
55 | 52 | if ((getIntegerValue(this, ("Total_Lock_Blocks_Of_" + f)) > height)) | |
56 | 53 | then throw(((("Your " + toString(getIntegerValue(this, ("Deposit_Amount_Of_" + f)))) + " MDC are Under Lock. Consider last 5 digits as value after Decimals. Token will be Unlocked after ") + toString((getIntegerValue(this, ("Total_Lock_Blocks_Of_" + f)) - height)))) | |
57 | - | else if (( | |
54 | + | else if ((t == 0)) | |
58 | 55 | then throw("You Have Already Withdraw your Amount.") | |
59 | 56 | else [ScriptTransfer(c.caller, getIntegerValue(this, ("Deposit_Amount_Of_" + f)), a), ScriptTransfer(c.caller, getIntegerValue(this, ("Rewards_Of_" + f)), b), IntegerEntry(("Deposit_height_Of_" + f), 0), IntegerEntry(("Deposit_Amount_Of_" + f), 0), IntegerEntry(("Total_Lock_Blocks_Of_" + f), 0), StringEntry(("Lock_Status_Of_" + f), "UNLOCK"), IntegerEntry(("Rewards_Of_" + f), 0)] | |
60 | 57 | } | |
61 | 58 | ||
62 | 59 | ||
63 | - | @Verifier( | |
64 | - | func | |
65 | - | let | |
66 | - | sigVerify( | |
60 | + | @Verifier(u) | |
61 | + | func v () = { | |
62 | + | let w = u | |
63 | + | sigVerify(u.bodyBytes, u.proofs[0], u.senderPublicKey) | |
67 | 64 | } | |
68 | 65 |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 4 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let a = base58'HDgUBQhx8vJY2uUmQPtqzEu6C32Ktx4jAD37aprLKV9Z' | |
5 | 5 | ||
6 | 6 | let b = base58'7BDByxoPpx8gjNfkuBi8h1zBTtg9PrxLvYv3q613CES8' | |
7 | 7 | ||
8 | 8 | @Callable(c) | |
9 | 9 | func Deposit (d) = { | |
10 | 10 | let e = if ((size(c.payments) == 1)) | |
11 | 11 | then c.payments[0] | |
12 | 12 | else throw("No payment attached, Please Attach MDC Token as per TIER in payment[1].") | |
13 | 13 | let f = toBase58String(c.caller.bytes) | |
14 | 14 | let g = 90 | |
15 | 15 | let h = "LOCKED" | |
16 | 16 | let i = 499999999999 | |
17 | 17 | let j = 999999999999 | |
18 | 18 | let k = 1000000000000 | |
19 | 19 | let l = 1440 | |
20 | 20 | let m = (l * d) | |
21 | 21 | let n = (height + m) | |
22 | 22 | let o = 695 | |
23 | 23 | let p = fraction(fraction(o, e.amount, pow(10, 0, 5, 0, 0, UP)), m, pow(10, 0, 6, 0, 0, UP)) | |
24 | 24 | let q = fraction(fraction((o * 2), e.amount, pow(10, 0, 5, 0, 0, UP)), m, pow(10, 0, 6, 0, 0, UP)) | |
25 | 25 | let r = fraction(fraction(((o * 25) / 10), e.amount, pow(10, 0, 5, 0, 0, UP)), m, pow(10, 0, 6, 0, 0, UP)) | |
26 | 26 | if ((e.assetId != a)) | |
27 | 27 | then throw((("Incorrect asset attached, please attach " + toBase58String(a)) + " only.")) | |
28 | 28 | else if ((6 >= d)) | |
29 | 29 | then throw("Choose Locking days in between 7 to 90.") | |
30 | 30 | else if ((d > g)) | |
31 | 31 | then throw("You Entered days greater than 90 please Enter no. of days in between 7 to 90.") | |
32 | 32 | else if ((1000000000 > e.amount)) | |
33 | 33 | then throw("Please Attach minimum 10,000 MDC To Achieve SILVER TIER.") | |
34 | 34 | else if ((i >= e.amount)) | |
35 | 35 | then [StringEntry(("Tier_Of_" + f), "SILVER"), IntegerEntry(("Deposit_height_Of_" + f), height), IntegerEntry(("Deposit_Amount_Of_" + f), e.amount), IntegerEntry(("Total_Lock_Blocks_Of_" + f), n), StringEntry(("Lock_Status_Of_" + f), h), IntegerEntry(("Rewards_Of_" + f), p)] | |
36 | 36 | else if ((j >= e.amount)) | |
37 | 37 | then [StringEntry(("Tier_Of_" + f), "GOLD"), IntegerEntry(("Deposit_height_Of_" + f), height), IntegerEntry(("Deposit_Amount_Of_" + f), e.amount), IntegerEntry(("Total_Lock_Blocks_Of_" + f), n), StringEntry(("Lock_Status_Of_" + f), h), IntegerEntry(("Rewards_Of_" + f), q)] | |
38 | 38 | else if ((e.amount >= k)) | |
39 | - | then [{ | |
39 | + | then [StringEntry(("Tier_Of_" + f), "DIAMOND"), IntegerEntry(("Deposit_height_Of_" + f), height), IntegerEntry(("Deposit_Amount_Of_" + f), e.amount), IntegerEntry(("Total_Lock_Blocks_Of_" + f), n), StringEntry(("Lock_Status_Of_" + f), h), IntegerEntry(("Rewards_Of_" + f), q)] | |
40 | + | else [{ | |
40 | 41 | let s = 20 | |
41 | - | StringEntry(("Tier_Of_" + f), "DIAMOND") | |
42 | - | }, IntegerEntry(("Deposit_height_Of_" + f), height), IntegerEntry(("Deposit_Amount_Of_" + f), e.amount), IntegerEntry(("Total_Lock_Blocks_Of_" + f), n), StringEntry(("Lock_Status_Of_" + f), h), IntegerEntry(("Rewards_Of_" + f), q)] | |
43 | - | else [{ | |
44 | - | let t = 20 | |
45 | 42 | IntegerEntry(("Deposit_height_Of_" + f), height) | |
46 | 43 | }, IntegerEntry(("Deposit_Amount_Of_" + f), e.amount), IntegerEntry(("Total_Lock_Blocks_Of_" + f), n), StringEntry(("Lock_Status_Of_" + f), h)] | |
47 | 44 | } | |
48 | 45 | ||
49 | 46 | ||
50 | 47 | ||
51 | 48 | @Callable(c) | |
52 | 49 | func Withdraw () = { | |
53 | 50 | let f = toBase58String(c.caller.bytes) | |
54 | - | let | |
51 | + | let t = getIntegerValue(this, ("Deposit_Amount_Of_" + f)) | |
55 | 52 | if ((getIntegerValue(this, ("Total_Lock_Blocks_Of_" + f)) > height)) | |
56 | 53 | then throw(((("Your " + toString(getIntegerValue(this, ("Deposit_Amount_Of_" + f)))) + " MDC are Under Lock. Consider last 5 digits as value after Decimals. Token will be Unlocked after ") + toString((getIntegerValue(this, ("Total_Lock_Blocks_Of_" + f)) - height)))) | |
57 | - | else if (( | |
54 | + | else if ((t == 0)) | |
58 | 55 | then throw("You Have Already Withdraw your Amount.") | |
59 | 56 | else [ScriptTransfer(c.caller, getIntegerValue(this, ("Deposit_Amount_Of_" + f)), a), ScriptTransfer(c.caller, getIntegerValue(this, ("Rewards_Of_" + f)), b), IntegerEntry(("Deposit_height_Of_" + f), 0), IntegerEntry(("Deposit_Amount_Of_" + f), 0), IntegerEntry(("Total_Lock_Blocks_Of_" + f), 0), StringEntry(("Lock_Status_Of_" + f), "UNLOCK"), IntegerEntry(("Rewards_Of_" + f), 0)] | |
60 | 57 | } | |
61 | 58 | ||
62 | 59 | ||
63 | - | @Verifier( | |
64 | - | func | |
65 | - | let | |
66 | - | sigVerify( | |
60 | + | @Verifier(u) | |
61 | + | func v () = { | |
62 | + | let w = u | |
63 | + | sigVerify(u.bodyBytes, u.proofs[0], u.senderPublicKey) | |
67 | 64 | } | |
68 | 65 |
github/deemru/w8io/026f985 45.61 ms ◑