tx · BG4k9JGedSbTfMmd43MsDer4cnGBHv54hoAksapcjqaw

3MyYckPLvxVKaoywB9DyoUQpy4rPbG44W2G:  -0.00200000 Waves

2022.06.21 13:57 [2106062] smart account 3MyYckPLvxVKaoywB9DyoUQpy4rPbG44W2G > SELF 0.00000000 Waves

{ "type": 13, "id": "BG4k9JGedSbTfMmd43MsDer4cnGBHv54hoAksapcjqaw", "fee": 200000, "feeAssetId": null, "timestamp": 1655809115403, "version": 2, "chainId": 84, "sender": "3MyYckPLvxVKaoywB9DyoUQpy4rPbG44W2G", "senderPublicKey": "GSE3xef7yPJM86RK98TTRpNp7C67yeMHAkciapPuU56K", "proofs": [ "5NWVBnAJpaXXbxGW5BXYNZR3kkRbUdtPFwqmx68F6sDLhbP12BxLB3CuaxNnMcbEd6w5WVQqUmGsXxVsLMquEyW" ], "script": "base64:AAIFAAAAAAAAAAYIAhIAEgAAAAAEAAAAAAJ0dwEAAAAaAVQ+7YEH8mRvE3c0tbqpeHlZj6y6IMZvhw8AAAAAAkJBAQAAACC6+r0A+qRhvfbxLETLar4Lzt1QWGqsT2lUyD+EyMqNQwAAAAADVENJAQAAACC+QxgAujAmMp9Bgik1StjQaVZeQEXcnOB8P3E0N8Qy/AAAAAAJaXNTdG9wcGVkBwAAAAIAAAABaQEAAAAFc3Rha2UAAAAABAAAAANwbXQJAQAAAAV2YWx1ZQAAAAEJAAGRAAAAAggFAAAAAWkAAAAIcGF5bWVudHMAAAAAAAAAAAAEAAAACXBtdEFtb3VudAgFAAAAA3BtdAAAAAZhbW91bnQDCQEAAAACIT0AAAACCAUAAAADcG10AAAAB2Fzc2V0SWQFAAAAAkJBCQAAAgAAAAECAAAAGFlvdSBjYW4gc3Rha2Ugc05TQlQgb25seQMFAAAACWlzU3RvcHBlZAkAAAIAAAABAgAAABlzbWFydCBjb250cmFjdCBpcyBvbiBsb2NrBAAAAAppblRyZWFzdXJ5CQAD8AAAAAIFAAAABHRoaXMFAAAAAkJBBAAAAAt0b3RhbElz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AAAgAAAAAAAAAAAAUAAAAHYmFsYW5jZQkAAAIAAAABAgAAABtVbnN1ZmljaWVudCBhY2NvdW50IGJhbGFuY2UEAAAACVRDSUFtb3VudAQAAAAHJG1hdGNoMAkAA+wAAAABBQAAAANUQ0kDCQAAAQAAAAIFAAAAByRtYXRjaDACAAAABUFzc2V0BAAAAAFxBQAAAAckbWF0Y2gwCAUAAAABcQAAAAhxdWFudGl0eQAAAAAAAAAAAAQAAAACdnAJAABrAAAAAwkAA/AAAAACBQAAAAR0aGlzBQAAAAJCQQAAAAAABfXhAAUAAAAJVENJQW1vdW50BAAAAAV0b1JlcAkAAGsAAAADBQAAAAJ2cAUAAAAGYW1vdW50AAAAAAAF9eEABAAAAAJ0YwkAAGsAAAADBQAAAAV0b1JlcAAAAAAABfXhAAAAAAACVAvkAAQAAAADYnJuCQEAAAAEQnVybgAAAAIFAAAAA1RDSQUAAAAGYW1vdW50BAAAAAN0cmIJAABlAAAAAgUAAAAFdG9SZXAFAAAAAnRjBAAAAAR0cnNmCQEAAAAOU2NyaXB0VHJhbnNmZXIAAAADCAUAAAABaQAAAAZjYWxsZXIFAAAAA3RyYgUAAAACQkEEAAAAA3R0cgkBAAAADlNjcmlwdFRyYW5zZmVyAAAAAwkBAAAAB0FkZHJlc3MAAAABBQAAAAJ0dwUAAAACdGMFAAAAAkJBCQAETAAAAAIFAAAAA2JybgkABEwAAAACBQAAAAR0cnNmCQAETAAAAAIFAAAAA3R0cgUAAAADbmlsAAAAAQAAAAJ0eAEAAAAGdmVyaWZ5AAAAAAkAAfQAAAADCAUAAAACdHgAAAAJYm9keUJ5dGVzCQABkQAAAAIIBQAAAAJ0eAAAAAZwcm9vZnMAAAAAAAAAAAAIBQAAAAJ0eAAAAA9zZW5kZXJQdWJsaWNLZXkfX22m", "height": 2106062, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: none Next: EsReM4XWYiefaggUJevHyUvvpKGRBhqnpWutAe9U8Fw4 Full:
OldNewDifferences
1-# no script
1+{-# STDLIB_VERSION 5 #-}
2+{-# SCRIPT_TYPE ACCOUNT #-}
3+{-# CONTENT_TYPE DAPP #-}
4+let tw = base58'3MuepBtBCjoxHzt6z8cSKhcg7hps7AR9DoL'
5+
6+let BA = base58'DatazKNzkW2dr3r2ZGCCYWoy52JV5pcZfrRNPQgKh9ai'
7+
8+let TCI = base58'DohoSLuGMXvefNR5eZmQbmas5amzdCkNY6DmfqgjfZ7q'
9+
10+let isStopped = false
11+
12+@Callable(i)
13+func stake () = {
14+ let pmt = value(i.payments[0])
15+ let pmtAmount = pmt.amount
16+ if ((pmt.assetId != BA))
17+ then throw("You can stake sNSBT only")
18+ else if (isStopped)
19+ then throw("smart contract is on lock")
20+ else {
21+ let inTreasury = assetBalance(this, BA)
22+ let totalIssued = match assetInfo(TCI) {
23+ case asset: Asset =>
24+ asset.quantity
25+ case _ =>
26+ throw("Can't find asset")
27+ }
28+ let treasury = (inTreasury - pmtAmount)
29+ let singleTCIinValue = fraction(totalIssued, 100000000, treasury)
30+ let amountToIssue = fraction(pmtAmount, singleTCIinValue, 100000000)
31+ let TCIIssue = Reissue(TCI, amountToIssue, true)
32+ let transfer = ScriptTransfer(i.caller, amountToIssue, TCI)
33+[TCIIssue, transfer]
34+ }
35+ }
36+
37+
38+
39+@Callable(i)
40+func withdraw () = {
41+ let w = value(i.payments[0])
42+ let amount = w.amount
43+ let balance = assetBalance(i.caller, TCI)
44+ if ((w.assetId != TCI))
45+ then throw("sdasda")
46+ else if ((0 >= amount))
47+ then throw("Can't withdraw 0 or negative ammount")
48+ else if ((0 >= balance))
49+ then throw("Unsuficient account balance")
50+ else {
51+ let TCIAmount = match assetInfo(TCI) {
52+ case q: Asset =>
53+ q.quantity
54+ case _ =>
55+ 0
56+ }
57+ let vp = fraction(assetBalance(this, BA), 100000000, TCIAmount)
58+ let toRep = fraction(vp, amount, 100000000)
59+ let tc = fraction(toRep, 100000000, 10000000000)
60+ let brn = Burn(TCI, amount)
61+ let trb = (toRep - tc)
62+ let trsf = ScriptTransfer(i.caller, trb, BA)
63+ let ttr = ScriptTransfer(Address(tw), tc, BA)
64+[brn, trsf, ttr]
65+ }
66+ }
67+
68+
69+@Verifier(tx)
70+func verify () = sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey)
71+

github/deemru/w8io/026f985 
13.74 ms