GithubHelp home page GithubHelp logo

sarvex / filecoin-solidity Goto Github PK

View Code? Open in Web Editor NEW

This project forked from zondax/filecoin-solidity

0.0 1.0 0.0 6.03 MB

Filecoin Solidity API Library

License: Apache License 2.0

JavaScript 6.76% Rust 37.98% Makefile 2.50% Solidity 52.76%

filecoin-solidity's Introduction

Filecoin Solidity

License GithubActions


zondax_light zondax_dark

Please visit our website at zondax.ch


⚠️⚠️ DISCLAIMER ⚠️⚠️

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

A better approach to import these libs is using the NPM package created for this. 🔗. Run on your project in order to add this package.

yarn add @zondax/filecoin-solidity

In your smart contract, copy and paste these lines.

import { MarketAPI } from "@zondax/filecoin-solidity/contracts/v0.8/MarketAPI.sol";
import { CommonTypes } from "@zondax/filecoin-solidity/contracts/v0.8/types/CommonTypes.sol";
import { MarketTypes } from "@zondax/filecoin-solidity/contracts/v0.8/types/MarketAPI.sol";
import { BigInt } from "@zondax/filecoin-solidity/contracts/v0.8/cbor/BigNumberCbor.sol";

Complementary lectures

Introduction to Filecoin 🔗

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 🔗

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 🔗

Community Discussions 🔗

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

Looking for the complete documentation? 📚📚

We have built this beautiful website for you! Let's go to docs web ↗️

filecoin-solidity's People

Contributors

emmanuelm41 avatar rllola avatar neithanmo avatar bahadylbekov avatar nufailismath avatar pfed-prog avatar ainhoa-a avatar dependabot[bot] avatar longfeiwan9 avatar omahs avatar snissn avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.