Skip to content

Commit 98d3b46

Browse files
authored
Merge pull request #1 from OpenZeppelin/master
merge new code0601
2 parents b120b9a + 142f6c3 commit 98d3b46

File tree

421 files changed

+51488
-19097
lines changed

Some content is hidden

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

421 files changed

+51488
-19097
lines changed

.babelrc

Lines changed: 0 additions & 3 deletions
This file was deleted.

.circleci/config.yml

Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
version: 2
2+
# 2.1 does not yet support local run
3+
# unless with workaround. For simplicity just use it.
4+
# https://github.com/CircleCI-Public/circleci-cli/issues/79
5+
6+
aliases:
7+
- &defaults
8+
docker:
9+
- image: circleci/node:10
10+
11+
- &cache_key_node_modules
12+
key: v1-node_modules-{{ checksum "package-lock.json" }}
13+
14+
jobs:
15+
dependencies:
16+
<<: *defaults
17+
steps:
18+
- checkout
19+
- restore_cache:
20+
<<: *cache_key_node_modules
21+
- run:
22+
name: Install npm dependencies and prepare
23+
command: |
24+
if [ ! -d node_modules ]; then
25+
npm ci
26+
else
27+
npm run prepare
28+
fi
29+
- persist_to_workspace:
30+
root: .
31+
paths:
32+
- node_modules
33+
- build
34+
- save_cache:
35+
paths:
36+
- node_modules
37+
<<: *cache_key_node_modules
38+
39+
lint:
40+
<<: *defaults
41+
steps:
42+
- checkout
43+
- attach_workspace:
44+
at: .
45+
- run:
46+
name: Linter
47+
command: npm run lint
48+
test:
49+
<<: *defaults
50+
steps:
51+
- checkout
52+
- attach_workspace:
53+
at: .
54+
- run:
55+
name: Unit tests
56+
command: npm run test
57+
58+
coverage:
59+
<<: *defaults
60+
steps:
61+
- checkout
62+
- attach_workspace:
63+
at: .
64+
- run:
65+
name: Unit tests with coverage report
66+
command: npm run coverage
67+
68+
# TODO(xinbenlv, #1839): run SOLC_NIGHTLY to be run but allow it to fail.
69+
70+
workflows:
71+
version: 2
72+
everything:
73+
jobs:
74+
- dependencies
75+
- lint:
76+
requires:
77+
- dependencies
78+
- test:
79+
requires:
80+
- dependencies
81+
- coverage:
82+
requires:
83+
- dependencies
84+

.codecov.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
comment: off
2+
coverage:
3+
range: "100...100"

.dependabot/config.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
version: 1
2+
3+
update_configs:
4+
- package_manager: "javascript"
5+
directory: "/"
6+
update_schedule: "weekly"
7+
version_requirement_updates: "increase_versions"

.editorconfig

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
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 = true
12+
max_line_length = 120
13+
14+
[*.sol]
15+
indent_size = 4
16+
17+
[*.js]
18+
indent_size = 2

.env.example

Lines changed: 0 additions & 5 deletions
This file was deleted.

.eslintrc

Lines changed: 37 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,51 +1,62 @@
11
{
22
"extends" : [
33
"standard",
4-
"plugin:promise/recommended"
4+
"plugin:promise/recommended",
55
],
66
"plugins": [
7-
"promise"
7+
"mocha-no-only",
8+
"promise",
89
],
910
"env": {
1011
"browser" : true,
1112
"node" : true,
1213
"mocha" : true,
13-
"jest" : true
14+
"jest" : true,
1415
},
1516
"globals" : {
1617
"artifacts": false,
1718
"contract": false,
1819
"assert": false,
19-
"web3": false
20+
"web3": false,
2021
},
2122
"rules": {
2223

2324
// Strict mode
24-
"strict": [2, "global"],
25+
"strict": ["error", "global"],
2526

2627
// Code style
27-
"indent": [2, 2],
28-
"quotes": [2, "single"],
28+
"array-bracket-spacing": ["off"],
29+
"camelcase": ["error", {"properties": "always"}],
30+
"comma-dangle": ["error", "always-multiline"],
31+
"comma-spacing": ["error", {"before": false, "after": true}],
32+
"dot-notation": ["error", {"allowKeywords": true, "allowPattern": ""}],
33+
"eol-last": ["error", "always"],
34+
"eqeqeq": ["error", "smart"],
35+
"generator-star-spacing": ["error", "before"],
36+
"indent": ["error", 2],
37+
"linebreak-style": ["error", "unix"],
38+
"max-len": ["error", 120, 2],
39+
"no-debugger": "off",
40+
"no-dupe-args": "error",
41+
"no-dupe-keys": "error",
42+
"no-mixed-spaces-and-tabs": ["error", "smart-tabs"],
43+
"no-redeclare": ["error", {"builtinGlobals": true}],
44+
"no-trailing-spaces": ["error", { "skipBlankLines": false }],
45+
"no-undef": "error",
46+
"no-use-before-define": "off",
47+
"no-var": "error",
48+
"object-curly-spacing": ["error", "always"],
49+
"prefer-const": "error",
50+
"quotes": ["error", "single"],
2951
"semi": ["error", "always"],
3052
"space-before-function-paren": ["error", "always"],
31-
"no-use-before-define": 0,
32-
"eqeqeq": [2, "smart"],
33-
"dot-notation": [2, {"allowKeywords": true, "allowPattern": ""}],
34-
"no-redeclare": [2, {"builtinGlobals": true}],
35-
"no-trailing-spaces": [2, { "skipBlankLines": true }],
36-
"eol-last": 1,
37-
"comma-spacing": [2, {"before": false, "after": true}],
38-
"camelcase": [2, {"properties": "always"}],
39-
"no-mixed-spaces-and-tabs": [2, "smart-tabs"],
40-
"comma-dangle": [1, "always-multiline"],
41-
"no-dupe-args": 2,
42-
"no-dupe-keys": 2,
43-
"no-debugger": 0,
44-
"no-undef": 2,
45-
"object-curly-spacing": [2, "always"],
46-
"max-len": [2, 120, 2],
47-
"generator-star-spacing": ["error", "before"],
48-
"promise/avoid-new": 0,
49-
"promise/always-return": 0
53+
54+
"mocha-no-only/mocha-no-only": ["error"],
55+
56+
"promise/always-return": "off",
57+
"promise/avoid-new": "off",
58+
},
59+
"parserOptions": {
60+
"ecmaVersion": 2018
5061
}
5162
}

.github/ISSUE_TEMPLATE.md

Lines changed: 0 additions & 34 deletions
This file was deleted.

.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: 15 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,22 @@
11
<!-- 0. 🎉 Thank you for submitting a PR! -->
22

3-
<!-- 1. **Does this close any open issues?** If so, list them here. If not, remove the `Fixes #` line. -->
3+
<!-- 1. Does this close any open issues? Please list them below. -->
44

5-
Fixes #
5+
<!-- Keep in mind that new features have a better chance of being merged fast if
6+
they were first discussed and designed with the maintainers. If there is no
7+
corresponding issue, please consider opening one for discussion first! -->
68

7-
# 🚀 Description
9+
Fixes #
810

9-
<!-- 2. Describe the changes introduced in this pull request -->
11+
<!-- 2. Describe the changes introduced in this pull request. -->
1012
<!-- Include any context necessary for understanding the PR's purpose. -->
1113

12-
<!-- 3. Before submitting, please review the following checklist: -->
13-
14-
- [ ] 📘 I've reviewed the [OpenZeppelin Contributor Guidelines](../blob/master/CONTRIBUTING.md)
15-
- [ ] ✅ I've added tests where applicable to test my new functionality.
16-
- [ ] 📖 I've made sure that my contracts are well-documented.
17-
- [ ] 🎨 I've run the JS/Solidity linters and fixed any issues (`npm run lint:all:fix`).
14+
<!-- 3. Before submitting, please make sure that you have:
15+
- reviewed the OpenZeppelin Contributor Guidelines
16+
(https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/CONTRIBUTING.md),
17+
- added tests where applicable to test new functionality,
18+
- made sure that your contracts are well-documented,
19+
- run the Solidity linter (`npm run lint:sol`) and fixed any issues,
20+
- run the JS linter and fixed any issues (`npm run lint:fix`), and
21+
- updated the changelog, if applicable.
22+
-->

.github/stale.yml

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
# Configuration for probot-stale - https://github.com/probot/stale
2+
3+
# Number of days of inactivity before an Issue or Pull Request becomes stale
4+
daysUntilStale: 15
5+
6+
# Number of days of inactivity before an Issue or Pull Request with the stale label is closed.
7+
# Set to false to disable. If disabled, issues still need to be closed manually, but will remain marked as stale.
8+
daysUntilClose: 15
9+
10+
# Issues or Pull Requests with these labels will never be considered stale. Set to `[]` to disable
11+
exemptLabels:
12+
- on hold
13+
- meta
14+
15+
# Set to true to ignore issues in a project (defaults to false)
16+
exemptProjects: false
17+
18+
# Set to true to ignore issues in a milestone (defaults to false)
19+
exemptMilestones: false
20+
21+
# Set to true to ignore issues with an assignee (defaults to false)
22+
exemptAssignees: false
23+
24+
# Label to use when marking as stale
25+
staleLabel: stale
26+
27+
# Comment to post when marking as stale. Set to `false` to disable
28+
markComment: >
29+
Hi all!
30+
31+
This Pull Request has not had any recent activity, is it still relevant? If so, what is blocking it?
32+
Is there anything we can do to help move it forward?
33+
34+
Thanks!
35+
36+
37+
# Comment to post when removing the stale label.
38+
# unmarkComment: >
39+
# Your comment here.
40+
41+
# Comment to post when closing a stale Issue or Pull Request.
42+
closeComment: >
43+
Hi folks!
44+
45+
This Pull Request is being closed as there was no response to the previous prompt.
46+
However, please leave a comment whenever you're ready to resume, so it can be reopened.
47+
48+
Thanks again!
49+
50+
51+
# Limit the number of actions per hour, from 1-30. Default is 30
52+
limitPerRun: 30
53+
54+
# Limit to only `issues` or `pulls`
55+
only: pulls
56+
57+
# Optionally, specify configuration settings that are specific to just 'issues' or 'pulls':
58+
# pulls:
59+
# daysUntilStale: 30
60+
# markComment: >
61+
# This pull request has been automatically marked as stale because it has not had
62+
# recent activity. It will be closed if no further activity occurs. Thank you
63+
# for your contributions.
64+
65+
# issues:
66+
# exemptLabels:
67+
# - confirmed

0 commit comments

Comments
 (0)