tx · GUwUBq2f1UWYheHhcuFGKZMR3LU1sNSwJYCae9kNm4tQ

3Mz29fiz3zgY9JDbiHKANvHsFgQutdfu4Ua:  -0.01400000 Waves

2021.03.15 16:55 [1438922] smart account 3Mz29fiz3zgY9JDbiHKANvHsFgQutdfu4Ua > SELF 0.00000000 Waves

{ "type": 13, "id": "GUwUBq2f1UWYheHhcuFGKZMR3LU1sNSwJYCae9kNm4tQ", "fee": 1400000, "feeAssetId": null, "timestamp": 1615816533412, "version": 2, "chainId": 84, "sender": "3Mz29fiz3zgY9JDbiHKANvHsFgQutdfu4Ua", "senderPublicKey": "CTyHhnVTxf16Z4CmGGneAK8WB5g2QyT4MB8kUn8vPPcu", "proofs": [ "3vqMyR59rirCF9wd2MEV4beoG5vYhjBqwPUa8HhtCVixPJcmGZN73cUqwo3jehj98YYr7arvH8KvLn8FLTsPTueb" ], "script": "base64:AAIEAAAAAAAAAAYIAhIAEgAAAAACAQAAAAxpc1dhdmVzQXNzZXQAAAABAAAAB2Fzc2V0SWQEAAAAByRtYXRjaDAFAAAAB2Fzc2V0SWQDCQAAAQAAAAIFAAAAByRtYXRjaDACAAAACkJ5dGVWZWN0b3IEAAAABWFzc2V0BQAAAAckbWF0Y2gwBwMJAAABAAAAAgUAAAAHJG1hdGNoMAIAAAAEVW5pdAQAAAAFd2F2ZXMFAAAAByRtYXRjaDAGCQAAAgAAAAECAAAAC01hdGNoIGVycm9yAQAAABBnZXRUcmVhc3VyeVZhbHVlAAAAAQAAAAdhc3NldElkBAAAAAx0cmVhc3VyeU5hbWUEAAAAByRtYXRjaDAFAAAAB2Fzc2V0SWQDCQAAAQAAAAIFAAAAByRtYXRjaDACAAAACkJ5dGVWZWN0b3IEAAAABWFzc2V0BQAAAAckbWF0Y2gwCQABLAAAAAICAAAACVRyZWFzdXJ5LQkAAlgAAAABBQAAAAVhc3NldAMJAAABAAAAAgUAAAAHJG1hdGNoMAIAAAAGU3RyaW5nBAAAAANzdHIFAAAAByRtYXRjaDAJA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y2gwAgAAAANJbnQEAAAAA3ZhbAUAAAAHJG1hdGNoMAUAAAADdmFsBAAAAARudWxsBQAAAAckbWF0Y2gwCQAAAgAAAAECAAAAJURhdGEgbWlzc2luZzogJ2dvdmVybm9yQ3JlYXRpb25QcmljZScDCQEAAAACIT0AAAACCAkAAZEAAAACCAUAAAABaQAAAAhwYXltZW50cwAAAAAAAAAAAAAAAAZhbW91bnQFAAAAFWdvdmVybm9yQ3JlYXRpb25QcmljZQkAAAIAAAABAgAAABdOb3QgYSB2YWxpZCBhbW91bnQgc2VudAQAAAALZ292Q29udHJhY3QJAARCAAAABQIAAAAQR292ZXJub3JDb250cmFjdAkAAaQAAAABBQAAAAZoZWlnaHQAAAAAAAAAAAEAAAAAAAAAAAAHBAAAAA1nb3ZDb250cmFjdElkCQAEOAAAAAEFAAAAC2dvdkNvbnRyYWN0CQAETAAAAAIJAQAAAAtTdHJpbmdFbnRyeQAAAAICAAAADlRyZWFzdXJ5LVdBVkVTCQABpAAAAAEJAABkAAAAAgkBAAAAEGdldFRyZWFzdXJ5VmFsdWUAAAABAgAAAAVXQVZFUwgJAAGRAAAAAggFAAAAAWkAAAAIcGF5bWVudHMAAAAAAAAAAAAAAAAGYW1vdW50CQAETAAAAAIFAAAAC2dvdkNvbnRyYWN0CQAETAAAAAIJAQAAAA5TY3JpcHRUcmFuc2ZlcgAAAAMIBQAAAAFpAAAABmNhbGxlcggFAAAAC2dvdkNvbnRyYWN0AAAACHF1YW50aXR5BQAAAA1nb3ZDb250cmFjdElkBQAAAANuaWwAAAABAAAAAnR4AQAAAAZ2ZXJpZnkAAAAACQAB9AAAAAMIBQAAAAJ0eAAAAAlib2R5Qnl0ZXMJAAGRAAAAAggFAAAAAnR4AAAABnByb29mcwAAAAAAAAAAAAgFAAAAAnR4AAAAD3NlbmRlclB1YmxpY0tleca7iqY=", "height": 1438922, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 7ekduY5P1SXuB5rnKSKY8XV92dgcHZVUQ3ReUoEDppJ3 Next: 5dfTQBUf4mjFaVjbqJe1kzyjKGdqG6DYFe69sUanuYvm Diff:
OldNewDifferences
1111 }
1212
1313
14-func getTreasury (assetId) = {
14+func getTreasuryValue (assetId) = {
1515 let treasuryName = match assetId {
1616 case asset: ByteVector =>
1717 ("Treasury-" + toBase58String(asset))
18- case waves: Unit =>
19- "Treasury-WAVES"
18+ case str: String =>
19+ ("Treasury-" + str)
20+ case _: Unit =>
21+ throw("Unknown treasury")
2022 case _ =>
2123 throw("Match error")
2224 }
5557 else {
5658 let govContract = Issue("GovernorContract", toString(height), 1, 0, false)
5759 let govContractId = calculateAssetId(govContract)
58-[StringEntry("Treasury-WAVES", toString((getTreasury(unit) + i.payments[0].amount))), govContract, ScriptTransfer(i.caller, govContract.quantity, govContractId)]
60+[StringEntry("Treasury-WAVES", toString((getTreasuryValue("WAVES") + i.payments[0].amount))), govContract, ScriptTransfer(i.caller, govContract.quantity, govContractId)]
5961 }
6062 }
6163
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
14-func getTreasury (assetId) = {
14+func getTreasuryValue (assetId) = {
1515 let treasuryName = match assetId {
1616 case asset: ByteVector =>
1717 ("Treasury-" + toBase58String(asset))
18- case waves: Unit =>
19- "Treasury-WAVES"
18+ case str: String =>
19+ ("Treasury-" + str)
20+ case _: Unit =>
21+ throw("Unknown treasury")
2022 case _ =>
2123 throw("Match error")
2224 }
2325 match getInteger(this, treasuryName) {
2426 case val: Int =>
2527 val
2628 case null =>
2729 0
2830 }
2931 }
3032
3133
3234 @Callable(i)
3335 func init () = if ((this != i.caller))
3436 then throw("Access denied")
3537 else [IntegerEntry("governorCreationPrice", 1)]
3638
3739
3840
3941 @Callable(i)
4042 func createGovernor () = if ((size(i.payments) != 1))
4143 then throw("No payment attached")
4244 else if ((this == i.caller))
4345 then throw("dApp self sending is denied")
4446 else if ((isWavesAsset(i.payments[0].assetId) == false))
4547 then throw("Payment should be in WAVES")
4648 else {
4749 let governorCreationPrice = match getInteger(this, "governorCreationPrice") {
4850 case val: Int =>
4951 val
5052 case null =>
5153 throw("Data missing: 'governorCreationPrice'")
5254 }
5355 if ((i.payments[0].amount != governorCreationPrice))
5456 then throw("Not a valid amount sent")
5557 else {
5658 let govContract = Issue("GovernorContract", toString(height), 1, 0, false)
5759 let govContractId = calculateAssetId(govContract)
58-[StringEntry("Treasury-WAVES", toString((getTreasury(unit) + i.payments[0].amount))), govContract, ScriptTransfer(i.caller, govContract.quantity, govContractId)]
60+[StringEntry("Treasury-WAVES", toString((getTreasuryValue("WAVES") + i.payments[0].amount))), govContract, ScriptTransfer(i.caller, govContract.quantity, govContractId)]
5961 }
6062 }
6163
6264
6365 @Verifier(tx)
6466 func verify () = sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey)
6567

github/deemru/w8io/169f3d6 
45.19 ms