Skip to content

Instantly share code, notes, and snippets.

Avatar

thedewer 18dew

View GitHub Profile
View gist:98806f425c7e1dd7a4f7779d7ab7cd70

Solidity Cheatsheet and Best practices

Motivation

This document is a cheatsheet for Solidity that you can use to write Smart Contracts for Ethereum based blockchain.

This guide is not intended to teach you Solidity from the ground up, but to help developers with basic knowledge who may struggle to get familiar with Smart Contracts and Blockchain because of the Solidity concepts used.

Note: If you have basic knowledge in JavaScript, it's easier to learn Solidity.

@18dew
18dew / Covid Score.md
Last active Apr 4, 2020
Covid Score - A Problem definition for tracking covid spread.
View Covid Score.md

Covid Score

Problem Statement

In vast country like india its virtually impossible to test entire population hence we need to develop a solution which derives a risk score for public based on their exposure to infected people over a specificed period of duration. If the exposure is above a threshold limit specified by goverment then person will have to take test.

Purpose of the problem definition is to come up with a scoring mechasim based on intersection and exposure with infected person path.

Ideal scoring mechanism would quantify the level of exposure a person have had with infected person. ( Note the exposure has no upper bound )

View contarct code class
pragma solidity ^0.4.24;
contract bank_ds {
mapping ( address => bool ) public bankRegis;
mapping ( address => bool ) public owner;
modifier isOwner(){
require(owner[msg.sender] == true);
_;
}
View Partity Testnet
{
"name": "CetasChain",
"engine": {
"instantSeal": null
},
"params": {
"accountStartNonce": "0x1",
"maximumExtraDataSize": "0x20",
"minGasLimit": "0x1388",
"networkID" : "0x7334"