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(i)
7-func storeData (newKey,newValue) = {
8- let slot = getInteger(this, newKey)
9- if (isDefined(slot))
10- then throw("Key already exists")
11- else [IntegerEntry(newKey, newValue)]
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)]
1233 }
1334
1435
1536 @Verifier(tx)
1637 func verify () = match tx {
17- case dtx: DataTransaction =>
18- throw("This transaction is prohibited to the dApp owner!")
38+ case setScriptTx: SetScriptTransaction =>
39+ false
1940 case _ =>
2041 sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey)
2142 }
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 6 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44
55
66 @Callable(i)
7-func storeData (newKey,newValue) = {
8- let slot = getInteger(this, newKey)
9- if (isDefined(slot))
10- then throw("Key already exists")
11- else [IntegerEntry(newKey, newValue)]
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)]
1233 }
1334
1435
1536 @Verifier(tx)
1637 func verify () = match tx {
17- case dtx: DataTransaction =>
18- throw("This transaction is prohibited to the dApp owner!")
38+ case setScriptTx: SetScriptTransaction =>
39+ false
1940 case _ =>
2041 sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey)
2142 }
2243

github/deemru/w8io/03bedc9 
20.94 ms