Skip to content

Commit

Permalink
Configure hardhat and deployment of Safe contracts for testing
Browse files Browse the repository at this point in the history
  • Loading branch information
germartinez committed Mar 1, 2021
1 parent 3c9deb5 commit 0066940
Show file tree
Hide file tree
Showing 5 changed files with 11,235 additions and 1,445 deletions.
4 changes: 4 additions & 0 deletions contracts/Deps.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
pragma solidity >=0.5.0 <0.7.0;

import { GnosisSafeProxyFactory } from "@gnosis.pm/safe-contracts/contracts/proxies/GnosisSafeProxyFactory.sol";
import { GnosisSafe } from "@gnosis.pm/safe-contracts/contracts/GnosisSafe.sol";
32 changes: 32 additions & 0 deletions hardhat.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
import '@nomiclabs/hardhat-ethers'
import '@nomiclabs/hardhat-waffle'
import 'hardhat-deploy'
import 'hardhat-typechain'
import { HardhatUserConfig } from 'hardhat/types'

const config: HardhatUserConfig = {
defaultNetwork: "hardhat",
solidity: {
compilers: [
{ version: '0.5.17' }
]
},
paths: {
artifacts: 'artifacts',
deploy: 'hardhat/deploy',
sources: 'contracts',
tests: 'tests'
},
networks: {
hardhat: {
allowUnlimitedContractSize: true,
blockGasLimit: 100000000,
gas: 100000000
}
},
namedAccounts: {
deployer: 0,
}
}

export default config
24 changes: 24 additions & 0 deletions hardhat/deploy/deploy-contracts.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
import { DeployFunction } from 'hardhat-deploy/types'
import { HardhatRuntimeEnvironment } from 'hardhat/types'

const deploy: DeployFunction = async (hre: HardhatRuntimeEnvironment) => {
const { deployments, getNamedAccounts } = hre
const { deployer } = await getNamedAccounts()
const { deploy } = deployments

await deploy('GnosisSafe', {
from: deployer,
args: [],
log: true,
deterministicDeployment: true
})

await deploy('GnosisSafeProxyFactory', {
from: deployer,
args: [],
log: true,
deterministicDeployment: true
})
}

export default deploy
23 changes: 17 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@
"safe"
],
"scripts": {
"build": "yarn rimraf dist && tsc",
"test": "jest",
"format": "prettier --write \"src/**/*.ts\"",
"build": "yarn rimraf dist && tsc && hardhat compile",
"test": "hardhat deploy && hardhat test",
"format": "prettier --write \"{src,tests,hardhat}/**/*.ts\"",
"lint": "tslint -p tsconfig.json"
},
"repository": {
Expand All @@ -25,20 +25,31 @@
},
"homepage": "https://github.com/gnosis/safe-core-sdk#readme",
"devDependencies": {
"@types/jest": "^26.0.20",
"@gnosis.pm/safe-contracts": "^1.2.0",
"@nomiclabs/hardhat-ethers": "^2.0.0",
"@nomiclabs/hardhat-waffle": "^2.0.0",
"@typechain/ethers-v5": "^6.0.1",
"@types/chai": "^4.2.15",
"@types/mocha": "^8.2.1",
"@types/node": "^14.14.28",
"@typescript-eslint/eslint-plugin": "^4.15.0",
"@typescript-eslint/parser": "^4.15.0",
"chai": "^4.3.1",
"eslint": "^7.20.0",
"eslint-config-prettier": "^7.2.0",
"eslint-plugin-prettier": "^3.3.1",
"ethereum-waffle": "^3.0.0",
"hardhat": "^2.0.11",
"hardhat-deploy": "^0.7.0-beta.46",
"hardhat-typechain": "^0.3.5",
"husky": "^5.0.9",
"jest": "^26.6.3",
"lint-staged": "^10.5.4",
"mocha": "^8.3.0",
"prettier": "^2.2.1",
"rimraf": "^3.0.2",
"ts-jest": "^26.5.1",
"ts-generator": "^0.1.1",
"ts-node": "^9.1.1",
"typechain": "^4.0.2",
"typescript": "^4.1.5"
},
"lint-staged": {
Expand Down
Loading

0 comments on commit 0066940

Please sign in to comment.