This repository has been archived by the owner on May 14, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added greeter contract and terminal auto setup
- Loading branch information
1 parent
7dec3b2
commit 2d1bd48
Showing
7 changed files
with
156 additions
and
42 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
{ | ||
"multiCommand.commands": [ | ||
|
||
{ | ||
"command": "multiCommand.watch", | ||
"sequence": [ | ||
"workbench.action.terminal.new", | ||
{ | ||
"command": "workbench.action.terminal.renameWithArg", | ||
"args": { | ||
"name": "yarn watch" | ||
} | ||
}, | ||
{ | ||
"command": "workbench.action.terminal.sendSequence", | ||
"args": { | ||
"text": "yarn run watch\u000D" // \u000D is a return so it runs | ||
} | ||
} | ||
] | ||
}, | ||
{ | ||
"command": "multiCommand.node", | ||
"sequence": [ | ||
"workbench.action.terminal.new", | ||
{ | ||
"command": "workbench.action.terminal.renameWithArg", | ||
"args": { | ||
"name": "yarn node" | ||
} | ||
}, | ||
{ | ||
"command": "workbench.action.terminal.sendSequence", | ||
"args": { | ||
"text": "yarn run node\u000D" // \u000D is a return so it runs | ||
} | ||
} | ||
] | ||
}, | ||
{ | ||
"command": "multiCommand.frontend", | ||
"sequence": [ | ||
"workbench.action.terminal.new", | ||
{ | ||
"command": "workbench.action.terminal.renameWithArg", | ||
"args": { | ||
"name": "yarn frontend" | ||
} | ||
}, | ||
{ | ||
"command": "workbench.action.terminal.sendSequence", | ||
"args": { | ||
"text": "yarn run frontend\u000D" // \u000D is a return so it runs | ||
} | ||
} | ||
] | ||
}, | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
{ | ||
// See https://go.microsoft.com/fwlink/?LinkId=733558 | ||
// for the documentation about the tasks.json format | ||
"version": "2.0.0", | ||
"tasks": [ | ||
|
||
{ | ||
"label": "Run 4 terminals on startup", | ||
"runOptions": {"runOn": "folderOpen"}, | ||
|
||
"dependsOrder": "sequence", // or parallel | ||
|
||
"dependsOn": [ | ||
"terminal1", | ||
"terminal2", | ||
"terminal3" | ||
] | ||
}, | ||
|
||
{ | ||
"label": "terminal1", | ||
"command": "${command:multiCommand.watch}" | ||
}, | ||
{ | ||
"label": "terminal2", | ||
"command": "${command:multiCommand.node}", | ||
}, | ||
{ | ||
"label": "terminal3", | ||
"command": "${command:multiCommand.frontend}" | ||
}, | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
//SPDX-License-Identifier: Unlicense | ||
pragma solidity ^0.6.0; | ||
|
||
import "hardhat/console.sol"; | ||
|
||
contract Greeter { | ||
string greeting; | ||
|
||
constructor(string memory _greeting) public { | ||
console.log("Deploying a Greeter with greeting:", _greeting); | ||
greeting = _greeting; | ||
} | ||
|
||
function greet() public view returns (string memory) { | ||
return greeting; | ||
} | ||
|
||
function setGreeting(string memory _greeting) public { | ||
console.log("Changing greeting from '%s' to '%s'", greeting, _greeting); | ||
greeting = _greeting; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import { HardhatRuntimeEnvironment } from "hardhat/types"; | ||
import { DeployFunction } from "hardhat-deploy/types"; | ||
|
||
const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) { | ||
const { deployments, getNamedAccounts } = hre; | ||
const { deploy } = deployments; | ||
|
||
const { deployer } = await getNamedAccounts(); | ||
|
||
await deploy("Greeter", { | ||
from: deployer, | ||
args: ["Hello from Hardhat"], | ||
log: true, | ||
}); | ||
}; | ||
export default func; | ||
// func.tags = ['Greeter']; | ||
// func.dependencies = ['GreeterElse']; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters