tx · FraDxU8kfh5h1mtktWr394s6M6q3bLn51qBNkqMjfAJh 3MzzmRoM2enqdcV86dq3YWKVF8wooVejKaw: -0.00100000 Waves 2022.10.06 10:39 [2260166] smart account 3MzzmRoM2enqdcV86dq3YWKVF8wooVejKaw > SELF 0.00000000 Waves
{ "type": 13, "id": "FraDxU8kfh5h1mtktWr394s6M6q3bLn51qBNkqMjfAJh", "fee": 100000, "feeAssetId": null, "timestamp": 1665041991244, "version": 2, "chainId": 84, "sender": "3MzzmRoM2enqdcV86dq3YWKVF8wooVejKaw", "senderPublicKey": "H6RbQRs8mjuoYecLNygDWF3dyi3meKcKwJKxow96Haho", "proofs": [ "3fpU5Xj8oAidPPLvETJNLtpjzvSfTfN5arvcGC5FBLAAtueLpEx4VFuxLJEV65439vuGyDydnbSGXxFg3fQTaUvF" ], "script": "base64:BgITCAISAwoBCBIECgIIARIECgIIBAQAB2tfZnVuZHMCB2tfZnVuZHMBDnRvQ29tcG9zaXRlS2V5AgRfa2V5CF9hZGRyZXNzCQCsAgIJAKwCAgUEX2tleQIBXwUIX2FkZHJlc3MBC3VwZGF0ZUZ1bmRzAQFpCQDMCAIJAQxJbnRlZ2VyRW50cnkCBQdrX2Z1bmRzBQFpBQNuaWwBBWZ1bmRzAAkBC3ZhbHVlT3JFbHNlAgkAmggCBQR0aGlzBQdrX2Z1bmRzAAADAWkBEGdldEN1cnJlbnRUb3RhbHMBBV91c2VyCQCUCgIFA25pbAkAlgoEAAAAAAkBBWZ1bmRzAAAAAWkBCHdpdGhkcmF3AghfYXNzZXRJZAdfYW1vdW50AwkAZgIFB19hbW91bnQJAQVmdW5kcwAJAAIBCQCsAgIJAKwCAgkArAICAhhJbnZhbGlkIHdpdGhkcmF3IHBhcmFtcyAJAKQDAQUHX2Ftb3VudAIDID4gCQCkAwEJAQVmdW5kcwAJAM4IAgkBC3VwZGF0ZUZ1bmRzAQkAZQIJAQVmdW5kcwAFB19hbW91bnQJAMwIAgkBDlNjcmlwdFRyYW5zZmVyAwgFAWkGY2FsbGVyBQdfYW1vdW50CQDZBAEFCF9hc3NldElkBQNuaWwBaQEHZGVwb3NpdAIGX3ZhdWx0BV9sb2NrBAdfYW1vdW50CAkAkQMCCAUBaQhwYXltZW50cwAABmFtb3VudAkBC3VwZGF0ZUZ1bmRzAQkAZAIJAQVmdW5kcwAFB19hbW91bnQBAnR4AQZ2ZXJpZnkACQD0AwMIBQJ0eAlib2R5Qnl0ZXMJAJEDAggFAnR4BnByb29mcwAACAUCdHgPc2VuZGVyUHVibGljS2V5ZV3yCQ==", "height": 2260166, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: none Next: none Full:
Old | New | Differences | |
---|---|---|---|
1 | - | # no script | |
1 | + | {-# STDLIB_VERSION 6 #-} | |
2 | + | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | + | {-# CONTENT_TYPE DAPP #-} | |
4 | + | let k_funds = "k_funds" | |
5 | + | ||
6 | + | func toCompositeKey (_key,_address) = ((_key + "_") + _address) | |
7 | + | ||
8 | + | ||
9 | + | func updateFunds (i) = [IntegerEntry(k_funds, i)] | |
10 | + | ||
11 | + | ||
12 | + | func funds () = valueOrElse(getInteger(this, k_funds), 0) | |
13 | + | ||
14 | + | ||
15 | + | @Callable(i) | |
16 | + | func getCurrentTotals (_user) = $Tuple2(nil, $Tuple4(0, 0, funds(), 0)) | |
17 | + | ||
18 | + | ||
19 | + | ||
20 | + | @Callable(i) | |
21 | + | func withdraw (_assetId,_amount) = if ((_amount > funds())) | |
22 | + | then throw(((("Invalid withdraw params " + toString(_amount)) + " > ") + toString(funds()))) | |
23 | + | else (updateFunds((funds() - _amount)) ++ [ScriptTransfer(i.caller, _amount, fromBase58String(_assetId))]) | |
24 | + | ||
25 | + | ||
26 | + | ||
27 | + | @Callable(i) | |
28 | + | func deposit (_vault,_lock) = { | |
29 | + | let _amount = i.payments[0].amount | |
30 | + | updateFunds((funds() + _amount)) | |
31 | + | } | |
32 | + | ||
33 | + | ||
34 | + | @Verifier(tx) | |
35 | + | func verify () = sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey) | |
36 | + |
github/deemru/w8io/169f3d6 32.37 ms ◑