tx · UF3eaEgYPUUtwtUxJFMMBP5ZqHADjpHrNqM2WN6VwcC

3Mz29fiz3zgY9JDbiHKANvHsFgQutdfu4Ua:  -0.01400000 Waves

2021.03.15 17:05 [1438936] smart account 3Mz29fiz3zgY9JDbiHKANvHsFgQutdfu4Ua > SELF 0.00000000 Waves

{ "type": 13, "id": "UF3eaEgYPUUtwtUxJFMMBP5ZqHADjpHrNqM2WN6VwcC", "fee": 1400000, "feeAssetId": null, "timestamp": 1615817119265, "version": 2, "chainId": 84, "sender": "3Mz29fiz3zgY9JDbiHKANvHsFgQutdfu4Ua", "senderPublicKey": "CTyHhnVTxf16Z4CmGGneAK8WB5g2QyT4MB8kUn8vPPcu", "proofs": [ "5wLj92vLn6eXREz3Au2uRKMLQb9btiCJGkMLUqmFJZL3LhXKp8bTC9A3ooh5daMb4YtSPbBL4T9fa8e1WCwg8gef" ], "script": "base64:AAIEAAAAAAAAAAYIAhIAEgAAAAACAQAAAAxpc1dhdmVzQXNzZXQAAAABAAAAB2Fzc2V0SWQEAAAAByRtYXRjaDAFAAAAB2Fzc2V0SWQDCQAAAQAAAAIFAAAAByRtYXRjaDACAAAACkJ5dGVWZWN0b3IEAAAABWFzc2V0BQAAAAckbWF0Y2gwBwMJAAABAAAAAgUAAAAHJG1hdGNoMAIAAAAEVW5pdAQAAAAFd2F2ZXMFAAAAByRtYXRjaDAGCQAAAgAAAAECAAAAC01hdGNoIGVycm9yAQAAABBnZXRUcmVhc3VyeVZhbHVlAAAAAQAAAAdhc3NldElkBAAAAAx0cmVhc3VyeU5hbWUEAAAAByRtYXRjaDAFAAAAB2Fzc2V0SWQDCQAAAQAAAAIFAAAAByRtYXRjaDACAAAACkJ5dGVWZWN0b3IEAAAABWFzc2V0BQAAAAckbWF0Y2gwCQABLAAAAAICAAAACVRyZWFzdXJ5LQkAAlgAAAABBQAAAAVhc3NldAMJAAABAAAAAgUAAAAHJG1hdGNoMAIAAAAGU3RyaW5nBAAAAANzdHIFAAAAByRtYXRja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WVudHMAAAAAAAAAAAAAAAAGYW1vdW50CQAETAAAAAIFAAAAC2dvdkNvbnRyYWN0CQAETAAAAAIJAQAAAA5TY3JpcHRUcmFuc2ZlcgAAAAMIBQAAAAFpAAAABmNhbGxlcggFAAAAC2dvdkNvbnRyYWN0AAAACHF1YW50aXR5BQAAAA1nb3ZDb250cmFjdElkBQAAAANuaWwAAAABAAAAAnR4AQAAAAZ2ZXJpZnkAAAAACQAB9AAAAAMIBQAAAAJ0eAAAAAlib2R5Qnl0ZXMJAAGRAAAAAggFAAAAAnR4AAAABnByb29mcwAAAAAAAAAAAAgFAAAAAnR4AAAAD3NlbmRlclB1YmxpY0tleVojiYY=", "height": 1438936, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 5dfTQBUf4mjFaVjbqJe1kzyjKGdqG6DYFe69sUanuYvm Next: 69eFQ6Z4J67ZiLYfBx5wWyWbh8aS4HiDBCnQ9phvyzwt Diff:
OldNewDifferences
1818 case str: String =>
1919 ("Treasury-" + str)
2020 case _: Unit =>
21- throw("Unknown treasury")
21+ throw("Unknown treasury #1")
2222 case _ =>
2323 throw("Match error")
2424 }
2525 match getInteger(this, treasuryName) {
2626 case val: Int =>
2727 val
28- case null =>
29- 0
28+ case _ =>
29+ throw("Unknown treasury #2")
3030 }
3131 }
3232
3434 @Callable(i)
3535 func init () = if ((this != i.caller))
3636 then throw("Access denied")
37- else [IntegerEntry("governorCreationPrice", 1)]
37+ else [DeleteEntry("caca"), DeleteEntry("feePoolStack"), DeleteEntry("lendingPoolAssets"), DeleteEntry("lendingPoolStack"), DeleteEntry("lendingPoolTokens"), DeleteEntry("listedLendingTokens"), IntegerEntry("governorCreationPrice", 1), IntegerEntry("Treasury-WAVES", 0)]
3838
3939
4040
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 4 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 func isWavesAsset (assetId) = match assetId {
55 case asset: ByteVector =>
66 false
77 case waves: Unit =>
88 true
99 case _ =>
1010 throw("Match error")
1111 }
1212
1313
1414 func getTreasuryValue (assetId) = {
1515 let treasuryName = match assetId {
1616 case asset: ByteVector =>
1717 ("Treasury-" + toBase58String(asset))
1818 case str: String =>
1919 ("Treasury-" + str)
2020 case _: Unit =>
21- throw("Unknown treasury")
21+ throw("Unknown treasury #1")
2222 case _ =>
2323 throw("Match error")
2424 }
2525 match getInteger(this, treasuryName) {
2626 case val: Int =>
2727 val
28- case null =>
29- 0
28+ case _ =>
29+ throw("Unknown treasury #2")
3030 }
3131 }
3232
3333
3434 @Callable(i)
3535 func init () = if ((this != i.caller))
3636 then throw("Access denied")
37- else [IntegerEntry("governorCreationPrice", 1)]
37+ else [DeleteEntry("caca"), DeleteEntry("feePoolStack"), DeleteEntry("lendingPoolAssets"), DeleteEntry("lendingPoolStack"), DeleteEntry("lendingPoolTokens"), DeleteEntry("listedLendingTokens"), IntegerEntry("governorCreationPrice", 1), IntegerEntry("Treasury-WAVES", 0)]
3838
3939
4040
4141 @Callable(i)
4242 func createGovernor () = if ((size(i.payments) != 1))
4343 then throw("No payment attached")
4444 else if ((this == i.caller))
4545 then throw("dApp self sending is denied")
4646 else if ((isWavesAsset(i.payments[0].assetId) == false))
4747 then throw("Payment should be in WAVES")
4848 else {
4949 let governorCreationPrice = match getInteger(this, "governorCreationPrice") {
5050 case val: Int =>
5151 val
5252 case null =>
5353 throw("Data missing: 'governorCreationPrice'")
5454 }
5555 if ((i.payments[0].amount != governorCreationPrice))
5656 then throw("Not a valid amount sent")
5757 else {
5858 let govContract = Issue("GovernorContract", toString(height), 1, 0, false)
5959 let govContractId = calculateAssetId(govContract)
6060 [IntegerEntry("Treasury-WAVES", (getTreasuryValue("WAVES") + i.payments[0].amount)), govContract, ScriptTransfer(i.caller, govContract.quantity, govContractId)]
6161 }
6262 }
6363
6464
6565 @Verifier(tx)
6666 func verify () = sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey)
6767

github/deemru/w8io/169f3d6 
39.27 ms