Skip to content

Commit dc43e0b

Browse files
committed
feat: 🎸 Initial commit
1 parent 53478b8 commit dc43e0b

26 files changed

+11515
-102
lines changed

.commitlintrc

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"extends": [
3+
"@commitlint/config-conventional"
4+
]
5+
}

.editorconfig

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# EditorConfig is awesome: https://EditorConfig.org
2+
3+
root = true
4+
5+
[*]
6+
end_of_line = lf
7+
trim_trailing_whitespace = true
8+
insert_final_newline = true
9+
indent_style = space
10+
indent_size = 2

.eslintignore

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
cache
2+
node_modules
3+
.github
4+
dist
5+
lib
6+
coverage
7+
typedoc
8+
temp

.eslintrc

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
{
2+
"parser": "@typescript-eslint/parser",
3+
"extends": [
4+
"plugin:@typescript-eslint/recommended",
5+
"plugin:@typescript-eslint/recommended-requiring-type-checking"
6+
],
7+
"plugins": ["@typescript-eslint"],
8+
"parserOptions": {
9+
"ecmaVersion": 2022,
10+
"sourceType": "module",
11+
"project": ["./tsconfig.json"]
12+
},
13+
"rules": {}
14+
}

.github/ISSUE_TEMPLATE/bug_report.md

+44
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
---
2+
name: Bug report
3+
about: Create a report to help us improve
4+
title: ''
5+
labels: 'triage needed'
6+
assignees: ''
7+
---
8+
9+
**⚠️ CAUTION: Any issue related to trading / price / not related with the code directly within this repository will be closed without comment**
10+
11+
**🆘 SECURITY: Any bug related to smart contract security should be addressed to [email protected]**
12+
13+
**Describe the bug**
14+
A clear and concise description of what the bug is.
15+
16+
**To Reproduce**
17+
Steps to reproduce the behavior:
18+
19+
1. Go to '...'
20+
2. Click on '....'
21+
3. Scroll down to '....'
22+
4. See error
23+
24+
**Expected behavior**
25+
A clear and concise description of what you expected to happen.
26+
27+
**Screenshots**
28+
If applicable, add screenshots to help explain your problem.
29+
30+
**Desktop (please complete the following information):**
31+
32+
- OS: [e.g. iOS]
33+
- Browser [e.g. chrome, safari]
34+
- Version [e.g. 22]
35+
36+
**Smartphone (please complete the following information):**
37+
38+
- Device: [e.g. iPhone6]
39+
- OS: [e.g. iOS8.1]
40+
- Browser [e.g. stock browser, safari]
41+
- Version [e.g. 22]
42+
43+
**Additional context**
44+
Add any other context about the problem here.
+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
---
2+
name: Feature request
3+
about: Suggest an idea for this project
4+
title: ''
5+
labels: 'triage needed'
6+
assignees: ''
7+
---
8+
9+
**⚠️ CAUTION: Any issue related to trading / price / not related with the code directly within this repository will be closed without comment**
10+
11+
**🆘 SECURITY: Any bug related to smart contract security should be addressed to [email protected]**
12+
13+
**Is your feature request related to a problem? Please describe.**
14+
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
15+
16+
**Describe the solution you'd like**
17+
A clear and concise description of what you want to happen.
18+
19+
**Describe alternatives you've considered**
20+
A clear and concise description of any alternative solutions or features you've considered.
21+
22+
**Additional context**
23+
Add any other context or screenshots about the feature request here.

.github/PULL_REQUEST_TEMPLATE/.gitkeep

Whitespace-only changes.

.github/workflows/release.yml

+32
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
name: Release
2+
on:
3+
push:
4+
branches:
5+
- master
6+
- beta
7+
jobs:
8+
release:
9+
name: Release
10+
runs-on: ubuntu-latest
11+
steps:
12+
- name: Checkout
13+
uses: actions/checkout@v3
14+
with:
15+
fetch-depth: 0
16+
- name: Setup Node.js
17+
uses: actions/setup-node@v3
18+
with:
19+
node-version: "lts/*"
20+
- name: Install dependencies
21+
run: yarn install --frozen-lockfile
22+
- name: Lint
23+
run: yarn lint
24+
- name: Test
25+
run: yarn test
26+
- name: Build
27+
run: yarn build
28+
- name: Release
29+
env:
30+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
31+
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
32+
run: npx semantic-release

.github/workflows/test.yml

+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
name: Test
2+
on:
3+
push:
4+
branches:
5+
- develop
6+
jobs:
7+
test:
8+
name: Test
9+
runs-on: ubuntu-latest
10+
steps:
11+
- name: Checkout
12+
uses: actions/checkout@v3
13+
with:
14+
fetch-depth: 0
15+
- name: Setup Node.js
16+
uses: actions/setup-node@v3
17+
with:
18+
node-version: "lts/*"
19+
- name: Install dependencies
20+
run: yarn install --frozen-lockfile
21+
- name: Lint
22+
run: yarn lint
23+
- name: Test
24+
run: yarn test

.gitignore

+15-102
Original file line numberDiff line numberDiff line change
@@ -1,104 +1,17 @@
1-
# Logs
2-
logs
3-
*.log
4-
npm-debug.log*
5-
yarn-debug.log*
6-
yarn-error.log*
7-
lerna-debug.log*
8-
9-
# Diagnostic reports (https://nodejs.org/api/report.html)
10-
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json
11-
12-
# Runtime data
13-
pids
14-
*.pid
15-
*.seed
16-
*.pid.lock
17-
18-
# Directory for instrumented libs generated by jscoverage/JSCover
19-
lib-cov
20-
21-
# Coverage directory used by tools like istanbul
22-
coverage
23-
*.lcov
24-
25-
# nyc test coverage
26-
.nyc_output
27-
28-
# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)
29-
.grunt
30-
31-
# Bower dependency directory (https://bower.io/)
32-
bower_components
33-
34-
# node-waf configuration
35-
.lock-wscript
36-
37-
# Compiled binary addons (https://nodejs.org/api/addons.html)
38-
build/Release
39-
40-
# Dependency directories
41-
node_modules/
42-
jspm_packages/
43-
44-
# TypeScript v1 declaration files
45-
typings/
46-
47-
# TypeScript cache
48-
*.tsbuildinfo
49-
50-
# Optional npm cache directory
51-
.npm
52-
53-
# Optional eslint cache
54-
.eslintcache
55-
56-
# Microbundle cache
57-
.rpt2_cache/
58-
.rts2_cache_cjs/
59-
.rts2_cache_es/
60-
.rts2_cache_umd/
61-
62-
# Optional REPL history
63-
.node_repl_history
64-
65-
# Output of 'npm pack'
66-
*.tgz
67-
68-
# Yarn Integrity file
69-
.yarn-integrity
70-
71-
# dotenv environment variables file
721
.env
73-
.env.test
74-
75-
# parcel-bundler cache (https://parceljs.org/)
76-
.cache
77-
78-
# Next.js build output
79-
.next
80-
81-
# Nuxt.js build / generate output
82-
.nuxt
2+
.env*
3+
!.env.example
4+
node_modules
5+
build
836
dist
84-
85-
# Gatsby files
86-
.cache/
87-
# Comment in the public line in if your project uses Gatsby and *not* Next.js
88-
# https://nextjs.org/blog/next-9-1#public-directory-support
89-
# public
90-
91-
# vuepress build output
92-
.vuepress/dist
93-
94-
# Serverless directories
95-
.serverless/
96-
97-
# FuseBox cache
98-
.fusebox/
99-
100-
# DynamoDB Local files
101-
.dynamodb/
102-
103-
# TernJS port file
104-
.tern-port
7+
lib
8+
.eslintcache
9+
.npmrc
10+
*.log
11+
temp
12+
*.level
13+
coverage
14+
typedoc
15+
artifacts-zk
16+
cache-zk
17+
typechain

.husky/.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
_

.husky/commit-msg

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#!/usr/bin/env sh
2+
. "$(dirname -- "$0")/_/husky.sh"
3+
4+
npx --no-install commitlint --edit ""

.husky/pre-commit

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#!/bin/sh
2+
. "$(dirname "$0")/_/husky.sh"
3+
4+
npx lint-staged

.lintstagedrc

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"*.{ts,js}": ["prettier --write", "eslint --cache --fix"],
3+
"*.md": ["prettier --write"]
4+
}

.mocharc.json

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"extension": ["ts"],
3+
"loader": "ts-node/esm"
4+
}

.prettierignore

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
node_modules
2+
.github
3+
dist
4+
lib
5+
build
6+
coverage
7+
typedoc
8+
temp

.prettierrc

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
{
2+
"semi": true,
3+
"trailingComma": "all",
4+
"singleQuote": true,
5+
"printWidth": 90,
6+
"tabWidth": 2,
7+
"overrides": [
8+
{
9+
"files": "*.sol",
10+
"options": {
11+
"printWidth": 80,
12+
"tabWidth": 2,
13+
"useTabs": false,
14+
"singleQuote": false,
15+
"bracketSpacing": false
16+
}
17+
}
18+
]
19+
}

contracts/ERC1155Token.sol

+46
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
// SPDX-License-Identifier: MIT
2+
pragma solidity ^0.8.19;
3+
4+
import "@openzeppelin/contracts-upgradeable/token/ERC1155/ERC1155Upgradeable.sol";
5+
import "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol";
6+
import "@openzeppelin/contracts-upgradeable/security/PausableUpgradeable.sol";
7+
import "@openzeppelin/contracts-upgradeable/token/ERC1155/extensions/ERC1155SupplyUpgradeable.sol";
8+
import "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";
9+
10+
abstract contract ERC1155Token is
11+
Initializable,
12+
ERC1155Upgradeable,
13+
OwnableUpgradeable,
14+
PausableUpgradeable,
15+
ERC1155SupplyUpgradeable
16+
{
17+
/// @custom:oz-upgrades-unsafe-allow constructor
18+
constructor() {
19+
_disableInitializers();
20+
}
21+
22+
function initialize() public virtual initializer {
23+
__ERC1155_init("");
24+
__Ownable_init();
25+
__Pausable_init();
26+
}
27+
28+
function pause() public onlyOwner {
29+
_pause();
30+
}
31+
32+
function unpause() public onlyOwner {
33+
_unpause();
34+
}
35+
36+
function _beforeTokenTransfer(
37+
address operator,
38+
address from,
39+
address to,
40+
uint256[] memory ids,
41+
uint256[] memory amounts,
42+
bytes memory data
43+
) internal override(ERC1155Upgradeable, ERC1155SupplyUpgradeable) whenNotPaused {
44+
super._beforeTokenTransfer(operator, from, to, ids, amounts, data);
45+
}
46+
}

0 commit comments

Comments
 (0)