tx · E7M9R9qmhBAPGh1Pb4msHu85YJPUkVfubrVdb5UVsxSb 3MqEAEVk1NcbRAuEPAX7nyzUqMHbhvRofez: -0.00700000 Waves 2023.11.10 12:22 [2837064] smart account 3MqEAEVk1NcbRAuEPAX7nyzUqMHbhvRofez > SELF 0.00000000 Waves
{ "type": 13, "id": "E7M9R9qmhBAPGh1Pb4msHu85YJPUkVfubrVdb5UVsxSb", "fee": 700000, "feeAssetId": null, "timestamp": 1699608197635, "version": 2, "chainId": 84, "sender": "3MqEAEVk1NcbRAuEPAX7nyzUqMHbhvRofez", "senderPublicKey": "Brp6cacBXyKUcZr5Uc6VDKsnFcaEeQ8nQzrZQyobDsuf", "proofs": [ "2QBGBMH85PpJB8K2yur7sQ9i4yCmB3EHxiWgHCGL59DSa2jdxoV9ZXiUueBD6558ti55fTAJLf67kWppwcXC4G4K" ], "script": "base64:BgISCAISABIAEgASAwoBCBIDCgEYEQENdHJ5R2V0SW50ZWdlcgIHYWRkcmVzcwNrZXkEByRtYXRjaDAJAJoIAgUHYWRkcmVzcwUDa2V5AwkAAQIFByRtYXRjaDACA0ludAQBYgUHJG1hdGNoMAUBYgAAAQx0cnlHZXRTdHJpbmcCB2FkZHJlc3MDa2V5BAckbWF0Y2gwCQCdCAIFB2FkZHJlc3MFA2tleQMJAAECBQckbWF0Y2gwAgZTdHJpbmcEAWIFByRtYXRjaDAFAWICAAAHYnVybnh0bgEgJE91eWp+Mzm4+wz/hKlxXF7KLd4zoMRdafnqRBHsTFQAA1BaMQEaAVeFnSww1fwDPmHFrd6Sv8UqkfOZrhpBQAoAA1BaMgEaAVf1RmgngA1o304mdXq0odMoMeAJv/V5eTcAA1BaMwEaAVdrUh3hZ11iM5xE9ppvCu7VVcjaIPzs5scAA1BaNAEaAVd8ufIkLHkd+cILYV2n5Ut+Pmb4MdnkIOIAA1BaNQEaAVdzM1uLVnknLEeNcZD2LCCz+T9Cl/2cRdIAA1BaNgEaAVdHHWb6sJRhaJYHMq62QOOh/3PO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YAFwAYABkAGgAbABwAHQAeAB8AIAAhACIAIwAkACUAJgAnACgAKQAqACsALAAtAC4ALwAwADEAMgAzADQANQA2ADcAOAA5ADoAOwA8AD0APgA/AEAAQQBCAEMARABFAEYARwBIAEkASgBLAEwATQBOAE8AUABRAFIAUwBUAFUAVgBXAFgAWQBaAFsAXABdAF4AXwBgAGEAYgBjAGQA31KtKg==", "height": 2837064, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: JD1XYdQBNzPFc11KUp5ey2kskimBWLRYkraZ3FRzLHR3 Next: 69CV1wnJXRFtcAesAXc8s5LFPSJHDwjGF8nshnC6VuU1 Diff:
Old | New | Differences | |
---|---|---|---|
52 | 52 | func WXbal (Pooladdress,address,LPstr) = { | |
53 | 53 | let burnxtnInWX = assetBalance(Address(Pooladdress), burnxtn) | |
54 | 54 | let addressStakeWX = tryGetInteger(Address(WXstake), ((("%s%s%s__staked__" + toString(address)) + "__") + LPstr)) | |
55 | - | let totalStakeWX = tryGetInteger(Address( | |
55 | + | let totalStakeWX = tryGetInteger(Address(WXstake), ("%s%s%s__staked__total__" + LPstr)) | |
56 | 56 | fraction(burnxtnInWX, addressStakeWX, totalStakeWX) | |
57 | 57 | } | |
58 | 58 | ||
90 | 90 | let lastOfList = list[(listSize - 1)] | |
91 | 91 | let address1 = value(addressFromString(firstOfList)) | |
92 | 92 | let balance1 = wavesBalance(address1).available | |
93 | - | [StringEntry("addresses", addresses), IntegerEntry("listSize", listSize), StringEntry("firstOfList", firstOfList), StringEntry("lastOfList", lastOfList), IntegerEntry("balance1", balance1)] | |
93 | + | func f (accum,address) = (accum ++ [IntegerEntry(address, wavesBalance(addressFromStringValue(address)).available)]) | |
94 | + | ||
95 | + | let enterIntegers = { | |
96 | + | let $l = list | |
97 | + | let $s = size($l) | |
98 | + | let $acc0 = nil | |
99 | + | func $f0_1 ($a,$i) = if (($i >= $s)) | |
100 | + | then $a | |
101 | + | else f($a, $l[$i]) | |
102 | + | ||
103 | + | func $f0_2 ($a,$i) = if (($i >= $s)) | |
104 | + | then $a | |
105 | + | else throw("List size exceeds 100") | |
106 | + | ||
107 | + | $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($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), 11), 12), 13), 14), 15), 16), 17), 18), 19), 20), 21), 22), 23), 24), 25), 26), 27), 28), 29), 30), 31), 32), 33), 34), 35), 36), 37), 38), 39), 40), 41), 42), 43), 44), 45), 46), 47), 48), 49), 50), 51), 52), 53), 54), 55), 56), 57), 58), 59), 60), 61), 62), 63), 64), 65), 66), 67), 68), 69), 70), 71), 72), 73), 74), 75), 76), 77), 78), 79), 80), 81), 82), 83), 84), 85), 86), 87), 88), 89), 90), 91), 92), 93), 94), 95), 96), 97), 98), 99), 100) | |
108 | + | } | |
109 | + | ([StringEntry("addresses", addresses), IntegerEntry("listSize", listSize), StringEntry("firstOfList", firstOfList), StringEntry("lastOfList", lastOfList)] ++ enterIntegers) | |
110 | + | } | |
111 | + | ||
112 | + | ||
113 | + | ||
114 | + | @Callable(i) | |
115 | + | func totalBalanceCaller () = (nil ++ totalBalance(i.caller)) | |
116 | + | ||
117 | + | ||
118 | + | ||
119 | + | @Callable(i) | |
120 | + | func totalBalanceAddress (address) = (nil ++ totalBalance(value(addressFromString(address)))) | |
121 | + | ||
122 | + | ||
123 | + | ||
124 | + | @Callable(i) | |
125 | + | func transfer (addresses) = { | |
126 | + | let assetId = i.payments[0].assetId | |
127 | + | let amount = i.payments[0].amount | |
128 | + | let amountPerAddress = (amount / size(addresses)) | |
129 | + | func f (accum,address) = (accum ++ [ScriptTransfer(addressFromStringValue(address), amountPerAddress, assetId)]) | |
130 | + | ||
131 | + | let $l = addresses | |
132 | + | let $s = size($l) | |
133 | + | let $acc0 = nil | |
134 | + | func $f0_1 ($a,$i) = if (($i >= $s)) | |
135 | + | then $a | |
136 | + | else f($a, $l[$i]) | |
137 | + | ||
138 | + | func $f0_2 ($a,$i) = if (($i >= $s)) | |
139 | + | then $a | |
140 | + | else throw("List size exceeds 100") | |
141 | + | ||
142 | + | $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($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), 11), 12), 13), 14), 15), 16), 17), 18), 19), 20), 21), 22), 23), 24), 25), 26), 27), 28), 29), 30), 31), 32), 33), 34), 35), 36), 37), 38), 39), 40), 41), 42), 43), 44), 45), 46), 47), 48), 49), 50), 51), 52), 53), 54), 55), 56), 57), 58), 59), 60), 61), 62), 63), 64), 65), 66), 67), 68), 69), 70), 71), 72), 73), 74), 75), 76), 77), 78), 79), 80), 81), 82), 83), 84), 85), 86), 87), 88), 89), 90), 91), 92), 93), 94), 95), 96), 97), 98), 99), 100) | |
94 | 143 | } | |
95 | 144 | ||
96 | 145 |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 6 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | func tryGetInteger (address,key) = match getInteger(address, key) { | |
5 | 5 | case b: Int => | |
6 | 6 | b | |
7 | 7 | case _ => | |
8 | 8 | 0 | |
9 | 9 | } | |
10 | 10 | ||
11 | 11 | ||
12 | 12 | func tryGetString (address,key) = match getString(address, key) { | |
13 | 13 | case b: String => | |
14 | 14 | b | |
15 | 15 | case _ => | |
16 | 16 | "" | |
17 | 17 | } | |
18 | 18 | ||
19 | 19 | ||
20 | 20 | let burnxtn = base58'3SjxA2YLdfF9fTRbzLm9xFn27C6MW34W1YsdJ6Axefns' | |
21 | 21 | ||
22 | 22 | let PZ1 = base58'3PE7NtJdmVq4yo47LKDqurQ8RLDCouvJCPB' | |
23 | 23 | ||
24 | 24 | let PZ2 = base58'3PQHndCUVrv3wBuQjbvVP9SnGmfbfitGxfx' | |
25 | 25 | ||
26 | 26 | let PZ3 = base58'3PBiMQLnX8wd4bssXCgF8KuUqHv1H4zWHGi' | |
27 | 27 | ||
28 | 28 | let PZ4 = base58'3PDJPGn6vBEBqWN4E3fNcxoKBoDXbsmoaM7' | |
29 | 29 | ||
30 | 30 | let PZ5 = base58'3PCS1xhGQi2eM5mYcCBhUSHvB31Kk5gZoCm' | |
31 | 31 | ||
32 | 32 | let PZ6 = base58'3P8Quvmgt3VEWAjBR3bsfgCqzUh7zTmTC4q' | |
33 | 33 | ||
34 | 34 | let WXstake = base58'3PPNhHYkkEy13gRWDCaruQyhNbX2GrjYSyV' | |
35 | 35 | ||
36 | 36 | let WX1 = base58'3P5vwLbXddLWpsRspftMxLuzfsjk3dLT3n5' | |
37 | 37 | ||
38 | 38 | let LP1 = "GyiHdcN59sZ46baFvj68ruLngrTPEvWDtsd6jHm4o46n" | |
39 | 39 | ||
40 | 40 | let WX2 = base58'3PKXseWa31VUSWUvm2YiRKxW2VM9RsVk3ry' | |
41 | 41 | ||
42 | 42 | let LP2 = "3MPHMJVwYGyeBLRsH1RsYhrTmemv752AEBwuFFV7g49Z" | |
43 | 43 | ||
44 | 44 | func PZbal (Pooladdress,address) = { | |
45 | 45 | let burnxtnInPZ = tryGetInteger(Address(Pooladdress), (("global_" + toBase58String(burnxtn)) + "_balance")) | |
46 | 46 | let addressStakePZ = tryGetInteger(Address(Pooladdress), (toString(address) + "_indexStaked")) | |
47 | 47 | let totalStakePZ = tryGetInteger(Address(Pooladdress), "global_poolToken_amount") | |
48 | 48 | fraction(burnxtnInPZ, addressStakePZ, totalStakePZ) | |
49 | 49 | } | |
50 | 50 | ||
51 | 51 | ||
52 | 52 | func WXbal (Pooladdress,address,LPstr) = { | |
53 | 53 | let burnxtnInWX = assetBalance(Address(Pooladdress), burnxtn) | |
54 | 54 | let addressStakeWX = tryGetInteger(Address(WXstake), ((("%s%s%s__staked__" + toString(address)) + "__") + LPstr)) | |
55 | - | let totalStakeWX = tryGetInteger(Address( | |
55 | + | let totalStakeWX = tryGetInteger(Address(WXstake), ("%s%s%s__staked__total__" + LPstr)) | |
56 | 56 | fraction(burnxtnInWX, addressStakeWX, totalStakeWX) | |
57 | 57 | } | |
58 | 58 | ||
59 | 59 | ||
60 | 60 | func totalBalance (address) = { | |
61 | 61 | let burnxtnBalance = assetBalance(address, burnxtn) | |
62 | 62 | let PZ1balance = PZbal(PZ1, address) | |
63 | 63 | let PZ2balance = PZbal(PZ2, address) | |
64 | 64 | let PZ3balance = PZbal(PZ3, address) | |
65 | 65 | let PZ4balance = PZbal(PZ4, address) | |
66 | 66 | let PZ5balance = PZbal(PZ5, address) | |
67 | 67 | let PZ6balance = PZbal(PZ6, address) | |
68 | 68 | let WX1balance = WXbal(WX1, address, LP1) | |
69 | 69 | let WX2balance = WXbal(WX2, address, LP2) | |
70 | 70 | let total = ((((((((burnxtnBalance + PZ1balance) + PZ2balance) + PZ3balance) + PZ4balance) + PZ5balance) + PZ6balance) + WX1balance) + WX2balance) | |
71 | 71 | [IntegerEntry("burnxtnBalance", burnxtnBalance), IntegerEntry("PZ1balance", PZ1balance), IntegerEntry("PZ2balance", PZ2balance), IntegerEntry("PZ3balance", PZ3balance), IntegerEntry("PZ4balance", PZ4balance), IntegerEntry("PZ5balance", PZ5balance), IntegerEntry("PZ6balance", PZ6balance), IntegerEntry("WX1balance", WX1balance), IntegerEntry("WX2balance", WX2balance), IntegerEntry("total", total)] | |
72 | 72 | } | |
73 | 73 | ||
74 | 74 | ||
75 | 75 | @Callable(i) | |
76 | 76 | func register () = if (contains(tryGetString(this, "Address registered"), toString(i.caller))) | |
77 | 77 | then throw("already registered") | |
78 | 78 | else if ((height > 1)) | |
79 | 79 | then throw("registration closed") | |
80 | 80 | else [IntegerEntry("Amount Registered", (tryGetInteger(this, "Amount Registered") + 1)), StringEntry(("Register address: " + toString((tryGetInteger(this, "Amount Registered") + 1))), toString(i.caller)), StringEntry("Address registered", ((tryGetString(this, "Address registered") + toString(i.caller)) + ","))] | |
81 | 81 | ||
82 | 82 | ||
83 | 83 | ||
84 | 84 | @Callable(i) | |
85 | 85 | func makeList () = { | |
86 | 86 | let addresses = dropRight(tryGetString(this, "Address registered"), 1) | |
87 | 87 | let list = split(addresses, ",") | |
88 | 88 | let listSize = size(list) | |
89 | 89 | let firstOfList = list[0] | |
90 | 90 | let lastOfList = list[(listSize - 1)] | |
91 | 91 | let address1 = value(addressFromString(firstOfList)) | |
92 | 92 | let balance1 = wavesBalance(address1).available | |
93 | - | [StringEntry("addresses", addresses), IntegerEntry("listSize", listSize), StringEntry("firstOfList", firstOfList), StringEntry("lastOfList", lastOfList), IntegerEntry("balance1", balance1)] | |
93 | + | func f (accum,address) = (accum ++ [IntegerEntry(address, wavesBalance(addressFromStringValue(address)).available)]) | |
94 | + | ||
95 | + | let enterIntegers = { | |
96 | + | let $l = list | |
97 | + | let $s = size($l) | |
98 | + | let $acc0 = nil | |
99 | + | func $f0_1 ($a,$i) = if (($i >= $s)) | |
100 | + | then $a | |
101 | + | else f($a, $l[$i]) | |
102 | + | ||
103 | + | func $f0_2 ($a,$i) = if (($i >= $s)) | |
104 | + | then $a | |
105 | + | else throw("List size exceeds 100") | |
106 | + | ||
107 | + | $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($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), 11), 12), 13), 14), 15), 16), 17), 18), 19), 20), 21), 22), 23), 24), 25), 26), 27), 28), 29), 30), 31), 32), 33), 34), 35), 36), 37), 38), 39), 40), 41), 42), 43), 44), 45), 46), 47), 48), 49), 50), 51), 52), 53), 54), 55), 56), 57), 58), 59), 60), 61), 62), 63), 64), 65), 66), 67), 68), 69), 70), 71), 72), 73), 74), 75), 76), 77), 78), 79), 80), 81), 82), 83), 84), 85), 86), 87), 88), 89), 90), 91), 92), 93), 94), 95), 96), 97), 98), 99), 100) | |
108 | + | } | |
109 | + | ([StringEntry("addresses", addresses), IntegerEntry("listSize", listSize), StringEntry("firstOfList", firstOfList), StringEntry("lastOfList", lastOfList)] ++ enterIntegers) | |
110 | + | } | |
111 | + | ||
112 | + | ||
113 | + | ||
114 | + | @Callable(i) | |
115 | + | func totalBalanceCaller () = (nil ++ totalBalance(i.caller)) | |
116 | + | ||
117 | + | ||
118 | + | ||
119 | + | @Callable(i) | |
120 | + | func totalBalanceAddress (address) = (nil ++ totalBalance(value(addressFromString(address)))) | |
121 | + | ||
122 | + | ||
123 | + | ||
124 | + | @Callable(i) | |
125 | + | func transfer (addresses) = { | |
126 | + | let assetId = i.payments[0].assetId | |
127 | + | let amount = i.payments[0].amount | |
128 | + | let amountPerAddress = (amount / size(addresses)) | |
129 | + | func f (accum,address) = (accum ++ [ScriptTransfer(addressFromStringValue(address), amountPerAddress, assetId)]) | |
130 | + | ||
131 | + | let $l = addresses | |
132 | + | let $s = size($l) | |
133 | + | let $acc0 = nil | |
134 | + | func $f0_1 ($a,$i) = if (($i >= $s)) | |
135 | + | then $a | |
136 | + | else f($a, $l[$i]) | |
137 | + | ||
138 | + | func $f0_2 ($a,$i) = if (($i >= $s)) | |
139 | + | then $a | |
140 | + | else throw("List size exceeds 100") | |
141 | + | ||
142 | + | $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($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), 11), 12), 13), 14), 15), 16), 17), 18), 19), 20), 21), 22), 23), 24), 25), 26), 27), 28), 29), 30), 31), 32), 33), 34), 35), 36), 37), 38), 39), 40), 41), 42), 43), 44), 45), 46), 47), 48), 49), 50), 51), 52), 53), 54), 55), 56), 57), 58), 59), 60), 61), 62), 63), 64), 65), 66), 67), 68), 69), 70), 71), 72), 73), 74), 75), 76), 77), 78), 79), 80), 81), 82), 83), 84), 85), 86), 87), 88), 89), 90), 91), 92), 93), 94), 95), 96), 97), 98), 99), 100) | |
94 | 143 | } | |
95 | 144 | ||
96 | 145 |
github/deemru/w8io/026f985 31.84 ms ◑