-
Notifications
You must be signed in to change notification settings - Fork 175
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #536 from protofire/develop
Release 4.1.0 - Develop to Master
- Loading branch information
Showing
61 changed files
with
1,963 additions
and
135 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
name: Docker Image CI | ||
|
||
on: | ||
workflow_dispatch: | ||
inputs: | ||
version: | ||
description: 'Solhint version' | ||
required: true | ||
image_name: | ||
description: 'Name of image to be used on docker hub' | ||
required: true | ||
default: 'protodb/protofire-solhint' | ||
jobs: | ||
|
||
build: | ||
|
||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Login to Docker Hub | ||
run: docker login -u ${{ secrets.DOCKER_USERNAME }} -p ${{ secrets.DOCKER_ACCESS_TOKEN }} | ||
|
||
- name: Build Docker image | ||
run: docker build . --file docker/Dockerfile --tag ${{ inputs.image_name }}:${{ inputs.version }} --build-arg VERSION=${{ inputs.version }} | ||
|
||
- name: Push Docker image to Docker Hub | ||
run: docker push ${{ inputs.image_name }}:${{ inputs.version }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,4 +10,6 @@ antlr4.jar | |
/docs/.sass-cache/ | ||
_temp/ | ||
*solhintReport*.* | ||
.env | ||
**/.DS_Store | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
FROM node:20-alpine | ||
LABEL maintainer="[email protected]" | ||
ENV VERSION=4.1.0 | ||
|
||
RUN npm install -g solhint@"$VERSION" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
# Docker Instructions | ||
Thanks to [@kaypee90](https://github.com/kaypee90) for the contribution<br><br> | ||
|
||
1. Get the image. Run:<br> | ||
`docker pull protodb/protofire-solhint:latest` | ||
|
||
2. Check if image is present (protodb/protofire-solhint:latest)<br> | ||
`docker images` | ||
|
||
3. Solhint use:<br> | ||
|
||
- Execute solhint with default config file<br> | ||
`docker run -v ./:/app -w /app -it protodb/protofire-solhint solhint './contracts/*.sol'` | ||
|
||
This command:<br> | ||
- Maps current folder to app/ inside container<br> | ||
- Executes solhint in './contracts/*.sol'<br> | ||
|
||
- Navigate inside container sharing current folder into app/ container folder<br> | ||
`docker run -v ./:/app -w /app -it protodb/protofire-solhint /bin/sh`<br> | ||
|
||
This command:<br> | ||
- Maps current folder to app/ container folder<br> | ||
- Can run solhint inside the container by typing `solhint ./contracts/*.sol`<br> | ||
(use your correct path, type exit to finish)<br> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{ | ||
"rules": { | ||
"avoid-suicide": "error" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
// SPDX-License-Identifier: Apache-2.0 | ||
pragma solidity ^0.8.0; | ||
|
||
import '@openzeppelin/contracts/ownership/Suicide.sol'; | ||
import { feature as suicide} from '@openzeppelin/contracts/ownership/Suicide.sol'; | ||
|
||
uint256 constant suicide = 1; | ||
|
||
enum MyEnum { | ||
suicide, | ||
B | ||
} | ||
|
||
struct OneNiceStruct { | ||
uint256 suicide; | ||
uint256 b; | ||
} | ||
|
||
error Unauthorized(); | ||
|
||
function freeFunction() pure returns (uint256) { | ||
suicide(); | ||
return 1; | ||
} | ||
|
||
contract Generic { | ||
struct AnotherNiceStruct { | ||
uint256 suicide; | ||
uint256 c; | ||
} | ||
|
||
address constant owner = "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48"; | ||
|
||
function seekAndestroy1() external { | ||
suicide(); | ||
} | ||
|
||
function seekAndestroy2() external { | ||
suicide(owner); | ||
} | ||
|
||
function seekAndestroy3() external { | ||
selfdestruct(); | ||
} | ||
|
||
function seekAndestroy4() external { | ||
selfdestruct(owner); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
// SPDX-License-Identifier: Apache-2.0 | ||
pragma solidity ^0.8.0; | ||
|
||
import '@openzeppelin/contracts/ownership/Suicide.sol'; | ||
import { feature as suicide} from '@openzeppelin/contracts/ownership/Suicide.sol'; | ||
|
||
uint256 constant suicide = 1; | ||
|
||
enum MyEnum { | ||
suicide, | ||
B | ||
} | ||
|
||
struct OneNiceStruct { | ||
uint256 suicide; | ||
uint256 b; | ||
} | ||
|
||
error Unauthorized(); | ||
|
||
function freeFunction() pure returns (uint256) { | ||
selfdestruct(); | ||
return 1; | ||
} | ||
|
||
contract Generic { | ||
struct AnotherNiceStruct { | ||
uint256 suicide; | ||
uint256 c; | ||
} | ||
|
||
address constant owner = "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48"; | ||
|
||
function seekAndestroy1() external { | ||
selfdestruct(); | ||
} | ||
|
||
function seekAndestroy2() external { | ||
selfdestruct(owner); | ||
} | ||
|
||
function seekAndestroy3() external { | ||
selfdestruct(); | ||
} | ||
|
||
function seekAndestroy4() external { | ||
selfdestruct(owner); | ||
} | ||
} |
Oops, something went wrong.