tx · 3mbQpL9V1L9bRAkhiood43XYiLcUrQKt5bHjxRxs58bh

3N3LWiYdT9n8o6ecwFZGy6MCehhq6sLUFFL:  -0.01400000 Waves

2019.08.22 15:32 [642328] smart account 3N3LWiYdT9n8o6ecwFZGy6MCehhq6sLUFFL > SELF 0.00000000 Waves

{ "type": 13, "id": "3mbQpL9V1L9bRAkhiood43XYiLcUrQKt5bHjxRxs58bh", "fee": 1400000, "feeAssetId": null, "timestamp": 1566477232758, "version": 1, "sender": "3N3LWiYdT9n8o6ecwFZGy6MCehhq6sLUFFL", "senderPublicKey": "3RTmBp69DqXiohzMXcmVU1pMFssmztWoibFARiKrgTr7", "proofs": [ "32qW3nLSFzmrVf4pXen6JzKvThPytpiyvUynMdRabSxh4ZxxpxXCmmJJ9ZPu5JHQiovng7EnGXteQnJfWnRwz9Fo" ], "script": "base64:AAIDAAAAAAAAAAAAAAAEAAAAAAVvd25lcgEAAAAaAVSTOHBLt7RyJdugRiL5k8zovFc+bobXqh8AAAAADWFzc2V0SWRUb2tlbkEBAAAAIHtxzCCjiO5MvMQa1Azqp+Y2rXgVKpJSDL3j5MzZkFIFAAAAAA1hc3NldElkVG9rZW5CBQAAAAR1bml0AAAAAAljb21pc3Npb24AAAAAAAAAAAAAAAADAAAACmNvbnRleHRPYmoBAAAABGZ1bmQAAAAABAAAAAdwYXltZW50BAAAAAckbWF0Y2gwCAUAAAAKY29udGV4dE9iagAAAAdwYXltZW50AwkAAAEAAAACBQAAAAckbWF0Y2gwAgAAAA9BdHRhY2hlZFBheW1lbnQEAAAAAXAFAAAAByRtYXRjaDAFAAAAAXAJAAACAAAAAQIAAAAUUGF5bWVudCBub3QgYXR0YWNoZWQEAAAAD2Fzc2V0SWRSZWNlaXZlZAgFAAAAB3BheW1lbnQAAAAHYXNzZXRJZAQAAAASdG9rZW5SZWNlaXZlQW1vdW50CAUAAAAHcGF5bWVudAAAAAZhbW91bnQDAwkAAAAAAAACBQAAAA9hc3NldElkUmVjZWl2ZWQF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aWZ5AAAAAAYuHoBr", "chainId": 84, "height": 642328, "spentComplexity": 0 } View: original | compacted Prev: E3vfbtkmN1MFjtjdLJ9G6o5CvjKkw3ZNGepKuZYevCpX Next: B2LgimrneTiKrC1WT4AMSUmwMwu1H85FWJh5PNA5SeLi Diff:
OldNewDifferences
2626 then !(isDefined(getString(this, "fundA")))
2727 else false)
2828 then WriteSet([DataEntry("amountTokenA", j), DataEntry("fundA", "funded")])
29- else if ((i == c))
29+ else if (if ((i == c))
30+ then !(isDefined(getString(this, "fundB")))
31+ else false)
3032 then WriteSet([DataEntry("amountTokenB", j), DataEntry("fundB", "funded")])
3133 else throw("already funded or you try to fund with incorrect asset")
3234 }
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 3 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 let a = base58'3N3LWiYdT9n8o6ecwFZGy6MCehhq6sLUFFL'
55
66 let b = base58'9Jsnot7RWQmTsfXtezQN7igoS2q1QF1jsotaxwh8Fxp4'
77
88 let c = unit
99
1010 let d = 0
1111
1212 @Callable(e)
1313 func fund () = {
1414 let f = {
1515 let g = e.payment
1616 if ($isInstanceOf(g, "AttachedPayment"))
1717 then {
1818 let h = g
1919 h
2020 }
2121 else throw("Payment not attached")
2222 }
2323 let i = f.assetId
2424 let j = f.amount
2525 if (if ((i == b))
2626 then !(isDefined(getString(this, "fundA")))
2727 else false)
2828 then WriteSet([DataEntry("amountTokenA", j), DataEntry("fundA", "funded")])
29- else if ((i == c))
29+ else if (if ((i == c))
30+ then !(isDefined(getString(this, "fundB")))
31+ else false)
3032 then WriteSet([DataEntry("amountTokenB", j), DataEntry("fundB", "funded")])
3133 else throw("already funded or you try to fund with incorrect asset")
3234 }
3335
3436
3537
3638 @Callable(e)
3739 func exchanger (k) = if (if ((0 > d))
3840 then true
3941 else (d > 100))
4042 then throw("incorrect comission value")
4143 else {
4244 let l = getIntegerValue(this, "amountTokenB")
4345 let m = getIntegerValue(this, "amountTokenA")
4446 let f = {
4547 let g = e.payment
4648 if ($isInstanceOf(g, "AttachedPayment"))
4749 then {
4850 let h = g
4951 h
5052 }
5153 else throw("Payment not attached")
5254 }
5355 let i = f.assetId
5456 let j = f.amount
5557 if ((i == c))
5658 then {
5759 let n = ((fraction(m, j, (j + l)) * (100 - d)) / 100)
5860 if ((k > n))
5961 then throw("Price has changed dramaticaly. Receiving token amount don't satisfy specified price level")
6062 else {
6163 let o = b
6264 ScriptResult(WriteSet([DataEntry("amountTokenA", (m - n)), DataEntry("amountTokenB", (l + j))]), TransferSet([ScriptTransfer(e.caller, n, o)]))
6365 }
6466 }
6567 else if ((i == b))
6668 then {
6769 let n = ((fraction(l, j, (j + m)) * (100 - d)) / 100)
6870 if ((k > n))
6971 then throw("Price has changed dramaticaly. Receiving token amount don't satisfy specified price level")
7072 else {
7173 let o = c
7274 ScriptResult(WriteSet([DataEntry("amountTokenA", (m + j)), DataEntry("amountTokenB", (l - n))]), TransferSet([ScriptTransfer(e.caller, n, o)]))
7375 }
7476 }
7577 else throw("Asset is not allowed")
7678 }
7779
7880
7981
8082 @Callable(e)
8183 func withdraw () = {
8284 let p = assetBalance(this, b)
8385 let q = assetBalance(this, c)
8486 if ((e.caller.bytes == a))
8587 then ScriptResult(WriteSet([DataEntry("amountTokenA", "withdrawn"), DataEntry("amountTokenB", "withdrawn")]), TransferSet([ScriptTransfer(e.caller, p, b), ScriptTransfer(e.caller, q, c)]))
8688 else throw("You are not exchanger's owner")
8789 }
8890
8991
9092 @Verifier(e)
9193 func r () = true
9294

github/deemru/w8io/026f985 
28.79 ms