tx · HBxEonqYeSh7jbvree28uKWFh9N1qWRJTMSGzk33aLjH 3N8oGmoNZRYR4iA9586cGgVoFPTPnbKcNds: -0.01400000 Waves 2022.03.05 11:59 [1950465] smart account 3N8oGmoNZRYR4iA9586cGgVoFPTPnbKcNds > SELF 0.00000000 Waves
{ "type": 13, "id": "HBxEonqYeSh7jbvree28uKWFh9N1qWRJTMSGzk33aLjH", "fee": 1400000, "feeAssetId": null, "timestamp": 1646470816223, "version": 2, "chainId": 84, "sender": "3N8oGmoNZRYR4iA9586cGgVoFPTPnbKcNds", "senderPublicKey": "CcnrRKYzgAP4VNysQhGczok7xWdHDnijupPd8nTfV8BE", "proofs": [ "4zFTs8ERTFfdt6SVu8orjJu9xh4UaHYqRqrfGoR1gcjiHHJb3xyYHW6pvqqLNET4wopAiTEcb6ytwTaJ2uw3Szn7" ], "script": "base64:AAIDAAAAAAAAAAkIARIAEgMKAQgAAAAAAAAAAgAAAAFpAQAAAARTZW5kAAAAAAQAAAADcG10CQEAAAAHZXh0cmFjdAAAAAEIBQAAAAFpAAAAB3BheW1lbnQEAAAABnNlbmRlcgkAAlgAAAABCAgFAAAAAWkAAAAGY2FsbGVyAAAABWJ5dGVzBAAAAA9zZW5kZXJwdWJsaWNrZXkJAAJYAAAAAQgFAAAAAWkAAAAPY2FsbGVyUHVibGljS2V5BAAAAAZhc3NldDEBAAAAIAhlhLcP8IpqGvPiaOguCJAkw9MnWAPNLPYuXgvf2hWkBAAAAAd0eG5oYXNoCQACWAAAAAEIBQAAAAFpAAAADXRyYW5zYWN0aW9uSWQDCQEAAAACIT0AAAACCAUAAAADcG10AAAAB2Fzc2V0SWQFAAAABmFzc2V0MQkAAAIAAAABCQABLAAAAAICAAAAJkluY29ycmVjdCBhc3NldCBhdHRhY2hlZCwgcGxlYXNlIHNlbmQgCQACWAAAAAEFAAAABmFzc2V0MQMJAABmAAAAAggFAAAAA3BtdAAAAAZhbW91bnQAAAAAAAAPQkAJAAACAAAAAQIAAAAaVXNlI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AAAAAAAAAAAgFAAAAAnR4AAAAD3NlbmRlclB1YmxpY0tledOn/xQ=", "height": 1950465, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: A7sqtDNpknuQZPhQTwbNBUfmBC7dgotb3kymKLPtqYNW Next: 8g2kQ9eLnVZA1YU4G24NHEQAJQ63gtRVacHafp6gFV21 Diff:
Old | New | Differences | |
---|---|---|---|
12 | 12 | let txnhash = toBase58String(i.transactionId) | |
13 | 13 | if ((pmt.assetId != asset1)) | |
14 | 14 | then throw(("Incorrect asset attached, please send " + toBase58String(asset1))) | |
15 | - | else WriteSet([DataEntry("Sender_TxnID", txnhash), DataEntry((txnhash + "_Sender_Address"), sender), DataEntry((txnhash + "_Sender_pubkey"), senderpublickey), DataEntry((txnhash + "_Sender_amount"), pmt.amount), DataEntry((txnhash + "_Sender_AssetID"), asset1), DataEntry((txnhash + "_Sender_Status"), "PENDING")]) | |
15 | + | else if ((pmt.amount > 1000000)) | |
16 | + | then throw("Use Less Amount to Attach.") | |
17 | + | else WriteSet([DataEntry("Sender_TxnID", txnhash), DataEntry((txnhash + "_Sender_Address"), sender), DataEntry((txnhash + "_Sender_pubkey"), senderpublickey), DataEntry((txnhash + "_Sender_amount"), pmt.amount), DataEntry((txnhash + "_Sender_AssetID"), asset1), DataEntry((txnhash + "_Sender_Status"), "PENDING")]) | |
18 | + | } | |
19 | + | ||
20 | + | ||
21 | + | ||
22 | + | @Callable(i) | |
23 | + | func Claim (TransactionHash) = { | |
24 | + | let currentKey = toBase58String(i.callerPublicKey) | |
25 | + | let fetchcurrentKey = getStringValue(this, (TransactionHash + "_Sender_pubkey")) | |
26 | + | let fetchAssetID = getStringValue(this, (TransactionHash + "_Sender_AssetID")) | |
27 | + | let fetchAmount = getIntegerValue(this, (TransactionHash + "_Sender_amount")) | |
28 | + | let ActualAmount = fraction(100, fetchAmount, 1) | |
29 | + | if ((currentKey != fetchcurrentKey)) | |
30 | + | then throw("You are not an authorized user to Withdraw Funds or Wrong Public Key.") | |
31 | + | else if ((fetchAmount == 0)) | |
32 | + | then throw("You Already Have Withdraw Funds from This TxnID.") | |
33 | + | else ScriptResult(WriteSet([DataEntry((TransactionHash + "_Sender_Status"), "WITHDRAW_COMPLETED"), DataEntry((TransactionHash + "_Sender_amount"), 0)]), TransferSet([ScriptTransfer(i.caller, ActualAmount, unit)])) | |
16 | 34 | } | |
17 | 35 | ||
18 | 36 |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 3 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | ||
5 | 5 | ||
6 | 6 | @Callable(i) | |
7 | 7 | func Send () = { | |
8 | 8 | let pmt = extract(i.payment) | |
9 | 9 | let sender = toBase58String(i.caller.bytes) | |
10 | 10 | let senderpublickey = toBase58String(i.callerPublicKey) | |
11 | 11 | let asset1 = base58'Zn3cLHW7aAVPm5aACcTjvg7e7iEy2cKDtbowok5qa9H' | |
12 | 12 | let txnhash = toBase58String(i.transactionId) | |
13 | 13 | if ((pmt.assetId != asset1)) | |
14 | 14 | then throw(("Incorrect asset attached, please send " + toBase58String(asset1))) | |
15 | - | else WriteSet([DataEntry("Sender_TxnID", txnhash), DataEntry((txnhash + "_Sender_Address"), sender), DataEntry((txnhash + "_Sender_pubkey"), senderpublickey), DataEntry((txnhash + "_Sender_amount"), pmt.amount), DataEntry((txnhash + "_Sender_AssetID"), asset1), DataEntry((txnhash + "_Sender_Status"), "PENDING")]) | |
15 | + | else if ((pmt.amount > 1000000)) | |
16 | + | then throw("Use Less Amount to Attach.") | |
17 | + | else WriteSet([DataEntry("Sender_TxnID", txnhash), DataEntry((txnhash + "_Sender_Address"), sender), DataEntry((txnhash + "_Sender_pubkey"), senderpublickey), DataEntry((txnhash + "_Sender_amount"), pmt.amount), DataEntry((txnhash + "_Sender_AssetID"), asset1), DataEntry((txnhash + "_Sender_Status"), "PENDING")]) | |
18 | + | } | |
19 | + | ||
20 | + | ||
21 | + | ||
22 | + | @Callable(i) | |
23 | + | func Claim (TransactionHash) = { | |
24 | + | let currentKey = toBase58String(i.callerPublicKey) | |
25 | + | let fetchcurrentKey = getStringValue(this, (TransactionHash + "_Sender_pubkey")) | |
26 | + | let fetchAssetID = getStringValue(this, (TransactionHash + "_Sender_AssetID")) | |
27 | + | let fetchAmount = getIntegerValue(this, (TransactionHash + "_Sender_amount")) | |
28 | + | let ActualAmount = fraction(100, fetchAmount, 1) | |
29 | + | if ((currentKey != fetchcurrentKey)) | |
30 | + | then throw("You are not an authorized user to Withdraw Funds or Wrong Public Key.") | |
31 | + | else if ((fetchAmount == 0)) | |
32 | + | then throw("You Already Have Withdraw Funds from This TxnID.") | |
33 | + | else ScriptResult(WriteSet([DataEntry((TransactionHash + "_Sender_Status"), "WITHDRAW_COMPLETED"), DataEntry((TransactionHash + "_Sender_amount"), 0)]), TransferSet([ScriptTransfer(i.caller, ActualAmount, unit)])) | |
16 | 34 | } | |
17 | 35 | ||
18 | 36 | ||
19 | 37 | @Verifier(tx) | |
20 | 38 | func verify () = match tx { | |
21 | 39 | case _ => | |
22 | 40 | sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey) | |
23 | 41 | } | |
24 | 42 |
github/deemru/w8io/169f3d6 41.44 ms ◑