Skip to content

Instantly share code, notes, and snippets.

View 0mkara's full-sized avatar
:octocat:
Go to shell!

Omkara 0mkara

:octocat:
Go to shell!
View GitHub Profile
@0mkara
0mkara / Contract Killer 3.md
Last active August 29, 2015 14:28 — forked from malarkey/Contract Killer 3.md
The latest version of my ‘killer contract’ for web designers and developers

Contract Killer

The popular open-source contract for web designers and developers by Stuff & Nonsense

  • Originally published: 23/12/2008
  • Revised date: 15/12/2013
  • Original post

@0mkara
0mkara / Ethereum_private_network.md
Last active February 29, 2024 21:59
Ethereum private network configuration guide.

Create your own Ethereum private network

Introduction

Used nodes:

Linux raspberrypi 4.9.41-v7+ #1023 SMP Tue Aug 8 16:00:15 BST 2017 armv7l GNU/Linux
Linux localhost.localdomain 4.14.5-200.fc26.x86_64 #1 SMP Mon Dec 11 16:29:08 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux
@0mkara
0mkara / EthereumNotes.md
Last active July 11, 2016 20:48
Important ethereum links and notes

Native-DApps

Solidity

Type members

Raine Revere @raineorshine 23:39 I'm getting an out of gas error when I try to deploy a contract. It is not due to the control flow itself but seems to be due to the raw size of the contract. Is it possible for the bytecode to get too big at a certain point to deploy? Any recommendations? Does splitting a contract into libraries get around this issue? Thanks.

Nick Johnson @Arachnid 00:10 Yes, it is, and yes, it does.

@0mkara
0mkara / swarm-server-setup.sh
Created August 4, 2016 18:00 — forked from zelig/swarm-server-setup.sh
swarm server setup
cat > ~/.gitconfig <<EOF
[github]
user = zelig
token =
[user]
name = zelig
email = viktor.tron@gmail.com
[core]
pager = less -FRX
[color]
@0mkara
0mkara / ecverify.sol
Created January 11, 2018 19:03 — forked from axic/ecverify.sol
Ethereum ECVerify
//
// The new assembly support in Solidity makes writing helpers easy.
// Many have complained how complex it is to use `ecrecover`, especially in conjunction
// with the `eth_sign` RPC call. Here is a helper, which makes that a matter of a single call.
//
// Sample input parameters:
// (with v=0)
// "0x47173285a8d7341e5e972fc677286384f802f8ef42a5ec5f03bbfa254cb01fad",
// "0xaca7da997ad177f040240cdccf6905b71ab16b74434388c3a72f34fd25d6439346b2bac274ff29b48b3ea6e2d04c1336eaceafda3c53ab483fc3ff12fac3ebf200",
// "0x0e5cb767cce09a7f3ca594df118aa519be5e2b5a"
@0mkara
0mkara / AwardToken.sol
Last active October 26, 2018 06:21
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.4.25+commit.59dbf8f1.js&optimize=false&gist=
pragma solidity ^0.4.24;
import 'https://github.com/OpenZeppelin/zeppelin-solidity/contracts/token/ERC20/ERC20Mintable.sol';
import 'https://github.com/OpenZeppelin/zeppelin-solidity/contracts/ownership/Ownable.sol';
import "./Ballot.sol";
contract AwardToken is ERC20Mintable, Ownable {
uint quantity;
uint ballotPeriod = 7 hours;
Ballot public currBallot;
address[] public prevWinners;
@0mkara
0mkara / SafeMathProxy.sol
Created October 26, 2018 13:31
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.4.25+commit.59dbf8f1.js&optimize=false&gist=
pragma solidity ^0.4.24;
import 'https://github.com/OpenZeppelin/zeppelin-solidity/contracts/math/SafeMath.sol';
/*
Using a proxy contract here allows revert-causing functions that contain
require() to return false rather than halt execution
https://truffleframework.com/tutorials/testing-for-throws-in-solidity-tests
*/
contract SafeMathProxy {
using SafeMath for uint;
@0mkara
0mkara / SimpleStorage.sol
Created October 29, 2018 21:55
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.4.25+commit.59dbf8f1.js&optimize=false&gist=
pragma solidity ^0.4.7;
import "remix_tests.sol";
contract SimpleStorage {
uint public storedData;
function SimpleStorage() public {
storedData = 100;
}
function set(uint x) public {
@0mkara
0mkara / Greeter.sol
Created January 7, 2019 13:33
Greeter
pragma solidity ^0.5.0;
contract Mortal {
/* Define variable owner of the type address */
address payable owner;
/* This function is executed at initialization and sets the owner of the contract */
function mortal() public { owner = msg.sender; }
/* Function to recover the funds on the contract */
function kill() public { if (msg.sender == owner) selfdestruct(owner); }
@0mkara
0mkara / mortal.sol
Created January 22, 2019 17:12
Mortal library
pragma solidity ^0.5.0;
contract Mortal {
/* Define variable owner of the type address */
address payable owner;
/* This function is executed at initialization and sets the owner of the contract */
function mortal() public { owner = msg.sender; }
/* Function to recover the funds on the contract */