description |
---|
In the Filecoin network, an address is a unique identifier that refers to an actor in the Filecoin state. All actors in Filecoin have a corresponding address which varies from the different usages. |
The Filecoin EVM runtime introduces three new actor types:
- Placeholder actors.
- Ethereum-style accounts, also called
EthAccount
. - EVM smart contracts.
A placeholder is a particular type of pseudo-actor that holds funds until an actual actor is deployed at a specific address. When funds are sent to an address starting with f410f
that doesn’t belong to any existing actor, a placeholder is created to hold the said funds until either an account or smart contract is deployed to that address.
A placeholder can become a real actor in one of two ways:
- A message is sent from the account that would exist at that placeholder’s address. If this happens, the placeholder is automatically upgraded into an account.
- An EVM smart contract is deployed to the address.
An Ethereum-style account is the Filecoin EVM runtime equivalent of an account with an f1
or f3
address, also known as native accounts. However, there are a few key differences:
- These accounts have
0x
-style addresses and an equivalentf
-style address starting withf410f
. - Messages from these accounts can be sent with Ethereum wallets like MetaMask by connecting the wallet to a Filecoin client.
- These accounts can be used to transfer funds to native or Ethereum-style.
- They can be used to call EVM smart contracts and can be used to deploy EVM smart contracts. However, they cannot be used to call native actors such as multisig or miner actors.
An EVM smart contract actor hosts a single EVM smart contract. Every EVM smart contract will have a 0x
-style address.
An EVM smart contract can be deployed in one of three ways:
- An existing EVM smart contract can use the EVM’s
CREATE
/CREATE2
opcode. - Ethereum-native tooling can be used in conjunction with an Ethereum-style account such as Remix or Hardhat.
- A native account can call method
4
on the Ethereum account managerf010
, passing the EVM init code as a CBOR-encoded byte-string (major type 2) in the message parameters.
An EVM smart contract may be called in one of three ways:
- An EVM smart contract can use the EVM’s
CALL
opcode. - Ethereum-native tooling, like MetaMask, can be used in conjunction with an Ethereum-style account.
- Finally, a native account can call method
3844450837
(FRC42(InvokeEVM)
):- The input data should either be empty or encoded as a CBOR byte string.
- The return data will either be empty or encoded as a CBOR byte string.