tx · 9FrwfG5W7b79oF2wa7ELxnQQ1HD2JKCW9VVCPTdajCEx

3MvTsZLYhU4bGijfdULLDAUEiZVryxJVQPJ:  -0.01400000 Waves

2023.01.15 16:50 [2406147] smart account 3MvTsZLYhU4bGijfdULLDAUEiZVryxJVQPJ > SELF 0.00000000 Waves

{ "type": 13, "id": "9FrwfG5W7b79oF2wa7ELxnQQ1HD2JKCW9VVCPTdajCEx", "fee": 1400000, "feeAssetId": null, "timestamp": 1673790751964, "version": 2, "chainId": 84, "sender": "3MvTsZLYhU4bGijfdULLDAUEiZVryxJVQPJ", "senderPublicKey": "6hSe4di8vdVexXUoSJQ1unZB3n287fgHNBP7PberpTez", "proofs": [ "4NL7oBgurAELqmiESYh5G2Wpu29YrzX2PcnkfTVUvb2AEbQh1wQ1fqbucKheEEfejAVhLXNTh9H3rABt5iGEwBjz" ], "script": "base64:AAIFAAAAAAAAAAwIAhIDCgEIEgMKAQEAAAAAAAAAAgAAAAFpAQAAAA9wbGFjZW9wdGlvbkNhbGwAAAABAAAAC09wdGlvbkVudHJ5BAAAAA1jYWxsZXJhZGRyZXNzCQACWAAAAAEICAUAAAABaQAAAAZjYWxsZXIAAAAFYnl0ZXMEAAAAEnJlYWRfb3JhY2xlX3N0YXR1cwkBAAAAEUBleHRyTmF0aXZlKDEwNTMpAAAAAgUAAAAEdGhpcwIAAAANb3JhY2xlX3N0YXR1cwQAAAAUcmVhZF9PcHRpb25Db3VudGVySUQJAQAAABFAZXh0ck5hdGl2ZSgxMDUwKQAAAAIFAAAABHRoaXMCAAAADjFtX2NvbnRyYWN0X2lkBAAAAApnZXRidGNkYXRhCQEAAAARQGV4dHJOYXRpdmUoMTA1MykAAAACBQAAAAR0aGlzCQABLAAAAAICAAAABzFtX2J0Y18JAAGkAAAAAQUAAAAUcmVhZF9PcHRpb25Db3VudGVySUQEAAAABnN3YXBMaQkABLUAAAACBQAAAApnZXRidGNkYXRhAgAAAAFfBAAAAAVwcmljZQkAAZEAAAACBQAAAA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AQAAAAZ2ZXJpZnkAAAAACQAB9AAAAAMIBQAAAAJ0eAAAAAlib2R5Qnl0ZXMJAAGRAAAAAggFAAAAAnR4AAAABnByb29mcwAAAAAAAAAAAAgFAAAAAnR4AAAAD3NlbmRlclB1YmxpY0tlebW77xM=", "height": 2406147, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 2WQN1RMUApm6AC9riECpLtoALXkD1DWV6b4VMJGtK9wr Next: 9FEKfEKvne7Mj5Dx1em4GSjYQh2cLu6sd6XfJL7t5NKt Diff:
OldNewDifferences
44
55
66 @Callable(i)
7-func placeoption (OptionEntry) = {
7+func placeoptionCall (OptionEntry) = {
88 let calleraddress = toBase58String(i.caller.bytes)
99 let read_oracle_status = getStringValue(this, "oracle_status")
1010 let read_OptionCounterID = getIntegerValue(this, "1m_contract_id")
1111 let getbtcdata = getStringValue(this, ("1m_btc_" + toString(read_OptionCounterID)))
1212 let swapLi = split(getbtcdata, "_")
1313 let price = swapLi[0]
14- if ((read_oracle_status == "Close"))
15- then throw("Oracle is closed.Wait Until Oracle is Turned On.")
16- else if ((OptionEntry == "Call"))
17- then [StringEntry(calleraddress, "Call"), StringEntry((calleraddress + "_price"), price)]
18- else if ((OptionEntry == "Put"))
19- then [StringEntry(calleraddress, "Put"), StringEntry((calleraddress + "_price"), price)]
20- else throw("You can Place only Either ['Call'] or ['Put']")
14+ let block = parseIntValue(swapLi[2])
15+ let checkblockgap = (lastBlock.height - block)
16+ let PreviousCall = match getInteger(this, "Total_Calls") {
17+ case a: Int =>
18+ a
19+ case _ =>
20+ 0
21+ }
22+ let TotalCall = (PreviousCall + 1)
23+ let PreviousUserCall = match getInteger(this, (calleraddress + "_Total_Calls")) {
24+ case a: Int =>
25+ a
26+ case _ =>
27+ 0
28+ }
29+ let TotalUserCall = (PreviousUserCall + 1)
30+ if ((2 > checkblockgap))
31+ then throw("Something Wrong with Oracle or Height is not matched.")
32+ else if ((read_oracle_status == "Close"))
33+ then throw("Oracle is closed. Wait Until Oracle is Turned On.")
34+ else if ((OptionEntry == "Call"))
35+ then [StringEntry(calleraddress, "Call"), StringEntry((calleraddress + "_price"), price)]
36+ else throw("You can Place only ['Call'] Here.")
2137 }
2238
2339
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 5 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44
55
66 @Callable(i)
7-func placeoption (OptionEntry) = {
7+func placeoptionCall (OptionEntry) = {
88 let calleraddress = toBase58String(i.caller.bytes)
99 let read_oracle_status = getStringValue(this, "oracle_status")
1010 let read_OptionCounterID = getIntegerValue(this, "1m_contract_id")
1111 let getbtcdata = getStringValue(this, ("1m_btc_" + toString(read_OptionCounterID)))
1212 let swapLi = split(getbtcdata, "_")
1313 let price = swapLi[0]
14- if ((read_oracle_status == "Close"))
15- then throw("Oracle is closed.Wait Until Oracle is Turned On.")
16- else if ((OptionEntry == "Call"))
17- then [StringEntry(calleraddress, "Call"), StringEntry((calleraddress + "_price"), price)]
18- else if ((OptionEntry == "Put"))
19- then [StringEntry(calleraddress, "Put"), StringEntry((calleraddress + "_price"), price)]
20- else throw("You can Place only Either ['Call'] or ['Put']")
14+ let block = parseIntValue(swapLi[2])
15+ let checkblockgap = (lastBlock.height - block)
16+ let PreviousCall = match getInteger(this, "Total_Calls") {
17+ case a: Int =>
18+ a
19+ case _ =>
20+ 0
21+ }
22+ let TotalCall = (PreviousCall + 1)
23+ let PreviousUserCall = match getInteger(this, (calleraddress + "_Total_Calls")) {
24+ case a: Int =>
25+ a
26+ case _ =>
27+ 0
28+ }
29+ let TotalUserCall = (PreviousUserCall + 1)
30+ if ((2 > checkblockgap))
31+ then throw("Something Wrong with Oracle or Height is not matched.")
32+ else if ((read_oracle_status == "Close"))
33+ then throw("Oracle is closed. Wait Until Oracle is Turned On.")
34+ else if ((OptionEntry == "Call"))
35+ then [StringEntry(calleraddress, "Call"), StringEntry((calleraddress + "_price"), price)]
36+ else throw("You can Place only ['Call'] Here.")
2137 }
2238
2339
2440
2541 @Callable(i)
2642 func calldata (Counter) = {
2743 let getbtcdata = getStringValue(addressFromPublicKey(base58'6hSe4di8vdVexXUoSJQ1unZB3n287fgHNBP7PberpTez'), ("1m_btc_" + toString(Counter)))
2844 let swapLi = split(getbtcdata, "_")
2945 let price = swapLi[0]
3046 let time = swapLi[1]
3147 let blockheight = swapLi[2]
3248 let div = swapLi[3]
3349 [StringEntry("price", swapLi[0]), StringEntry("time", swapLi[1]), StringEntry("blockheight", swapLi[2]), StringEntry("div", swapLi[3])]
3450 }
3551
3652
3753 @Verifier(tx)
3854 func verify () = sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey)
3955

github/deemru/w8io/169f3d6 
66.74 ms