tx · 3BXHgiykf8xd4NT2DwiZ8jjdxbgmsDCXKaXQH8TcvzGF

3MwPF8FWd4fYohy6CXXB6wtjbRRvqFpxmdD:  -0.01000000 Waves

2023.07.30 13:53 [2688508] smart account 3MwPF8FWd4fYohy6CXXB6wtjbRRvqFpxmdD > SELF 0.00000000 Waves

{ "type": 13, "id": "3BXHgiykf8xd4NT2DwiZ8jjdxbgmsDCXKaXQH8TcvzGF", "fee": 1000000, "feeAssetId": null, "timestamp": 1690714415601, "version": 2, "chainId": 84, "sender": "3MwPF8FWd4fYohy6CXXB6wtjbRRvqFpxmdD", "senderPublicKey": "G6PnkMn8MpXBkNwsQKMn1o1V7EKMgZyHCJRdFMQuouBC", "proofs": [ "gR8PSj3j9x3g3kQE18wse5PzofrBBy9j6Q2gYm288fuHb9xwynHiHbLErgC7CujmTNcmvx4Nz3foNR5tDDAxH89" ], "script": "base64:BgIJCAISABIDCgEBBwAQY29udHJhY3RGaWxlTmFtZQICcDEAA1NFUAIBXwAIa2Fzc2V0SWQCB0Fzc2V0SUQACWtuZXdUb2tlbgIFVG9rZW4BCmtleUFzc2V0SUQACQC5CQIJAMwIAgICJXMJAMwIAgIHYXNzZXRJRAUDbmlsBQNTRVABB3dyYXBFcnIBA21zZwkAuQkCCQDMCAIFEGNvbnRyYWN0RmlsZU5hbWUJAMwIAgIBOgkAzAgCBQNtc2cFA25pbAIAAQh0aHJvd0VycgEDbXNnCQACAQkBB3dyYXBFcnIBBQNtc2cCAWkBDXRva2VuSXNzdWFuY2UABARuYW1lAghQUkFDVElDRQQLZGVzY3JpcHRpb24CCjE6MTAgd2F2ZXMECHF1YW50aXR5AICt4gQECGRlY2ltYWxzAAMEC2lzc3VlX3Rva2VuCQDCCAUFBG5hbWUFC2Rlc2NyaXB0aW9uBQhxdWFudGl0eQUIZGVjaW1hbHMGBAdhc3NldElkCQC4CAEFC2lzc3VlX3Rva2VuCQDMCAIFC2lzc3VlX3Rva2VuCQDMCAIJAQtCaW5hcnlFbnRyeQIFCGthc3NldElkBQdhc3NldElkCQDMCAIJAQtTdHJpbmdFbnRyeQIFCWtuZXdUb2tlbggFC2lzc3VlX3Rva2VuBG5hbWUFA25pbAFpAQhidXlUb2tlbgEIcXVhbnRpdHkECndhdmVzT3JFcnIJAAACCAkAkQMCCAUBaQhwYXltZW50cwAAB2Fzc2V0SWQFBHVuaXQEB2Fzc2V0SWQJARN2YWx1ZU9yRXJyb3JNZXNzYWdlAgkBEUBleHRyTmF0aXZlKDEwNTIpAgUEdGhpcwUIa2Fzc2V0SWQCIWlkINGC0L7QutC10L3QsCDQvdC1INC90LDQudC00LXQvQQNcGF5bWVudEFtb3VudAgJAJEDAggFAWkIcGF5bWVudHMAAAZhbW91bnQEC3Rva2VuX3ByaWNlAJBOBAphbW91bnRfZHVlCQBoAgULdG9rZW5fcHJpY2UFCHF1YW50aXR5BAdwYXltZW50BAckbWF0Y2gwCQCRAwIIBQFpCHBheW1lbnRzAAADCQABAgUHJG1hdGNoMAIPQXR0YWNoZWRQYXltZW50BAFwBQckbWF0Y2gwBQFwCQACAQIWU2VuZCBleGFjdGx5IDAuMSBXQVZFUwMJAQIhPQIFCndhdmVzT3JFcnIGCQEIdGhyb3dFcnIBAivQn9C70LDRgtC10LYg0LTQvtC70LbQtdC9INCx0YvRgtGMINCyIFdBVkVTAwkBAiE9AgUNcGF5bWVudEFtb3VudAUKYW1vdW50X2R1ZQkBCHRocm93RXJyAQIy0J3QtdC/0YDQsNCy0LjQu9GM0L3QsNGPINGB0YPQvNC80LAg0L/Qu9Cw0YLQtdC20LAJAMwIAgkBDlNjcmlwdFRyYW5zZmVyAwgFAWkGY2FsbGVyBQhxdWFudGl0eQUHYXNzZXRJZAUDbmlsADas2K4=", "height": 2688508, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: FafG5DvVanaRDEkCksLGrm7X1z6BKffizJEzQtzvwLwr Next: BXPhdbCAZxfFsenrNqT3rnxGkEVyWTkhNJsTQeKDA6Ri Diff:
OldNewDifferences
3636 let wavesOrErr = (i.payments[0].assetId == unit)
3737 let assetId = valueOrErrorMessage(getBinaryValue(this, kassetId), "id токена не найден")
3838 let paymentAmount = i.payments[0].amount
39- let token_price = 100000
39+ let token_price = 10000
4040 let amount_due = (token_price * quantity)
4141 let payment = match i.payments[0] {
4242 case p: AttachedPayment =>
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 6 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 let contractFileName = "p1"
55
66 let SEP = "_"
77
88 let kassetId = "AssetID"
99
1010 let knewToken = "Token"
1111
1212 func keyAssetID () = makeString(["%s", "assetID"], SEP)
1313
1414
1515 func wrapErr (msg) = makeString([contractFileName, ":", msg], "")
1616
1717
1818 func throwErr (msg) = throw(wrapErr(msg))
1919
2020
2121 @Callable(i)
2222 func tokenIssuance () = {
2323 let name = "PRACTICE"
2424 let description = "1:10 waves"
2525 let quantity = 10000000
2626 let decimals = 3
2727 let issue_token = Issue(name, description, quantity, decimals, true)
2828 let assetId = calculateAssetId(issue_token)
2929 [issue_token, BinaryEntry(kassetId, assetId), StringEntry(knewToken, issue_token.name)]
3030 }
3131
3232
3333
3434 @Callable(i)
3535 func buyToken (quantity) = {
3636 let wavesOrErr = (i.payments[0].assetId == unit)
3737 let assetId = valueOrErrorMessage(getBinaryValue(this, kassetId), "id токена не найден")
3838 let paymentAmount = i.payments[0].amount
39- let token_price = 100000
39+ let token_price = 10000
4040 let amount_due = (token_price * quantity)
4141 let payment = match i.payments[0] {
4242 case p: AttachedPayment =>
4343 p
4444 case _ =>
4545 throw("Send exactly 0.1 WAVES")
4646 }
4747 if ((wavesOrErr != true))
4848 then throwErr("Платеж должен быть в WAVES")
4949 else if ((paymentAmount != amount_due))
5050 then throwErr("Неправильная сумма платежа")
5151 else [ScriptTransfer(i.caller, quantity, assetId)]
5252 }
5353
5454

github/deemru/w8io/026f985 
22.67 ms