npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@fil-acc/filecoin-solidity-api

v1.1.2

Published

Filecoin EVM Solidity APIs

Downloads

25

Readme

Filecoin Solidity


Protocol Labs are now the owners of this library, and will mantain it moving forward.

Originally authored by Zondax.


Notice

This software is dual-licensed under the MIT License and the Apache Software License v2 by way of the Permissive License Stack. Use of this library implies your acceptance of these terms and conditions.

Things to keep in mind, while using this library:

  • There are implicit invariants these contracts expect to hold.
  • You should exhaustively read each contract you plan to use, top to bottom.
  • You can easily “shoot yourself in the foot” if you’re not careful with how you use the library.

Disclaimer :warning:

The libraries have been developed under the following set of assumptions.

Take a look at them here.


Introduction

Filecoin Virtual Machine (FVM)

Filecoin today lacks general programmability. As a result, it is not possible to deploy user-defined behaviour, or "smart contracts", to the blockchain. The goal of the FVM project is to add general programmability to the Filecoin blockchain. They predict this will unleash a proliferation of new services and tools that can be built and deployed to the Filecoin network, without requiring network upgrades, involvement from core implementation maintainers, changes in the embedded actors, or spec alterations.

Filecoin Solidity

It is a set of Solidity libraries that allow Solidity smart contracts to seamlessly call methods of Filecoin built-in actors. They do cross-platform calls to the real Filecoin built-in actors. A set of mock libraries are located too. They respond to specific scenarios based on the received parameters instead of doing real calls.

Features

Libraries to interact with built-in actors

Querying an operating on the storage market, miner actors, verified registry for FIL+ automation, and more.

OpenZeppelin-like utilities specific to Filecoin

For developer convenience.

Filecoin data types

Sectors, deals, partitions, deadlines, and more.

Access to system features

via Filecoin precompiles

How to use it

In order to use these APIs in your project, you will need to import them on your own contract. As they are embeddable libraries, they don't need to be present on the chain first. You can just import the library you desire and call its methods.

Local files

You will need to copy these files to a folder inside your project. Let's name it libs. In your smart contract, copy and paste these lines.

import { MarketAPI } from "./libs/MarketAPI.sol";
import { CommonTypes } from "./libs/types/CommonTypes.sol";
import { MarketTypes } from "./libs/types/MarketTypes.sol";

NPM Package

Better approach to import these libs is using the NPM package created for this .

$ npm install filecoin-solidity-api

Foundry (git)

[!WARNING] When installing via git, it is a common error to use the master branch. This is a development branch that should be avoided in favor of tagged releases. The release process involves security measures that the master branch does not guarantee.

[!WARNING] Foundry installs the latest version initially, but subsequent forge update commands will use the master branch.

$ forge install filecoin-project/filecoin-solidity

Add filecoin-solidity-api=lib/filecoin-project/filecoin-solidity/ in remappings.txt.

Usage

In your smart contract, copy and paste these lines.

import { MarketAPI } from "filecoin-solidity-api/contracts/v0.8/MarketAPI.sol";
import { CommonTypes } from "filecoin-solidity-api/contracts/v0.8/types/CommonTypes.sol";
import { MarketTypes } from "filecoin-solidity-api/contracts/v0.8/types/MarketTypes.sol";
import { BigIntCBOR } from "filecoin-solidity-api/contracts/v0.8/cbor/BigIntCbor.sol";

Complementary lectures

Introduction to Filecoin :link:

Important explainers & concepts on Filecoin storage and retrieval markets, FVM as part of Filecoin and Lotus nodes that power the Filecoin network.

Filecoin 101: conceptual read :link:

If you’re starting totally new, we got you! Here’s a 101 conceptual read on understanding FVM from scratch.

Past Hackathons

FVM Space Warp ETHGlobal Cheat Sheet :link:

Community Discussions :link:

Find nice articles with rich and valuable content about different topics related to Filecoin network.

Looking for the complete documentation? :books::books:

Filecoin solidity documentation: Let's go to docs web :arrow_upper_right:


Information for filecoin-solidity lib developers is contained in ./lib-dev

<<<<<<< HEAD

=======

1eeaacbd720f224bf1a85c9e3fd65ea6a64c9336