After doing a simple calculation in rust ink! 4.0 smart contract, the result is incorrect and doesn't match the expected result.
Here is the simple formula:
let a0_balance_mul:U256 = U256::from(amount_in_with_lp_fees * self.get_a0_balance());
The variables for the above formula are:
amount_in_with_lp_fees = 100,000,000,000,000,000,000
self.get_a0_balance() = 10,000,000,000,000,000,000
The result that Im getting is : 319,435,266,158,123,073,073,250,785,136,463,577,088
Which should be : 1000000000000000000000000000000000000000
I've checked both numbers and they are both represented correctly using U256
int.
Thanks in advance.