tx · 38qHNXoouxMWKRhGb2yZgPJLtQaCUfaANTwqWakzwAdX 3N29FGLqCbdBKeP8PzVwL4rYb8sJHR41VEN: -0.01000000 Waves 2019.07.19 13:42 [592653] smart account 3N29FGLqCbdBKeP8PzVwL4rYb8sJHR41VEN > SELF 0.00000000 Waves
{ "type": 13, "id": "38qHNXoouxMWKRhGb2yZgPJLtQaCUfaANTwqWakzwAdX", "fee": 1000000, "feeAssetId": null, "timestamp": 1563532984903, "version": 1, "sender": "3N29FGLqCbdBKeP8PzVwL4rYb8sJHR41VEN", "senderPublicKey": "EeePgs29FQMEqHiMQtnx1UFRLRiQ3MHnrpTe8yBPmTBn", "proofs": [ "53gKVBz7MPU2VvwS8yvm18qD5h1ohdTVpAt5N3RePfEmobaW9ttpcicWy4ZoTxGWXLgFmMkqpnxMA7SUBndr2KzT" ], "script": "base64:AAIDAAAAAAAAAAAAAAADAAAAAA9wcml6ZVBlcmNlbnRhZ2UAAAAAAAAAAFAAAAAADWZlZVBlcmNlbnRhZ2UAAAAAAAAAABQAAAAACmZlZUFkZHJlc3MJAQAAAAdBZGRyZXNzAAAAAQEAAAAaAVT8lSg/slqiz5yHkNQMnNutta5mGGGWABwAAAACAAAACmludm9jYXRpb24BAAAAA2JldAAAAAEAAAAGb3B0aW9uBAAAAAt0cmFuc2FjdGlvbgkBAAAAB2V4dHJhY3QAAAABCAUAAAAKaW52b2NhdGlvbgAAAAdwYXltZW50AwkBAAAACWlzRGVmaW5lZAAAAAEIBQAAAAt0cmFuc2FjdGlvbgAAAAdhc3NldElkCQAAAgAAAAECAAAAGENhbiB3b3JrIG9ubHkgd2l0aCBXQVZFUwQAAAAHYWRkcmVzcwkAAlgAAAABCAgFAAAACmludm9jYXRpb24AAAAGY2FsbGVyAAAABWJ5dGVzBAAAAAlhbW91bnRLZXkJAAEsAAAAAgUAAAAHYWRkcmVzcwIAAAAHLmFtb3VudAQAAAAJb3B0aW9uS2V5CQABLAAAAAIFAAAAB2FkZHJlc3MCAAA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CAUAAAACdHgAAAAGcHJvb2ZzAAAAAAAAAAAACAUAAAACdHgAAAAPc2VuZGVyUHVibGljS2V5bfGdhg==", "chainId": 84, "height": 592653, "spentComplexity": 0 } View: original | compacted Prev: none Next: none Full:
Old | New | Differences | |
---|---|---|---|
1 | - | # no script | |
1 | + | {-# STDLIB_VERSION 3 #-} | |
2 | + | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | + | {-# CONTENT_TYPE DAPP #-} | |
4 | + | let prizePercentage = 80 | |
5 | + | ||
6 | + | let feePercentage = 20 | |
7 | + | ||
8 | + | let feeAddress = Address(base58'3NCwcjtR3UgUG2cHYyzt6UxcmhCqZyzSdCP') | |
9 | + | ||
10 | + | @Callable(invocation) | |
11 | + | func bet (option) = { | |
12 | + | let transaction = extract(invocation.payment) | |
13 | + | if (isDefined(transaction.assetId)) | |
14 | + | then throw("Can work only with WAVES") | |
15 | + | else { | |
16 | + | let address = toBase58String(invocation.caller.bytes) | |
17 | + | let amountKey = (address + ".amount") | |
18 | + | let optionKey = (address + ".option") | |
19 | + | let currentAmount = match getInteger(this, amountKey) { | |
20 | + | case amount: Int => | |
21 | + | amount | |
22 | + | case _ => | |
23 | + | 0 | |
24 | + | } | |
25 | + | let newAmount = (currentAmount + transaction.amount) | |
26 | + | WriteSet([DataEntry(amountKey, newAmount), DataEntry(optionKey, option)]) | |
27 | + | } | |
28 | + | } | |
29 | + | ||
30 | + | ||
31 | + | ||
32 | + | @Callable(invocation) | |
33 | + | func withdraw () = { | |
34 | + | let currentAmount = wavesBalance(this) | |
35 | + | let prizeAmount = ((currentAmount / 100) * prizePercentage) | |
36 | + | let feeAmount = ((currentAmount / 100) * feePercentage) | |
37 | + | TransferSet([ScriptTransfer(invocation.caller, prizeAmount, unit), ScriptTransfer(feeAddress, feeAmount, unit)]) | |
38 | + | } | |
39 | + | ||
40 | + | ||
41 | + | @Verifier(tx) | |
42 | + | func verify () = sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey) | |
43 | + |
github/deemru/w8io/169f3d6 19.12 ms ◑