tx · CxfqokVSSjfXo646AMaNBEzqD3b1HDSeZLxm88pHfr7N

3NBkgZNDiBMcfaXFzTjyRjhPmSzPwNEESfT:  -0.01000000 Waves

2023.10.11 06:53 [2793443] smart account 3NBkgZNDiBMcfaXFzTjyRjhPmSzPwNEESfT > SELF 0.00000000 Waves

{ "type": 13, "id": "CxfqokVSSjfXo646AMaNBEzqD3b1HDSeZLxm88pHfr7N", "fee": 1000000, "feeAssetId": null, "timestamp": 1696996488485, "version": 2, "chainId": 84, "sender": "3NBkgZNDiBMcfaXFzTjyRjhPmSzPwNEESfT", "senderPublicKey": "FjhtNLcQF3PqRymjVvNo3MP7GkwACEUWicnD6uHx8p7g", "proofs": [ "4tkfuqHjxHZmWzBp8Lz2cTb3RukrMWSYNrAjNYgNHxCDhqowFPfvm6syaPFY3mbCRWf3hWTmVyC7LtkDW6BHdp8q" ], "script": "base64:BgIOCAISBAoCCAgSBAoCCAERAQ5nZXRTdHJpbmdCeUtleQEDa2V5CQELdmFsdWVPckVsc2UCCQCdCAIFBHRoaXMFA2tleQIAABF1c2R0UFBBc3NldElkX3N0cgkBDmdldFN0cmluZ0J5S2V5AQIbY29uZl9hY2NlcHRlZF9hc3NldF9VU0RUX1BQAA5hcnRBc3NldElkX3N0cgkBDmdldFN0cmluZ0J5S2V5AQIXY29uZl9hY2NlcHRlZF9hc3NldF9BUlQAEXVzZGNQUEFzc2V0SWRfc3RyCQEOZ2V0U3RyaW5nQnlLZXkBAhtjb25mX2FjY2VwdGVkX2Fzc2V0X1VTRENfUFAAD2Vhc3RBc3NldElkX3N0cgkBDmdldFN0cmluZ0J5S2V5AQIYY29uZl9hY2NlcHRlZF9hc3NldF9FQVNUABFwdXp6bGVBc3NldElkX3N0cgkBDmdldFN0cmluZ0J5S2V5AQIaY29uZl9hY2NlcHRlZF9hc3NldF9QVVpaTEUAEGV0aFBQQXNzZXRJZF9zdHIJAQ5nZXRTdHJpbmdCeUtleQECGmNvbmZfYWNjZXB0ZWRfYXNzZXR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hc3NldE91dAxNaW5BbW91bnRPdXQEB3BheW1lbnQJAQV2YWx1ZQEJAJEDAggFAWkIcGF5bWVudHMAAAQIYW1vdW50SW4JAQV2YWx1ZQEIBQdwYXltZW50BmFtb3VudAQJYXNzZXRJZEluAwkBCWlzRGVmaW5lZAEIBQdwYXltZW50B2Fzc2V0SWQJANgEAQkBBXZhbHVlAQgFB3BheW1lbnQHYXNzZXRJZAIFV0FWRVMDCQECIT0CBQhhc3NldE91dAUOYXJ0QXNzZXRJZF9zdHIJAAIBAhZBc3NldCBvdXQgbm90IGFjY2VwdGVkBAxhbW91bnRUb1NlbmQJARJnZXRfYW1vdW50X3RvX3NlbmQCBQhhbW91bnRJbgUJYXNzZXRJZEluCQDMCAIJAQ5TY3JpcHRUcmFuc2ZlcgMIBQFpBmNhbGxlcgUMYW1vdW50VG9TZW5kCQDZBAEFCGFzc2V0T3V0BQNuaWwBAnR4AQZ2ZXJpZnkACQD0AwMIBQJ0eAlib2R5Qnl0ZXMJAJEDAggFAnR4BnByb29mcwAACAUCdHgPc2VuZGVyUHVibGljS2V5mY2P+A==", "height": 2793443, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 66vAWLEL7bkM3AgjWYRVZTJW1E6VKKusEB714yJx9Hai Next: none Diff:
OldNewDifferences
6363 func swap (assetOut,MinAmountOut) = {
6464 let payment = value(i.payments[0])
6565 let amountIn = value(payment.amount)
66- let assetIdIn = value(payment.assetId)
66+ let assetIdIn = if (isDefined(payment.assetId))
67+ then toBase58String(value(payment.assetId))
68+ else "WAVES"
6769 if ((assetOut != artAssetId_str))
6870 then throw("Asset out not accepted")
6971 else {
70- let amountToSend = get_amount_to_send(amountIn, toBase58String(assetIdIn))
72+ let amountToSend = get_amount_to_send(amountIn, assetIdIn)
7173 [ScriptTransfer(i.caller, amountToSend, fromBase58String(assetOut))]
7274 }
7375 }
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 6 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 func getStringByKey (key) = valueOrElse(getString(this, key), "")
55
66
77 let usdtPPAssetId_str = getStringByKey("conf_accepted_asset_USDT_PP")
88
99 let artAssetId_str = getStringByKey("conf_accepted_asset_ART")
1010
1111 let usdcPPAssetId_str = getStringByKey("conf_accepted_asset_USDC_PP")
1212
1313 let eastAssetId_str = getStringByKey("conf_accepted_asset_EAST")
1414
1515 let puzzleAssetId_str = getStringByKey("conf_accepted_asset_PUZZLE")
1616
1717 let ethPPAssetId_str = getStringByKey("conf_accepted_asset_ETH_PP")
1818
1919 let wavesAssetId_str = "WAVES"
2020
2121 let usdtPPAssetId = fromBase58String(usdtPPAssetId_str)
2222
2323 let artAssetId = fromBase58String(artAssetId_str)
2424
2525 let usdcPPAssetId = fromBase58String(usdcPPAssetId_str)
2626
2727 let eastAssetId = fromBase58String(eastAssetId_str)
2828
2929 let puzzleAssetId = fromBase58String(puzzleAssetId_str)
3030
3131 let ethPPAssetId = fromBase58String(ethPPAssetId_str)
3232
3333 let wavesAssetId = base58''
3434
3535 let chris = getStringByKey("conf_admin_1")
3636
3737 func get_amount_to_send (amountIn,assetIdIn) = if (if (if ((assetIdIn == usdtPPAssetId_str))
3838 then true
3939 else (assetIdIn == usdcPPAssetId_str))
4040 then true
4141 else (assetIdIn == eastAssetId_str))
4242 then 200000000
4343 else if ((assetIdIn == puzzleAssetId_str))
4444 then 800000000
4545 else if ((assetIdIn == ethPPAssetId_str))
4646 then 16000000000
4747 else 300000000
4848
4949
5050 @Callable(invoke)
5151 func setConf (key,val) = {
5252 let caller = toString(invoke.caller)
5353 if (containsElement([chris, toString(this)], caller))
5454 then if (contains(key, "conf_"))
5555 then [StringEntry(key, val)]
5656 else throw("Entries starting with conf_ only")
5757 else throw("You are not allowed to change this")
5858 }
5959
6060
6161
6262 @Callable(i)
6363 func swap (assetOut,MinAmountOut) = {
6464 let payment = value(i.payments[0])
6565 let amountIn = value(payment.amount)
66- let assetIdIn = value(payment.assetId)
66+ let assetIdIn = if (isDefined(payment.assetId))
67+ then toBase58String(value(payment.assetId))
68+ else "WAVES"
6769 if ((assetOut != artAssetId_str))
6870 then throw("Asset out not accepted")
6971 else {
70- let amountToSend = get_amount_to_send(amountIn, toBase58String(assetIdIn))
72+ let amountToSend = get_amount_to_send(amountIn, assetIdIn)
7173 [ScriptTransfer(i.caller, amountToSend, fromBase58String(assetOut))]
7274 }
7375 }
7476
7577
7678 @Verifier(tx)
7779 func verify () = sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey)
7880

github/deemru/w8io/169f3d6 
38.03 ms