CRYPTO NEWS

Conversion from Wei to Ether gives different results

I’m trying to analyze the transaction of this contract, but sometimes when I try to convert from wei to ether value of tokens I got comma in different position than expected. This is how I proceed:

1)Fetch all transactions from Moralis API.
2)Take the ABI of the contract, and from the tx_input I decode the transaction in this way:

contract = web3.eth.contract(address=Web3.toChecksumAddress(tx["to_address"]), abi=abi['result']) func_obj, func_params = contract.decode_function_input(tx["input"]) 
  1. I get the wei value of token sent to the contract selecting the func_params with the following path func_params['amountsInOutMarketMaxFee'][0] in the case of Swap Function invoked.

Everything is fine unless in some case when I try to convert some numbers from wei to ether value I got different numbers than seen in explorers. For example when I fetch the following transaction from the contract above: https://polygonscan.com/tx/0xea4e56d19226aa07dcacc70a015c38c674644476fb99a9b4365195b415d16768 I got the following value:

20000000000000000000 

That’s the same amount you get from the decoded input in the blockchain explorer page. But if I try to convert the amount with the following function:

 Web3.fromWei(tx_data['amountsInOutMaxFee'][0], 'ether') 

I got 2.0 while on the blockchain explorer the amount is 20.0 Why is there this lack? Thank you for the answers.

Nexo claims “smear campaign” ignores its attempts to aid insolvent companies

CryptoSlate spoke to Nexo co-founder Antoni Trenchev regarding Nexo’s decision to increase insurance to $775 million, its moves to offer aid to struggling crypto firms, and the recent allegations claiming Nexo is in trouble. Trenchev told CryptoSlate that its move to increase insurance levels was a part of an ongoing plan to improve security unrelated::Listen

CryptoSlate spoke to Nexo co-founder Antoni Trenchev regarding Nexo’s decision to increase insurance to $775 million, its moves to offer aid to struggling crypto firms, and the recent allegations claiming Nexo is in trouble.

Trenchev told CryptoSlate that its move to increase insurance levels was a part of an ongoing plan to improve security unrelated to recent market volatility. Nexo holds assets in custody with third parties which are “fully protected” should “something happens to these assets under the care of our third-party custodians.” Nexo has not had to call on any of the insurances it holds.

Further, Trenchev confirmed that all loans are “strictly collateralized” and claimed it is”the most security-focused lender” in crypto. Amid allegations that Nexo may also be secretly insolvent, Trenchev said its public partnership with its third-party custodians means they “are confident everything is as it should be.”

The Nexo Co-Founder refused to comment on the potential source of recent allegations stating that “the recent noise in the space is anything other than a smear campaign.” In fact, Trenchev declared Nexo is in a solid position compared to others in the industry.

“A few of the better-known companies in the space are seemingly close to insolvency and the community is in turmoil. In stark contrast, Nexo continues to function normally and even has sufficient liquidity reserves to offer aid to these companies– we aim to restore public confidence and help their adversely affected clients and investors.”

In response to the state of Nexo’s offer to acquire Celsius’ assets Trenchev asserted  that “there are several ongoing processes for which Nexo has been approached to help with the provision of liquidity.” Further, Trenchev affirmed that Nexo is “committed to being part of the solution” to restore the reputation of crypto lending.

A recent post by Celsius stated that it is exploring “strategic transactions” to “stabilize” its liquidity issues. Neither party has neither confirmed nor denied that they are in negotiations.

Disclaimer: Nexo is an advertising partner for CryptoSlate.

The post Nexo claims “smear campaign” ignores its attempts to aid insolvent companies appeared first on CryptoSlate.

Conversion from Wei to Ether gives different results

Shopping cart
There are no products in the cart!
Continue shopping
0