From b761468eead0632f35a42f7c1ed018f880faf38c Mon Sep 17 00:00:00 2001 From: bojinovic Date: Fri, 8 Dec 2023 11:37:37 +0100 Subject: [PATCH] Release: v1.0.1 --- LICENSE-APACHE | 5 +++ LICENSE-MIT | 19 +++++++++ README.md | 101 +++++++++++++--------------------------------- lib-dev/README.md | 64 +++++++++++++++++++++++++++++ package.json | 17 ++++---- 5 files changed, 125 insertions(+), 81 deletions(-) create mode 100644 LICENSE-APACHE create mode 100644 LICENSE-MIT create mode 100644 lib-dev/README.md diff --git a/LICENSE-APACHE b/LICENSE-APACHE new file mode 100644 index 0000000..14478a3 --- /dev/null +++ b/LICENSE-APACHE @@ -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. diff --git a/LICENSE-MIT b/LICENSE-MIT new file mode 100644 index 0000000..72dc60d --- /dev/null +++ b/LICENSE-MIT @@ -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. diff --git a/README.md b/README.md index 766c0e4..3e80bab 100644 --- a/README.md +++ b/README.md @@ -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: @@ -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 | -| :---------------------------------------------------------------------------------------------------: | :-----------------------------------------------------------------------------------------------------------------------------: | :----------------: | -| [fvm@v3.0.0-alpha.21](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 @@ -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 ` - -- 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)**_ diff --git a/lib-dev/README.md b/lib-dev/README.md new file mode 100644 index 0000000..08a34df --- /dev/null +++ b/lib-dev/README.md @@ -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 ` + +- 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 | +| :---------------------------------------------------------------------------------------------------: | :-----------------------------------------------------------------------------------------------------------------------------: | :----------------: | +| [fvm@v3.0.0-alpha.21](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: | diff --git a/package.json b/package.json index 89bc361..b6db76b 100644 --- a/package.json +++ b/package.json @@ -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": { @@ -11,7 +11,7 @@ }, "repository": { "type": "git", - "url": "git+https://github.com/Zondax/filecoin-solidity.git" + "url": "git+https://github.com/filecoin-project/filecoin-solidity.git" }, "keywords": [ "FEVM", @@ -19,14 +19,15 @@ "Solidity", "Filecoin" ], - "author": "Zondax AG ", - "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"