Skip to content

Instantly share code, notes, and snippets.

Avatar
🏠
Working from home

Gaurav buddies2705

🏠
Working from home
  • Bangalore
View GitHub Profile
View Blockstack gist
Verifying my Blockstack ID is secured with the address 1CVTf4DmBL5Jfki3qRZiBsGmhRnAZCKJEA https://explorer.blockstack.org/address/1CVTf4DmBL5Jfki3qRZiBsGmhRnAZCKJEA
View OpcodeChecker.sol
/**
* @dev OpcodeChecker processes contract code to generate a bitmap of used opcodes.
*
* The generated bitmap can be used to enforce whitelisting and blacklisting on contract code.
* Bit n of the bitmap is set iff opcode n is used. For instance, the presence of the STOP opcode
* will result in bit 0 of the bitmap being set.
*
* A best-effort attempt is made to skip over unreachable data, but there may be false positives.
* To the extent the checker is written correctly, there are no false negatives.
*
View ExampleToken.sol
pragma solidity ^0.4.24;
import "openzeppelin-solidity/contracts/token/ERC20/DetailedERC20.sol";
import "openzeppelin-solidity/contracts/token/ERC20/StandardToken.sol";
import "openzeppelin-solidity/contracts/token/ERC20/MintableToken.sol";
/**
* @title DetailedERC20 token
* @dev The decimals are only for visualization purposes.
View ExampleTokenCrowdsale.sol
pragma solidity ^0.4.24;
import "openzeppelin-solidity/contracts/crowdsale/Crowdsale.sol";
import "openzeppelin-solidity/contracts/crowdsale/emission/MintedCrowdsale.sol";
import "openzeppelin-solidity/contracts/crowdsale/validation/CappedCrowdsale.sol";
contract ExampleTokenCrowdsale is Crowdsale, MintedCrowdsale, CappedCrowdsale{
//minimum investor Contribution - 20000000000000000000
View ExampleTokenCrowdsale.sol
pragma solidity ^0.4.24;
import "openzeppelin-solidity/contracts/crowdsale/Crowdsale.sol";
import "openzeppelin-solidity/contracts/crowdsale/emission/MintedCrowdsale.sol";
import "openzeppelin-solidity/contracts/crowdsale/validation/CappedCrowdsale.sol";
import "openzeppelin-solidity/contracts/crowdsale/validation/TimedCrowdsale.sol";
contract ExampleTokenCrowdsale is MintedCrowdsale, CappedCrowdsale, TimedCrowdsale{
View DividendToken.sol
pragma solidity ^0.4.24;
import "openzeppelin-solidity/contracts/math/SafeMath.sol";
contract DividendToken{
using SafeMath for uint256;
string public name = "Dividend Token";
string public symbol = "DIV";
@buddies2705
buddies2705 / Escrow.sol
Last active Oct 29, 2018
Escrow Smart Contract
View Escrow.sol
pragma solidity ^0.4.24;
import "../../math/SafeMath.sol";
import "../../ownership/Secondary.sol";
/**
* @title Escrow
* @dev Base escrow contract, holds funds designated for a payee until they
* withdraw them.
* @dev Intended usage: This contract (and derived escrow contracts) should be a
@buddies2705
buddies2705 / Secondary.sol
Created Oct 29, 2018
Open Zeppelin secondary permission manager
View Secondary.sol
pragma solidity ^0.4.24;
import "../../math/SafeMath.sol";
import "../../ownership/Secondary.sol";
contract Escrow is Secondary {
using SafeMath for uint256;
event Deposited(address indexed payee, uint256 weiAmount);
event Withdrawn(address indexed payee, uint256 weiAmount);
View Dice.sol
pragma solidity ^0.4.24;
contract Dice{
struct Bet{
uint8 currentBet;
bool isBetSet; //default value is false
uint8 destiny;
}
@buddies2705
buddies2705 / token.json
Created Dec 22, 2018
subscribe smart contract event
View token.json
[
{
"constant": true,
"inputs": [
{
"name": "_interfaceID",
"type": "bytes4"
}
],
"name": "supportsInterface",