tx · Bncev1n8cEdz9ABj8oaz8ihrtpJFNuCrfocwgo4n98Go

3N6s7QBCvgnCNbR7r4rajA9DsejGtshaLLa:  -0.01500000 Waves

2019.12.20 18:57 [817485] smart account 3N6s7QBCvgnCNbR7r4rajA9DsejGtshaLLa > SELF 0.00000000 Waves

{ "type": 13, "id": "Bncev1n8cEdz9ABj8oaz8ihrtpJFNuCrfocwgo4n98Go", "fee": 1500000, "feeAssetId": null, "timestamp": 1576857192154, "version": 1, "sender": "3N6s7QBCvgnCNbR7r4rajA9DsejGtshaLLa", "senderPublicKey": "5wpzgifs7AQAB2xctYK9m7gDenQv4yCCiLcTgKQTcz9Z", "proofs": [ "3s1vP4dccQ8sGZNJ67zMYfCqLjeBVsT1Z332TQpQGiHVb5JEtdHbACNk9xHAyvjYcmF6qezCsbF9iH5AFiQwanES" ], "script": "base64:AAIDAAAAAAAAABcIARIECgIBARIDCgEIEgMKAQgSAwoBCAAAAAEAAAAAD2F1Y3Rpb25EdXJhdGlvbgkAAGgAAAACAAAAAAAAAAWgAAAAAAAAAAABAAAABAAAAAFpAQAAAAxiZWdpbkF1Y3Rpb24AAAACAAAACG1pblByaWNlAAAACGR1cmF0aW9uAwkAAGYAAAACBQAAAAhkdXJhdGlvbgUAAAAPYXVjdGlvbkR1cmF0aW9uCQAAAgAAAAEJAAEsAAAAAgkAASwAAAACCQABLAAAAAIJAAEsAAAAAgIAAAATU3BlY2lmaWVkIGR1cmF0aW9uKAkAAaQAAAABBQAAAAhkdXJhdGlvbgIAAAAfKSBleGNlZWRzIHRoZSBtYXhpbXVtIGR1cmF0aW9uKAkAAaQAAAABBQAAAA9hdWN0aW9uRHVyYXRpb24CAAAAASkEAAAACWF1Y3Rpb25JZAkAAlgAAAABCAUAAAABaQAAAA10cmFuc2FjdGlvbklkBAAAAAdlbmRUaW1lCQAAZAAAAAIIBQAAAAlsYXN0QmxvY2sAAAAGaGVpZ2h0BQAAAAhkdXJhdGlvbgQAAAADcG10CQEAAAAHZXh0c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GEyDNbHyhd6K4 Diff:
OldNewDifferences
101101 else if ((endTime > lastBlock.height))
102102 then throw("Auction is not finished yet")
103103 else if (isDefined(getBoolean(this, (auctionId + "_winnerWithdrawStatus"))))
104- then throw("The bid amount is already transfered")
104+ then throw("The item already transfered")
105105 else ScriptResult(WriteSet([DataEntry((auctionId + "_winnerWithdrawStatus"), true)]), TransferSet([ScriptTransfer(highestBidderAddr, 1, itemAddr)]))
106106 }
107107
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 3 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 let auctionDuration = (1440 * 1)
55
66 @Callable(i)
77 func beginAuction (minPrice,duration) = if ((duration > auctionDuration))
88 then throw((((("Specified duration(" + toString(duration)) + ") exceeds the maximum duration(") + toString(auctionDuration)) + ")"))
99 else {
1010 let auctionId = toBase58String(i.transactionId)
1111 let endTime = (lastBlock.height + duration)
1212 let pmt = extract(i.payment)
1313 WriteSet([DataEntry(auctionId, auctionId), DataEntry((auctionId + "_endTime"), endTime), DataEntry((auctionId + "_owner"), toBase58String(i.caller.bytes)), DataEntry((auctionId + "_itemId"), if (isDefined(pmt.assetId))
1414 then toBase58String(value(pmt.assetId))
1515 else throw("Item not atached")), DataEntry((auctionId + "_minPrice"), minPrice)])
1616 }
1717
1818
1919
2020 @Callable(i)
2121 func bid (auctionId) = {
2222 let pmt = extract(i.payment)
2323 let callerAddress = toBase58String(i.caller.bytes)
2424 let endTime = getIntegerValue(this, (auctionId + "_endTime"))
2525 let minPrice = getIntegerValue(this, (auctionId + "_minPrice"))
2626 let highestBidAmt = getInteger(this, (auctionId + "_highestBidAmt"))
2727 let highestBidder = getString(this, (auctionId + "_highestBidder"))
2828 let bidFromTheSameUser = if (isDefined(highestBidder))
2929 then (value(highestBidder) == callerAddress)
3030 else false
3131 let totalBidAmount = (pmt.amount + (if (bidFromTheSameUser)
3232 then value(highestBidAmt)
3333 else 0))
3434 if (!(isDefined(getString(this, auctionId))))
3535 then throw("Auction Id not found")
3636 else if ((lastBlock.height >= endTime))
3737 then throw("Auction Completed")
3838 else if (if (if (!(isDefined(highestBidAmt)))
3939 then (minPrice >= totalBidAmount)
4040 else false)
4141 then true
4242 else if (isDefined(highestBidAmt))
4343 then (value(highestBidAmt) >= totalBidAmount)
4444 else false)
4545 then throw(("Bid must be more then " + (if (!(isDefined(highestBidAmt)))
4646 then toString(minPrice)
4747 else toString(value(highestBidAmt)))))
4848 else if (!(isDefined(highestBidder)))
4949 then WriteSet([DataEntry((auctionId + "_highestBidder"), callerAddress), DataEntry((auctionId + "_highestBidAmt"), totalBidAmount)])
5050 else if (bidFromTheSameUser)
5151 then WriteSet([DataEntry((auctionId + "_highestBidAmt"), totalBidAmount)])
5252 else {
5353 let previousBidder = addressFromStringValue(value(highestBidder))
5454 ScriptResult(WriteSet([DataEntry((auctionId + "_highestBidder"), callerAddress), DataEntry((auctionId + "_highestBidAmt"), totalBidAmount)]), TransferSet([ScriptTransfer(previousBidder, value(highestBidAmt), unit)]))
5555 }
5656 }
5757
5858
5959
6060 @Callable(i)
6161 func ownerWithdraw (auctionId) = {
6262 let callerAddress = toBase58String(i.caller.bytes)
6363 let endTime = getIntegerValue(this, (auctionId + "_endTime"))
6464 let owner = getStringValue(this, (auctionId + "_owner"))
6565 let highestBidder = getString(this, (auctionId + "_highestBidder"))
6666 let itemId = getStringValue(this, (auctionId + "_itemId"))
6767 let highestBidAmt = getIntegerValue(this, (auctionId + "_highestBidAmt"))
6868 let highestBidderAddr = addressFromStringValue(value(highestBidder))
6969 let ownerAddr = addressFromStringValue(value(owner))
7070 let itemAddr = fromBase58String(value(itemId))
7171 if ((callerAddress != value(owner)))
7272 then throw("Access Denied")
7373 else if ((endTime > lastBlock.height))
7474 then throw("Auction is not finished yet")
7575 else if (!(isDefined(highestBidder)))
7676 then if (isDefined(getBoolean(this, (auctionId + "_ownerWithdrawStatus"))))
7777 then throw("Item already withdrawn")
7878 else ScriptResult(WriteSet([DataEntry((auctionId + "_ownerWithdrawStatus"), true)]), TransferSet([ScriptTransfer(ownerAddr, 1, itemAddr)]))
7979 else if (isDefined(getBoolean(this, (auctionId + "_ownerWithdrawStatus"))))
8080 then throw("The bid amount is already transfered")
8181 else ScriptResult(WriteSet([DataEntry((auctionId + "_ownerWithdrawStatus"), true)]), TransferSet([ScriptTransfer(ownerAddr, ((highestBidAmt / 100) * 95), unit)]))
8282 }
8383
8484
8585
8686 @Callable(i)
8787 func winnerWithdraw (auctionId) = {
8888 let callerAddress = toBase58String(i.caller.bytes)
8989 let endTime = getIntegerValue(this, (auctionId + "_endTime"))
9090 let owner = getStringValue(this, (auctionId + "_owner"))
9191 let highestBidder = getString(this, (auctionId + "_highestBidder"))
9292 let itemId = getStringValue(this, (auctionId + "_itemId"))
9393 let highestBidAmt = getIntegerValue(this, (auctionId + "_highestBidAmt"))
9494 let highestBidderAddr = addressFromStringValue(value(highestBidder))
9595 let ownerAddr = addressFromStringValue(value(owner))
9696 let itemAddr = fromBase58String(value(itemId))
9797 if ((callerAddress != if (isDefined(highestBidder))
9898 then value(highestBidder)
9999 else throw("Nobody won this item")))
100100 then throw("Access Denied")
101101 else if ((endTime > lastBlock.height))
102102 then throw("Auction is not finished yet")
103103 else if (isDefined(getBoolean(this, (auctionId + "_winnerWithdrawStatus"))))
104- then throw("The bid amount is already transfered")
104+ then throw("The item already transfered")
105105 else ScriptResult(WriteSet([DataEntry((auctionId + "_winnerWithdrawStatus"), true)]), TransferSet([ScriptTransfer(highestBidderAddr, 1, itemAddr)]))
106106 }
107107
108108

github/deemru/w8io/026f985 
44.45 ms