tx · FPdSHACnmvFrceHWK4MwA134reFCw23M7Q4jWG3wA5y4

3N2icgpJnXhcYab7KQrwqWsV4LwSF25C1Ep:  -0.01400000 Waves

2019.07.12 14:35 [582455] smart account 3N2icgpJnXhcYab7KQrwqWsV4LwSF25C1Ep > SELF 0.00000000 Waves

{ "type": 13, "id": "FPdSHACnmvFrceHWK4MwA134reFCw23M7Q4jWG3wA5y4", "fee": 1400000, "feeAssetId": null, "timestamp": 1562931382175, "version": 1, "sender": "3N2icgpJnXhcYab7KQrwqWsV4LwSF25C1Ep", "senderPublicKey": "BJAeTqNbDSA5FiYihZZaSWvD6XL5XjpqVXbTGerBJjRK", "proofs": [ "66KMg9FUDcTGypQqWE6ristLBkB7NVEsTGwpQEquNm8L1m3ybixo73dUeRQkJxJRQPEg6pVndbNebqsXsXyAbqws" ], "script": "base64:AAIDAAAAAAAAAAAAAAAEAAAAAAp0b2tlbklkRGVmAQAAACCU1B7l35UfeySUCJ5Oe8nTMKHr4huFqp+vPk8CQCqTZQEAAAASdXNlckhhc0FkbWluQWNjZXNzAAAAAQAAAAdhZGRyZXNzCQAAAAAAAAIFAAAAB2FkZHJlc3MFAAAABHRoaXMBAAAABGFkZHIAAAACAAAAB3Rva2VuSWQAAAADcGFyCQABLAAAAAIJAAEsAAAAAgkAAlgAAAABBQAAAAd0b2tlbklkAgAAAAFfBQAAAANwYXIBAAAABXNhZGRyAAAAAgAAAAd0b2tlbklkAAAAA3BhcgkAASwAAAACCQABLAAAAAIFAAAAB3Rva2VuSWQCAAAAAV8FAAAAA3BhcgAAAAMAAAABaQEAAAADYmV0AAAAAQAAAA10b2tlbklkU3RyaW5nBAAAABZzdGFydFRyYW5zYWN0aW9uSGVpZ2h0CQEAAAARQGV4dHJOYXRpdmUoMTA1MCkAAAACBQAAAAR0aGlzCQEAAAAFc2FkZHIAAAACBQAAAA10b2tlbklkU3RyaW5nAgAAAAVzdGFydAQAAAAJdGltZURlbHRhCQAAZQAAAAIFAAAABmhlaWdodAUA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AkAAGUAAAACCQEAAAARQGV4dHJOYXRpdmUoMTA1MCkAAAACBQAAAAR0aGlzCQEAAAAEYWRkcgAAAAIFAAAAB3Rva2VuSWQCAAAABXN0YXJ0BQAAAAZoZWlnaHQEAAAABWRlbHRhCQAAZQAAAAIJAQAAABFAZXh0ck5hdGl2ZSgxMDUwKQAAAAIFAAAABHRoaXMJAQAAAARhZGRyAAAAAgUAAAAHdG9rZW5JZAIAAAAIZHVyYXRpb24FAAAABmxlbmd0aAMJAABmAAAAAgUAAAAFZGVsdGEAAAAAAAAAAAAJAAACAAAAAQkAASwAAAACCQABLAAAAAICAAAAJFRoZSBhdWN0aW9uIGNhbm5vdCBiZSBmaW5pc2hlZCB5ZXQhIAkAAaQAAAABBQAAAAVkZWx0YQIAAAASIG1pbnV0ZXMgcmVtYWluaW5nBAAAAAttYXhCZXRPd25lcgkBAAAAFGFkZHJlc3NGcm9tUHVibGljS2V5AAAAAQkAAZsAAAABCQEAAAARQGV4dHJOYXRpdmUoMTA1MykAAAACBQAAAAR0aGlzCQEAAAAEYWRkcgAAAAIFAAAAB3Rva2VuSWQCAAAAC21heEJldE93bmVyCQEAAAAMU2NyaXB0UmVzdWx0AAAAAgkBAAAACFdyaXRlU2V0AAAAAQkABEwAAAACCQEAAAAJRGF0YUVudHJ5AAAAAgkBAAAABGFkZHIAAAACBQAAAAd0b2tlbklkAgAAAAVzdGFydAAAAAAAAAAAAAUAAAADbmlsCQEAAAALVHJhbnNmZXJTZXQAAAABCQAETAAAAAIJAQAAAA5TY3JpcHRUcmFuc2ZlcgAAAAMFAAAAC21heEJldE93bmVyAAAAAAAAAAABBQAAAAd0b2tlbklkBQAAAANuaWwAAAAA+pgFBw==", "chainId": 84, "height": 582455, "spentComplexity": 0 } View: original | compacted Prev: BcmZe2czpqBZ6Um7HgP7gfFwudjFW1i9nXV2za8jkGj2 Next: 3z34gKQJvBZfiEAnkhoDpWVvYEitt9w7TZkg4bcvap29 Diff:
OldNewDifferences
1919 let maxBet = getIntegerValue(this, saddr(tokenIdString, "maxBet"))
2020 let maxBetOwner = addressFromPublicKey(toBytes(getStringValue(this, saddr(tokenIdString, "maxBetOwner"))))
2121 let pmt = extract(i.payment)
22- if ((timeDelta > getIntegerValue(this, saddr(tokenIdString, "startTime"))))
22+ if ((timeDelta > getIntegerValue(this, saddr(tokenIdString, "duration"))))
2323 then throw("The betting was closed.")
2424 else if (!(isDefined(pmt.assetId)))
2525 then {
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 func saddr (tokenId,par) = ((tokenId + "_") + par)
1313
1414
1515 @Callable(i)
1616 func bet (tokenIdString) = {
1717 let startTransactionHeight = getIntegerValue(this, saddr(tokenIdString, "start"))
1818 let timeDelta = (height - startTransactionHeight)
1919 let maxBet = getIntegerValue(this, saddr(tokenIdString, "maxBet"))
2020 let maxBetOwner = addressFromPublicKey(toBytes(getStringValue(this, saddr(tokenIdString, "maxBetOwner"))))
2121 let pmt = extract(i.payment)
22- if ((timeDelta > getIntegerValue(this, saddr(tokenIdString, "startTime"))))
22+ if ((timeDelta > getIntegerValue(this, saddr(tokenIdString, "duration"))))
2323 then throw("The betting was closed.")
2424 else if (!(isDefined(pmt.assetId)))
2525 then {
2626 let price = pmt.amount
2727 if ((price > maxBet))
2828 then ScriptResult(WriteSet([DataEntry(saddr(tokenIdString, "maxBet"), price), DataEntry(saddr(tokenIdString, "maxBetOwner"), toBase58String(i.callerPublicKey))]), TransferSet([ScriptTransfer(maxBetOwner, maxBet, unit)]))
2929 else throw("Your bet isn't the max bet")
3030 }
3131 else throw("You need to place a bet using waves currency")
3232 }
3333
3434
3535
3636 @Callable(i)
3737 func start (startPrice,auctionDuration) = {
3838 let pmt = extract(i.payment)
3939 let tokenId = extract(pmt.assetId)
4040 if (isDefined(tokenId))
4141 then WriteSet([DataEntry(addr(tokenId, "start"), height), DataEntry(addr(tokenId, "maxBet"), startPrice), DataEntry(addr(tokenId, "duration"), auctionDuration), DataEntry(addr(tokenId, "maxBetOwner"), toBase58String(i.callerPublicKey))])
4242 else throw("You can't sell waves using the auction")
4343 }
4444
4545
4646
4747 @Callable(i)
4848 func finish (tokenId) = {
4949 let length = (getIntegerValue(this, addr(tokenId, "start")) - height)
5050 let delta = (getIntegerValue(this, addr(tokenId, "duration")) - length)
5151 if ((delta > 0))
5252 then throw((("The auction cannot be finished yet! " + toString(delta)) + " minutes remaining"))
5353 else {
5454 let maxBetOwner = addressFromPublicKey(toBytes(getStringValue(this, addr(tokenId, "maxBetOwner"))))
5555 ScriptResult(WriteSet([DataEntry(addr(tokenId, "start"), 0)]), TransferSet([ScriptTransfer(maxBetOwner, 1, tokenId)]))
5656 }
5757 }
5858
5959

github/deemru/w8io/026f985 
23.03 ms