Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
O
openzeppelin-contracts-upgradeable
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
俞永鹏
openzeppelin-contracts-upgradeable
Commits
b3b83b55
Unverified
Commit
b3b83b55
authored
Jan 20, 2022
by
JulissaDantes
Committed by
GitHub
Jan 21, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add Slither reentrancy check in CI (#3047)
Co-authored-by: Francisco Giordano <frangio.1@gmail.com>
parent
783ac759
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
34 additions
and
1 deletions
+34
-1
test.yml
.github/workflows/test.yml
+23
-0
TimelockController.sol
contracts/governance/TimelockController.sol
+3
-0
GovernorTimelockControl.sol
contracts/governance/extensions/GovernorTimelockControl.sol
+3
-0
ERC20FlashMint.sol
contracts/token/ERC20/extensions/ERC20FlashMint.sol
+3
-0
package.json
package.json
+2
-1
No files found.
.github/workflows/test.yml
View file @
b3b83b55
...
@@ -54,3 +54,26 @@ jobs:
...
@@ -54,3 +54,26 @@ jobs:
env
:
env
:
NODE_OPTIONS
:
--max_old_space_size=4096
NODE_OPTIONS
:
--max_old_space_size=4096
-
uses
:
codecov/codecov-action@v2
-
uses
:
codecov/codecov-action@v2
slither
:
runs-on
:
ubuntu-latest
steps
:
-
uses
:
actions/checkout@v2
-
uses
:
actions/setup-node@v2
with
:
node-version
:
12.x
-
uses
:
actions/cache@v2
id
:
cache
with
:
path
:
'
**/node_modules'
key
:
npm-v2-${{ hashFiles('**/package-lock.json') }}
restore-keys
:
npm-v2-
-
run
:
npm ci
if
:
steps.cache.outputs.cache-hit != 'true'
-
name
:
Set up Python
uses
:
actions/setup-python@v2
-
name
:
Install dependencies
run
:
pip3 install slither-analyzer
-
name
:
Summary of static analysis
run
:
npm run slither
contracts/governance/TimelockController.sol
View file @
b3b83b55
...
@@ -261,6 +261,9 @@ contract TimelockController is AccessControl {
...
@@ -261,6 +261,9 @@ contract TimelockController is AccessControl {
*
*
* - the caller must have the 'executor' role.
* - the caller must have the 'executor' role.
*/
*/
// This function can reenter, but it doesn't pose a risk because _afterCall checks that the proposal is pending,
// thus any modifications to the operation during reentrancy should be caught.
// slither-disable-next-line reentrancy-eth
function execute(
function execute(
address target,
address target,
uint256 value,
uint256 value,
...
...
contracts/governance/extensions/GovernorTimelockControl.sol
View file @
b3b83b55
...
@@ -122,6 +122,9 @@ abstract contract GovernorTimelockControl is IGovernorTimelock, Governor {
...
@@ -122,6 +122,9 @@ abstract contract GovernorTimelockControl is IGovernorTimelock, Governor {
* @dev Overriden version of the {Governor-_cancel} function to cancel the timelocked proposal if it as already
* @dev Overriden version of the {Governor-_cancel} function to cancel the timelocked proposal if it as already
* been queued.
* been queued.
*/
*/
// This function can reenter through the external call to the timelock, but we assume the timelock is trusted and
// well behaved (according to TimelockController) and this will not happen.
// slither-disable-next-line reentrancy-no-eth
function _cancel(
function _cancel(
address[] memory targets,
address[] memory targets,
uint256[] memory values,
uint256[] memory values,
...
...
contracts/token/ERC20/extensions/ERC20FlashMint.sol
View file @
b3b83b55
...
@@ -56,6 +56,9 @@ abstract contract ERC20FlashMint is ERC20, IERC3156FlashLender {
...
@@ -56,6 +56,9 @@ abstract contract ERC20FlashMint is ERC20, IERC3156FlashLender {
* @param data An arbitrary datafield that is passed to the receiver.
* @param data An arbitrary datafield that is passed to the receiver.
* @return `true` is the flash loan was successful.
* @return `true` is the flash loan was successful.
*/
*/
// This function can reenter, but it doesn't pose a risk because it always preserves the property that the amount
// minted at the beginning is always recovered and burned at the end, or else the entire function will revert.
// slither-disable-next-line reentrancy-no-eth
function flashLoan(
function flashLoan(
IERC3156FlashBorrower receiver,
IERC3156FlashBorrower receiver,
address token,
address token,
...
...
package.json
View file @
b3b83b55
...
@@ -29,7 +29,8 @@
...
@@ -29,7 +29,8 @@
"version"
:
"scripts/release/version.sh"
,
"version"
:
"scripts/release/version.sh"
,
"test"
:
"hardhat test"
,
"test"
:
"hardhat test"
,
"test:inheritance"
:
"node scripts/inheritanceOrdering artifacts/build-info/*"
,
"test:inheritance"
:
"node scripts/inheritanceOrdering artifacts/build-info/*"
,
"gas-report"
:
"env ENABLE_GAS_REPORT=true npm run test"
"gas-report"
:
"env ENABLE_GAS_REPORT=true npm run test"
,
"slither"
:
"npm run clean && slither . --detect reentrancy-eth,reentrancy-no-eth,reentrancy-unlimited-gas"
},
},
"repository"
:
{
"repository"
:
{
"type"
:
"git"
,
"type"
:
"git"
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment