tx · DNxHiAZgWnPShf9HxWVb42v4JxTTk2kjD4Rx7R9zHc32

3N2icgpJnXhcYab7KQrwqWsV4LwSF25C1Ep:  -0.01400000 Waves

2019.07.12 13:20 [582379] smart account 3N2icgpJnXhcYab7KQrwqWsV4LwSF25C1Ep > SELF 0.00000000 Waves

{ "type": 13, "id": "DNxHiAZgWnPShf9HxWVb42v4JxTTk2kjD4Rx7R9zHc32", "fee": 1400000, "feeAssetId": null, "timestamp": 1562926864923, "version": 1, "sender": "3N2icgpJnXhcYab7KQrwqWsV4LwSF25C1Ep", "senderPublicKey": "BJAeTqNbDSA5FiYihZZaSWvD6XL5XjpqVXbTGerBJjRK", "proofs": [ "2FX4LsvPGweQgDkYQxfwcn9hzT9t7zxFz7McrPJUFNgy7RgG6yfuwM9zJeM1WbbPWVsNwz8JrmSz3yh56i1L9dw7" ], "script": "base64:AAIDAAAAAAAAAAAAAAADAAAAAAd0b2tlbklkAQAAACCU1B7l35UfeySUCJ5Oe8nTMKHr4huFqp+vPk8CQCqTZQEAAAASdXNlckhhc0FkbWluQWNjZXNzAAAAAQAAAAdhZGRyZXNzCQAAAAAAAAIFAAAAB2FkZHJlc3MFAAAABHRoaXMBAAAABGFkZHIAAAACAAAAB3Rva2VuSWQAAAADcGFyCQABLAAAAAIJAAEsAAAAAgkAAlgAAAABBQAAAAd0b2tlbklkAgAAAAFfBQAAAANwYXIAAAADAAAAAWkBAAAAA2JldAAAAAEAAAAHdG9rZW5JZAQAAAAWc3RhcnRUcmFuc2FjdGlvbkhlaWdodAkBAAAAEUBleHRyTmF0aXZlKDEwNTApAAAAAgUAAAAEdGhpcwkBAAAABGFkZHIAAAACBQAAAAd0b2tlbklkAgAAAAVzdGFydAQAAAAJdGltZURlbHRhCQAAZQAAAAIFAAAABmhlaWdodAUAAAAWc3RhcnRUcmFuc2FjdGlvbkhlaWdodAQAAAAGbWF4QmV0CQEAAAAHZXh0cmFjdAAAAAEJAAQaAAAAAgUAAAAEdGhpcwkBAAAABGF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V0AAAAAQkABEwAAAACCQEAAAAOU2NyaXB0VHJhbnNmZXIAAAADBQAAAAttYXhCZXRPd25lcgAAAAAAAAAAAQUAAAAHdG9rZW5JZAUAAAADbmlsAAAAAAmphU4=", "chainId": 84, "height": 582379, "spentComplexity": 0 } View: original | compacted Prev: 2hkt5YDQnm7DjKPLBFCJFf2CARsRuki8zYJVXrdYFDEi Next: HLtoeCh1a4TuNJK3rBivPnFQXp2crYMube1Em5z4g2WY Diff:
OldNewDifferences
1616 let maxBet = extract(getInteger(this, addr(tokenId, "maxBet")))
1717 let maxBetOwner = addressFromPublicKey(toBytes(getStringValue(this, addr(tokenId, "maxBetOwner"))))
1818 let pmt = extract(i.payment)
19- throw("ok2")
19+ if ((timeDelta > 2000))
20+ then throw("The betting was closed")
21+ else if (!(isDefined(pmt.assetId)))
22+ then throw("ok3")
23+ else throw("You need to place a bet using waves currency")
2024 }
2125
2226
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 3 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 let tokenId = 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 (tokenId) = {
1414 let startTransactionHeight = getIntegerValue(this, addr(tokenId, "start"))
1515 let timeDelta = (height - startTransactionHeight)
1616 let maxBet = extract(getInteger(this, addr(tokenId, "maxBet")))
1717 let maxBetOwner = addressFromPublicKey(toBytes(getStringValue(this, addr(tokenId, "maxBetOwner"))))
1818 let pmt = extract(i.payment)
19- throw("ok2")
19+ if ((timeDelta > 2000))
20+ then throw("The betting was closed")
21+ else if (!(isDefined(pmt.assetId)))
22+ then throw("ok3")
23+ else throw("You need to place a bet using waves currency")
2024 }
2125
2226
2327
2428 @Callable(i)
2529 func start (startPrice,auctionDuration) = {
2630 let pmt = extract(i.payment)
2731 let tokenIn = pmt.assetId
2832 if (isDefined(tokenId))
2933 then WriteSet([DataEntry(addr(tokenId, "start"), height), DataEntry(addr(tokenId, "startPrice"), startPrice), DataEntry(addr(tokenId, "duration"), auctionDuration), DataEntry(addr(tokenId, "maxBetOwner"), toBase58String(i.callerPublicKey))])
3034 else throw("You can't sell waves using the auction")
3135 }
3236
3337
3438
3539 @Callable(i)
3640 func finish (tokenId) = {
3741 let length = (getIntegerValue(this, addr(tokenId, "start")) - height)
3842 let delta = (getIntegerValue(this, addr(tokenId, "duration")) - length)
3943 if ((delta > 0))
4044 then throw((("The auction cannot be finished yet! " + toString(delta)) + " minutes remaining"))
4145 else {
4246 let maxBetOwner = addressFromPublicKey(toBytes(getStringValue(this, addr(tokenId, "maxBetOwner"))))
4347 ScriptResult(WriteSet([DataEntry(addr(tokenId, "start"), 0)]), TransferSet([ScriptTransfer(maxBetOwner, 1, tokenId)]))
4448 }
4549 }
4650
4751

github/deemru/w8io/169f3d6 
37.82 ms