Skip to content

Commit

Permalink
Release: v1.0.1
Browse files Browse the repository at this point in the history
  • Loading branch information
wertikalk committed Dec 8, 2023
1 parent 0755d80 commit b761468
Show file tree
Hide file tree
Showing 5 changed files with 125 additions and 81 deletions.
5 changes: 5 additions & 0 deletions LICENSE-APACHE
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
19 changes: 19 additions & 0 deletions LICENSE-MIT
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
The MIT License (MIT)

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
101 changes: 28 additions & 73 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,15 @@

---

Originally authored by Zondax. Learn more at [zondax.ch](https://www.zondax.ch).
Protocol Labs are now the owners of this library, and will mantain it moving forward.
[Protocol Labs](https://protocol.ai/) are now the owners of this library, and will mantain it moving forward.

Originally authored by [Zondax](https://www.zondax.ch).

---

## Notice

This is software is available under Apache 2.0 License. Use of this library implies your acceptance of these terms and conditions
This software is dual-licensed under the [MIT License](./LICENSE-MIT) and the [Apache Software License v2](./LICENSE-APACHE) by way of the [Permissive License Stack](https://protocol.ai/blog/announcing-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:

Expand Down Expand Up @@ -73,29 +74,36 @@ import { MarketTypes } from "./libs/types/MarketTypes.sol";

#### NPM Package

A better approach to import these libs is using the NPM package created for this. [:link:](https://www.npmjs.com/package/@zondax/filecoin-solidity).
Run on your project in order to add this package.
Better approach to import these libs is using the [NPM package](https://www.npmjs.com/package/filecoin-solidity) created for this .

```yarn
yarn add @zondax/filecoin-solidity
```
$ npm install filecoin-solidity
```

In your smart contract, copy and paste these lines.
#### Foundry (git)

```solidity
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/MarketTypes.sol";
import { BigInt } from "@zondax/filecoin-solidity/contracts/v0.8/cbor/BigIntCbor.sol";
> [!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-solidity
```

### Supported networks
Add `filecoin-solidity/=lib/filecoin-solidity/` in `remappings.txt.`

The following table contains information about the versions of filecoin network on which the `filecoin-solidity` library has been tested on.
#### Usage

| FVM version | Builtin actors | Pass |
| :---------------------------------------------------------------------------------------------------: | :-----------------------------------------------------------------------------------------------------------------------------: | :----------------: |
| [[email protected]](https://github.com/filecoin-project/ref-fvm/releases/tag/fvm%40v3.0.0-alpha.21) | [builtin_actors@dev/20230206-pre-rc.6](https://github.com/filecoin-project/builtin-actors/releases/tag/dev%2F20230206-pre-rc.6) | :white_check_mark: |
In your smart contract, copy and paste these lines.

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

## Complementary lectures

Expand All @@ -119,59 +127,6 @@ Find nice articles with rich and valuable content about different topics related

Filecoin solidity documentation: [Let's go to docs web](https://docs.filecoin.io/smart-contracts/developing-contracts/solidity-libraries/) :arrow_upper_right:

## Getting Started

Requirements / Steps are performed on MacOS.

### Requirements:

- **Foundry** [[Official Docs]](https://book.getfoundry.sh/getting-started/installation):

`curl -L https://foundry.paradigm.xyz | bash`

- **Rust** [[Official Docs]](https://doc.rust-lang.org/book/ch01-01-installation.html):

`curl --proto '=https' --tlsv1.2 https://sh.rustup.rs -sSf | sh`

- **Yarn**[[Official Docs]](https://classic.yarnpkg.com/lang/en/docs/install/#mac-stable):

`npm install --global yarn`

- **CMake** [[Official Docs]](https://cmake.org/download/):

- [MacOS] Install GUI: [v3.7.0](https://github.com/Kitware/CMake/releases/download/v3.27.0/cmake-3.27.0-macos-universal.dmg)
- Add it to the Application folder
- Open terminal and run:

` sudo "/Applications/CMake.app/Contents/bin/cmake-gui" --install`

### Setup process:

- Clone the repo with the `--recursive` flag

```
git clone https://github.com/MVPWorkshop/filecoin-solidity --recursive
```

- Run: `cd filecoin-solidity`
- Install Solc:

- MacOS:
`make install_solc_mac`
- Linux:
`make install_solc_linux`

- Run: `make`

### Workflow

- Compiling / testing contracts:

`forge <build/test>`

- Running all of the integration tests:

`make test_integration`
---

- Running individual integration tests:
- see [Makefile](./Makefile) for a complete list
_**Information for `filecoin-solidity` lib developers is contained in [./lib-dev](./lib-dev)**_
64 changes: 64 additions & 0 deletions lib-dev/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
## Getting Started

Requirements / Steps are performed on MacOS.

### Requirements:

- **Foundry** [[Official Docs]](https://book.getfoundry.sh/getting-started/installation):

`curl -L https://foundry.paradigm.xyz | bash`

- **Rust** [[Official Docs]](https://doc.rust-lang.org/book/ch01-01-installation.html):

`curl --proto '=https' --tlsv1.2 https://sh.rustup.rs -sSf | sh`

- **Yarn**[[Official Docs]](https://classic.yarnpkg.com/lang/en/docs/install/#mac-stable):

`npm install --global yarn`

- **CMake** [[Official Docs]](https://cmake.org/download/):

- [MacOS] Install GUI: [v3.7.0](https://github.com/Kitware/CMake/releases/download/v3.27.0/cmake-3.27.0-macos-universal.dmg)
- Add it to the Application folder
- Open terminal and run:

` sudo "/Applications/CMake.app/Contents/bin/cmake-gui" --install`

### Setup process:

- Clone the repo with the `--recursive` flag

```
git clone https://github.com/filecoin-project/filecoin-solidity.git --recursive
```

- Run: `cd filecoin-solidity`
- Install Solc:

- MacOS:
`make install_solc_mac`
- Linux:
`make install_solc_linux`

- Run: `make`

### Workflow

- Compiling / testing contracts:

`forge <build/test>`

- Running all of the integration tests:

`make test_integration`

- Running individual integration tests:
- see [Makefile](./Makefile) for a complete list

### Supported networks

The following table contains information about the versions of filecoin network on which the `filecoin-solidity` library has been tested on.

| FVM version | Builtin actors | Pass |
| :---------------------------------------------------------------------------------------------------: | :-----------------------------------------------------------------------------------------------------------------------------: | :----------------: |
| [[email protected]](https://github.com/filecoin-project/ref-fvm/releases/tag/fvm%40v3.0.0-alpha.21) | [builtin_actors@dev/20230206-pre-rc.6](https://github.com/filecoin-project/builtin-actors/releases/tag/dev%2F20230206-pre-rc.6) | :white_check_mark: |
17 changes: 9 additions & 8 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@zondax/filecoin-solidity",
"version": "0.0.0",
"name": "filecoin-solidity",
"version": "1.0.1",
"description": "Filecoin EVM Solidity APIs",
"main": "",
"directories": {
Expand All @@ -11,22 +11,23 @@
},
"repository": {
"type": "git",
"url": "git+https://github.com/Zondax/filecoin-solidity.git"
"url": "git+https://github.com/filecoin-project/filecoin-solidity.git"
},
"keywords": [
"FEVM",
"EVM",
"Solidity",
"Filecoin"
],
"author": "Zondax AG <[email protected]>",
"license": "Apache-2.0",
"author": "[Protocol Labs, Filecoin Core Devs]",
"license": "MIT OR Apache-2.0",
"bugs": {
"url": "https://github.com/Zondax/filecoin-solidity/issues"
"url": "https://github.com/filecoin-project/filecoin-solidity/issues"
},
"homepage": "https://github.com/Zondax/filecoin-solidity#readme",
"homepage": "https://github.com/filecoin-project/filecoin-solidity#readme",
"files": [
"contracts"
"contracts/",
"!/contracts/v0.8/tests/**/*"
],
"publishConfig": {
"access": "public"
Expand Down

0 comments on commit b761468

Please sign in to comment.