tx · GMyusQBqu7Txr3tZ7JNGdk9XvtCJw3eC29QHFHx9qzCQ 3Mp8Ho5tMT8763ehdYqbi7zPtbGDuqC6Wsd: -0.01600000 Waves 2022.12.20 10:58 [2368341] smart account 3Mp8Ho5tMT8763ehdYqbi7zPtbGDuqC6Wsd > SELF 0.00000000 Waves
{ "type": 13, "id": "GMyusQBqu7Txr3tZ7JNGdk9XvtCJw3eC29QHFHx9qzCQ", "fee": 1600000, "feeAssetId": null, "timestamp": 1671523098004, "version": 2, "chainId": 84, "sender": "3Mp8Ho5tMT8763ehdYqbi7zPtbGDuqC6Wsd", "senderPublicKey": "AKGrXfFfmMqNYsJJoMcL5YZHfRhxau4pkJbVGKhx468Q", "proofs": [ "2mCMVykNj37QG75GJS3bedm6ppvNubuWV9ED8jeZ66Z9PAPCF1XbGFa2AHTkxodeE1CMqj3GgnMD1V99pwHsyf2R" ], "script": "base64:BgL4EQgCEgQKAggIEg4KDAgICAgICAgICAgICBINCgsICAgICAgICAgICBIGCgQICAgIEgQKAggIEgcKBQgBAQgBEgQKAggIEgQKAggIEgYKBAgICAgSBgoECAgICCIOZ2V0U3RyaW5nQnlLZXkiA2tleSIIdW5pdFRlc3QiCW9yYWNsZUZlZSIIc2lnbkRhcHAiC2ZlZVJlY2VpdmVyIgh1c2VyRGFwcCINd2hpdGVsaXN0RGFwcCILc2lnbkFzc2V0SWQiC3VzZG5Bc3NldElkIgx3YXZlc0Fzc2V0SWQiBWNocmlzIhlnZXRJbnRlZ2VyQnlLZXlGcm9tT3JhY2xlIg9nZXRJbnRlZ2VyQnlLZXkiDmNoZWNrV2hpdGVsaXN0Ig9nZXRCb29sZWFuQnlLZXkiB3NpZ25DdXQiC3VzZG5XYXZlQ3V0Ig5kZWZhdWx0TGljZW5jZSISZGVmYXVsdEhhc2hMaWNlbmNlIgtkYXBwUnVubmluZyIObWFpbnRlbmFuY2VNU0ciDXVzZXJTdXNwZW5kZWQiC3VzZXJSZW1vdmVkIhB1c2VyVW5yZWd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mJpAgAJAAIBAg1CaWQgbm90IGZvdW5kBAJiagkAtQkCBQJiaQIBXwQCYVIJAQJiZgEJAJEDAgUCYmoAAAQCY3kCCENBTkNFTEVECQDMCAIJAQtEZWxldGVFbnRyeQEJAKwCAgUCYmgCBV9PUEVOCQDMCAIJAQtTdHJpbmdFbnRyeQIJAKwCAgkArAICBQJiaAIBXwUCY3kJAKwCAgkArAICBQJiaQIBXwkApAMBBQJidAkAzAgCCQEMSW50ZWdlckVudHJ5AgkArAICAhJjdXJyZW50X2JpZGFtb3VudF8FAU8JAGUCBQJjcwABCQDMCAIJAQ5TY3JpcHRUcmFuc2ZlcgMJAQdBZGRyZXNzAQkA2QQBBQJjeAkBDXBhcnNlSW50VmFsdWUBCQCRAwIFAmJqAAEFAmFSBQNuaWwAx6GMlw==", "height": 2368341, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: ydEe7NWa9esYFVqJkWtkhkGXgojzFuKUEbKW9F9dqtU Next: 7L3dhQVGXzSsRTFUW61kr62vf3336iu51nwakQudTuy4 Full:
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 6 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | - | let wxPool = addressFromStringValue("3PPZWgFNRKHLvM51pwS934C8VZ7d2F4Z58g") | |
5 | - | ||
6 | - | let usdnAssetId = base58'DG2xFkPdDwKUoBkzGAhQtLpSGzfXLiCYPEzeKH2Ad24p' | |
7 | - | ||
8 | - | let usdnAssetIdString = "DG2xFkPdDwKUoBkzGAhQtLpSGzfXLiCYPEzeKH2Ad24p" | |
9 | - | ||
10 | - | let usdnWavesLPTokenAssetId = base58'7KZbJrVopwJhkdwbe1eFDBbex4dkY63MxjTNjqXtrzj1' | |
11 | - | ||
12 | - | let routingPuzzlePool = addressFromStringValue("3PGFHzVGT4NTigwCKP1NcwoXkodVZwvBuuU") | |
13 | - | ||
14 | - | let nonRoutingPuzzlePool = addressFromStringValue("3PDrYPF6izza2sXWffzTPF7e2Fcir2CMpki") | |
15 | - | ||
16 | - | let surfAssetId = base58'At8D6NFFpheCbvKVnjVoeLL84Eo8NZn6ovManxfLaFWL' | |
17 | - | ||
18 | - | let surfAssetIdString = "At8D6NFFpheCbvKVnjVoeLL84Eo8NZn6ovManxfLaFWL" | |
19 | - | ||
20 | - | let nonRoutingPuzzleSurfPool = addressFromStringValue("3P7r93vXHuusageNJVGwzqaz3WMotAu49Yz") | |
21 | - | ||
22 | - | let swopSurfPool = addressFromStringValue("3PLp9KrdrbWAvSFHGJVEaszUubquz3M6mfe") | |
23 | - | ||
24 | - | let wxAssetId = base58'Atqv59EYzjFGuitKVnMRk6H8FukjoV3ktPorbEys25on' | |
25 | - | ||
26 | - | let wxAssetIdString = "Atqv59EYzjFGuitKVnMRk6H8FukjoV3ktPorbEys25on" | |
27 | - | ||
28 | - | let swopWxPool = addressFromStringValue("3PKi4G3VX2k42ZSmNNrmvgdDH7JzRaUhY7R") | |
29 | - | ||
30 | - | let wxWxPool = addressFromStringValue("3PCENpEKe8atwELZ7oCSmcdEfcRuKTrUx99") | |
31 | - | ||
32 | - | let usdnWxLPTokenAssetId = base58'F2AKkA513k5yHEJkLsU6vWxCYYk811GpjLhwEv2WGwZ9' | |
33 | - | ||
34 | - | let wxUsdcPool = addressFromStringValue("3PC3HtupBxBmy4WtZf1Tym1vrxg9MwbZRK1") | |
35 | - | ||
36 | - | let usdcAssetIdString = "6XtHjpXbs9RRJP2Sr9GUyVqzACcby9TkThHXnjVC5CDJ" | |
37 | - | ||
38 | - | let usdcAssetId = base58'6XtHjpXbs9RRJP2Sr9GUyVqzACcby9TkThHXnjVC5CDJ' | |
39 | - | ||
40 | - | let usdcWxLPTokenAssetId = base58'EK6N7S38xbtBT3SxAqoGdDLCiX6rojX6G169CnSyuE5' | |
41 | - | ||
42 | - | let puzzleUsdcPool = addressFromStringValue("3P93Kqz8PUbCudvMyjbci54WxQrtBtw4dbZ") | |
43 | - | ||
44 | - | let wxUsdtPool = addressFromStringValue("3P8KMyAJCPWNcyedqrmymxaeWonvmkhGauz") | |
45 | - | ||
46 | - | let usdtAssetIdString = "34N9YcEETLWn93qYQ64EsP1x89tSruJU44RrEMSXXEPJ" | |
47 | - | ||
48 | - | let usdtAssetId = base58'34N9YcEETLWn93qYQ64EsP1x89tSruJU44RrEMSXXEPJ' | |
49 | - | ||
50 | - | let usdtWxLPTokenAssetId = base58'97zHFp1C3cB7qfvx8Xv5f2rWp9nUSG5UnAamfPcW6txf' | |
51 | - | ||
52 | - | let puzzleUsdtPool = addressFromStringValue("3P93Kqz8PUbCudvMyjbci54WxQrtBtw4dbZ") | |
53 | - | ||
54 | - | let wxTsnPool = addressFromStringValue("3PH832eKnw67PFvJfUg9Knz6BHM87QvjMeL") | |
55 | - | ||
56 | - | let tsnAssetIdString = "8t4DPWTwPzpatHA9AkTxWAB47THnYzBsDnoY7fQqbG91" | |
57 | - | ||
58 | - | let tsnAssetId = base58'8t4DPWTwPzpatHA9AkTxWAB47THnYzBsDnoY7fQqbG91' | |
59 | - | ||
60 | - | let tsnWxLPTokenAssetId = base58'EbwpqrZjrvi7XLowkM5Z2rg7xVdzfg6S5ec9asarpAU9' | |
61 | - | ||
62 | - | let puzzleTsnPool = addressFromStringValue("3PN1eJpdhJyRptcN9iLTarsJBtR2Kb3NXSU") | |
63 | - | ||
64 | - | let wxBtcPool = addressFromStringValue("3PCBWDTA6jrFswd7gQgaE3Xk7gLM5RKofvp") | |
65 | - | ||
66 | - | let swopBtcPool = addressFromStringValue("3PACj2DLTw3uUhsUmT98zHU5M4hPufbHKav") | |
67 | - | ||
68 | - | let btcAssetIdString = "8LQW8f7P5d5PZM7GtZEBgaqRPGSzS3DfPuiXrURJ4AJS" | |
69 | - | ||
70 | - | let btcAssetId = base58'8LQW8f7P5d5PZM7GtZEBgaqRPGSzS3DfPuiXrURJ4AJS' | |
71 | - | ||
72 | - | let btcWxLPTokenAssetId = base58'8WhH5CCJ6NakPvEvAJcizqqD7H6axhupdYHDFumSDwsy' | |
73 | - | ||
74 | - | let btcSwopLpToken = base58'58RNQJqLQ3tYYpkjuJujWzLzMX3nzpGn6bTC8LfLtgAM' | |
75 | - | ||
76 | - | let wxEthPool = addressFromStringValue("3PEMqetsaJDbYMw1XGovmE37FB8VUhGnX9A") | |
77 | - | ||
78 | - | let ethAssetIdString = "474jTeYx2r2Va35794tCScAXWJG9hU2HcgxzMowaZUnu" | |
79 | - | ||
80 | - | let ethAssetId = base58'474jTeYx2r2Va35794tCScAXWJG9hU2HcgxzMowaZUnu' | |
81 | - | ||
82 | - | let ethWxLPTokenAssetId = base58'6gtgBD12xZkUTnzGofoFJpMg5gYG1FP6PaGyLviVQjbh' | |
83 | - | ||
84 | - | let swopEthPool = addressFromStringValue("3PNEC4YKqZiMMytFrYRVtpW2ujvi3aGXRPm") | |
85 | - | ||
86 | - | let ethSwopLpToken = base58'H8wRVSgq82j6YU1K7jXVpDXHpd5m91t3bmCzRR7uFGc7' | |
87 | - | ||
88 | - | let wxLtcPool = addressFromStringValue("3P94wvu5gA7VhjPgAB3twaeqdwHCwNK2vsn") | |
89 | - | ||
90 | - | let ltcAssetIdString = "HZk1mbfuJpmxU1Fs4AX5MWLVYtctsNcg6e2C6VKqK8zk" | |
91 | - | ||
92 | - | let ltcAssetId = base58'HZk1mbfuJpmxU1Fs4AX5MWLVYtctsNcg6e2C6VKqK8zk' | |
93 | - | ||
94 | - | let ltcWxLPTokenAssetId = base58'CNkqC6GPi888WdJ1EuVtu9JGZ9VHpAn8eTHwR8YZxXbv' | |
95 | - | ||
96 | - | let swopLtcPool = addressFromStringValue("3P32Rjpo9YHoHaorLSxvnV6CkKFXyfDCkJh") | |
97 | - | ||
98 | - | let ltcSwopLpToken = base58'2npCQ21bzjEgBYWMepyd95aA3vwXaQpPBXnHtmmXadXF' | |
99 | - | ||
100 | - | let wxWestPool = addressFromStringValue("3PFxchXqKNjgP1CcbgFZjHyrEj9xMbSeLU3") | |
101 | - | ||
102 | - | let westAssetIdString = "4LHHvYGNKJUg5hj65aGD5vgScvCBmLpdRFtjokvCjSL8" | |
103 | - | ||
104 | - | let westAssetId = base58'4LHHvYGNKJUg5hj65aGD5vgScvCBmLpdRFtjokvCjSL8' | |
105 | - | ||
106 | - | let westWxLPTokenAssetId = base58'CaryXC3PhVr1rTxUGk8Bx7CcoxPX9ea3F5RGFiCe98Jr' | |
107 | - | ||
108 | - | let swopWestPool = addressFromStringValue("3P6DLdJTP2EySq9MFdJu6beUevrQd2sVVBh") | |
109 | - | ||
110 | - | let westSwopLpToken = base58'8g1Ki9cvjjhLUTyNwd4MaZ4fNfNTVc92Cb6f8My4qb1A' | |
111 | - | ||
112 | - | let wxEggPool = addressFromStringValue("3P3Y38zymCHoTM6qcE9JcEA8rhaGTQbVMgu") | |
113 | - | ||
114 | - | let eggAssetIdString = "C1iWsKGqLwjHUndiQ7iXpdmPum9PeCDFfyXBdJJosDRS" | |
115 | - | ||
116 | - | let eggAssetId = base58'C1iWsKGqLwjHUndiQ7iXpdmPum9PeCDFfyXBdJJosDRS' | |
117 | - | ||
118 | - | let eggWxLPTokenAssetId = base58'EsGs3xQLW8QSRiABfztfVLe8u5a2pvNfkdti4VYes1ms' | |
119 | - | ||
120 | - | let swopEggPool = addressFromStringValue("3PEeJQRJT4v4XvSUBPmxhdWKz439nae7KtQ") | |
121 | - | ||
122 | - | let eggSwopLpToken = base58'2wk64hhVqjC3DgJa9HE9bcV7dCazuRtCSs6giqBAbBak' | |
123 | - | ||
124 | - | let swopPlutoPool = addressFromStringValue("3PDSXwwA2xAtmxeo2bebDP3AA5ynZ2Krgnw") | |
125 | - | ||
126 | - | let plutoSwopLpToken = base58'CBFNT7ti8bGzESndbsNB376Ug4fQ2ZyhXzdY892edTqq' | |
127 | - | ||
128 | - | let plutoAssetIdString = "Ajso6nTTjptu2UHLx6hfSXVtHFtRBJCkKYd5SAyj7zf5" | |
129 | - | ||
130 | - | let plutoAssetId = base58'Ajso6nTTjptu2UHLx6hfSXVtHFtRBJCkKYd5SAyj7zf5' | |
131 | - | ||
132 | - | let puzzlePlutoPool = addressFromStringValue("3P93Kqz8PUbCudvMyjbci54WxQrtBtw4dbZ") | |
133 | - | ||
134 | - | func getIntegerByKey (key) = valueOrElse(getInteger(this, key), 35) | |
4 | + | func getStringByKey (key) = valueOrElse(getString(this, key), "") | |
135 | 5 | ||
136 | 6 | ||
137 | - | let | |
7 | + | let unitTest = false | |
138 | 8 | ||
139 | - | @Callable(i) | |
140 | - | func set (a) = if ((i.caller != this)) | |
141 | - | then throw("you are not allowed to set!") | |
142 | - | else [IntegerEntry("montant", a)] | |
9 | + | let oracleFee = value(addressFromString(getStringByKey("conf_oracle_fee"))) | |
10 | + | ||
11 | + | let signDapp = value(addressFromString(getStringByKey("conf_signweb_dapp"))) | |
12 | + | ||
13 | + | let feeReceiver = getStringByKey("conf_fee_receiver") | |
14 | + | ||
15 | + | let userDapp = if (unitTest) | |
16 | + | then value(addressFromString("3Mt4RGMEyjSWYAocTPqd55wdHQQB3PU2UCm")) | |
17 | + | else value(addressFromString(getStringByKey("conf_users_dapp"))) | |
18 | + | ||
19 | + | let whitelistDapp = value(addressFromString(getStringByKey("conf_whitelist_dapp"))) | |
20 | + | ||
21 | + | let signAssetId = fromBase58String(getStringByKey("conf_accepted_asset_SIGN")) | |
22 | + | ||
23 | + | let usdnAssetId = fromBase58String(getStringByKey("conf_accepted_asset_USDN")) | |
24 | + | ||
25 | + | let wavesAssetId = base58'' | |
26 | + | ||
27 | + | let chris = getStringByKey("conf_admin_1") | |
28 | + | ||
29 | + | func getIntegerByKeyFromOracle (key) = valueOrErrorMessage(getInteger(oracleFee, key), "Integer undefine or 0 in oracle") | |
30 | + | ||
31 | + | ||
32 | + | func getIntegerByKey (key) = valueOrElse(getInteger(this, key), 0) | |
33 | + | ||
34 | + | ||
35 | + | func checkWhitelist (key) = valueOrElse(getInteger(whitelistDapp, key), 0) | |
36 | + | ||
37 | + | ||
38 | + | func getBooleanByKey (key) = valueOrElse(getBoolean(this, key), false) | |
39 | + | ||
40 | + | ||
41 | + | let signCut = 7 | |
42 | + | ||
43 | + | let usdnWaveCut = 10 | |
44 | + | ||
45 | + | let defaultLicence = getStringByKey("conf_default_licence") | |
46 | + | ||
47 | + | let defaultHashLicence = getStringByKey("conf_default_licence_hash") | |
48 | + | ||
49 | + | let dappRunning = valueOrElse(getBoolean(userDapp, "conf_dapp_is_running"), true) | |
50 | + | ||
51 | + | let maintenanceMSG = valueOrElse(getString(userDapp, "conf_maintenance_msg"), "") | |
52 | + | ||
53 | + | let userSuspended = "SUSPENDED" | |
54 | + | ||
55 | + | let userRemoved = "REMOVED" | |
56 | + | ||
57 | + | let userUnregistered = "UNREGISTERED" | |
58 | + | ||
59 | + | let userAllowed = "ALLOWED" | |
60 | + | ||
61 | + | let currentCertificationPrice = getIntegerByKeyFromOracle(("certification_fee_" + toBase58String(signAssetId))) | |
62 | + | ||
63 | + | func checkSignCertificate (signID,Owner,sha256Hash) = match getString(signDapp, ((("data_fc_" + signID) + "_") + Owner)) { | |
64 | + | case a: String => | |
65 | + | if (contains(a, sha256Hash)) | |
66 | + | then true | |
67 | + | else false | |
68 | + | case _ => | |
69 | + | false | |
70 | + | } | |
71 | + | ||
72 | + | ||
73 | + | func validateCID (cid) = if (contains(cid, "/")) | |
74 | + | then if (if ((76 > size(cid))) | |
75 | + | then (size(split(cid, "/")[0]) == 59) | |
76 | + | else false) | |
77 | + | then (16 > size(split(cid, "/")[1])) | |
78 | + | else false | |
79 | + | else false | |
80 | + | ||
81 | + | ||
82 | + | func validateHash (hash) = (size(hash) == 64) | |
83 | + | ||
84 | + | ||
85 | + | func keyUserStatus (caller) = ("user_status_" + caller) | |
86 | + | ||
87 | + | ||
88 | + | func keyDate (caller,artId) = ((("art_date_" + artId) + "_") + caller) | |
89 | + | ||
90 | + | ||
91 | + | func keyName (caller,artId) = ((("art_name_" + artId) + "_") + caller) | |
92 | + | ||
93 | + | ||
94 | + | func keyDesc (caller,artId) = ((("art_desc_" + artId) + "_") + caller) | |
95 | + | ||
96 | + | ||
97 | + | func keyDisplayCid (caller,artId) = ((("art_display_cid_" + artId) + "_") + caller) | |
98 | + | ||
99 | + | ||
100 | + | func keyExportHash (caller,artId) = ((("art_export_hash_" + artId) + "_") + caller) | |
101 | + | ||
102 | + | ||
103 | + | func keyExportCid (caller,artId) = ((("art_export_cid_" + artId) + "_") + caller) | |
104 | + | ||
105 | + | ||
106 | + | func keyMaxMint (caller,artId) = ((("art_maxmint_" + artId) + "_") + caller) | |
107 | + | ||
108 | + | ||
109 | + | func keySignID (caller,artId) = ((("art_signid_" + artId) + "_") + caller) | |
110 | + | ||
111 | + | ||
112 | + | func keyIssued (caller,artId) = ((("art_issued_" + artId) + "_") + caller) | |
113 | + | ||
114 | + | ||
115 | + | func keyOnSale (caller,artId) = ((("art_onsale_" + artId) + "_") + caller) | |
116 | + | ||
117 | + | ||
118 | + | func keyLicenceHash (caller,artId) = ((("art_licence_hash_" + artId) + "_") + caller) | |
119 | + | ||
120 | + | ||
121 | + | func keyLicenceCid (caller,artId) = ((("art_licence_cid_" + artId) + "_") + caller) | |
122 | + | ||
123 | + | ||
124 | + | func keyTags (caller,artId) = ((("art_tags_" + artId) + "_") + caller) | |
125 | + | ||
126 | + | ||
127 | + | func keyType (caller,artId) = ((("art_type_" + artId) + "_") + caller) | |
128 | + | ||
129 | + | ||
130 | + | func keyNote (caller,artId) = ((("art_note_" + artId) + "_") + caller) | |
131 | + | ||
132 | + | ||
133 | + | func keyCrawler (caller,artId) = ((("art_crawler_cid_" + artId) + "_") + caller) | |
134 | + | ||
135 | + | ||
136 | + | func keyPrice (caller,artId) = ((("art_price_" + artId) + "_") + caller) | |
137 | + | ||
138 | + | ||
139 | + | func keyEndSale (caller,artId) = ((("art_endsale_" + artId) + "_") + caller) | |
140 | + | ||
141 | + | ||
142 | + | func keyAssetIdAccepted (caller,artId) = ((("art_assetAccepted_" + artId) + "_") + caller) | |
143 | + | ||
144 | + | ||
145 | + | func keyFlag (caller,artId) = ((("art_flag_" + artId) + "_") + caller) | |
146 | + | ||
147 | + | ||
148 | + | func keyArtistAgentAddr (artistAddr) = ("artist_agent_" + artistAddr) | |
149 | + | ||
150 | + | ||
151 | + | func keyPrimaryShare (artistAddr) = ("artist_agent_primary_" + artistAddr) | |
152 | + | ||
153 | + | ||
154 | + | func keyHashByTxidAddr (caller,txid) = ((("get_hashbytxidaddr_" + txid) + "_") + caller) | |
155 | + | ||
156 | + | ||
157 | + | func keyOwnerByHash (sha256Hash) = ("get_owner_by_hash_" + sha256Hash) | |
158 | + | ||
159 | + | ||
160 | + | func keyidBySignid (caller,signId) = ((("get_artidbysignid_" + signId) + "_") + caller) | |
161 | + | ||
162 | + | ||
163 | + | func keyTxidByHashOwner (sha256Hash,caller) = ("get_txid_by_hash_owner_" + toBase58String(sha256_16Kb(toBytes((sha256Hash + caller))))) | |
164 | + | ||
165 | + | ||
166 | + | func validateAllCID (cidDisplay,cidExport,cidLicence) = if (!(validateCID(cidDisplay))) | |
167 | + | then throw("Wrong Display CID") | |
168 | + | else if (!(validateCID(cidExport))) | |
169 | + | then throw("Wrong Export CID") | |
170 | + | else if (if ((cidLicence != "")) | |
171 | + | then !(validateCID(cidLicence)) | |
172 | + | else false) | |
173 | + | then throw("Wrong Licence CID") | |
174 | + | else true | |
175 | + | ||
176 | + | ||
177 | + | func validateAllHash (sha256Export,sha256Licence) = if (!(validateHash(sha256Export))) | |
178 | + | then throw("Export Hash 64 char. max") | |
179 | + | else if (!(validateHash(sha256Licence))) | |
180 | + | then throw("Licence Hash 64 char. max") | |
181 | + | else true | |
182 | + | ||
183 | + | ||
184 | + | func validateString (str,max) = if ((size(str) == 0)) | |
185 | + | then throw("Field cannot be is empty") | |
186 | + | else if ((size(str) > max)) | |
187 | + | then throw((str + " is too long")) | |
188 | + | else true | |
189 | + | ||
190 | + | ||
191 | + | func validateUser (caller) = { | |
192 | + | let userStatus = valueOrElse(getString(userDapp, keyUserStatus(caller)), userUnregistered) | |
193 | + | if (if ((userStatus == userUnregistered)) | |
194 | + | then true | |
195 | + | else (userStatus == userAllowed)) | |
196 | + | then "Register this account first with \"Account\" tab" | |
197 | + | else if ((userStatus == userSuspended)) | |
198 | + | then "Account suspended" | |
199 | + | else if ((userStatus == userRemoved)) | |
200 | + | then "Account removed" | |
201 | + | else "" | |
202 | + | } | |
203 | + | ||
204 | + | ||
205 | + | func setLIcence (cidLicence,sha256Licence) = { | |
206 | + | let cid = if ((size(cidLicence) == 0)) | |
207 | + | then defaultLicence | |
208 | + | else cidLicence | |
209 | + | let hash = if ((size(sha256Licence) == 0)) | |
210 | + | then defaultHashLicence | |
211 | + | else sha256Licence | |
212 | + | $Tuple2(cid, hash) | |
213 | + | } | |
214 | + | ||
215 | + | ||
216 | + | func validateArtworkData (caller,cidDisplay,cidExport,licenceCID,sha256Export,licenceHash,name,description,tags) = { | |
217 | + | let checkUser = validateUser(caller) | |
218 | + | if ((checkUser != "")) | |
219 | + | then throw(checkUser) | |
220 | + | else if ((size(cidDisplay) == 0)) | |
221 | + | then throw("Display CID cannot be empty") | |
222 | + | else if (!(validateAllCID(cidDisplay, cidExport, licenceCID))) | |
223 | + | then throw("Problem with CID") | |
224 | + | else if (!(validateAllHash(sha256Export, licenceHash))) | |
225 | + | then throw("Problem with Hashes") | |
226 | + | else if (!(validateString(name, 100))) | |
227 | + | then throw("100 Char. max name") | |
228 | + | else if (!(validateString(description, 1000))) | |
229 | + | then throw("1000 Char. max description") | |
230 | + | else if ((size(split(tags, ",")) > 5)) | |
231 | + | then throw("5 tags max.") | |
232 | + | else "" | |
233 | + | } | |
234 | + | ||
235 | + | ||
236 | + | func isPayment (i) = if ((size(i.payments) == 0)) | |
237 | + | then throw("No payment attached") | |
238 | + | else { | |
239 | + | let payment = value(i.payments[0]) | |
240 | + | let amount = value(payment.amount) | |
241 | + | $Tuple2(payment, amount) | |
242 | + | } | |
243 | + | ||
244 | + | ||
245 | + | func validatePayment (i) = { | |
246 | + | let $t083918427 = isPayment(i) | |
247 | + | let payment = $t083918427._1 | |
248 | + | let amount = $t083918427._2 | |
249 | + | let assetId = if (if (isDefined(payment.assetId)) | |
250 | + | then (payment.assetId == signAssetId) | |
251 | + | else false) | |
252 | + | then payment.assetId | |
253 | + | else throw("Only SIGN token accepted as transaction fee") | |
254 | + | if ((amount != currentCertificationPrice)) | |
255 | + | then throw(("Payment amount should be " + toString(currentCertificationPrice))) | |
256 | + | else $Tuple2(amount, assetId) | |
257 | + | } | |
258 | + | ||
259 | + | ||
260 | + | func isArtMinted (addrToUse,artId) = match getInteger(this, keyIssued(addrToUse, artId)) { | |
261 | + | case b: Int => | |
262 | + | if ((b != 0)) | |
263 | + | then true | |
264 | + | else false | |
265 | + | case _ => | |
266 | + | false | |
267 | + | } | |
268 | + | ||
269 | + | ||
270 | + | func validatePriceAssetId (i,priceAssetId,artworkPrice) = { | |
271 | + | let $t090209056 = isPayment(i) | |
272 | + | let payment = $t090209056._1 | |
273 | + | let amount = $t090209056._2 | |
274 | + | let assetId = if (!(isDefined(payment.assetId))) | |
275 | + | then unit | |
276 | + | else if (if ((size(priceAssetId) > 0)) | |
277 | + | then (toBase58String(value(payment.assetId)) == priceAssetId) | |
278 | + | else false) | |
279 | + | then payment.assetId | |
280 | + | else throw("Wrong asset id") | |
281 | + | if (if ((assetId == unit)) | |
282 | + | then (priceAssetId != "") | |
283 | + | else false) | |
284 | + | then throw("Wrong asset id") | |
285 | + | else if ((artworkPrice != amount)) | |
286 | + | then throw("Payment don't match") | |
287 | + | else $Tuple2(amount, assetId) | |
288 | + | } | |
289 | + | ||
290 | + | ||
291 | + | func acceptedAssetIds (assetId) = if (if (if (if ((assetId != toBase58String(signAssetId))) | |
292 | + | then (assetId != toBase58String(wavesAssetId)) | |
293 | + | else false) | |
294 | + | then (assetId != "WAVES") | |
295 | + | else false) | |
296 | + | then (assetId != toBase58String(usdnAssetId)) | |
297 | + | else false) | |
298 | + | then throw("Only SIGN, USDN or WAVES accepted") | |
299 | + | else true | |
300 | + | ||
301 | + | ||
302 | + | func validateMinSell (assetId,price) = { | |
303 | + | let minSellWaves = if (unitTest) | |
304 | + | then 10 | |
305 | + | else getIntegerByKeyFromOracle("waves_min_sell") | |
306 | + | let minSellUsdn = 1000000 | |
307 | + | let minSellSign = if (unitTest) | |
308 | + | then 1 | |
309 | + | else (currentCertificationPrice * 2) | |
310 | + | if (if (if (if (if ((assetId == toBase58String(usdnAssetId))) | |
311 | + | then (minSellUsdn > price) | |
312 | + | else false) | |
313 | + | then (price != 0) | |
314 | + | else false) | |
315 | + | then true | |
316 | + | else if (if ((assetId == toBase58String(signAssetId))) | |
317 | + | then (minSellSign > price) | |
318 | + | else false) | |
319 | + | then (price != 0) | |
320 | + | else false) | |
321 | + | then true | |
322 | + | else if (if (if ((assetId == toBase58String(wavesAssetId))) | |
323 | + | then true | |
324 | + | else (assetId == "WAVES")) | |
325 | + | then (minSellWaves > price) | |
326 | + | else false) | |
327 | + | then (price != 0) | |
328 | + | else false) | |
329 | + | then throw("Wrong minimum sell price") | |
330 | + | else true | |
331 | + | } | |
332 | + | ||
333 | + | ||
334 | + | func getBidAssetId (assetId) = if ((assetId == "WAVES")) | |
335 | + | then unit | |
336 | + | else fromBase58String(assetId) | |
337 | + | ||
338 | + | ||
339 | + | func getPriceAssetIdFromBid (bidDataKey) = { | |
340 | + | let bidData = getStringByKey((bidDataKey + "_OPEN")) | |
341 | + | if ((bidData == "")) | |
342 | + | then throw("Bid not found") | |
343 | + | else { | |
344 | + | let bidDataArr = split(bidData, "_") | |
345 | + | let bidAmount = parseIntValue(bidDataArr[1]) | |
346 | + | let bidAssetId = getBidAssetId(bidDataArr[0]) | |
347 | + | if ((0 >= bidAmount)) | |
348 | + | then throw("Wrong amount") | |
349 | + | else $Tuple2(bidAmount, bidAssetId) | |
350 | + | } | |
351 | + | } | |
352 | + | ||
353 | + | ||
354 | + | func idCallerDate (i) = if (!(dappRunning)) | |
355 | + | then throw(maintenanceMSG) | |
356 | + | else $Tuple3(toBase58String(i.transactionId), toBase58String(i.caller.bytes), lastBlock.timestamp) | |
357 | + | ||
358 | + | ||
359 | + | func buyMint (i,artId,issuer,bidId,bidOwner) = { | |
360 | + | let $t01128111340 = idCallerDate(i) | |
361 | + | let id = $t01128111340._1 | |
362 | + | let caller = $t01128111340._2 | |
363 | + | let date = $t01128111340._3 | |
364 | + | let isBid = if (if (if ((toBase58String(i.caller.bytes) == issuer)) | |
365 | + | then (bidOwner != "") | |
366 | + | else false) | |
367 | + | then (bidId != "") | |
368 | + | else false) | |
369 | + | then true | |
370 | + | else false | |
371 | + | let blockEnd = getIntegerByKey(keyEndSale(caller, artId)) | |
372 | + | if (if (if ((blockEnd != 0)) | |
373 | + | then (height >= blockEnd) | |
374 | + | else false) | |
375 | + | then !(isBid) | |
376 | + | else false) | |
377 | + | then throw("Sale ended.") | |
378 | + | else { | |
379 | + | let callerIsIssuer = (toBase58String(i.caller.bytes) == issuer) | |
380 | + | let totalNFT = getIntegerByKey("total_nft_issued") | |
381 | + | let signID = getStringByKey(keySignID(issuer, artId)) | |
382 | + | let artworkName = getStringByKey(keyName(issuer, artId)) | |
383 | + | if ((artworkName == "")) | |
384 | + | then throw("Art doesn't exist") | |
385 | + | else { | |
386 | + | let isOnSale = getBooleanByKey(keyOnSale(issuer, artId)) | |
387 | + | let amountSold = getIntegerByKey(keyIssued(issuer, artId)) | |
388 | + | let artworkPrice = if (callerIsIssuer) | |
389 | + | then (currentCertificationPrice * 2) | |
390 | + | else getIntegerByKey(keyPrice(issuer, artId)) | |
391 | + | let priceAssetId = if (callerIsIssuer) | |
392 | + | then toBase58String(signAssetId) | |
393 | + | else getStringByKey(keyAssetIdAccepted(issuer, artId)) | |
394 | + | let maxCanSell = getIntegerByKey(keyMaxMint(issuer, artId)) | |
395 | + | if (if (if (!(isBid)) | |
396 | + | then !(callerIsIssuer) | |
397 | + | else false) | |
398 | + | then if (if ((0 >= artworkPrice)) | |
399 | + | then true | |
400 | + | else !(isOnSale)) | |
401 | + | then true | |
402 | + | else (0 >= maxCanSell) | |
403 | + | else false) | |
404 | + | then throw("Art not for sale") | |
405 | + | else if (if (if (!(isBid)) | |
406 | + | then callerIsIssuer | |
407 | + | else false) | |
408 | + | then (0 >= maxCanSell) | |
409 | + | else false) | |
410 | + | then throw("Max issuable not set") | |
411 | + | else { | |
412 | + | let checkUser = validateUser(issuer) | |
413 | + | if (if (isBid) | |
414 | + | then (checkUser != "") | |
415 | + | else false) | |
416 | + | then throw(checkUser) | |
417 | + | else { | |
418 | + | let bidDataKey = ((((((("bid_" + artId) + "_") + issuer) + "_") + bidOwner) + "_") + bidId) | |
419 | + | let $t01309113258 = if (isBid) | |
420 | + | then getPriceAssetIdFromBid(bidDataKey) | |
421 | + | else validatePriceAssetId(i, priceAssetId, artworkPrice) | |
422 | + | let amount = $t01309113258._1 | |
423 | + | let assetId = $t01309113258._2 | |
424 | + | let agent = valueOrElse(getString(userDapp, keyArtistAgentAddr(issuer)), feeReceiver) | |
425 | + | let agentShare = valueOrElse(getInteger(userDapp, keyPrimaryShare(issuer)), 0) | |
426 | + | let isWhitelisted = checkWhitelist(issuer) | |
427 | + | let cut = if ((isWhitelisted > height)) | |
428 | + | then 0 | |
429 | + | else if ((assetId == signAssetId)) | |
430 | + | then signCut | |
431 | + | else usdnWaveCut | |
432 | + | let amountForSign = fraction(amount, cut, 100) | |
433 | + | let amountForAgent = if (if (if ((agent != feeReceiver)) | |
434 | + | then (agentShare > 0) | |
435 | + | else false) | |
436 | + | then (height > isWhitelisted) | |
437 | + | else false) | |
438 | + | then fraction(amount, agentShare, 100) | |
439 | + | else 0 | |
440 | + | let amountForCreator = (amount - amountForSign) | |
441 | + | if ((amountSold == maxCanSell)) | |
442 | + | then throw("Art sold out") | |
443 | + | else { | |
444 | + | let newAmountSold = (amountSold + 1) | |
445 | + | let issueMeta = ((((((((((("Creator: " + issuer) + ", | |
446 | + | ArtID: ") + artId) + ", | |
447 | + | SignID: ") + signID) + ", | |
448 | + | Artwork name: ") + artworkName) + ", | |
449 | + | Issue: ") + toString(newAmountSold)) + "/") + toString(maxCanSell)) | |
450 | + | let issueNFT = Issue(("SA_" + toString((totalNFT + 1))), issueMeta, 1, 0, false) | |
451 | + | let idNFT = calculateAssetId(issueNFT) | |
452 | + | let sellStatus = if (if ((newAmountSold == maxCanSell)) | |
453 | + | then true | |
454 | + | else !(isOnSale)) | |
455 | + | then false | |
456 | + | else true | |
457 | + | let receiveNFT = if (if (if ((caller == issuer)) | |
458 | + | then (bidOwner != "") | |
459 | + | else false) | |
460 | + | then (bidId != "") | |
461 | + | else false) | |
462 | + | then addressFromStringValue(bidOwner) | |
463 | + | else i.caller | |
464 | + | let assetIdBid = if (!(isDefined(assetId))) | |
465 | + | then "WAVES" | |
466 | + | else toBase58String(value(assetId)) | |
467 | + | let bidData = getStringByKey((bidDataKey + "_OPEN")) | |
468 | + | let bidDelOld = DeleteEntry((bidDataKey + "_OPEN")) | |
469 | + | let bidUpdate = StringEntry((bidDataKey + "_CLOSED"), ((bidData + "_") + toString(date))) | |
470 | + | let soldKey = ((((((("art_sold_" + toString(newAmountSold)) + "_of_") + toString(maxCanSell)) + "_") + artId) + "_") + issuer) | |
471 | + | let soldValue = if (!(isBid)) | |
472 | + | then ((((((((((caller + "_") + toString(date)) + "_") + id) + "_") + toString(artworkPrice)) + "_") + priceAssetId) + "_") + toBase58String(idNFT)) | |
473 | + | else ((((((((((toString(receiveNFT) + "_") + toString(date)) + "_") + id) + "_") + toString(amount)) + "_") + assetIdBid) + "_") + toBase58String(idNFT)) | |
474 | + | let soldData = StringEntry(soldKey, soldValue) | |
475 | + | let commissions = if ((amountForAgent != 0)) | |
476 | + | then [ScriptTransfer(Address(fromBase58String(feeReceiver)), (amountForSign - amountForAgent), assetId), ScriptTransfer(Address(fromBase58String(agent)), amountForAgent, assetId)] | |
477 | + | else [ScriptTransfer(Address(fromBase58String(feeReceiver)), amountForSign, assetId)] | |
478 | + | let buyRes = ([IntegerEntry(keyIssued(issuer, artId), newAmountSold), StringEntry(("nft_" + toBase58String(idNFT)), soldKey), IntegerEntry("total_nft_issued", (totalNFT + 1)), IntegerEntry(keyEndSale(issuer, artId), 0), BooleanEntry(keyOnSale(issuer, artId), sellStatus), issueNFT, ScriptTransfer(Address(fromBase58String(issuer)), amountForCreator, assetId), ScriptTransfer(receiveNFT, 1, idNFT)] ++ commissions) | |
479 | + | if (isBid) | |
480 | + | then [soldData, bidUpdate, bidDelOld] :: buyRes | |
481 | + | else soldData :: buyRes | |
482 | + | } | |
483 | + | } | |
484 | + | } | |
485 | + | } | |
486 | + | } | |
487 | + | } | |
488 | + | ||
489 | + | ||
490 | + | @Callable(invoke) | |
491 | + | func setConf (key,val) = { | |
492 | + | let caller = toString(invoke.caller) | |
493 | + | if (containsElement([chris, toString(this)], caller)) | |
494 | + | then if (contains(key, "conf_")) | |
495 | + | then [StringEntry(key, val)] | |
496 | + | else throw("Entries starting with conf_ only") | |
497 | + | else throw("You are not allowed to change this") | |
498 | + | } | |
143 | 499 | ||
144 | 500 | ||
145 | 501 | ||
146 | 502 | @Callable(i) | |
147 | - | func a1 () = if ((i.caller != this)) | |
148 | - | then throw("you are not allowed to arb!") | |
503 | + | func addArtwork (sha256Hash,signID,name,description,tags,type,cidDisplay,sha256Export,cidExport,sha256Licence,cidLicence,crawler) = { | |
504 | + | let $t01704317086 = idCallerDate(i) | |
505 | + | let artId = $t01704317086._1 | |
506 | + | let caller = $t01704317086._2 | |
507 | + | let date = $t01704317086._3 | |
508 | + | if (!(validateHash(sha256Hash))) | |
509 | + | then throw("Hash should be 64 characters maximum") | |
510 | + | else { | |
511 | + | let $t01718717256 = setLIcence(cidLicence, sha256Licence) | |
512 | + | let licenceCID = $t01718717256._1 | |
513 | + | let licenceHash = $t01718717256._2 | |
514 | + | let validateArtwork = validateArtworkData(caller, cidDisplay, cidExport, licenceCID, sha256Export, licenceHash, name, description, tags) | |
515 | + | if ((validateArtwork != "")) | |
516 | + | then throw("Something went wrong!") | |
517 | + | else { | |
518 | + | let $t01747517517 = validatePayment(i) | |
519 | + | let amount = $t01747517517._1 | |
520 | + | let assetId = $t01747517517._2 | |
521 | + | if (!(isDefined(amount))) | |
522 | + | then throw("Something went wrong") | |
523 | + | else { | |
524 | + | let entryExist = getStringByKey(keyTxidByHashOwner(sha256Hash, caller)) | |
525 | + | if ((entryExist != "")) | |
526 | + | then throw("You already added it") | |
527 | + | else { | |
528 | + | let hashExist = getStringByKey(keyOwnerByHash(sha256Hash)) | |
529 | + | if ((hashExist != "")) | |
530 | + | then throw("Hash already registered") | |
531 | + | else { | |
532 | + | let isSignCertified = checkSignCertificate(signID, caller, sha256Hash) | |
533 | + | if (!(isSignCertified)) | |
534 | + | then throw("Sign Certificate not found for this address.") | |
535 | + | else [StringEntry(keyOwnerByHash(sha256Hash), caller), StringEntry(keyTxidByHashOwner(sha256Hash, caller), artId), IntegerEntry(keyDate(caller, artId), date), StringEntry(keyName(caller, artId), name), StringEntry(keyDesc(caller, artId), description), StringEntry(keyDisplayCid(caller, artId), cidDisplay), StringEntry(keyExportCid(caller, artId), cidExport), StringEntry(keyExportHash(caller, artId), sha256Export), StringEntry(keyLicenceHash(caller, artId), licenceHash), StringEntry(keyLicenceCid(caller, artId), licenceCID), StringEntry(keyType(caller, artId), type), StringEntry(keyTags(caller, artId), tags), IntegerEntry(keyMaxMint(caller, artId), 0), StringEntry(keySignID(caller, artId), signID), IntegerEntry(keyIssued(caller, artId), 0), BooleanEntry(keyOnSale(caller, artId), false), StringEntry(keyidBySignid(caller, signID), artId), StringEntry(keyHashByTxidAddr(caller, artId), sha256Hash), StringEntry(keyCrawler(caller, artId), crawler), ScriptTransfer(Address(fromBase58String(feeReceiver)), amount, assetId)] | |
536 | + | } | |
537 | + | } | |
538 | + | } | |
539 | + | } | |
540 | + | } | |
541 | + | } | |
542 | + | ||
543 | + | ||
544 | + | ||
545 | + | @Callable(i) | |
546 | + | func updateArtwork (txid,name,description,tags,type,cidDisplay,sha256Export,cidExport,sha256Licence,cidLicence,crawler) = if (!(dappRunning)) | |
547 | + | then throw(maintenanceMSG) | |
149 | 548 | else { | |
150 | - | let usdnBalanceBefore = assetBalance(this, usdnAssetId) | |
151 | - | if ((usdnBalanceBefore == usdnBalanceBefore)) | |
152 | - | then { | |
153 | - | let wavesBalanceBefore = wavesBalance(this).available | |
154 | - | if ((wavesBalanceBefore == wavesBalanceBefore)) | |
155 | - | then { | |
156 | - | let buyOnPuzzle = invoke(nonRoutingPuzzlePool, "swap", ["WAVES", 1], [AttachedPayment(usdnAssetId, (a * 1000000))]) | |
157 | - | if ((buyOnPuzzle == buyOnPuzzle)) | |
158 | - | then { | |
159 | - | let wavesBalToSwap = (wavesBalance(this).available - wavesBalanceBefore) | |
160 | - | if ((0 >= wavesBalToSwap)) | |
161 | - | then throw("nothing to arb") | |
162 | - | else { | |
163 | - | let putTheTokenInThePool = invoke(wxPool, "putOneTkn", [1, false], [AttachedPayment(unit, wavesBalToSwap)]) | |
164 | - | if ((putTheTokenInThePool == putTheTokenInThePool)) | |
165 | - | then { | |
166 | - | let lpTokenBalance = assetBalance(this, usdnWavesLPTokenAssetId) | |
167 | - | if ((lpTokenBalance == lpTokenBalance)) | |
168 | - | then { | |
169 | - | let sellPoolToken = invoke(wxPool, "getOneTkn", [usdnAssetIdString, 1], [AttachedPayment(usdnWavesLPTokenAssetId, lpTokenBalance)]) | |
170 | - | if ((sellPoolToken == sellPoolToken)) | |
171 | - | then { | |
172 | - | let usdnBalanceAfter = assetBalance(this, usdnAssetId) | |
173 | - | if ((usdnBalanceAfter == usdnBalanceAfter)) | |
174 | - | then if ((0 >= (usdnBalanceAfter - usdnBalanceBefore))) | |
175 | - | then throw("WU PUZZLE -> WX [($_$)]") | |
176 | - | else nil | |
177 | - | else throw("Strict value is not equal to itself.") | |
178 | - | } | |
179 | - | else throw("Strict value is not equal to itself.") | |
180 | - | } | |
181 | - | else throw("Strict value is not equal to itself.") | |
182 | - | } | |
183 | - | else throw("Strict value is not equal to itself.") | |
184 | - | } | |
185 | - | } | |
186 | - | else throw("Strict value is not equal to itself.") | |
549 | + | let caller = toBase58String(i.caller.bytes) | |
550 | + | let $t02024920318 = setLIcence(cidLicence, sha256Licence) | |
551 | + | let licenceCID = $t02024920318._1 | |
552 | + | let licenceHash = $t02024920318._2 | |
553 | + | let validateArtwork = validateArtworkData(caller, cidDisplay, cidExport, licenceCID, sha256Export, licenceHash, name, description, tags) | |
554 | + | if ((validateArtwork != "")) | |
555 | + | then throw("Something went wrong!") | |
556 | + | else { | |
557 | + | let entryExist = getStringByKey(keyName(caller, txid)) | |
558 | + | if ((entryExist == "")) | |
559 | + | then throw("Entry not found") | |
560 | + | else { | |
561 | + | let flag = getStringByKey(keyFlag(caller, txid)) | |
562 | + | if ((flag == "ILLEGAL")) | |
563 | + | then throw("Cannot update ILLEGAL artwork") | |
564 | + | else if (!(isArtMinted(caller, txid))) | |
565 | + | then [StringEntry(keyName(caller, txid), name), StringEntry(keyDesc(caller, txid), description), StringEntry(keyDisplayCid(caller, txid), cidDisplay), StringEntry(keyExportCid(caller, txid), cidExport), StringEntry(keyExportHash(caller, txid), sha256Export), StringEntry(keyLicenceCid(caller, txid), licenceCID), StringEntry(keyLicenceHash(caller, txid), licenceHash), StringEntry(keyTags(caller, txid), tags), StringEntry(keyType(caller, txid), type), StringEntry(keyCrawler(caller, txid), crawler)] | |
566 | + | else throw("Already minted") | |
187 | 567 | } | |
188 | - | else throw("Strict value is not equal to itself.") | |
189 | 568 | } | |
190 | - | else throw("Strict value is not equal to itself.") | |
191 | 569 | } | |
192 | 570 | ||
193 | 571 | ||
194 | 572 | ||
195 | 573 | @Callable(i) | |
196 | - | func a2 () = if ((i.caller != this)) | |
197 | - | then throw("you are not allowed to arb!") | |
198 | - | else { | |
199 | - | let usdnBalanceBefore = assetBalance(this, usdnAssetId) | |
200 | - | if ((usdnBalanceBefore == usdnBalanceBefore)) | |
201 | - | then { | |
202 | - | let wavesBalanceBefore = wavesBalance(this).available | |
203 | - | if ((wavesBalanceBefore == wavesBalanceBefore)) | |
204 | - | then { | |
205 | - | let putTheTokenInThePool = invoke(wxPool, "putOneTkn", [1, false], [AttachedPayment(usdnAssetId, (a * 1000000))]) | |
206 | - | if ((putTheTokenInThePool == putTheTokenInThePool)) | |
207 | - | then { | |
208 | - | let lpTokenBalance = assetBalance(this, usdnWavesLPTokenAssetId) | |
209 | - | if ((lpTokenBalance == lpTokenBalance)) | |
210 | - | then { | |
211 | - | let sellPoolToken = invoke(wxPool, "getOneTkn", ["WAVES", 1], [AttachedPayment(usdnWavesLPTokenAssetId, lpTokenBalance)]) | |
212 | - | if ((sellPoolToken == sellPoolToken)) | |
213 | - | then { | |
214 | - | let wavesBalToSwap = (wavesBalance(this).available - wavesBalanceBefore) | |
215 | - | if ((0 >= wavesBalToSwap)) | |
216 | - | then throw("nothing to arb") | |
217 | - | else { | |
218 | - | let buyOnPuzzle = invoke(nonRoutingPuzzlePool, "swap", [usdnAssetIdString, 1], [AttachedPayment(unit, wavesBalToSwap)]) | |
219 | - | if ((buyOnPuzzle == buyOnPuzzle)) | |
220 | - | then { | |
221 | - | let usdnBalanceAfter = assetBalance(this, usdnAssetId) | |
222 | - | if ((usdnBalanceAfter == usdnBalanceAfter)) | |
223 | - | then if ((0 >= (usdnBalanceAfter - usdnBalanceBefore))) | |
224 | - | then throw("WU WX -> PUZZLE [($_$)]") | |
225 | - | else nil | |
226 | - | else throw("Strict value is not equal to itself.") | |
227 | - | } | |
228 | - | else throw("Strict value is not equal to itself.") | |
229 | - | } | |
230 | - | } | |
231 | - | else throw("Strict value is not equal to itself.") | |
232 | - | } | |
233 | - | else throw("Strict value is not equal to itself.") | |
234 | - | } | |
235 | - | else throw("Strict value is not equal to itself.") | |
236 | - | } | |
237 | - | else throw("Strict value is not equal to itself.") | |
238 | - | } | |
239 | - | else throw("Strict value is not equal to itself.") | |
240 | - | } | |
574 | + | func flagArtwork (artId,addr,flag,note) = { | |
575 | + | let $t02174321777 = idCallerDate(i) | |
576 | + | let id = $t02174321777._1 | |
577 | + | let caller = $t02174321777._2 | |
578 | + | if (containsElement([chris, toString(this)], caller)) | |
579 | + | then if (containsElement(["CONSENT", "", "CHANGE_REQUIRED", "FLAGGED", "ILLEGAL"], flag)) | |
580 | + | then [StringEntry(keyFlag(addr, artId), flag), StringEntry(keyNote(addr, artId), note)] | |
581 | + | else throw(("Unknow status " + flag)) | |
582 | + | else throw("You are not allowed") | |
583 | + | } | |
241 | 584 | ||
242 | 585 | ||
243 | 586 | ||
244 | 587 | @Callable(i) | |
245 | - | func a3 () = if ((i.caller != this)) | |
246 | - | then throw("you are not allowed to arb!") | |
247 | - | else { | |
248 | - | let usdnBalanceBefore = assetBalance(this, usdnAssetId) | |
249 | - | if ((usdnBalanceBefore == usdnBalanceBefore)) | |
250 | - | then { | |
251 | - | let buySurfOnPuzzle = invoke(nonRoutingPuzzleSurfPool, "swap", [surfAssetIdString, 1], [AttachedPayment(usdnAssetId, (a * 1000000))]) | |
252 | - | if ((buySurfOnPuzzle == buySurfOnPuzzle)) | |
253 | - | then { | |
254 | - | let surfBalToSwap = assetBalance(this, surfAssetId) | |
255 | - | let swapSurfOnSwop = invoke(swopSurfPool, "exchange", [1], [AttachedPayment(surfAssetId, surfBalToSwap)]) | |
256 | - | if ((swapSurfOnSwop == swapSurfOnSwop)) | |
257 | - | then { | |
258 | - | let usdnBalanceAfter = assetBalance(this, usdnAssetId) | |
259 | - | if ((usdnBalanceAfter == usdnBalanceAfter)) | |
260 | - | then if ((0 >= (usdnBalanceAfter - usdnBalanceBefore))) | |
261 | - | then throw("SURF PUZZLE -> SWOP [($_$)]") | |
262 | - | else nil | |
263 | - | else throw("Strict value is not equal to itself.") | |
264 | - | } | |
265 | - | else throw("Strict value is not equal to itself.") | |
266 | - | } | |
267 | - | else throw("Strict value is not equal to itself.") | |
268 | - | } | |
269 | - | else throw("Strict value is not equal to itself.") | |
270 | - | } | |
588 | + | func deleteArtwork (artId,addr) = { | |
589 | + | let $t02221322247 = idCallerDate(i) | |
590 | + | let id = $t02221322247._1 | |
591 | + | let caller = $t02221322247._2 | |
592 | + | let addrToUse = if (containsElement([chris, toString(this)], caller)) | |
593 | + | then addr | |
594 | + | else caller | |
595 | + | let entryExist = valueOrErrorMessage(getStringByKey(keyName(addrToUse, artId)), "No art matching for this address") | |
596 | + | if ((entryExist == "")) | |
597 | + | then throw("No art matching for this address") | |
598 | + | else { | |
599 | + | let sha256Hash = getStringByKey(keyHashByTxidAddr(addrToUse, artId)) | |
600 | + | if ((sha256Hash == "")) | |
601 | + | then throw("No art hash matching for this address") | |
602 | + | else { | |
603 | + | let signID = getStringByKey(keySignID(addrToUse, artId)) | |
604 | + | if ((signID == "")) | |
605 | + | then throw("No SIGN ID matching") | |
606 | + | else { | |
607 | + | let dataToDelete = [DeleteEntry(keyDate(addrToUse, artId)), DeleteEntry(keyName(addrToUse, artId)), DeleteEntry(keyDesc(addrToUse, artId)), DeleteEntry(keyDisplayCid(addrToUse, artId)), DeleteEntry(keyExportCid(addrToUse, artId)), DeleteEntry(keyExportHash(addrToUse, artId)), DeleteEntry(keyLicenceHash(addrToUse, artId)), DeleteEntry(keyLicenceCid(addrToUse, artId)), DeleteEntry(keyType(addrToUse, artId)), DeleteEntry(keyTags(addrToUse, artId)), DeleteEntry(keyMaxMint(addrToUse, artId)), DeleteEntry(keySignID(addrToUse, artId)), DeleteEntry(keyIssued(addrToUse, artId)), DeleteEntry(keyOnSale(addrToUse, artId)), DeleteEntry(keyFlag(addrToUse, artId)), DeleteEntry(keyPrice(addrToUse, artId)), DeleteEntry(keyAssetIdAccepted(addrToUse, artId)), DeleteEntry(keyOwnerByHash(sha256Hash)), DeleteEntry(keyidBySignid(addrToUse, signID)), DeleteEntry(keyTxidByHashOwner(sha256Hash, addrToUse)), DeleteEntry(keyEndSale(addrToUse, artId)), DeleteEntry(keyNote(addrToUse, artId)), DeleteEntry(keyCrawler(addrToUse, artId))] | |
608 | + | if (!(isArtMinted(addrToUse, artId))) | |
609 | + | then if (!(dappRunning)) | |
610 | + | then throw(maintenanceMSG) | |
611 | + | else dataToDelete | |
612 | + | else if (containsElement([chris, toString(this)], caller)) | |
613 | + | then dataToDelete | |
614 | + | else throw("Art already minted, you cannot delete it") | |
615 | + | } | |
616 | + | } | |
617 | + | } | |
618 | + | } | |
271 | 619 | ||
272 | 620 | ||
273 | 621 | ||
274 | 622 | @Callable(i) | |
275 | - | func a4 () = if ((i.caller != this)) | |
276 | - | then throw("you are not allowed to arb!") | |
277 | - | else { | |
278 | - | let usdnBalanceBefore = assetBalance(this, usdnAssetId) | |
279 | - | if ((usdnBalanceBefore == usdnBalanceBefore)) | |
280 | - | then { | |
281 | - | let swapToSurfOnSwop = invoke(swopSurfPool, "exchange", [1], [AttachedPayment(usdnAssetId, (a * 1000000))]) | |
282 | - | if ((swapToSurfOnSwop == swapToSurfOnSwop)) | |
283 | - | then { | |
284 | - | let surfBalToSwap = assetBalance(this, surfAssetId) | |
285 | - | let sellSurfOnPuzzle = invoke(nonRoutingPuzzleSurfPool, "swap", [usdnAssetIdString, 1], [AttachedPayment(surfAssetId, surfBalToSwap)]) | |
286 | - | if ((sellSurfOnPuzzle == sellSurfOnPuzzle)) | |
287 | - | then { | |
288 | - | let usdnBalanceAfter = assetBalance(this, usdnAssetId) | |
289 | - | if ((usdnBalanceAfter == usdnBalanceAfter)) | |
290 | - | then if ((0 >= (usdnBalanceAfter - usdnBalanceBefore))) | |
291 | - | then throw("SURF SWOP -> PUZZLE [($_$)]") | |
292 | - | else nil | |
293 | - | else throw("Strict value is not equal to itself.") | |
623 | + | func sellArtwork (artId,price,maxMint,assetId,blockEnd) = { | |
624 | + | let $t02501425048 = idCallerDate(i) | |
625 | + | let id = $t02501425048._1 | |
626 | + | let caller = $t02501425048._2 | |
627 | + | let artworkName = getStringByKey(keyName(caller, artId)) | |
628 | + | if ((artworkName == "")) | |
629 | + | then throw("This art doesn't match your account") | |
630 | + | else { | |
631 | + | let flag = getStringByKey(keyFlag(caller, artId)) | |
632 | + | if (containsElement(["CHANGE_REQUIRED", "FLAGGED", "ILLEGAL"], flag)) | |
633 | + | then throw("Flagged artwork") | |
634 | + | else { | |
635 | + | let bidNbr = getIntegerByKey(("current_bidamount_" + artId)) | |
636 | + | if ((0 > blockEnd)) | |
637 | + | then throw("Negative end") | |
638 | + | else if (if ((blockEnd > 0)) | |
639 | + | then if ((maxMint != 1)) | |
640 | + | then true | |
641 | + | else (price != 0) | |
642 | + | else false) | |
643 | + | then throw("Timed offer only allowed for unique edition and offer only") | |
644 | + | else { | |
645 | + | let baseHeight = if ((blockEnd == 0)) | |
646 | + | then 0 | |
647 | + | else height | |
648 | + | if (!(acceptedAssetIds(assetId))) | |
649 | + | then throw("Something went wrong!") | |
650 | + | else if (!(validateMinSell(assetId, price))) | |
651 | + | then throw("Something went wrong!") | |
652 | + | else { | |
653 | + | let checkUser = validateUser(caller) | |
654 | + | if ((checkUser != "")) | |
655 | + | then throw(checkUser) | |
656 | + | else { | |
657 | + | let amountSold = getIntegerByKey(keyIssued(caller, artId)) | |
658 | + | let maxCanSell = getIntegerByKey(keyMaxMint(caller, artId)) | |
659 | + | if ((maxMint > 100)) | |
660 | + | then throw("100 editions max per artwork") | |
661 | + | else if (if ((amountSold != 0)) | |
662 | + | then (amountSold == maxCanSell) | |
663 | + | else false) | |
664 | + | then throw("Max edition reached.") | |
665 | + | else if (if ((amountSold > 0)) | |
666 | + | then (maxCanSell != maxMint) | |
667 | + | else false) | |
668 | + | then throw("Cannot change maximum issuable anymore") | |
669 | + | else if (if ((bidNbr > 0)) | |
670 | + | then (maxCanSell != maxMint) | |
671 | + | else false) | |
672 | + | then throw("Cannot change maximum issuable with active orders") | |
673 | + | else { | |
674 | + | let sellStatus = if (if ((price > 0)) | |
675 | + | then (maxMint > 0) | |
676 | + | else false) | |
677 | + | then true | |
678 | + | else false | |
679 | + | [BooleanEntry(keyOnSale(caller, artId), sellStatus), IntegerEntry(keyPrice(caller, artId), price), IntegerEntry(keyMaxMint(caller, artId), maxMint), StringEntry(keyAssetIdAccepted(caller, artId), assetId), IntegerEntry(keyEndSale(caller, artId), (baseHeight + blockEnd))] | |
680 | + | } | |
681 | + | } | |
682 | + | } | |
294 | 683 | } | |
295 | - | else throw("Strict value is not equal to itself.") | |
296 | - | } | |
297 | - | else throw("Strict value is not equal to itself.") | |
298 | - | } | |
299 | - | else throw("Strict value is not equal to itself.") | |
300 | - | } | |
684 | + | } | |
685 | + | } | |
686 | + | } | |
301 | 687 | ||
302 | 688 | ||
303 | 689 | ||
304 | 690 | @Callable(i) | |
305 | - | func a5 () = if ((i.caller != this)) | |
306 | - | then throw("you are not allowed to arb!") | |
307 | - | else { | |
308 | - | let usdnBalanceBefore = assetBalance(this, usdnAssetId) | |
309 | - | if ((usdnBalanceBefore == usdnBalanceBefore)) | |
310 | - | then { | |
311 | - | let putTheTokenInThePool = invoke(wxWxPool, "putOneTkn", [1, false], [AttachedPayment(usdnAssetId, (a * 1000000))]) | |
312 | - | if ((putTheTokenInThePool == putTheTokenInThePool)) | |
313 | - | then { | |
314 | - | let lpTokenBalance = assetBalance(this, usdnWxLPTokenAssetId) | |
315 | - | if ((lpTokenBalance == lpTokenBalance)) | |
316 | - | then { | |
317 | - | let sellPoolToken = invoke(wxWxPool, "getOneTkn", [wxAssetIdString, 1], [AttachedPayment(usdnWxLPTokenAssetId, lpTokenBalance)]) | |
318 | - | if ((sellPoolToken == sellPoolToken)) | |
319 | - | then { | |
320 | - | let wxBalToSwap = assetBalance(this, wxAssetId) | |
321 | - | let swapWxOnSwop = invoke(swopWxPool, "exchange", [1], [AttachedPayment(wxAssetId, wxBalToSwap)]) | |
322 | - | if ((swapWxOnSwop == swapWxOnSwop)) | |
323 | - | then { | |
324 | - | let usdnBalanceAfter = assetBalance(this, usdnAssetId) | |
325 | - | if ((usdnBalanceAfter == usdnBalanceAfter)) | |
326 | - | then if ((0 >= (usdnBalanceAfter - usdnBalanceBefore))) | |
327 | - | then throw("WX WX -> SWOP [($_$)]") | |
328 | - | else nil | |
329 | - | else throw("Strict value is not equal to itself.") | |
330 | - | } | |
331 | - | else throw("Strict value is not equal to itself.") | |
332 | - | } | |
333 | - | else throw("Strict value is not equal to itself.") | |
334 | - | } | |
335 | - | else throw("Strict value is not equal to itself.") | |
336 | - | } | |
337 | - | else throw("Strict value is not equal to itself.") | |
338 | - | } | |
339 | - | else throw("Strict value is not equal to itself.") | |
340 | - | } | |
691 | + | func buyArtwork (artId,issuer) = buyMint(i, artId, issuer, "", "") | |
341 | 692 | ||
342 | 693 | ||
343 | 694 | ||
344 | 695 | @Callable(i) | |
345 | - | func a6 () = if ((i.caller != this)) | |
346 | - | then throw("you are not allowed to arb!") | |
347 | - | else { | |
348 | - | let usdnBalanceBefore = assetBalance(this, usdnAssetId) | |
349 | - | if ((usdnBalanceBefore == usdnBalanceBefore)) | |
350 | - | then { | |
351 | - | let swapToWxOnSwop = invoke(swopWxPool, "exchange", [1], [AttachedPayment(usdnAssetId, (a * 1000000))]) | |
352 | - | if ((swapToWxOnSwop == swapToWxOnSwop)) | |
353 | - | then { | |
354 | - | let wxBalToSwap = assetBalance(this, wxAssetId) | |
355 | - | let putTheTokenInThePool = invoke(wxWxPool, "putOneTkn", [1, false], [AttachedPayment(wxAssetId, wxBalToSwap)]) | |
356 | - | if ((putTheTokenInThePool == putTheTokenInThePool)) | |
357 | - | then { | |
358 | - | let lpTokenBalance = assetBalance(this, usdnWxLPTokenAssetId) | |
359 | - | if ((lpTokenBalance == lpTokenBalance)) | |
360 | - | then { | |
361 | - | let sellPoolToken = invoke(wxWxPool, "getOneTkn", [usdnAssetIdString, 1], [AttachedPayment(usdnWxLPTokenAssetId, lpTokenBalance)]) | |
362 | - | if ((sellPoolToken == sellPoolToken)) | |
363 | - | then { | |
364 | - | let usdnBalanceAfter = assetBalance(this, usdnAssetId) | |
365 | - | if ((usdnBalanceAfter == usdnBalanceAfter)) | |
366 | - | then if ((0 >= (usdnBalanceAfter - usdnBalanceBefore))) | |
367 | - | then throw("WX SWOP -> WX [($_$)]") | |
368 | - | else nil | |
369 | - | else throw("Strict value is not equal to itself.") | |
370 | - | } | |
371 | - | else throw("Strict value is not equal to itself.") | |
372 | - | } | |
373 | - | else throw("Strict value is not equal to itself.") | |
374 | - | } | |
375 | - | else throw("Strict value is not equal to itself.") | |
696 | + | func setBid (artId,issuer) = { | |
697 | + | let $t02730527345 = idCallerDate(i) | |
698 | + | let id = $t02730527345._1 | |
699 | + | let caller = $t02730527345._2 | |
700 | + | let date = $t02730527345._3 | |
701 | + | let $t02735027386 = isPayment(i) | |
702 | + | let payment = $t02735027386._1 | |
703 | + | let amount = $t02735027386._2 | |
704 | + | let assetId = if (!(isDefined(payment.assetId))) | |
705 | + | then "WAVES" | |
706 | + | else toBase58String(value(payment.assetId)) | |
707 | + | let blockEnd = getIntegerByKey(keyEndSale(issuer, artId)) | |
708 | + | if (if ((blockEnd != 0)) | |
709 | + | then (height >= blockEnd) | |
710 | + | else false) | |
711 | + | then throw("Sale ended.") | |
712 | + | else { | |
713 | + | let bidNbr = getIntegerByKey(("current_bidamount_" + artId)) | |
714 | + | if (!(acceptedAssetIds(assetId))) | |
715 | + | then throw("asset not accepted") | |
716 | + | else if (!(validateMinSell(assetId, amount))) | |
717 | + | then throw("Wrong min sell") | |
718 | + | else { | |
719 | + | let amountSold = getIntegerByKey(keyIssued(issuer, artId)) | |
720 | + | let maxCanSell = getIntegerByKey(keyMaxMint(issuer, artId)) | |
721 | + | if ((0 >= maxCanSell)) | |
722 | + | then throw("No max edition set for this artwork") | |
723 | + | else if ((amountSold >= maxCanSell)) | |
724 | + | then throw("Sold out, you cannot bid") | |
725 | + | else [StringEntry((((((((("bid_" + artId) + "_") + issuer) + "_") + caller) + "_") + id) + "_OPEN"), ((((assetId + "_") + toString(amount)) + "_") + toString(date))), IntegerEntry(("current_bidamount_" + artId), (bidNbr + 1))] | |
376 | 726 | } | |
377 | - | else throw("Strict value is not equal to itself.") | |
378 | - | } | |
379 | - | else throw("Strict value is not equal to itself.") | |
380 | - | } | |
727 | + | } | |
728 | + | } | |
381 | 729 | ||
382 | 730 | ||
383 | 731 | ||
384 | 732 | @Callable(i) | |
385 | - | func a7 () = if ((i.caller != this)) | |
386 | - | then throw("you are not allowed to arb!") | |
387 | - | else { | |
388 | - | let usdnBalanceBefore = assetBalance(this, usdnAssetId) | |
389 | - | if ((usdnBalanceBefore == usdnBalanceBefore)) | |
390 | - | then { | |
391 | - | let buyUsdcOnPuzzle = invoke(puzzleUsdcPool, "swap", [usdcAssetIdString, 1], [AttachedPayment(usdnAssetId, (a * 1000000))]) | |
392 | - | if ((buyUsdcOnPuzzle == buyUsdcOnPuzzle)) | |
393 | - | then { | |
394 | - | let usdcBalToSwap = assetBalance(this, usdcAssetId) | |
395 | - | if ((usdcBalToSwap == usdcBalToSwap)) | |
396 | - | then { | |
397 | - | let putTheTokenInThePool = invoke(wxUsdcPool, "putOneTknV2", [1, false], [AttachedPayment(usdcAssetId, usdcBalToSwap)]) | |
398 | - | if ((putTheTokenInThePool == putTheTokenInThePool)) | |
399 | - | then { | |
400 | - | let lpTokenBalance = assetBalance(this, usdcWxLPTokenAssetId) | |
401 | - | if ((lpTokenBalance == lpTokenBalance)) | |
402 | - | then { | |
403 | - | let sellPoolToken = invoke(wxUsdcPool, "getOneTknV2", [usdnAssetIdString, 1], [AttachedPayment(usdcWxLPTokenAssetId, lpTokenBalance)]) | |
404 | - | if ((sellPoolToken == sellPoolToken)) | |
405 | - | then { | |
406 | - | let usdnBalanceAfter = assetBalance(this, usdnAssetId) | |
407 | - | if ((usdnBalanceAfter == usdnBalanceAfter)) | |
408 | - | then if ((0 >= (usdnBalanceAfter - usdnBalanceBefore))) | |
409 | - | then throw("USDC PUZZLE -> WX [($_$)]") | |
410 | - | else nil | |
411 | - | else throw("Strict value is not equal to itself.") | |
412 | - | } | |
413 | - | else throw("Strict value is not equal to itself.") | |
414 | - | } | |
415 | - | else throw("Strict value is not equal to itself.") | |
416 | - | } | |
417 | - | else throw("Strict value is not equal to itself.") | |
418 | - | } | |
419 | - | else throw("Strict value is not equal to itself.") | |
420 | - | } | |
421 | - | else throw("Strict value is not equal to itself.") | |
422 | - | } | |
423 | - | else throw("Strict value is not equal to itself.") | |
424 | - | } | |
733 | + | func acceptBid (artId,issuer,bidId,bidOwner) = { | |
734 | + | let caller = toBase58String(i.caller.bytes) | |
735 | + | if ((caller != issuer)) | |
736 | + | then throw("You cannot do this action") | |
737 | + | else buyMint(i, artId, issuer, bidId, bidOwner) | |
738 | + | } | |
425 | 739 | ||
426 | 740 | ||
427 | 741 | ||
428 | 742 | @Callable(i) | |
429 | - | func a8 () = if ((i.caller != this)) | |
430 | - | then throw("you are not allowed to arb!") | |
431 | - | else { | |
432 | - | let usdnBalanceBefore = assetBalance(this, usdnAssetId) | |
433 | - | if ((usdnBalanceBefore == usdnBalanceBefore)) | |
434 | - | then { | |
435 | - | let putTheTokenInThePool = invoke(wxUsdcPool, "putOneTknV2", [1, false], [AttachedPayment(usdnAssetId, (a * 1000000))]) | |
436 | - | if ((putTheTokenInThePool == putTheTokenInThePool)) | |
437 | - | then { | |
438 | - | let lpTokenBalance = assetBalance(this, usdcWxLPTokenAssetId) | |
439 | - | if ((lpTokenBalance == lpTokenBalance)) | |
440 | - | then { | |
441 | - | let sellPoolToken = invoke(wxUsdcPool, "getOneTknV2", [usdcAssetIdString, 1], [AttachedPayment(usdcWxLPTokenAssetId, lpTokenBalance)]) | |
442 | - | if ((sellPoolToken == sellPoolToken)) | |
443 | - | then { | |
444 | - | let usdcBalToSwap = assetBalance(this, usdcAssetId) | |
445 | - | if ((usdcBalToSwap == usdcBalToSwap)) | |
446 | - | then { | |
447 | - | let sellUsdcOnPuzzle = invoke(puzzleUsdcPool, "swap", [usdnAssetIdString, 1], [AttachedPayment(usdcAssetId, usdcBalToSwap)]) | |
448 | - | if ((sellUsdcOnPuzzle == sellUsdcOnPuzzle)) | |
449 | - | then { | |
450 | - | let usdnBalanceAfter = assetBalance(this, usdnAssetId) | |
451 | - | if ((usdnBalanceAfter == usdnBalanceAfter)) | |
452 | - | then if ((0 >= (usdnBalanceAfter - usdnBalanceBefore))) | |
453 | - | then throw("USDC WX -> PUZZLE [($_$)]") | |
454 | - | else nil | |
455 | - | else throw("Strict value is not equal to itself.") | |
456 | - | } | |
457 | - | else throw("Strict value is not equal to itself.") | |
458 | - | } | |
459 | - | else throw("Strict value is not equal to itself.") | |
460 | - | } | |
461 | - | else throw("Strict value is not equal to itself.") | |
462 | - | } | |
463 | - | else throw("Strict value is not equal to itself.") | |
464 | - | } | |
465 | - | else throw("Strict value is not equal to itself.") | |
466 | - | } | |
467 | - | else throw("Strict value is not equal to itself.") | |
468 | - | } | |
743 | + | func cancelBid (artId,issuer,bidId,bidOwner) = { | |
744 | + | let $t02881328874 = idCallerDate(i) | |
745 | + | let id = $t02881328874._1 | |
746 | + | let caller = $t02881328874._2 | |
747 | + | let date = $t02881328874._3 | |
748 | + | if (if ((caller != bidOwner)) | |
749 | + | then (caller != issuer) | |
750 | + | else false) | |
751 | + | then throw("You cannot do this action") | |
752 | + | else { | |
753 | + | let returnMoneyTo = if ((caller == issuer)) | |
754 | + | then bidOwner | |
755 | + | else caller | |
756 | + | let bidNbr = getIntegerByKey(("current_bidamount_" + artId)) | |
757 | + | let bidDataKey = ((((((("bid_" + artId) + "_") + issuer) + "_") + bidOwner) + "_") + bidId) | |
758 | + | let bidData = getStringByKey((bidDataKey + "_OPEN")) | |
759 | + | if ((bidData == "")) | |
760 | + | then throw("Bid not found") | |
761 | + | else { | |
762 | + | let bidDataArr = split(bidData, "_") | |
763 | + | let assetId = getBidAssetId(bidDataArr[0]) | |
764 | + | let bidStatus = "CANCELED" | |
765 | + | [DeleteEntry((bidDataKey + "_OPEN")), StringEntry(((bidDataKey + "_") + bidStatus), ((bidData + "_") + toString(date))), IntegerEntry(("current_bidamount_" + artId), (bidNbr - 1)), ScriptTransfer(Address(fromBase58String(returnMoneyTo)), parseIntValue(bidDataArr[1]), assetId)] | |
766 | + | } | |
767 | + | } | |
768 | + | } | |
469 | 769 | ||
470 | - | ||
471 | - | ||
472 | - | @Callable(i) | |
473 | - | func a9 () = if ((i.caller != this)) | |
474 | - | then throw("you are not allowed to arb!") | |
475 | - | else { | |
476 | - | let usdnBalanceBefore = assetBalance(this, usdnAssetId) | |
477 | - | if ((usdnBalanceBefore == usdnBalanceBefore)) | |
478 | - | then { | |
479 | - | let buyUsdtOnPuzzle = invoke(puzzleUsdtPool, "swap", [usdtAssetIdString, 1], [AttachedPayment(usdnAssetId, (a * 1000000))]) | |
480 | - | if ((buyUsdtOnPuzzle == buyUsdtOnPuzzle)) | |
481 | - | then { | |
482 | - | let usdtBalToSwap = assetBalance(this, usdtAssetId) | |
483 | - | if ((usdtBalToSwap == usdtBalToSwap)) | |
484 | - | then { | |
485 | - | let putTheTokenInThePool = invoke(wxUsdtPool, "putOneTknV2", [1, false], [AttachedPayment(usdtAssetId, usdtBalToSwap)]) | |
486 | - | if ((putTheTokenInThePool == putTheTokenInThePool)) | |
487 | - | then { | |
488 | - | let lpTokenBalance = assetBalance(this, usdtWxLPTokenAssetId) | |
489 | - | if ((lpTokenBalance == lpTokenBalance)) | |
490 | - | then { | |
491 | - | let sellPoolToken = invoke(wxUsdtPool, "getOneTknV2", [usdnAssetIdString, 1], [AttachedPayment(usdtWxLPTokenAssetId, lpTokenBalance)]) | |
492 | - | if ((sellPoolToken == sellPoolToken)) | |
493 | - | then { | |
494 | - | let usdnBalanceAfter = assetBalance(this, usdnAssetId) | |
495 | - | if ((usdnBalanceAfter == usdnBalanceAfter)) | |
496 | - | then if ((0 >= (usdnBalanceAfter - usdnBalanceBefore))) | |
497 | - | then throw("USDT PUZZLE -> WX [($_$)]") | |
498 | - | else nil | |
499 | - | else throw("Strict value is not equal to itself.") | |
500 | - | } | |
501 | - | else throw("Strict value is not equal to itself.") | |
502 | - | } | |
503 | - | else throw("Strict value is not equal to itself.") | |
504 | - | } | |
505 | - | else throw("Strict value is not equal to itself.") | |
506 | - | } | |
507 | - | else throw("Strict value is not equal to itself.") | |
508 | - | } | |
509 | - | else throw("Strict value is not equal to itself.") | |
510 | - | } | |
511 | - | else throw("Strict value is not equal to itself.") | |
512 | - | } | |
513 | - | ||
514 | - | ||
515 | - | ||
516 | - | @Callable(i) | |
517 | - | func a10 () = if ((i.caller != this)) | |
518 | - | then throw("you are not allowed to arb!") | |
519 | - | else { | |
520 | - | let usdnBalanceBefore = assetBalance(this, usdnAssetId) | |
521 | - | if ((usdnBalanceBefore == usdnBalanceBefore)) | |
522 | - | then { | |
523 | - | let putTheTokenInThePool = invoke(wxUsdtPool, "putOneTknV2", [1, false], [AttachedPayment(usdnAssetId, (a * 1000000))]) | |
524 | - | if ((putTheTokenInThePool == putTheTokenInThePool)) | |
525 | - | then { | |
526 | - | let lpTokenBalance = assetBalance(this, usdtWxLPTokenAssetId) | |
527 | - | if ((lpTokenBalance == lpTokenBalance)) | |
528 | - | then { | |
529 | - | let sellPoolToken = invoke(wxUsdtPool, "getOneTknV2", [usdtAssetIdString, 1], [AttachedPayment(usdtWxLPTokenAssetId, lpTokenBalance)]) | |
530 | - | if ((sellPoolToken == sellPoolToken)) | |
531 | - | then { | |
532 | - | let usdtBalToSwap = assetBalance(this, usdtAssetId) | |
533 | - | if ((usdtBalToSwap == usdtBalToSwap)) | |
534 | - | then { | |
535 | - | let sellUsdtOnPuzzle = invoke(puzzleUsdtPool, "swap", [usdnAssetIdString, 1], [AttachedPayment(usdtAssetId, usdtBalToSwap)]) | |
536 | - | if ((sellUsdtOnPuzzle == sellUsdtOnPuzzle)) | |
537 | - | then { | |
538 | - | let usdnBalanceAfter = assetBalance(this, usdnAssetId) | |
539 | - | if ((usdnBalanceAfter == usdnBalanceAfter)) | |
540 | - | then if ((0 >= (usdnBalanceAfter - usdnBalanceBefore))) | |
541 | - | then throw("USDT WX -> PUZZLE [($_$)]") | |
542 | - | else nil | |
543 | - | else throw("Strict value is not equal to itself.") | |
544 | - | } | |
545 | - | else throw("Strict value is not equal to itself.") | |
546 | - | } | |
547 | - | else throw("Strict value is not equal to itself.") | |
548 | - | } | |
549 | - | else throw("Strict value is not equal to itself.") | |
550 | - | } | |
551 | - | else throw("Strict value is not equal to itself.") | |
552 | - | } | |
553 | - | else throw("Strict value is not equal to itself.") | |
554 | - | } | |
555 | - | else throw("Strict value is not equal to itself.") | |
556 | - | } | |
557 | - | ||
558 | - | ||
559 | - | ||
560 | - | @Callable(i) | |
561 | - | func a11 () = if ((i.caller != this)) | |
562 | - | then throw("you are not allowed to arb!") | |
563 | - | else { | |
564 | - | let usdnBalanceBefore = assetBalance(this, usdnAssetId) | |
565 | - | if ((usdnBalanceBefore == usdnBalanceBefore)) | |
566 | - | then { | |
567 | - | let buyTsnOnPuzzle = invoke(puzzleTsnPool, "swap", [tsnAssetIdString, 1], [AttachedPayment(usdnAssetId, (a * 1000000))]) | |
568 | - | if ((buyTsnOnPuzzle == buyTsnOnPuzzle)) | |
569 | - | then { | |
570 | - | let tsnBalToSwap = assetBalance(this, tsnAssetId) | |
571 | - | if ((tsnBalToSwap == tsnBalToSwap)) | |
572 | - | then { | |
573 | - | let putTheTokenInThePool = invoke(wxTsnPool, "putOneTkn", [1, false], [AttachedPayment(tsnAssetId, tsnBalToSwap)]) | |
574 | - | if ((putTheTokenInThePool == putTheTokenInThePool)) | |
575 | - | then { | |
576 | - | let lpTokenBalance = assetBalance(this, tsnWxLPTokenAssetId) | |
577 | - | if ((lpTokenBalance == lpTokenBalance)) | |
578 | - | then { | |
579 | - | let sellPoolToken = invoke(wxTsnPool, "getOneTkn", [usdnAssetIdString, 1], [AttachedPayment(tsnWxLPTokenAssetId, lpTokenBalance)]) | |
580 | - | if ((sellPoolToken == sellPoolToken)) | |
581 | - | then { | |
582 | - | let usdnBalanceAfter = assetBalance(this, usdnAssetId) | |
583 | - | if ((usdnBalanceAfter == usdnBalanceAfter)) | |
584 | - | then if ((0 >= (usdnBalanceAfter - usdnBalanceBefore))) | |
585 | - | then throw("TSN PUZZLE -> WX [($_$)]") | |
586 | - | else nil | |
587 | - | else throw("Strict value is not equal to itself.") | |
588 | - | } | |
589 | - | else throw("Strict value is not equal to itself.") | |
590 | - | } | |
591 | - | else throw("Strict value is not equal to itself.") | |
592 | - | } | |
593 | - | else throw("Strict value is not equal to itself.") | |
594 | - | } | |
595 | - | else throw("Strict value is not equal to itself.") | |
596 | - | } | |
597 | - | else throw("Strict value is not equal to itself.") | |
598 | - | } | |
599 | - | else throw("Strict value is not equal to itself.") | |
600 | - | } | |
601 | - | ||
602 | - | ||
603 | - | ||
604 | - | @Callable(i) | |
605 | - | func a12 () = if ((i.caller != this)) | |
606 | - | then throw("you are not allowed to arb!") | |
607 | - | else { | |
608 | - | let usdnBalanceBefore = assetBalance(this, usdnAssetId) | |
609 | - | if ((usdnBalanceBefore == usdnBalanceBefore)) | |
610 | - | then { | |
611 | - | let putTheTokenInThePool = invoke(wxTsnPool, "putOneTkn", [1, false], [AttachedPayment(usdnAssetId, (a * 1000000))]) | |
612 | - | if ((putTheTokenInThePool == putTheTokenInThePool)) | |
613 | - | then { | |
614 | - | let lpTokenBalance = assetBalance(this, tsnWxLPTokenAssetId) | |
615 | - | if ((lpTokenBalance == lpTokenBalance)) | |
616 | - | then { | |
617 | - | let sellPoolToken = invoke(wxTsnPool, "getOneTkn", [tsnAssetIdString, 1], [AttachedPayment(tsnWxLPTokenAssetId, lpTokenBalance)]) | |
618 | - | if ((sellPoolToken == sellPoolToken)) | |
619 | - | then { | |
620 | - | let tsnBalToSwap = assetBalance(this, tsnAssetId) | |
621 | - | if ((tsnBalToSwap == tsnBalToSwap)) | |
622 | - | then { | |
623 | - | let selltsnOnPuzzle = invoke(puzzleTsnPool, "swap", [usdnAssetIdString, 1], [AttachedPayment(tsnAssetId, tsnBalToSwap)]) | |
624 | - | if ((selltsnOnPuzzle == selltsnOnPuzzle)) | |
625 | - | then { | |
626 | - | let usdnBalanceAfter = assetBalance(this, usdnAssetId) | |
627 | - | if ((usdnBalanceAfter == usdnBalanceAfter)) | |
628 | - | then if ((0 >= (usdnBalanceAfter - usdnBalanceBefore))) | |
629 | - | then throw("TSN WX -> PUZZLE [($_$)]") | |
630 | - | else nil | |
631 | - | else throw("Strict value is not equal to itself.") | |
632 | - | } | |
633 | - | else throw("Strict value is not equal to itself.") | |
634 | - | } | |
635 | - | else throw("Strict value is not equal to itself.") | |
636 | - | } | |
637 | - | else throw("Strict value is not equal to itself.") | |
638 | - | } | |
639 | - | else throw("Strict value is not equal to itself.") | |
640 | - | } | |
641 | - | else throw("Strict value is not equal to itself.") | |
642 | - | } | |
643 | - | else throw("Strict value is not equal to itself.") | |
644 | - | } | |
645 | - | ||
646 | - | ||
647 | - | ||
648 | - | @Callable(i) | |
649 | - | func a13 () = if ((i.caller != this)) | |
650 | - | then throw("you are not allowed to arb!") | |
651 | - | else { | |
652 | - | let usdnBalanceBefore = assetBalance(this, usdnAssetId) | |
653 | - | if ((usdnBalanceBefore == usdnBalanceBefore)) | |
654 | - | then { | |
655 | - | let putTheTokenInThePool = invoke(wxBtcPool, "putOneTkn", [1, false], [AttachedPayment(usdnAssetId, (a * 1000000))]) | |
656 | - | if ((putTheTokenInThePool == putTheTokenInThePool)) | |
657 | - | then { | |
658 | - | let lpTokenBalance = assetBalance(this, btcWxLPTokenAssetId) | |
659 | - | if ((lpTokenBalance == lpTokenBalance)) | |
660 | - | then { | |
661 | - | let sellPoolToken = invoke(wxBtcPool, "getOneTkn", [btcAssetIdString, 1], [AttachedPayment(btcWxLPTokenAssetId, lpTokenBalance)]) | |
662 | - | if ((sellPoolToken == sellPoolToken)) | |
663 | - | then { | |
664 | - | let btcBalToSwap = assetBalance(this, btcAssetId) | |
665 | - | let swapBtcOnSwop = invoke(swopBtcPool, "exchange", [1], [AttachedPayment(btcAssetId, btcBalToSwap)]) | |
666 | - | if ((swapBtcOnSwop == swapBtcOnSwop)) | |
667 | - | then { | |
668 | - | let usdnBalanceAfter = assetBalance(this, usdnAssetId) | |
669 | - | if ((usdnBalanceAfter == usdnBalanceAfter)) | |
670 | - | then if ((0 >= (usdnBalanceAfter - usdnBalanceBefore))) | |
671 | - | then throw("BTC WX -> SWOP [($_$)]") | |
672 | - | else nil | |
673 | - | else throw("Strict value is not equal to itself.") | |
674 | - | } | |
675 | - | else throw("Strict value is not equal to itself.") | |
676 | - | } | |
677 | - | else throw("Strict value is not equal to itself.") | |
678 | - | } | |
679 | - | else throw("Strict value is not equal to itself.") | |
680 | - | } | |
681 | - | else throw("Strict value is not equal to itself.") | |
682 | - | } | |
683 | - | else throw("Strict value is not equal to itself.") | |
684 | - | } | |
685 | - | ||
686 | - | ||
687 | - | ||
688 | - | @Callable(i) | |
689 | - | func a14 () = if ((i.caller != this)) | |
690 | - | then throw("you are not allowed to arb!") | |
691 | - | else { | |
692 | - | let usdnBalanceBefore = assetBalance(this, usdnAssetId) | |
693 | - | if ((usdnBalanceBefore == usdnBalanceBefore)) | |
694 | - | then { | |
695 | - | let swapToBtcOnSwop = invoke(swopBtcPool, "exchange", [1], [AttachedPayment(usdnAssetId, (a * 1000000))]) | |
696 | - | if ((swapToBtcOnSwop == swapToBtcOnSwop)) | |
697 | - | then { | |
698 | - | let btcBalToSwap = assetBalance(this, btcAssetId) | |
699 | - | let putTheTokenInThePool = invoke(wxBtcPool, "putOneTkn", [1, false], [AttachedPayment(btcAssetId, btcBalToSwap)]) | |
700 | - | if ((putTheTokenInThePool == putTheTokenInThePool)) | |
701 | - | then { | |
702 | - | let lpTokenBalance = assetBalance(this, btcWxLPTokenAssetId) | |
703 | - | if ((lpTokenBalance == lpTokenBalance)) | |
704 | - | then { | |
705 | - | let sellPoolToken = invoke(wxBtcPool, "getOneTkn", [usdnAssetIdString, 1], [AttachedPayment(btcWxLPTokenAssetId, lpTokenBalance)]) | |
706 | - | if ((sellPoolToken == sellPoolToken)) | |
707 | - | then { | |
708 | - | let usdnBalanceAfter = assetBalance(this, usdnAssetId) | |
709 | - | if ((usdnBalanceAfter == usdnBalanceAfter)) | |
710 | - | then if ((0 >= (usdnBalanceAfter - usdnBalanceBefore))) | |
711 | - | then throw("BTC SWOP -> WX [($_$)]") | |
712 | - | else nil | |
713 | - | else throw("Strict value is not equal to itself.") | |
714 | - | } | |
715 | - | else throw("Strict value is not equal to itself.") | |
716 | - | } | |
717 | - | else throw("Strict value is not equal to itself.") | |
718 | - | } | |
719 | - | else throw("Strict value is not equal to itself.") | |
720 | - | } | |
721 | - | else throw("Strict value is not equal to itself.") | |
722 | - | } | |
723 | - | else throw("Strict value is not equal to itself.") | |
724 | - | } | |
725 | - | ||
726 | - | ||
727 | - | ||
728 | - | @Callable(i) | |
729 | - | func a15 () = if ((i.caller != this)) | |
730 | - | then throw("you are not allowed to arb!") | |
731 | - | else { | |
732 | - | let usdnBalanceBefore = assetBalance(this, usdnAssetId) | |
733 | - | if ((usdnBalanceBefore == usdnBalanceBefore)) | |
734 | - | then { | |
735 | - | let putTheTokenInThePool = invoke(wxEthPool, "putOneTkn", [1, false], [AttachedPayment(usdnAssetId, (a * 1000000))]) | |
736 | - | if ((putTheTokenInThePool == putTheTokenInThePool)) | |
737 | - | then { | |
738 | - | let lpTokenBalance = assetBalance(this, ethWxLPTokenAssetId) | |
739 | - | if ((lpTokenBalance == lpTokenBalance)) | |
740 | - | then { | |
741 | - | let sellPoolToken = invoke(wxEthPool, "getOneTkn", [ethAssetIdString, 1], [AttachedPayment(ethWxLPTokenAssetId, lpTokenBalance)]) | |
742 | - | if ((sellPoolToken == sellPoolToken)) | |
743 | - | then { | |
744 | - | let ethBalToSwap = assetBalance(this, ethAssetId) | |
745 | - | let swapEthOnSwop = invoke(swopEthPool, "exchange", [1], [AttachedPayment(ethAssetId, ethBalToSwap)]) | |
746 | - | if ((swapEthOnSwop == swapEthOnSwop)) | |
747 | - | then { | |
748 | - | let usdnBalanceAfter = assetBalance(this, usdnAssetId) | |
749 | - | if ((usdnBalanceAfter == usdnBalanceAfter)) | |
750 | - | then if ((0 >= (usdnBalanceAfter - usdnBalanceBefore))) | |
751 | - | then throw("ETH WX -> SWOP [($_$)]") | |
752 | - | else nil | |
753 | - | else throw("Strict value is not equal to itself.") | |
754 | - | } | |
755 | - | else throw("Strict value is not equal to itself.") | |
756 | - | } | |
757 | - | else throw("Strict value is not equal to itself.") | |
758 | - | } | |
759 | - | else throw("Strict value is not equal to itself.") | |
760 | - | } | |
761 | - | else throw("Strict value is not equal to itself.") | |
762 | - | } | |
763 | - | else throw("Strict value is not equal to itself.") | |
764 | - | } | |
765 | - | ||
766 | - | ||
767 | - | ||
768 | - | @Callable(i) | |
769 | - | func a16 () = if ((i.caller != this)) | |
770 | - | then throw("you are not allowed to arb!") | |
771 | - | else { | |
772 | - | let usdnBalanceBefore = assetBalance(this, usdnAssetId) | |
773 | - | if ((usdnBalanceBefore == usdnBalanceBefore)) | |
774 | - | then { | |
775 | - | let swapToEthOnSwop = invoke(swopEthPool, "exchange", [1], [AttachedPayment(usdnAssetId, (a * 1000000))]) | |
776 | - | if ((swapToEthOnSwop == swapToEthOnSwop)) | |
777 | - | then { | |
778 | - | let ethBalToSwap = assetBalance(this, ethAssetId) | |
779 | - | let putTheTokenInThePool = invoke(wxEthPool, "putOneTkn", [1, false], [AttachedPayment(ethAssetId, ethBalToSwap)]) | |
780 | - | if ((putTheTokenInThePool == putTheTokenInThePool)) | |
781 | - | then { | |
782 | - | let lpTokenBalance = assetBalance(this, ethWxLPTokenAssetId) | |
783 | - | if ((lpTokenBalance == lpTokenBalance)) | |
784 | - | then { | |
785 | - | let sellPoolToken = invoke(wxEthPool, "getOneTkn", [usdnAssetIdString, 1], [AttachedPayment(ethWxLPTokenAssetId, lpTokenBalance)]) | |
786 | - | if ((sellPoolToken == sellPoolToken)) | |
787 | - | then { | |
788 | - | let usdnBalanceAfter = assetBalance(this, usdnAssetId) | |
789 | - | if ((usdnBalanceAfter == usdnBalanceAfter)) | |
790 | - | then if ((0 >= (usdnBalanceAfter - usdnBalanceBefore))) | |
791 | - | then throw("ETH SWOP -> WX [($_$)]") | |
792 | - | else nil | |
793 | - | else throw("Strict value is not equal to itself.") | |
794 | - | } | |
795 | - | else throw("Strict value is not equal to itself.") | |
796 | - | } | |
797 | - | else throw("Strict value is not equal to itself.") | |
798 | - | } | |
799 | - | else throw("Strict value is not equal to itself.") | |
800 | - | } | |
801 | - | else throw("Strict value is not equal to itself.") | |
802 | - | } | |
803 | - | else throw("Strict value is not equal to itself.") | |
804 | - | } | |
805 | - | ||
806 | - | ||
807 | - | ||
808 | - | @Callable(i) | |
809 | - | func a17 () = if ((i.caller != this)) | |
810 | - | then throw("you are not allowed to arb!") | |
811 | - | else { | |
812 | - | let usdnBalanceBefore = assetBalance(this, usdnAssetId) | |
813 | - | if ((usdnBalanceBefore == usdnBalanceBefore)) | |
814 | - | then { | |
815 | - | let putTheTokenInThePool = invoke(wxLtcPool, "putOneTkn", [1, false], [AttachedPayment(usdnAssetId, (a * 1000000))]) | |
816 | - | if ((putTheTokenInThePool == putTheTokenInThePool)) | |
817 | - | then { | |
818 | - | let lpTokenBalance = assetBalance(this, ltcWxLPTokenAssetId) | |
819 | - | if ((lpTokenBalance == lpTokenBalance)) | |
820 | - | then { | |
821 | - | let sellPoolToken = invoke(wxLtcPool, "getOneTkn", [ltcAssetIdString, 1], [AttachedPayment(ltcWxLPTokenAssetId, lpTokenBalance)]) | |
822 | - | if ((sellPoolToken == sellPoolToken)) | |
823 | - | then { | |
824 | - | let ltcBalToSwap = assetBalance(this, ltcAssetId) | |
825 | - | let swapLtcOnSwop = invoke(swopLtcPool, "exchange", [1], [AttachedPayment(ltcAssetId, ltcBalToSwap)]) | |
826 | - | if ((swapLtcOnSwop == swapLtcOnSwop)) | |
827 | - | then { | |
828 | - | let usdnBalanceAfter = assetBalance(this, usdnAssetId) | |
829 | - | if ((usdnBalanceAfter == usdnBalanceAfter)) | |
830 | - | then if ((0 >= (usdnBalanceAfter - usdnBalanceBefore))) | |
831 | - | then throw("LTC WX -> SWOP [($_$)]") | |
832 | - | else nil | |
833 | - | else throw("Strict value is not equal to itself.") | |
834 | - | } | |
835 | - | else throw("Strict value is not equal to itself.") | |
836 | - | } | |
837 | - | else throw("Strict value is not equal to itself.") | |
838 | - | } | |
839 | - | else throw("Strict value is not equal to itself.") | |
840 | - | } | |
841 | - | else throw("Strict value is not equal to itself.") | |
842 | - | } | |
843 | - | else throw("Strict value is not equal to itself.") | |
844 | - | } | |
845 | - | ||
846 | - | ||
847 | - | ||
848 | - | @Callable(i) | |
849 | - | func a18 () = if ((i.caller != this)) | |
850 | - | then throw("you are not allowed to arb!") | |
851 | - | else { | |
852 | - | let usdnBalanceBefore = assetBalance(this, usdnAssetId) | |
853 | - | if ((usdnBalanceBefore == usdnBalanceBefore)) | |
854 | - | then { | |
855 | - | let swapToLtcOnSwop = invoke(swopLtcPool, "exchange", [1], [AttachedPayment(usdnAssetId, (a * 1000000))]) | |
856 | - | if ((swapToLtcOnSwop == swapToLtcOnSwop)) | |
857 | - | then { | |
858 | - | let ltcBalToSwap = assetBalance(this, ltcAssetId) | |
859 | - | let putTheTokenInThePool = invoke(wxLtcPool, "putOneTkn", [1, false], [AttachedPayment(ltcAssetId, ltcBalToSwap)]) | |
860 | - | if ((putTheTokenInThePool == putTheTokenInThePool)) | |
861 | - | then { | |
862 | - | let lpTokenBalance = assetBalance(this, ltcWxLPTokenAssetId) | |
863 | - | if ((lpTokenBalance == lpTokenBalance)) | |
864 | - | then { | |
865 | - | let sellPoolToken = invoke(wxLtcPool, "getOneTkn", [usdnAssetIdString, 1], [AttachedPayment(ltcWxLPTokenAssetId, lpTokenBalance)]) | |
866 | - | if ((sellPoolToken == sellPoolToken)) | |
867 | - | then { | |
868 | - | let usdnBalanceAfter = assetBalance(this, usdnAssetId) | |
869 | - | if ((usdnBalanceAfter == usdnBalanceAfter)) | |
870 | - | then if ((0 >= (usdnBalanceAfter - usdnBalanceBefore))) | |
871 | - | then throw("LTC SWOP -> WX [($_$)]") | |
872 | - | else nil | |
873 | - | else throw("Strict value is not equal to itself.") | |
874 | - | } | |
875 | - | else throw("Strict value is not equal to itself.") | |
876 | - | } | |
877 | - | else throw("Strict value is not equal to itself.") | |
878 | - | } | |
879 | - | else throw("Strict value is not equal to itself.") | |
880 | - | } | |
881 | - | else throw("Strict value is not equal to itself.") | |
882 | - | } | |
883 | - | else throw("Strict value is not equal to itself.") | |
884 | - | } | |
885 | - | ||
886 | - | ||
887 | - | ||
888 | - | @Callable(i) | |
889 | - | func a19 () = if ((i.caller != this)) | |
890 | - | then throw("you are not allowed to arb!") | |
891 | - | else { | |
892 | - | let usdnBalanceBefore = assetBalance(this, usdnAssetId) | |
893 | - | if ((usdnBalanceBefore == usdnBalanceBefore)) | |
894 | - | then { | |
895 | - | let putTheTokenInThePool = invoke(wxWestPool, "putOneTkn", [1, false], [AttachedPayment(usdnAssetId, (a * 1000000))]) | |
896 | - | if ((putTheTokenInThePool == putTheTokenInThePool)) | |
897 | - | then { | |
898 | - | let lpTokenBalance = assetBalance(this, westWxLPTokenAssetId) | |
899 | - | if ((lpTokenBalance == lpTokenBalance)) | |
900 | - | then { | |
901 | - | let sellPoolToken = invoke(wxWestPool, "getOneTkn", [westAssetIdString, 1], [AttachedPayment(westWxLPTokenAssetId, lpTokenBalance)]) | |
902 | - | if ((sellPoolToken == sellPoolToken)) | |
903 | - | then { | |
904 | - | let westBalToSwap = assetBalance(this, westAssetId) | |
905 | - | let swapWestOnSwop = invoke(swopWestPool, "exchange", [1], [AttachedPayment(westAssetId, westBalToSwap)]) | |
906 | - | if ((swapWestOnSwop == swapWestOnSwop)) | |
907 | - | then { | |
908 | - | let usdnBalanceAfter = assetBalance(this, usdnAssetId) | |
909 | - | if ((usdnBalanceAfter == usdnBalanceAfter)) | |
910 | - | then if ((0 >= (usdnBalanceAfter - usdnBalanceBefore))) | |
911 | - | then throw("WEST WX -> SWOP [($_$)]") | |
912 | - | else nil | |
913 | - | else throw("Strict value is not equal to itself.") | |
914 | - | } | |
915 | - | else throw("Strict value is not equal to itself.") | |
916 | - | } | |
917 | - | else throw("Strict value is not equal to itself.") | |
918 | - | } | |
919 | - | else throw("Strict value is not equal to itself.") | |
920 | - | } | |
921 | - | else throw("Strict value is not equal to itself.") | |
922 | - | } | |
923 | - | else throw("Strict value is not equal to itself.") | |
924 | - | } | |
925 | - | ||
926 | - | ||
927 | - | ||
928 | - | @Callable(i) | |
929 | - | func a20 () = if ((i.caller != this)) | |
930 | - | then throw("you are not allowed to arb!") | |
931 | - | else { | |
932 | - | let usdnBalanceBefore = assetBalance(this, usdnAssetId) | |
933 | - | if ((usdnBalanceBefore == usdnBalanceBefore)) | |
934 | - | then { | |
935 | - | let swapToWestOnSwop = invoke(swopWestPool, "exchange", [1], [AttachedPayment(usdnAssetId, (a * 1000000))]) | |
936 | - | if ((swapToWestOnSwop == swapToWestOnSwop)) | |
937 | - | then { | |
938 | - | let westBalToSwap = assetBalance(this, westAssetId) | |
939 | - | let putTheTokenInThePool = invoke(wxWestPool, "putOneTkn", [1, false], [AttachedPayment(westAssetId, westBalToSwap)]) | |
940 | - | if ((putTheTokenInThePool == putTheTokenInThePool)) | |
941 | - | then { | |
942 | - | let lpTokenBalance = assetBalance(this, westWxLPTokenAssetId) | |
943 | - | if ((lpTokenBalance == lpTokenBalance)) | |
944 | - | then { | |
945 | - | let sellPoolToken = invoke(wxWestPool, "getOneTkn", [usdnAssetIdString, 1], [AttachedPayment(westWxLPTokenAssetId, lpTokenBalance)]) | |
946 | - | if ((sellPoolToken == sellPoolToken)) | |
947 | - | then { | |
948 | - | let usdnBalanceAfter = assetBalance(this, usdnAssetId) | |
949 | - | if ((usdnBalanceAfter == usdnBalanceAfter)) | |
950 | - | then if ((0 >= (usdnBalanceAfter - usdnBalanceBefore))) | |
951 | - | then throw("WEST SWOP -> WX [($_$)]") | |
952 | - | else nil | |
953 | - | else throw("Strict value is not equal to itself.") | |
954 | - | } | |
955 | - | else throw("Strict value is not equal to itself.") | |
956 | - | } | |
957 | - | else throw("Strict value is not equal to itself.") | |
958 | - | } | |
959 | - | else throw("Strict value is not equal to itself.") | |
960 | - | } | |
961 | - | else throw("Strict value is not equal to itself.") | |
962 | - | } | |
963 | - | else throw("Strict value is not equal to itself.") | |
964 | - | } | |
965 | - | ||
966 | - | ||
967 | - | ||
968 | - | @Callable(i) | |
969 | - | func a21 () = if ((i.caller != this)) | |
970 | - | then throw("you are not allowed to arb!") | |
971 | - | else { | |
972 | - | let usdnBalanceBefore = assetBalance(this, usdnAssetId) | |
973 | - | if ((usdnBalanceBefore == usdnBalanceBefore)) | |
974 | - | then { | |
975 | - | let putTheTokenInThePool = invoke(wxEggPool, "putOneTkn", [1, false], [AttachedPayment(usdnAssetId, (a * 1000000))]) | |
976 | - | if ((putTheTokenInThePool == putTheTokenInThePool)) | |
977 | - | then { | |
978 | - | let lpTokenBalance = assetBalance(this, eggWxLPTokenAssetId) | |
979 | - | if ((lpTokenBalance == lpTokenBalance)) | |
980 | - | then { | |
981 | - | let sellPoolToken = invoke(wxEggPool, "getOneTkn", [eggAssetIdString, 1], [AttachedPayment(eggWxLPTokenAssetId, lpTokenBalance)]) | |
982 | - | if ((sellPoolToken == sellPoolToken)) | |
983 | - | then { | |
984 | - | let eggBalToSwap = assetBalance(this, eggAssetId) | |
985 | - | let swapEggOnSwop = invoke(swopEggPool, "exchange", [1], [AttachedPayment(eggAssetId, eggBalToSwap)]) | |
986 | - | if ((swapEggOnSwop == swapEggOnSwop)) | |
987 | - | then { | |
988 | - | let usdnBalanceAfter = assetBalance(this, usdnAssetId) | |
989 | - | if ((usdnBalanceAfter == usdnBalanceAfter)) | |
990 | - | then if ((0 >= (usdnBalanceAfter - usdnBalanceBefore))) | |
991 | - | then throw("EGG WX -> SWOP [($_$)]") | |
992 | - | else nil | |
993 | - | else throw("Strict value is not equal to itself.") | |
994 | - | } | |
995 | - | else throw("Strict value is not equal to itself.") | |
996 | - | } | |
997 | - | else throw("Strict value is not equal to itself.") | |
998 | - | } | |
999 | - | else throw("Strict value is not equal to itself.") | |
1000 | - | } | |
1001 | - | else throw("Strict value is not equal to itself.") | |
1002 | - | } | |
1003 | - | else throw("Strict value is not equal to itself.") | |
1004 | - | } | |
1005 | - | ||
1006 | - | ||
1007 | - | ||
1008 | - | @Callable(i) | |
1009 | - | func a22 () = if ((i.caller != this)) | |
1010 | - | then throw("you are not allowed to arb!") | |
1011 | - | else { | |
1012 | - | let usdnBalanceBefore = assetBalance(this, usdnAssetId) | |
1013 | - | if ((usdnBalanceBefore == usdnBalanceBefore)) | |
1014 | - | then { | |
1015 | - | let swapToEggOnSwop = invoke(swopEggPool, "exchange", [1], [AttachedPayment(usdnAssetId, (a * 1000000))]) | |
1016 | - | if ((swapToEggOnSwop == swapToEggOnSwop)) | |
1017 | - | then { | |
1018 | - | let eggBalToSwap = assetBalance(this, eggAssetId) | |
1019 | - | let putTheTokenInThePool = invoke(wxEggPool, "putOneTkn", [1, false], [AttachedPayment(eggAssetId, eggBalToSwap)]) | |
1020 | - | if ((putTheTokenInThePool == putTheTokenInThePool)) | |
1021 | - | then { | |
1022 | - | let lpTokenBalance = assetBalance(this, eggWxLPTokenAssetId) | |
1023 | - | if ((lpTokenBalance == lpTokenBalance)) | |
1024 | - | then { | |
1025 | - | let sellPoolToken = invoke(wxEggPool, "getOneTkn", [usdnAssetIdString, 1], [AttachedPayment(eggWxLPTokenAssetId, lpTokenBalance)]) | |
1026 | - | if ((sellPoolToken == sellPoolToken)) | |
1027 | - | then { | |
1028 | - | let usdnBalanceAfter = assetBalance(this, usdnAssetId) | |
1029 | - | if ((usdnBalanceAfter == usdnBalanceAfter)) | |
1030 | - | then if ((0 >= (usdnBalanceAfter - usdnBalanceBefore))) | |
1031 | - | then throw("EGG SWOP -> WX [($_$)]") | |
1032 | - | else nil | |
1033 | - | else throw("Strict value is not equal to itself.") | |
1034 | - | } | |
1035 | - | else throw("Strict value is not equal to itself.") | |
1036 | - | } | |
1037 | - | else throw("Strict value is not equal to itself.") | |
1038 | - | } | |
1039 | - | else throw("Strict value is not equal to itself.") | |
1040 | - | } | |
1041 | - | else throw("Strict value is not equal to itself.") | |
1042 | - | } | |
1043 | - | else throw("Strict value is not equal to itself.") | |
1044 | - | } | |
1045 | - | ||
1046 | - | ||
1047 | - | ||
1048 | - | @Callable(i) | |
1049 | - | func a23 () = if ((i.caller != this)) | |
1050 | - | then throw("you are not allowed to arb!") | |
1051 | - | else { | |
1052 | - | let usdnBalanceBefore = assetBalance(this, usdnAssetId) | |
1053 | - | if ((usdnBalanceBefore == usdnBalanceBefore)) | |
1054 | - | then { | |
1055 | - | let buyPlutoOnPuzzle = invoke(puzzlePlutoPool, "swap", [plutoAssetIdString, 1], [AttachedPayment(usdnAssetId, (a * 1000000))]) | |
1056 | - | if ((buyPlutoOnPuzzle == buyPlutoOnPuzzle)) | |
1057 | - | then { | |
1058 | - | let plutoBalToSwap = assetBalance(this, plutoAssetId) | |
1059 | - | let swapPlutoOnSwop = invoke(swopPlutoPool, "exchange", [1], [AttachedPayment(plutoAssetId, plutoBalToSwap)]) | |
1060 | - | if ((swapPlutoOnSwop == swapPlutoOnSwop)) | |
1061 | - | then { | |
1062 | - | let usdnBalanceAfter = assetBalance(this, usdnAssetId) | |
1063 | - | if ((usdnBalanceAfter == usdnBalanceAfter)) | |
1064 | - | then if ((0 >= (usdnBalanceAfter - usdnBalanceBefore))) | |
1065 | - | then throw("PLUTO PUZZLE -> SWOP [($_$)]") | |
1066 | - | else nil | |
1067 | - | else throw("Strict value is not equal to itself.") | |
1068 | - | } | |
1069 | - | else throw("Strict value is not equal to itself.") | |
1070 | - | } | |
1071 | - | else throw("Strict value is not equal to itself.") | |
1072 | - | } | |
1073 | - | else throw("Strict value is not equal to itself.") | |
1074 | - | } | |
1075 | - | ||
1076 | - | ||
1077 | - | ||
1078 | - | @Callable(i) | |
1079 | - | func a24 () = if ((i.caller != this)) | |
1080 | - | then throw("you are not allowed to arb!") | |
1081 | - | else { | |
1082 | - | let usdnBalanceBefore = assetBalance(this, usdnAssetId) | |
1083 | - | if ((usdnBalanceBefore == usdnBalanceBefore)) | |
1084 | - | then { | |
1085 | - | let swapToPlutoOnSwop = invoke(swopPlutoPool, "exchange", [1], [AttachedPayment(usdnAssetId, (a * 1000000))]) | |
1086 | - | if ((swapToPlutoOnSwop == swapToPlutoOnSwop)) | |
1087 | - | then { | |
1088 | - | let plutoBalToSwap = assetBalance(this, plutoAssetId) | |
1089 | - | let sellPlutoOnPuzzle = invoke(puzzlePlutoPool, "swap", [usdnAssetIdString, 1], [AttachedPayment(plutoAssetId, plutoBalToSwap)]) | |
1090 | - | if ((sellPlutoOnPuzzle == sellPlutoOnPuzzle)) | |
1091 | - | then { | |
1092 | - | let usdnBalanceAfter = assetBalance(this, usdnAssetId) | |
1093 | - | if ((usdnBalanceAfter == usdnBalanceAfter)) | |
1094 | - | then if ((0 >= (usdnBalanceAfter - usdnBalanceBefore))) | |
1095 | - | then throw("PLUTO SWOP -> PUZZLE [($_$)]") | |
1096 | - | else nil | |
1097 | - | else throw("Strict value is not equal to itself.") | |
1098 | - | } | |
1099 | - | else throw("Strict value is not equal to itself.") | |
1100 | - | } | |
1101 | - | else throw("Strict value is not equal to itself.") | |
1102 | - | } | |
1103 | - | else throw("Strict value is not equal to itself.") | |
1104 | - | } | |
1105 | - | ||
1106 | - | ||
1107 | - | @Verifier(tx) | |
1108 | - | func verify () = sigVerify_128Kb(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey) | |
1109 | 770 |
github/deemru/w8io/026f985 95.01 ms ◑