tx · 82drciUupAcLvmcDSrUPDR8rh3xrrbigTHcLXs7MMbEL

3MwPF8FWd4fYohy6CXXB6wtjbRRvqFpxmdD:  -0.01000000 Waves

2023.07.27 20:33 [2684574] smart account 3MwPF8FWd4fYohy6CXXB6wtjbRRvqFpxmdD > SELF 0.00000000 Waves

{ "type": 13, "id": "82drciUupAcLvmcDSrUPDR8rh3xrrbigTHcLXs7MMbEL", "fee": 1000000, "feeAssetId": null, "timestamp": 1690479245616, "version": 2, "chainId": 84, "sender": "3MwPF8FWd4fYohy6CXXB6wtjbRRvqFpxmdD", "senderPublicKey": "G6PnkMn8MpXBkNwsQKMn1o1V7EKMgZyHCJRdFMQuouBC", "proofs": [ "dM54pCPNy7kH3wrFLbGCWGyWRz6gpBNUSrrer6ZG7SMrzYyp6esTnP3w1a65uHgi6L3D5dkAJUZw7o9STxgbMPb" ], "script": "base64:BgIJCAISABIDCgEBBgAQY29udHJhY3RGaWxlTmFtZQICcDEAA1NFUAIBXwAIa2Fzc2V0SWQCB0Fzc2V0SUQACWtuZXdUb2tlbgIFVG9rZW4BB3dyYXBFcnIBA21zZwkAuQkCCQDMCAIFEGNvbnRyYWN0RmlsZU5hbWUJAMwIAgIBOgkAzAgCBQNtc2cFA25pbAIAAQh0aHJvd0VycgEDbXNnCQACAQkBB3dyYXBFcnIBBQNtc2cCAWkBDXRva2VuSXNzdWFuY2UABARuYW1lAghQUkFDVElDRQQLZGVzY3JpcHRpb24CCjE6MTAgd2F2ZXMECHF1YW50aXR5AICt4gQECGRlY2ltYWxzAAMEC2lzc3VlX3Rva2VuCQDCCAUFBG5hbWUFC2Rlc2NyaXB0aW9uBQhxdWFudGl0eQUIZGVjaW1hbHMGBAdhc3NldElkCQC4CAEFC2lzc3VlX3Rva2VuCQDMCAIFC2lzc3VlX3Rva2VuCQDMCAIJAQtCaW5hcnlFbnRyeQIFCGthc3NldElkBQdhc3NldElkCQDMCAIJAQtTdHJpbmdFbnRyeQIFCWtuZXdUb2tlbggFC2lzc3VlX3Rva2VuBG5hbWUFA25pbAFpAQlidXlzVG9rZW4BCHF1YW50aXR5BAp3YXZlc09yRXJyCQAAAggJAJEDAggFAWkIcGF5bWVudHMAAAdhc3NldElkBQR1bml0BAdhc3NldElkCQETdmFsdWVPckVycm9yTWVzc2FnZQIJARFAZXh0ck5hdGl2ZSgxMDUyKQIFBHRoaXMFCGthc3NldElkAiFpZCDRgtC+0LrQtdC90LAg0L3QtSDQvdCw0LnQtNC10L0EDXBheW1lbnRBbW91bnQICQCRAwIIBQFpCHBheW1lbnRzAAAGYW1vdW50BAt0b2tlbl9wcmljZQkAaQIAAQCAreIEBAphbW91bnRfZHVlCQBoAgULdG9rZW5fcHJpY2UFCHF1YW50aXR5AwMJAAACBQp3YXZlc09yRXJyBgkAAAIFDXBheW1lbnRBbW91bnQFCmFtb3VudF9kdWUHCQDMCAIJAQ5TY3JpcHRUcmFuc2ZlcgMIBQFpBmNhbGxlcgUIcXVhbnRpdHkFB2Fzc2V0SWQFA25pbAkBCHRocm93RXJyAQIr0J/Qu9Cw0YLQtdC2INC00L7Qu9C20LXQvSDQsdGL0YLRjCDQsiBXQVZFUwADwhWh", "height": 2684574, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: E2rZoYwoa6b9VsNPQCNNW33tHF7zn7zHoGyvzsx8PRef Next: FmLU4XSN479srnTbPzuq5GkeLeW1Jif1Y8BXvvHMrrFG Diff:
OldNewDifferences
3333 let wavesOrErr = (i.payments[0].assetId == unit)
3434 let assetId = valueOrErrorMessage(getBinaryValue(this, kassetId), "id токена не найден")
3535 let paymentAmount = i.payments[0].amount
36- let token_price = (1 / 10000)
36+ let token_price = (1 / 10000000)
3737 let amount_due = (token_price * quantity)
38- if ((wavesOrErr == true))
38+ if (if ((wavesOrErr == true))
39+ then (paymentAmount == amount_due)
40+ else false)
3941 then [ScriptTransfer(i.caller, quantity, assetId)]
4042 else throwErr("Платеж должен быть в WAVES")
4143 }
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 wrapErr (msg) = makeString([contractFileName, ":", msg], "")
1313
1414
1515 func throwErr (msg) = throw(wrapErr(msg))
1616
1717
1818 @Callable(i)
1919 func tokenIssuance () = {
2020 let name = "PRACTICE"
2121 let description = "1:10 waves"
2222 let quantity = 10000000
2323 let decimals = 3
2424 let issue_token = Issue(name, description, quantity, decimals, true)
2525 let assetId = calculateAssetId(issue_token)
2626 [issue_token, BinaryEntry(kassetId, assetId), StringEntry(knewToken, issue_token.name)]
2727 }
2828
2929
3030
3131 @Callable(i)
3232 func buysToken (quantity) = {
3333 let wavesOrErr = (i.payments[0].assetId == unit)
3434 let assetId = valueOrErrorMessage(getBinaryValue(this, kassetId), "id токена не найден")
3535 let paymentAmount = i.payments[0].amount
36- let token_price = (1 / 10000)
36+ let token_price = (1 / 10000000)
3737 let amount_due = (token_price * quantity)
38- if ((wavesOrErr == true))
38+ if (if ((wavesOrErr == true))
39+ then (paymentAmount == amount_due)
40+ else false)
3941 then [ScriptTransfer(i.caller, quantity, assetId)]
4042 else throwErr("Платеж должен быть в WAVES")
4143 }
4244
4345

github/deemru/w8io/026f985 
19.93 ms