Hey Man
Good Evening
I have a doubt 🥲
When I had to pass a value earlier
I used to do something like
contract.MethodName({value: price})
But now my method also has parameters. How to do it now ?
Jan 20, 2023, 7:45 PM
just add the parameters and at the end
, {value: price}
, {value: price}
like
function test(address) public payable
you can do
contract.test(address,{value: 1})
function test(address) public payable
you can do
contract.test(address,{value: 1})
Jan 20, 2023, 7:48 PM
Like this ?
Jan 20, 2023, 7:48 PM
msg.value is used like another parameter
yes, move the await inside the (
also i suggest to avoid "to.be.reverted"
use "to.be.revertedWith("your error")
use "to.be.revertedWith("your error")
more precise
Jan 20, 2023, 7:49 PM
Yes
I was trying to work with the former part first 😅
I was trying to work with the former part first 😅
Thanks it works now :0
🙇🏻🙇🏻
Is there a way to get inside this if block for tests ?
(bool success,) = msg.sender.call{value: proceeds}("");
Iif(!success){
revert nftMarketplace__unableToSend();
}
(bool success,) = msg.sender.call{value: proceeds}("");
Iif(!success){
revert nftMarketplace__unableToSend();
}
Jan 20, 2023, 8:41 PM
send eth to a contract that doesn' t have receive ()
Jan 20, 2023, 8:47 PM
as well as fallback
Jan 20, 2023, 8:48 PM
/job
Jan 20, 2023, 9:33 PM
Quick question, with an array of let's say, 100 uints, apart from a for loop, which other means can I use to get the smallest number of the array. Using Solidity of course
Jan 20, 2023, 9:49 PM
without a loop in general?
so all the algorithm that you could use are excluded?
Jan 20, 2023, 9:50 PM
Not without a loop in general
No. I just want a more efficient method, so that the function doesn't run out of gas or block
Jan 20, 2023, 9:58 PM
ok then you should check algorithm for your search
Jan 20, 2023, 9:58 PM
What kind on Solidity would work. And work fast?
Jan 20, 2023, 9:59 PM
algorithm is general
doesn't depend on the language
doesn't depend on the language
Jan 20, 2023, 10:00 PM