You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
当合约接收ETH的时候,`receive()`会被触发。`receive()`最好不要执行太多的逻辑因为如果别人用`send`和`transfer`方法发送`ETH`的话,`gas`会限制在`2300`,`receive()`太复杂可能会触发`Out of Gas`报错;如果用`call`就可以自定义`gas`执行更复杂的逻辑(这三种发送ETH的方法我们之后会讲到)。
37
+
当合约接收ETH的时候,`receive()`会被触发。`receive()`最好不要执行太多的逻辑,因为如果别人用`send`或`transfer`方法发送`ETH`的话,`gas`会被限制在`2300`,`receive()`太复杂可能会触发`Out of Gas`报错,进而导致整个交易失败;如果用`call`就可以自定义`gas`执行更复杂的逻辑(这三种发送ETH的方法我们之后会讲到)。
0 commit comments