tx · GAcviWtbFfJfS3JLGtDAKkdDvLGBE8hkBY4sDK4Mb9aH

3NC7GJvfMCykyTMSe9KU2rJmVygk1fzzKpC:  -0.01400000 Waves

2020.04.10 13:08 [948106] smart account 3NC7GJvfMCykyTMSe9KU2rJmVygk1fzzKpC > SELF 0.00000000 Waves

{ "type": 13, "id": "GAcviWtbFfJfS3JLGtDAKkdDvLGBE8hkBY4sDK4Mb9aH", "fee": 1400000, "feeAssetId": null, "timestamp": 1586513354299, "version": 1, "sender": "3NC7GJvfMCykyTMSe9KU2rJmVygk1fzzKpC", "senderPublicKey": "BNrrKkZSXXCbcCtXLT3VMQnSAJt2jt8TLnZWaB5US3Ci", "proofs": [ "4uyBKdwVvN9qzR1GFef3tTK8q8uWnT6ZbjYs91Gcbqq4ZZdkbNQcG7fPtftc3mqBGoEnM1ofuHKxniDETwvTTaaT" ], "script": "base64:AAIDAAAAAAAAAAoIARIAEgQKAgEIAAAAAwEAAAAKZ2V0QmFsYW5jZQAAAAIAAAAHYWRkcmVzcwAAAAdhc3NldElkBAAAAAFiCQAEGgAAAAIFAAAABHRoaXMJAAEsAAAAAgkAASwAAAACBQAAAAdhZGRyZXNzAgAAAAFfBQAAAAdhc3NldElkBAAAAAckbWF0Y2gwBQAAAAFiAwkAAAEAAAACBQAAAAckbWF0Y2gwAgAAAANJbnQEAAAAAXQFAAAAByRtYXRjaDAFAAAAAXQAAAAAAAAAAAABAAAACmdldEFzc2V0SWQAAAABAAAAB2Fzc2V0SWQEAAAAByRtYXRjaDAFAAAAB2Fzc2V0SWQDCQAAAQAAAAIFAAAAByRtYXRjaDACAAAACkJ5dGVWZWN0b3IEAAAAAWIFAAAAByRtYXRjaDAJAAJYAAAAAQUAAAABYgIAAAAFV0FWRVMBAAAADmFzc2V0SWRUb0J5dGVzAAAAAQAAAAdhc3NldElkAwMJAAAAAAAAAgUAAAAHYXNzZXRJZAIAAAAFV0FWRVMGCQAAAAAAAAIFAAAAB2Fzc2V0SWQCAAAAAAUAA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AAwgFAAAAAWkAAAAGY2FsbGVyBQAAAAZhbW91bnQJAQAAAA5hc3NldElkVG9CeXRlcwAAAAEFAAAAB2Fzc2V0SWQFAAAAA25pbAkAAAIAAAABCQABLAAAAAICAAAAEFlvdXIgYmFsYW5jZSBpcyAJAAGkAAAAAQUAAAADYmFsAAAAAD4Dc2k=", "chainId": 84, "height": 948106, "spentComplexity": 0 } View: original | compacted Prev: D1pfZeBq4bqTMMABvr8SAsC3RfyNwiakJC9Je2fHgeDf Next: 81c7LxywrdGVVtpVT4JLCDZa4vEgSAUYZVEfBN1VfaUD Diff:
OldNewDifferences
11 {-# STDLIB_VERSION 3 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
4-let usdn = base58'3KFXBGGLCjA5Z2DuW4Dq9fDDrHjJJP1ZEkaoajSzuKsC'
5-
64 func getBalance (address,assetId) = {
75 let b = getInteger(this, ((address + "_") + assetId))
86 match b {
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 3 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
4-let usdn = base58'3KFXBGGLCjA5Z2DuW4Dq9fDDrHjJJP1ZEkaoajSzuKsC'
5-
64 func getBalance (address,assetId) = {
75 let b = getInteger(this, ((address + "_") + assetId))
86 match b {
97 case t: Int =>
108 t
119 case _ =>
1210 0
1311 }
1412 }
1513
1614
1715 func getAssetId (assetId) = match assetId {
1816 case b: ByteVector =>
1917 toBase58String(b)
2018 case _ =>
2119 "WAVES"
2220 }
2321
2422
2523 func assetIdToBytes (assetId) = if (if ((assetId == "WAVES"))
2624 then true
2725 else (assetId == ""))
2826 then unit
2927 else fromBase58String(assetId)
3028
3129
3230 @Callable(i)
3331 func deposit () = {
3432 let address = toBase58String(i.caller.bytes)
3533 let payment = extract(i.payment)
3634 let assetId = getAssetId(payment.assetId)
3735 let bal = getBalance(address, assetId)
3836 ScriptResult(WriteSet([DataEntry(((address + "_") + assetId), (bal + payment.amount))]), TransferSet(nil))
3937 }
4038
4139
4240
4341 @Callable(i)
4442 func withdraw (amount,assetId) = {
4543 let address = toBase58String(i.caller.bytes)
4644 let bal = getBalance(address, assetId)
4745 if ((bal >= amount))
4846 then ScriptResult(WriteSet([DataEntry(((address + "_") + assetId), (bal - amount))]), TransferSet([ScriptTransfer(i.caller, amount, assetIdToBytes(assetId))]))
4947 else throw(("Your balance is " + toString(bal)))
5048 }
5149
5250

github/deemru/w8io/026f985 
32.22 ms