tx · 3ZbtYo7mGH38nQpuJ2Q6tcXRV8AAQh3PBiCdRaVs2ren

3Mv7nXq2V2Dnn9oSkB5feRt6RxtqnPiAXNH:  -0.04000000 Waves

2022.04.18 10:45 [2013716] smart account 3Mv7nXq2V2Dnn9oSkB5feRt6RxtqnPiAXNH > SELF 0.00000000 Waves

{ "type": 13, "id": "3ZbtYo7mGH38nQpuJ2Q6tcXRV8AAQh3PBiCdRaVs2ren", "fee": 4000000, "feeAssetId": null, "timestamp": 1650267949960, "version": 2, "chainId": 84, "sender": "3Mv7nXq2V2Dnn9oSkB5feRt6RxtqnPiAXNH", "senderPublicKey": "HJ4JLtArYaaiBiWho6gzLRbKUVM6ZVTaKmci6sgFQtEm", "proofs": [ "2XKrNQdsZqFmkdEiwJNdSVqQabm4vbYS8VkWcWcPJmx3KRY73LWd7oAF6HW5QJzuEYxeGXB7FJjeHFRVnY6vo8AW" ], "script": "base64:AAIFAAAAAAAAAAQIAhIAAAAAAwAAAAACSUQBAAAAIP8QR3aaHO4gAEH6GV3RAr44yVLBwb023LSVkrkR45liAAAAAAJMUAEAAAAgVICYp/GT+FfvfSZYAZKhhCXeJCqcu2y/TJ9L8R1cyz8AAAAACWlzU3RvcHBlZAcAAAABAAAAAWkBAAAABXN0YWtlAAAAAAQAAAADcG10CQEAAAAFdmFsdWUAAAABCQABkQAAAAIIBQAAAAFpAAAACHBheW1lbnRzAAAAAAAAAAAABAAAAAlwbXRBbW91bnQIBQAAAANwbXQAAAAGYW1vdW50AwkBAAAAAiE9AAAAAggFAAAAA3BtdAAAAAdhc3NldElkBQAAAAJJRAkAAAIAAAABAgAAABthdHRhY2ggdGVzdE5TQlQgdG9rZW5zIG9ubHkDBQAAAAlpc1N0b3BwZWQJAAACAAAAAQIAAAAZc21hcnQgY29udHJhY3QgaXMgb24gbG9jawQAAAAKaW5UcmVhc3VyeQkAA/AAAAACBQAAAAR0aGlzBQAAAAJJRAQAAAALdG90YWxJc3N1ZWQEAAAAByRtYXRjaDAJAAPsAAAAAQUAAAACTFADCQAAAQAAAAIFAAAAByRtYXRjaDACAAAABUFzc2V0BAAAAAVhc3NldAUAAAAHJG1hdGNoMAgFAAAABWFzc2V0AAAACHF1YW50aXR5CQAAAgAAAAECAAAAEENhbid0IGZpbmQgYXNzZXQEAAAACHRyZWFzdXJ5CQAAZQAAAAIFAAAACmluVHJlYXN1cnkFAAAACXBtdEFtb3VudAQAAAAPc2luZ2xlTFBpblZhbHVlCQAAawAAAAMFAAAAC3RvdGFsSXNzdWVkAAAAAAAF9eEABQAAAAh0cmVhc3VyeQQAAAANYW1vdW50VG9Jc3N1ZQkAAGsAAAADBQAAAAlwbXRBbW91bnQFAAAAD3NpbmdsZUxQaW5WYWx1ZQAAAAAABfXhAAQAAAAHTFBJc3N1ZQkBAAAAB1JlaXNzdWUAAAADBQAAAAJMUAUAAAANYW1vdW50VG9Jc3N1ZQYEAAAACHRyYW5zZmVyCQEAAAAOU2NyaXB0VHJhbnNmZXIAAAADCAUAAAABaQAAAAZjYWxsZXIFAAAADWFtb3VudFRvSXNzdWUFAAAAAkxQCQAETAAAAAIFAAAAB0xQSXNzdWUJAARMAAAAAgUAAAAIdHJhbnNmZXIFAAAAA25pbAAAAAC3NBo5", "height": 2013716, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 57Q27YXxqoJ7a2NsEPnEoiYx9yiigVAtAcFPy6fuZjWw Next: Evxwpbnjv6HUZ31WwLUKLRE8eAwSfQhPP7K3yzudye7X Diff:
OldNewDifferences
3333 }
3434
3535
36-
37-@Callable(i)
38-func withdraw (amount) = {
39- let attached = i.payments[0]
40- let paymentID = i.payments[0].assetId
41- if ((paymentID != LP))
42- then throw("Attach the correct LP token")
43- else {
44- let newAmount = (attached.amount - amount)
45- if ((0 > amount))
46- then throw("Can't withdraw negative amount")
47- else if ((0 > newAmount))
48- then throw("Not enough balance")
49- else {
50- let burning = Burn(LP, amount)
51- let transfer = ScriptTransfer(i.caller, newAmount, ID)
52-[burning, transfer]
53- }
54- }
55- }
56-
57-
58-@Verifier(tx)
59-func verify () = sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey)
60-
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 5 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 let ID = base58'JAfMu2seKNzTVfqi5w5Pjh4kwwPTZPCEFpc2q2vDyFeh'
55
66 let LP = base58'6gryiTrJoLkNzBtZLVBuCyCvnxPY77TVUS2ouYYjjVTU'
77
88 let isStopped = false
99
1010 @Callable(i)
1111 func stake () = {
1212 let pmt = value(i.payments[0])
1313 let pmtAmount = pmt.amount
1414 if ((pmt.assetId != ID))
1515 then throw("attach testNSBT tokens only")
1616 else if (isStopped)
1717 then throw("smart contract is on lock")
1818 else {
1919 let inTreasury = assetBalance(this, ID)
2020 let totalIssued = match assetInfo(LP) {
2121 case asset: Asset =>
2222 asset.quantity
2323 case _ =>
2424 throw("Can't find asset")
2525 }
2626 let treasury = (inTreasury - pmtAmount)
2727 let singleLPinValue = fraction(totalIssued, 100000000, treasury)
2828 let amountToIssue = fraction(pmtAmount, singleLPinValue, 100000000)
2929 let LPIssue = Reissue(LP, amountToIssue, true)
3030 let transfer = ScriptTransfer(i.caller, amountToIssue, LP)
3131 [LPIssue, transfer]
3232 }
3333 }
3434
3535
36-
37-@Callable(i)
38-func withdraw (amount) = {
39- let attached = i.payments[0]
40- let paymentID = i.payments[0].assetId
41- if ((paymentID != LP))
42- then throw("Attach the correct LP token")
43- else {
44- let newAmount = (attached.amount - amount)
45- if ((0 > amount))
46- then throw("Can't withdraw negative amount")
47- else if ((0 > newAmount))
48- then throw("Not enough balance")
49- else {
50- let burning = Burn(LP, amount)
51- let transfer = ScriptTransfer(i.caller, newAmount, ID)
52-[burning, transfer]
53- }
54- }
55- }
56-
57-
58-@Verifier(tx)
59-func verify () = sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey)
60-

github/deemru/w8io/169f3d6 
66.01 ms