Skip to content

Instantly share code, notes, and snippets.

View 18dew's full-sized avatar

thedewer 18dew

View GitHub Profile
@18dew
18dew / gist:98806f425c7e1dd7a4f7779d7ab7cd70
Last active June 25, 2023 17:24
Solidity Cheatsheet

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 / ReentrancyGuardPermissioned.sol
Created May 5, 2023 19:28
Permissioned Re-entrancyGuard with facility ot enable and disable re-entrancy call within the contract
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.8.0) (security/ReentrancyGuard.sol)
pragma solidity ^0.8.0;
/**
* @dev Contract module that helps prevent reentrant calls to a function.
*
* Inheriting from `ReentrancyGuard` will make the {nonReentrant} modifier
* available, which can be applied to functions to make sure there are no nested
@18dew
18dew / Covid Score.md
Last active April 4, 2020 09:40
Covid Score - A Problem definition for tracking covid spread.

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 )

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);
_;
}
{
"name": "CetasChain",
"engine": {
"instantSeal": null
},
"params": {
"accountStartNonce": "0x1",
"maximumExtraDataSize": "0x20",
"minGasLimit": "0x1388",
"networkID" : "0x7334"