Skip to content

Instantly share code, notes, and snippets.

@MASDXI
MASDXI / 2-dirty-raft-config.json
Last active March 5, 2021 05:56
Quorum-RAFT-config
{
"network": {
"name": "2-dirty-raft",
"verbosity": 5,
"consensus": "raft",
"quorumVersion": "21.1.0",
"transactionManager": "21.1.0",
"permissioned": true,
"genesisFile": "none",
"generateKeys": true,
@MASDXI
MASDXI / genesis.json
Last active May 8, 2021 08:52
Example pre-loaded smart contract on genesis.json
{
"alloc": {
"0xed9d02e382b34818e88b88a309c7fe71e65f419d": {
"balance": "1000000000000000000000000000"
},
"0xca843569e3427144cead5e4d5999a3d0ccf92b8e": {
"balance": "1000000000000000000000000000"
},
"0x0fbdc686b912d7722dc86510934589e0aaf3b55a": {
"balance": "1000000000000000000000000000"
@MASDXI
MASDXI / ERC20.sol
Last active August 2, 2021 10:47
ERC20.sol Remix IDE
// SPDX-License-Identifier: MIT
pragma solidity >=0.7.0 <0.9.0;
import "https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/token/ERC20/ERC20.sol";
contract Token is ERC20 {
// name Token
// symbol TKN
// decimals 18 (default)
// totalSupply 1000000
@MASDXI
MASDXI / IPRNG.sol
Last active June 20, 2022 20:58
Signed Message RNG
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.1;
interface IPRNG {
struct Entropy {
address signer;
bytes32 hash;
bytes sig;
}
@MASDXI
MASDXI / Crowsale.sol
Created March 20, 2022 13:30
Malicious contract
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/security/ReentrancyGuard.sol";
import "@openzeppelin/contracts/security/Pausable.sol";
contract Crowdsale is Ownable, ReentrancyGuard, Pausable {
IERC20 private _tokenA;
@MASDXI
MASDXI / Calculator.sol
Last active April 4, 2022 11:52
RTLO smart contract
// SPDX-License-Identifier: MIT
pragma solidity 0.7.5;
contract Calculator {
function add(uint256 x, uint256 y) public pure returns (uint256) {
/* start function*/
require(x + y >= x);
return /*first number*/x + y/*second number*/
/* end function*/;
// SPDX-License-Identifier: NONE
pragma solidity =0.7.5;
/*
* @source: https://youtu.be/P_Mtd5Fc_3E
* @author: Shahar Zini
* @revised: 0x91d9
*/
contract GuessTheNumber {
@MASDXI
MASDXI / ABI.json
Created July 7, 2022 09:37
Test 0x44 on ETH 2.0
[
{
"inputs": [],
"name": "rand",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
@MASDXI
MASDXI / iroha_v1-local-dev.sh
Created November 21, 2022 05:37
iroha v1 docker
#!usr/bin/bash
docker pull sirawitt42/iroha-1.5.0-rockdb:develop
git clone https://github.com/MASDXI/iroha.git -b masdxi/docker/hotfix
cd iroha
docker run --name iroha \
-d \
-p 50051:50051 \
@MASDXI
MASDXI / triedb.sol
Created November 12, 2023 07:43
TrieDB
// SPDX-License-Identifier: UNLICENSED
pragma solidity 0.8.14;
contract TrieDB {
enum TRIE_STATUS { INACTIVE, ACTIVE }
struct TrieNode {
bytes32 origin;
TRIE_STATUS status;