Creating & Editing source code through Micro view (AD)
TD

TJ Dunham

Created Dec 13, 2022

Creating & Editing source code through Micro view (AD)

This process highlights the change of the source code itself, through edits to the Activity diagram. This is done using pre-installed libraries that allows users to change and edit the original source code.

I will be changing 'SwapExactTokensSupportingFeeOnTransfertokens' in the 'UniswapV2Router02.sol' contract. Notice the change in the diagram itself, as well as the new types of data structures, arguments, and operators used. In the end, the new source code is generated without breaking any dependencies. The whole process taking less than 30 seconds.

Follow along to see how you can apply towards the smart contracts you upload!

142
    a

Arc-reactor

16 Steps
1

Select desired contract file using the contract pane

Select desired contract file using the contract pane
2

Select a function within one of the contracts

Select a function within one of the contracts
3

The function will be populated along with a diagram showing the flow of logic

This is the 'SwapExactTokensSupportingFeeOnTransfertokens ' function or data structure mapped

The function will be populated along with a diagram showing the flow of logic
4

Open the 'Activity Diagram' editor bar by moving inside the window, or selecting the arrows

Open the 'Activity Diagram' editor bar by moving inside the window, or selecting the arrows
5

Select desired 'logic bubble' and notice source code populating along right-hand side

This step highlights how each step of a process within any smart contract is broken down by the reactor. Each 'logic bubble' or white box features a unique data structure with a specific purpose. All of the data for it is populated along the right-hand side as well as the ability to edit.

Select desired 'logic bubble' and notice source code populating along right-hand side
6

Select the arrow under arguments to expand some of your editing options

Select the arrow under arguments to expand some of your editing options
7

Notice arguments have now populated along with sub-folders, click on one of them. In this case ,'MemberAccess'

Notice arguments have now populated along with sub-folders, click on one of them. In this case ,'MemberAccess'
8

Click on FunctionCall

Click on FunctionCall
9

To edit, select the widget with the desired 'type' (MemberAccess)

To edit, select the widget with the desired 'type' (MemberAccess)
10

Change to a different type, in this case,' UnaryOperation'

Change to a different type, in this case,' UnaryOperation'
11

Fill out the field below 'Unaryoperation' with desired operator, in this case, '++'

Fill out the field below 'Unaryoperation' with desired operator, in this case, '++'
12

Select the subexpression, 'BooleanLiteral'

Select the subexpression, 'BooleanLiteral'
13

Change the subexpression to 'NumberLiteral' by selecting in drop-down menu

Change the subexpression to 'NumberLiteral' by selecting in drop-down menu
14

Fill out 'number' and 'subdenomination' using the type field, and drop-down menu respectively

Fill out 'number' and 'subdenomination' using the type field, and drop-down menu respectively
15

Click the checkmark at the bottom to generate new source code

Click the checkmark at the bottom to generate new source code
16

Notice the diagram has changed, reflecting newly generated source code

Notice the diagram has changed, reflecting newly generated source code
Well done!
Create how-to guides like this in a snap. Get Tango now.