tx · G65XF1r2QV6hbrSmMNaGThHX95ar6fBuwSbSEjiM17DW

3MuBakQdFAobmsHH371bKVYNed6yA9Y2Wfy:  -0.01400000 Waves

2021.05.25 15:52 [1541212] smart account 3MuBakQdFAobmsHH371bKVYNed6yA9Y2Wfy > SELF 0.00000000 Waves

{ "type": 13, "id": "G65XF1r2QV6hbrSmMNaGThHX95ar6fBuwSbSEjiM17DW", "fee": 1400000, "feeAssetId": null, "timestamp": 1621947192737, "version": 2, "chainId": 84, "sender": "3MuBakQdFAobmsHH371bKVYNed6yA9Y2Wfy", "senderPublicKey": "9BAE85H9Tsey8NGdpT5HxdVYHBCmY1prGiG1TSQJxnZe", "proofs": [ "61VhKaQs5ama9eub6ZguBwUMYBBqdc2wCx83AFmzCMw4R78TegeynifWFvxmxjF3c62phqbeBD9SQuwNnhnr8K8U" ], "script": "base64:AAIEAAAAAAAAABcIAhIDCgEIEgMKAQESAwoBARIECgIIAQAAAAsBAAAADmdldE51bWJlckJ5S2V5AAAAAQAAAANrZXkEAAAABm51bWJlcgQAAAAHJG1hdGNoMAkABBoAAAACBQAAAAR0aGlzBQAAAANrZXkDCQAAAQAAAAIFAAAAByRtYXRjaDACAAAAA0ludAQAAAABYQUAAAAHJG1hdGNoMAUAAAABYQAAAAAAAAAAAAUAAAAGbnVtYmVyAAAAAAROT05FAgAAAARub25lAQAAAA5nZXRTdHJpbmdCeUtleQAAAAEAAAADa2V5BAAAAAZzdHJpbmcEAAAAByRtYXRjaDAJAAQdAAAAAgUAAAAEdGhpcwUAAAADa2V5AwkAAAEAAAACBQAAAAckbWF0Y2gwAgAAAAZTdHJpbmcEAAAAAWEFAAAAByRtYXRjaDAFAAAAAWEFAAAABE5PTkUFAAAABnN0cmluZwEAAAAPZ2V0S2V5VXNlckVtYWlsAAAAAQAAAAR1c2VyCQABLAAAAAIJAAEsAAAAAgIAAAAFdXNlcl8FAAAABHVzZXICAAAABl9lbWFpbAEAAAARZ2V0VmFsdWVVc2VyRW1haWwAAAAB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2UAAAAABQAAAAhxdWFudGl0eQUAAAADbmlsAAAAAWkBAAAADXRyYW5zZmVyVG9rZW4AAAACAAAACXJlY2lwaWVudAAAAAZhbW91bnQFAAAAA25pbAAAAAEAAAACdHgBAAAABnZlcmlmeQAAAAAJAAH0AAAAAwgFAAAAAnR4AAAACWJvZHlCeXRlcwkAAZEAAAACCAUAAAACdHgAAAAGcHJvb2ZzAAAAAAAAAAAACAUAAAACdHgAAAAPc2VuZGVyUHVibGljS2V5M+0zDQ==", "height": 1541212, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 2haiFjzhL9m2D1FczgfTZssMfnSkqeUsu18v6sURC1jC Next: GkugvFiuFa4mRTGcSj3TdPZ4oVe4MKa2gQfpYJr2uZ8f Diff:
OldNewDifferences
3131 func getValueUserEmail (user) = getStringByKey(getKeyUserEmail(user))
3232
3333
34+func getKeyUserBalance (user) = (("user_" + user) + "balance")
35+
36+
37+func getValueUserBalance (user) = getNumberByKey(getKeyUserBalance(user))
38+
39+
3440 func getKeyDAppAssetId () = "dApp_assetId"
3541
3642
3743 func getValueDAppAssetId () = getStringByKey(getKeyDAppAssetId())
44+
45+
46+func getKeyDAppBalance () = "dApp_assetId"
47+
48+
49+func getValueDAppAmount () = getStringByKey(getKeyDAppBalance())
3850
3951
4052 @Callable(i)
4355 let currentUserEmail = getValueUserEmail(currentUserAddress)
4456 if ((currentUserEmail != NONE))
4557 then throw("user is already registered")
46- else [StringEntry(getKeyUserEmail(currentUserAddress), email)]
58+ else [StringEntry(getKeyUserEmail(currentUserAddress), email), IntegerEntry(getKeyUserBalance(currentUserAddress), 0)]
4759 }
4860
4961
5668 else {
5769 let asset = Issue("NYAN-25", "NYAN-25 token", quantity, 0, true)
5870 let assetId = calculateAssetId(asset)
59-[asset, StringEntry(getKeyDAppAssetId(), toBase58String(assetId))]
71+[asset, StringEntry(getKeyDAppAssetId(), toBase58String(assetId)), IntegerEntry(getKeyDAppBalance(), quantity)]
6072 }
6173 }
6274
6779 let dAppAssetId = getValueDAppAssetId()
6880 if ((dAppAssetId == NONE))
6981 then throw("token has not been issued")
70- else [Reissue(fromBase58String(dAppAssetId), quantity, true)]
82+ else [Reissue(fromBase58String(dAppAssetId), quantity, true), IntegerEntry(getKeyDAppBalance(), quantity)]
7183 }
84+
85+
86+
87+@Callable(i)
88+func transferToken (recipient,amount) = nil
7289
7390
7491 @Verifier(tx)
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 4 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 func getNumberByKey (key) = {
55 let number = match getInteger(this, key) {
66 case a: Int =>
77 a
88 case _ =>
99 0
1010 }
1111 number
1212 }
1313
1414
1515 let NONE = "none"
1616
1717 func getStringByKey (key) = {
1818 let string = match getString(this, key) {
1919 case a: String =>
2020 a
2121 case _ =>
2222 NONE
2323 }
2424 string
2525 }
2626
2727
2828 func getKeyUserEmail (user) = (("user_" + user) + "_email")
2929
3030
3131 func getValueUserEmail (user) = getStringByKey(getKeyUserEmail(user))
3232
3333
34+func getKeyUserBalance (user) = (("user_" + user) + "balance")
35+
36+
37+func getValueUserBalance (user) = getNumberByKey(getKeyUserBalance(user))
38+
39+
3440 func getKeyDAppAssetId () = "dApp_assetId"
3541
3642
3743 func getValueDAppAssetId () = getStringByKey(getKeyDAppAssetId())
44+
45+
46+func getKeyDAppBalance () = "dApp_assetId"
47+
48+
49+func getValueDAppAmount () = getStringByKey(getKeyDAppBalance())
3850
3951
4052 @Callable(i)
4153 func signUp (email) = {
4254 let currentUserAddress = toBase58String(i.caller.bytes)
4355 let currentUserEmail = getValueUserEmail(currentUserAddress)
4456 if ((currentUserEmail != NONE))
4557 then throw("user is already registered")
46- else [StringEntry(getKeyUserEmail(currentUserAddress), email)]
58+ else [StringEntry(getKeyUserEmail(currentUserAddress), email), IntegerEntry(getKeyUserBalance(currentUserAddress), 0)]
4759 }
4860
4961
5062
5163 @Callable(i)
5264 func issueToken (quantity) = {
5365 let dAppAssetId = getValueDAppAssetId()
5466 if ((dAppAssetId != NONE))
5567 then throw("token has already been issued")
5668 else {
5769 let asset = Issue("NYAN-25", "NYAN-25 token", quantity, 0, true)
5870 let assetId = calculateAssetId(asset)
59-[asset, StringEntry(getKeyDAppAssetId(), toBase58String(assetId))]
71+[asset, StringEntry(getKeyDAppAssetId(), toBase58String(assetId)), IntegerEntry(getKeyDAppBalance(), quantity)]
6072 }
6173 }
6274
6375
6476
6577 @Callable(i)
6678 func reissueToken (quantity) = {
6779 let dAppAssetId = getValueDAppAssetId()
6880 if ((dAppAssetId == NONE))
6981 then throw("token has not been issued")
70- else [Reissue(fromBase58String(dAppAssetId), quantity, true)]
82+ else [Reissue(fromBase58String(dAppAssetId), quantity, true), IntegerEntry(getKeyDAppBalance(), quantity)]
7183 }
84+
85+
86+
87+@Callable(i)
88+func transferToken (recipient,amount) = nil
7289
7390
7491 @Verifier(tx)
7592 func verify () = sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey)
7693

github/deemru/w8io/169f3d6 
27.88 ms