tx · 9EGExVjMNwwNdohgK81wnqs63iX6knEPSpcDoaBCHRUh 3N17JMn4WESkhCSrcEwdADBZFAe8uiuvCGQ: -0.01400000 Waves 2021.09.22 12:10 [1714050] smart account 3N17JMn4WESkhCSrcEwdADBZFAe8uiuvCGQ > SELF 0.00000000 Waves
{ "type": 13, "id": "9EGExVjMNwwNdohgK81wnqs63iX6knEPSpcDoaBCHRUh", "fee": 1400000, "feeAssetId": null, "timestamp": 1632301683174, "version": 2, "chainId": 84, "sender": "3N17JMn4WESkhCSrcEwdADBZFAe8uiuvCGQ", "senderPublicKey": "BMLuSYJ8rvQD55waCoKpzCBhJAbY8s9pp4V5ZgxuzCBD", "proofs": [ "5nieDvYRXhqQL6voDEM2rrzkiLwBDdJE7jqKWUuvdEDDfQfetfKuhBEBAUF1bVYDxWgjRE176hwgh1URHLjgLshG" ], "script": "base64:AAIEAAAAAAAAAAcIAhIDCgEIAAAAAgAAAAAKQTRBQXNzZXRJRAEAAAAg/sQa4d7v52kifRLo73ftXd9xD7wgh9JaaHT98W4IWDcAAAAAC1VTRFRBc3NldElEAQAAACAIZYS3D/CKahrz4mjoLgiQJMPTJ1gDzSz2Ll4L39oVpAAAAAEAAAABaQEAAAAKV2Vla2x5Vm90ZQAAAAEAAAAORmF2b3VyaXRlQXNzZXQEAAAAA3BtdAMJAAAAAAAAAgkAAZAAAAABCAUAAAABaQAAAAhwYXltZW50cwAAAAAAAAAAAQkAAZEAAAACCAUAAAABaQAAAAhwYXltZW50cwAAAAAAAAAAAAkAAAIAAAABAgAAADlXZWVrbHkgVm90ZSBOZWVkIDAuMDAwMSBBNEEgVG9rZW4gYXMgQXR0YWNoZWQgcGF5bWVudFsxXS4EAAAACmN1cnJlbnRLZXkJAAJYAAAAAQgIBQAAAAFpAAAABmNhbGxlcgAAAAVieXRlcwQAAAAOV2VlazBUaW1lc3RhbXAAAAABe0aSU8AEAAAACGVhY2h3ZWVrAAAAAAAkDIQABAAAABJjdXJyZW50cnVubmluZ3dl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us": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 38GxLopQUMfKFjGffYWjhbQMMbh6UNCrBqnaxisf7JZa Next: 8noYN8SfWeDEg5Xw7EZZysYKdhdC2iddvvwf1k4cSdyi Diff:
Old | New | Differences | |
---|---|---|---|
6 | 6 | let USDTAssetID = base58'Zn3cLHW7aAVPm5aACcTjvg7e7iEy2cKDtbowok5qa9H' | |
7 | 7 | ||
8 | 8 | @Callable(i) | |
9 | - | func | |
9 | + | func WeeklyVote (FavouriteAsset) = { | |
10 | 10 | let pmt = if ((size(i.payments) == 1)) | |
11 | 11 | then i.payments[0] | |
12 | - | else throw("0.0001 A4A Token | |
12 | + | else throw("Weekly Vote Need 0.0001 A4A Token as Attached payment[1].") | |
13 | 13 | let currentKey = toBase58String(i.caller.bytes) | |
14 | - | let Week0Timestamp = | |
14 | + | let Week0Timestamp = 1628976600000 | |
15 | 15 | let eachweek = 604800000 | |
16 | 16 | let currentrunningweek = ((lastBlock.timestamp - Week0Timestamp) / eachweek) | |
17 | 17 | let checkassetbal = assetBalance(addressFromPublicKey(i.callerPublicKey), A4AAssetID) | |
21 | 21 | then throw("Minimum 1 A4A is required on Your Address to Vote. Please Mint or hold minimum 1 A4A on this Address.") | |
22 | 22 | else if ((pmt.assetId != A4AAssetID)) | |
23 | 23 | then throw((("Incorrect asset attached, please attach " + toBase58String(A4AAssetID)) + " AssetID Only.")) | |
24 | - | else if (( | |
25 | - | then throw("Please Attach | |
24 | + | else if ((pmt.amount != 10000)) | |
25 | + | then throw("Please Attach Exact 0.0001 A4A To Vote.") | |
26 | 26 | else if (if (if (if ((FavouriteAsset == "A4A")) | |
27 | 27 | then true | |
28 | 28 | else (FavouriteAsset == "ARRR")) |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 4 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let A4AAssetID = base58'J9VzWPfRSQyCbEv5oWpxLSihigbpbJsGBHJZV9Ct8ook' | |
5 | 5 | ||
6 | 6 | let USDTAssetID = base58'Zn3cLHW7aAVPm5aACcTjvg7e7iEy2cKDtbowok5qa9H' | |
7 | 7 | ||
8 | 8 | @Callable(i) | |
9 | - | func | |
9 | + | func WeeklyVote (FavouriteAsset) = { | |
10 | 10 | let pmt = if ((size(i.payments) == 1)) | |
11 | 11 | then i.payments[0] | |
12 | - | else throw("0.0001 A4A Token | |
12 | + | else throw("Weekly Vote Need 0.0001 A4A Token as Attached payment[1].") | |
13 | 13 | let currentKey = toBase58String(i.caller.bytes) | |
14 | - | let Week0Timestamp = | |
14 | + | let Week0Timestamp = 1628976600000 | |
15 | 15 | let eachweek = 604800000 | |
16 | 16 | let currentrunningweek = ((lastBlock.timestamp - Week0Timestamp) / eachweek) | |
17 | 17 | let checkassetbal = assetBalance(addressFromPublicKey(i.callerPublicKey), A4AAssetID) | |
18 | 18 | let fetchvotes = getIntegerValue(this, (FavouriteAsset + "_Total_Votes")) | |
19 | 19 | let totalvotes = (fetchvotes + 1) | |
20 | 20 | if ((100000000 > checkassetbal)) | |
21 | 21 | then throw("Minimum 1 A4A is required on Your Address to Vote. Please Mint or hold minimum 1 A4A on this Address.") | |
22 | 22 | else if ((pmt.assetId != A4AAssetID)) | |
23 | 23 | then throw((("Incorrect asset attached, please attach " + toBase58String(A4AAssetID)) + " AssetID Only.")) | |
24 | - | else if (( | |
25 | - | then throw("Please Attach | |
24 | + | else if ((pmt.amount != 10000)) | |
25 | + | then throw("Please Attach Exact 0.0001 A4A To Vote.") | |
26 | 26 | else if (if (if (if ((FavouriteAsset == "A4A")) | |
27 | 27 | then true | |
28 | 28 | else (FavouriteAsset == "ARRR")) | |
29 | 29 | then true | |
30 | 30 | else (FavouriteAsset == "TN")) | |
31 | 31 | then true | |
32 | 32 | else (FavouriteAsset == "WAVES")) | |
33 | 33 | then [StringEntry(("Voted_Asset_" + currentKey), FavouriteAsset), StringEntry("message", "<h1>You Voted Successfully!</h1><br>"), IntegerEntry("Current_Voting_Week", currentrunningweek), IntegerEntry("Week0Timestamp", Week0Timestamp), IntegerEntry("LastBlockTimeStamp", lastBlock.timestamp), IntegerEntry((FavouriteAsset + "_Total_Votes"), totalvotes), ScriptTransfer(i.caller, 1, A4AAssetID)] | |
34 | 34 | else throw("Blank/Wrong Input Entered For Voting.") | |
35 | 35 | } | |
36 | 36 | ||
37 | 37 | ||
38 | 38 | @Verifier(tx) | |
39 | 39 | func verify () = sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey) | |
40 | 40 |
github/deemru/w8io/169f3d6 29.15 ms ◑