Skip to content

Commit

Permalink
empty hardhat project
Browse files Browse the repository at this point in the history
  • Loading branch information
dips committed Oct 29, 2022
1 parent 9375356 commit 6015362
Show file tree
Hide file tree
Showing 10 changed files with 15,849 additions and 128 deletions.
219 changes: 91 additions & 128 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,129 +1,92 @@
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class

# C extensions
*.so

# Distribution / packaging
.Python
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
wheels/
pip-wheel-metadata/
share/python-wheels/
*.egg-info/
.installed.cfg
*.egg
MANIFEST

# PyInstaller
# Usually these files are written by a python script from a template
# before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec

# Installer logs
pip-log.txt
pip-delete-this-directory.txt

# Unit test / coverage reports
htmlcov/
.tox/
.nox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*.cover
*.py,cover
.hypothesis/
.pytest_cache/

# Translations
*.mo
*.pot

# Django stuff:
*.log
local_settings.py
db.sqlite3
db.sqlite3-journal

# Flask stuff:
instance/
.webassets-cache

# Scrapy stuff:
.scrapy

# Sphinx documentation
docs/_build/

# PyBuilder
target/

# Jupyter Notebook
.ipynb_checkpoints

# IPython
profile_default/
ipython_config.py

# pyenv
.python-version

# pipenv
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
# However, in case of collaboration, if having platform-specific dependencies or dependencies
# having no cross-platform support, pipenv may install dependencies that don't work, or not
# install all needed dependencies.
#Pipfile.lock

# PEP 582; used by e.g. github.com/David-OConnor/pyflow
__pypackages__/

# Celery stuff
celerybeat-schedule
celerybeat.pid

# SageMath parsed files
*.sage.py

# Environments
packages/subgraph/subgraph.yaml
packages/subgraph/generated
packages/subgraph/abis/*
packages/hardhat/*.txt
**/aws.json

# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
**/node_modules

packages/hardhat/artifacts*
packages/hardhat/deployments
packages/react-app/src/contracts/*
!packages/react-app/src/contracts/external_contracts.js
packages/hardhat/cache*
packages/**/data
!packages/react-app/src/contracts/contracts.js


# ts
packages/hardhat-ts/cache
# secrets
.secret

packages/subgraph/config/config.json
tenderly.yaml

# dependencies
/node_modules
/.pnp
.pnp.js

# testing
coverage

# production
build
# yarn / eslint
.yarn/cache
.yarn/install-state.gz
.yarn/build-state.yml
.eslintcache
# testing
coverage

# production
build

# Hardhat files
cache
artifacts

# misc
.DS_Store
.env*

# debug
npm-debug.log*
yarn-debug.log*
yarn-error.log*

.idea

# Local Netlify folder
.netlify
*.tsbuildinfo
*.stackdump

# doc directory
/doc
node_modules
.env
.venv
env/
venv/
ENV/
env.bak/
venv.bak/

# Spyder project settings
.spyderproject
.spyproject

# Rope project settings
.ropeproject

# mkdocs documentation
/site

# mypy
.mypy_cache/
.dmypy.json
dmypy.json

# Pyre type checker
.pyre/
coverage
coverage.json
typechain
typechain-types

#Hardhat files
cache
artifacts


node_modules
.env
coverage
coverage.json
typechain
typechain-types

#Hardhat files
cache
artifacts

8 changes: 8 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
[submodule "packages/services/arbitrum"]
path = packages/services/arbitrum
url = https://github.com/OffchainLabs/arbitrum
branch = master
[submodule "packages/services/optimism"]
path = packages/services/optimism
url = https://github.com/ethereum-optimism/optimism
branch = regenesis/0.4.0
29 changes: 29 additions & 0 deletions .gitpod.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
tasks:
- name: App
init: >
yarn &&
gp sync-done install
command: REACT_APP_PROVIDER=$(gp url 8545) yarn start
- name: Chain
init: gp sync-await install
command: yarn chain --hostname 0.0.0.0
openMode: split-right
- name: Deployment
init: gp sync-await install
command: yarn deploy
openMode: split-right
ports:
- port: 3000
onOpen: open-preview
- port: 8545
onOpen: ignore
visibility: public
github:
prebuilds:
pullRequestsFromForks: true
addComment: true
vscode:
extensions:
- dbaeumer.vscode-eslint
- esbenp.prettier-vscode
- juanblanco.solidity
13 changes: 13 additions & 0 deletions README.md.old
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Sample Hardhat Project

This project demonstrates a basic Hardhat use case. It comes with a sample contract, a test for that contract, and a script that deploys that contract.

Try running some of the following tasks:

```shell
npx hardhat help
npx hardhat test
REPORT_GAS=true npx hardhat test
npx hardhat node
npx hardhat run scripts/deploy.js
```
34 changes: 34 additions & 0 deletions contracts/Lock.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
// SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.9;

// Uncomment this line to use console.log
// import "hardhat/console.sol";

contract Lock {
uint public unlockTime;
address payable public owner;

event Withdrawal(uint amount, uint when);

constructor(uint _unlockTime) payable {
require(
block.timestamp < _unlockTime,
"Unlock time should be in the future"
);

unlockTime = _unlockTime;
owner = payable(msg.sender);
}

function withdraw() public {
// Uncomment this line, and the import of "hardhat/console.sol", to print a log in your terminal
// console.log("Unlock time is %o and block timestamp is %o", unlockTime, block.timestamp);

require(block.timestamp >= unlockTime, "You can't withdraw yet");
require(msg.sender == owner, "You aren't the owner");

emit Withdrawal(address(this).balance, block.timestamp);

owner.transfer(address(this).balance);
}
}
6 changes: 6 additions & 0 deletions hardhat.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
require("@nomicfoundation/hardhat-toolbox");

/** @type import('hardhat/config').HardhatUserConfig */
module.exports = {
solidity: "0.8.17",
};
Loading

0 comments on commit 6015362

Please sign in to comment.