tx · AND3yuGwTZHnG2ogkkesA8Sum8YnZKZnHzManXpPFyNN

3MvU8vDCk4NkA1Ag4vE3mETA4U9ioFh6VEM:  -0.01500000 Waves

2019.12.14 09:42 [808189] smart account 3MvU8vDCk4NkA1Ag4vE3mETA4U9ioFh6VEM > SELF 0.00000000 Waves

{ "type": 13, "id": "AND3yuGwTZHnG2ogkkesA8Sum8YnZKZnHzManXpPFyNN", "fee": 1500000, "feeAssetId": null, "timestamp": 1576305802782, "version": 1, "sender": "3MvU8vDCk4NkA1Ag4vE3mETA4U9ioFh6VEM", "senderPublicKey": "LknnJnwRo6xRdriHmjgVbRDgpexijZFTYBU3Lw4HBS1", "proofs": [ "BsSWsPbpLRZM7Xu1RC9akvNsKToeMhuoNhCyTWJmqBvn6WKSNiTLEYdKfnCyCKTQgeUFS4VdcTs5CCbKgMggkCs" ], "script": "base64:AAIDAAAAAAAAABIIARIECgIBARIDCgEIEgMKAQgAAAABAAAAAA9hdWN0aW9uRHVyYXRpb24JAABoAAAAAgAAAAAAAAAFoAAAAAAAAAAAAQAAAAMAAAABaQEAAAAMYmVnaW5BdWN0aW9uAAAAAgAAAAhtaW5QcmljZQAAAAhkdXJhdGlvbgMJAABmAAAAAgUAAAAIZHVyYXRpb24FAAAAD2F1Y3Rpb25EdXJhdGlvbgkAAAIAAAABCQABLAAAAAIJAAEsAAAAAgkAASwAAAACCQABLAAAAAICAAAAE1NwZWNpZmllZCBkdXJhdGlvbigJAAGkAAAAAQUAAAAIZHVyYXRpb24CAAAAHykgZXhjZWVkcyB0aGUgbWF4aW11bSBkdXJhdGlvbigJAAGkAAAAAQUAAAAPYXVjdGlvbkR1cmF0aW9uAgAAAAEpBAAAAAlhdWN0aW9uSWQJAAJYAAAAAQgFAAAAAWkAAAANdHJhbnNhY3Rpb25JZAQAAAAHZW5kVGltZQkAAGQAAAACCAUAAAAJbGFzdEJsb2NrAAAABmhlaWdodAUAAAAIZHVyYXRpb24EAAAAA3BtdAkBAAAAB2V4dHJhY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AAAB19zdGF0dXMGBQAAAANuaWwJAQAAAAtUcmFuc2ZlclNldAAAAAEJAARMAAAAAgkBAAAADlNjcmlwdFRyYW5zZmVyAAAAAwUAAAARaGlnaGVzdEJpZGRlckFkZHIAAAAAAAAAAAEBAAAABlQfWoIY8QkABEwAAAACCQEAAAAOU2NyaXB0VHJhbnNmZXIAAAADBQAAAAlvd25lckFkZHIFAAAADWhpZ2hlc3RCaWRBbXQFAAAABHVuaXQFAAAAA25pbAAAAACWpL/d", "chainId": 84, "height": 808189, "spentComplexity": 0 } View: original | compacted Prev: 2jwkjsnqP3zaLdpLUH7xqg9teYSeBcw4Bs74PZ1mAKUJ Next: CAVVBiWYDsZPeCuDfqHbPZsz7ucTjeQq8C2dCxsHkGLW Diff:
OldNewDifferences
44 let auctionDuration = (1440 * 1)
55
66 @Callable(i)
7+func beginAuction (minPrice,duration) = if ((duration > auctionDuration))
8+ then throw((((("Specified duration(" + toString(duration)) + ") exceeds the maximum duration(") + toString(auctionDuration)) + ")"))
9+ else {
10+ let auctionId = toBase58String(i.transactionId)
11+ let endTime = (lastBlock.height + duration)
12+ let pmt = extract(i.payment)
13+ WriteSet([DataEntry(auctionId, auctionId), DataEntry((auctionId + "_endTime"), endTime), DataEntry((auctionId + "_owner"), toBase58String(i.caller.bytes)), DataEntry((auctionId + "_itemId"), if (isDefined(pmt.assetId))
14+ then toBase58String(value(pmt.assetId))
15+ else throw("Item not atached")), DataEntry((auctionId + "_minPrice"), minPrice)])
16+ }
17+
18+
19+
20+@Callable(i)
721 func bid (auctionId) = {
8- let pmt = extract(i.payment)
922 let callerAddress = toBase58String(i.caller.bytes)
1023 let endTime = getIntegerValue(this, (auctionId + "_endTime"))
1124 let minPrice = getIntegerValue(this, (auctionId + "_minPrice"))
1427 let bidFromTheSameUser = if (isDefined(highestBidder))
1528 then (value(highestBidder) == callerAddress)
1629 else false
17- let totalBidAmount = (pmt.amount + (if (bidFromTheSameUser)
30+ let totalBidAmount = (1000000 + (if (bidFromTheSameUser)
1831 then value(highestBidAmt)
1932 else 0))
2033 if (!(isDefined(getIntegerValue(this, auctionId))))
4255 }
4356
4457
58+
59+@Callable(i)
60+func withdraw (auctionId) = {
61+ let pmt = extract(i.payment)
62+ let callerAddress = toBase58String(i.caller.bytes)
63+ let endTime = getIntegerValue(this, (auctionId + "_endTime"))
64+ let owner = getStringValue(this, (auctionId + "_owner"))
65+ let highestBidder = getString(this, (auctionId + "_highestBidder"))
66+ let itemId = getStringValue(this, (auctionId + "_itemId"))
67+ let highestBidAmt = getIntegerValue(this, (auctionId + "_highestBidAmt"))
68+ let highestBidderAddr = addressFromStringValue(value(highestBidder))
69+ let ownerAddr = addressFromStringValue(value(owner))
70+ let itemAddr = addressFromStringValue(value(itemId))
71+ if ((endTime > lastBlock.height))
72+ then throw("Auction is not finished yet")
73+ else if (!(isDefined(highestBidder)))
74+ then if (!(isDefined(getBoolean(this, (auctionId + "_status")))))
75+ then throw("Owner already withdrawn the item")
76+ else ScriptResult(WriteSet([DataEntry((auctionId + "_status"), true)]), TransferSet([ScriptTransfer(ownerAddr, 1, base58'itemAddr')]))
77+ else if (isDefined(getBoolean(this, (auctionId + "_status"))))
78+ then throw("The item is transfered to the highest bidder and the bid amount is transfered to the owner")
79+ else ScriptResult(WriteSet([DataEntry((auctionId + "_status"), true)]), TransferSet([ScriptTransfer(highestBidderAddr, 1, base58'itemAddr'), ScriptTransfer(ownerAddr, highestBidAmt, unit)]))
80+ }
81+
82+
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 3 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 let auctionDuration = (1440 * 1)
55
66 @Callable(i)
7+func beginAuction (minPrice,duration) = if ((duration > auctionDuration))
8+ then throw((((("Specified duration(" + toString(duration)) + ") exceeds the maximum duration(") + toString(auctionDuration)) + ")"))
9+ else {
10+ let auctionId = toBase58String(i.transactionId)
11+ let endTime = (lastBlock.height + duration)
12+ let pmt = extract(i.payment)
13+ WriteSet([DataEntry(auctionId, auctionId), DataEntry((auctionId + "_endTime"), endTime), DataEntry((auctionId + "_owner"), toBase58String(i.caller.bytes)), DataEntry((auctionId + "_itemId"), if (isDefined(pmt.assetId))
14+ then toBase58String(value(pmt.assetId))
15+ else throw("Item not atached")), DataEntry((auctionId + "_minPrice"), minPrice)])
16+ }
17+
18+
19+
20+@Callable(i)
721 func bid (auctionId) = {
8- let pmt = extract(i.payment)
922 let callerAddress = toBase58String(i.caller.bytes)
1023 let endTime = getIntegerValue(this, (auctionId + "_endTime"))
1124 let minPrice = getIntegerValue(this, (auctionId + "_minPrice"))
1225 let highestBidAmt = getInteger(this, (auctionId + "_highestBidAmt"))
1326 let highestBidder = getString(this, (auctionId + "_highestBidder"))
1427 let bidFromTheSameUser = if (isDefined(highestBidder))
1528 then (value(highestBidder) == callerAddress)
1629 else false
17- let totalBidAmount = (pmt.amount + (if (bidFromTheSameUser)
30+ let totalBidAmount = (1000000 + (if (bidFromTheSameUser)
1831 then value(highestBidAmt)
1932 else 0))
2033 if (!(isDefined(getIntegerValue(this, auctionId))))
2134 then throw("Auction Id not found")
2235 else if ((lastBlock.height >= endTime))
2336 then throw("Auction Completed")
2437 else if (if (if (!(isDefined(highestBidAmt)))
2538 then (minPrice >= totalBidAmount)
2639 else false)
2740 then true
2841 else if (isDefined(highestBidAmt))
2942 then (value(highestBidAmt) >= totalBidAmount)
3043 else false)
3144 then throw(("Bid must be more then " + (if (!(isDefined(highestBidAmt)))
3245 then toString(minPrice)
3346 else toString(value(highestBidAmt)))))
3447 else if (!(isDefined(highestBidder)))
3548 then WriteSet([DataEntry((auctionId + "_highestBidder"), callerAddress), DataEntry((auctionId + "_highestBidAmt"), totalBidAmount)])
3649 else if (bidFromTheSameUser)
3750 then WriteSet([DataEntry((auctionId + "_highestBidAmt"), totalBidAmount)])
3851 else {
3952 let previousBidder = addressFromStringValue(value(highestBidder))
4053 ScriptResult(WriteSet([DataEntry((auctionId + "_highestBidder"), callerAddress), DataEntry((auctionId + "_highestBidAmt"), totalBidAmount)]), TransferSet([ScriptTransfer(previousBidder, value(highestBidAmt), unit)]))
4154 }
4255 }
4356
4457
58+
59+@Callable(i)
60+func withdraw (auctionId) = {
61+ let pmt = extract(i.payment)
62+ let callerAddress = toBase58String(i.caller.bytes)
63+ let endTime = getIntegerValue(this, (auctionId + "_endTime"))
64+ let owner = getStringValue(this, (auctionId + "_owner"))
65+ let highestBidder = getString(this, (auctionId + "_highestBidder"))
66+ let itemId = getStringValue(this, (auctionId + "_itemId"))
67+ let highestBidAmt = getIntegerValue(this, (auctionId + "_highestBidAmt"))
68+ let highestBidderAddr = addressFromStringValue(value(highestBidder))
69+ let ownerAddr = addressFromStringValue(value(owner))
70+ let itemAddr = addressFromStringValue(value(itemId))
71+ if ((endTime > lastBlock.height))
72+ then throw("Auction is not finished yet")
73+ else if (!(isDefined(highestBidder)))
74+ then if (!(isDefined(getBoolean(this, (auctionId + "_status")))))
75+ then throw("Owner already withdrawn the item")
76+ else ScriptResult(WriteSet([DataEntry((auctionId + "_status"), true)]), TransferSet([ScriptTransfer(ownerAddr, 1, base58'itemAddr')]))
77+ else if (isDefined(getBoolean(this, (auctionId + "_status"))))
78+ then throw("The item is transfered to the highest bidder and the bid amount is transfered to the owner")
79+ else ScriptResult(WriteSet([DataEntry((auctionId + "_status"), true)]), TransferSet([ScriptTransfer(highestBidderAddr, 1, base58'itemAddr'), ScriptTransfer(ownerAddr, highestBidAmt, unit)]))
80+ }
81+
82+

github/deemru/w8io/026f985 
26.44 ms