For the complete documentation index, see llms.txt. This page is also available as Markdown.

Filecoin.sol

This page covers the built-in actors Filecoin.sol API.

For conceptual information on built-in actors, including their purposes, how they work and more, see the conceptual guide.

Prerequisites

Before you can call a built-in actor using the API, you must import Filecoin.sol using one of the available methods.

Works on

Filecoin.sol is for contracts deployed to Filecoin EVM networks that expose Filecoin built-in actor precompiles. Use the current filecoin-solidity-api package on Filecoin mainnet or Calibration testnet, and use the same API surface when testing against a local Filecoin EVM-compatible network.

Call a built-in actor

For available actors and methods see Available actors and methods.

Once you’ve either imported particular contracts manually or installed filecoin-solidity-api using npm, create a callable method to access the built-in actor methods the way you normally would in a Solidity smart contract. Working examples of smart contracts that call built-in actor methods are available below.

For conceptual information on built-in actors, including their purposes, how they work and available types, see the conceptual guide.

Call the account actor

The following example imports the Account actor library and creates a callable method for each of the available actor methods. For the full code, see the GitHub repository.

Call the DataCap actor

The following example imports the DataCap actor library and creates a callable method for each of the available actor methods. For the full code, see the GitHub repository.

Call the storage market actor

The following example imports the Storage market actor library and creates a callable method for each of the available actor methods. For the full code, see the GitHub repository.

Call the miner actor

The following example imports the Miner actor library and creates a callable method for each of the available actor methods. For the full code, see the GitHub repository.

Call the storage power actor

The following example imports the Storage power actor library and creates a callable method for each of the available actor methods. For the full code, see the GitHub repository.

Call the verified registry actor

The following example imports the verified registry actor library and creates a callable method for each of the available actor methods. For the full code, see the GitHub repository.

Was this page helpful?

Last updated