tx · 9ns78H1h3uZ9rdJd1AJbnoGEANuwT1uZ26Jq1tiA9yYm

3MpVFGJWgiGyh5LmE1nxNLsjjtSL3Bgh9NV:  -0.01400000 Waves

2019.08.30 16:08 [654026] smart account 3MpVFGJWgiGyh5LmE1nxNLsjjtSL3Bgh9NV > SELF 0.00000000 Waves

{ "type": 13, "id": "9ns78H1h3uZ9rdJd1AJbnoGEANuwT1uZ26Jq1tiA9yYm", "fee": 1400000, "feeAssetId": null, "timestamp": 1567170467078, "version": 1, "sender": "3MpVFGJWgiGyh5LmE1nxNLsjjtSL3Bgh9NV", "senderPublicKey": "854p8BYzrj6yBPRPmfQur3oF1Rjc1AJ548qRp5FT5kDa", "proofs": [ "3a1gWRvwcf8pKPX9DGDgeDu27TsiJcMvXxNZjdDx31mvBP6k1fNmETv5xvMQi6DwbpgUmAgpjRRko4NjD56hS5wm" ], "script": "base64:AAIDAAAAAAAAAAAAAAAEAAAAAAVvd25lcgEAAAAaAVRFbm0V+EOCq2NTOJsSE2133z0GcAjjvP8AAAAADWFzc2V0SWRUb2tlbkEBAAAAIEMzbeDGHf4oU+zuHGjXevUoBPuFN8LOz9CQD8ug/yo1AAAAAA1hc3NldElkVG9rZW5CAQAAACCqoUHYIr+9N/tCdWkhfZ3SevjX3HPTosOWNfoRj9syOgAAAAAJY29taXNzaW9uAAAAAAAAAAAKAAAABAAAAApjb250ZXh0T2JqAQAAAARmdW5kAAAAAAQAAAAHcGF5bWVudAQAAAAHJG1hdGNoMAgFAAAACmNvbnRleHRPYmoAAAAHcGF5bWVudAMJAAABAAAAAgUAAAAHJG1hdGNoMAIAAAAPQXR0YWNoZWRQYXltZW50BAAAAAFwBQAAAAckbWF0Y2gwBQAAAAFwCQAAAgAAAAECAAAAFFBheW1lbnQgbm90IGF0dGFjaGVkBAAAAA9hc3NldElkUmVjZWl2ZWQIBQAAAAdwYXltZW50AAAAB2Fzc2V0SWQEAAAAEnRva2VuUmVjZWl2ZUFtb3VudAgFAAAAB3BheW1l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AAQAAAApjb250ZXh0T2JqAQAAAAZ2ZXJpZnkAAAAABm1XTIM=", "chainId": 84, "height": 654026, "spentComplexity": 0 } View: original | compacted Prev: 7N4UBN22zGYXZFsWzXE3XLQyiJayH2jtZk79tcBCM2YU Next: 89GMYyqTFG1YxNE81JHxnRb9KEb53Niv6P4srhuA8Lm8 Diff:
OldNewDifferences
2222 }
2323 let i = f.assetId
2424 let j = f.amount
25- if (if ((i == b))
26- then !(isDefined(getBoolean(this, "fundA")))
27- else false)
25+ if ((i == b))
2826 then WriteSet([DataEntry("amountTokenA", j), DataEntry("fundA", true)])
2927 else if (if ((i == c))
3028 then !(isDefined(getBoolean(this, "fundB")))
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 3 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 let a = base58'3MvFCghS4jJ7E5QuJfKa4LwCoHJiAcsDQrA'
55
66 let b = base58'5XKoQDZphxtgtXxm36qhXrYo1F6mRLa9M8QHUDPWQ4mi'
77
88 let c = base58'CV4vfjkevn3aJ4tKaMn9gPHugYztu6RhDw2ete34SxiV'
99
1010 let d = 10
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
25- if (if ((i == b))
26- then !(isDefined(getBoolean(this, "fundA")))
27- else false)
25+ if ((i == b))
2826 then WriteSet([DataEntry("amountTokenA", j), DataEntry("fundA", true)])
2927 else if (if ((i == c))
3028 then !(isDefined(getBoolean(this, "fundB")))
3129 else false)
3230 then WriteSet([DataEntry("amountTokenB", j), DataEntry("fundB", true)])
3331 else throw("already funded or you try to fund with incorrect asset")
3432 }
3533
3634
3735
3836 @Callable(e)
3937 func replenishment () = {
4038 let f = {
4139 let g = e.payment
4240 if ($isInstanceOf(g, "AttachedPayment"))
4341 then {
4442 let h = g
4543 h
4644 }
4745 else throw("Payment not attached")
4846 }
4947 let i = f.assetId
5048 let j = f.amount
5149 if (if ((i == b))
5250 then isDefined(getBoolean(this, "fundA"))
5351 else false)
5452 then {
5553 let k = getIntegerValue(this, "amountTokenA")
5654 WriteSet([DataEntry("amountTokenA", (k + j))])
5755 }
5856 else if (if ((i == c))
5957 then isDefined(getBoolean(this, "fundB"))
6058 else false)
6159 then {
6260 let l = getIntegerValue(this, "amountTokenB")
6361 WriteSet([DataEntry("amountTokenA", (l + j))])
6462 }
6563 else throw("there was an error in the replenishment")
6664 }
6765
6866
6967
7068 @Callable(e)
7169 func exchanger (m) = if (if ((0 > d))
7270 then true
7371 else (d > 100))
7472 then throw("incorrect comission value")
7573 else {
7674 let l = getIntegerValue(this, "amountTokenB")
7775 let k = getIntegerValue(this, "amountTokenA")
7876 let f = {
7977 let g = e.payment
8078 if ($isInstanceOf(g, "AttachedPayment"))
8179 then {
8280 let h = g
8381 h
8482 }
8583 else throw("Payment not attached")
8684 }
8785 let i = f.assetId
8886 let j = f.amount
8987 if ((i == c))
9088 then {
9189 let n = ((fraction(k, j, (j + l)) * (100 - d)) / 100)
9290 if ((m > n))
9391 then throw("Price has changed dramaticaly. Receiving token amount don't satisfy specified price level")
9492 else {
9593 let o = b
9694 ScriptResult(WriteSet([DataEntry("amountTokenA", (k - n)), DataEntry("amountTokenB", (l + j))]), TransferSet([ScriptTransfer(e.caller, n, o)]))
9795 }
9896 }
9997 else if ((i == b))
10098 then {
10199 let n = ((fraction(l, j, (j + k)) * (100 - d)) / 100)
102100 if ((m > n))
103101 then throw("Price has changed dramaticaly. Receiving token amount don't satisfy specified price level")
104102 else {
105103 let o = c
106104 ScriptResult(WriteSet([DataEntry("amountTokenA", (k + j)), DataEntry("amountTokenB", (l - n))]), TransferSet([ScriptTransfer(e.caller, n, o)]))
107105 }
108106 }
109107 else throw("Asset is not allowed")
110108 }
111109
112110
113111
114112 @Callable(e)
115113 func withdraw () = {
116114 let p = assetBalance(this, b)
117115 let q = assetBalance(this, c)
118116 if ((e.caller.bytes == a))
119117 then ScriptResult(WriteSet([DataEntry("amountTokenA", "withdrawn"), DataEntry("amountTokenB", "withdrawn")]), TransferSet([ScriptTransfer(e.caller, p, b), ScriptTransfer(e.caller, q, c)]))
120118 else throw("You are not exchanger's owner")
121119 }
122120
123121
124122 @Verifier(e)
125123 func r () = true
126124

github/deemru/w8io/026f985 
40.66 ms