Skip to content

Commit 05a3274

Browse files
authored
Merge pull request #2370 from eshon/main
Updating Docs with important note about method numbers for sends to f410f/0x recipients
2 parents f06276e + 3f27212 commit 05a3274

File tree

2 files changed

+13
-2
lines changed

2 files changed

+13
-2
lines changed

reference/exchanges/exchange-integration.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,15 @@ When `GasFeeCap`, `GasPremium` and `MaxFee` are set to `0`, Lotus will do the ga
107107

108108
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`.
109109

110+
### Filecoin's EVM and Method number for sends
111+
112+
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).
113+
114+
{% hint style="danger" %}
115+
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.
116+
{% endhint %}
117+
118+
110119
## Integration
111120

112121
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.

smart-contracts/filecoin-evm-runtime/difference-with-ethereum.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ Filecoin charges Filecoin gas only. This includes the Filecoin EVM runtime. Inst
1616
2. EVM instruction costs can depend on the exact Filecoin EVM runtime code-paths taken, and caching.
1717

1818
{% hint style="danger" %}
19-
⚠️ 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.
19+
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.
2020
{% endhint %}
2121

2222
## Gas stipend
@@ -40,7 +40,9 @@ The `CALLCODE` opcode has not been implemented. Use the newer `DELEGATECALL` opc
4040

4141
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.
4242

43-
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.
43+
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).
44+
45+
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.
4446

4547
## Precompiles
4648

0 commit comments

Comments
 (0)