Experiments for Declarative smart contracts

This repository contains the experiment scripts for experiments in FSE'22 paper Declarative smart contracts.

Compile DSC programs into Solidity.

We have placed the generated Solidity programs in dsc/contracts and dsc-instruments/contracts.

You could skip this step and rerun the evaluation experiments, or regenerate the Solidity programs yourself. To generate Solidity programs, please refer to the DSC repository for instructions, and copy the generated programs into dsc/contracts(programs without instrumentation) and dsc-instruments/contracts (with-instrumentation).

Install dependencies

  1. Install npm: please follow instructions here to install npm for your operating system.
  2. Install Ganache: npm install -g ganache
  3. Install Truffle: npm install -g truffle

Reproduce experiment results in the paper

The contracts used for gas measurements, and the instructions are in separate sub directories.

Reproduce experiment results using Docker

Download Dokcer form here

  1. Pull the docker image: docker pull hxchen/fse22-eval
  2. Reference contracts in Solidity: docker run -w /home/node/smart-contracts/solidity hxchen/fse22-eval sh test.sh
  3. Contracts generated by DSC: docker run -w /home/node/smart-contracts/dsc hxchen/fse22-eval sh test.sh
  4. Contracts generated by DSC, with instrumentation for run-time verification: docker run -w /home/node/smart-contracts/dsc-instruments hxchen/fse22-eval sh test.sh