(bool success,) = address(marketingWallet).call{value: ethForMarketing}("");

^ what does (bool succes,) do here? I'm guessing the call function on the other side returns a boolean and that is used there. But I'm not sure what the comma means?

Jul 22, 2022, 5:32 AM
Call returns two values, success status and the data returned from the function. You are assigning the Boolean to the variable success to later require it most likely
Jul 22, 2022, 5:43 AM
I was expecting smth like that, but always good to verify. Thanks!
Jul 22, 2022, 5:45 AM
yup, on some contracts, you can see things like
(item,,,,,)
this is just a way to iterate the array and extract (in variable) only what you need
Jul 22, 2022, 5:46 AM
I want my contract to sell LP tokens to the uniswap pair but I would like to make sure that I get back an exact amount of token0. Is there a way to do this?
Jul 22, 2022, 7:04 AM

© 2024 Draquery.com All rights reserved.