tx · ANWaxYmofJ78bDAj6xZgLc9kSuJGundHCPp92YD5yifm

3Mu6VrDnLvDzfqA4nwe9a3bfJcym5H9fuaQ:  -0.00100000 Waves

2023.05.15 11:55 [2578855] smart account 3Mu6VrDnLvDzfqA4nwe9a3bfJcym5H9fuaQ > SELF 0.00000000 Waves

{ "type": 13, "id": "ANWaxYmofJ78bDAj6xZgLc9kSuJGundHCPp92YD5yifm", "fee": 100000, "feeAssetId": null, "timestamp": 1684140976242, "version": 2, "chainId": 84, "sender": "3Mu6VrDnLvDzfqA4nwe9a3bfJcym5H9fuaQ", "senderPublicKey": "71L2Po5e5f8uTcwDYnXjrBbiiGLX6dnC2SSJBD5Nw3xg", "proofs": [ "4oeKMeq6MTP6gAgro1ir3LohRyNTfx2rUCBYe2PdStYh2NmS5F6GvADgVbCm77mZVkzMhrdyQyZ9xDAooKcACsfz" ], "script": "base64:BgIJCAISABIDCgEBAAIBaQEHZGVwb3NpdAAEB3BheW1lbnQJAQV2YWx1ZQEIBQFpCHBheW1lbnRzAwMJAGYCCQCQAwEFB3BheW1lbnQAAQYJAQlpc0RlZmluZWQBCAkAkQMCBQdwYXltZW50AAAHYXNzZXRJZAkAAgECKFlvdSBjYW4gb25seSBvbmUgV0FWRVMgZGVwb3NpdCBhdCBhIHRpbWUECmN1cnJlbnRLZXkJANgEAQgIBQFpBmNhbGxlcgVieXRlcwQNY3VycmVudEFtb3VudAkBC3ZhbHVlT3JFbHNlAgkAmggCBQR0aGlzBQpjdXJyZW50S2V5AAAECW5ld0Ftb3VudAkAZAIFDWN1cnJlbnRBbW91bnQICQCRAwIFB3BheW1lbnQAAAZhbW91bnQJAMwIAgkBDEludGVnZXJFbnRyeQIFCmN1cnJlbnRLZXkFCW5ld0Ftb3VudAUDbmlsAWkBCHdpdGhkcmF3AQZhbW91bnQECmN1cnJlbnRLZXkJANgEAQgIBQFpBmNhbGxlcgVieXRlcwQNY3VycmVudEFtb3VudAkBC3ZhbHVlT3JFbHNlAgkAmggCBQR0aGlzBQpjdXJyZW50S2V5AAAECW5ld0Ftb3VudAkAZQIFDWN1cnJlbnRBbW91bnQFBmFtb3VudAMJAGYCAAAFBmFtb3VudAkAAgECH0Nhbm5vdCB3aXRoZHJhdyBuZWdhdGl2ZSBhbW91bnQDCQBmAgAABQluZXdBbW91bnQJAAIBAhJOb3QgZW5vdWdoIGJhbGFuY2UJAMwIAgkBDEludGVnZXJFbnRyeQIFCmN1cnJlbnRLZXkFCW5ld0Ftb3VudAkAzAgCCQEOU2NyaXB0VHJhbnNmZXIDCAUBaQZjYWxsZXIFBmFtb3VudAUEdW5pdAUDbmlsAQJ0eAEGdmVyaWZ5AAQHJG1hdGNoMAUCdHgDCQABAgUHJG1hdGNoMAIUU2V0U2NyaXB0VHJhbnNhY3Rpb24EC3NldFNjcmlwdFR4BQckbWF0Y2gwBwkA9AMDCAUCdHgJYm9keUJ5dGVzCQCRAwIIBQJ0eAZwcm9vZnMAAAgFAnR4D3NlbmRlclB1YmxpY0tleUmsbSU=", "height": 2578855, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: none Next: none Full:
OldNewDifferences
1-# no script
1+{-# STDLIB_VERSION 6 #-}
2+{-# SCRIPT_TYPE ACCOUNT #-}
3+{-# CONTENT_TYPE DAPP #-}
4+
5+
6+@Callable(i)
7+func deposit () = {
8+ let payment = value(i.payments)
9+ if (if ((size(payment) > 1))
10+ then true
11+ else isDefined(payment[0].assetId))
12+ then throw("You can only one WAVES deposit at a time")
13+ else {
14+ let currentKey = toBase58String(i.caller.bytes)
15+ let currentAmount = valueOrElse(getInteger(this, currentKey), 0)
16+ let newAmount = (currentAmount + payment[0].amount)
17+[IntegerEntry(currentKey, newAmount)]
18+ }
19+ }
20+
21+
22+
23+@Callable(i)
24+func withdraw (amount) = {
25+ let currentKey = toBase58String(i.caller.bytes)
26+ let currentAmount = valueOrElse(getInteger(this, currentKey), 0)
27+ let newAmount = (currentAmount - amount)
28+ if ((0 > amount))
29+ then throw("Cannot withdraw negative amount")
30+ else if ((0 > newAmount))
31+ then throw("Not enough balance")
32+ else [IntegerEntry(currentKey, newAmount), ScriptTransfer(i.caller, amount, unit)]
33+ }
34+
35+
36+@Verifier(tx)
37+func verify () = match tx {
38+ case setScriptTx: SetScriptTransaction =>
39+ false
40+ case _ =>
41+ sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey)
42+}
43+

github/deemru/w8io/169f3d6 
47.79 ms