tx · FFbUBZ9w35FxZuUvKJZ7wcUnJvBM7QnRwrtVtn7fcMDS
3N8oN3yLcrZHa6DcDfqE9Rz8GkzudXjnmrx: -0.01000000 Waves
2023.08.18 10:18 [2715732] smart account 3N8oN3yLcrZHa6DcDfqE9Rz8GkzudXjnmrx > SELF 0.00000000 Waves
{
"type": 13,
"id": "FFbUBZ9w35FxZuUvKJZ7wcUnJvBM7QnRwrtVtn7fcMDS",
"fee": 1000000,
"feeAssetId": null,
"timestamp": 1692343140636,
"version": 2,
"chainId": 84,
"sender": "3N8oN3yLcrZHa6DcDfqE9Rz8GkzudXjnmrx",
"senderPublicKey": "81tRXAgqfPdSG8kxEMcAuyLeBBRRrzyqQLXCtCj1dpk2",
"proofs": [
"5F7cZMxFuGw1a4LNg7dUfLJdfaNq6V3tgTLJfSMm41Qa1nX4kNnTiTuSLpzHyxNFpTQ7W6L8HqgjNWySqdFHBdYg"
],
"script": "base64:BgIJCAISAwoBCBIAAgANYXNzZXRJZFN0cmluZwIsRU1BTUx4RG52M3hpejhSWGc4QnRqMzNqY0V3M3dMY3pMM0pLWVltdXVicGMABWFzc2V0CQDZBAEFDWFzc2V0SWRTdHJpbmcCAWkBDmNvbW1pdEZvck1pbmVyAQ1hZGRyZXNzU3RyaW5nBAVpbmRleAkBC3ZhbHVlT3JFbHNlAgkAmggCBQR0aGlzAgVpbmRleAAABANrZXkJAKwCAgUNYWRkcmVzc1N0cmluZwIIX3N0YWtlZF8EBnN0YWtlZAkBC3ZhbHVlT3JFbHNlAgkAmggCBQR0aGlzBQNrZXkAAAkAzAgCCQEMSW50ZWdlckVudHJ5AgUDa2V5CQBkAgUGc3Rha2VkCAkAkQMCCAUBaQhwYXltZW50cwAABmFtb3VudAkAzAgCCQEMSW50ZWdlckVudHJ5AgkArAICAgVpbmRleAkApAMBBQVpbmRleAkAZAIFBWluZGV4AAEFA25pbAFpAQh3aXRoZHJhdwAEA2tleQkArAICCQClCAEIBQFpBmNhbGxlcgIIX3N0YWtlZF8EBmFtb3VudAkBE3ZhbHVlT3JFcnJvck1lc3NhZ2UCCQCaCAIFBHRoaXMFA2tleQIBYQkAzAgCCQEOU2NyaXB0VHJhbnNmZXIDCAUBaQZjYWxsZXIFBmFtb3VudAUFYXNzZXQJAMwIAgkBDEludGVnZXJFbnRyeQIFA2tleQAABQNuaWwAB+t3vw==",
"height": 2715732,
"applicationStatus": "succeeded",
"spentComplexity": 0
}
View: original | compacted
Prev: Ar3H2sJ4TLB8wKZQGsxDKes1EkfphC8XQwSnwPZgLWWS
Next: Fe9uF1r4M6msbjMyKYUNfjPtj9iCXV2p9ju58Btw5dcT
Full:
Old | New | | Differences |
---|
1 | 1 | | {-# STDLIB_VERSION 6 #-} |
---|
2 | 2 | | {-# SCRIPT_TYPE ACCOUNT #-} |
---|
3 | 3 | | {-# CONTENT_TYPE DAPP #-} |
---|
4 | | - | func test () = { |
---|
5 | | - | let list = [$Tuple2("a", 0), $Tuple2("b", 1), $Tuple2("c", 2)] |
---|
6 | | - | func bar (acc,next) = { |
---|
7 | | - | let $t0191208 = next |
---|
8 | | - | let a = $t0191208._1 |
---|
9 | | - | let b = $t0191208._2 |
---|
10 | | - | let c = invoke(this, "foo", [a, b], nil) |
---|
11 | | - | if ((c == c)) |
---|
12 | | - | then 0 |
---|
13 | | - | else throw("Strict value is not equal to itself.") |
---|
14 | | - | } |
---|
| 4 | + | let assetIdString = "EMAMLxDnv3xiz8RXg8Btj33jcEw3wLczL3JKYYmuubpc" |
---|
15 | 5 | | |
---|
16 | | - | let $l = list |
---|
17 | | - | let $s = size($l) |
---|
18 | | - | let $acc0 = 0 |
---|
19 | | - | func $f0_1 ($a,$i) = if (($i >= $s)) |
---|
20 | | - | then $a |
---|
21 | | - | else bar($a, $l[$i]) |
---|
22 | | - | |
---|
23 | | - | func $f0_2 ($a,$i) = if (($i >= $s)) |
---|
24 | | - | then $a |
---|
25 | | - | else throw("List size exceeds 10") |
---|
26 | | - | |
---|
27 | | - | $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10) |
---|
28 | | - | } |
---|
29 | | - | |
---|
| 6 | + | let asset = fromBase58String(assetIdString) |
---|
30 | 7 | | |
---|
31 | 8 | | @Callable(i) |
---|
32 | | - | func foo (a,b) = [IntegerEntry(a, b)] |
---|
| 9 | + | func commitForMiner (addressString) = { |
---|
| 10 | + | let index = valueOrElse(getInteger(this, "index"), 0) |
---|
| 11 | + | let key = (addressString + "_staked_") |
---|
| 12 | + | let staked = valueOrElse(getInteger(this, key), 0) |
---|
| 13 | + | [IntegerEntry(key, (staked + i.payments[0].amount)), IntegerEntry(("index" + toString(index)), (index + 1))] |
---|
| 14 | + | } |
---|
33 | 15 | | |
---|
34 | 16 | | |
---|
35 | 17 | | |
---|
36 | 18 | | @Callable(i) |
---|
37 | | - | func a () = { |
---|
38 | | - | let a = test() |
---|
39 | | - | if ((a == a)) |
---|
40 | | - | then nil |
---|
41 | | - | else throw("Strict value is not equal to itself.") |
---|
| 19 | + | func withdraw () = { |
---|
| 20 | + | let key = (toString(i.caller) + "_staked_") |
---|
| 21 | + | let amount = valueOrErrorMessage(getInteger(this, key), "a") |
---|
| 22 | + | [ScriptTransfer(i.caller, amount, asset), IntegerEntry(key, 0)] |
---|
42 | 23 | | } |
---|
43 | 24 | | |
---|
44 | 25 | | |
---|