tx · F7xwzz2MDq1ZmHRnQcSVhfm56NA9znQiaXMSGJzCPPXx

3MwgDbpnUQcr7MiFVQ1NcNgTBvkRytdGd2R:  -0.00200000 Waves

2022.11.23 16:44 [2329826] smart account 3MwgDbpnUQcr7MiFVQ1NcNgTBvkRytdGd2R > SELF 0.00000000 Waves

{ "type": 13, "id": "F7xwzz2MDq1ZmHRnQcSVhfm56NA9znQiaXMSGJzCPPXx", "fee": 200000, "feeAssetId": null, "timestamp": 1669211111707, "version": 2, "chainId": 84, "sender": "3MwgDbpnUQcr7MiFVQ1NcNgTBvkRytdGd2R", "senderPublicKey": "6kGDUcAPHWXGnMU89GNpRLQT8qawCijYhNB4zF8EV6kK", "proofs": [ "5S2fsqzNE1XipE3A7vCXxaUXLVjbNMGdU9M5mAufNwkWgyxqB8MbjYrajaMp6p5jK38MqqVNziCRNqak9D2LVPHY" ], "script": "base64:BgIWCAISAwoBCBIDCgEIEgMKAQgSAwoBAQYACVNFUEFSQVRPUgICX18ACEtFWV9JTklUAgRJTklUAAxLRVlfTVVMVElTSUcCCE1VTFRJU0lHAApLRVlfU1RBVFVTAgZTVEFUVVMAC0tFWV9DTEFJTUVSAgdDTEFJTUVSARBfdmFsaWRhdGVBZGRyZXNzAQhhZGRyZXNzXwQHJG1hdGNoMAkApggBBQhhZGRyZXNzXwMJAAECBQckbWF0Y2gwAgdBZGRyZXNzBAFhBQckbWF0Y2gwBgcEAWkBBGluaXQBCGNsYWltZXJfBAhtdWx0aXNpZwkBE3ZhbHVlT3JFcnJvck1lc3NhZ2UCCQCiCAEFDEtFWV9NVUxUSVNJRwIVaW5pdDogbm8gbXVsdGlzaWcgc2V0BARpbml0CQELdmFsdWVPckVsc2UCCQCgCAEFCEtFWV9JTklUBwQDZXJyAwkBAiE9AggFAWkGY2FsbGVyBQR0aGlzCQACAQIXaW5pdDogcGVybWlzc2lvbiBkZW5pZWQDBQRpbml0CQACAQIZaW5pdDogYWxyZWFkeSBpbml0aWFsaXplZAMJAQEhA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gaXRzZWxmLgFpAQVjbGFpbQEHYW1vdW50XwMJAQIhPQIIBQFpBmNhbGxlcgkBEUBleHRyTmF0aXZlKDEwNjIpAQkBEUBleHRyTmF0aXZlKDEwNTgpAQULS0VZX0NMQUlNRVIJAAIBAhhjbGFpbTogcGVybWlzc2lvbiBkZW5pZWQDAwkAZwIAAAUHYW1vdW50XwYJAGYCBQdhbW91bnRfCAkA7wcBBQR0aGlzB3JlZ3VsYXIJAAIBAhVjbGFpbTogaW52YWxpZCBhbW91bnQJAJQKAgkAzAgCCQEOU2NyaXB0VHJhbnNmZXIDCAUBaQZjYWxsZXIFB2Ftb3VudF8FBHVuaXQFA25pbAUEdW5pdAECdHgBBnZlcmlmeQAEByRtYXRjaDAJAKIIAQUMS0VZX01VTFRJU0lHAwkAAQIFByRtYXRjaDACBlN0cmluZwQIbXVsdGlzaWcFByRtYXRjaDAJAQt2YWx1ZU9yRWxzZQIJAJsIAgkBEUBleHRyTmF0aXZlKDEwNjIpAQUIbXVsdGlzaWcJALkJAgkAzAgCBQpLRVlfU1RBVFVTCQDMCAIJAKUIAQUEdGhpcwkAzAgCCQDYBAEIBQJ0eAJpZAUDbmlsBQlTRVBBUkFUT1IHCQD0AwMIBQJ0eAlib2R5Qnl0ZXMJAJEDAggFAnR4BnByb29mcwAACAUCdHgPc2VuZGVyUHVibGljS2V5r/ldwA==", "height": 2329826, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: none Next: none Full:
OldNewDifferences
1-# no script
1+{-# STDLIB_VERSION 6 #-}
2+{-# SCRIPT_TYPE ACCOUNT #-}
3+{-# CONTENT_TYPE DAPP #-}
4+let SEPARATOR = "__"
5+
6+let KEY_INIT = "INIT"
7+
8+let KEY_MULTISIG = "MULTISIG"
9+
10+let KEY_STATUS = "STATUS"
11+
12+let KEY_CLAIMER = "CLAIMER"
13+
14+func _validateAddress (address_) = match addressFromString(address_) {
15+ case a: Address =>
16+ true
17+ case _ =>
18+ false
19+}
20+
21+
22+@Callable(i)
23+func init (claimer_) = {
24+ let multisig = valueOrErrorMessage(getString(KEY_MULTISIG), "init: no multisig set")
25+ let init = valueOrElse(getBoolean(KEY_INIT), false)
26+ let err = if ((i.caller != this))
27+ then throw("init: permission denied")
28+ else if (init)
29+ then throw("init: already initialized")
30+ else if (!(_validateAddress(claimer_)))
31+ then throw("init: invalid claimer address")
32+ else unit
33+ if ((err == err))
34+ then $Tuple2([BooleanEntry(KEY_INIT, true), StringEntry(KEY_CLAIMER, claimer_)], unit)
35+ else throw("Strict value is not equal to itself.")
36+ }
37+
38+
39+
40+@Callable(i)
41+func setMultisig (multisig_) = {
42+ let err = if ((i.caller != this))
43+ then throw("setMultisig: permission denied")
44+ else if (!(_validateAddress(multisig_)))
45+ then throw("setMultisig: invalid multisig address")
46+ else unit
47+ if ((err == err))
48+ then $Tuple2([StringEntry(KEY_MULTISIG, multisig_)], unit)
49+ else throw("Strict value is not equal to itself.")
50+ }
51+
52+
53+
54+@Callable(i)
55+func setClaimer (claimer_) = {
56+ let err = if ((i.caller != this))
57+ then throw("setClaimer: permission denied")
58+ else if (!(_validateAddress(claimer_)))
59+ then throw("setClaimer: invalid claimer address")
60+ else unit
61+ if ((err == err))
62+ then $Tuple2([StringEntry(KEY_CLAIMER, claimer_)], unit)
63+ else throw("Strict value is not equal to itself.")
64+ }
65+
66+
67+
68+@Callable(i)
69+func claim (amount_) = if ((i.caller != addressFromStringValue(getStringValue(KEY_CLAIMER))))
70+ then throw("claim: permission denied")
71+ else if (if ((0 >= amount_))
72+ then true
73+ else (amount_ > wavesBalance(this).regular))
74+ then throw("claim: invalid amount")
75+ else $Tuple2([ScriptTransfer(i.caller, amount_, unit)], unit)
76+
77+
78+@Verifier(tx)
79+func verify () = match getString(KEY_MULTISIG) {
80+ case multisig: String =>
81+ valueOrElse(getBoolean(addressFromStringValue(multisig), makeString([KEY_STATUS, toString(this), toBase58String(tx.id)], SEPARATOR)), false)
82+ case _ =>
83+ sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey)
84+}
85+

github/deemru/w8io/026f985 
66.61 ms