Skip to content

Commit

Permalink
Refactor: hardhat-deploy, contractLoader, signers, ethers, rollup-rea…
Browse files Browse the repository at this point in the history
…diness (scaffold-eth#192)

* packages <> docker re-shuffle

- move graph-node docker setup into the packages folder
- create git submodule for arbitrum & optimism

* add .gitModules

* update package.json for graph-node move

* add hardhat-deploy

- add hardhat-deploy
- migrate to using that for deployments & publishing
- make contractLoader chain aware
- introduce external_contracts.json
- Update README notes

* setup tweaks

* Update .gitignore

* plumbing

- fix yarn start if there is no /contracts/contracts.json
- re-write publish to just focus on publishing to the subgraph

* make external contracts js not json

* network name config to contractLoader

* chore: arb-ts dependency

* tidy up ethers, signers not providers

* back to localhost

* typos

* feat: local eth and erc20 arbitrium bridging support in debug mode

* fix abi publishing

* reshuffle into services package

* fix graph-node commands

* remove testing erc20

* readme tweaks

* Re-added bytecode saving to publish script

* Commented bytecode export

* hardhat_contracts not contracts

* revert the wait()

* wait() in transactor

* Pull in L2Bridge & Refactors from chains-and-deployments (scaffold-eth#207)

* feat: optimism eth bridge local integration

* Added dumb Arbitrum bridge page

* Eth bridge on Rinkeby

* chore: updated eth bridge method

* Optimism bridge

- Added optimism
- Refactored to cut down unnecessary rpc calls

* refactor: added ovm_eth integration to verify optimism eth bridging

* Injected provider changes

* Correctly switch user signer on network switch

* combine the bridges

* fix up look sharp

- fix up testnet bridge deposits
- dynamic contract metadata in contractLoader config
- cleanup in contractLoader
- bytecode commented out in publish
- rinkeby Arbitrum

* move l2 bridge, back to vanilla, typos

* more tidier

Co-authored-by: viraj124 <[email protected]>
Co-authored-by: Pablo Ruiz <[email protected]>

* docs / demos

- examples in deploy
- etherscan verification
- companion networks
- arbitrum config
- README updates

* spaces

* Title + remove hardhat-etherscan

* bits and pieces

Co-authored-by: viraj124 <[email protected]>
Co-authored-by: Pablo Ruiz <[email protected]>
  • Loading branch information
3 people authored Jun 21, 2021
1 parent 5f26eff commit 1e8e7de
Show file tree
Hide file tree
Showing 61 changed files with 2,990 additions and 1,376 deletions.
10 changes: 5 additions & 5 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
packages/subgraph/subgraph.yaml
packages/subgraph/generated
packages/subgraph/abis
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/artifacts*
packages/hardhat/deployments
packages/react-app/src/contracts/*
!packages/react-app/src/contracts/contracts.js
packages/hardhat/cache
!packages/react-app/src/contracts/external_contracts.js
packages/hardhat/cache*

docker/**/data
packages/**/data

packages/subgraph/config/config.json
tenderly.yaml
Expand Down
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
377 changes: 275 additions & 102 deletions README.md

Large diffs are not rendered by default.

5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,9 @@
"fundedwallet": "cd packages/hardhat && npx hardhat fundedwallet",
"flatten": "cd packages/hardhat && npx hardhat flatten",
"clean": "cd packages/hardhat && npx hardhat clean",
"graph-run-node": "cd docker/graph-node && docker-compose up",
"graph-remove-node": "cd docker/graph-node && docker-compose down",
"run-graph-node": "yarn workspace @scaffold-eth/services run-graph-node",
"remove-graph-node": "yarn workspace @scaffold-eth/services remove-graph-node",
"clean-graph-node": "yarn workspace @scaffold-eth/services clean-graph-node",
"graph-prepare": "mustache packages/subgraph/config/config.json packages/subgraph/src/subgraph.template.yaml > packages/subgraph/subgraph.yaml",
"graph-codegen": "yarn workspace @scaffold-eth/subgraph graph codegen",
"graph-build": "yarn workspace @scaffold-eth/subgraph graph build",
Expand Down
30 changes: 30 additions & 0 deletions packages/hardhat/deploy/00_deploy_your_contract.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
// deploy/00_deploy_your_contract.js

module.exports = async ({ getNamedAccounts, deployments }) => {
const { deploy } = deployments;
const { deployer } = await getNamedAccounts();
await deploy("YourContract", {
// Learn more about args here: https://www.npmjs.com/package/hardhat-deploy#deploymentsdeploy
from: deployer,
// args: ["Hello"],
log: true,
});

/*
// Getting a previously deployed contract
const YourContract = await ethers.getContract("YourContract", deployer);
await YourContract.setPurpose("Hello");
//const yourContract = await ethers.getContractAt('YourContract', "0xaAC799eC2d00C013f1F11c37E654e59B0429DF6A") //<-- if you want to instantiate a version of a contract at a specific address!
*/
};
module.exports.tags = ["YourContract"];

/*
Tenderly verification
let verification = await tenderly.verify({
name: contractName,
address: contractAddress,
network: targetNetwork,
});
*/
Loading

0 comments on commit 1e8e7de

Please sign in to comment.