tx · HQCZJH8Za2AbcDXAh6vfbYEiW3SrPiJS9uRoyu7ZeXie

3Mt6jj1WUYqd7DT7dHEubs9jETLUXMcAB8k:  -0.01000000 Waves

2023.01.19 08:00 [2411368] smart account 3Mt6jj1WUYqd7DT7dHEubs9jETLUXMcAB8k > SELF 0.00000000 Waves

{ "type": 13, "id": "HQCZJH8Za2AbcDXAh6vfbYEiW3SrPiJS9uRoyu7ZeXie", "fee": 1000000, "feeAssetId": null, "timestamp": 1674104504225, "version": 2, "chainId": 84, "sender": "3Mt6jj1WUYqd7DT7dHEubs9jETLUXMcAB8k", "senderPublicKey": "3VyXNqJY8HwfqLo6TUZ1V4BwE6NMZuq9XYEARYhktMPE", "proofs": [ "2KGb8YnyUcMuxfUtgosGTm9qkp5hjn1AZK7eSBcqKiWE5Zax8PEcw8XZG5AaGmu9gZfbK5QSeztrxeioZA4Ktvdv" ], "script": "base64:BgImCAISBAoCCAgSBAoCCAESBQoDCAEEEgMKAQgSBQoDCAEEEgMKAQgIAQ5nZXRTdHJpbmdCeUtleQEDa2V5CQELdmFsdWVPckVsc2UCCQCdCAIFBHRoaXMFA2tleQIAAQ9nZXRJbnRlZ2VyQnlLZXkBA2tleQkBC3ZhbHVlT3JFbHNlAgkAmggCBQR0aGlzBQNrZXkAAAALQ09ORl9BTUlOX0sCDUFETUlOX0FERFJFU1MAD0NPTkZfQVJUV09SS1NfSwINQVJUV09SS1NfREFQUAAMQ09ORl9VU0VSU19LAgpVU0VSU19EQVBQAAVjaHJpcwkBDmdldFN0cmluZ0J5S2V5AQULQ09ORl9BTUlOX0sADGFydHdvcmtzRGFwcAkBDmdldFN0cmluZ0J5S2V5AQUPQ09ORl9BUlRXT1JLU19LAAl1c2Vyc0RhcHAJAQ5nZXRTdHJpbmdCeUtleQEFDENPTkZfVVNFUlNfSwYGaW52b2tlAQdzZXRDb25mAgNrZXkDdmFsBAZjYWxsZXIJAKUIAQgFBmludm9rZQZjYWxsZXIDCQEPY29udGFpbnNFbGVtZ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yCQClCAEJAKcIAQgFAWkPY2FsbGVyUHVibGljS2V5BAZhbW91bnQJAQt2YWx1ZU9yRWxzZQIJAJoIAgUEdGhpcwkArAICBQdhZGRyZXNzAglfZnJlZV90eHMAAAMJAGcCAAAFBmFtb3VudAkAAgECFE5vIGZyZWUgdHggYXZhaWxhYmxlBAJpZAkA2AQBCAUBaQ10cmFuc2FjdGlvbklkAwkBD2NvbnRhaW5zRWxlbWVudAIJAMwIAgUMYXJ0d29ya3NEYXBwCQDMCAIFCXVzZXJzRGFwcAUDbmlsBQZjYWxsZXIJAMwIAgkBDEludGVnZXJFbnRyeQIJAKwCAgUHYWRkcmVzcwIJX2ZyZWVfdHhzCQBlAgUGYW1vdW50AAEJAMwIAgkBDlNjcmlwdFRyYW5zZmVyAwkBB0FkZHJlc3MBCQDZBAEFBmNhbGxlcgCgwh4FBHVuaXQFA25pbAkAAgECIVlvdSBhcmUgbm90IGF1dGhvcml6ZWQgdG8gZG8gdGhpcwAMiSNc", "height": 2411368, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: H5PgdiwCkSLydxh4mDKhpNAiYxiXFLmwAQJae2kESam7 Next: BLUucQ6YZ6x2kDcFNYQu96ikhXDe8zoGwChZcvCazkXh Diff:
OldNewDifferences
1111
1212 let CONF_ARTWORKS_K = "ARTWORKS_DAPP"
1313
14+let CONF_USERS_K = "USERS_DAPP"
15+
1416 let chris = getStringByKey(CONF_AMIN_K)
1517
1618 let artworksDapp = getStringByKey(CONF_ARTWORKS_K)
19+
20+let usersDapp = getStringByKey(CONF_USERS_K)
1721
1822 @Callable(invoke)
1923 func setConf (key,val) = {
6468 then throw("No free drop available")
6569 else {
6670 let id = toBase58String(i.transactionId)
67- if (containsElement([chris, artworksDapp], caller))
71+ if (containsElement([artworksDapp], caller))
6872 then [IntegerEntry((address + "_free_drops"), (amount - 1))]
73+ else throw("You are not authorized to do this")
74+ }
75+ }
76+
77+
78+
79+@Callable(i)
80+func whitelistFreeTxs (address,amount,addToCurrentAmount) = {
81+ let caller = toString(addressFromPublicKey(i.callerPublicKey))
82+ let id = toBase58String(i.transactionId)
83+ if (containsElement([chris], caller))
84+ then {
85+ let currentAmount = valueOrElse(getInteger(this, (address + "_free_txq")), 0)
86+ let newAmount = if (addToCurrentAmount)
87+ then (currentAmount + amount)
88+ else amount
89+[IntegerEntry((address + "_free_txs"), newAmount)]
90+ }
91+ else throw("You are not authorized to whitelist txs")
92+ }
93+
94+
95+
96+@Callable(i)
97+func useFreeTx (address) = {
98+ let caller = toString(addressFromPublicKey(i.callerPublicKey))
99+ let amount = valueOrElse(getInteger(this, (address + "_free_txs")), 0)
100+ if ((0 >= amount))
101+ then throw("No free tx available")
102+ else {
103+ let id = toBase58String(i.transactionId)
104+ if (containsElement([artworksDapp, usersDapp], caller))
105+ then [IntegerEntry((address + "_free_txs"), (amount - 1)), ScriptTransfer(Address(fromBase58String(caller)), 500000, unit)]
69106 else throw("You are not authorized to do this")
70107 }
71108 }
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 6 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 func getStringByKey (key) = valueOrElse(getString(this, key), "")
55
66
77 func getIntegerByKey (key) = valueOrElse(getInteger(this, key), 0)
88
99
1010 let CONF_AMIN_K = "ADMIN_ADDRESS"
1111
1212 let CONF_ARTWORKS_K = "ARTWORKS_DAPP"
1313
14+let CONF_USERS_K = "USERS_DAPP"
15+
1416 let chris = getStringByKey(CONF_AMIN_K)
1517
1618 let artworksDapp = getStringByKey(CONF_ARTWORKS_K)
19+
20+let usersDapp = getStringByKey(CONF_USERS_K)
1721
1822 @Callable(invoke)
1923 func setConf (key,val) = {
2024 let caller = toString(invoke.caller)
2125 if (containsElement([chris, toString(this)], caller))
2226 then [StringEntry(key, val)]
2327 else throw("You are not allowed to change this")
2428 }
2529
2630
2731
2832 @Callable(i)
2933 func whitelist (address,days) = {
3034 let caller = toString(addressFromPublicKey(i.callerPublicKey))
3135 let id = toBase58String(i.transactionId)
3236 let expire = if ((days == 0))
3337 then days
3438 else (height + (1440 * days))
3539 if (containsElement([chris], caller))
3640 then [IntegerEntry(address, expire)]
3741 else throw("You are not authorized to whitelist artists")
3842 }
3943
4044
4145
4246 @Callable(i)
4347 func whitelistFreeDrop (address,amount,addToCurrentAmount) = {
4448 let caller = toString(addressFromPublicKey(i.callerPublicKey))
4549 let id = toBase58String(i.transactionId)
4650 if (containsElement([chris], caller))
4751 then {
4852 let currentAmount = valueOrElse(getInteger(this, (address + "_free_drops")), 0)
4953 let newAmount = if (addToCurrentAmount)
5054 then (currentAmount + amount)
5155 else amount
5256 [IntegerEntry((address + "_free_drops"), newAmount)]
5357 }
5458 else throw("You are not authorized to whitelist drops")
5559 }
5660
5761
5862
5963 @Callable(i)
6064 func useFreeDrop (address) = {
6165 let caller = toString(addressFromPublicKey(i.callerPublicKey))
6266 let amount = valueOrElse(getInteger(this, (address + "_free_drops")), 0)
6367 if ((0 >= amount))
6468 then throw("No free drop available")
6569 else {
6670 let id = toBase58String(i.transactionId)
67- if (containsElement([chris, artworksDapp], caller))
71+ if (containsElement([artworksDapp], caller))
6872 then [IntegerEntry((address + "_free_drops"), (amount - 1))]
73+ else throw("You are not authorized to do this")
74+ }
75+ }
76+
77+
78+
79+@Callable(i)
80+func whitelistFreeTxs (address,amount,addToCurrentAmount) = {
81+ let caller = toString(addressFromPublicKey(i.callerPublicKey))
82+ let id = toBase58String(i.transactionId)
83+ if (containsElement([chris], caller))
84+ then {
85+ let currentAmount = valueOrElse(getInteger(this, (address + "_free_txq")), 0)
86+ let newAmount = if (addToCurrentAmount)
87+ then (currentAmount + amount)
88+ else amount
89+[IntegerEntry((address + "_free_txs"), newAmount)]
90+ }
91+ else throw("You are not authorized to whitelist txs")
92+ }
93+
94+
95+
96+@Callable(i)
97+func useFreeTx (address) = {
98+ let caller = toString(addressFromPublicKey(i.callerPublicKey))
99+ let amount = valueOrElse(getInteger(this, (address + "_free_txs")), 0)
100+ if ((0 >= amount))
101+ then throw("No free tx available")
102+ else {
103+ let id = toBase58String(i.transactionId)
104+ if (containsElement([artworksDapp, usersDapp], caller))
105+ then [IntegerEntry((address + "_free_txs"), (amount - 1)), ScriptTransfer(Address(fromBase58String(caller)), 500000, unit)]
69106 else throw("You are not authorized to do this")
70107 }
71108 }
72109
73110

github/deemru/w8io/169f3d6 
26.53 ms