Skip to content

Commit

Permalink
init
Browse files Browse the repository at this point in the history
  • Loading branch information
mmv08 committed Mar 25, 2022
0 parents commit 123fd47
Show file tree
Hide file tree
Showing 35 changed files with 12,226 additions and 0 deletions.
6 changes: 6 additions & 0 deletions .env.sample
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
MNEMONIC=""
# Used for infura based network
INFURA_KEY=""
# Used for custom network
NODE_URL=""
ETHERSCAN_API_KEY=""
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
*.sol linguist-language=Solidity
34 changes: 34 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
---
name: Bug report
about: Bug report about the Safe smart contracts

---

## Prerequisites

- First, many thanks for taking part in the community and helping us improve. We appreciate that a lot.
- Support questions are better asked in our Gitter chat: https://gitter.im/gnosis/Safe
- Please ensure the issue isn't already reported.

*Please delete the above section and the instructions in the sections below before submitting*

## Description

Please describe considely the bug you have found, and what you expect instead.

## Environment

- Compiler version:
- Compiler options (if applicable, e.g. optimizer enabled):
- Framework/IDE (e.g. Truffle or Remix):
- EVM execution environment / backend / blockchain client:
- Operating system:

## Steps to reproduce

If applicable, please provide a *minimal* source code example to trigger the bug you have found.
Provide as much information as necessary to reproduce the bug.

## Additional context

Add any other context about the problem here.
29 changes: 29 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
---
name: Feature request
about: Suggest an idea or feature request for the Safe smart contracts project

---

## Prerequisites

- First, many thanks for taking part in the community and helping us improve. We appreciate that a lot.
- Support questions are better asked in our Gitter chat: https://gitter.im/gnosis/Safe
- Please ensure the issue isn't already reported.

*Please delete the above section and the instructions in the sections below before submitting*

## Context / issue

In case your feature request related to a problem, please add clear and concise description of what the issue is.

## Proposed solution

Please add a clear and concise description of what you want to happen.

## Alternatives

Please add a clear and concise description of any alternative solutions or features you've considered.

## Additional context

Add any other context or screenshots about the feature request here.
81 changes: 81 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
name: safe-contracts
on: [push]

jobs:
tests:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: 16.7.0
- uses: actions/cache@v2
with:
path: "**/node_modules"
key: ${{ runner.os }}-modules-${{ hashFiles('**/yarn.lock') }}
- run: yarn --frozen-lockfile
- run: yarn build
- run: yarn coverage
- name: Coveralls
uses: coverallsapp/github-action@master
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: 16.7.0
- uses: actions/cache@v2
with:
path: "**/node_modules"
key: ${{ runner.os }}-modules-${{ hashFiles('**/yarn.lock') }}
- run: yarn --frozen-lockfile
- run: yarn lint:sol
tests-other:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
contract-name: ["GnosisSafeL2"]
env:
SAFE_CONTRACT_UNDER_TEST: ${{ matrix.contract-name }}
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: 16.7.0
- uses: actions/cache@v2
with:
path: "**/node_modules"
key: ${{ runner.os }}-modules-${{ hashFiles('**/yarn.lock') }}
- run: yarn --frozen-lockfile
- run: yarn build
- run: yarn coverage
- name: Coveralls
uses: coverallsapp/github-action@master
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
benchmarks:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
solidity: ["0.7.6", "0.8.2"]
include:
- solidity: "0.8.2"
settings: '{"viaIR":true,"optimizer":{"enabled":true,"runs":10000}}'
env:
SOLIDITY_VERSION: ${{ matrix.solidity }}
SOLIDITY_SETTINGS: ${{ matrix.settings }}
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: 16.7.0
- uses: actions/cache@v2
with:
path: "**/node_modules"
key: ${{ runner.os }}-modules-${{ hashFiles('**/yarn.lock') }}
- run: (yarn --frozen-lockfile && yarn build && yarn hardhat codesize --contractname GnosisSafe && yarn benchmark) || echo "Benchmark failed"
14 changes: 14 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
build/
node_modules/
.DS_Store
.zos.session
.openzeppelin/.session
deployments/
env/
dist/
.env
bin/
solc
coverage/
coverage.json
yarn-error.log
1 change: 1 addition & 0 deletions .husky/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
_
21 changes: 21 additions & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

# Redirect output to stderr.
exec 1>&2

# prevent it.only or describe.only commited
if [ "$allowonlytests" != "true" ] &&
test $(git diff --cached | grep -E "\b(it|describe).only\(" | wc -l) != 0
then
cat <<\EOF
Error: Attempt to add it.only or describe.only - which may disable all other tests
If you know what you are doing you can disable this check using:
git config hooks.allowonlytests true
EOF
exit 1
fi

exit 0
1 change: 1 addition & 0 deletions .nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
v16.7.0
20 changes: 20 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"overrides": [
{
"files": "*.sol",
"options": {
"printWidth": 140,
"tabWidth": 4,
"useTabs": false,
"singleQuote": false,
"bracketSpacing": false,
"explicitTypes": "always"
}
}
],
"tabWidth": 2,
"printWidth": 140,
"trailingComma": "all",
"singleQuote": true,
"semi": false
}
10 changes: 10 additions & 0 deletions .solcover.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
module.exports = {
skipFiles: [],
mocha: {
grep: '@skip-on-coverage', // Find everything with this tag
invert: true, // Run the grep's inverse set.
},
providerOptions: {
callGasLimit: '0x6691b7',
},
}
20 changes: 20 additions & 0 deletions .solhint.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"extends": "solhint:recommended",
"plugins": [
"prettier"
],
"rules": {
"compiler-version": "off",
"func-visibility": [
"warn",
{
"ignoreConstructors": true
}
],
"prettier/prettier": "error",
"not-rely-on-time": "off",
"reason-string": "off",
"no-empty-blocks": "off",
"avoid-low-level-calls": "off"
}
}
18 changes: 18 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"version": "0.2.0",
"configurations": [
{
"name": "truffle test (ganache running)",
"type": "node",
"request": "launch",
"program": "${workspaceRoot}/node_modules/truffle/build/cli.bundled.js",
"args": [
"test"
],
"cwd": "${workspaceRoot}",
"outFiles": [
"${workspaceRoot}/test/**/*"
],
},
]
}
Loading

0 comments on commit 123fd47

Please sign in to comment.