tx · 2w8uJgwuWtM6udzDVUBe8SvBmL2v8kk99HsfXZWY42jy

3MvVBtsXroQpy1tsPw21TU2ET9A8WfmrNjz:  -0.14000000 Waves

2022.11.29 12:44 [2338224] smart account 3MvVBtsXroQpy1tsPw21TU2ET9A8WfmrNjz > SELF 0.00000000 Waves

{ "type": 13, "id": "2w8uJgwuWtM6udzDVUBe8SvBmL2v8kk99HsfXZWY42jy", "fee": 14000000, "feeAssetId": null, "timestamp": 1669715085714, "version": 2, "chainId": 84, "sender": "3MvVBtsXroQpy1tsPw21TU2ET9A8WfmrNjz", "senderPublicKey": "C3v9sfZTmGuW7YXwjUKypU41QpFcHCoJxLpvdR4d3iSv", "proofs": [ "3BJarhwxC7RdXjQpKdPfKgwgTVSNw1zuWWW4uUe71TwVhgUjnP9Xy4xMWjtn2c2ywsGpx2k2mQpL32mho2NKtCGS", "2uv6opzACnm3Ppi49tAvFcQCG4gkgYVqsLuFic5rrvhQUfVHEj8MgcHi8HjNs7UREYPGdinj9SfBrDtMKBWtu48H" ], "script": "base64:BgIhCAISBAoCAQgSBAoCCAgSAwoBBBIDCgEIEgMKAQgSABIAFQAPa1ByZWZpeFBvb2xOYW1lAgVwb29sXwAFa1BhaXICBXBhaXJfAAlrQXNzZXRJZEECCkFfYXNzZXRfaWQACWtBc3NldElkQgIKQl9hc3NldF9pZAAfa0xhdW5jaHBhZERhdGFUcmFuc2FjdGlvblN0YXR1cwIhbGF1bmNocGFkX2RhdGFfdHJhbnNhY3Rpb25fc3RhdHVzABNrQWN0aXZlQWxsQ29udHJhY3RzAhRhY3RpdmVfYWxsX2NvbnRyYWN0cwAMa0FkbWluUHViS2V5AglhZG1pbl9wdWIADWtBZG1pblB1YktleTECC2FkbWluX3B1Yl8xAA1rQWRtaW5QdWJLZXkyAgthZG1pbl9wdWJfMgANa0FkbWluUHViS2V5MwILYWRtaW5fcHViXzMAEmtBZG1pbkludm9rZVB1YktleQIQYWRtaW5faW52b2tlX3B1YgAUa0FjaGlldmVt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25lZAUSYWRtaW5QdWJLZXkzU2lnbmVkAAKYnTC8", "height": 2338224, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: Ddeeor5SDGD6B2nPC1pVpLBz5FW7grpWRMMNyXHCbEce Next: 7WuhyMQV8CMDevX7Jjz7Ku465fvef12LV2ykRC85YXcf Diff:
OldNewDifferences
1010 let kAssetIdB = "B_asset_id"
1111
1212 let kLaunchpadDataTransactionStatus = "launchpad_data_transaction_status"
13+
14+let kActiveAllContracts = "active_all_contracts"
15+
16+let kAdminPubKey = "admin_pub"
1317
1418 let kAdminPubKey1 = "admin_pub_1"
1519
2832 let adminPubKey3 = base58'CFhbV6h41hVjbGHudGtS3fYUv7QAKRxFQzKNtx4B5PqP'
2933
3034 let adminPubKeyInvoke = base58'Kn7NpzaG12dLZgcHf2ipUftU6hbJygmrhFqQYE4B7ZK'
35+
36+let activeAllContracts = getBooleanValue(this, kActiveAllContracts)
3137
3238 func isSelfCall (i) = if ((i.caller == this))
3339 then unit
4955 func getAddressIfValid (address) = toString(valueOrErrorMessage(addressFromString(address), (("Can't parse \"" + address) + "\" as address")))
5056
5157
58+func isAdminCall (i) = if (containsElement([adminPubKey1, adminPubKey2, adminPubKey3], i.callerPublicKey))
59+ then unit
60+ else throw("Only admin can call this function")
61+
62+
5263 @Callable(i)
53-func setAdmin () = valueOrElse(isSelfCall(i), [StringEntry(kAdminPubKey1, toBase58String(adminPubKey1)), StringEntry(kAdminPubKey2, toBase58String(adminPubKey2)), StringEntry(kAdminPubKey3, toBase58String(adminPubKey3)), StringEntry(kAdminInvokePubKey, toBase58String(adminPubKeyInvoke))])
64+func setAdmin (adminId,adminPubKey) = valueOrElse(isSelfCall(i), if (if ((0 > adminId))
65+ then (adminId > 3)
66+ else false)
67+ then throw("Wrong admin id")
68+ else [StringEntry((kAdminPubKey + toString(adminId)), adminPubKey)])
5469
5570
5671
5772 @Callable(i)
58-func addPool (poolAddress,poolName) = valueOrElse(isSelfCall(i), {
73+func addPool (poolAddress,poolName) = valueOrElse(isAdminCall(i), {
5974 let validatedAddress = getAddressIfValid(poolAddress)
6075 let keyName = (kPrefixPoolName + validatedAddress)
6176 let possiblyAlreadyAddedPool = getString(this, keyName)
7388
7489
7590 @Callable(i)
76-func renamePool (poolAddress,newPoolName) = valueOrElse(isSelfCall(i), {
77- let validatedAddress = getAddressIfValid(poolAddress)
78- let keyName = (kPrefixPoolName + validatedAddress)
79- let possiblyAlreadyAddedPool = getString(this, keyName)
80- if (isDefined(possiblyAlreadyAddedPool))
81- then [StringEntry(keyName, newPoolName)]
82- else throw((("Pool with address \"" + validatedAddress) + "\" has not yet been added"))
83- })
91+func launchpadDataTransactionStatus (status) = valueOrElse(isAdminCall(i), [BooleanEntry(kLaunchpadDataTransactionStatus, status)])
8492
8593
8694
8795 @Callable(i)
88-func launchpadDataTransactionStatus (status) = valueOrElse(isSelfCall(i), [BooleanEntry(kLaunchpadDataTransactionStatus, status)])
89-
90-
91-
92-@Callable(i)
93-func addAchievementsWriter (address) = valueOrElse(isSelfCall(i), {
96+func addAchievementsWriter (address) = valueOrElse(isAdminCall(i), {
9497 let writers = valueOrElse(getString(this, kAchievementsWriters), "")
9598 let data = if ((writers == ""))
9699 then nil
101104
102105
103106 @Callable(i)
104-func removeAchievementsWriter (address) = valueOrElse(isSelfCall(i), {
107+func removeAchievementsWriter (address) = valueOrElse(isAdminCall(i), {
105108 let writers = split(valueOrElse(getString(this, kAchievementsWriters), ""), ",")
106109 let index = valueOrErrorMessage(indexOf(writers, address), "Can't find address in the list")
107110 [StringEntry(kAchievementsWriters, makeString(removeByIndex(writers, index), ","))]
108111 })
112+
113+
114+
115+@Callable(i)
116+func shutdownAllContracts () = valueOrElse(isAdminCall(i), if (!(activeAllContracts))
117+ then throw("All contracts already shutdown")
118+ else [BooleanEntry(kActiveAllContracts, false)])
119+
120+
121+
122+@Callable(i)
123+func activateAllContracts () = valueOrElse(isAdminCall(i), if (activeAllContracts)
124+ then throw("All contracts already active")
125+ else [BooleanEntry(kActiveAllContracts, true)])
109126
110127
111128 @Verifier(tx)
119136 let adminPubKey3Signed = if (sigVerify(tx.bodyBytes, tx.proofs[2], adminPubKey3))
120137 then 1
121138 else 0
122- let signedByAdmin = (((adminPubKey1Signed + adminPubKey2Signed) + adminPubKey3Signed) >= 2)
123- let signedByAdminToCallAddPool = (((adminPubKey1Signed + adminPubKey2Signed) + adminPubKey3Signed) >= 1)
124- match tx {
125- case inv: InvokeScriptTransaction =>
126- let isSelfInvokeRenamePool = if ((inv.dApp == this))
127- then containsElement(["renamePool"], inv.function)
128- else false
129- let isSelfInvokeSetAdmin = if ((inv.dApp == this))
130- then containsElement(["setAdmin"], inv.function)
131- else false
132- let isSelfInvokeAddPool = if ((inv.dApp == this))
133- then containsElement(["addPool"], inv.function)
134- else false
135- let isSelfInvokeLaunchpadDataTxStatus = if ((inv.dApp == this))
136- then containsElement(["launchpadDataTransactionStatus"], inv.function)
137- else false
138- let isSelfInvokeAddAchievementsWriter = if ((inv.dApp == this))
139- then containsElement(["addAchievementsWriter"], inv.function)
140- else false
141- let isSelfInvokeRemoveAchievementsWriter = if ((inv.dApp == this))
142- then containsElement(["removeAchievementsWriter"], inv.function)
143- else false
144- if (if (if (if (if (if (if (signedByAdmin)
145- then (size(inv.payments) == 0)
146- else false)
147- then isSelfInvokeRenamePool
148- else false)
149- then true
150- else if (if (signedByAdminToCallAddPool)
151- then (size(inv.payments) == 0)
152- else false)
153- then isSelfInvokeAddPool
154- else false)
155- then true
156- else if (if (signedByAdmin)
157- then (size(inv.payments) == 0)
158- else false)
159- then isSelfInvokeSetAdmin
160- else false)
161- then true
162- else if (if (signedByAdmin)
163- then (size(inv.payments) == 0)
164- else false)
165- then isSelfInvokeLaunchpadDataTxStatus
166- else false)
167- then true
168- else if (if (signedByAdmin)
169- then (size(inv.payments) == 0)
170- else false)
171- then isSelfInvokeAddAchievementsWriter
172- else false)
173- then true
174- else if (if (signedByAdmin)
175- then (size(inv.payments) == 0)
176- else false)
177- then isSelfInvokeRemoveAchievementsWriter
178- else false
179- case _: Order|DataTransaction|SponsorFeeTransaction|SetScriptTransaction|CreateAliasTransaction|LeaseCancelTransaction|LeaseTransaction|IssueTransaction|InvokeExpressionTransaction|UpdateAssetInfoTransaction|InvokeScriptTransaction|SetAssetScriptTransaction|TransferTransaction|ExchangeTransaction|MassTransferTransaction|BurnTransaction|ReissueTransaction =>
180- signedByAdmin
181- case _ =>
182- throw("Match error")
183- }
139+ (((adminPubKey1Signed + adminPubKey2Signed) + adminPubKey3Signed) >= 2)
184140 }
185141
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 6 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 let kPrefixPoolName = "pool_"
55
66 let kPair = "pair_"
77
88 let kAssetIdA = "A_asset_id"
99
1010 let kAssetIdB = "B_asset_id"
1111
1212 let kLaunchpadDataTransactionStatus = "launchpad_data_transaction_status"
13+
14+let kActiveAllContracts = "active_all_contracts"
15+
16+let kAdminPubKey = "admin_pub"
1317
1418 let kAdminPubKey1 = "admin_pub_1"
1519
1620 let kAdminPubKey2 = "admin_pub_2"
1721
1822 let kAdminPubKey3 = "admin_pub_3"
1923
2024 let kAdminInvokePubKey = "admin_invoke_pub"
2125
2226 let kAchievementsWriters = "achievements_writers"
2327
2428 let adminPubKey1 = base58'GFmKZ2naZFRoCvNbwKAQVGmLb1uBeWGDgFabdGBuZiuy'
2529
2630 let adminPubKey2 = base58'GmJXRyhRA79g8yUGgKBAVdnFfQFDMjQG98b1MmLDh5kk'
2731
2832 let adminPubKey3 = base58'CFhbV6h41hVjbGHudGtS3fYUv7QAKRxFQzKNtx4B5PqP'
2933
3034 let adminPubKeyInvoke = base58'Kn7NpzaG12dLZgcHf2ipUftU6hbJygmrhFqQYE4B7ZK'
35+
36+let activeAllContracts = getBooleanValue(this, kActiveAllContracts)
3137
3238 func isSelfCall (i) = if ((i.caller == this))
3339 then unit
3440 else throw("Only the Oracle itself can invoke this function")
3541
3642
3743 func getPoolType (poolAddress) = {
3844 let version = valueOrErrorMessage(getString(poolAddress, "version"), "Pool is not initialized")
3945 if ((version == "1.0.0"))
4046 then "cpmm"
4147 else if ((version == "2.0.0"))
4248 then "flat"
4349 else if ((version == "3.0.0"))
4450 then "multycurve"
4551 else throw("Unknown version of pool")
4652 }
4753
4854
4955 func getAddressIfValid (address) = toString(valueOrErrorMessage(addressFromString(address), (("Can't parse \"" + address) + "\" as address")))
5056
5157
58+func isAdminCall (i) = if (containsElement([adminPubKey1, adminPubKey2, adminPubKey3], i.callerPublicKey))
59+ then unit
60+ else throw("Only admin can call this function")
61+
62+
5263 @Callable(i)
53-func setAdmin () = valueOrElse(isSelfCall(i), [StringEntry(kAdminPubKey1, toBase58String(adminPubKey1)), StringEntry(kAdminPubKey2, toBase58String(adminPubKey2)), StringEntry(kAdminPubKey3, toBase58String(adminPubKey3)), StringEntry(kAdminInvokePubKey, toBase58String(adminPubKeyInvoke))])
64+func setAdmin (adminId,adminPubKey) = valueOrElse(isSelfCall(i), if (if ((0 > adminId))
65+ then (adminId > 3)
66+ else false)
67+ then throw("Wrong admin id")
68+ else [StringEntry((kAdminPubKey + toString(adminId)), adminPubKey)])
5469
5570
5671
5772 @Callable(i)
58-func addPool (poolAddress,poolName) = valueOrElse(isSelfCall(i), {
73+func addPool (poolAddress,poolName) = valueOrElse(isAdminCall(i), {
5974 let validatedAddress = getAddressIfValid(poolAddress)
6075 let keyName = (kPrefixPoolName + validatedAddress)
6176 let possiblyAlreadyAddedPool = getString(this, keyName)
6277 if (isDefined(possiblyAlreadyAddedPool))
6378 then throw((((("Pool with address \"" + validatedAddress) + "\" is already defined with name \"") + value(possiblyAlreadyAddedPool)) + "\""))
6479 else ([StringEntry(keyName, poolName)] ++ (if ((getPoolType(value(addressFromString(poolAddress))) == "multycurve"))
6580 then nil
6681 else {
6782 let assetIdA = valueOrErrorMessage(getString(value(addressFromString(poolAddress)), kAssetIdA), "Asset id A is incorrect")
6883 let assetIdB = valueOrErrorMessage(getString(value(addressFromString(poolAddress)), kAssetIdB), "Asset id B is incorrect")
6984 [StringEntry((((kPair + assetIdA) + "_") + assetIdB), poolAddress)]
7085 }))
7186 })
7287
7388
7489
7590 @Callable(i)
76-func renamePool (poolAddress,newPoolName) = valueOrElse(isSelfCall(i), {
77- let validatedAddress = getAddressIfValid(poolAddress)
78- let keyName = (kPrefixPoolName + validatedAddress)
79- let possiblyAlreadyAddedPool = getString(this, keyName)
80- if (isDefined(possiblyAlreadyAddedPool))
81- then [StringEntry(keyName, newPoolName)]
82- else throw((("Pool with address \"" + validatedAddress) + "\" has not yet been added"))
83- })
91+func launchpadDataTransactionStatus (status) = valueOrElse(isAdminCall(i), [BooleanEntry(kLaunchpadDataTransactionStatus, status)])
8492
8593
8694
8795 @Callable(i)
88-func launchpadDataTransactionStatus (status) = valueOrElse(isSelfCall(i), [BooleanEntry(kLaunchpadDataTransactionStatus, status)])
89-
90-
91-
92-@Callable(i)
93-func addAchievementsWriter (address) = valueOrElse(isSelfCall(i), {
96+func addAchievementsWriter (address) = valueOrElse(isAdminCall(i), {
9497 let writers = valueOrElse(getString(this, kAchievementsWriters), "")
9598 let data = if ((writers == ""))
9699 then nil
97100 else split(writers, ",")
98101 [StringEntry(kAchievementsWriters, makeString((data :+ address), ","))]
99102 })
100103
101104
102105
103106 @Callable(i)
104-func removeAchievementsWriter (address) = valueOrElse(isSelfCall(i), {
107+func removeAchievementsWriter (address) = valueOrElse(isAdminCall(i), {
105108 let writers = split(valueOrElse(getString(this, kAchievementsWriters), ""), ",")
106109 let index = valueOrErrorMessage(indexOf(writers, address), "Can't find address in the list")
107110 [StringEntry(kAchievementsWriters, makeString(removeByIndex(writers, index), ","))]
108111 })
112+
113+
114+
115+@Callable(i)
116+func shutdownAllContracts () = valueOrElse(isAdminCall(i), if (!(activeAllContracts))
117+ then throw("All contracts already shutdown")
118+ else [BooleanEntry(kActiveAllContracts, false)])
119+
120+
121+
122+@Callable(i)
123+func activateAllContracts () = valueOrElse(isAdminCall(i), if (activeAllContracts)
124+ then throw("All contracts already active")
125+ else [BooleanEntry(kActiveAllContracts, true)])
109126
110127
111128 @Verifier(tx)
112129 func verify () = {
113130 let adminPubKey1Signed = if (sigVerify(tx.bodyBytes, tx.proofs[0], adminPubKey1))
114131 then 1
115132 else 0
116133 let adminPubKey2Signed = if (sigVerify(tx.bodyBytes, tx.proofs[1], adminPubKey2))
117134 then 1
118135 else 0
119136 let adminPubKey3Signed = if (sigVerify(tx.bodyBytes, tx.proofs[2], adminPubKey3))
120137 then 1
121138 else 0
122- let signedByAdmin = (((adminPubKey1Signed + adminPubKey2Signed) + adminPubKey3Signed) >= 2)
123- let signedByAdminToCallAddPool = (((adminPubKey1Signed + adminPubKey2Signed) + adminPubKey3Signed) >= 1)
124- match tx {
125- case inv: InvokeScriptTransaction =>
126- let isSelfInvokeRenamePool = if ((inv.dApp == this))
127- then containsElement(["renamePool"], inv.function)
128- else false
129- let isSelfInvokeSetAdmin = if ((inv.dApp == this))
130- then containsElement(["setAdmin"], inv.function)
131- else false
132- let isSelfInvokeAddPool = if ((inv.dApp == this))
133- then containsElement(["addPool"], inv.function)
134- else false
135- let isSelfInvokeLaunchpadDataTxStatus = if ((inv.dApp == this))
136- then containsElement(["launchpadDataTransactionStatus"], inv.function)
137- else false
138- let isSelfInvokeAddAchievementsWriter = if ((inv.dApp == this))
139- then containsElement(["addAchievementsWriter"], inv.function)
140- else false
141- let isSelfInvokeRemoveAchievementsWriter = if ((inv.dApp == this))
142- then containsElement(["removeAchievementsWriter"], inv.function)
143- else false
144- if (if (if (if (if (if (if (signedByAdmin)
145- then (size(inv.payments) == 0)
146- else false)
147- then isSelfInvokeRenamePool
148- else false)
149- then true
150- else if (if (signedByAdminToCallAddPool)
151- then (size(inv.payments) == 0)
152- else false)
153- then isSelfInvokeAddPool
154- else false)
155- then true
156- else if (if (signedByAdmin)
157- then (size(inv.payments) == 0)
158- else false)
159- then isSelfInvokeSetAdmin
160- else false)
161- then true
162- else if (if (signedByAdmin)
163- then (size(inv.payments) == 0)
164- else false)
165- then isSelfInvokeLaunchpadDataTxStatus
166- else false)
167- then true
168- else if (if (signedByAdmin)
169- then (size(inv.payments) == 0)
170- else false)
171- then isSelfInvokeAddAchievementsWriter
172- else false)
173- then true
174- else if (if (signedByAdmin)
175- then (size(inv.payments) == 0)
176- else false)
177- then isSelfInvokeRemoveAchievementsWriter
178- else false
179- case _: Order|DataTransaction|SponsorFeeTransaction|SetScriptTransaction|CreateAliasTransaction|LeaseCancelTransaction|LeaseTransaction|IssueTransaction|InvokeExpressionTransaction|UpdateAssetInfoTransaction|InvokeScriptTransaction|SetAssetScriptTransaction|TransferTransaction|ExchangeTransaction|MassTransferTransaction|BurnTransaction|ReissueTransaction =>
180- signedByAdmin
181- case _ =>
182- throw("Match error")
183- }
139+ (((adminPubKey1Signed + adminPubKey2Signed) + adminPubKey3Signed) >= 2)
184140 }
185141

github/deemru/w8io/026f985 
50.55 ms