Skip to content

Commit

Permalink
Revert "move deploy script to TS"
Browse files Browse the repository at this point in the history
This reverts commit 80b2004.
  • Loading branch information
holic committed Sep 30, 2022
1 parent a1f085d commit 6fa3268
Show file tree
Hide file tree
Showing 26 changed files with 159 additions and 212 deletions.
7 changes: 2 additions & 5 deletions packages/contracts/.env
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
CHAIN_ID=
RPC_URL=

DEPLOYER=
DEPLOYER_PRIVATE_KEY=

# for verifying
CHAIN_NAME=goerli
RPC_URL=
ETHERSCAN_API_KEY=
12 changes: 12 additions & 0 deletions packages/contracts/deploy.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# Expects jq to be installed

source .env
source .env.goerli

forge script script/Deploy.s.sol -vvv \
--chain-id $CHAIN_ID \
--rpc-url $RPC_URL \
--private-key $DEPLOYER_PRIVATE_KEY \
--broadcast

# cat broadcast/Deploy.s.sol/5/run-latest.json | jq -r '.transactions | to_entries | [{key: .[].value.contractName, value: {deployedTo: .[].value.contractAddress, deployer: .[].value.transaction.from, transactionHash: ..|..}}] | from_entries'
95 changes: 0 additions & 95 deletions packages/contracts/deploy.ts

This file was deleted.

16 changes: 0 additions & 16 deletions packages/contracts/deploys/goerli.json

This file was deleted.

5 changes: 5 additions & 0 deletions packages/contracts/deploys/goerli/ExampleNFT.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"deployedTo": "0xe584409f2ba1ade9895485d90587fd46baa3c0d8",
"deployer": "0xf3337fe5a01039e77bceeb3f6df36ee717b784b8",
"transactionHash": "0x0f2e90e779142bf098532dcc6a335cdf115a8e96ec93f30323d6b078c0edf656"
}
14 changes: 5 additions & 9 deletions packages/contracts/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,29 +6,25 @@
"pnpm": "7"
},
"scripts": {
"prettier": "pnpm lint:fix && prettier --write \"src/**/*.sol\" --plugin=prettier-plugin-solidity",
"lint": "solhint --config ../../.solhint.json \"src/**/*.sol\"",
"lint:fix": "pnpm lint --fix",
"test": "forge test --no-match-contract Forked",
"test:fork": "source .env && forge test --fork-url $RPC_URL --match-contract Forked",
"clean": "rm -rf types",
"build": "pnpm clean && pnpm compile && pnpm types",
"compile": "forge build --force --skip tests scripts",
"types": "typechain --target ethers-v5 \"out/**/*.sol/!(*.abi).json\" --out-dir types && tsc",
"test": "forge test --no-match-contract Forked",
"test:fork": "source .env && forge test --fork-url $RPC_URL --match-contract Forked",
"deploy:goerli": "dotenv -e .env.goerli -e .env ts-node deploy.ts"
"prettier": "pnpm lint:fix && prettier --write \"src/**/*.sol\" --plugin=prettier-plugin-solidity",
"lint": "solhint --config ../../.solhint.json \"src/**/*.sol\"",
"lint:fix": "pnpm lint --fix"
},
"devDependencies": {
"@ethersproject/abi": "^5.0.0",
"@ethersproject/bytes": "^5.0.0",
"@ethersproject/providers": "^5.0.0",
"@typechain/ethers-v5": "^10.0.0",
"@types/node": "17.0.0",
"dotenv-cli": "^6.0.0",
"ethers": "^5.5.2",
"prettier-plugin-solidity": "^1.0.0-beta.19",
"solhint": "^3.3.7",
"solhint-plugin-prettier": "^0.0.5",
"ts-node": "^10.9.1",
"typechain": "^8.0.0",
"typescript": "^4.5.5"
}
Expand Down
2 changes: 2 additions & 0 deletions packages/contracts/script/Deploy.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ contract Deploy is Script {
function run() public {
vm.startBroadcast();

// TODO: check if we've already deployed and reuse if possible

ContentStore contentStore = new ContentStore();
FileStore fileStore = new FileStore(contentStore);

Expand Down
8 changes: 1 addition & 7 deletions packages/contracts/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,10 @@
"compilerOptions": {
"lib": ["esnext"],
"target": "es6",
"module": "es6",
"module": "commonjs",
"strict": true,
"esModuleInterop": true,
"moduleResolution": "node",
"resolveJsonModule": true,
"isolatedModules": true
},
"ts-node": {
"compilerOptions": {
"module": "commonjs"
}
}
}
3 changes: 2 additions & 1 deletion packages/contracts/types/ContentStore.js
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
export {};
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
3 changes: 2 additions & 1 deletion packages/contracts/types/FileStore.js
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
export {};
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
3 changes: 2 additions & 1 deletion packages/contracts/types/IContentStore.js
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
export {};
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
3 changes: 2 additions & 1 deletion packages/contracts/types/IFileStore.js
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
export {};
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
3 changes: 2 additions & 1 deletion packages/contracts/types/Ownable.js
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
export {};
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
3 changes: 2 additions & 1 deletion packages/contracts/types/Ownable2Step.js
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
export {};
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
3 changes: 2 additions & 1 deletion packages/contracts/types/SSTORE2.js
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
export {};
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
3 changes: 2 additions & 1 deletion packages/contracts/types/common.js
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
export {};
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
12 changes: 8 additions & 4 deletions packages/contracts/types/factories/ContentStore__factory.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.ContentStore__factory = void 0;
/* Autogenerated file. Do not edit manually. */
/* tslint:disable */
/* eslint-disable */
import { utils, Contract, ContractFactory } from "ethers";
const ethers_1 = require("ethers");
const _abi = [
{
inputs: [
Expand Down Expand Up @@ -166,7 +169,7 @@ const _abi = [
];
const _bytecode = "0x608060405234801561001057600080fd5b50610514806100206000396000f3fe608060405234801561001057600080fd5b50600436106100625760003560e01c8063093e9839146100675780631bf226ac1461009c57806331654b09146100dd5780633a77c6c9146100fe5780634641dce614610111578063f97406f714610124575b600080fd5b61007a61007536600461040d565b61015f565b604080519283526001600160a01b039091166020830152015b60405180910390f35b6100c56100aa3660046104be565b6000602081905290815260409020546001600160a01b031681565b6040516001600160a01b039091168152602001610093565b6100f06100eb3660046104be565b610218565b604051908152602001610093565b6100f061010c3660046104d7565b61027d565b6100c561011f3660046104be565b610320565b61014f6101323660046104be565b6000908152602081905260409020546001600160a01b0316151590565b6040519015158152602001610093565b805160208083019190912060008181529182905260408220549091906001600160a01b0316156101aa575060008181526020819052604090205490926001600160a01b039091169150565b6101b383610374565b6000838152602081815260409182902080546001600160a01b0319166001600160a01b0385161790558551915191825291925083917fa1011c3aaafa54b70d8ca12f3b9257ca9a4fe1f6a02196819ea1dcaee1932ca0910160405180910390a2915091565b6000818152602081905260408120546001600160a01b0316610255576040516303001a1960e41b8152600481018390526024015b60405180910390fd5b600082815260208190526040902054610276906001600160a01b03166103b6565b5192915050565b600080610289836103b6565b80516020808301919091206000818152918290526040909120549093509091506001600160a01b0316156102bd5750919050565b6000828152602081815260409182902080546001600160a01b0319166001600160a01b0387161790558251915191825283917fa1011c3aaafa54b70d8ca12f3b9257ca9a4fe1f6a02196819ea1dcaee1932ca0910160405180910390a250919050565b6000818152602081905260408120546001600160a01b0316610358576040516303001a1960e41b81526004810183905260240161024c565b506000908152602081905260409020546001600160a01b031690565b60008151600181018060401b6a61000080600a3d393df300178452600a8101601585016000f0925050816103b05763301164256000526004601cfd5b90915290565b6060813b806103cd576311052bb46000526004601cfd5b600181039050604051915061ffe0603f820116820160405280825280600160208401853c50919050565b634e487b7160e01b600052604160045260246000fd5b60006020828403121561041f57600080fd5b813567ffffffffffffffff8082111561043757600080fd5b818401915084601f83011261044b57600080fd5b81358181111561045d5761045d6103f7565b604051601f8201601f19908116603f01168101908382118183101715610485576104856103f7565b8160405282815287602084870101111561049e57600080fd5b826020860160208301376000928101602001929092525095945050505050565b6000602082840312156104d057600080fd5b5035919050565b6000602082840312156104e957600080fd5b81356001600160a01b038116811461050057600080fd5b939250505056fea164736f6c634300080d000a";
const isSuperArgs = (xs) => xs.length > 1;
export class ContentStore__factory extends ContractFactory {
class ContentStore__factory extends ethers_1.ContractFactory {
constructor(...args) {
if (isSuperArgs(args)) {
super(...args);
Expand All @@ -188,11 +191,12 @@ export class ContentStore__factory extends ContractFactory {
return super.connect(signer);
}
static createInterface() {
return new utils.Interface(_abi);
return new ethers_1.utils.Interface(_abi);
}
static connect(address, signerOrProvider) {
return new Contract(address, _abi, signerOrProvider);
return new ethers_1.Contract(address, _abi, signerOrProvider);
}
}
exports.ContentStore__factory = ContentStore__factory;
ContentStore__factory.bytecode = _bytecode;
ContentStore__factory.abi = _abi;
Loading

0 comments on commit 6fa3268

Please sign in to comment.