tx · 8af99uDm7FR2ryDkZGfirMrhDKupSAQUtGY7vpSnicjG

3MvVBtsXroQpy1tsPw21TU2ET9A8WfmrNjz:  -0.00800000 Waves

2023.02.02 11:25 [2431758] smart account 3MvVBtsXroQpy1tsPw21TU2ET9A8WfmrNjz > SELF 0.00000000 Waves

{ "type": 13, "id": "8af99uDm7FR2ryDkZGfirMrhDKupSAQUtGY7vpSnicjG", "fee": 800000, "feeAssetId": null, "timestamp": 1675326385196, "version": 2, "chainId": 84, "sender": "3MvVBtsXroQpy1tsPw21TU2ET9A8WfmrNjz", "senderPublicKey": "C3v9sfZTmGuW7YXwjUKypU41QpFcHCoJxLpvdR4d3iSv", "proofs": [ "5Yc3ZjWYcSSukjvyFv3uM6CDZSUyMYdQP5ozyzzcQAnRSicHmQe9NC2oAVZcvxSx58jDBynAUEemmvHrgTf9THzE", "3QjhqpiiY6bMmX73hCwjsoG4TidAAYF8t2zkVR49bDNHxMSa8bNDGxpQEKYH9WHZFBuzyrRwV1sHh6q1PHCVp2gS" ], "script": "base64:BgImCAISBAoCAQgSBAoCCAgSAwoBCBIDCgEEEgMKAQgSAwoBCBIAEgAUAA9rUHJlZml4UG9vbE5hbWUCBXBvb2xfABFrUHJlZml4RGVwcmVjYXRlZAILZGVwcmVjYXRlZF8ABWtQYWlyAgVwYWlyXwAJa0Fzc2V0SWRBAgpBX2Fzc2V0X2lkAAlrQXNzZXRJZEICCkJfYXNzZXRfaWQAH2tMYXVuY2hwYWREYXRhVHJhbnNhY3Rpb25TdGF0dXMCIWxhdW5jaHBhZF9kYXRhX3RyYW5zYWN0aW9uX3N0YXR1cwATa0FjdGl2ZUFsbENvbnRyYWN0cwIUYWN0aXZlX2FsbF9jb250cmFjdHMADGtBZG1pblB1YktleQIKYWRtaW5fcHViXwANa0FkbWluUHViS2V5MQILYWRtaW5fcHViXzEADWtBZG1pblB1YktleTICC2FkbWluX3B1Yl8yAA1rQWRtaW5QdWJLZXkzAgthZG1pbl9wdWJfMwAUa0Fja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MDCAUCdHgJYm9keUJ5dGVzCQCRAwIIBQJ0eAZwcm9vZnMAAAUMYWRtaW5QdWJLZXkxAAEAAAQSYWRtaW5QdWJLZXkyU2lnbmVkAwkA9AMDCAUCdHgJYm9keUJ5dGVzCQCRAwIIBQJ0eAZwcm9vZnMAAQUMYWRtaW5QdWJLZXkyAAEAAAQSYWRtaW5QdWJLZXkzU2lnbmVkAwkA9AMDCAUCdHgJYm9keUJ5dGVzCQCRAwIIBQJ0eAZwcm9vZnMAAgUMYWRtaW5QdWJLZXkzAAEAAAkAZwIJAGQCCQBkAgUSYWRtaW5QdWJLZXkxU2lnbmVkBRJhZG1pblB1YktleTJTaWduZWQFEmFkbWluUHViS2V5M1NpZ25lZAACwuXPeA==", "height": 2431758, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: DEyoPsRA6SAY8CuaiegoXTXofsdXJQYFoW37t7UU6rxB Next: 4wHwuCTWLM1RV5n45fCHsqGGDKAzcEBso9jKpq6QMUw Full:
OldNewDifferences
11 {-# STDLIB_VERSION 6 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 let kPrefixPoolName = "pool_"
55
66 let kPrefixDeprecated = "deprecated_"
77
88 let kPair = "pair_"
99
1010 let kAssetIdA = "A_asset_id"
1111
1212 let kAssetIdB = "B_asset_id"
1313
1414 let kLaunchpadDataTransactionStatus = "launchpad_data_transaction_status"
1515
1616 let kActiveAllContracts = "active_all_contracts"
1717
1818 let kAdminPubKey = "admin_pub_"
1919
2020 let kAdminPubKey1 = "admin_pub_1"
2121
2222 let kAdminPubKey2 = "admin_pub_2"
2323
2424 let kAdminPubKey3 = "admin_pub_3"
2525
2626 let kAchievementsWriters = "achievements_writers"
2727
2828 let adminPubKey1 = fromBase58String(getStringValue(this, kAdminPubKey1))
2929
3030 let adminPubKey2 = fromBase58String(getStringValue(this, kAdminPubKey2))
3131
3232 let adminPubKey3 = fromBase58String(getStringValue(this, kAdminPubKey3))
3333
3434 let activeAllContracts = getBooleanValue(this, kActiveAllContracts)
3535
3636 func isSelfCall (i) = if ((i.caller == this))
3737 then unit
3838 else throw("Only the Oracle itself can invoke this function")
3939
4040
4141 func getPoolType (poolAddress) = {
4242 let version = valueOrErrorMessage(getString(poolAddress, "version"), "Pool is not initialized")
4343 if ((version == "1.0.0"))
4444 then "cpmm"
4545 else if ((version == "2.0.0"))
4646 then "flat"
4747 else if ((version == "3.0.0"))
4848 then "multycurve"
4949 else throw("Unknown version of pool")
5050 }
5151
5252
5353 func getAddressIfValid (address) = toString(valueOrErrorMessage(addressFromString(address), (("Can't parse \"" + address) + "\" as address")))
5454
5555
5656 func isAdminCall (i) = if (containsElement([adminPubKey1, adminPubKey2, adminPubKey3], i.callerPublicKey))
5757 then unit
5858 else throw("Only admin can call this function")
5959
6060
6161 @Callable(i)
6262 func setAdmin (adminId,adminPubKey) = valueOrElse(isSelfCall(i), if (if ((0 > adminId))
6363 then (adminId > 3)
6464 else false)
6565 then throw("Wrong admin id")
6666 else [StringEntry((kAdminPubKey + toString(adminId)), adminPubKey)])
6767
6868
6969
7070 @Callable(i)
7171 func addPool (poolAddress,poolName) = valueOrElse(isAdminCall(i), {
7272 let validatedAddress = getAddressIfValid(poolAddress)
7373 let keyName = (kPrefixPoolName + validatedAddress)
7474 let possiblyAlreadyAddedPool = getString(this, keyName)
7575 if (isDefined(possiblyAlreadyAddedPool))
7676 then throw((((("Pool with address \"" + validatedAddress) + "\" is already defined with name \"") + value(possiblyAlreadyAddedPool)) + "\""))
7777 else ([StringEntry(keyName, poolName)] ++ (if ((getPoolType(value(addressFromString(poolAddress))) == "multycurve"))
7878 then nil
7979 else {
8080 let assetIdA = valueOrErrorMessage(getString(value(addressFromString(poolAddress)), kAssetIdA), "Asset id A is incorrect")
8181 let assetIdB = valueOrErrorMessage(getString(value(addressFromString(poolAddress)), kAssetIdB), "Asset id B is incorrect")
8282 [StringEntry((((kPair + assetIdA) + "_") + assetIdB), poolAddress)]
8383 }))
8484 })
8585
8686
8787
8888 @Callable(i)
8989 func setDeprecated (poolAddress) = valueOrElse(isAdminCall(i), {
9090 let keyName = (kPrefixPoolName + poolAddress)
9191 if (!(isDefined(getString(this, keyName))))
9292 then throw(("Couldn't found pool with address " + poolAddress))
9393 else [BooleanEntry((kPrefixDeprecated + poolAddress), true)]
9494 })
9595
9696
9797
9898 @Callable(i)
9999 func launchpadDataTransactionStatus (status) = valueOrElse(isAdminCall(i), [BooleanEntry(kLaunchpadDataTransactionStatus, status)])
100100
101101
102102
103103 @Callable(i)
104104 func addAchievementsWriter (address) = valueOrElse(isAdminCall(i), {
105105 let writers = valueOrElse(getString(this, kAchievementsWriters), "")
106106 let data = if ((writers == ""))
107107 then nil
108108 else split(writers, ",")
109109 [StringEntry(kAchievementsWriters, makeString((data :+ address), ","))]
110110 })
111111
112112
113113
114114 @Callable(i)
115115 func removeAchievementsWriter (address) = valueOrElse(isAdminCall(i), {
116116 let writers = split(valueOrElse(getString(this, kAchievementsWriters), ""), ",")
117117 let index = valueOrErrorMessage(indexOf(writers, address), "Can't find address in the list")
118118 [StringEntry(kAchievementsWriters, makeString(removeByIndex(writers, index), ","))]
119119 })
120120
121121
122122
123123 @Callable(i)
124124 func shutdownAllContracts () = valueOrElse(isAdminCall(i), if (!(activeAllContracts))
125125 then throw("All contracts already shutdown")
126126 else [BooleanEntry(kActiveAllContracts, false)])
127127
128128
129129
130130 @Callable(i)
131131 func activateAllContracts () = valueOrElse(isAdminCall(i), if (activeAllContracts)
132132 then throw("All contracts already active")
133133 else [BooleanEntry(kActiveAllContracts, true)])
134134
135135
136136 @Verifier(tx)
137137 func verify () = {
138138 let adminPubKey1Signed = if (sigVerify(tx.bodyBytes, tx.proofs[0], adminPubKey1))
139139 then 1
140140 else 0
141141 let adminPubKey2Signed = if (sigVerify(tx.bodyBytes, tx.proofs[1], adminPubKey2))
142142 then 1
143143 else 0
144144 let adminPubKey3Signed = if (sigVerify(tx.bodyBytes, tx.proofs[2], adminPubKey3))
145145 then 1
146146 else 0
147147 (((adminPubKey1Signed + adminPubKey2Signed) + adminPubKey3Signed) >= 2)
148148 }
149149

github/deemru/w8io/169f3d6 
25.75 ms