-
Notifications
You must be signed in to change notification settings - Fork 14
BasicUsage
A brief overview how to develop smart contracts with eclipse, uml and mix together.
(Here is work in progress.)
You need eclipse and the papyrus software the best starting points are the modeling.
- http://www.eclipse.org/downloads/packages/eclipse-modeling-tools/neon
- smart-contract tools
- The JavaScript Development Tools SDK (1.6.201.v201512010225) this is the version I found is working well
- mix and the solidity compiler
See install for more details.
In eclipse the files are stored in the workspace and organized as projects. When you use js as frontend code it is good to convert the project to a java script project. If you want to use the project setup described in junit testing with java for junit testing follow this instruction, you can always add the java script nature later on.
The preferences are used for meaningful defaults. There are used to populate a launch configuration when it gets created. The properties have a global and a project scope. See the preferences section in the wiki.
Add the solidity compiler in the compiler preferences if you like.

Create a simple uml model, add the registered profile.
| create a papyrus project | name the project |
|---|---|
![]() |
![]() |
| select the uml model as diagram language | name the model and create a class diagramm |
|---|---|
![]() |
![]() |
| create a model from the template |
|---|
![]() |
Or :
| apply the solidity profile to the model | finish the wizard |
|---|---|
![]() |
![]() |
To create a properly configured project use the template.
| create a model from the template |
|---|
![]() |
Adding model elements is defined in http://wiki.eclipse.org/Papyrus_User_Guide and ...
To add a stereotype select the element and ...
The stereotype properties are available at the profile tab of the properties view, there all applied stereotypes are listed together with their properties.
The property view is your best friend also the also the model explorer comes handy, both are displayed in the papyus perspective.
The papyrus editor is straight forward you add new elements by selecting it in the tool section.
To add a contract you need to add a class and apply the Contract Stereotype.
Add Fields and assign a type.
Contract functions are modeled by operations with the stereotype GFunction applied.
Events are modeled also a operations, but it has the Event stereotype applied.
Modifiers are modeled as constrains, when the modifier has input parameters you need to apply the modifier stereotype, to link the modifier to a function you can add a modifier datatype to the function stereotype, this is a bit crude, and linking the modifier to the function and set the parameters.
It is also possible to link the operation to the constrain, when the modifier has no parameters.
There is a constrain 'payable' in the Types model, so you don't need to create it for your self.






