Skip to content
This repository has been archived by the owner on Jul 19, 2024. It is now read-only.

Submit erc3525 #7

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions contracts/erc3525/.env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
ETHERSCAN_API_KEY=ABC123ABC123ABC123ABC123ABC123ABC1
ROPSTEN_URL=https://eth-ropsten.alchemyapi.io/v2/<YOUR ALCHEMY KEY>
PRIVATE_KEY=0xabc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc1
4 changes: 4 additions & 0 deletions contracts/erc3525/.eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
node_modules
artifacts
cache
coverage
62 changes: 62 additions & 0 deletions contracts/erc3525/.eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
module.exports = {
env: {
browser: false,
es2021: true,
mocha: true,
node: true,
},
globals: {
artifacts: false,
contract: false,
assert: false,
web3: false,
usePlugin: false,
extendEnvironment: false,
},
plugins: ["@typescript-eslint"],
extends: [
"standard",
"plugin:prettier/recommended",
"plugin:node/recommended",
],
parser: "@typescript-eslint/parser",
parserOptions: {
ecmaVersion: 12,
},
rules: {
"node/no-unsupported-features/es-syntax": [
"error",
{ ignores: ["modules"] }, "global"
],
"array-bracket-spacing": ["off"],
"camelcase": ["error", {"properties": "always"}],
"comma-dangle": ["error", "always-multiline"],
"comma-spacing": ["error", {"before": false, "after": true}],
"dot-notation": ["error", {"allowKeywords": true, "allowPattern": ""}],
"eol-last": ["error", "always"],
"eqeqeq": ["error", "smart"],
"generator-star-spacing": ["error", "before"],
"indent": ["error", 2],
"linebreak-style": ["error", "unix"],
"max-len": ["error", 120, 2],
"no-debugger": "off",
"no-dupe-args": "error",
"no-dupe-keys": "error",
"no-mixed-spaces-and-tabs": ["error", "smart-tabs"],
"no-redeclare": ["error", {"builtinGlobals": true}],
"no-trailing-spaces": ["error", { "skipBlankLines": false }],
"no-undef": "error",
"no-use-before-define": "off",
"no-var": "error",
"object-curly-spacing": ["error", "always"],
"prefer-const": "error",
"quotes": ["error", "single"],
"semi": ["error", "always"],
"space-before-function-paren": ["error", "always"],

"mocha-no-only/mocha-no-only": ["error"],

"promise/always-return": "off",
"promise/avoid-new": "off",
},
};
15 changes: 15 additions & 0 deletions contracts/erc3525/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
node_modules
.env
coverage
coverage.json
typechain

#Hardhat files
cache
artifacts
.idea/
typechain-types
build/

#testlog
testlog.txt
3 changes: 3 additions & 0 deletions contracts/erc3525/.npmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
hardhat.config.ts
scripts
test
5 changes: 5 additions & 0 deletions contracts/erc3525/.prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
node_modules
artifacts
cache
coverage*
gasReporterOutput.json
11 changes: 11 additions & 0 deletions contracts/erc3525/.prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"overrides": [
{
"files": "*.sol",
"options": {
"printWidth": 120,
"explicitTypes": "always"
}
}
]
}
18 changes: 18 additions & 0 deletions contracts/erc3525/.solhint.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"extends": "solhint:recommended",
"rules": {
"compiler-version": ["error", "^0.8.0"],
"func-visibility": ["warn", { "ignoreConstructors": true }],
"reason-string": ["warn",{"maxLength":64}],
"no-unused-vars": "warn",
"const-name-snakecase": "error",
"contract-name-camelcase": "error",
"event-name-camelcase": "error",
"func-name-mixedcase": "error",
"func-param-name-mixedcase": "error",
"modifier-name-mixedcase": "error",
"private-vars-leading-underscore": "error",
"var-name-mixedcase": "error",
"imports-on-top": "error"
}
}
1 change: 1 addition & 0 deletions contracts/erc3525/.solhintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
node_modules
21 changes: 21 additions & 0 deletions contracts/erc3525/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2022 Solv Protocol

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.
80 changes: 80 additions & 0 deletions contracts/erc3525/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
# ERC-3525 Reference Implementation

**This is reference implementation of [ERC-3525](https://eips.ethereum.org/EIPS/eip-3525).**

>ERC-3525, proposed by Solv Protocol, is a standard for the Semi-Fungible Token (or SFT) approved by the Ethereum community.
>
>It defines a new type of digital asset characterized by the following key features:
>
>* Unique ID and expressivity of ERC-721 non-fungible tokens. Compatibility with the ERC-721 token standard.
>* It is fractionalizable, combinable, and computable.
>* It can work like an account and nest other digital assets, including ERC-20 fungible tokens and NFTs, with support for token-to-token transfer.
>* Programmable appearance, functionality, lockup, transfer, etc. Metadata is optimized to support dynamic inputs and more complex financial logic.


🧙**Not sure how to get started?** Check out [ERC-3525 Starter Kit: Developer Edition](https://medium.com/solv-blog/erc-3525-starter-kit-developer-edition-9d734ca62bd0) - a step-by-step guide to get you started with the ERC-3525 reference implementation.🚀

## Overview

### Installation

```bash
npm install @solvprotocol/erc-3525@latest
```

### Usage
Once installed, you can use the contracts in the library by importing them:

```solidity
pragma solidity ^0.8.9;

import "@solvprotocol/erc-3525/ERC3525.sol";

contract MyERC3525 is ERC3525 {

constructor()
ERC3525("MyERC3525", "MY3525", 18) {
}
}
```

To keep your system secure, you should always use the installed code as-is, and neither copy-paste it from online sources nor modify it yourself.

## Learn More

[ERC-3525 White Paper](https://whitepaper.sftlabs.io/SFT%20Whitepaper.pdf)

## Security

This project is maintained by [Solv Protocol](https://solv.finance) with the goal of providing a ERC-3525 Reference Implementation for the SFT ecosystem. We address security through risk management in various areas such as engineering and open source best practices, scoping and API design, multi-layered review processes, and incident response preparedness.

Past audits can be found in [audits/](https://github.com/solv-finance/erc-3525/tree/main/audits).

Smart contracts are a nascent technology and carry a high level of technical risk and uncertainty. Although the ERC-3525 Reference Implementation has been audited, using it is not a substitute for a security audit.

ERC-3525 Reference Implementation Contracts is made available under the MIT License, which disclaims all warranties in relation to the project and which limits the liability of those that contribute and maintain the project, including Solv Protocol. As set out further in the Terms, you acknowledge that you are solely responsible for any use of ERC-3525 Reference Implementation Contracts and you assume all risks associated with any such use.

## Contribute

**Requirements**

- Solidity 0.8
- Hardhat
- Node.js >= 12.10

#### Setup

Run `npm install` in the root directory

#### Unit Tests

Run `npm test` to run the unit tests

#### Transpile
Run `npm run transpile` to transpile the non-upgradable contracts to upgradeable contracts

## License
ERC-3525 Reference Implementation is released under the [MIT License](https://github.com/solv-finance/erc-3525/blob/main/LICENSE).

## Credits
ERC-3525 Reference Implementation power by **[Solv Finance](https://solv.finance)**
Binary file not shown.
Loading