Skip to content

Commit

Permalink
Merge pull request #5 from malik672/dev_cache_var
Browse files Browse the repository at this point in the history
Dev cache var
  • Loading branch information
malik672 authored Nov 24, 2023
2 parents 30a5baa + c553c1b commit 9475837
Show file tree
Hide file tree
Showing 32 changed files with 900 additions and 639 deletions.
78 changes: 78 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
name: CI

on:
push:
branches:
- main
pull_request:
workflow_dispatch:

permissions:
contents: read

env:
RUSTFLAGS: -Dwarnings

jobs:
cargo-tests:
runs-on: ubuntu-latest
timeout-minutes: 20
steps:
- uses: actions/checkout@v4
- uses: actions-rs/toolchain@v1
with:
toolchain: nightly
profile: minimal
override: true
- uses: Swatinem/rust-cache@v1
- run: cargo test --all
- run: cargo test --all --all-features

cargo-lint:
runs-on: ubuntu-latest
timeout-minutes: 20
steps:
- uses: actions/checkout@v4
- uses: actions-rs/toolchain@v1
with:
toolchain: nightly
profile: minimal
components: rustfmt, clippy
override: true
- uses: Swatinem/rust-cache@v1
- run: cargo +nightly fmt --all -- --check
- run: cargo +nightly clippy --all --all-features -- -D warnings

cargo-build:
runs-on: ubuntu-latest
timeout-minutes: 20
continue-on-error: true
steps:
- uses: actions/checkout@v4
- uses: actions-rs/toolchain@v1
with:
toolchain: nightly
profile: minimal
override: true
- uses: Swatinem/rust-cache@v1
- continue-on-error: true
run: cargo build --all
id: build

cargo-doc:
runs-on: ubuntu-latest
timeout-minutes: 20
continue-on-error: true
steps:
- uses: actions/checkout@v4
- uses: actions-rs/toolchain@v1
with:
toolchain: nightly
profile: minimal
override: true
- uses: Swatinem/rust-cache@v1
- name: doclints
continue-on-error: true
run: RUSTDOCFLAGS="-D warnings" cargo doc --all --no-deps --all-features --document-private-items
id: build
- run: cargo test --doc --all --all-features
22 changes: 0 additions & 22 deletions .github/workflows/rust.yml

This file was deleted.

181 changes: 97 additions & 84 deletions artifacts/contract.sol/Counter1.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,13 @@
}
],
"bytecode": {
"object": "0x608060405234801561001057600080fd5b5061017e806100206000396000f3fe608060405234801561001057600080fd5b50600436106100365760003560e01c80638381f58a1461003b578063d09de08a14610059575b600080fd5b610043610063565b60405161005091906100a8565b60405180910390f35b610061610069565b005b60005481565b600a6000541061007857600080fd5b600160005461008791906100f2565b600081905550565b6000819050919050565b6100a28161008f565b82525050565b60006020820190506100bd6000830184610099565b92915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b60006100fd8261008f565b91506101088361008f565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0382111561013d5761013c6100c3565b5b82820190509291505056fea2646970667358221220ad4f8bcd003a65ca54686b6174a57128aa9ce6e487bc3378c35935a5930a7e9664736f6c634300080c0033",
"sourceMap": "57:202:0:-:0;;;;;;;;;;;;;;;;;;;",
"object": "0x608060405234801561001057600080fd5b5060e38061001f6000396000f3fe6080604052348015600f57600080fd5b506004361060325760003560e01c80638381f58a146037578063d09de08a146051575b600080fd5b603d6059565b604051604891906094565b60405180910390f35b6057605f565b005b60005481565b600054600a11606d57600080fd5b600054601411607b57600080fd5b565b6000819050919050565b608e81607d565b82525050565b600060208201905060a760008301846087565b9291505056fea26469706673582212208fda61b21f32332065be61c9b6c9d133e91372becc160b991b3c640ba2a966a464736f6c634300080c0033",
"sourceMap": "57:203:0:-:0;;;;;;;;;;;;;;;;;;;",
"linkReferences": {}
},
"deployedBytecode": {
"object": "0x608060405234801561001057600080fd5b50600436106100365760003560e01c80638381f58a1461003b578063d09de08a14610059575b600080fd5b610043610063565b60405161005091906100a8565b60405180910390f35b610061610069565b005b60005481565b600a6000541061007857600080fd5b600160005461008791906100f2565b600081905550565b6000819050919050565b6100a28161008f565b82525050565b60006020820190506100bd6000830184610099565b92915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b60006100fd8261008f565b91506101088361008f565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0382111561013d5761013c6100c3565b5b82820190509291505056fea2646970667358221220ad4f8bcd003a65ca54686b6174a57128aa9ce6e487bc3378c35935a5930a7e9664736f6c634300080c0033",
"sourceMap": "57:202:0:-:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;81:21;;;:::i;:::-;;;;;;;:::i;:::-;;;;;;;;163:94;;;:::i;:::-;;81:21;;;;:::o;163:94::-;218:2;209:6;;:11;201:20;;;;;;249:1;240:6;;:10;;;;:::i;:::-;231:6;:19;;;;163:94::o;7:77:1:-;44:7;73:5;62:16;;7:77;;;:::o;90:118::-;177:24;195:5;177:24;:::i;:::-;172:3;165:37;90:118;;:::o;214:222::-;307:4;345:2;334:9;330:18;322:26;;358:71;426:1;415:9;411:17;402:6;358:71;:::i;:::-;214:222;;;;:::o;442:180::-;490:77;487:1;480:88;587:4;584:1;577:15;611:4;608:1;601:15;628:305;668:3;687:20;705:1;687:20;:::i;:::-;682:25;;721:20;739:1;721:20;:::i;:::-;716:25;;875:1;807:66;803:74;800:1;797:81;794:107;;;881:18;;:::i;:::-;794:107;925:1;922;918:9;911:16;;628:305;;;;:::o",
"object": "0x6080604052348015600f57600080fd5b506004361060325760003560e01c80638381f58a146037578063d09de08a146051575b600080fd5b603d6059565b604051604891906094565b60405180910390f35b6057605f565b005b60005481565b600054600a11606d57600080fd5b600054601411607b57600080fd5b565b6000819050919050565b608e81607d565b82525050565b600060208201905060a760008301846087565b9291505056fea26469706673582212208fda61b21f32332065be61c9b6c9d133e91372becc160b991b3c640ba2a966a464736f6c634300080c0033",
"sourceMap": "57:203:0:-:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;81:21;;;:::i;:::-;;;;;;;:::i;:::-;;;;;;;;163:95;;;:::i;:::-;;81:21;;;;:::o;163:95::-;214:6;;209:2;:11;201:20;;;;;;244:6;;239:2;:11;231:20;;;;;;163:95::o;7:77:1:-;44:7;73:5;62:16;;7:77;;;:::o;90:118::-;177:24;195:5;177:24;:::i;:::-;172:3;165:37;90:118;;:::o;214:222::-;307:4;345:2;334:9;330:18;322:26;;358:71;426:1;415:9;411:17;402:6;358:71;:::i;:::-;214:222;;;;:::o",
"linkReferences": {}
},
"methodIdentifiers": {
Expand All @@ -44,7 +44,7 @@
]
},
"nodeType": "SourceUnit",
"src": "32:229:0",
"src": "32:230:0",
"nodes": [
{
"id": 1,
Expand All @@ -60,7 +60,7 @@
{
"id": 24,
"nodeType": "ContractDefinition",
"src": "57:202:0",
"src": "57:203:0",
"nodes": [
{
"id": 3,
Expand Down Expand Up @@ -150,12 +150,12 @@
{
"id": 23,
"nodeType": "FunctionDefinition",
"src": "163:94:0",
"src": "163:95:0",
"nodes": [],
"body": {
"id": 22,
"nodeType": "Block",
"src": "191:66:0",
"src": "191:67:0",
"nodes": [],
"statements": [
{
Expand All @@ -172,35 +172,35 @@
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"id": 11,
"name": "number",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 3,
"src": "209:6:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": "<",
"rightExpression": {
"hexValue": "3130",
"id": 12,
"id": 11,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "218:2:0",
"src": "209:2:0",
"typeDescriptions": {
"typeIdentifier": "t_rational_10_by_1",
"typeString": "int_const 10"
},
"value": "10"
},
"nodeType": "BinaryOperation",
"operator": ">",
"rightExpression": {
"id": 12,
"name": "number",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 3,
"src": "214:6:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"src": "209:11:0",
"typeDescriptions": {
"typeIdentifier": "t_bool",
Expand Down Expand Up @@ -250,80 +250,93 @@
},
{
"expression": {
"id": 20,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"id": 16,
"name": "number",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 3,
"src": "231:6:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "Assignment",
"operator": "=",
"rightHandSide": {
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 19,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"id": 17,
"name": "number",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 3,
"src": "240:6:0",
"typeDescriptions": {
"arguments": [
{
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": "+",
"rightExpression": {
"hexValue": "31",
"id": 18,
},
"id": 19,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"isPure": false,
"lValueRequested": false,
"nodeType": "Literal",
"src": "249:1:0",
"typeDescriptions": {
"typeIdentifier": "t_rational_1_by_1",
"typeString": "int_const 1"
"leftExpression": {
"hexValue": "3230",
"id": 17,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "239:2:0",
"typeDescriptions": {
"typeIdentifier": "t_rational_20_by_1",
"typeString": "int_const 20"
},
"value": "20"
},
"value": "1"
},
"src": "240:10:0",
"nodeType": "BinaryOperation",
"operator": ">",
"rightExpression": {
"id": 18,
"name": "number",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 3,
"src": "244:6:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"src": "239:11:0",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_bool",
"typeString": "bool"
}
],
"id": 16,
"name": "require",
"nodeType": "Identifier",
"overloadedDeclarations": [
-18,
-18
],
"referencedDeclaration": -18,
"src": "231:7:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
"typeIdentifier": "t_function_require_pure$_t_bool_$returns$__$",
"typeString": "function (bool) pure"
}
},
"src": "231:19:0",
"id": 20,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "231:20:0",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 21,
"nodeType": "ExpressionStatement",
"src": "231:19:0"
"src": "231:20:0"
}
]
},
Expand Down
4 changes: 2 additions & 2 deletions cache/solidity-files-cache.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
},
"files": {
"src/contract.sol": {
"lastModificationDate": 1700311238224,
"contentHash": "28ea6601f023bdb343631464f98166b1",
"lastModificationDate": 1700762187306,
"contentHash": "4cfab11a6c48fe1603a2ee6922e55b0a",
"sourceName": "src/contract.sol",
"solcConfig": {
"settings": {
Expand Down
2 changes: 1 addition & 1 deletion src/config.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// config.rs
use clap::{App, Arg};

pub fn parse_args() -> (String, Option<String>) {
pub fn _parse_args() -> (String, Option<String>) {
let matches = App::new("Solidity Contract Analyzer")
.version("1.0")
.author("Malik")
Expand Down
4 changes: 2 additions & 2 deletions src/contract.sol
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ contract Counter1 {
bool private localize;

function increment() public {
require(number < 10);
number = number + 1;
require(10 > number);
require(20 > number);
}
}

Loading

0 comments on commit 9475837

Please sign in to comment.