tx · B85n3erU3UowaFcoqhty2NnDXjf4iLSGguNSW9Yax4z3

3MtkCfhJSAZ6P2bsBM2DdpurZ7S1vepUvrc:  -0.01400000 Waves

2019.09.27 18:15 [694987] smart account 3MtkCfhJSAZ6P2bsBM2DdpurZ7S1vepUvrc > SELF 0.00000000 Waves

{ "type": 13, "id": "B85n3erU3UowaFcoqhty2NnDXjf4iLSGguNSW9Yax4z3", "fee": 1400000, "feeAssetId": null, "timestamp": 1569597375321, "version": 1, "sender": "3MtkCfhJSAZ6P2bsBM2DdpurZ7S1vepUvrc", "senderPublicKey": "5M8TjFdQ2hPL23uw5RrCvaES2qU4NpCtn68zqTyiYm2E", "proofs": [ "5Mr5AusGuVoXN3xhsQtbVbNGMrjLFNErJQZvQRkWrEdcesoJTXcCpuzuid6k2kVUWhuHhGPxfyEtzNAMp4dBPJZQ" ], "script": "base64:AAIDAAAAAAAAAAAAAAAEAAAAAAdXQVZFTEVUCQAAaAAAAAIJAABoAAAAAgAAAAAAAAAAZAAAAAAAAAAD6AAAAAAAAAAD6AAAAAAKQ09NTUlTU0lPTgkAAGkAAAACCQAAaAAAAAIAAAAAAAAAAAUFAAAAB1dBVkVMRVQAAAAAAAAAA+gAAAAAB3Rva2VuSUQCAAAALDR5c1plVXZ0QnJTVmdKOXYzTWZoM2JXRDJXTlBkNWtRODI3cGlvZ3dwTXg0AAAAAA1wbGF5ZXJTdG9yYWdlCQEAAAAcQGV4dHJVc2VyKGFkZHJlc3NGcm9tU3RyaW5nKQAAAAECAAAAIzNNeFphV0ptZHlwanY4TU12OFJQVHREcTRHTk1QZENpc0pQAAAAAQAAAAFpAQAAAANidXkAAAACAAAACHBsYXllcklEAAAAC3BhY2thZ2VOYW1lBAAAAAR0eElkCQACWAAAAAEIBQAAAAFpAAAADXRyYW5zYWN0aW9uSWQEAAAAA3BtdAkBAAAAB2V4dHJhY3QAAAABCAUAAAABaQAAAAdwYXltZW50BAAAAApwYXltZW50QW10CAUAAAADcG10AAAABmFtb3Vud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uDRRTpqP Diff:
OldNewDifferences
77
88 let tokenID = "4ysZeUvtBrSVgJ9v3Mfh3bWD2WNPd5kQ827piogwpMx4"
99
10-let playerStorage = "3MxZaWJmdypjv8MMv8RPTtDq4GNMPdCisJP"
10+let playerStorage = addressFromStringValue("3MxZaWJmdypjv8MMv8RPTtDq4GNMPdCisJP")
1111
1212 @Callable(i)
1313 func buy (playerID,packageName) = {
3636 else {
3737 let playerAddressStr = toString(playerAddress)
3838 let paymentSumStr = toString(paymentSum)
39- let gameWalletStr = "3MvPwvMQPcSEuGMoCJo6X9zi8rr4aEiWWpF"
40- let gameWalletAddress = addressFromStringValue(gameWalletStr)
41- let tokensTransfer = [ScriptTransfer(gameWalletAddress, 5, toBytes(tokenID))]
42- TransferSet(tokensTransfer)
39+ let gameWalletStr = getStringValue(playerStorage, (playerID + "_address"))
40+ if ((1 == 1))
41+ then throw(("Player game Wallet = " + gameWalletStr))
42+ else {
43+ let gameWalletAddress = addressFromStringValue(gameWalletStr)
44+ let tokensTransfer = [ScriptTransfer(gameWalletAddress, 5, toBytes(tokenID))]
45+ TransferSet(tokensTransfer)
46+ }
4347 }
4448 }
4549 }
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 3 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 let WAVELET = ((100 * 1000) * 1000)
55
66 let COMMISSION = ((5 * WAVELET) / 1000)
77
88 let tokenID = "4ysZeUvtBrSVgJ9v3Mfh3bWD2WNPd5kQ827piogwpMx4"
99
10-let playerStorage = "3MxZaWJmdypjv8MMv8RPTtDq4GNMPdCisJP"
10+let playerStorage = addressFromStringValue("3MxZaWJmdypjv8MMv8RPTtDq4GNMPdCisJP")
1111
1212 @Callable(i)
1313 func buy (playerID,packageName) = {
1414 let txId = toBase58String(i.transactionId)
1515 let pmt = extract(i.payment)
1616 let paymentAmt = pmt.amount
1717 let paymentSum = ((paymentAmt - COMMISSION) / WAVELET)
1818 let isExistPackage = isDefined(getStringValue(this, packageName))
1919 if (!(isExistPackage))
2020 then throw("This package doesn't exist anymore")
2121 else {
2222 let packageNameData = split(packageName, "_")
2323 let tokensAmount = parseIntValue(packageNameData[0])
2424 let actualPrice = parseIntValue(getStringValue(this, packageName))
2525 if ((paymentSum != actualPrice))
2626 then throw(((("Donation amount should be " + toString(actualPrice)) + " Waves, but we got ") + toString(paymentSum)))
2727 else {
2828 let betNotInWaves = isDefined(pmt.assetId)
2929 let feeNotInWaves = isDefined(pmt.assetId)
3030 let playerPubKey58 = toBase58String(i.callerPublicKey)
3131 let playerAddress = addressFromPublicKey(fromBase58String(playerPubKey58))
3232 if (betNotInWaves)
3333 then throw("Bet amount must be in Waves")
3434 else if (feeNotInWaves)
3535 then throw("Transaction's fee must be in Waves")
3636 else {
3737 let playerAddressStr = toString(playerAddress)
3838 let paymentSumStr = toString(paymentSum)
39- let gameWalletStr = "3MvPwvMQPcSEuGMoCJo6X9zi8rr4aEiWWpF"
40- let gameWalletAddress = addressFromStringValue(gameWalletStr)
41- let tokensTransfer = [ScriptTransfer(gameWalletAddress, 5, toBytes(tokenID))]
42- TransferSet(tokensTransfer)
39+ let gameWalletStr = getStringValue(playerStorage, (playerID + "_address"))
40+ if ((1 == 1))
41+ then throw(("Player game Wallet = " + gameWalletStr))
42+ else {
43+ let gameWalletAddress = addressFromStringValue(gameWalletStr)
44+ let tokensTransfer = [ScriptTransfer(gameWalletAddress, 5, toBytes(tokenID))]
45+ TransferSet(tokensTransfer)
46+ }
4347 }
4448 }
4549 }
4650 }
4751
4852

github/deemru/w8io/169f3d6 
43.44 ms