Skip to content
This repository has been archived by the owner on Mar 1, 2024. It is now read-only.

mardizzone/pos-944 Snyk integration #440

Open
wants to merge 36 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
265df12
Merge pull request #223 from maticnetwork/develop
atvanguard Apr 13, 2020
e55b2d6
Merge pull request #270 from maticnetwork/develop
atvanguard May 27, 2020
2659701
Merge pull request #275 from maticnetwork/develop
atvanguard May 30, 2020
a1bdb02
remove docker for compiling
temaniarpit27 Jun 1, 2022
1553570
revert changes
temaniarpit27 Jun 1, 2022
7f1148d
Improvement for integration test
cffls Jun 16, 2022
e596c4b
hello
gatsbyz Oct 27, 2022
1ffd184
gana
gatsbyz Oct 27, 2022
854ac98
hooo
gatsbyz Oct 27, 2022
6dc208d
fix
gatsbyz Oct 28, 2022
b385f98
ci use node 16
gatsbyz Oct 31, 2022
8cb8d72
testrpc script upgrade
gatsbyz Oct 31, 2022
5383918
wait for several block confirmations between each deployment
gatsbyz Oct 31, 2022
ba3b59d
fix parameters
gatsbyz Oct 31, 2022
06f10a7
change
gatsbyz Nov 1, 2022
c43f8ab
go
gatsbyz Nov 1, 2022
49e7b55
test
gatsbyz Nov 1, 2022
233f2d2
safemath fix
gatsbyz Nov 1, 2022
a1da472
fix
gatsbyz Nov 1, 2022
50db5e7
add
gatsbyz Nov 1, 2022
fd020cf
dev: add: pos-944 security-ci, readme and sol related files
marcello33 Nov 3, 2022
8e95fa4
dev: add: merge node upgrade branch / add \idea in gitignore
marcello33 Nov 9, 2022
eb61673
dev: add: implement security-ci for snyk
marcello33 Nov 10, 2022
5f7dfe4
Merge branch 'mardizzone/node-upgrade' into mardizzone/pos-944
marcello33 Nov 14, 2022
f6978bd
dev: add: pos-944 ignore licenses vulnerabilities
marcello33 Nov 14, 2022
228ab78
dev: add: pos-944 upgrade dependensies
marcello33 Nov 14, 2022
4146fb1
dev: fix: pos-944 remove duplicate
marcello33 Nov 14, 2022
6cf8644
dev: add: pos-944 solve SAST vulnerabilities / add snyk cache file to…
marcello33 Nov 14, 2022
ce5d012
dev: fix: pos-944 solve syntax issues with reasons and use comment
marcello33 Nov 14, 2022
ecfcf6d
dev: fix: pos-944 upgrade some deps to solve vulnerabilities / open i…
marcello33 Nov 15, 2022
ff3c61a
dev: fix: pos-944 upgrade some deps to solve vulnerabilities
marcello33 Nov 15, 2022
d535e8c
build: rm coverage, slither, fix solhint
ZeroEkkusu Nov 23, 2022
3c70a58
dev: chg: bump truffle version to solve mocha vulnerability
marcello33 Nov 28, 2022
c057c9d
Merge branch 'mardizzone/pos-944' of https://github.com/maticnetwork/…
marcello33 Nov 28, 2022
8f87a32
Merge branch 'main' into mardizzone/pos-944
marcello33 Nov 28, 2022
e55e7e0
build: fix `babel` issue
ZeroEkkusu Nov 29, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,14 @@ jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Setup Node.js environment
uses: actions/setup-node@v2-beta
uses: actions/setup-node@v3
with:
node-version: '10.x'
node-version: '16'
registry-url: 'https://registry.npmjs.org'
- name: Cache npm dependencies
uses: actions/cache@v1
uses: actions/cache@v3
with:
path: ~/.npm
key: ${{ runner.OS }}-npm-cache-${{ hashFiles('**/package-lock.json') }}
Expand Down
30 changes: 30 additions & 0 deletions .github/workflows/security-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Security CI
on: [push, pull_request]

jobs:
snyk:
name: Snyk
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- name: Run Snyk to check for vulnerabilities
uses: snyk/actions/node@master
env:
SNYK_TOKEN: ${{ secrets.SNYK_TOKEN }}
with:
args: --org=${{ secrets.SNYK_ORG }} --severity-threshold=medium --sarif-file-output=snyk.sarif
- name: Upload result to GitHub Code Scanning
uses: github/codeql-action/upload-sarif@v2
with:
sarif_file: snyk.sarif

solhint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Get node.js
uses: actions/setup-node@v1
with:
node-version: "16.x"
- run: npm ci
- run: npx solhint "contracts/**/*.sol"
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,7 @@ test-blockchain/data
coverage/

coverage.json

.idea

.dccache
141 changes: 141 additions & 0 deletions .snyk
Original file line number Diff line number Diff line change
@@ -0,0 +1,141 @@
# Snyk (https://snyk.io) policy file, patches or ignores known vulnerabilities.
version: v1.25.0
# ignores vulnerabilities until expiry date; change duration by modifying expiry date
ignore:
'snyk:lic:npm:ethereumjs:tx:MPL-2.0':
- '*':
reason: 'As open source org, we have no issues with licenses'
created: 2022-11-14T15:15:06.869Z
'snyk:lic:npm:ethereumjs-account:MPL-2.0':
- '*':
reason: 'As open source org, we have no issues with licenses'
created: 2022-11-14T15:23:25.369Z
'snyk:lic:npm:ethereumjs-block:MPL-2.0':
- '*':
reason: 'As open source org, we have no issues with licenses'
created: 2022-11-14T15:15:15.843Z
'snyk:lic:npm:ethereumjs-tx:MPL-2.0':
- '*':
reason: 'As open source org, we have no issues with licenses'
created: 2022-11-14T15:15:16.050Z
'snyk:lic:npm:ethereumjs-util:MPL-2.0':
- '*':
reason: 'As open source org, we have no issues with licenses'
created: 2022-11-14T15:16:10.153Z
'snyk:lic:npm:ethereumjs-vm:MPL-2.0':
- '*':
reason: 'As open source org, we have no issues with licenses'
created: 2022-11-14T15:16:11.002Z
'snyk:lic:npm:merkle-patricia-tree:MPL-2.0':
- '*':
reason: 'As open source org, we have no issues with licenses'
created: 2022-11-14T15:16:48.133Z
'snyk:lic:npm:rlp:MPL-2.0':
- '*':
reason: 'As open source org, we have no issues with licenses'
created: 2022-11-14T15:17:01.101Z
'snyk:lic:npm:web3:LGPL-3.0':
- '*':
reason: 'As open source org, we have no issues with licenses'
created: 2022-11-14T15:18:01.101Z
'snyk:lic:npm:web3-bzz:LGPL-3.0':
- '*':
reason: 'As open source org, we have no issues with licenses'
created: 2022-11-14T15:19:01.101Z
'snyk:lic:npm:web3-core:LGPL-3.0':
- '*':
reason: 'As open source org, we have no issues with licenses'
created: 2022-11-14T15:19:02.520Z
'snyk:lic:npm:web3-core-helpers:LGPL-3.0':
- '*':
reason: 'As open source org, we have no issues with licenses'
created: 2022-11-14T15:19:03.100Z
'snyk:lic:npm:web3-core-method:LGPL-3.0':
- '*':
reason: 'As open source org, we have no issues with licenses'
created: 2022-11-14T15:19:03.585Z
'snyk:lic:npm:web3-core-promievent:LGPL-3.0':
- '*':
reason: 'As open source org, we have no issues with licenses'
created: 2022-11-14T15:19:03.733Z
'snyk:lic:npm:web3-core-requestmanager:LGPL-3.0':
- '*':
reason: 'As open source org, we have no issues with licenses'
created: 2022-11-14T15:20:00.000Z
'snyk:lic:npm:web3-core-subscriptions:LGPL-3.0':
- '*':
reason: 'As open source org, we have no issues with licenses'
created: 2022-11-14T15:20:00.000Z
'snyk:lic:npm:web3-eth:LGPL-3.0':
- '*':
reason: 'As open source org, we have no issues with licenses'
created: 2022-11-14T15:20:01.000Z
'snyk:lic:npm:web3-eth-abi:LGPL-3.0':
- '*':
reason: 'As open source org, we have no issues with licenses'
created: 2022-11-14T15:20:02.000Z
'snyk:lic:npm:web3-eth-accounts:LGPL-3.0':
- '*':
reason: 'As open source org, we have no issues with licenses'
created: 2022-11-14T15:20:03.000Z
'snyk:lic:npm:web3-eth-contract:LGPL-3.0':
- '*':
reason: 'As open source org, we have no issues with licenses'
created: 2022-11-14T15:20:04.000Z
'snyk:lic:npm:web3-eth-ens:LGPL-3.0':
- '*':
reason: 'As open source org, we have no issues with licenses'
created: 2022-11-14T15:20:05.000Z
'snyk:lic:npm:web3-eth-iban:LGPL-3.0':
- '*':
reason: 'As open source org, we have no issues with licenses'
created: 2022-11-14T15:20:06.000Z
'snyk:lic:npm:web3-eth-personal:LGPL-3.0':
- '*':
reason: 'As open source org, we have no issues with licenses'
created: 2022-11-14T15:20:07.000Z
'snyk:lic:npm:web3-net:LGPL-3.0':
- '*':
reason: 'As open source org, we have no issues with licenses'
created: 2022-11-14T15:20:08.000Z
'snyk:lic:npm:web3-providers-http:LGPL-3.0':
- '*':
reason: 'As open source org, we have no issues with licenses'
created: 2022-11-14T15:20:09.000Z
'snyk:lic:npm:web3-providers-ipc:LGPL-3.0':
- '*':
reason: 'As open source org, we have no issues with licenses'
created: 2022-11-14T15:20:10.000Z
'snyk:lic:npm:web3-providers-ws:LGPL-3.0':
- '*':
reason: 'As open source org, we have no issues with licenses'
created: 2022-11-14T15:20:11.000Z
'snyk:lic:npm:web3-shh:LGPL-3.0':
- '*':
reason: 'As open source org, we have no issues with licenses'
created: 2022-11-14T15:20:12.000Z
'snyk:lic:npm:web3-utils:LGPL-3.0':
- '*':
reason: 'As open source org, we have no issues with licenses'
created: 2022-11-14T15:20:13.000Z
'SNYK-JS-OPENZEPPELINSOLIDITY-2965800':
- '*':
reason: 'No upgrade or patch available. See https://security.snyk.io/vuln/SNYK-JS-OPENZEPPELINSOLIDITY-2965800'
created: 2022-11-15T09:14:00.000Z
'SNYK-JS-GOT-2932019':
- '*':
reason: 'Waiting for issue to be fixed. See https://github.com/trufflesuite/truffle/issues/5704'
created: 2022-11-15T09:16:00.000Z
'SNYK-JS-WEB3-174533':
- '*':
reason: 'Waiting for issue to be fixed. See https://github.com/trufflesuite/truffle/issues/5704'
created: 2022-11-15T09:16:30.000Z
'SNYK-JS-WS-1296835':
- '*':
reason: 'Waiting for issue to be fixed. See https://github.com/trufflesuite/truffle/issues/5704'
created: 2022-11-15T09:17:00.000Z
patch: {}
exclude:
global: # foollowing are used for tests, therefore private keys are mocked
- scripts/*.js
- moonwalker-migrations/*.js
2 changes: 2 additions & 0 deletions .solcover.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
module.exports = {
configureYulOptimizer: true,
skipFiles: ["mocks", "test"],
mocha: {
grep: "@skip-on-coverage", // Find everything with this tag
invert: true // Run the grep's inverse set.
Expand Down
12 changes: 12 additions & 0 deletions .solhint.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"extends": "solhint:recommended",
"plugins": [],
"rules": {
"code-complexity": ["error", 13],
"compiler-version": ["error", "^0.5.0"],
"func-visibility": ["error", { "ignoreConstructors": true }],
"max-line-length": ["warn", 120],
"not-rely-on-time": "off",
"reason-string": ["warn", { "maxLength": 64 }]
}
}
3 changes: 3 additions & 0 deletions .solhintignore.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# directories
**/lib
**/node_modules
14 changes: 14 additions & 0 deletions SECURITY.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Polygon Technology Security Information

## Link to vulnerability disclosure details (Bug Bounty)
- Websites and Applications: https://hackerone.com/polygon-technology
- Smart Contracts: https://immunefi.com/bounty/polygon

## Languages that our team speaks and understands.
Preferred-Languages: en

## Security-related job openings at Polygon.
https://polygon.technology/careers

## Polygon security contact details
[email protected]
69 changes: 3 additions & 66 deletions contracts/common/gnosis/GnosisSafe.sol
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@

pragma solidity >=0.5.0 <0.7.0;


import {SafeMath} from "openzeppelin-solidity/contracts/math/SafeMath.sol";

/// @title SelfAuthorized - authorizes current contract to perform actions
/// @author Richard Meissner - <[email protected]>
contract SelfAuthorized {
Expand Down Expand Up @@ -606,72 +609,6 @@ contract ISignatureValidator is ISignatureValidatorConstants {
returns (bytes4);
}


/**
* @title SafeMath
* @dev Math operations with safety checks that revert on error
* TODO: remove once open zeppelin update to solc 0.5.0
*/
library SafeMath {

/**
* @dev Multiplies two numbers, reverts on overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
// Gas optimization: this is cheaper than requiring 'a' not being zero, but the
// benefit is lost if 'b' is also tested.
// See: https://github.com/OpenZeppelin/openzeppelin-solidity/pull/522
if (a == 0) {
return 0;
}

uint256 c = a * b;
require(c / a == b);

return c;
}

/**
* @dev Integer division of two numbers truncating the quotient, reverts on division by zero.
*/
function div(uint256 a, uint256 b) internal pure returns (uint256) {
require(b > 0); // Solidity only automatically asserts when dividing by 0
uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold

return c;
}

/**
* @dev Subtracts two numbers, reverts on overflow (i.e. if subtrahend is greater than minuend).
*/
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
require(b <= a);
uint256 c = a - b;

return c;
}

/**
* @dev Adds two numbers, reverts on overflow.
*/
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a);

return c;
}

/**
* @dev Divides two numbers and returns the remainder (unsigned integer modulo),
* reverts when dividing by zero.
*/
function mod(uint256 a, uint256 b) internal pure returns (uint256) {
require(b != 0);
return a % b;
}
}

/// @title Gnosis Safe - A multisignature wallet with support for confirmations using signed messages based on ERC191.
/// @author Stefan George - <[email protected]>
/// @author Richard Meissner - <[email protected]>
Expand Down
Loading