Skip to content

Commit 524c94c

Browse files
committed
added sepparate constructor and runtime cfg
1 parent f78527c commit 524c94c

File tree

12 files changed

+2969
-2540
lines changed

12 files changed

+2969
-2540
lines changed

cfg

Lines changed: 5 additions & 0 deletions
Large diffs are not rendered by default.

package-lock.json

Lines changed: 2864 additions & 2501 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@
8686
"reflect-metadata": "^0.1.12",
8787
"solc": "^0.5.8",
8888
"terser": "3.14.1",
89-
"tsoa": "2.1.8",
89+
"tsoa": "2.3.81",
9090
"web3": "1.0.0-beta.37",
9191
"winston": "^2.2.0"
9292
},

src/api/service/controller/ContractController.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,8 @@ import { TYPES } from '../../../inversify/types';
44
import { ContractService } from '../service/ContractService';
55
import { logger } from '../../../Logger';
66
import { RunContractFunctionRequest } from '../request/RunContractFunctionRequest';
7-
import { IWeb3 } from '../../blockchain/IWeb3';
8-
import { Web3Instance } from '../../blockchain/Web3Instance';
97
import { Web3Configuration } from '../../blockchain/Web3Configuration';
108
import { DeployContractRequest } from '../request/DeployContractRequest';
11-
import { TransactionRequest } from '../request/TransactionRequest';
129

1310
@Route('contract')
1411
@provideSingleton(ContractController)
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
import React from 'react';
2+
3+
import Graph from '../Graph/Graph';
4+
5+
import styles from './ControlFlowGraphConstructor.scss';
6+
7+
const ControlFlowGraphConstructor = ({ contractName, contractPath, graphResponse }) => {
8+
return (
9+
<div className={styles['control-flow-graph']}>
10+
<Graph
11+
graphType="cfgconstructor"
12+
graphId={contractName}
13+
contractPath={contractPath}
14+
cfg={graphResponse.cfg}
15+
operations={graphResponse.operations}
16+
/>
17+
</div>
18+
);
19+
}
20+
21+
ControlFlowGraphConstructor.displayName = 'ControlFlowGraphConstructor';
22+
23+
export default ControlFlowGraphConstructor;

src/client/components/ControlFlowGraph/ControlFlowGraph.js renamed to src/client/components/ControlFlowGraphRuntime/ControlFlowGraphRuntime.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,13 @@ import React from 'react';
22

33
import Graph from '../Graph/Graph';
44

5-
import styles from './ControlFlowGraph.scss';
5+
import styles from './ControlFlowGraphRuntime.scss';
66

7-
const ControlFlowGraph = ({ contractName, contractPath, graphResponse }) => {
7+
const ControlFlowGraphRuntime = ({ contractName, contractPath, graphResponse }) => {
88
return (
99
<div className={styles['control-flow-graph']}>
1010
<Graph
11-
graphType="cfg"
11+
graphType="cfgruntime"
1212
graphId={contractName}
1313
contractPath={contractPath}
1414
cfg={graphResponse.cfg}
@@ -18,6 +18,6 @@ const ControlFlowGraph = ({ contractName, contractPath, graphResponse }) => {
1818
);
1919
}
2020

21-
ControlFlowGraph.displayName = 'ControlFlowGraph';
21+
ControlFlowGraphRuntime.displayName = 'ControlFlowGraphRuntime';
2222

23-
export default ControlFlowGraph;
23+
export default ControlFlowGraphRuntime;
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
.control-flow-graph {
2+
position: relative;
3+
4+
&__body {
5+
width: 100%;
6+
}
7+
}

src/client/components/InnerTab/InnerTabPanel/InnerTabPanel.js

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,13 @@ import React from 'react';
22

33
import TransactionDebugger from '../../TransactionDebugger/TransactionDebugger';
44
import Disassembler from '../../Disassembler/Disassembler';
5-
import ControlFlowGraph from '../../ControlFlowGraph/ControlFlowGraph';
5+
import ControlFlowGraphRuntime from '../../ControlFlowGraphRuntime/ControlFlowGraphRuntime';
66
import StorageViewer from '../../StorageViewer/StorageViewer';
77

88
import styles from './InnerTabPanel.scss';
99

1010
import classnames from 'classnames/bind';
11+
import ControlFlowGraphConstructor from '../../ControlFlowGraphConstructor/ControlFlowGraphConstructor';
1112

1213
const cx = classnames.bind(styles);
1314

@@ -31,8 +32,16 @@ const InnerTabPanel = ({ type, active, contractName, contractCode, contractPath,
3132
disassemblerResponse={disassemblerResponse}
3233
/>
3334
}
34-
{type === 'Control Flow Graph' &&
35-
<ControlFlowGraph
35+
{type === 'Control Flow Graph Runtime' &&
36+
<ControlFlowGraphRuntime
37+
contractPath={contractPath}
38+
contractName={contractName}
39+
contractCode={contractCode}
40+
graphResponse={graphResponse}
41+
/>
42+
}
43+
{type === 'Control Flow Graph Constructor' &&
44+
<ControlFlowGraphConstructor
3645
contractPath={contractPath}
3746
contractName={contractName}
3847
contractCode={contractCode}

src/client/components/SideBar/SideBar.js

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ class SideBar extends React.Component {
1010

1111
render() {
1212

13-
const { onTransactionDebuggerClick, onControlFlowGraphClick, onDisassemblerClick, onViewStorageClick } = this.props;
13+
const { onTransactionDebuggerClick, onControlFlowGraphRuntimeClick, onControlFlowGraphConstructorClick, onDisassemblerClick, onViewStorageClick } = this.props;
1414

1515
return (
1616
<div className={styles['side-bar']}>
@@ -20,8 +20,11 @@ class SideBar extends React.Component {
2020
<div className={styles['side-bar__item']} onClick={onDisassemblerClick}>
2121
<span>Disassembler</span>
2222
</div>
23-
<div className={styles['side-bar__item']} onClick={onControlFlowGraphClick}>
24-
<span>Control Flow Graph</span>
23+
<div className={styles['side-bar__item']} onClick={onControlFlowGraphConstructorClick}>
24+
<span>Control Flow Graph Constructor</span>
25+
</div>
26+
<div className={styles['side-bar__item']} onClick={onControlFlowGraphRuntimeClick}>
27+
<span>Control Flow Graph Runtime</span>
2528
</div>
2629
<div className={styles['side-bar__item']} onClick={onViewStorageClick}>
2730
<span>View Storage</span>

0 commit comments

Comments
 (0)