When I use the toAddress.call{value: amt}(""); code, it works fine to transfer ether to EOA account but comes back false if its sent to contract. Why is that?
Asked
Active
Viewed 40 times
1
Hoi Nam
- 13
- 2
1 Answers
1
By default, a contract can't receive Ethers and will refuse the send.
For a contract to be able to receive Ethers, you should have a function with the payable keyword (and call that function), or use the generic fallback receive function. More info at https://ethereum.stackexchange.com/a/81995/31933
Lauri Peltonen
- 29,391
- 3
- 20
- 57