Skip to content

Instantly share code, notes, and snippets.

import com.alibaba.fastjson.JSONObject;
import org.apache.dubbo.common.io.Bytes;
import org.apache.dubbo.common.serialize.hessian2.Hessian2ObjectOutput;
import sun.misc.Unsafe;
import sun.print.UnixPrintServiceLookup;
import java.io.*;
import java.lang.reflect.Field;
import java.net.Socket;
import java.util.HashMap;
import java.util.Random;
@yemoli
yemoli / CallCounter.sol
Created December 28, 2021 00:46
Created using remix-ide: Realtime Ethereum Contract Compiler and Runtime. Load this file by pasting this gists URL or ID at https://remix.ethereum.org/#version=soljson-v0.5.16+commit.9c3226ce.js&optimize=false&runs=200&gist=
pragma solidity ^0.5.16;
contract Counter{
uint private count = 10;
uint public showc;
function inc(uint num) public returns(uint){
return count += num;
}
function getCount() public returns(uint){
showc = count;
return showc;
@yemoli
yemoli / test.sol
Created December 27, 2021 11:15
Created using remix-ide: Realtime Ethereum Contract Compiler and Runtime. Load this file by pasting this gists URL or ID at https://remix.ethereum.org/#version=soljson-v0.5.16+commit.9c3226ce.js&optimize=false&runs=200&gist=
pragma solidity 0.5.16;
contract owned{
address payable owner;
constructor() public{
owner = msg.sender;
}
modifier onlyOwner{
require(msg.sender == owner,"only the contract owner can call this function");
_;