Published 11 January 2019

Saving and reading smart contract data in the Credits blockchain

Introduction

Introduction

Smart contract variables can only be read and written by the smart contract of the owner of these variables. All types of variables used in Java are supported. The user can also create his own type of variables.

Notes on the volume of the variable. The limitation on the platform is imposed by waiting timeout. That is, if the variable contains a large amount, assume that it is a list with N number of elements, and it is not possible to get this list during a given period of time, then a runtime error will be generated. The same applies to writing to the blockchain. The restriction on timeout is imposed everywhere.

Visibility scope

Visibility scope

Only smart contract methods that are public can be executed. Variables can't be used directly, regardless of their scope.

Writing from a smart contract in the blockchain

Writing from a smart contract in the blockchain

Writing data to the blockchain as variables is possible in the builder or in the custom smart contract method. Moreover, initialization of the variable in the builder occurs at the time of the smart contract publication.

Reading from a smart contract from the blockchain

Reading from a smart contract from the blockchain

Reading data from the blockchain in the form of variables is possible in the user methods of the smart contract.

Votes 0, average rating 0

Contents