tx · D1pfZeBq4bqTMMABvr8SAsC3RfyNwiakJC9Je2fHgeDf

3NC7GJvfMCykyTMSe9KU2rJmVygk1fzzKpC:  -0.01400000 Waves

2020.04.10 13:07 [948105] smart account 3NC7GJvfMCykyTMSe9KU2rJmVygk1fzzKpC > SELF 0.00000000 Waves

{ "type": 13, "id": "D1pfZeBq4bqTMMABvr8SAsC3RfyNwiakJC9Je2fHgeDf", "fee": 1400000, "feeAssetId": null, "timestamp": 1586513288836, "version": 1, "sender": "3NC7GJvfMCykyTMSe9KU2rJmVygk1fzzKpC", "senderPublicKey": "BNrrKkZSXXCbcCtXLT3VMQnSAJt2jt8TLnZWaB5US3Ci", "proofs": [ "4K4gkS8b5RoZqS5NscFGLLvoCs31h7K8Zc1vjgsgP3dHeFwWYqaMck5fuWFJj1cg8n4dzc9Sd5c4iTGxj16pcjco" ], "script": "base64:AAIDAAAAAAAAAAoIARIAEgQKAgEIAAAABAAAAAAEdXNkbgEAAAAgImQ/Hr5gRukRahMT3KYz/hZ+B/l36bPyFfyZSSowCjcBAAAACmdldEJhbGFuY2UAAAACAAAAB2FkZHJlc3MAAAAHYXNzZXRJZAQAAAABYgkABBoAAAACBQAAAAR0aGlzCQABLAAAAAIJAAEsAAAAAgUAAAAHYWRkcmVzcwIAAAABXwUAAAAHYXNzZXRJZAQAAAAHJG1hdGNoMAUAAAABYgMJAAABAAAAAgUAAAAHJG1hdGNoMAIAAAADSW50BAAAAAF0BQAAAAckbWF0Y2gwBQAAAAF0AAAAAAAAAAAAAQAAAApnZXRBc3NldElkAAAAAQAAAAdhc3NldElkBAAAAAckbWF0Y2gwBQAAAAdhc3NldElkAwkAAAEAAAACBQAAAAckbWF0Y2gwAgAAAApCeXRlVmVjdG9yBAAAAAFiBQAAAAckbWF0Y2gwCQACWAAAAAEFAAAAAWICAAAABVdBVkVTAQAAAA5hc3NldElkVG9CeXRlcwAAAAEAAAAHYXNzZXRJZAMDCQAAAAAAAAIFAAAAB2Fzc2V0SWQCAAAAB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ZXJTZXQAAAABCQAETAAAAAIJAQAAAA5TY3JpcHRUcmFuc2ZlcgAAAAMIBQAAAAFpAAAABmNhbGxlcgUAAAAGYW1vdW50CQEAAAAOYXNzZXRJZFRvQnl0ZXMAAAABBQAAAAdhc3NldElkBQAAAANuaWwJAAACAAAAAQkAASwAAAACAgAAABBZb3VyIGJhbGFuY2UgaXMgCQABpAAAAAEFAAAAA2JhbAAAAADBIGbe", "chainId": 84, "height": 948105, "spentComplexity": 0 } View: original | compacted Prev: A23sR2sNWSQDrFEB3io77bLk2Tp2sMkJp3119GQDj5go Next: GAcviWtbFfJfS3JLGtDAKkdDvLGBE8hkBY4sDK4Mb9aH Diff:
OldNewDifferences
2222 }
2323
2424
25-func assetIdToBytes (assetId) = if ((assetId == "WAVES"))
25+func assetIdToBytes (assetId) = if (if ((assetId == "WAVES"))
26+ then true
27+ else (assetId == ""))
2628 then unit
2729 else fromBase58String(assetId)
2830
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 3 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 let usdn = base58'3KFXBGGLCjA5Z2DuW4Dq9fDDrHjJJP1ZEkaoajSzuKsC'
55
66 func getBalance (address,assetId) = {
77 let b = getInteger(this, ((address + "_") + assetId))
88 match b {
99 case t: Int =>
1010 t
1111 case _ =>
1212 0
1313 }
1414 }
1515
1616
1717 func getAssetId (assetId) = match assetId {
1818 case b: ByteVector =>
1919 toBase58String(b)
2020 case _ =>
2121 "WAVES"
2222 }
2323
2424
25-func assetIdToBytes (assetId) = if ((assetId == "WAVES"))
25+func assetIdToBytes (assetId) = if (if ((assetId == "WAVES"))
26+ then true
27+ else (assetId == ""))
2628 then unit
2729 else fromBase58String(assetId)
2830
2931
3032 @Callable(i)
3133 func deposit () = {
3234 let address = toBase58String(i.caller.bytes)
3335 let payment = extract(i.payment)
3436 let assetId = getAssetId(payment.assetId)
3537 let bal = getBalance(address, assetId)
3638 ScriptResult(WriteSet([DataEntry(((address + "_") + assetId), (bal + payment.amount))]), TransferSet(nil))
3739 }
3840
3941
4042
4143 @Callable(i)
4244 func withdraw (amount,assetId) = {
4345 let address = toBase58String(i.caller.bytes)
4446 let bal = getBalance(address, assetId)
4547 if ((bal >= amount))
4648 then ScriptResult(WriteSet([DataEntry(((address + "_") + assetId), (bal - amount))]), TransferSet([ScriptTransfer(i.caller, amount, assetIdToBytes(assetId))]))
4749 else throw(("Your balance is " + toString(bal)))
4850 }
4951
5052

github/deemru/w8io/026f985 
20.75 ms