tx · 6ZZGDGFNQLjXvU6jGVaZjyYx1cWQNoYvkLuftQqZ1awE

3N9b7vExDf2qqZt2xG9FUsca7iwLVuih1Ta:  -0.01000000 Waves

2023.12.01 23:58 [2868089] smart account 3N9b7vExDf2qqZt2xG9FUsca7iwLVuih1Ta > SELF 0.00000000 Waves

{ "type": 13, "id": "6ZZGDGFNQLjXvU6jGVaZjyYx1cWQNoYvkLuftQqZ1awE", "fee": 1000000, "feeAssetId": null, "timestamp": 1701464322692, "version": 2, "chainId": 84, "sender": "3N9b7vExDf2qqZt2xG9FUsca7iwLVuih1Ta", "senderPublicKey": "4rSYGN3SSXzknh6jLyLqqGdGor584DXdjdP2BAbz7kgt", "proofs": [ "4EMnapbG3yo1ZgxqQ1uA1VRvjDv3oe4CtxMPZRPJWYmPKTWP5gWTKn6EAyAwtrJSbKer9KHt46LTBDdWCM4CDLq6" ], "script": "base64:AAIFAAAAAAAAABcIAhIGCgQIAQgBEgYKBAgIAQESAwoBCAAAAAwAAAAACWRldmVsb3BlcgkBAAAAEUBleHRyTmF0aXZlKDEwNjIpAAAAAQIAAAAjM01wNlRUaHZiYjh6OW5wcXo0QUszQnlxQWJ2czdkWVM4dVIBAAAACmtleVBhcnRuZXIAAAABAAAAB2FkZHJlc3MJAAEsAAAAAgIAAAAPJXMlc19fcGFydG5lcl9fBQAAAAdhZGRyZXNzAQAAABBrZXlXYW50ZWRBc3NldElkAAAAAQAAAAdhZGRyZXNzCQABLAAAAAICAAAAFSVzJXNfX3dhbnRlZEFzc2V0SWRfXwUAAAAHYWRkcmVzcwEAAAAPa2V5V2FudGVkQW1vdW50AAAAAQAAAAdhZGRyZXNzCQABLAAAAAICAAAAFCVzJXNfX3dhbnRlZEFtb3VudF9fBQAAAAdhZGRyZXNzAQAAAAprZXlBc3NldElkAAAAAQAAAAdvcmRlcklkCQABLAAAAAICAAAADyVzJXNfX2Fzc2V0SWRfXwUAAAAHb3JkZXJJZAEAAAAJa2V5QW1vdW50AAAAAQAAAAdv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zc2V0SWRTdHIJAARMAAAAAgkBAAAADlNjcmlwdFRyYW5zZmVyAAAAAwUAAAAJZGV2ZWxvcGVyCQEAAAARQGV4dHJOYXRpdmUoMTA1NSkAAAABCQEAAAANa2V5U2VydmljZUZlZQAAAAEFAAAAB29yZGVySWQJAQAAAAdmcm9tU3RyAAAAAQUAAAAKYXNzZXRJZFN0cgkABEwAAAACCQEAAAALRGVsZXRlRW50cnkAAAABCQEAAAANa2V5U2VydmljZUZlZQAAAAEFAAAAB29yZGVySWQJAARMAAAAAgkBAAAAC0RlbGV0ZUVudHJ5AAAAAQkBAAAACWtleUFtb3VudAAAAAEFAAAAB29yZGVySWQJAARMAAAAAgkBAAAAC0RlbGV0ZUVudHJ5AAAAAQkBAAAACmtleU9yZGVySWQAAAABBQAAAAdvcmRlcklkCQAETAAAAAIJAQAAAAtEZWxldGVFbnRyeQAAAAEJAQAAAAprZXlBc3NldElkAAAAAQUAAAAHb3JkZXJJZAUAAAADbmlsAAAAAGWGY3A=", "height": 2868089, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 5DaEjy3hJRafU133FQC5mc8sXmvUqBQuZ2oqJHX6Hc8b Next: J8up4RiDgz5Xik3tYrNmev5JGyhkPZ2FvRDgxsEVjrzV Diff:
OldNewDifferences
6060
6161
6262 @Callable(i)
63+func deal (orderId,address,amount,minAmount) = if (!(isDefined(keyOrderId(orderId))))
64+ then throw(("You don't have an order with this id: " + orderId))
65+ else if ((amount > getIntegerValue(keyAmount(orderId))))
66+ then throw("The transaction cannot be executed because the seller does not have enough funds")
67+ else {
68+ let restAmount = (getIntegerValue(keyAmount(orderId)) - amount)
69+ let assetIdKey = keyAssetId(orderId)
70+ let assetIdRaw = getString(this, assetIdKey)
71+ let assetIdStr = value(assetIdRaw)
72+ if ((minAmount > restAmount))
73+ then [ScriptTransfer(addressFromStringValue(address), amount, fromStr(assetIdStr)), ScriptTransfer(i.caller, restAmount, fromStr(assetIdStr)), ScriptTransfer(developer, getIntegerValue(keyServiceFee(orderId)), fromStr(assetIdStr)), DeleteEntry(keyServiceFee(orderId)), DeleteEntry(keyAmount(orderId)), DeleteEntry(keyOrderId(orderId)), DeleteEntry(keyAssetId(orderId))]
74+ else [ScriptTransfer(addressFromStringValue(address), amount, fromStr(assetIdStr)), DeleteEntry(keyAmount(orderId)), IntegerEntry(keyAmount(orderId), restAmount)]
75+ }
76+
77+
78+
79+@Callable(i)
6380 func cancel (orderId) = if (!(isDefined(keyOrderId(orderId))))
6481 then throw(("You don't have an order with this id: " + orderId))
6582 else {
7188 }
7289
7390
74-
75-@Callable(i)
76-func deal (orderId,address,amount,minAmount) = if (!(isDefined(keyOrderId(orderId))))
77- then throw(("You don't have an order with this id: " + orderId))
78- else if ((amount > toInt(toBytes(value(keyAmount(orderId))))))
79- then throw("The transaction cannot be executed because the seller does not have enough funds")
80- else {
81- let restAmount = (toInt(toBytes(value(keyAmount(orderId)))) - amount)
82- let assetIdKey = keyAssetId(orderId)
83- let assetIdRaw = getString(this, assetIdKey)
84- let assetIdStr = value(assetIdRaw)
85- if ((minAmount > restAmount))
86- then [ScriptTransfer(addressFromStringValue(address), amount, fromStr(assetIdStr)), ScriptTransfer(i.caller, restAmount, fromStr(assetIdStr)), ScriptTransfer(developer, toInt(toBytes(value(keyServiceFee(orderId)))), fromStr(assetIdStr)), DeleteEntry(keyServiceFee(orderId)), DeleteEntry(keyAmount(orderId)), DeleteEntry(keyOrderId(orderId)), DeleteEntry(keyAssetId(orderId))]
87- else [ScriptTransfer(addressFromStringValue(address), amount, fromStr(assetIdStr)), DeleteEntry(keyAmount(orderId)), IntegerEntry(keyAmount(orderId), restAmount)]
88- }
89-
90-
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 5 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 let developer = addressFromStringValue("3Mp6TThvbb8z9npqz4AK3ByqAbvs7dYS8uR")
55
66 func keyPartner (address) = ("%s%s__partner__" + address)
77
88
99 func keyWantedAssetId (address) = ("%s%s__wantedAssetId__" + address)
1010
1111
1212 func keyWantedAmount (address) = ("%s%s__wantedAmount__" + address)
1313
1414
1515 func keyAssetId (orderId) = ("%s%s__assetId__" + orderId)
1616
1717
1818 func keyAmount (orderId) = ("%s%s__amount__" + orderId)
1919
2020
2121 func keyOrderId (orderId) = ("%s%s__orderId__" + orderId)
2222
2323
2424 func keyServiceFee (orderId) = ("%s%s__serviceFee__" + orderId)
2525
2626
2727 func getAmount (amount) = amount
2828
2929
3030 func toStr (assetId) = if ((assetId == unit))
3131 then "WAVES"
3232 else toBase58String(value(assetId))
3333
3434
3535 func fromStr (assetIdStr) = if ((assetIdStr == "WAVES"))
3636 then unit
3737 else fromBase58String(assetIdStr)
3838
3939
4040 func checkAsset (assetId) = {
4141 let asset = fromStr(assetId)
4242 if (if ((asset != unit))
4343 then (assetInfo(value(asset)) == unit)
4444 else false)
4545 then throw("Invalid assetId: assetInfo missing")
4646 else toStr(asset)
4747 }
4848
4949
5050 @Callable(i)
5151 func escrow (orderId,amount,assetId,developerFee) = if (isDefined(getString(this, keyOrderId(orderId))))
5252 then throw(("You already have an order with this id: " + orderId))
5353 else if ((0 >= amount))
5454 then throw("Non-positive order amount")
5555 else {
5656 let orderAmount = (amount - developerFee)
5757 [IntegerEntry(keyServiceFee(orderId), developerFee), IntegerEntry(keyAmount(orderId), orderAmount), StringEntry(keyOrderId(orderId), orderId), StringEntry(keyAssetId(orderId), assetId)]
5858 }
5959
6060
6161
6262 @Callable(i)
63+func deal (orderId,address,amount,minAmount) = if (!(isDefined(keyOrderId(orderId))))
64+ then throw(("You don't have an order with this id: " + orderId))
65+ else if ((amount > getIntegerValue(keyAmount(orderId))))
66+ then throw("The transaction cannot be executed because the seller does not have enough funds")
67+ else {
68+ let restAmount = (getIntegerValue(keyAmount(orderId)) - amount)
69+ let assetIdKey = keyAssetId(orderId)
70+ let assetIdRaw = getString(this, assetIdKey)
71+ let assetIdStr = value(assetIdRaw)
72+ if ((minAmount > restAmount))
73+ then [ScriptTransfer(addressFromStringValue(address), amount, fromStr(assetIdStr)), ScriptTransfer(i.caller, restAmount, fromStr(assetIdStr)), ScriptTransfer(developer, getIntegerValue(keyServiceFee(orderId)), fromStr(assetIdStr)), DeleteEntry(keyServiceFee(orderId)), DeleteEntry(keyAmount(orderId)), DeleteEntry(keyOrderId(orderId)), DeleteEntry(keyAssetId(orderId))]
74+ else [ScriptTransfer(addressFromStringValue(address), amount, fromStr(assetIdStr)), DeleteEntry(keyAmount(orderId)), IntegerEntry(keyAmount(orderId), restAmount)]
75+ }
76+
77+
78+
79+@Callable(i)
6380 func cancel (orderId) = if (!(isDefined(keyOrderId(orderId))))
6481 then throw(("You don't have an order with this id: " + orderId))
6582 else {
6683 let restAmount = getIntegerValue(keyAmount(orderId))
6784 let assetIdKey = keyAssetId(orderId)
6885 let assetIdRaw = getString(this, assetIdKey)
6986 let assetIdStr = value(assetIdRaw)
7087 [ScriptTransfer(i.caller, restAmount, fromStr(assetIdStr)), ScriptTransfer(developer, getIntegerValue(keyServiceFee(orderId)), fromStr(assetIdStr)), DeleteEntry(keyServiceFee(orderId)), DeleteEntry(keyAmount(orderId)), DeleteEntry(keyOrderId(orderId)), DeleteEntry(keyAssetId(orderId))]
7188 }
7289
7390
74-
75-@Callable(i)
76-func deal (orderId,address,amount,minAmount) = if (!(isDefined(keyOrderId(orderId))))
77- then throw(("You don't have an order with this id: " + orderId))
78- else if ((amount > toInt(toBytes(value(keyAmount(orderId))))))
79- then throw("The transaction cannot be executed because the seller does not have enough funds")
80- else {
81- let restAmount = (toInt(toBytes(value(keyAmount(orderId)))) - amount)
82- let assetIdKey = keyAssetId(orderId)
83- let assetIdRaw = getString(this, assetIdKey)
84- let assetIdStr = value(assetIdRaw)
85- if ((minAmount > restAmount))
86- then [ScriptTransfer(addressFromStringValue(address), amount, fromStr(assetIdStr)), ScriptTransfer(i.caller, restAmount, fromStr(assetIdStr)), ScriptTransfer(developer, toInt(toBytes(value(keyServiceFee(orderId)))), fromStr(assetIdStr)), DeleteEntry(keyServiceFee(orderId)), DeleteEntry(keyAmount(orderId)), DeleteEntry(keyOrderId(orderId)), DeleteEntry(keyAssetId(orderId))]
87- else [ScriptTransfer(addressFromStringValue(address), amount, fromStr(assetIdStr)), DeleteEntry(keyAmount(orderId)), IntegerEntry(keyAmount(orderId), restAmount)]
88- }
89-
90-

github/deemru/w8io/026f985 
24.47 ms