tx · 8eAZXqdiowrtgvgRXTPy9oT42cDPR1LfHqg1pD5BHSdB

3N5jpkcHiH5R36y9cYnoXhVHe4pxRkS3peF:  -0.01400000 Waves

2020.03.11 21:45 [904858] smart account 3N5jpkcHiH5R36y9cYnoXhVHe4pxRkS3peF > SELF 0.00000000 Waves

{ "type": 13, "id": "8eAZXqdiowrtgvgRXTPy9oT42cDPR1LfHqg1pD5BHSdB", "fee": 1400000, "feeAssetId": null, "timestamp": 1583952337172, "version": 1, "sender": "3N5jpkcHiH5R36y9cYnoXhVHe4pxRkS3peF", "senderPublicKey": "9v3cUhWaBqFKLuHQTbz2osNsxRANDcpaRZja43mFNkR3", "proofs": [ "Qg64zZiWh4XoPC2pVEkuLQZYSy4RWhfgP84W1xrZMbAhALe2pMYFMV1MbBJjRbDvAqfVUa2pf4N1khniqY6h3kP" ], "script": "base64:AAIDAAAAAAAAAA0IARIAEgASABIDCgEBAAAABQAAAAAGRVVDb2luAQAAACDJofoUphCC2vgdQrn0R0tQm4QOreBLRVolNScltI/WUQAAAAAGVVNDb2luAQAAACCWpimiLpI8FZFaHXIW3ZwI74bEgcPecoAv5ODcRcQ7/QAAAAAOb3duZXJQdWJsaWNLZXkBAAAAIIR0OzhzTJc1ozXjp3CfISpQxO2vbrCrTGSiFABFRe8mAAAAAA1PcmFjbGVBZGRyZXNzCQEAAAAHQWRkcmVzcwAAAAEJAAGbAAAAAQIAAAAjM05BY29lV2RVVFduOGNzWEpQRzQ3djFGanRqY2ZxeGI1dHUBAAAADmdldE51bWJlckJ5S2V5AAAAAQAAAANrZXkEAAAAByRtYXRjaDAJAAQaAAAAAgUAAAANT3JhY2xlQWRkcmVzcwUAAAADa2V5AwkAAAEAAAACBQAAAAckbWF0Y2gwAgAAAANJbnQEAAAAAWEFAAAAByRtYXRjaDAFAAAAAWEAAAAAAAAAAAAAAAAEAAAAAWkBAAAAB2RlcG9zaXQAAAAABAAAAANwbXQJAQAAAAdleHRyYWN0AAAAAQgFAAAAAWkAAA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Ps3k=", "chainId": 84, "height": 904858, "spentComplexity": 0 } View: original | compacted Prev: LYgpPWDB1NfNMrEGAeuLL7FvKoFP38akb7dALPW1jtw Next: GSCiShWzB6Mzf1kREHM4bdrG1SxVqp8RkBy3RHqAwYTM Diff:
OldNewDifferences
110110 else 0
111111 }
112112 let m = e("waves_usd_2")
113- let n = ((j.amount / m) * 100)
113+ let n = j.amount
114114 let o = (l - n)
115115 if ((0 > j.amount))
116116 then throw("Can't withdraw negative amount")
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 3 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 let a = base58'Ea6CdDfumo8ZFecxUSWKAjZpQXmkRC79WB4ktu3KffPn'
55
66 let b = base58'B957NA5BEM8quCDhe1fUPkqBSdCZdJunNxjGE8FRJkWx'
77
88 let c = base58'9v3cUhWaBqFKLuHQTbz2osNsxRANDcpaRZja43mFNkR3'
99
1010 let d = Address(toBytes("3NAcoeWdUTWn8csXJPG47v1Fjtjcfqxb5tu"))
1111
1212 func e (f) = {
1313 let g = getInteger(d, f)
1414 if ($isInstanceOf(g, "Int"))
1515 then {
1616 let h = g
1717 h
1818 }
1919 else 0
2020 }
2121
2222
2323 @Callable(i)
2424 func deposit () = {
2525 let j = extract(i.payment)
2626 if (isDefined(j.assetId))
2727 then if ((j.assetId == b))
2828 then {
2929 let k = toBase58String(i.caller.bytes)
3030 let l = {
3131 let g = getInteger(this, (k + "_uscoin"))
3232 if ($isInstanceOf(g, "Int"))
3333 then {
3434 let h = g
3535 h
3636 }
3737 else 0
3838 }
3939 let m = e("waves_usd_2")
4040 let n = (j.amount * 100)
4141 let o = (l + j.amount)
4242 ScriptResult(WriteSet([DataEntry((k + "_uscoin"), o)]), TransferSet([ScriptTransfer(i.caller, n, a)]))
4343 }
4444 else throw("can hodl USCoin only at the moment")
4545 else {
4646 let k = toBase58String(i.caller.bytes)
4747 let l = {
4848 let g = getInteger(this, (k + "_waves"))
4949 if ($isInstanceOf(g, "Int"))
5050 then {
5151 let h = g
5252 h
5353 }
5454 else 0
5555 }
5656 let m = e("waves_usd_2")
5757 let n = j.amount
5858 let o = (l + j.amount)
5959 ScriptResult(WriteSet([DataEntry((k + "_waves"), o)]), TransferSet([ScriptTransfer(i.caller, n, a)]))
6060 }
6161 }
6262
6363
6464
6565 @Callable(i)
6666 func withdrawUSCoin () = {
6767 let j = extract(i.payment)
6868 if (isDefined(j.assetId))
6969 then if ((j.assetId == a))
7070 then {
7171 let k = toBase58String(i.caller.bytes)
7272 let l = {
7373 let g = getInteger(this, (k + "_uscoin"))
7474 if ($isInstanceOf(g, "Int"))
7575 then {
7676 let h = g
7777 h
7878 }
7979 else 0
8080 }
8181 let m = e("waves_usd_2")
8282 let n = (j.amount / 100)
8383 let o = (l - n)
8484 if ((0 > j.amount))
8585 then throw("Can't withdraw negative amount")
8686 else if ((0 > o))
8787 then throw("Not enough USCoin Deposited")
8888 else ScriptResult(WriteSet([DataEntry((k + "_uscoin"), o)]), TransferSet([ScriptTransfer(i.caller, n, b)]))
8989 }
9090 else throw("You Can Withdraw with EUCoin only")
9191 else throw("You Can Withdraw with EUCoin only")
9292 }
9393
9494
9595
9696 @Callable(i)
9797 func withdrawWaves () = {
9898 let j = extract(i.payment)
9999 if (isDefined(j.assetId))
100100 then if ((j.assetId == a))
101101 then {
102102 let k = toBase58String(i.caller.bytes)
103103 let l = {
104104 let g = getInteger(this, (k + "_waves"))
105105 if ($isInstanceOf(g, "Int"))
106106 then {
107107 let h = g
108108 h
109109 }
110110 else 0
111111 }
112112 let m = e("waves_usd_2")
113- let n = ((j.amount / m) * 100)
113+ let n = j.amount
114114 let o = (l - n)
115115 if ((0 > j.amount))
116116 then throw("Can't withdraw negative amount")
117117 else if ((0 > o))
118118 then throw("Not enough Waves Deposited")
119119 else ScriptResult(WriteSet([DataEntry((k + "_waves"), o)]), TransferSet([ScriptTransfer(i.caller, n, unit)]))
120120 }
121121 else throw("You Can Withdraw with EUCoin only")
122122 else throw("You Can Withdraw with EUCoin only")
123123 }
124124
125125
126126
127127 @Callable(i)
128128 func getFaucet (p) = {
129129 let k = toBase58String(i.caller.bytes)
130130 let l = {
131131 let g = getInteger(this, (k + "_faucet"))
132132 if ($isInstanceOf(g, "Int"))
133133 then {
134134 let h = g
135135 h
136136 }
137137 else 0
138138 }
139139 if ((0 > p))
140140 then throw("Can't withdraw negative amount")
141141 else if ((l > 0))
142142 then throw("Faucet already taken")
143143 else ScriptResult(WriteSet([DataEntry((k + "_faucet"), p)]), TransferSet([ScriptTransfer(i.caller, p, a)]))
144144 }
145145
146146
147147 @Verifier(q)
148148 func r () = {
149149 let g = q
150150 if ($isInstanceOf(g, "SetScriptTransaction"))
151151 then {
152152 let s = g
153153 sigVerify(q.bodyBytes, q.proofs[0], c)
154154 }
155155 else if ($isInstanceOf(g, "DataTransaction"))
156156 then {
157157 let s = g
158158 true
159159 }
160160 else false
161161 }
162162

github/deemru/w8io/169f3d6 
28.30 ms