tx · CC69LUjxxQ6RUbNx4A6B7vQD4cHJGYsD147B2W3JyPhY 3NC9boevS259eTsMAkFAxCPorzK4Z9bpWje: -0.01400000 Waves 2023.01.16 02:50 [2406743] smart account 3NC9boevS259eTsMAkFAxCPorzK4Z9bpWje > SELF 0.00000000 Waves
{ "type": 13, "id": "CC69LUjxxQ6RUbNx4A6B7vQD4cHJGYsD147B2W3JyPhY", "fee": 1400000, "feeAssetId": null, "timestamp": 1673826705756, "version": 2, "chainId": 84, "sender": "3NC9boevS259eTsMAkFAxCPorzK4Z9bpWje", "senderPublicKey": "515tSAyMUbAb8kKjcpGDpqALGfCgcwfWmWKKkcBKTcGB", "proofs": [ "4oMXWu6rWJweWHL1P9EvBK87E6zhCrDdTr2irDZA68CcCcjyqJGdvjQj4oRuuWD8wPUKfgSs1GZGfhJsesZjLPSh" ], "script": "base64:AAIFAAAAAAAAAA4IAhIAEgMKAQgSAwoBAQAAAAAAAAADAAAAAWkBAAAAD3BsYWNlb3B0aW9uQ2FsbAAAAAAEAAAADWNhbGxlcmFkZHJlc3MJAAJYAAAAAQgIBQAAAAFpAAAABmNhbGxlcgAAAAVieXRlcwQAAAAScmVhZF9vcmFjbGVfc3RhdHVzCQEAAAARQGV4dHJOYXRpdmUoMTA1MykAAAACBQAAAAR0aGlzAgAAAA1vcmFjbGVfc3RhdHVzBAAAABRyZWFkX09wdGlvbkNvdW50ZXJJRAkBAAAAEUBleHRyTmF0aXZlKDEwNTApAAAAAgUAAAAEdGhpcwIAAAAOMW1fY29udHJhY3RfaWQEAAAACmdldGJ0Y2RhdGEJAQAAABFAZXh0ck5hdGl2ZSgxMDUzKQAAAAIFAAAABHRoaXMJAAEsAAAAAgIAAAAHMW1fYnRjXwkAAaQAAAABBQAAABRyZWFkX09wdGlvbkNvdW50ZXJJRAQAAAAGc3dhcExpCQAEtQAAAAIFAAAACmdldGJ0Y2RhdGECAAAAAV8EAAAABXByaWNlCQABkQAAAAIFAAAABnN3YXBMaQAAAAAAAAAA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AAAAAgUAAAAKZ2V0YnRjZGF0YQIAAAABXwQAAAAFcHJpY2UJAAGRAAAAAgUAAAAGc3dhcExpAAAAAAAAAAAABAAAAAR0aW1lCQABkQAAAAIFAAAABnN3YXBMaQAAAAAAAAAAAQQAAAALYmxvY2toZWlnaHQJAAGRAAAAAgUAAAAGc3dhcExpAAAAAAAAAAACBAAAAANkaXYJAAGRAAAAAgUAAAAGc3dhcExpAAAAAAAAAAADCQAETAAAAAIJAQAAAAtTdHJpbmdFbnRyeQAAAAICAAAABXByaWNlCQABkQAAAAIFAAAABnN3YXBMaQAAAAAAAAAAAAkABEwAAAACCQEAAAALU3RyaW5nRW50cnkAAAACAgAAAAR0aW1lCQABkQAAAAIFAAAABnN3YXBMaQAAAAAAAAAAAQkABEwAAAACCQEAAAALU3RyaW5nRW50cnkAAAACAgAAAAtibG9ja2hlaWdodAkAAZEAAAACBQAAAAZzd2FwTGkAAAAAAAAAAAIJAARMAAAAAgkBAAAAC1N0cmluZ0VudHJ5AAAAAgIAAAADZGl2CQABkQAAAAIFAAAABnN3YXBMaQAAAAAAAAAAAwUAAAADbmlsAAAAAQAAAAJ0eAEAAAAGdmVyaWZ5AAAAAAkAAfQAAAADCAUAAAACdHgAAAAJYm9keUJ5dGVzCQABkQAAAAIIBQAAAAJ0eAAAAAZwcm9vZnMAAAAAAAAAAAAIBQAAAAJ0eAAAAA9zZW5kZXJQdWJsaWNLZXl0wrCy", "height": 2406743, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 5Ew8zZ4e5N2JmQ82NB9FYDo2vCNgY7P1DyjiLbMYRwee Next: FJWaNotxw57taUt1h9L95MgRvkFVeQ7ZoDUvBZ5yGef9 Diff:
Old | New | Differences | |
---|---|---|---|
53 | 53 | let splitbtcpriceAtEndCounter = split(getbtcdataAtEndCounter, "_") | |
54 | 54 | let getbtcpriceAtEndCounter = splitbtcpriceAtEndCounter[0] | |
55 | 55 | let pricediff = (parseIntValue(getbtcpriceAtEndCounter) - parseIntValue(getbtcpriceAtStartCounter)) | |
56 | - | [StringEntry("Contract_Start_value", getStartCounter), StringEntry("Contract_End_value", getEndCounter), StringEntry("Blank1", getbtcpriceAtStartCounter), StringEntry("Blank2", getbtcpriceAtEndCounter), IntegerEntry("Diff", pricediff), DeleteEntry(((("Call_Start_End_" + calleraddress) + "_") + Call_Sequence)), DeleteEntry(getOptionCallPrice)] | |
56 | + | if ((pricediff > 0)) | |
57 | + | then throw("Price is less.") | |
58 | + | else [StringEntry("Contract_Start_value", getStartCounter), StringEntry("Contract_End_value", getEndCounter), StringEntry("Blank1", getbtcpriceAtStartCounter), StringEntry("Blank2", getbtcpriceAtEndCounter), IntegerEntry("Diff", pricediff), DeleteEntry(((("Call_Start_End_" + calleraddress) + "_") + Call_Sequence)), DeleteEntry(getOptionCallPrice)] | |
57 | 59 | } | |
58 | 60 | ||
59 | 61 |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 5 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | ||
5 | 5 | ||
6 | 6 | @Callable(i) | |
7 | 7 | func placeoptionCall () = { | |
8 | 8 | let calleraddress = toBase58String(i.caller.bytes) | |
9 | 9 | let read_oracle_status = getStringValue(this, "oracle_status") | |
10 | 10 | let read_OptionCounterID = getIntegerValue(this, "1m_contract_id") | |
11 | 11 | let getbtcdata = getStringValue(this, ("1m_btc_" + toString(read_OptionCounterID))) | |
12 | 12 | let swapLi = split(getbtcdata, "_") | |
13 | 13 | let price = swapLi[0] | |
14 | 14 | let block = parseIntValue(swapLi[2]) | |
15 | 15 | let checkblockgap = (height - block) | |
16 | 16 | let OpionExpireCounter = 1 | |
17 | 17 | let OptionExpireCounterID = (read_OptionCounterID + OpionExpireCounter) | |
18 | 18 | let PreviousCall = match getInteger(this, "Total_Calls") { | |
19 | 19 | case a: Int => | |
20 | 20 | a | |
21 | 21 | case _ => | |
22 | 22 | 0 | |
23 | 23 | } | |
24 | 24 | let TotalCall = (PreviousCall + 1) | |
25 | 25 | let PreviousUserCall = match getInteger(this, (calleraddress + "_Total_Calls")) { | |
26 | 26 | case a: Int => | |
27 | 27 | a | |
28 | 28 | case _ => | |
29 | 29 | 0 | |
30 | 30 | } | |
31 | 31 | let TotalUserCall = (PreviousUserCall + 1) | |
32 | 32 | if ((checkblockgap > 2)) | |
33 | 33 | then throw("Something Wrong with Oracle or Height is not matched.") | |
34 | 34 | else if ((read_oracle_status == "Close")) | |
35 | 35 | then throw("Oracle is closed. Wait Until Oracle is Turned On.") | |
36 | 36 | else [StringEntry(((("Call_" + calleraddress) + "_") + toString(TotalUserCall)), price), StringEntry(((("Call_Start_End_" + calleraddress) + "_") + toString(TotalUserCall)), ((toString(read_OptionCounterID) + "_") + toString(OptionExpireCounterID))), IntegerEntry("Total_Calls", TotalCall), IntegerEntry((calleraddress + "_Total_Calls"), TotalUserCall)] | |
37 | 37 | } | |
38 | 38 | ||
39 | 39 | ||
40 | 40 | ||
41 | 41 | @Callable(i) | |
42 | 42 | func ClaimCall (Call_Sequence) = { | |
43 | 43 | let calleraddress = toBase58String(i.caller.bytes) | |
44 | 44 | let getOptionCallPrice = getStringValue(this, ((("Call_" + calleraddress) + "_") + Call_Sequence)) | |
45 | 45 | let getOptionCall_Sequencedata = getStringValue(this, ((("Call_Start_End_" + calleraddress) + "_") + Call_Sequence)) | |
46 | 46 | let splitStartEndCounter = split(getOptionCall_Sequencedata, "_") | |
47 | 47 | let getStartCounter = splitStartEndCounter[0] | |
48 | 48 | let getEndCounter = splitStartEndCounter[1] | |
49 | 49 | let getbtcdataAtStartCounter = getStringValue(this, ("1m_btc_" + getStartCounter)) | |
50 | 50 | let splitbtcpriceAtStartCounter = split(getbtcdataAtStartCounter, "_") | |
51 | 51 | let getbtcpriceAtStartCounter = splitbtcpriceAtStartCounter[0] | |
52 | 52 | let getbtcdataAtEndCounter = getStringValue(this, ("1m_btc_" + getEndCounter)) | |
53 | 53 | let splitbtcpriceAtEndCounter = split(getbtcdataAtEndCounter, "_") | |
54 | 54 | let getbtcpriceAtEndCounter = splitbtcpriceAtEndCounter[0] | |
55 | 55 | let pricediff = (parseIntValue(getbtcpriceAtEndCounter) - parseIntValue(getbtcpriceAtStartCounter)) | |
56 | - | [StringEntry("Contract_Start_value", getStartCounter), StringEntry("Contract_End_value", getEndCounter), StringEntry("Blank1", getbtcpriceAtStartCounter), StringEntry("Blank2", getbtcpriceAtEndCounter), IntegerEntry("Diff", pricediff), DeleteEntry(((("Call_Start_End_" + calleraddress) + "_") + Call_Sequence)), DeleteEntry(getOptionCallPrice)] | |
56 | + | if ((pricediff > 0)) | |
57 | + | then throw("Price is less.") | |
58 | + | else [StringEntry("Contract_Start_value", getStartCounter), StringEntry("Contract_End_value", getEndCounter), StringEntry("Blank1", getbtcpriceAtStartCounter), StringEntry("Blank2", getbtcpriceAtEndCounter), IntegerEntry("Diff", pricediff), DeleteEntry(((("Call_Start_End_" + calleraddress) + "_") + Call_Sequence)), DeleteEntry(getOptionCallPrice)] | |
57 | 59 | } | |
58 | 60 | ||
59 | 61 | ||
60 | 62 | ||
61 | 63 | @Callable(i) | |
62 | 64 | func calldata (Counter) = { | |
63 | 65 | let getbtcdata = getStringValue(this, ("1m_btc_" + toString(Counter))) | |
64 | 66 | let swapLi = split(getbtcdata, "_") | |
65 | 67 | let price = swapLi[0] | |
66 | 68 | let time = swapLi[1] | |
67 | 69 | let blockheight = swapLi[2] | |
68 | 70 | let div = swapLi[3] | |
69 | 71 | [StringEntry("price", swapLi[0]), StringEntry("time", swapLi[1]), StringEntry("blockheight", swapLi[2]), StringEntry("div", swapLi[3])] | |
70 | 72 | } | |
71 | 73 | ||
72 | 74 | ||
73 | 75 | @Verifier(tx) | |
74 | 76 | func verify () = sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey) | |
75 | 77 |
github/deemru/w8io/026f985 22.11 ms ◑