tx · 4WqTPsAurkDKw5Pw24HKqiqe5NAqsYYxzrQYnp7YWWFq

3N72SETEKtTuaA3YNVYWgVEmXKrRrZYXHGo:  -0.01000000 Waves

2022.12.02 12:16 [2342534] smart account 3N72SETEKtTuaA3YNVYWgVEmXKrRrZYXHGo > SELF 0.00000000 Waves

{ "type": 13, "id": "4WqTPsAurkDKw5Pw24HKqiqe5NAqsYYxzrQYnp7YWWFq", "fee": 1000000, "feeAssetId": null, "timestamp": 1669972582758, "version": 2, "chainId": 84, "sender": "3N72SETEKtTuaA3YNVYWgVEmXKrRrZYXHGo", "senderPublicKey": "Kwu4LYBMntApXv8t7csxV23Kvc3tvak26wMKK56tA4V", "proofs": [ "AYsewqp78B66LqbKJU6qLkrjhjyEpZGXGdS5ER69XGSrEmYKLJQsvJaEyxRqvSxnPhM1SN8qWcDLtXqDSmRDgDu" ], "script": "base64:BgIHCAISAwoBCAABAWkBA2JpZAEJYXVjdGlvbklkBANwbXQJAQV2YWx1ZQEJAJEDAggFAWkIcGF5bWVudHMAAAQNcG10QXNzZXRJZFN0cgMJAQlpc0RlZmluZWQBCAUDcG10B2Fzc2V0SWQJANgEAQkBBXZhbHVlAQgFA3BtdAdhc3NldElkAgVXQVZFUwQQY2FsbGVyQWRkcmVzc1N0cgkA2AQBCAgFAWkGY2FsbGVyBWJ5dGVzBAllbmRIZWlnaHQJARFAZXh0ck5hdGl2ZSgxMDUwKQIFBHRoaXMFCWF1Y3Rpb25JZAQKc3RhcnRQcmljZQkBEUBleHRyTmF0aXZlKDEwNTApAgUEdGhpcwkArAICBQlhdWN0aW9uSWQCC19zdGFydFByaWNlBAxwcmljZUFzc2V0SWQJARFAZXh0ck5hdGl2ZSgxMDUzKQIFBHRoaXMJAKwCAgUJYXVjdGlvbklkAg1fcHJpY2VBc3NldElkBAl3aW5BbW91bnQJAJoIAgUEdGhpcwkArAICBQlhdWN0aW9uSWQCCl93aW5BbW91bnQEBndpbm5lcgkAnQgCBQR0aGlzCQCsAgIFCW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5uZXIECnByaWNlQXNzZXQDAwkAAAIFDHByaWNlQXNzZXRJZAIFV0FWRVMGCQAAAgUMcHJpY2VBc3NldElkAgAFBHVuaXQJANkEAQUMcHJpY2VBc3NldElkCQDMCAIJAQtTdHJpbmdFbnRyeQIJAKwCAgUJYXVjdGlvbklkAgdfd2lubmVyBRBjYWxsZXJBZGRyZXNzU3RyCQDMCAIJAQxJbnRlZ2VyRW50cnkCCQCsAgIFCWF1Y3Rpb25JZAIKX3dpbkFtb3VudAUOdG90YWxCaWRBbW91bnQJAMwIAgkBDlNjcmlwdFRyYW5zZmVyAwUScHJldmlvdXNCaWRkZXJBZGRyCQEFdmFsdWUBBQl3aW5BbW91bnQFCnByaWNlQXNzZXQFA25pbAAfrYLF", "height": 2342534, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: J7GbVs4iwNig74pvzgHJemegPjyxxHpEMzUyaeT7Joz8 Next: 7At5dpMZZ2gyjnm6wrSaFSGoMBVj4pBV1azMnTVPAwZd Full:
OldNewDifferences
11 {-# STDLIB_VERSION 6 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44
55
66 @Callable(i)
77 func bid (auctionId) = {
88 let pmt = value(i.payments[0])
99 let pmtAssetIdStr = if (isDefined(pmt.assetId))
1010 then toBase58String(value(pmt.assetId))
1111 else "WAVES"
1212 let callerAddressStr = toBase58String(i.caller.bytes)
1313 let endHeight = getIntegerValue(this, auctionId)
1414 let startPrice = getIntegerValue(this, (auctionId + "_startPrice"))
1515 let priceAssetId = getStringValue(this, (auctionId + "_priceAssetId"))
1616 let winAmount = getInteger(this, (auctionId + "_winAmount"))
1717 let winner = getString(this, (auctionId + "_winner"))
1818 let bidFromTheSameUser = if (isDefined(winner))
1919 then (value(winner) == callerAddressStr)
2020 else false
2121 let totalBidAmount = (pmt.amount + (if (bidFromTheSameUser)
2222 then value(winAmount)
2323 else 0))
2424 if ((lastBlock.height >= endHeight))
2525 then throw("Auction already finished")
2626 else if ((priceAssetId != pmtAssetIdStr))
2727 then throw((("Bid must be in asset '" + priceAssetId) + "'"))
2828 else if (if (if (isDefined(winAmount))
2929 then (value(winAmount) >= totalBidAmount)
3030 else false)
3131 then true
3232 else if (!(isDefined(winAmount)))
3333 then (startPrice >= totalBidAmount)
3434 else false)
3535 then throw(("Bid must be more then " + toString(if (isDefined(winAmount))
3636 then value(winAmount)
3737 else startPrice)))
3838 else if (if (bidFromTheSameUser)
3939 then true
4040 else !(isDefined(winner)))
4141 then [StringEntry((auctionId + "_winner"), callerAddressStr), IntegerEntry((auctionId + "_winAmount"), totalBidAmount)]
4242 else {
4343 let previousBidderAddr = addressFromStringValue(value(winner))
4444 let priceAsset = if (if ((priceAssetId == "WAVES"))
4545 then true
4646 else (priceAssetId == ""))
4747 then unit
4848 else fromBase58String(priceAssetId)
4949 [StringEntry((auctionId + "_winner"), callerAddressStr), IntegerEntry((auctionId + "_winAmount"), totalBidAmount), ScriptTransfer(previousBidderAddr, value(winAmount), priceAsset)]
5050 }
5151 }
5252
5353

github/deemru/w8io/026f985 
25.96 ms