tx · Fh34HCqHcXyRnNRSA4N6TttBgTjFEvViCQ76Pdp2RW55

3N1XAEyg1TQGa5FCEerrRhLGi5KyVq26Xm8:  -0.00200000 Waves

2023.01.15 18:07 [2406222] smart account 3N1XAEyg1TQGa5FCEerrRhLGi5KyVq26Xm8 > SELF 0.00000000 Waves

{ "type": 13, "id": "Fh34HCqHcXyRnNRSA4N6TttBgTjFEvViCQ76Pdp2RW55", "fee": 200000, "feeAssetId": null, "timestamp": 1673795386548, "version": 2, "chainId": 84, "sender": "3N1XAEyg1TQGa5FCEerrRhLGi5KyVq26Xm8", "senderPublicKey": "ATuPi6fn8277fNiCoRgPTav9QG15CJoW95GEGcDmfYt8", "proofs": [ "2Jqrwu6QJ6JGmrZC9TUmDcS5tsoqXVPuTXNmyAsb4Lf2tkohQrAEGAQ7HcTuu7fZaGvGiviC8hoQusrQ8GTQTcvV" ], "script": "base64:BgIKCAISABIECgIBAQsABXdjZElkAiw1V0U2SEJWc21BYmFwVG1US3BteVdtVVI2N2ZjMTZ5YkZyTmp4em1EQnRQYQALd2NkRGVjaW1hbHMAAgETdG90YWxTaGFyZUJ5VXNlcktFWQEFb3duZXIJALkJAgkAzAgCAgZzaGFyZXMJAMwIAgUFb3duZXIFA25pbAIBXwEUdG90YWxTaGFyZUJ5VXNlclJFQUQBBW93bmVyCQELdmFsdWVPckVsc2UCCQCaCAIFBHRoaXMJARN0b3RhbFNoYXJlQnlVc2VyS0VZAQUFb3duZXIAAAASdG90YWxJc3N1ZWRXQ0RfS0VZAhB0b3RhbF9pc3N1ZWRfV0NEARN0b3RhbElzc3VlZFdDRF9SRUFEAAkBC3ZhbHVlT3JFbHNlAgkAmggCBQR0aGlzBRJ0b3RhbElzc3VlZFdDRF9LRVkAAAAOdG90YWxTaGFyZXNLRVkCDHRvdGFsX3NoYXJlcwEPdG90YWxTaGFyZXNSRUFEAAkBC3ZhbHVlT3JFbHNlAgkAmggCBQR0aGlzBQ50b3RhbFNoYXJlc0tFWQAAAApwYXJhbUFfS0VZAgFBAQtwYXJhbUFfUkVBRAAJAQt2YWx1ZU9yRWxzZQIJAJoIAgUEdGhpcwIBQQBkAQxjb21wdXRlVE1ESVICCmlzc3VlZF93Y2QBQQkAawMAgK3iBACgjQYJAGwGBQppc3N1ZWRfd2NkBQt3Y2REZWNpbWFscwUBQQACAAUFBkhBTEZVUAIBaQENZGVwb3NpdF9zaGFyZQAEA3BtdAMJAAACCQCQAwEIBQFpCHBheW1lbnRzAAEJAJEDAggFAWkIcGF5bWVudHMAAAkAAgECHEF0dGFjaGVkIHBheW1lbnQgaXMgcmVxdWlyZWQDCQEJaXNEZWZpbmVkAQgFA3BtdAdhc3NldElkCQACAQIWT25seSBXQVZFUyBpcyBhbGxvd2VkLgQHYWNjb3VudAkApQgBCAUBaQZjYWxsZXIEEHRvdGFsU2hhcmVCeVVzZXIJARR0b3RhbFNoYXJlQnlVc2VyUkVBRAEFB2FjY291bnQEC3RvdGFsU2hhcmVzCQEPdG90YWxTaGFyZXNSRUFEAAkAzAgCCQEMSW50ZWdlckVudHJ5AgkBE3RvdGFsU2hhcmVCeVVzZXJLRVkBBQdhY2NvdW50CQBkAgUQdG90YWxTaGFyZUJ5VXNlcggFA3BtdAZhbW91bnQJAMwIAgkBDEludGVnZXJFbnRyeQIFDnRvdGFsU2hhcmVzS0VZCQBkAgULdG90YWxTaGFyZXMIBQNwbXQGYW1vdW50BQNuaWwBaQEJZ2V0X3RtZGlyAgppc3N1ZWRfd2NkAUEJAAIBCQCsAgICCHJlc3VsdDogCQCkAwEJAQxjb21wdXRlVE1ESVICBQppc3N1ZWRfd2NkBQFBAGFUzDM=", "height": 2406222, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 3q5aWJE6w8a66sUcUFuS17qDg6r2brabBzo7tZxC1yrX Next: 6zr1VZkhQeJDq2uwW1uxxbz6sWTcGoWByStH78EJmH8n Diff:
OldNewDifferences
2626 func paramA_READ () = valueOrElse(getInteger(this, "A"), 100)
2727
2828
29-func computeTMDIR (issued_wcd,A) = pow(issued_wcd, wcdDecimals, A, 2, 8, HALFUP)
29+func computeTMDIR (issued_wcd,A) = fraction(10000000, 100000, pow(issued_wcd, wcdDecimals, A, 2, 5, HALFUP))
3030
3131
3232 @Callable(i)
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 6 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 let wcdId = "5WE6HBVsmAbapTmTKpmyWmUR67fc16ybFrNjxzmDBtPa"
55
66 let wcdDecimals = 2
77
88 func totalShareByUserKEY (owner) = makeString(["shares", owner], "_")
99
1010
1111 func totalShareByUserREAD (owner) = valueOrElse(getInteger(this, totalShareByUserKEY(owner)), 0)
1212
1313
1414 let totalIssuedWCD_KEY = "total_issued_WCD"
1515
1616 func totalIssuedWCD_READ () = valueOrElse(getInteger(this, totalIssuedWCD_KEY), 0)
1717
1818
1919 let totalSharesKEY = "total_shares"
2020
2121 func totalSharesREAD () = valueOrElse(getInteger(this, totalSharesKEY), 0)
2222
2323
2424 let paramA_KEY = "A"
2525
2626 func paramA_READ () = valueOrElse(getInteger(this, "A"), 100)
2727
2828
29-func computeTMDIR (issued_wcd,A) = pow(issued_wcd, wcdDecimals, A, 2, 8, HALFUP)
29+func computeTMDIR (issued_wcd,A) = fraction(10000000, 100000, pow(issued_wcd, wcdDecimals, A, 2, 5, HALFUP))
3030
3131
3232 @Callable(i)
3333 func deposit_share () = {
3434 let pmt = if ((size(i.payments) == 1))
3535 then i.payments[0]
3636 else throw("Attached payment is required")
3737 if (isDefined(pmt.assetId))
3838 then throw("Only WAVES is allowed.")
3939 else {
4040 let account = toString(i.caller)
4141 let totalShareByUser = totalShareByUserREAD(account)
4242 let totalShares = totalSharesREAD()
4343 [IntegerEntry(totalShareByUserKEY(account), (totalShareByUser + pmt.amount)), IntegerEntry(totalSharesKEY, (totalShares + pmt.amount))]
4444 }
4545 }
4646
4747
4848
4949 @Callable(i)
5050 func get_tmdir (issued_wcd,A) = throw(("result: " + toString(computeTMDIR(issued_wcd, A))))
5151
5252

github/deemru/w8io/169f3d6 
30.54 ms