Skip to content

Latest commit

 

History

History

rubysol-by-example

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Rubysol By Example

an introduction to Rubysol with simple examples (inspired and mostly following Solidity By Example)

NOTE: While Rubysol has / uses 100%-compatible Solidity data types and (application binary interfaces) abis and method sig(natures) and call data - Rubysol syntax (and semantics) sometimes differs following the Ruby philosophy of programmer productivity and fun. "Less is more" highlights include:

No internal/private/public "trilogy" for state (storage) variables. Only internal and public AND "auto-magically" depending on naming convention. Internals MUST start with underscore (_) otherwise state (storage) variables are public.

No internal/private/public/external "tetralogy or quadrology" for functions. Only internal and public AND "auto-magically" depending on naming convention.

No multiple "diamond-shaped whatever-algo¹ linearized" inheritance. Only linear single inheritance.
Use module includes for adding (reusing/shared) functions.

Note 1
    A
   / \
  B   C
 / \ /
F  D,E

When a function is called that is defined multiple times in different contracts, parent contracts are searched from right to left, and in depth-first manner.

No modifiers. Use functions or if clauses.

No immutable state (storage) variables. [Maybe add back a "freeze" option later?]

No constant state (storage) variables. Use "plain" constants.

To be continued... the idea or the theme is "less is more" or better security by making "obfuscated" code harder and so on.

Basics

Applications

Questions? Comments?

Join us in the Rubidity & Rubysol (community) discord (chat server). Yes you can. Your questions and commetary welcome.

Or post them over at the Help & Support page. Thanks.