Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
* Feature/scaffold-eth#29 eth-hooks v4 changes (scaffold-eth#32)

* scaffold-eth#29 testing out contracts context

* scaffold-eth#29 v4 compatability changes and merging develop

* scaffold-eth#29 eth-hooks v4 minor updates

* scaffold-eth#29 more work on contract context scaffold-eth/eth-ui#101

- external contracts are now handles
- worked on the contract context initalization in app

* scaffold-eth#29 more work on contract context scaffold-eth/eth-ui#101

- created an contract context factory

* scaffold-eth#29 preliminary typing system for all the app contracts

* scaffold-eth#29 contract typing is almost working

* scaffold-eth#29 checkpoint

* scaffold-eth#29 checkpoint

* scaffold-eth#29 regenerate lock file

* scaffold-eth#29 general refactor of v4 types and function names

* scaffold-eth#29 created hook and system to load contracts

* scaffold-eth#29 using the new eth-hooksv4 paradigm

* scaffold-eth#29 fixes from eth-hooksv4 and eth-components

* scaffold-eth#29 fixes from eth-hooksv4 and eth-components

* scaffold-eth#29 fixes from eth-hooksv4 loading contractrats

* scaffold-eth#29 changes to how main provider is passed around

* added react async

* scaffold-eth#29 final changes to inital beta

* scaffold-eth#29 final changes to inital beta

* scaffold-eth#29 changes from scaffold-eth/eth-ui#114

* scaffold-eth#29 changes from scaffold-eth/eth-ui#114

* scaffold-eth#29 changes from scaffold-eth/eth-ui#114

event based updates

* replace apollo with react-query and graphql-request.  lazy load GraphiQl

* scaffold-eth#29 tried to make folder structure simpler.  better commands to build contracts

* scaffold-eth#29 minor fixes

* scaffold-eth#29 more comments to contract

* update packages

* scaffold-eth#46 fixes and autconnect to burner with an option

* scaffold-eth#46  packages updates

* changes for scaffold-eth/eth-ui#120 useBalance

* scaffold-eth#47 changes to building contract, bug fixes, and updates to packages

* reenabled dai

* scaffold-eth#47 updated packages

* scaffold-eth#47 updated packages, fixed externals for vite.

* disabled subgraph for now scaffold-eth#48

* updated git ignore

* scaffold-eth#47 fix to generic-contract.  removed generated fiels

* scaffold-eth#47 updated git ignore

* scaffold-eth#47 updated action

* scaffold-eth#47 updated action

* scaffold-eth#47 updated action
  • Loading branch information
ShravanSunder authored Jan 12, 2022
1 parent db74761 commit 29a4ce9
Show file tree
Hide file tree
Showing 63 changed files with 25,595 additions and 26,054 deletions.
8 changes: 6 additions & 2 deletions .github/workflows/pull-request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,14 @@ jobs:
- name: 'hardhat compile'
run: |
yarn compile --force
- name: 'build contracts'
run: |
yarn shx cp ./packages/vite-app-ts/scripts/hardhat_contracts.json.bak ./packages/vite-app-ts/src/generated/hardhat_contracts.json
yarn contracts:build
- name: 'build production'
run: |
yarn shx cp ./packages/vite-app-ts/src/generated/contracts/hardhat_contracts.json.bak ./packages/vite-app-ts/src/generated/contracts/hardhat_contracts.json
yarn run start optimize --force
yarn run build
# - run: yarn hardhat:test
Expand Down
40 changes: 15 additions & 25 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,43 +7,38 @@ packages/hardhat/*.txt
# 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
packages/subgraph/config/config.json
tenderly.yaml

#build
*.tsbuildinfo
*.stackdump
.yalc
yalc.lock
packages/vite-app-ts/dist
packages/hardhat-ts/mnemonic.secret

# 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
dist

#Hardhat files
cache
Expand All @@ -52,19 +47,14 @@ artifacts
# misc
.DS_Store
.env*
.netlify

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

.idea

# Local Netlify folder
.netlify
*.tsbuildinfo
*.stackdump
.yalc
yalc.lock
packages/vite-app-ts/dist
packages/hardhat-ts/mnemonic.secret



9 changes: 2 additions & 7 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,9 @@
"**/build/**/*": true,
"**/debug/": true,
"**/dist/": true,
"**/node_modules/": true,
"**/obj": true,
"node_modules": true,
"node_modules/*/**": true,
"**/node_modules": true,
"yarn-error.log": true,
"**/yarn-error.log": true,
"packages\\eth-hooks/lib": true,
"**/.yalc": true
},
"search.exclude": {
Expand All @@ -42,14 +37,14 @@
"**/build/**/*": true,
"**/debug/": true,
"**/dist/": true,
"**/node_modules/": true,
"**/obj": true,
"node_modules": true,
"node_modules/*/**": true,
"**/node_modules": true,
"yarn-error.log": true,
"**/yarn-error.log": true,
"**/.yalc": true
"**/.yalc": true,
"**/.yarn": true
},
"explorerExclude.backup": null,
"eslint.workingDirectories": [
Expand Down
11 changes: 5 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@
"test": "yarn workspace @scaffold-eth/hardhat test",
"start": "yarn workspace @scaffold-eth/vite-app start",
"compile": "yarn workspace @scaffold-eth/hardhat compile",
"contracts:build": "yarn workspace @scaffold-eth/hardhat hardhat compile && yarn workspace @scaffold-eth/vite-app contracts:external",
"contracts:rebuild": "yarn workspace @scaffold-eth/hardhat hardhat clean && yarn contracts:build",
"export": "yarn workspace @scaffold-eth/hardhat export",
"deploy": "yarn workspace @scaffold-eth/hardhat deploy",
"watch": "yarn workspace @scaffold-eth/hardhat watch",
Expand Down Expand Up @@ -59,11 +61,8 @@
},
"packageManager": "[email protected]",
"devDependencies": {
"eslint": "^7.32.0",
"prettier": "^2.4.1",
"shx": "^0.3.3"
},
"dependencies": {
"react": "^17.0.2"
"eslint": "^8.6.0",
"prettier": "^2.5.1",
"shx": "^0.3.4"
}
}
23 changes: 0 additions & 23 deletions packages/hardhat-ts/contracts/Greeter.sol

This file was deleted.

18 changes: 9 additions & 9 deletions packages/hardhat-ts/contracts/YourContract.sol
Original file line number Diff line number Diff line change
Expand Up @@ -6,30 +6,30 @@ import 'hardhat/console.sol';
//import "@openzeppelin/contracts/access/Ownable.sol"; //https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/access/Ownable.sol

contract YourContract {
event SetPurpose(address sender, string purpose);

string _purpose = 'Building Unstoppable Apps';
string public purpose = 'Building Unstoppable Apps!!!';

// this is an error handler
//error EmptyPurposeError(uint code, string message);

constructor() {
// what should we do on deploy?
}

function purpose() public view returns (string memory) {
return _purpose;
}
// this is an event for the function below
event SetPurpose(address sender, string purpose);

function setPurpose(string memory newPurpose) public payable {
// you can add error handling!

// if(bytes(newPurpose).length == 0){
// revert EmptyPurposeError({
// code: 1,
// message: "Purpose can not be empty"
// });
// }

_purpose = newPurpose;
console.log(msg.sender, 'set purpose to', _purpose);
emit SetPurpose(msg.sender, _purpose);
purpose = newPurpose;
console.log(msg.sender, 'set purpose to', purpose);
emit SetPurpose(msg.sender, purpose);
}
}
7 changes: 3 additions & 4 deletions packages/hardhat-ts/deploy/00_deploy_your_contract.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
import { DeployFunction } from 'hardhat-deploy/types';
import { parseEther } from 'ethers/lib/utils';
import { HardhatRuntimeEnvironmentExtended } from 'helpers/types/hardhat-type-extensions';
import { HardhatRuntimeEnvironment } from 'hardhat/types';

const func: DeployFunction = async (hre: HardhatRuntimeEnvironmentExtended) => {
const { getNamedAccounts, deployments } = hre as any;
const func: DeployFunction = async (hre: HardhatRuntimeEnvironment) => {
const { getNamedAccounts, deployments } = hre;
const { deploy } = deployments;
const { deployer } = await getNamedAccounts();
await deploy('YourContract', {
Expand Down
3 changes: 1 addition & 2 deletions packages/hardhat-ts/generated/.gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
# Ignore everything in this directory
*
# Except this file
!.gitignore
!contract-types
!.gitignore
9 changes: 0 additions & 9 deletions packages/hardhat-ts/hardhat.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ import '@nomiclabs/hardhat-waffle';
import '@nomiclabs/hardhat-ethers';
import '@tenderly/hardhat-tenderly';
import 'hardhat-deploy';
// not required as we are using @nomiclabs/hardhat-ethers@npm:hardhat-deploy-ethers

// import 'solidity-coverage';

Expand All @@ -26,14 +25,6 @@ import { HardhatRuntimeEnvironmentExtended, TEthers } from 'helpers/types/hardha

import { create } from 'ipfs-http-client';

declare module 'hardhat/types/runtime' {
// This is an example of an extension to the Hardhat Runtime Environment.
// This new field will be available in tasks' actions, scripts, and tests.
export interface HardhatRuntimeEnvironment {
ethers: TEthers;
}
}

const { isAddress, getAddress, formatUnits, parseUnits } = utils;
//
// Select the network you want to deploy to here:
Expand Down
55 changes: 27 additions & 28 deletions packages/hardhat-ts/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,7 @@
"fork": "hardhat node --fork https://mainnet.infura.io/v3/460f40a260564ac4a4f4b3fffb032dad",
"test": "hardhat test --network hardhat",
"compile": "hardhat compile",
"deploy": "hardhat deploy --export-all ../vite-app-ts/src/generated/contracts/hardhat_contracts.json",
"export": "hardhat export --export-all ../vite-app-ts/src/generated/contracts/hardhat_contracts.json",
"deploy": "hardhat deploy --export-all ../vite-app-ts/src/generated/hardhat_contracts.json",
"postdeploy": "hardhat run scripts/publish.ts",
"watch": "node scripts/watch.js",
"accounts": "hardhat accounts",
Expand All @@ -19,44 +18,44 @@
"etherscan-verify": "hardhat etherscan-verify --api-key PSW8C433Q667DVEX5BCRMGNAH9FSGFZ7Q8"
},
"dependencies": {
"@eth-optimism/hardhat-ovm": "^0.2.2",
"@ethereumjs/vm": "^5.5.3",
"@ethersproject/providers": "^5.4.1",
"@eth-optimism/hardhat-ovm": "^0.2.4",
"@ethereumjs/vm": "^5.6.0",
"@ethersproject/providers": "^5.5.2",
"@nomiclabs/hardhat-ethers": "npm:hardhat-deploy-ethers@^0.3.0-beta.10",
"@nomiclabs/hardhat-waffle": "^2.0.0",
"@openzeppelin/contracts": "^4.1.0",
"@tenderly/hardhat-tenderly": "^1.0.10",
"@typechain/ethers-v5": "^7.0.1",
"@typechain/hardhat": "^2.0.2",
"chalk": "^4.1.1",
"@nomiclabs/hardhat-waffle": "^2.0.1",
"@openzeppelin/contracts": "^4.4.1",
"@tenderly/hardhat-tenderly": "^1.0.13",
"@typechain/ethers-v5": "^7.2.0",
"@typechain/hardhat": "^2.3.1",
"chalk": "^4.1.2",
"ethereum-waffle": "^3.4.0",
"ethers": "^5.4.1",
"hardhat": "^2.4.0",
"hardhat-deploy": "^0.9.2",
"ethers": "^5.5.3",
"hardhat": "^2.8.2",
"hardhat-deploy": "^0.9.24",
"hardhat-deploy-ethers": "^0.3.0-beta.10",
"ipfs-http-client": "^54.0.2",
"qrcode-terminal": "^0.12.0",
"typechain": "^5.1.1"
"typechain": "^5.2.0"
},
"devDependencies": {
"@types/jest": "^27.0.2",
"@types/node": "^16.11.1",
"eslint": "^7.32.0",
"eslint-config-airbnb": "^18.2.1",
"eslint-config-airbnb-typescript": "^14.0.1",
"@types/jest": "^27.4.0",
"@types/node": "^16.11.19",
"eslint": "^8.6.0",
"eslint-config-airbnb": "^19.0.4",
"eslint-config-airbnb-typescript": "^16.1.0",
"eslint-config-prettier": "^8.3.0",
"eslint-plugin-import": "^2.25.2",
"eslint-plugin-jest": "^24.7.0",
"eslint-plugin-import": "^2.25.4",
"eslint-plugin-jest": "^25.3.4",
"eslint-plugin-prettier": "^4.0.0",
"jest": "^27.3.1",
"node-watch": "^0.7.1",
"prettier": "^2.4.1",
"jest": "^27.4.7",
"node-watch": "^0.7.2",
"prettier": "^2.5.1",
"prettier-plugin-solidity": "^1.0.0-beta.13",
"rlp": "^2.2.7",
"solidity-coverage": "^0.7.17",
"ts-node": "^10.3.0",
"tsconfig-paths": "^3.11.0",
"typescript": "^4.3.4"
"ts-node": "^10.4.0",
"tsconfig-paths": "^3.12.0",
"typescript": "^4.5.4"
},
"installConfig": {
"hoistingLimits": "workspaces"
Expand Down
3 changes: 1 addition & 2 deletions packages/hardhat-ts/scripts/publish.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import '@nomiclabs/hardhat-waffle';
import * as fs from 'fs';
import * as chalk from 'chalk';
import * as hre from 'hardhat';
import { DeploymentT } from 'helpers/types/hardhat-type-extensions';
import path from 'path';

const publishGenerated = '../vite-app-ts/src/generated/contracts';
Expand All @@ -15,7 +14,7 @@ const graphDir = '../subgraph';
const publishContract = (contractName: string, networkName: string) => {
try {
let contract = fs.readFileSync(`${deploymentsDir}/${networkName}/${contractName}.json`).toString();
const contractJson: DeploymentT = JSON.parse(contract);
const contractJson: { address: string; abi: [] } = JSON.parse(contract);
const graphConfigPath = `${graphDir}/config/config.json`;
let graphConfigStr = '{}';
try {
Expand Down
4 changes: 2 additions & 2 deletions packages/subgraph/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
"deploy-local": "graph deploy --node http://localhost:8020/ --ipfs http://localhost:5001 scaffold-eth/your-contract"
},
"dependencies": {
"@graphprotocol/graph-cli": "^0.22.2",
"@graphprotocol/graph-ts": "^0.22.0"
"@graphprotocol/graph-cli": "^0.25.2",
"@graphprotocol/graph-ts": "^0.24.1"
},
"devDependencies": {
"mustache": "^4.2.0"
Expand Down
Loading

0 comments on commit 29a4ce9

Please sign in to comment.