tx · 4LxbFLgt5aKZV9hJE7TpfvkKY2UTbnZcTmPUM59v9Xr4 3N4o2HTw9N9b1aw59zmfmvtSA3uUZTgRMRZ: -0.01400000 Waves 2021.06.09 21:52 [1563220] smart account 3N4o2HTw9N9b1aw59zmfmvtSA3uUZTgRMRZ > SELF 0.00000000 Waves
{ "type": 13, "id": "4LxbFLgt5aKZV9hJE7TpfvkKY2UTbnZcTmPUM59v9Xr4", "fee": 1400000, "feeAssetId": null, "timestamp": 1623264773265, "version": 2, "chainId": 84, "sender": "3N4o2HTw9N9b1aw59zmfmvtSA3uUZTgRMRZ", "senderPublicKey": "ShSztE3JWeTwsqzeYxpBsdD1GNeC5sSL3zbipUmxuR1", "proofs": [ "52LWA94YRcDDQK8uSH2r7Eq7E2dY4jEkEQKudSPgpFHNm6tweFPCauxDkBNtVtB5bbmZ2FXZHc833mACNxFSVaBo" ], "script": "base64:AAIDAAAAAAAAAAkIARIAEgMKAQgAAAAAAAAAAgAAAAFpAQAAAAlSS01UdG9LU1MAAAAABAAAAANwbXQJAQAAAAdleHRyYWN0AAAAAQgFAAAAAWkAAAAHcGF5bWVudAQAAAAGc2VuZGVyCQACWAAAAAEICAUAAAABaQAAAAZjYWxsZXIAAAAFYnl0ZXMEAAAAD3NlbmRlcnB1YmxpY2tleQkAAlgAAAABCAUAAAABaQAAAA9jYWxsZXJQdWJsaWNLZXkEAAAABmFzc2V0MQEAAAAg7W6ezmGUnP3O5hqSHS3e4uYtkMJNmB8HvATDD5acfHEEAAAAB3R4bmhhc2gJAAJYAAAAAQgFAAAAAWkAAAANdHJhbnNhY3Rpb25JZAMJAQAAAAIhPQAAAAIIBQAAAANwbXQAAAAHYXNzZXRJZAUAAAAGYXNzZXQxCQAAAgAAAAECAAAAWkluY29ycmVjdCBhc3NldCBhdHRhY2hlZCwgcGxlYXNlIHNlbmQgR3lxVFlEZWEzRFdCYUF5UXM1UzV1SDIyMjN1Y0VMWUZhekpwWkxDZk16blUgKFJLTVQpLgkBAAAAC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AAAGcHJvb2ZzAAAAAAAAAAAACAUAAAACdHgAAAAPc2VuZGVyUHVibGljS2V57Au5lg==", "height": 1563220, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: AqktdbTb9CbhKRaDtn1F5YvjBHAf28jDJ9Jr3AxMu4Wj Next: CdzxdMPGrZUMgn92KFbiHUBv7BvXJDZABBdf6ykgYztq Diff:
Old | New | Differences | |
---|---|---|---|
16 | 16 | } | |
17 | 17 | ||
18 | 18 | ||
19 | + | ||
20 | + | @Callable(i) | |
21 | + | func withdraw (TransactionHash) = { | |
22 | + | let currentKey = toBase58String(i.caller.bytes) | |
23 | + | let fetchcurrentKey = getStringValue(this, (TransactionHash + "_Sender_pubkey")) | |
24 | + | let fetchAssetID = getStringValue(this, (TransactionHash + "_Sender_AssetID")) | |
25 | + | let fetchAmount = getIntegerValue(this, (TransactionHash + "_Sender_amount")) | |
26 | + | let AssetID = "GyqTYDea3DWBaAyQs5S5uH2223ucELYFazJpZLCfMznU" | |
27 | + | if ((currentKey != fetchcurrentKey)) | |
28 | + | then throw("You are not an authorized user to Withdraw Funds or Wrong Public Key.") | |
29 | + | else if ((0 > fetchAmount)) | |
30 | + | then throw("fetch amount can't be Zero") | |
31 | + | else ScriptResult(WriteSet([DataEntry((TransactionHash + "_Sender_Status"), "WITHDRAW_COMPLETED"), DataEntry((TransactionHash + "_Sender_amount"), 0)]), TransferSet([ScriptTransfer(i.caller, fetchAmount, unit)])) | |
32 | + | } | |
33 | + | ||
34 | + | ||
19 | 35 | @Verifier(tx) | |
20 | 36 | func verify () = match tx { | |
21 | 37 | case _ => |
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 RKMTtoKSS () = { | |
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'GyqTYDea3DWBaAyQs5S5uH2223ucELYFazJpZLCfMznU' | |
12 | 12 | let txnhash = toBase58String(i.transactionId) | |
13 | 13 | if ((pmt.assetId != asset1)) | |
14 | 14 | then throw("Incorrect asset attached, please send GyqTYDea3DWBaAyQs5S5uH2223ucELYFazJpZLCfMznU (RKMT).") | |
15 | 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"), "GyqTYDea3DWBaAyQs5S5uH2223ucELYFazJpZLCfMznU"), DataEntry((txnhash + "_Sender_Status"), "PENDING")]) | |
16 | 16 | } | |
17 | 17 | ||
18 | 18 | ||
19 | + | ||
20 | + | @Callable(i) | |
21 | + | func withdraw (TransactionHash) = { | |
22 | + | let currentKey = toBase58String(i.caller.bytes) | |
23 | + | let fetchcurrentKey = getStringValue(this, (TransactionHash + "_Sender_pubkey")) | |
24 | + | let fetchAssetID = getStringValue(this, (TransactionHash + "_Sender_AssetID")) | |
25 | + | let fetchAmount = getIntegerValue(this, (TransactionHash + "_Sender_amount")) | |
26 | + | let AssetID = "GyqTYDea3DWBaAyQs5S5uH2223ucELYFazJpZLCfMznU" | |
27 | + | if ((currentKey != fetchcurrentKey)) | |
28 | + | then throw("You are not an authorized user to Withdraw Funds or Wrong Public Key.") | |
29 | + | else if ((0 > fetchAmount)) | |
30 | + | then throw("fetch amount can't be Zero") | |
31 | + | else ScriptResult(WriteSet([DataEntry((TransactionHash + "_Sender_Status"), "WITHDRAW_COMPLETED"), DataEntry((TransactionHash + "_Sender_amount"), 0)]), TransferSet([ScriptTransfer(i.caller, fetchAmount, unit)])) | |
32 | + | } | |
33 | + | ||
34 | + | ||
19 | 35 | @Verifier(tx) | |
20 | 36 | func verify () = match tx { | |
21 | 37 | case _ => | |
22 | 38 | sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey) | |
23 | 39 | } | |
24 | 40 |
github/deemru/w8io/169f3d6 40.14 ms ◑