diff --git a/reference/exchanges/exchange-integration.md b/reference/exchanges/exchange-integration.md index 6f538147b..9bac78f62 100644 --- a/reference/exchanges/exchange-integration.md +++ b/reference/exchanges/exchange-integration.md @@ -107,6 +107,15 @@ When `GasFeeCap`, `GasPremium` and `MaxFee` are set to `0`, Lotus will do the ga Some JavaScript libraries attempt to estimate the gas fees before sending the transaction to the Filecoin network. However, they sometimes underestimate, leading to transactions getting stuck in the mempool. If you are noticing your transactions getting stuck in the mempool after sending them to the network using a JavaScript library, try `GasFeeCap`, `GasPremium`, and `MaxFee` to `0`. +### Filecoin's EVM and Method number for sends + +A summary of the Filecoin's EVM differences with Ethereum is available in the [FEVM - Difference with Ethereum section](/smart-contracts/filecoin-evm-runtime/difference-with-ethereum). + +{% hint style="danger" %} +Note that when sending funds to a Filecoin EVM recipient address (`f410f` or `0x`), it is recommended to always use the `InvokeEVM` `method 3844450837` to prevent possible loss of funds in case the recipient is a smart contract. The `lotus send 0x` CLI method always defaults to this method number. +{% endhint %} + + ## Integration You can interact with the network by using Lotus CLI or using the [JSON-RPC APIs](https://lotus.filecoin.io/reference/basics/overview/). Follow the [API tokens guide](https://lotus.filecoin.io/docs/developers/api-access/) to set up API tokens on your node and grant necessary permissions. To find all CLI usage, run `lotus -h` in your lotus folder. diff --git a/smart-contracts/filecoin-evm-runtime/difference-with-ethereum.md b/smart-contracts/filecoin-evm-runtime/difference-with-ethereum.md index a1a529583..fb78c6ea7 100644 --- a/smart-contracts/filecoin-evm-runtime/difference-with-ethereum.md +++ b/smart-contracts/filecoin-evm-runtime/difference-with-ethereum.md @@ -16,7 +16,7 @@ Filecoin charges Filecoin gas only. This includes the Filecoin EVM runtime. Inst 2. EVM instruction costs can depend on the exact Filecoin EVM runtime code-paths taken, and caching. {% hint style="danger" %} -⚠️ Filecoin gas costs are not set in stone and should never be hard-coded. Future network upgrades will break any smart contracts that depend on gas costs not changing. +Filecoin gas costs are not set in stone and should never be hard-coded. Future network upgrades will break any smart contracts that depend on gas costs not changing. {% endhint %} ## Gas stipend @@ -40,7 +40,9 @@ The `CALLCODE` opcode has not been implemented. Use the newer `DELEGATECALL` opc In Ethereum, `SELFDESTRUCT` is the only way to send funds to a smart contract without giving the target smart contract a chance to execute code. -In Filecoin, any actor can use `method 0`, also called a bare-value send, to transfer funds to any other actor without invoking the target actor’s code. You can think of this behavior as having the suggested [`PAY` opcode](https://eips.ethereum.org/EIPS/eip-5920) already implemented in Filecoin. +In Filecoin, any actor can use `method 0`, also called a bare-value send, to transfer funds to any other actor without invoking the target actor’s code. You can think of this behavior as having the suggested [`PAY` opcode](https://eips.ethereum.org/EIPS/eip-5920) already implemented in Filecoin. However by default, Solidity smart contracts do not accept bare value transfers, unless the author implements the [receive() or fallback() function](https://docs.soliditylang.org/en/v0.8.17/contracts.html#receive-ether-function). For more information see [FIP Discussion #592](https://github.com/filecoin-project/FIPs/discussions/592#discussioncomment-4819619). + +Therefore in case the recipient is a smart contract, **it is recommended to always use the `InvokeEVM` `method 3844450837` for sends to prevent loss of funds** when sending to an `f410f`/`0x` address recipient. ## Precompiles