Skip to content

Commit

Permalink
init commit
Browse files Browse the repository at this point in the history
  • Loading branch information
mahmoud-elgammal committed Jun 1, 2024
1 parent 0ac4d40 commit 305b8d0
Show file tree
Hide file tree
Showing 39 changed files with 10,154 additions and 130 deletions.
131 changes: 1 addition & 130 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,130 +1 @@
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
lerna-debug.log*
.pnpm-debug.log*

# Diagnostic reports (https://nodejs.org/api/report.html)
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json

# Runtime data
pids
*.pid
*.seed
*.pid.lock

# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov

# Coverage directory used by tools like istanbul
coverage
*.lcov

# nyc test coverage
.nyc_output

# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)
.grunt

# Bower dependency directory (https://bower.io/)
bower_components

# node-waf configuration
.lock-wscript

# Compiled binary addons (https://nodejs.org/api/addons.html)
build/Release

# Dependency directories
node_modules/
jspm_packages/

# Snowpack dependency directory (https://snowpack.dev/)
web_modules/

# TypeScript cache
*.tsbuildinfo

# Optional npm cache directory
.npm

# Optional eslint cache
.eslintcache

# Optional stylelint cache
.stylelintcache

# Microbundle cache
.rpt2_cache/
.rts2_cache_cjs/
.rts2_cache_es/
.rts2_cache_umd/

# Optional REPL history
.node_repl_history

# Output of 'npm pack'
*.tgz

# Yarn Integrity file
.yarn-integrity

# dotenv environment variable files
.env
.env.development.local
.env.test.local
.env.production.local
.env.local

# parcel-bundler cache (https://parceljs.org/)
.cache
.parcel-cache

# Next.js build output
.next
out

# Nuxt.js build / generate output
.nuxt
dist

# Gatsby files
.cache/
# Comment in the public line in if your project uses Gatsby and not Next.js
# https://nextjs.org/blog/next-9-1#public-directory-support
# public

# vuepress build output
.vuepress/dist

# vuepress v2.x temp and cache directory
.temp
.cache

# Docusaurus cache and generated files
.docusaurus

# Serverless directories
.serverless/

# FuseBox cache
.fusebox/

# DynamoDB Local files
.dynamodb/

# TernJS port file
.tern-port

# Stores VSCode versions used for testing VSCode extensions
.vscode-test

# yarn v2
.yarn/cache
.yarn/unplugged
.yarn/build-state.yml
.yarn/install-state.gz
.pnp.*
node_modules/
Binary file added bun.lockb
Binary file not shown.
4 changes: 4 additions & 0 deletions lerna.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"$schema": "node_modules/lerna/schemas/lerna-schema.json",
"version": "0.0.0"
}
11 changes: 11 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"name": "root",
"private": true,
"workspaces": [
"packages/*"
],
"dependencies": {},
"devDependencies": {
"lerna": "^8.1.2"
}
}
4 changes: 4 additions & 0 deletions packages/contracts/.env.sample
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
ETHERSCAN_API_KEY=0000000000000000000000000000000000000000
ETH_RPC=https://example.com/rpc
CONTRACT_OWNER_PRIVATE_KEY=0000000000000000000000000000000000000000000000000000000000000000
COINMARKETCAP_API_KEY=0000000000000000000000000000000000000000
4 changes: 4 additions & 0 deletions packages/contracts/.eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
node_modules
artifacts
cache
coverage
47 changes: 47 additions & 0 deletions packages/contracts/.eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
{
"env": {
"es2021": true,
"node": true
},
"parser": "@typescript-eslint/parser",
"parserOptions": {
"ecmaVersion": 12,
"sourceType": "module",
"project": "./tsconfig.json"
},
"plugins": [
"@typescript-eslint",
"prettier",
"sort-imports-es6-autofix",
"import"
],
"extends": [
"eslint:recommended",
"plugin:@typescript-eslint/recommended",
"plugin:prettier/recommended"
],
"rules": {
"import/newline-after-import": ["error"],
"@typescript-eslint/no-floating-promises": "error",
"require-await": "error",
"prettier/prettier": [
"error",
{
"trailingComma": "es5",
"tabWidth": 2,
"semi": false,
"singleQuote": true,
"endOfLine": "auto"
}
],
"sort-imports-es6-autofix/sort-imports-es6": [
2,
{
"ignoreCase": false,
"ignoreMemberSort": false,
"memberSyntaxSortOrder": ["none", "all", "multiple", "single"]
}
],
"import/prefer-default-export": "error"
}
}
23 changes: 23 additions & 0 deletions packages/contracts/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
node_modules
.env
coverage
coverage.json
typechain
.DS_Store
dist

# Hardhat files
cache
artifacts

# logs
*.log

# yarn
.pnp.*
.yarn/*
!.yarn/patches
!.yarn/plugins
!.yarn/releases
!.yarn/sdks
!.yarn/versions
1 change: 1 addition & 0 deletions packages/contracts/.nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
v20.14.0
8 changes: 8 additions & 0 deletions packages/contracts/.prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
node_modules
artifacts
cache
coverage*
gasReporterOutput.json
typechain
.yarn
dist
24 changes: 24 additions & 0 deletions packages/contracts/.prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{
"overrides": [
{
"files": "*.sol",
"options": {
"printWidth": 80,
"tabWidth": 2,
"useTabs": false,
"singleQuote": false,
"bracketSpacing": false
}
},
{
"files": ["*.ts", "*.js"],
"options": {
"trailingComma": "es5",
"tabWidth": 2,
"semi": false,
"singleQuote": true,
"endOfLine": "auto"
}
}
]
}
15 changes: 15 additions & 0 deletions packages/contracts/.solhint.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"extends": "solhint:recommended",
"rules": {
"compiler-version": ["error", "^0.8.26"],
"func-visibility": [
"warn",
{
"ignoreConstructors": true
}
],
"no-empty-blocks": "off",
"reason-string": "off",
"no-global-import": "off"
}
}
1 change: 1 addition & 0 deletions packages/contracts/.solhintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
node_modules
7 changes: 7 additions & 0 deletions packages/contracts/.yarnrc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
nodeLinker: node-modules

plugins:
- path: .yarn/plugins/yarn-up-all-plugin.cjs
spec: "https://github.com/e5mode/yarn-up-all/releases/download/1.1.0/index.js"

yarnPath: .yarn/releases/yarn-4.2.2.cjs
21 changes: 21 additions & 0 deletions packages/contracts/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2022-present Borodutch Labs

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.
25 changes: 25 additions & 0 deletions packages/contracts/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Solidity Ethereum smart contract starter

Heavily influenced by the [Big Whale Labs repos](https://github.com/BigWhaleLabs).

## Usage

1. Clone the repository with `git clone git@github.com:Borodutch/smart-contract-starter`
2. Install the dependencies with `yarn`
3. Add environment variables to your `.env` file
4. Run the scripts below

## Environment variables

| Name | Description |
| ---------------------------- | --------------------------------------------------------- |
| `ETHERSCAN_API_KEY` | Etherscan API key |
| `ETH_RPC` | Ethereum RPC URL |
| `CONTRACT_OWNER_PRIVATE_KEY` | Private key of the contract owner to deploy the contracts |
| `COINMARKETCAP_API_KEY` | Coinmarketcap API key |

Also check out the `.env.sample` file for more information.

## Available scripts

Check out the `package.json` file for more information.
21 changes: 21 additions & 0 deletions packages/contracts/contracts/MyERC721.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
// SPDX-License-Identifier: MIT
pragma solidity >=0.7.0 <0.9.0;

import "@openzeppelin/contracts/token/ERC721/ERC721.sol";
import "@openzeppelin/contracts/access/Ownable.sol";

contract MyERC721 is ERC721, Ownable {
uint256 public tokenId;

constructor(
string memory name,
string memory symbol,
address initialOwner
) ERC721(name, symbol) Ownable(initialOwner) {}

function mint() external {
uint256 _tokenId = tokenId;
_safeMint(msg.sender, _tokenId);
tokenId++;
}
}
Loading

0 comments on commit 305b8d0

Please sign in to comment.