Skip to content

Instantly share code, notes, and snippets.

View buddies2705's full-sized avatar
🏠
Working from home

Gaurav buddies2705

🏠
Working from home
  • Bangalore
View GitHub Profile
Verifying my Blockstack ID is secured with the address 1CVTf4DmBL5Jfki3qRZiBsGmhRnAZCKJEA https://explorer.blockstack.org/address/1CVTf4DmBL5Jfki3qRZiBsGmhRnAZCKJEA
/**
* @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.
*
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.
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
@buddies2705
buddies2705 / ExampleTokenCrowdsale.sol
Created October 15, 2018 12:42
Time - sensitive crowdsale
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{
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 October 29, 2018 00:08
Escrow Smart Contract
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 October 29, 2018 00:18
Open Zeppelin secondary permission manager
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);
@buddies2705
buddies2705 / Dice.sol
Created November 5, 2018 02:24
Roll the Dice
pragma solidity ^0.4.24;
contract Dice{
struct Bet{
uint8 currentBet;
bool isBetSet; //default value is false
uint8 destiny;
}
@buddies2705
buddies2705 / token.json
Created December 22, 2018 11:23
subscribe smart contract event
[
{
"constant": true,
"inputs": [
{
"name": "_interfaceID",
"type": "bytes4"
}
],
"name": "supportsInterface",