tx · BmS46pwbqGWrxsWd138XdaD2uR8jZ7AhC9RLXN5Q2r3Y

3N7cKXykq32Xk6z4jSbECdcjyswJy84iSLZ:  -0.05000000 Waves

2019.09.08 09:41 [666765] smart account 3N7cKXykq32Xk6z4jSbECdcjyswJy84iSLZ > SELF 0.00000000 Waves

{ "type": 13, "id": "BmS46pwbqGWrxsWd138XdaD2uR8jZ7AhC9RLXN5Q2r3Y", "fee": 5000000, "feeAssetId": null, "timestamp": 1567924939725, "version": 1, "sender": "3N7cKXykq32Xk6z4jSbECdcjyswJy84iSLZ", "senderPublicKey": "3bC9HyDT8KaxdVq6EzZLqW53SX9MrALqoWf8zBXEBc2R", "proofs": [ "26BJ9Z1JeBxKuVkmAzu8pmxVsm1MKDCNNHCLddPqz1SYunp6rptp1K5bujpzVaHvfH41JTXiyFDiCpwXnEA19AH8" ], "script": "base64:AAIDAAAAAAAAAAAAAAAIAAAAAARob3VyCQAAaAAAAAIAAAAAAAAAADwAAAAAAAAAADwAAAAAEXN0YXJ2ZVRvRGVhdGhUaW1lCQAAaAAAAAIJAABoAAAAAgUAAAAEaG91cgAAAAAAAAAAGAAAAAAAAAAABwAAAAAMYmFua0NvbnRyYWN0CQEAAAAcQGV4dHJVc2VyKGFkZHJlc3NGcm9tU3RyaW5nKQAAAAECAAAAIzNON3FRNGFkazY4czJjcVJuVXpIRlJQUUIySlgxQ1B4aGNOAAAAAA9mZWVkaW5nQ29udHJhY3QJAQAAABxAZXh0clVzZXIoYWRkcmVzc0Zyb21TdHJpbmcpAAAAAQIAAAAjM043cVE0YWRrNjhzMmNxUm5VekhGUlBRQjJKWDFDUHhoY04AAAAACXBpZ2d5QmFuawkBAAAAHEBleHRyVXNlcihhZGRyZXNzRnJvbVN0cmluZykAAAABAgAAACMzTjY0dFo0N1JhNFB3OXVGQ1hIeWFITVF6bkJyUXZ4ZzRzQQAAAAAEdHlwZQIAAAADQ2F0AQAAABJub3JtYWxpemVUaW1lc3RhbXAAAAABAAAACXRpbWVzd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FuawgFAAAAA3BtdAAAAAZhbW91bnQIBQAAAANwbXQAAAAHYXNzZXRJZAUAAAADbmlsBAAAAAxmZWVkaW5nUHJpY2UAAAAAAAAAAAEDCQAAZgAAAAIFAAAADGZlZWRpbmdQcmljZQgFAAAAA3BtdAAAAAZhbW91bnQJAAACAAAAAQIAAAAwSW5zdWZpY2llbnQgYW1vdW50IG9mIFdhdmVzIHRvIGZlZWQgdGhlIGNyZWF0dXJlBAAAAAl0aW1lc3RhbXAJAQAAAANtYXgAAAACBQAAABBjdXJyZW50VGltZXN0YW1wBQAAABRsYXN0RmVlZGluZ1RpbWVzdGFtcAkBAAAADFNjcmlwdFJlc3VsdAAAAAIJAQAAAAhXcml0ZVNldAAAAAEJAARMAAAAAgkBAAAACURhdGFFbnRyeQAAAAICAAAADGxhc3RfZmVlZGluZwkBAAAAEm5vcm1hbGl6ZVRpbWVzdGFtcAAAAAEFAAAACXRpbWVzdGFtcAUAAAADbmlsCQEAAAALVHJhbnNmZXJTZXQAAAABCQAETAAAAAIJAQAAAA5TY3JpcHRUcmFuc2ZlcgAAAAMFAAAADGJhbmtDb250cmFjdAgFAAAAA3BtdAAAAAZhbW91bnQFAAAABHVuaXQFAAAAA25pbAAAAADh2WGJ", "chainId": 84, "height": 666765, "spentComplexity": 0 } View: original | compacted Prev: EfvCmhui79eoXCWAdHR6VQmFVBfo2sd7Rv1DLxY7Cd9J Next: 5PVvJbM4NAsKhJfy9zejyhfZPz3mnT7o9vo7Ef2TQx3m Diff:
OldNewDifferences
4343 else if (isDefined(pmt.assetId))
4444 then TransferSet([ScriptTransfer(piggyBank, pmt.amount, pmt.assetId)])
4545 else {
46- let feedingPrice = 100000
46+ let feedingPrice = 1
4747 if ((feedingPrice > pmt.amount))
4848 then throw("Insuficient amount of Waves to feed the creature")
4949 else {
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 3 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 let hour = (60 * 60)
55
66 let starveToDeathTime = ((hour * 24) * 7)
77
88 let bankContract = addressFromStringValue("3N7qQ4adk68s2cqRnUzHFRPQB2JX1CPxhcN")
99
1010 let feedingContract = addressFromStringValue("3N7qQ4adk68s2cqRnUzHFRPQB2JX1CPxhcN")
1111
1212 let piggyBank = addressFromStringValue("3N64tZ47Ra4Pw9uFCXHyaHMQznBrQvxg4sA")
1313
1414 let type = "Cat"
1515
1616 func normalizeTimestamp (timestamp) = if ((timestamp > starveToDeathTime))
1717 then starveToDeathTime
1818 else timestamp
1919
2020
2121 func max (a,b) = if ((a > b))
2222 then a
2323 else b
2424
2525
2626 @Callable(i)
2727 func feed () = {
2828 let pmt = extract(i.payment)
2929 let currentTimestamp = match blockInfoByHeight(extract(transactionHeightById(i.transactionId))) {
3030 case bi: BlockInfo =>
3131 bi.timestamp
3232 case _ =>
3333 throw()
3434 }
3535 let lastFeedingTimestamp = match getInteger(this, "last_feeding") {
3636 case t: Int =>
3737 t
3838 case _ =>
3939 (currentTimestamp + (starveToDeathTime / 2))
4040 }
4141 if ((currentTimestamp > (lastFeedingTimestamp + starveToDeathTime)))
4242 then throw("The creature is dead =(")
4343 else if (isDefined(pmt.assetId))
4444 then TransferSet([ScriptTransfer(piggyBank, pmt.amount, pmt.assetId)])
4545 else {
46- let feedingPrice = 100000
46+ let feedingPrice = 1
4747 if ((feedingPrice > pmt.amount))
4848 then throw("Insuficient amount of Waves to feed the creature")
4949 else {
5050 let timestamp = max(currentTimestamp, lastFeedingTimestamp)
5151 ScriptResult(WriteSet([DataEntry("last_feeding", normalizeTimestamp(timestamp))]), TransferSet([ScriptTransfer(bankContract, pmt.amount, unit)]))
5252 }
5353 }
5454 }
5555
5656

github/deemru/w8io/169f3d6 
32.35 ms