Lesson 4: Receive & Fall back #641
-
Hello, I need help with when I send eth to my contract via Metamask, I get an error in rinkeby etherscan saying " Warning! Error encountered during contract execution [out of gas] " This is for the Fundme.sol file I have wrote the code below receive() external payable{
} These were the lines that Patrick showed during the video where doing that should let me send eth to the contract via MetaMask, In solidity the code compiled correctly and everything is fine but I am not able to fund the contract with Eth via metamask but I am able to fund it via the contract meaning via Remix. any help would be appreciated. Thanks again |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 5 replies
-
what does your might of not met a require statement |
Beta Was this translation helpful? Give feedback.
-
@SummerShyne Make sure you have enough funds in your wallet account and pass value according to the correct price as @mattjaf mentioned. After doing this if you still face the issue then you can manually set the gas cost when the MetaMask will popup. By default, the base fee is set the 21000, if computation costs more gas then we need to give more gas. Wallets have the feature to automatically detect the gas cost, if MetaMask is failing in doing so, then should manually select the higher fee, and all the remaining gas will return to the wallet. |
Beta Was this translation helpful? Give feedback.
-
Beta Was this translation helpful? Give feedback.
what does your
fund()
function look likemight of not met a require statement