tx · EfuQpcbfFVtHihDajF44cspjSSdrpkjw5S6RcmgFkPMX

3MtoBpCc3s2T4CxasJ5MXrZZsU339D28mvD:  -0.01400000 Waves

2021.05.25 17:46 [1541319] smart account 3MtoBpCc3s2T4CxasJ5MXrZZsU339D28mvD > SELF 0.00000000 Waves

{ "type": 13, "id": "EfuQpcbfFVtHihDajF44cspjSSdrpkjw5S6RcmgFkPMX", "fee": 1400000, "feeAssetId": null, "timestamp": 1621953990515, "version": 2, "chainId": 84, "sender": "3MtoBpCc3s2T4CxasJ5MXrZZsU339D28mvD", "senderPublicKey": "8SRjg8K8B7rhV2pih6qRgku886VQE4phwNCDjWZu1fUe", "proofs": [ "5Q2jY13ptzCsaJn7P6uYmpFLmLHDcHjVRMSLY5Pf14Friiuza6vUZYrv9npewwABR1fDyQeXrDvKMXcMcqg2Zjn4" ], "script": "base64:AAIEAAAAAAAAACYIAhIDCgEIEgMKAQESAwoBARIECgIIARIHCgUICAEBCBIECgIIAQAAABEBAAAADmdldE51bWJlckJ5S2V5AAAAAQAAAANrZXkEAAAABm51bWJlcgQAAAAHJG1hdGNoMAkABBoAAAACBQAAAAR0aGlzBQAAAANrZXkDCQAAAQAAAAIFAAAAByRtYXRjaDACAAAAA0ludAQAAAABYQUAAAAHJG1hdGNoMAUAAAABYQAAAAAAAAAAAAUAAAAGbnVtYmVyAAAAAAROT05FAgAAAARub25lAQAAAA5nZXRTdHJpbmdCeUtleQAAAAEAAAADa2V5BAAAAAZzdHJpbmcEAAAAByRtYXRjaDAJAAQdAAAAAgUAAAAEdGhpcwUAAAADa2V5AwkAAAEAAAACBQAAAAckbWF0Y2gwAgAAAAZTdHJpbmcEAAAAAWEFAAAAByRtYXRjaDAFAAAAAWEFAAAABE5PTkUFAAAABnN0cmluZwEAAAAPZ2V0S2V5VXNlckVtYWlsAAAAAQAAAAR1c2VyCQABLAAAAAIJAAEsAAAAAgIAAAAFdXNlcl8FAAAABHVzZXICAAAABl9lbWFpbAEAAAARZ2V0VmF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cm4AAAACCQACWQAAAAEJAQAAABNnZXRWYWx1ZURBcHBBc3NldElkAAAAAAUAAAADc3VtBQAAAANuaWwAAAABAAAAAnR4AQAAAAZ2ZXJpZnkAAAAACQAB9AAAAAMIBQAAAAJ0eAAAAAlib2R5Qnl0ZXMJAAGRAAAAAggFAAAAAnR4AAAABnByb29mcwAAAAAAAAAAAAgFAAAAAnR4AAAAD3NlbmRlclB1YmxpY0tledx9G5w=", "height": 1541319, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 694TW1NM2jaP8bZyiDyPmYTWfRk6UsAiPwBmoUDTmog9 Next: 8Mfx3ETERxpzSbEvjscH9bqkWbPokQfcDG9eAuhAwdbg Diff:
OldNewDifferences
136136 }
137137
138138
139-@Verifier(Q)
140-func R () = sigVerify(Q.bodyBytes, Q.proofs[0], Q.senderPublicKey)
139+
140+@Callable(y)
141+func exchangeAssetToken (E,I) = {
142+ let A = toBase58String(y.caller.bytes)
143+ let K = assetBalance(Address(fromBase58String(A)), fromBase58String(o()))
144+ let Q = v(E)
145+ let R = (Q * I)
146+ let L = (K - R)
147+ if ((0 > L))
148+ then throw("not enoung balance")
149+ else [ScriptTransfer(Address(fromBase58String(A)), I, fromBase58String(E)), Burn(fromBase58String(o()), R)]
150+ }
151+
152+
153+@Verifier(S)
154+func T () = sigVerify(S.bodyBytes, S.proofs[0], S.senderPublicKey)
141155
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 4 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 func a (b) = {
55 let c = {
66 let d = getInteger(this, b)
77 if ($isInstanceOf(d, "Int"))
88 then {
99 let e = d
1010 e
1111 }
1212 else 0
1313 }
1414 c
1515 }
1616
1717
1818 let f = "none"
1919
2020 func g (b) = {
2121 let h = {
2222 let d = getString(this, b)
2323 if ($isInstanceOf(d, "String"))
2424 then {
2525 let e = d
2626 e
2727 }
2828 else f
2929 }
3030 h
3131 }
3232
3333
3434 func i (j) = (("user_" + j) + "_email")
3535
3636
3737 func k (j) = g(i(j))
3838
3939
4040 func l (j) = (("user_" + j) + "_balance")
4141
4242
4343 func m (j) = a(l(j))
4444
4545
4646 func n () = "dApp_assetId"
4747
4848
4949 func o () = g(n())
5050
5151
5252 func p () = "dApp_balance"
5353
5454
5555 func q () = a(p())
5656
5757
5858 func r (s) = (("asset_" + s) + "_title")
5959
6060
6161 func t (s) = g(r(s))
6262
6363
6464 func u (s) = (("asset_" + s) + "_price")
6565
6666
6767 func v (s) = a(u(s))
6868
6969
7070 func w (s) = (("asset_" + s) + "_data")
7171
7272
7373 func x (s) = g(u(s))
7474
7575
7676 @Callable(y)
7777 func signUp (z) = {
7878 let A = toBase58String(y.caller.bytes)
7979 let B = k(A)
8080 if ((B != f))
8181 then throw("user is already registered")
8282 else [StringEntry(i(A), z), IntegerEntry(l(A), 0)]
8383 }
8484
8585
8686
8787 @Callable(y)
8888 func issueToken (C) = {
8989 let D = o()
9090 if ((D != f))
9191 then throw("token has already been issued")
9292 else {
9393 let s = Issue("NYAN-25", "NYAN-25 token", C, 0, true)
9494 let E = calculateAssetId(s)
9595 [s, StringEntry(n(), toBase58String(E)), IntegerEntry(p(), C)]
9696 }
9797 }
9898
9999
100100
101101 @Callable(y)
102102 func reissueToken (C) = {
103103 let D = o()
104104 if ((D == f))
105105 then throw("token has not been issued")
106106 else {
107107 let F = q()
108108 let G = (F + C)
109109 [Reissue(fromBase58String(D), C, true), IntegerEntry(p(), G)]
110110 }
111111 }
112112
113113
114114
115115 @Callable(y)
116116 func transferToken (H,I) = {
117117 let F = q()
118118 let J = (F - I)
119119 if ((0 > J))
120120 then throw("not enoung balance")
121121 else {
122122 let A = toBase58String(y.caller.bytes)
123123 let K = m(A)
124124 let L = (K + I)
125125 [IntegerEntry(p(), J), IntegerEntry(l(H), L), ScriptTransfer(Address(fromBase58String(H)), I, fromBase58String(o()))]
126126 }
127127 }
128128
129129
130130
131131 @Callable(y)
132132 func issueAssetToken (M,N,C,O,P) = {
133133 let s = Issue(M, N, C, 0, true)
134134 let E = calculateAssetId(s)
135135 [s, StringEntry(r(toBase58String(E)), M), IntegerEntry(u(toBase58String(E)), O), StringEntry(w(toBase58String(E)), P)]
136136 }
137137
138138
139-@Verifier(Q)
140-func R () = sigVerify(Q.bodyBytes, Q.proofs[0], Q.senderPublicKey)
139+
140+@Callable(y)
141+func exchangeAssetToken (E,I) = {
142+ let A = toBase58String(y.caller.bytes)
143+ let K = assetBalance(Address(fromBase58String(A)), fromBase58String(o()))
144+ let Q = v(E)
145+ let R = (Q * I)
146+ let L = (K - R)
147+ if ((0 > L))
148+ then throw("not enoung balance")
149+ else [ScriptTransfer(Address(fromBase58String(A)), I, fromBase58String(E)), Burn(fromBase58String(o()), R)]
150+ }
151+
152+
153+@Verifier(S)
154+func T () = sigVerify(S.bodyBytes, S.proofs[0], S.senderPublicKey)
141155

github/deemru/w8io/169f3d6 
40.41 ms