0

This is a very common question. I am trying to withdraw fund from the contract. I have tried send,transfer and call but the transaction hash always shows 0 value transferred

pragma solidity >=0.4.22 <0.9.0;

function withdraw(address payable _to, uint256 _amount) public returns (bool){
    bool sent = _to.send(_amount);
    return sent;
}

enter image description here

I can see the amount is right in the method request, but not sure what i am doing wrong

In addition, I did verify the contract has enough balance

enter image description here

I am not sure, what i am doing wrong

2
  • We can’t see the pictures fix the post :)
    – Majd TL
    Nov 12 '21 at 21:04
  • If you click on the image, it expands. @MajdTL. Do you want me to capture more info from ganache? Nov 12 '21 at 21:21
0

Works as expected. send method works instead of the other one FYI

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.