tx · 4XFRAG4MaRmnwppDEvSiy2tnTryiMgHG5a81cNpGfCGS
3NAVJcqMw8AsPecAtd74CeNtAG2qRV2V1so: -0.04000000 Waves
2022.05.21 17:00 [2061532] smart account 3NAVJcqMw8AsPecAtd74CeNtAG2qRV2V1so > SELF 0.00000000 Waves
{
"type": 13,
"id": "4XFRAG4MaRmnwppDEvSiy2tnTryiMgHG5a81cNpGfCGS",
"fee": 4000000,
"feeAssetId": null,
"timestamp": 1653141678250,
"version": 2,
"chainId": 84,
"sender": "3NAVJcqMw8AsPecAtd74CeNtAG2qRV2V1so",
"senderPublicKey": "EpvN8tsbEWeeqZSLaEVCda8PZfKa1JAF3ZFp7hRq1gWj",
"proofs": [
"3s5E88KebkMtZbhK9ENTqN4CYDkv531EU5xQndWtsAShG9FDQFGf9tRuHvYKDUkMyTp3wYxjd37GzTLKiWacrUec"
],
"script": "base64:AAIFAAAAAAAAAAYIAhIAEgAAAAADAAAAAAZ1c2RuSUQBAAAAIA/yHBKs5MQ8muxGGqslqLDsugcrRsxtiHLwteKSSQG0AAAAAAZldFVTRE4BAAAAIArgbcH68lrWZElMEVXNaWlpG4Cviv0rAfCbvXtcX03lAAAAAAhpc1N0b3BlZAcAAAACAAAAAWkBAAAAB2RlcG9zaXQAAAAABAAAAANwbXQJAQAAAAV2YWx1ZQAAAAEJAAGRAAAAAggFAAAAAWkAAAAIcGF5bWVudHMAAAAAAAAAAAAEAAAAAmFtCAUAAAADcG10AAAABmFtb3VudAMJAQAAAAIhPQAAAAIIBQAAAANwbXQAAAAHYXNzZXRJZAUAAAAGdXNkbklECQAAAgAAAAECAAAADUludmFsaWQgdG9rZW4DBQAAAAhpc1N0b3BlZAkAAAIAAAABAgAAAA9kQXBwIGlzIHN0b3BwZWQEAAAABXRvSXNzCQAAaAAAAAIFAAAAAmFtAAAAAAAAAABkBAAAAAFyCQEAAAAHUmVpc3N1ZQAAAAMFAAAABmV0VVNETgUAAAAFdG9Jc3MGBAAAAAN0cngJAQAAAA5TY3JpcHRUcmFuc2ZlcgAAAAMIBQAAAAFpAAAABmNhbGxlcgUAAAAFdG9Jc3MFAAAABmV0VVNETgkABEwAAAACBQAAAAFyCQAETAAAAAIFAAAAA3RyeAUAAAADbmlsAAAAAWkBAAAACHdpdGhkcmF3AAAAAAQAAAADcG10CQEAAAAFdmFsdWUAAAABCQABkQAAAAIIBQAAAAFpAAAACHBheW1lbnRzAAAAAAAAAAAABAAAAANhbXQIBQAAAANwbXQAAAAGYW1vdW50AwkBAAAAAiE9AAAAAggFAAAAA3BtdAAAAAdhc3NldElkBQAAAAZldFVTRE4JAAACAAAAAQIAAAAYSW52YWxpZCBwYXltZW50IGF0dGFjaGVkAwkAAGcAAAACAAAAAAAAAAAABQAAAANhbXQJAAACAAAAAQIAAAAOSW52YWxpZCBhbW91bnQEAAAABHRvUEIJAABpAAAAAgUAAAADYW10AAAAAAAAAABkBAAAAANicm4JAQAAAARCdXJuAAAAAgUAAAAGZXRVU0ROBQAAAANhbXQEAAAAAnBiCQEAAAAOU2NyaXB0VHJhbnNmZXIAAAADCAUAAAABaQAAAAZjYWxsZXIFAAAABHRvUEIFAAAABnVzZG5JRAkABEwAAAACBQAAAANicm4JAARMAAAAAgUAAAACcGIFAAAAA25pbAAAAAEAAAACdHgBAAAABnZlcmlmeQAAAAAJAAH0AAAAAwgFAAAAAnR4AAAACWJvZHlCeXRlcwkAAZEAAAACCAUAAAACdHgAAAAGcHJvb2ZzAAAAAAAAAAAACAUAAAACdHgAAAAPc2VuZGVyUHVibGljS2V55uejow==",
"height": 2061532,
"applicationStatus": "succeeded",
"spentComplexity": 0
}
View: original | compacted
Prev: 8G4BieYZdFxiCA9e2v1Jxfqmk2JBvpQVpcXzyQbY5U9k
Next: none
Diff:
Old | New | | Differences |
---|
24 | 24 | | } |
---|
25 | 25 | | |
---|
26 | 26 | | |
---|
| 27 | + | |
---|
| 28 | + | @Callable(i) |
---|
| 29 | + | func withdraw () = { |
---|
| 30 | + | let pmt = value(i.payments[0]) |
---|
| 31 | + | let amt = pmt.amount |
---|
| 32 | + | if ((pmt.assetId != etUSDN)) |
---|
| 33 | + | then throw("Invalid payment attached") |
---|
| 34 | + | else if ((0 >= amt)) |
---|
| 35 | + | then throw("Invalid amount") |
---|
| 36 | + | else { |
---|
| 37 | + | let toPB = (amt / 100) |
---|
| 38 | + | let brn = Burn(etUSDN, amt) |
---|
| 39 | + | let pb = ScriptTransfer(i.caller, toPB, usdnID) |
---|
| 40 | + | [brn, pb] |
---|
| 41 | + | } |
---|
| 42 | + | } |
---|
| 43 | + | |
---|
| 44 | + | |
---|
27 | 45 | | @Verifier(tx) |
---|
28 | 46 | | func verify () = sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey) |
---|
29 | 47 | | |
---|
Full:
Old | New | | Differences |
---|
1 | 1 | | {-# STDLIB_VERSION 5 #-} |
---|
2 | 2 | | {-# SCRIPT_TYPE ACCOUNT #-} |
---|
3 | 3 | | {-# CONTENT_TYPE DAPP #-} |
---|
4 | 4 | | let usdnID = base58'25FEqEjRkqK6yCkiT7Lz6SAYz7gUFCtxfCChnrVFD5AT' |
---|
5 | 5 | | |
---|
6 | 6 | | let etUSDN = base58'jTZeaNjsi7iJK5mTo42VgYjRBHdHawAdhYykMQUnx7v' |
---|
7 | 7 | | |
---|
8 | 8 | | let isStoped = false |
---|
9 | 9 | | |
---|
10 | 10 | | @Callable(i) |
---|
11 | 11 | | func deposit () = { |
---|
12 | 12 | | let pmt = value(i.payments[0]) |
---|
13 | 13 | | let am = pmt.amount |
---|
14 | 14 | | if ((pmt.assetId != usdnID)) |
---|
15 | 15 | | then throw("Invalid token") |
---|
16 | 16 | | else if (isStoped) |
---|
17 | 17 | | then throw("dApp is stopped") |
---|
18 | 18 | | else { |
---|
19 | 19 | | let toIss = (am * 100) |
---|
20 | 20 | | let r = Reissue(etUSDN, toIss, true) |
---|
21 | 21 | | let trx = ScriptTransfer(i.caller, toIss, etUSDN) |
---|
22 | 22 | | [r, trx] |
---|
23 | 23 | | } |
---|
24 | 24 | | } |
---|
25 | 25 | | |
---|
26 | 26 | | |
---|
| 27 | + | |
---|
| 28 | + | @Callable(i) |
---|
| 29 | + | func withdraw () = { |
---|
| 30 | + | let pmt = value(i.payments[0]) |
---|
| 31 | + | let amt = pmt.amount |
---|
| 32 | + | if ((pmt.assetId != etUSDN)) |
---|
| 33 | + | then throw("Invalid payment attached") |
---|
| 34 | + | else if ((0 >= amt)) |
---|
| 35 | + | then throw("Invalid amount") |
---|
| 36 | + | else { |
---|
| 37 | + | let toPB = (amt / 100) |
---|
| 38 | + | let brn = Burn(etUSDN, amt) |
---|
| 39 | + | let pb = ScriptTransfer(i.caller, toPB, usdnID) |
---|
| 40 | + | [brn, pb] |
---|
| 41 | + | } |
---|
| 42 | + | } |
---|
| 43 | + | |
---|
| 44 | + | |
---|
27 | 45 | | @Verifier(tx) |
---|
28 | 46 | | func verify () = sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey) |
---|
29 | 47 | | |
---|