Dero Virtual Machine Light Version A standalone version of the Stargate Testnet DVM, working in a offline mode.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
b9ron 920d8fc687 version v0.0.4 2 months ago
stargate version v0.0.4 2 months ago
.gitignore initial commit 2 months ago
LICENSE initial commit 2 months ago
README.md version v0.0.4 2 months ago
dvml.go version v0.0.4 2 months ago

README.md

DERO Virtual Machine Light

ABOUT DVM Light

DVM Light is a standalone version of Dero Stargate Testnet Virtual Machine designed for accelerate the development of Smart Contract on the DERO Network in an offline environement. ( See more: https://git.dero.io/DeroProject/dvm_doc )

Installation From Source

  1. Install Golang, minimum Golang 1.10.3 required.
  2. In the go workspace: git clone https://git.dero.io/b9ron/dvml
  3. Add some dvm-basic file in the dvml folder.
  4. Run the command go get -u (it can take a while)
  5. Finally run or compile with: go run dvml.go or go build

Usage

Linux:

$(go env GOPATH)/src/dvml$ ./dvml file

Windows:

%GOPATH%\\go\\src\\dvml>dvml.exe file

Requirment

  1. Each dvm-basic file need a mandatory function Initialize() Uint64 that return a Uint64 0 .
  2. Only public function will be executed (the first letter must be an Upper Case)
  3. Before using LOAD(data) instruction, data need to be initialized in Initialize() function with STORE(data,value) instruction.

String value

10 STORE(name, "Alice")

Uint64 value

10 STORE(balance, 0)

Minimalistic Initialize function

Function Initialize() Uint64
20 RETURN 0
End Function

Examples for lottery.bas

For the signature: Function TuneLotteryParameters(input Uint64, lotteryeveryXdeposit Uint64, lotterygiveback Uint64) Uint64

(dvml) run TuneLotteryParameters 10000 5 8800

For the signature: Function TransferOwnership(newowner String) Uint64

(dvml) run TransferOwnership dEToNFYEXufYzcs64qnfocZ48nvmbxbKR1x2MZBqbrHn5dULSfRRdN3d4EsbwKLGeHE5k3Vrh77BWFufe2gBcrDF57PqDCaJoc

Changelog

0.0.4:

  • You can use the instruction SEND_DERO_TO_ADDRESS in smart contract without crashing the DVML, but you need to send some DEROs to the smart contract using a function with an a argument named value and an amount in uint64.

0.0.3:

  • help display Help and Usage information.
  • account display 10 generated accounts (0 to 9), with the command account 9 you can select the account number 9. (usefuf for the DVM SIGNER() instruction.)
  • signer or whoami display the current address of the SIGNER().
  • storage show the data stored with the DVM STORE() instruction.

** KNOWN BUG : SEND_DERO_TO_ADDRESS doesn’t work yet! **

0.0.2:

  • You can execute multiple functions without losing the context with the command run.
  • You can list the fonctions inside the SC with their arguments using the command list.
  • A prompt has been added ( press q or quit for exit.)

0.0.1:

  • Only one function at the time
  • Initial release

Donations

DERO:

dERoNFYEXufYzcs64qnfocZ48nvmbxbKR1x2MZBqbrHn5dULSfRRdN3d4EsbwKLGeHE5k3Vrh77BWFufe2gBcrDF57PqDCaJoc