tx · BwE16QDFubJDYmNhmWhHByY3ywxGN7wyXpWWXn1TkfcX

3N2icgpJnXhcYab7KQrwqWsV4LwSF25C1Ep:  -0.01400000 Waves

2019.07.12 13:39 [582402] smart account 3N2icgpJnXhcYab7KQrwqWsV4LwSF25C1Ep > SELF 0.00000000 Waves

{ "type": 13, "id": "BwE16QDFubJDYmNhmWhHByY3ywxGN7wyXpWWXn1TkfcX", "fee": 1400000, "feeAssetId": null, "timestamp": 1562927982863, "version": 1, "sender": "3N2icgpJnXhcYab7KQrwqWsV4LwSF25C1Ep", "senderPublicKey": "BJAeTqNbDSA5FiYihZZaSWvD6XL5XjpqVXbTGerBJjRK", "proofs": [ "4D2MdndQf6BqohLBvnvoLhMtPf6cH8TpbNE23mE27zairrQtdfwaPCXU79nwxFxsu7HALeZH18BieZWZM4xVm3sm" ], "script": "base64:AAIDAAAAAAAAAAAAAAADAAAAAAp0b2tlbklkRGVmAQAAACCU1B7l35UfeySUCJ5Oe8nTMKHr4huFqp+vPk8CQCqTZQEAAAASdXNlckhhc0FkbWluQWNjZXNzAAAAAQAAAAdhZGRyZXNzCQAAAAAAAAIFAAAAB2FkZHJlc3MFAAAABHRoaXMBAAAABGFkZHIAAAACAAAAB3Rva2VuSWQAAAADcGFyCQABLAAAAAIJAAEsAAAAAgkAAlgAAAABBQAAAAd0b2tlbklkAgAAAAFfBQAAAANwYXIAAAADAAAAAWkBAAAAA2JldAAAAAEAAAANdG9rZW5JZFN0cmluZwQAAAAHdG9rZW5JZAkAAZsAAAABBQAAAA10b2tlbklkU3RyaW5nCQAAAgAAAAEJAAJYAAAAAQUAAAAHdG9rZW5JZAAAAAFpAQAAAAVzdGFydAAAAAIAAAAKc3RhcnRQcmljZQAAAA9hdWN0aW9uRHVyYXRpb24EAAAAA3BtdAkBAAAAB2V4dHJhY3QAAAABCAUAAAABaQAAAAdwYXltZW50BAAAAAd0b2tlbklkCQEAAAAHZXh0cmFjdAAAAAEIBQAAAANwbXQAAAAHYXNzZXRJZ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hAgAAABIgbWludXRlcyByZW1haW5pbmcEAAAAC21heEJldE93bmVyCQEAAAAUYWRkcmVzc0Zyb21QdWJsaWNLZXkAAAABCQABmwAAAAEJAQAAABFAZXh0ck5hdGl2ZSgxMDUzKQAAAAIFAAAABHRoaXMJAQAAAARhZGRyAAAAAgUAAAAHdG9rZW5JZAIAAAALbWF4QmV0T3duZXIJAQAAAAxTY3JpcHRSZXN1bHQAAAACCQEAAAAIV3JpdGVTZXQAAAABCQAETAAAAAIJAQAAAAlEYXRhRW50cnkAAAACCQEAAAAEYWRkcgAAAAIFAAAAB3Rva2VuSWQCAAAABXN0YXJ0AAAAAAAAAAAABQAAAANuaWwJAQAAAAtUcmFuc2ZlclNldAAAAAEJAARMAAAAAgkBAAAADlNjcmlwdFRyYW5zZmVyAAAAAwUAAAALbWF4QmV0T3duZXIAAAAAAAAAAAEFAAAAB3Rva2VuSWQFAAAAA25pbAAAAAB64+2I", "chainId": 84, "height": 582402, "spentComplexity": 0 } View: original | compacted Prev: 38MWWQv1Ebp7yD5uKJecxBb7w73wuqnGpMrX6ZNVJeLV Next: 6GuwfUiDWFgUSiNJmohG8oD4NqnT4CqYxMoac4nv5Zcf Diff:
OldNewDifferences
1212 @Callable(i)
1313 func bet (tokenIdString) = {
1414 let tokenId = toBytes(tokenIdString)
15- let startTransactionHeight = getIntegerValue(this, addr(tokenId, "start"))
16- let timeDelta = (height - startTransactionHeight)
17- let maxBet = extract(getInteger(this, addr(tokenId, "maxBet")))
18- let maxBetOwner = addressFromPublicKey(toBytes(getStringValue(this, addr(tokenId, "maxBetOwner"))))
19- let pmt = extract(i.payment)
20- if ((timeDelta > 20000))
21- then throw("The betting was closed")
22- else if (!(isDefined(pmt.assetId)))
23- then {
24- let price = pmt.amount
25- if ((price > maxBet))
26- then ScriptResult(WriteSet([DataEntry(addr(tokenId, "maxBet"), price), DataEntry(addr(tokenId, "maxBetOwner"), toBase58String(i.callerPublicKey))]), TransferSet([ScriptTransfer(maxBetOwner, maxBet, unit)]))
27- else throw("Your bet isn't the max bet")
28- }
29- else throw("You need to place a bet using waves currency")
15+ throw(toBase58String(tokenId))
3016 }
3117
3218
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 3 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 let tokenIdDef = base58'B1xwWnBLB7z79VPr4sq1jBb5GDqs8TeT5jHojTdiwxfE'
55
66 func userHasAdminAccess (address) = (address == this)
77
88
99 func addr (tokenId,par) = ((toBase58String(tokenId) + "_") + par)
1010
1111
1212 @Callable(i)
1313 func bet (tokenIdString) = {
1414 let tokenId = toBytes(tokenIdString)
15- let startTransactionHeight = getIntegerValue(this, addr(tokenId, "start"))
16- let timeDelta = (height - startTransactionHeight)
17- let maxBet = extract(getInteger(this, addr(tokenId, "maxBet")))
18- let maxBetOwner = addressFromPublicKey(toBytes(getStringValue(this, addr(tokenId, "maxBetOwner"))))
19- let pmt = extract(i.payment)
20- if ((timeDelta > 20000))
21- then throw("The betting was closed")
22- else if (!(isDefined(pmt.assetId)))
23- then {
24- let price = pmt.amount
25- if ((price > maxBet))
26- then ScriptResult(WriteSet([DataEntry(addr(tokenId, "maxBet"), price), DataEntry(addr(tokenId, "maxBetOwner"), toBase58String(i.callerPublicKey))]), TransferSet([ScriptTransfer(maxBetOwner, maxBet, unit)]))
27- else throw("Your bet isn't the max bet")
28- }
29- else throw("You need to place a bet using waves currency")
15+ throw(toBase58String(tokenId))
3016 }
3117
3218
3319
3420 @Callable(i)
3521 func start (startPrice,auctionDuration) = {
3622 let pmt = extract(i.payment)
3723 let tokenId = extract(pmt.assetId)
3824 if (isDefined(tokenId))
3925 then WriteSet([DataEntry(addr(tokenId, "start"), height), DataEntry(addr(tokenId, "startPrice"), startPrice), DataEntry(addr(tokenId, "duration"), auctionDuration), DataEntry(addr(tokenId, "maxBetOwner"), toBase58String(i.callerPublicKey))])
4026 else throw("You can't sell waves using the auction")
4127 }
4228
4329
4430
4531 @Callable(i)
4632 func finish (tokenId) = {
4733 let length = (getIntegerValue(this, addr(tokenId, "start")) - height)
4834 let delta = (getIntegerValue(this, addr(tokenId, "duration")) - length)
4935 if ((delta > 0))
5036 then throw((("The auction cannot be finished yet! " + toString(delta)) + " minutes remaining"))
5137 else {
5238 let maxBetOwner = addressFromPublicKey(toBytes(getStringValue(this, addr(tokenId, "maxBetOwner"))))
5339 ScriptResult(WriteSet([DataEntry(addr(tokenId, "start"), 0)]), TransferSet([ScriptTransfer(maxBetOwner, 1, tokenId)]))
5440 }
5541 }
5642
5743

github/deemru/w8io/169f3d6 
88.26 ms