tx · 5dQZhXZaeqKYwXgTRRzKBBecUAJgdrd4f5M6umSVsTsw 3MwJL2DqwKdgVQ2Aw5ov1rTEmGTKEkK1wET: -0.00200000 Waves 2023.05.15 15:51 [2579098] smart account 3MwJL2DqwKdgVQ2Aw5ov1rTEmGTKEkK1wET > SELF 0.00000000 Waves
{ "type": 13, "id": "5dQZhXZaeqKYwXgTRRzKBBecUAJgdrd4f5M6umSVsTsw", "fee": 200000, "feeAssetId": null, "timestamp": 1684155202085, "version": 2, "chainId": 84, "sender": "3MwJL2DqwKdgVQ2Aw5ov1rTEmGTKEkK1wET", "senderPublicKey": "ACNdxdXUS5uLiYS4LMdrApJBVCQj8FDMHEknQkNYCUaK", "proofs": [ "4DZH6S2Q6hyUNSGJuw7zFZtwBnMt7UCa1xDmSYB37VjCaqyiHeXKvaH6T8YtxqekFa8W2Z45SVMQhdkU4oegrdB3" ], "script": "base64:BgIPCAISABIDCgEBEgQKAgEIAAMBaQEHZGVwb3NpdAAEB3BheW1lbnQJAQV2YWx1ZQEIBQFpCHBheW1lbnRzAwMJAGYCCQCQAwEFB3BheW1lbnQAAQYJAQlpc0RlZmluZWQBCAkAkQMCBQdwYXltZW50AAAHYXNzZXRJZAkAAgECKFlvdSBjYW4gb25seSBvbmUgV0FWRVMgZGVwb3NpdCBhdCBhIHRpbWUECmN1cnJlbnRLZXkJANgEAQgIBQFpBmNhbGxlcgVieXRlcwQNY3VycmVudEFtb3VudAkBC3ZhbHVlT3JFbHNlAgkAmggCBQR0aGlzBQpjdXJyZW50S2V5AAAECW5ld0Ftb3VudAkAZAIFDWN1cnJlbnRBbW91bnQICQCRAwIFB3BheW1lbnQAAAZhbW91bnQJAMwIAgkBDEludGVnZXJFbnRyeQIFCmN1cnJlbnRLZXkFCW5ld0Ftb3VudAUDbmlsAWkBCHdpdGhkcmF3AQZhbW91bnQECmN1cnJlbnRLZXkJANgEAQgIBQFpBmNhbGxlcgVieXRlcwQNY3VycmVudEFtb3VudAkBC3ZhbHVlT3JFbHNlAgkAmggCBQR0aGlzBQpjdXJyZW50S2V5AAAECW5ld0Ftb3VudAkAZQIFDWN1cnJlbnRBbW91bnQFBmFtb3VudAMJAGYCAAAFBmFtb3VudAkAAgECH0Nhbm5vdCB3aXRoZHJhdyBuZWdhdGl2ZSBhbW91bnQDCQBmAgAABQluZXdBbW91bnQJAAIBAhJOb3QgZW5vdWdoIGJhbGFuY2UJAMwIAgkBDEludGVnZXJFbnRyeQIFCmN1cnJlbnRLZXkFCW5ld0Ftb3VudAkAzAgCCQEOU2NyaXB0VHJhbnNmZXIDCAUBaQZjYWxsZXIFBmFtb3VudAUEdW5pdAUDbmlsAWkBCmRlcDlTd2F2ZXMCBmFtb3VudA1hZGRyZXNzU3dhdmVzBApjdXJyZW50S2V5CQDYBAEICAUBaQZjYWxsZXIFYnl0ZXMEBmFzc2V0QQgJAJEDAggFAWkIcGF5bWVudHMAAAdhc3NldElkBA1hbW91bnRQYXltZW50AAEECmludm9jYXRpb24JAPwHBAkBEUBleHRyTmF0aXZlKDEwNjIpAQUNYWRkcmVzc1N3YXZlcwIHZGVwb3NpdAUDbmlsCQDMCAIJAQ9BdHRhY2hlZFBheW1lbnQCBQZhc3NldEEFDWFtb3VudFBheW1lbnQFA25pbAMJAAACBQppbnZvY2F0aW9uBQppbnZvY2F0aW9uCQDMCAIJAQxJbnRlZ2VyRW50cnkCBQpjdXJyZW50S2V5BQZhbW91bnQFA25pbAkAAgECJFN0cmljdCB2YWx1ZSBpcyBub3QgZXF1YWwgdG8gaXRzZWxmLgECdHgBBnZlcmlmeQAEByRtYXRjaDAFAnR4CQD0AwMIBQJ0eAlib2R5Qnl0ZXMJAJEDAggFAnR4BnByb29mcwAACAUCdHgPc2VuZGVyUHVibGljS2V5iRdZHA==", "height": 2579098, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 31jiXpg63ko5JLq2KsvtKEuGcVYZadZCKFN6ZBf8h2y7 Next: 7n6f4wuEsRiqRcZUdq3rdLw2yy4mKdmWD4kekfEFMyQB Diff:
Old | New | Differences | |
---|---|---|---|
35 | 35 | ||
36 | 36 | ||
37 | 37 | @Callable(i) | |
38 | - | func | |
38 | + | func dep9Swaves (amount,addressSwaves) = { | |
39 | 39 | let currentKey = toBase58String(i.caller.bytes) | |
40 | 40 | let assetA = i.payments[0].assetId | |
41 | - | let amountPayment = | |
41 | + | let amountPayment = 1 | |
42 | 42 | let invocation = invoke(addressFromStringValue(addressSwaves), "deposit", nil, [AttachedPayment(assetA, amountPayment)]) | |
43 | 43 | if ((invocation == invocation)) | |
44 | 44 | then [IntegerEntry(currentKey, amount)] |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 6 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | ||
5 | 5 | ||
6 | 6 | @Callable(i) | |
7 | 7 | func deposit () = { | |
8 | 8 | let payment = value(i.payments) | |
9 | 9 | if (if ((size(payment) > 1)) | |
10 | 10 | then true | |
11 | 11 | else isDefined(payment[0].assetId)) | |
12 | 12 | then throw("You can only one WAVES deposit at a time") | |
13 | 13 | else { | |
14 | 14 | let currentKey = toBase58String(i.caller.bytes) | |
15 | 15 | let currentAmount = valueOrElse(getInteger(this, currentKey), 0) | |
16 | 16 | let newAmount = (currentAmount + payment[0].amount) | |
17 | 17 | [IntegerEntry(currentKey, newAmount)] | |
18 | 18 | } | |
19 | 19 | } | |
20 | 20 | ||
21 | 21 | ||
22 | 22 | ||
23 | 23 | @Callable(i) | |
24 | 24 | func withdraw (amount) = { | |
25 | 25 | let currentKey = toBase58String(i.caller.bytes) | |
26 | 26 | let currentAmount = valueOrElse(getInteger(this, currentKey), 0) | |
27 | 27 | let newAmount = (currentAmount - amount) | |
28 | 28 | if ((0 > amount)) | |
29 | 29 | then throw("Cannot withdraw negative amount") | |
30 | 30 | else if ((0 > newAmount)) | |
31 | 31 | then throw("Not enough balance") | |
32 | 32 | else [IntegerEntry(currentKey, newAmount), ScriptTransfer(i.caller, amount, unit)] | |
33 | 33 | } | |
34 | 34 | ||
35 | 35 | ||
36 | 36 | ||
37 | 37 | @Callable(i) | |
38 | - | func | |
38 | + | func dep9Swaves (amount,addressSwaves) = { | |
39 | 39 | let currentKey = toBase58String(i.caller.bytes) | |
40 | 40 | let assetA = i.payments[0].assetId | |
41 | - | let amountPayment = | |
41 | + | let amountPayment = 1 | |
42 | 42 | let invocation = invoke(addressFromStringValue(addressSwaves), "deposit", nil, [AttachedPayment(assetA, amountPayment)]) | |
43 | 43 | if ((invocation == invocation)) | |
44 | 44 | then [IntegerEntry(currentKey, amount)] | |
45 | 45 | else throw("Strict value is not equal to itself.") | |
46 | 46 | } | |
47 | 47 | ||
48 | 48 | ||
49 | 49 | @Verifier(tx) | |
50 | 50 | func verify () = match tx { | |
51 | 51 | case _ => | |
52 | 52 | sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey) | |
53 | 53 | } | |
54 | 54 |
github/deemru/w8io/169f3d6 28.35 ms ◑