Skip to content

Contracts

UrsZeidler edited this page Sep 24, 2016 · 12 revisions

Contracts

The basic profile for solidity dapps.

Library

Defines class as a library.

extends ===> :Class

Contract

A class tagged with this stereotype will be generated as a contract.

extends ===> :Class

name type doc
ConstructorCode String Code for the contructor. The Constructor is deprecated, use a simple Function with the Class name.
ConstructorArgs String The arguments of the constructor.
defaultFunction Boolean True generates a default function

Struct

A class tagged with this stereotype will be generated as a struct. So normally it is models as an inner class.

extends ===> :Class

Function

An operation will be rendered as function with the functionCode value as code.

extends ===> :Operation

name type doc
functionCode String you could add the code also here
returnType FunctionType the return type of the function
modifier Constraint Applies the constrain an a modifier to the method.

Constructor

A constructor is just like a function, with the exception that it will not be used by the js code generator and therefore no js method and gui code is generated.

Delegate

Let the generator produce delegate operations defined in the type of the property.

extends ===> :Property

Event

An operation tagged as Event will define an Event in the Contract.

extends ===> :Operation

Mapping

Defines the mapping type. The value is defined by the 'value' property.

extends ===> :Property

name type doc
value Classifier Define the value of the mapping.

KeyMapping

Defines the mapping type. The key is defined by the 'key' property.

extends ===> :Property

name type doc
key Classifier Define the key of the mapping.

GetterSetter

Creates a getter and/or setter for an tagged property.

extends ===> :Property

name type doc
getter Boolean Set to true will generate a getter method.
setter Boolean Set to true generates a setter method for the property.

StandardizedContractAPI

An interface tagged by this stereotype define an SCA. A contract implementing such an interface will take only the defines methods and not explicitly inherited this interface.

extends ===> :Interface

Const

Defines a property of a contract as a constant, it is used for properties with a default value.

extends ===> :Property

Import

Defines an import for this model. It links the package to import.

extends ===> :Import

name type doc
importFilter String A filter for the imports.
Clone this wiki locally