Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deployment script with OpenZepplin deploy #138

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions hardhat.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import './src/tasks/activate';

const accounts = {
mnemonic:
process.env.SIGNER_MNEMONIC ??
process.env['SIGNER_MNEMONIC'] ??
'clown border solid resource camp medal angle success achieve impulse beach inherit busy track hazard',
};

Expand Down Expand Up @@ -50,16 +50,16 @@ const config: HardhatUserConfig = {
},
},
docgen: {
output: 'docs',
// output: 'docs',
pages: 'files',
},
gasReporter: {
enabled: process.env.REPORT_GAS !== undefined,
enabled: process.env['REPORT_GAS'] !== undefined,
currency: 'USD',
},
etherscan: {
apiKey: {
polygon: process.env.POLYGONSCAN_API_KEY,
polygon: process.env['POLYGONSCAN_API_KEY'] || '',
},
},
};
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@
"@nomiclabs/hardhat-ethers": "^2.2.2",
"@openzeppelin/contracts": "^4.8.2",
"@openzeppelin/contracts-upgradeable": "^4.8.2",
"@openzeppelin/hardhat-upgrades": "^1.22.1",
"@openzeppelin/defender-sdk": "^1.7.0",
"@openzeppelin/hardhat-upgrades": "^1.28.0",
"@statechannels/nitro-protocol": "^2.0.0-alpha.2",
"@tsconfig/node18-strictest-esm": "^1.0.1",
"@typescript-eslint/eslint-plugin": "^5.47.0",
"@typescript-eslint/parser": "^5.47.0",
"chai": "^4.3.7",
Expand Down
25 changes: 25 additions & 0 deletions scripts/deployTestERC20.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
const artifactFile = require('../artifacts/contracts/test/TestERC20.sol/TestERC20.json');
const API_KEY = process.env['DEFENDER_API_KEY'];
const API_SECRET = process.env['DEFENDER_API_SECRET'];
const { Defender } = require('@openzeppelin/defender-sdk');
const client = new Defender({ apiKey: API_KEY, apiSecret: API_SECRET });


const main = async (): Promise<any> => {
return client.deploy.deployContract({
contractName: 'TestERC20',
contractPath: 'contracts/test/TestERC20.sol',
artifactPayload: JSON.stringify(artifactFile),
network: 'goerli',
licenseType: 'MIT',
constructorInputs: ['TEST', 'TEST', '1000000000000000000'],
verifySourceCode: false
});
}

main().then((deployment) => {
console.log(deployment);
}).catch((error) => {
console.error(error);
process.exitCode = 1;
});
35 changes: 27 additions & 8 deletions tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,33 @@
{
"$schema": "https://json.schemastore.org/tsconfig",
"display": "Tweaked Node 18 + ESM + Strictest",
"extends": "@tsconfig/node18-strictest-esm/tsconfig.json",
"compilerOptions": {
"resolveJsonModule": true,
"module": "CommonJS",
"exactOptionalPropertyTypes": false,
"noPropertyAccessFromIndexSignature": false,
"noUncheckedIndexedAccess": false,
"resolveJsonModule": true
"target": "es2022",
"strict": true,
"esModuleInterop": true,
"skipLibCheck": true,
"forceConsistentCasingInFileNames": true,
"moduleResolution": "node",
"allowUnusedLabels": false,
"allowUnreachableCode": false,
"exactOptionalPropertyTypes": true,
"noFallthroughCasesInSwitch": true,
"noImplicitOverride": true,
"noImplicitReturns": true,
"noPropertyAccessFromIndexSignature": true,
"noUncheckedIndexedAccess": true,
"noUnusedLocals": true,
"noUnusedParameters": true,
"checkJs": true
},
"include": ["./contracts", "./scripts", "./src", "./test"],
"files": ["./hardhat.config.ts"]
"include": [
"./contracts",
"./scripts",
"./src",
"./test"
],
"files": [
"./hardhat.config.ts"
]
}