tx · AyFGwsQDkFzXTv7fJXaiwFv9wCWJvd8PQbZCgKgVFbw9

3Mvqg45GNNEhYssByz8tT6BECpZd8wKyuki:  -0.00100000 Waves

2024.07.06 01:04 [3181280] smart account 3Mvqg45GNNEhYssByz8tT6BECpZd8wKyuki > SELF 0.00000000 Waves

{ "type": 13, "id": "AyFGwsQDkFzXTv7fJXaiwFv9wCWJvd8PQbZCgKgVFbw9", "fee": 100000, "feeAssetId": null, "timestamp": 1720217111689, "version": 2, "chainId": 84, "sender": "3Mvqg45GNNEhYssByz8tT6BECpZd8wKyuki", "senderPublicKey": "Em3xR3qCDVUJh4RYP61j2iaMKdEHYvyYEA4kmBMKQHLd", "proofs": [ "9jZSyuBAQxX3Gw8PGX66Cp8LxsQpN8LHJ3yG5ULqWmfEdGQo2G5D3ML1mHDv8zLf4k96FB3U51dMobmRjGjEmL1" ], "script": "base64:BgIJCAISABIDCgEBAAIBaQEHZGVwb3NpdAAEB3BheW1lbnQJAQV2YWx1ZQEIBQFpCHBheW1lbnRzAwMJAGYCCQCQAwEFB3BheW1lbnQAAQYJAQlpc0RlZmluZWQBCAkAkQMCBQdwYXltZW50AAAHYXNzZXRJZAkAAgECKFlvdSBjYW4gb25seSBvbmUgV0FWRVMgZGVwb3NpdCBhdCBhIHRpbWUECmN1cnJlbnRLZXkJANgEAQgIBQFpBmNhbGxlcgVieXRlcwQNY3VycmVudEFtb3VudAkBC3ZhbHVlT3JFbHNlAgkAmggCBQR0aGlzBQpjdXJyZW50S2V5AAAECW5ld0Ftb3VudAkAZAIFDWN1cnJlbnRBbW91bnQICQCRAwIFB3BheW1lbnQAAAZhbW91bnQJAMwIAgkBDEludGVnZXJFbnRyeQIFCmN1cnJlbnRLZXkFCW5ld0Ftb3VudAUDbmlsAWkBCHdpdGhkcmF3AQZhbW91bnQECmN1cnJlbnRLZXkJANgEAQgIBQFpBmNhbGxlcgVieXRlcwQNY3VycmVudEFtb3VudAkBC3ZhbHVlT3JFbHNlAgkAmggCBQR0aGlzBQpjdXJyZW50S2V5AAAECW5ld0Ftb3VudAkAZQIFDWN1cnJlbnRBbW91bnQFBmFtb3VudAMJAGYCAAAFBmFtb3VudAkAAgECH0Nhbm5vdCB3aXRoZHJhdyBuZWdhdGl2ZSBhbW91bnQDCQBmAgAABQluZXdBbW91bnQJAAIBAhJOb3QgZW5vdWdoIGJhbGFuY2UJAMwIAgkBDEludGVnZXJFbnRyeQIFCmN1cnJlbnRLZXkFCW5ld0Ftb3VudAkAzAgCCQEOU2NyaXB0VHJhbnNmZXIDCAUBaQZjYWxsZXIFBmFtb3VudAUEdW5pdAUDbmlsAQJ0eAEGdmVyaWZ5AAQHJG1hdGNoMAUCdHgDCQABAgUHJG1hdGNoMAIUU2V0U2NyaXB0VHJhbnNhY3Rpb24EC3NldFNjcmlwdFR4BQckbWF0Y2gwBwkA9AMDCAUCdHgJYm9keUJ5dGVzCQCRAwIIBQJ0eAZwcm9vZnMAAAgFAnR4D3NlbmRlclB1YmxpY0tleUmsbSU=", "height": 3181280, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 83GsDA8yYuEj2ncaReeMuNm2aoxzEkhghE32ZSAcLsni Next: none Diff:
OldNewDifferences
44
55
66 @Callable(a)
7-func storeData (b,c) = {
8- let d = getInteger(this, b)
9- if (isDefined(d))
10- then throw("Key already exists")
11- else [IntegerEntry(b, c)]
7+func deposit () = {
8+ let b = value(a.payments)
9+ if (if ((size(b) > 1))
10+ then true
11+ else isDefined(b[0].assetId))
12+ then throw("You can only one WAVES deposit at a time")
13+ else {
14+ let c = toBase58String(a.caller.bytes)
15+ let d = valueOrElse(getInteger(this, c), 0)
16+ let e = (d + b[0].amount)
17+[IntegerEntry(c, e)]
18+ }
1219 }
1320
1421
15-@Verifier(e)
16-func f () = {
17- let g = e
18- if ($isInstanceOf(g, "DataTransaction"))
22+
23+@Callable(a)
24+func withdraw (f) = {
25+ let c = toBase58String(a.caller.bytes)
26+ let d = valueOrElse(getInteger(this, c), 0)
27+ let e = (d - f)
28+ if ((0 > f))
29+ then throw("Cannot withdraw negative amount")
30+ else if ((0 > e))
31+ then throw("Not enough balance")
32+ else [IntegerEntry(c, e), ScriptTransfer(a.caller, f, unit)]
33+ }
34+
35+
36+@Verifier(g)
37+func h () = {
38+ let i = g
39+ if ($isInstanceOf(i, "SetScriptTransaction"))
1940 then {
20- let h = g
21- throw("This transaction is prohibited to the dApp owner!")
41+ let j = i
42+ false
2243 }
23- else sigVerify(e.bodyBytes, e.proofs[0], e.senderPublicKey)
44+ else sigVerify(g.bodyBytes, g.proofs[0], g.senderPublicKey)
2445 }
2546
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 6 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44
55
66 @Callable(a)
7-func storeData (b,c) = {
8- let d = getInteger(this, b)
9- if (isDefined(d))
10- then throw("Key already exists")
11- else [IntegerEntry(b, c)]
7+func deposit () = {
8+ let b = value(a.payments)
9+ if (if ((size(b) > 1))
10+ then true
11+ else isDefined(b[0].assetId))
12+ then throw("You can only one WAVES deposit at a time")
13+ else {
14+ let c = toBase58String(a.caller.bytes)
15+ let d = valueOrElse(getInteger(this, c), 0)
16+ let e = (d + b[0].amount)
17+[IntegerEntry(c, e)]
18+ }
1219 }
1320
1421
15-@Verifier(e)
16-func f () = {
17- let g = e
18- if ($isInstanceOf(g, "DataTransaction"))
22+
23+@Callable(a)
24+func withdraw (f) = {
25+ let c = toBase58String(a.caller.bytes)
26+ let d = valueOrElse(getInteger(this, c), 0)
27+ let e = (d - f)
28+ if ((0 > f))
29+ then throw("Cannot withdraw negative amount")
30+ else if ((0 > e))
31+ then throw("Not enough balance")
32+ else [IntegerEntry(c, e), ScriptTransfer(a.caller, f, unit)]
33+ }
34+
35+
36+@Verifier(g)
37+func h () = {
38+ let i = g
39+ if ($isInstanceOf(i, "SetScriptTransaction"))
1940 then {
20- let h = g
21- throw("This transaction is prohibited to the dApp owner!")
41+ let j = i
42+ false
2243 }
23- else sigVerify(e.bodyBytes, e.proofs[0], e.senderPublicKey)
44+ else sigVerify(g.bodyBytes, g.proofs[0], g.senderPublicKey)
2445 }
2546

github/deemru/w8io/169f3d6 
39.98 ms