Skip to content

Commit 875c640

Browse files
committed
Transpile 37a3970
0 parents  commit 875c640

File tree

345 files changed

+67547
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

345 files changed

+67547
-0
lines changed

.codecov.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
comment: off
2+
github_checks:
3+
annotations: false
4+
coverage:
5+
status:
6+
patch:
7+
default:
8+
target: 95%
9+
project:
10+
default:
11+
threshold: 1%

.editorconfig

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# EditorConfig is awesome: https://EditorConfig.org
2+
3+
# top-most EditorConfig file
4+
root = true
5+
6+
[*]
7+
charset = utf-8
8+
end_of_line = lf
9+
indent_style = space
10+
insert_final_newline = true
11+
trim_trailing_whitespace = false
12+
max_line_length = 120
13+
14+
[*.sol]
15+
indent_size = 4
16+
17+
[*.js]
18+
indent_size = 2
19+
20+
[*.adoc]
21+
max_line_length = 0

.eslintrc

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
{
2+
"extends" : [
3+
"standard",
4+
"plugin:promise/recommended",
5+
],
6+
"plugins": [
7+
"mocha-no-only",
8+
"promise",
9+
],
10+
"env": {
11+
"browser" : true,
12+
"node" : true,
13+
"mocha" : true,
14+
"jest" : true,
15+
},
16+
"globals" : {
17+
"artifacts": false,
18+
"contract": false,
19+
"assert": false,
20+
"web3": false,
21+
"usePlugin": false,
22+
"extendEnvironment": false,
23+
},
24+
"rules": {
25+
26+
// Strict mode
27+
"strict": ["error", "global"],
28+
29+
// Code style
30+
"array-bracket-spacing": ["off"],
31+
"camelcase": ["error", {"properties": "always"}],
32+
"comma-dangle": ["error", "always-multiline"],
33+
"comma-spacing": ["error", {"before": false, "after": true}],
34+
"dot-notation": ["error", {"allowKeywords": true, "allowPattern": ""}],
35+
"eol-last": ["error", "always"],
36+
"eqeqeq": ["error", "smart"],
37+
"generator-star-spacing": ["error", "before"],
38+
"indent": ["error", 2],
39+
"linebreak-style": ["error", "unix"],
40+
"max-len": ["error", 120, 2],
41+
"no-debugger": "off",
42+
"no-dupe-args": "error",
43+
"no-dupe-keys": "error",
44+
"no-mixed-spaces-and-tabs": ["error", "smart-tabs"],
45+
"no-redeclare": ["error", {"builtinGlobals": true}],
46+
"no-trailing-spaces": ["error", { "skipBlankLines": false }],
47+
"no-undef": "error",
48+
"no-use-before-define": "off",
49+
"no-var": "error",
50+
"object-curly-spacing": ["error", "always"],
51+
"prefer-const": "error",
52+
"quotes": ["error", "single"],
53+
"semi": ["error", "always"],
54+
"space-before-function-paren": ["error", "always"],
55+
56+
"mocha-no-only/mocha-no-only": ["error"],
57+
58+
"promise/always-return": "off",
59+
"promise/avoid-new": "off",
60+
},
61+
"parserOptions": {
62+
"ecmaVersion": 2018
63+
}
64+
}

.gitattributes

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
*.sol linguist-language=Solidity

.github/ISSUE_TEMPLATE/bug_report.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
---
2+
name: Bug report
3+
about: Report a bug in OpenZeppelin Contracts
4+
5+
---
6+
7+
<!-- Briefly describe the issue you're experiencing. Tell us what you were trying to do and what happened instead. -->
8+
9+
<!-- Remember, this is not a place to ask for help debugging code. For that, we welcome you in the OpenZeppelin Community Forum: https://forum.openzeppelin.com/. -->
10+
11+
**💻 Environment**
12+
13+
<!-- Tell us what version of OpenZeppelin Contracts you're using, and how you're using it: Truffle, Remix, etc. -->
14+
15+
**📝 Details**
16+
17+
<!-- Describe the problem you have been experiencing in more detail. Include as much information as you think is relevant. Keep in mind that transactions can fail for many reasons; context is key here. -->
18+
19+
**🔢 Code to reproduce bug**
20+
21+
<!-- We will be able to better help if you provide a minimal example that triggers the bug. -->

.github/ISSUE_TEMPLATE/config.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
contact_links:
2+
- name: Support request
3+
url: https://forum.openzeppelin.com/c/support/contracts/18
4+
about: Ask the community in the Community Forum
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
---
2+
name: Feature request
3+
about: Suggest an idea for OpenZeppelin Contracts
4+
5+
---
6+
7+
**🧐 Motivation**
8+
<!-- Is your feature request related to a specific problem? Is it just a crazy idea? Tell us about it! -->
9+
10+
**📝 Details**
11+
<!-- Please describe your feature request in detail. -->
12+
13+
<!-- Make sure that you have reviewed the OpenZeppelin Contributor Guidelines. -->
14+
<!-- https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/CONTRIBUTING.md -->

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
<!-- Thank you for your interest in contributing to OpenZeppelin! -->
2+
3+
<!-- Consider opening an issue for discussion prior to submitting a PR. -->
4+
<!-- New features will be merged faster if they were first discussed and designed with the team. -->
5+
6+
Fixes #???? <!-- Fill in with issue number -->
7+
8+
<!-- Describe the changes introduced in this pull request. -->
9+
<!-- Include any context necessary for understanding the PR's purpose. -->
10+
11+
12+
#### PR Checklist
13+
14+
<!-- Before merging the pull request all of the following must be complete. -->
15+
<!-- Feel free to submit a PR or Draft PR even if some items are pending. -->
16+
<!-- Some of the items may not apply. -->
17+
18+
- [ ] Tests
19+
- [ ] Documentation
20+
- [ ] Changelog entry

.github/workflows/merge-upstream.yml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
name: Merge upstream
2+
3+
on:
4+
workflow_dispatch: {}
5+
schedule:
6+
- cron: '0 10 * * *'
7+
8+
jobs:
9+
update:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- uses: rokroskar/workflow-run-cleanup-action@v0.2.2
13+
env:
14+
GITHUB_TOKEN: ${{github.token}}
15+
- uses: actions/checkout@v2
16+
with:
17+
ref: upstream-patched
18+
fetch-depth: 0
19+
ssh-key: ${{secrets.DEPLOY_KEY}}
20+
- run: bash scripts/upgradeable/git-user-config.sh
21+
- run: bash scripts/upgradeable/merge-upstream.sh
22+
- run: git push

.github/workflows/test.yml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
name: Test
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
- release-v*
8+
pull_request: {}
9+
workflow_dispatch: {}
10+
11+
jobs:
12+
test:
13+
runs-on: ubuntu-latest
14+
steps:
15+
- uses: actions/checkout@v2
16+
- uses: actions/setup-node@v2
17+
with:
18+
node-version: 12.x
19+
- uses: actions/cache@v2
20+
id: cache
21+
with:
22+
path: '**/node_modules'
23+
key: npm-v2-${{ hashFiles('**/package-lock.json') }}
24+
restore-keys: npm-v2-
25+
- run: npm ci
26+
if: steps.cache.outputs.cache-hit != 'true'
27+
- run: bash scripts/upgradeable/transpile.sh
28+
if: github.event_name == 'pull_request'
29+
- run: npm run test
30+
env:
31+
FORCE_COLOR: 1
32+
ENABLE_GAS_REPORT: true
33+
- run: npm run test:inheritance
34+
- name: Print gas report
35+
run: cat gas-report.txt

.github/workflows/transpile.yml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: Transpile
2+
3+
on:
4+
workflow_dispatch: {}
5+
push:
6+
branches: [upstream-patched]
7+
8+
jobs:
9+
transpile:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- uses: rokroskar/workflow-run-cleanup-action@v0.2.2
13+
env:
14+
GITHUB_TOKEN: ${{github.token}}
15+
- uses: actions/checkout@v2
16+
with:
17+
ref: upstream-patched
18+
fetch-depth: 0
19+
ssh-key: ${{secrets.DEPLOY_KEY}}
20+
- uses: actions/setup-node@v1
21+
with:
22+
node-version: 12.x
23+
- uses: actions/cache@v2
24+
id: cache
25+
with:
26+
path: '**/node_modules'
27+
key: npm-v2-${{ hashFiles('**/package-lock.json') }}
28+
restore-keys: npm-v2-
29+
- run: npm ci
30+
if: steps.cache.outputs.cache-hit != 'true'
31+
- run: bash scripts/upgradeable/git-user-config.sh
32+
- run: bash scripts/upgradeable/transpile-onto.sh master origin/master
33+
- run: git push origin master

.gitignore

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
*.swp
2+
*.swo
3+
4+
# Logs
5+
logs
6+
*.log
7+
8+
# Runtime data
9+
pids
10+
*.pid
11+
*.seed
12+
allFiredEvents
13+
scTopics
14+
15+
# Coverage directory used by tools like istanbul
16+
coverage
17+
coverage.json
18+
coverageEnv
19+
20+
# node-waf configuration
21+
.lock-wscript
22+
23+
# Dependency directory
24+
node_modules
25+
26+
# Debug log from npm
27+
npm-debug.log
28+
29+
# local env variables
30+
.env
31+
32+
# truffle build directory
33+
build/
34+
35+
# macOS
36+
.DS_Store
37+
38+
# truffle
39+
.node-xmlhttprequest-*
40+
41+
# IntelliJ IDE
42+
.idea
43+
44+
# docs artifacts
45+
docs/modules/api
46+
47+
# only used to package @openzeppelin/contracts
48+
contracts/build/
49+
contracts/README.md
50+
51+
# temporary artifact from solidity-coverage
52+
allFiredEvents
53+
.coverage_artifacts
54+
.coverage_cache
55+
.coverage_contracts
56+
57+
# hardhat
58+
cache
59+
artifacts

.mocharc.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
module.exports = {
2+
timeout: 4000,
3+
};

.prettierrc

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"overrides": [
3+
{
4+
"files": "*.sol",
5+
"options": {
6+
"printWidth": 120,
7+
"explicitTypes": "always"
8+
}
9+
}
10+
]
11+
}

.solcover.js

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
module.exports = {
2+
norpc: true,
3+
testCommand: 'npm test',
4+
compileCommand: 'npm run compile',
5+
skipFiles: [
6+
'mocks',
7+
],
8+
providerOptions: {
9+
default_balance_ether: '10000000000000000000000000',
10+
},
11+
mocha: {
12+
fgrep: '[skip-on-coverage]',
13+
invert: true,
14+
},
15+
}

.solhint.json

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{
2+
"rules": {
3+
"no-unused-vars": "error",
4+
"private-vars-leading-underscore": "error",
5+
"const-name-snakecase": "error",
6+
"contract-name-camelcase": "error",
7+
"event-name-camelcase": "error",
8+
"func-name-mixedcase": "error",
9+
"func-param-name-mixedcase": "error",
10+
"modifier-name-mixedcase": "error",
11+
"private-vars-leading-underscore": "error",
12+
"var-name-mixedcase": "error",
13+
"imports-on-top": "error"
14+
}
15+
}

0 commit comments

Comments
 (0)