All Projects → Soltsice → Soltsice

Soltsice / Soltsice

Licence: mit
Solidity & TypeScript Integration, Configuration and Examples

Programming Languages

typescript
32286 projects
solidity
1140 projects

Projects that are alternatives of or similar to Soltsice

Dapp
TypeScript React Redux Ethereum IPFS Starter Kit
Stars: ✭ 33 (-64.89%)
Mutual labels:  ethereum, truffle
Nuxt Box
Truffle, Nuxt and Vue boilerplate
Stars: ✭ 46 (-51.06%)
Mutual labels:  ethereum, truffle
Disperse
React/Redux dApp (decentralized app) boilerplate using Ethereum's blockchain
Stars: ✭ 36 (-61.7%)
Mutual labels:  ethereum, truffle
Ethermint Archive
Ethereum on Tendermint using Cosmos-SDK!
Stars: ✭ 667 (+609.57%)
Mutual labels:  ethereum, truffle
Supply Chain
Supply chain management on blockchain using Angular 4 + Truffle + IPFS + Ethereum
Stars: ✭ 76 (-19.15%)
Mutual labels:  ethereum, truffle
Typechain
🔌 TypeScript bindings for Ethereum smart contracts
Stars: ✭ 769 (+718.09%)
Mutual labels:  ethereum, truffle
Transmute Framework
TypeScript dApp Framework
Stars: ✭ 45 (-52.13%)
Mutual labels:  ethereum, truffle
Eth Crypto
Cryptographic javascript-functions for ethereum and tutorials to use them with web3js and solidity
Stars: ✭ 420 (+346.81%)
Mutual labels:  ethereum, truffle
Kin Token
Kin token contracts.
Stars: ✭ 60 (-36.17%)
Mutual labels:  ethereum, truffle
Awesome Ethereum Cn
Web3.js、Solidity、Truffle开发教程及以太坊开发资源汇总
Stars: ✭ 54 (-42.55%)
Mutual labels:  ethereum, truffle
React Box
Truffle, Webpack and React boilerplate.
Stars: ✭ 516 (+448.94%)
Mutual labels:  ethereum, truffle
Marketprotocol
Ethereum based derivatives trading protocol creating digital tokens for any asset
Stars: ✭ 78 (-17.02%)
Mutual labels:  ethereum, truffle
Defi Sdk
DeFi SDK Makes Money Lego Work
Stars: ✭ 440 (+368.09%)
Mutual labels:  ethereum, truffle
Eth.social
An Ethereum dApp for posting social events.
Stars: ✭ 17 (-81.91%)
Mutual labels:  ethereum, truffle
Eattheblocks
Source code for Eat The Blocks, a screencast for Ethereum Dapp Developers
Stars: ✭ 431 (+358.51%)
Mutual labels:  ethereum, truffle
Blockchain Learning
Learn and promote blockchain together by writing
Stars: ✭ 44 (-53.19%)
Mutual labels:  ethereum, truffle
Eth Gas Reporter
Gas usage per unit test. Average gas usage per method. A mocha reporter.
Stars: ✭ 330 (+251.06%)
Mutual labels:  ethereum, truffle
React Ethereum Dapp Example
A starter boilerplate for an Ethereum dapp using web3.js v1.0, truffle, react, and parity
Stars: ✭ 384 (+308.51%)
Mutual labels:  ethereum, truffle
Trace
Supply chain transparency platform proof-of-concept based on the Ethereum blockchain ✍️
Stars: ✭ 52 (-44.68%)
Mutual labels:  ethereum, truffle
Etheno
Simplify Ethereum security analysis and testing
Stars: ✭ 77 (-18.09%)
Mutual labels:  ethereum, truffle

Soltsice

Solidity & TypeScript Integration, Configuration and Examples

With Soltsice you could generate strongly-typed TypeScript proxies for Ethereum contracts from Solidity ABI with a single command. You could also send raw signed transactions to public Ethereum nodes such as Infura just by adding an optional private key parameter to any method. Soltsice provides convenient utilities for storing key files, for signing arbitrary data for later address recovery with ecrecover functions from contracts code and for other frequent tasks. Finally, Soltsice has MultiOwnable and BotManageable contracts for granular access control for MultiSig majority, individual owners and backend accounts.

Quick links


Features

Solidity ABI to TypeScript contract generation

With Soltsice you could generate strongly-typed TypeScript proxies for Ethereum contracts from Solidity ABI with a single command.

Methods

TODO

Events

TODO

Type safety and easy refactoring

The initial purpose of this library was to have peace of mind and type safety when working with rapidly changing Solidity ABI. TypeScript proxies for contracts allow to use powerful intellisense feature of code editors.

Methods with signatures

Methods with signatures

Typed Constructor

Typed Constructor

Fast API discovery & Intellisense support

TODO

Isomorphic NPM packages for contracts

TODO

Transactions and custom data signing

TODO

Using remote public nodes is easy

TODO Problem: Geth 1.8 added pruning, but still long-running nodes grow in side. Standard BizSpark subscription cannot keep up, needs more resources.

TODO Deploy via migrations using contracts, showcase @ts-check attribute in VSCode

Micropayments state channels example

TODO

Private key management

TODO

Security considerations

TODO

Local key file storage

TODO

Note that the format is standard one so you could import existing key files just by providing a filepath and password.

top

Contracts for access control

TODO

MultiOwnable: MultiSig majority and individual owner access

TODO

BotManageable: account managed by backend

TODO

Utilities

TODO

W3 module

TODO

Ethereum Utils

TODO

Typings

Keythereum

TODO

Storage contract

TODO

soltsice code generator from code

TODO

Work in progress

TODO

top


Getting started

Installing and using Soltsice is very easy. You could just add soltsice NPM package to your existing project or use a starter project for new development.

Install & Usage

You must have truffle and copyfiles installed globally:

npm install -g truffle copyfiles

Install and save Soltsice:

npm install soltsice --save

Soltsice allows to generate TypeScript files for Ethereum contracts with the command:

soltsice ./artifacts ./types

All .json artifacts from truffle compile in the folder artifacts will be transformed into TypeScript classes in types with a single index.ts file with all exports.

Every TypeScript contract class inherits SoltsiceContract, which is a wrapper over Truffle-contract with methods generated from ABI. If some functionality is not yet supported by Soltsice, you may use SoltsiceContract._instance : Promise<any> field to access untyped Truffle-contract instance.

You could import generated types as:

import { W3 } from "soltsice";
import { BigNumber } from "bignumber.js";
import { StandardToken } from "./types";

// default wrapper for web3: either window['web3'] if present,
// or http provider connected to localhost: 8545, if not running on https 
let w3: W3 = new W3();

// null for ctor params which are only used for newly deployed contracts
let st: StandardToken = new StandardToken("address of deployed contract", null, w3);

// note that typings are optional in variable definitions, TypeScript infers types
let supply: Promise<BigNumber> = st.totalSupply();

supply.then(value => {
    console.log("TOTAL SUPPLY", value.dividedBy(1e18).toFormat(0));
});

See dbrain-contracts and dbrain-blockchain-api projects that use this library and a standalone minimal example here.

Workflow

  • Edit Solidity contracts, run truffle compile, run tests on Truffle stack (solidity or js, if any)
  • Run Soltsice command soltsice ./src ./dest, all TypeScript contracts will be updated, any API changes will block subsequent TS compilation (except for rare edge cases such as multiple return parameters which are returned as an array and we use any TS type for them)
  • Adjust you code to the changes.

Starter projects

TODO

Contracts starter

TODO A starter project with the shortest path to deploy

Frontend with CRA & TypeScript

TODO Use the contract starter package from DApp starter (dbrain-dapp structure)

Backend API with Swagger

TODO Use the contract starter from backend (dbrain-blockchain-api structure)

top


Examples

TODO

Dbrain contracts

TODO https://github.com/Soltsice/dbrain-contracts State channels + in-memory off-chain signing mock

Dbrain blockchain API

TODO https://github.com/Soltsice/dbrain-blockchain-api Off-chain signing prototype on Postgres

Dbrain DApp prototype

TODO

top


Contributing

If some functionality is not supported yet you are very welcome to open an issue or pull request!

Build

To build & test run the following commands:

npm install
npm run build:contracts
npm run soltsice
npm test

License

MIT

(c) 2018 Dbrain.io

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].