Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
…olidity-library into milestone-3
  • Loading branch information
wertikalk committed Dec 7, 2023
2 parents b239a48 + 049267b commit e0cd315
Show file tree
Hide file tree
Showing 5 changed files with 59 additions and 220 deletions.
201 changes: 0 additions & 201 deletions LICENSE

This file was deleted.

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.
35 changes: 25 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Protocol Labs are now the owners of this library, and will mantain it moving for

## 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,20 +73,35 @@ 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.
A better approach to import these libs is using the NPM package created for this [:link:](https://www.npmjs.com/package/@filecoin-project/filecoin-solidity). Run on your project in order to add this package.

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

#### 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-project/filecoin-solidity/=lib/filecoin-project/filecoin-solidity/` in `remappings.txt.`

#### Usage

In your smart contract, copy and paste these lines.

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

### Supported networks
Expand Down Expand Up @@ -150,7 +165,7 @@ Requirements / Steps are performed on MacOS.
- Clone the repo with the `--recursive` flag

```
git clone https://github.com/MVPWorkshop/filecoin-solidity --recursive
git clone https://github.com/filecoin-project/filecoin-solidity.git --recursive
```
- Run: `cd filecoin-solidity`
Expand Down
19 changes: 10 additions & 9 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-project/filecoin-solidity",
"version": "1.0.0",
"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 Expand Up @@ -59,4 +60,4 @@
"ts-node": "^10.9.1",
"typescript": "^5.2.2"
}
}
}

0 comments on commit e0cd315

Please sign in to comment.