tx · DFSj3Tv43wpsdDZuwk9Dfv7ymTjAYFqGyssUC21bPz9Y 3MtkCfhJSAZ6P2bsBM2DdpurZ7S1vepUvrc: -0.01400000 Waves 2019.09.28 01:26 [695441] smart account 3MtkCfhJSAZ6P2bsBM2DdpurZ7S1vepUvrc > SELF 0.00000000 Waves
{ "type": 13, "id": "DFSj3Tv43wpsdDZuwk9Dfv7ymTjAYFqGyssUC21bPz9Y", "fee": 1400000, "feeAssetId": null, "timestamp": 1569623219039, "version": 1, "sender": "3MtkCfhJSAZ6P2bsBM2DdpurZ7S1vepUvrc", "senderPublicKey": "5M8TjFdQ2hPL23uw5RrCvaES2qU4NpCtn68zqTyiYm2E", "proofs": [ "53Mcth5MJZ4jySDMptnfpmgq7Lhz4rC1P9ygqsshgMtjLcDenqBE8LwsqhXLvzVbuuEVLBBwCCahV1REogkNNbGg" ], "script": "base64:AAIDAAAAAAAAAAAAAAAGAAAAAAdXQVZFTEVUCQAAaAAAAAIJAABoAAAAAgAAAAAAAAAAZAAAAAAAAAAD6AAAAAAAAAAD6AAAAAAKQ09NTUlTU0lPTgkAAGkAAAACCQAAaAAAAAIAAAAAAAAAAAUFAAAAB1dBVkVMRVQAAAAAAAAAA+gAAAAAB3Rva2VuSUQCAAAAPEo0WlhldUtiMnJaSG9pdFVIaFJIVlpwcWU5TkJuQ2s2WDJBeG5pbXVlZ2NzdGNEVkNockJ1RFFQOGdYTQAAAAAJcHJpemVQb29sCQEAAAAcQGV4dHJVc2VyKGFkZHJlc3NGcm9tU3RyaW5nKQAAAAECAAAAIzNNcnF6WGZRV1RyaHJKNkdCYW1Td0tLRHozMWdkWExnQ2FyAAAAAAdwcm9qZWN0CQEAAAAcQGV4dHJVc2VyKGFkZHJlc3NGcm9tU3RyaW5nKQAAAAECAAAAIzNONUx5NGJrdmc1dUZqZjlCcGVBc2lrOExxMnNmSFljMkhVAAAAAA1wbGF5ZXJTdG9yYWdlCQEAAAAcQGV4dHJVc2VyKGFkZHJlc3NGcm9t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AAAxoYWxmT2ZEb25hdGUFAAAABHVuaXQJAARMAAAAAgkBAAAADlNjcmlwdFRyYW5zZmVyAAAAAwUAAAAHcHJvamVjdAUAAAAMaGFsZk9mRG9uYXRlBQAAAAR1bml0CQAETAAAAAIJAQAAAA5TY3JpcHRUcmFuc2ZlcgAAAAMFAAAAEWdhbWVXYWxsZXRBZGRyZXNzAAAAAAAAACcQBQAAAAR1bml0BQAAAANuaWwAAAAAQr5ELg==", "chainId": 84, "height": 695441, "spentComplexity": 0 } View: original | compacted Prev: 5fJhgtzFZhVjxco49eggwTrF3oVxxpm95YHEemavQnoU Next: 3GvXautqWaQhJwFp7Gn5zAWeBwhyS3xgfeZPRzr5zaQo Diff:
Old | New | Differences | |
---|---|---|---|
5 | 5 | ||
6 | 6 | let COMMISSION = ((5 * WAVELET) / 1000) | |
7 | 7 | ||
8 | - | let tokenID = " | |
8 | + | let tokenID = "J4ZXeuKb2rZHoitUHhRHVZpqe9NBnCk6X2AxnimuegcstcDVChrBuDQP8gXM" | |
9 | 9 | ||
10 | 10 | let prizePool = addressFromStringValue("3MrqzXfQWTrhrJ6GBamSwKKDz31gdXLgCar") | |
11 | 11 | ||
38 | 38 | then throw("Bet amount must be in Waves") | |
39 | 39 | else if (feeNotInWaves) | |
40 | 40 | then throw("Transaction's fee must be in Waves") | |
41 | - | else if ((1 == 1)) | |
42 | - | then throw(toBase58String(toBytes(tokenID))) | |
43 | - | else { | |
44 | - | let playerAddressStr = toString(playerAddress) | |
45 | - | let paymentSumStr = toString(paymentSum) | |
46 | - | let gameWalletStr = getStringValue(playerStorage, (playerID + "_address")) | |
47 | - | let gameWalletAddress = addressFromStringValue(gameWalletStr) | |
48 | - | TransferSet([ScriptTransfer(prizePool, halfOfDonate, unit), ScriptTransfer(project, halfOfDonate, unit), ScriptTransfer(gameWalletAddress, 10000, unit)]) | |
49 | - | } | |
41 | + | else { | |
42 | + | let playerAddressStr = toString(playerAddress) | |
43 | + | let paymentSumStr = toString(paymentSum) | |
44 | + | let gameWalletStr = getStringValue(playerStorage, (playerID + "_address")) | |
45 | + | let gameWalletAddress = addressFromStringValue(gameWalletStr) | |
46 | + | TransferSet([ScriptTransfer(prizePool, halfOfDonate, unit), ScriptTransfer(project, halfOfDonate, unit), ScriptTransfer(gameWalletAddress, 10000, unit)]) | |
47 | + | } | |
50 | 48 | } | |
51 | 49 | } | |
52 | 50 | } |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 3 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let WAVELET = ((100 * 1000) * 1000) | |
5 | 5 | ||
6 | 6 | let COMMISSION = ((5 * WAVELET) / 1000) | |
7 | 7 | ||
8 | - | let tokenID = " | |
8 | + | let tokenID = "J4ZXeuKb2rZHoitUHhRHVZpqe9NBnCk6X2AxnimuegcstcDVChrBuDQP8gXM" | |
9 | 9 | ||
10 | 10 | let prizePool = addressFromStringValue("3MrqzXfQWTrhrJ6GBamSwKKDz31gdXLgCar") | |
11 | 11 | ||
12 | 12 | let project = addressFromStringValue("3N5Ly4bkvg5uFjf9BpeAsik8Lq2sfHYc2HU") | |
13 | 13 | ||
14 | 14 | let playerStorage = addressFromStringValue("3MxZaWJmdypjv8MMv8RPTtDq4GNMPdCisJP") | |
15 | 15 | ||
16 | 16 | @Callable(i) | |
17 | 17 | func buy (playerID,packageName) = { | |
18 | 18 | let txId = toBase58String(i.transactionId) | |
19 | 19 | let pmt = extract(i.payment) | |
20 | 20 | let paymentAmt = pmt.amount | |
21 | 21 | let halfOfDonate = ((paymentAmt - COMMISSION) / 2) | |
22 | 22 | let paymentSum = ((paymentAmt - COMMISSION) / WAVELET) | |
23 | 23 | let isExistPackage = isDefined(getStringValue(this, packageName)) | |
24 | 24 | if (!(isExistPackage)) | |
25 | 25 | then throw("This package doesn't exist anymore") | |
26 | 26 | else { | |
27 | 27 | let packageNameData = split(packageName, "_") | |
28 | 28 | let tokensAmount = parseIntValue(packageNameData[0]) | |
29 | 29 | let actualPrice = parseIntValue(getStringValue(this, packageName)) | |
30 | 30 | if ((paymentSum != actualPrice)) | |
31 | 31 | then throw(((("Donation amount should be " + toString(actualPrice)) + " Waves, but we got ") + toString(paymentSum))) | |
32 | 32 | else { | |
33 | 33 | let betNotInWaves = isDefined(pmt.assetId) | |
34 | 34 | let feeNotInWaves = isDefined(pmt.assetId) | |
35 | 35 | let playerPubKey58 = toBase58String(i.callerPublicKey) | |
36 | 36 | let playerAddress = addressFromPublicKey(fromBase58String(playerPubKey58)) | |
37 | 37 | if (betNotInWaves) | |
38 | 38 | then throw("Bet amount must be in Waves") | |
39 | 39 | else if (feeNotInWaves) | |
40 | 40 | then throw("Transaction's fee must be in Waves") | |
41 | - | else if ((1 == 1)) | |
42 | - | then throw(toBase58String(toBytes(tokenID))) | |
43 | - | else { | |
44 | - | let playerAddressStr = toString(playerAddress) | |
45 | - | let paymentSumStr = toString(paymentSum) | |
46 | - | let gameWalletStr = getStringValue(playerStorage, (playerID + "_address")) | |
47 | - | let gameWalletAddress = addressFromStringValue(gameWalletStr) | |
48 | - | TransferSet([ScriptTransfer(prizePool, halfOfDonate, unit), ScriptTransfer(project, halfOfDonate, unit), ScriptTransfer(gameWalletAddress, 10000, unit)]) | |
49 | - | } | |
41 | + | else { | |
42 | + | let playerAddressStr = toString(playerAddress) | |
43 | + | let paymentSumStr = toString(paymentSum) | |
44 | + | let gameWalletStr = getStringValue(playerStorage, (playerID + "_address")) | |
45 | + | let gameWalletAddress = addressFromStringValue(gameWalletStr) | |
46 | + | TransferSet([ScriptTransfer(prizePool, halfOfDonate, unit), ScriptTransfer(project, halfOfDonate, unit), ScriptTransfer(gameWalletAddress, 10000, unit)]) | |
47 | + | } | |
50 | 48 | } | |
51 | 49 | } | |
52 | 50 | } | |
53 | 51 | ||
54 | 52 |
github/deemru/w8io/026f985 31.20 ms ◑