I have a Struct set that stores uint256 price.
So, when I have to store a decimal number into the āpriceā. I do
const price = Moralis.Units.ETH(price)
So, now the mapping in contract stores the data of price as 1100000000000000000 for 1.1 ETH.
When I have to call a function to send ETH to the contract will I need to change the amount of ETH sent by the user?
Like:
if(listing.price > msg.value) // this returns true. as the listing price has been set by 10**18 but the msg.value is only 1.1
Will it cause any security problem if I did:
uint256 val = msg.value * 10**18;
(listing.price > msg.value) // here it returns false as both has same amt of value now.