Skip to content

Instantly share code, notes, and snippets.

View gyan0890's full-sized avatar

Gyan gyan0890

View GitHub Profile
@gyan0890
gyan0890 / 1_Ballot.sol
Created October 11, 2020 06: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.6.12+commit.27d51765.js&optimize=false&gist=
pragma solidity ^0.5.0;
contract Ballot {
struct Voter {
uint weight;
bool voted;
uint8 vote;
address delegate;
}
struct Proposal {
//SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "../utils/Context.sol";
import "../utils/Strings.sol";
import "../utils/introspection/ERC165.sol";
/**
* @dev External interface of AccessControl declared to support ERC165 detection.
@gyan0890
gyan0890 / contracts...EthernaalMarketplace.sol
Created August 19, 2021 18:08
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.8.2+commit.661d1103.js&optimize=false&runs=200&gist=
// SPDX-License-Identifier: EtherNaal
pragma solidity >=0.6.0 <0.9.0;
import "@openzeppelin/contracts/token/ERC721/extensions/ERC721URIStorage.sol";
import "@openzeppelin/contracts/utils/Counters.sol";
contract EtherNaal is ERC721URIStorage{
mapping(uint256 => uint256) private salePrice;
@gyan0890
gyan0890 / contracts...EtherNaut4.sol
Created September 16, 2021 16:25
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.6.2+commit.bacdbe57.js&optimize=false&runs=200&gist=
// this line is added to create a gist. Empty file is not allowed.
@gyan0890
gyan0890 / contracts...EtherNautL2.sol
Created September 16, 2021 16:25
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.6.2+commit.bacdbe57.js&optimize=false&runs=200&gist=
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import '@openzeppelin/contracts/utils/math/SafeMath.sol';
contract CoinFlip {
using SafeMath for uint256;
uint256 public consecutiveWins;
uint256 lastHash;
@gyan0890
gyan0890 / contracts...QLIPMarketplace.sol
Created September 17, 2021 11: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.8.2+commit.661d1103.js&optimize=false&runs=200&gist=
//SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.0;
import "https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/token/ERC721/ERC721.sol";
import "https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/token/ERC721/extensions/ERC721URIStorage.sol";
import "https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/utils/Counters.sol";
import "https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/token/ERC721/IERC721Receiver.sol";
contract QLIPMarketplace is ERC721URIStorage, IERC721Receiver{
using Counters for Counters.Counter;
@gyan0890
gyan0890 / contracts...IDO.sol
Created September 23, 2021 05: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.8.2+commit.661d1103.js&optimize=false&runs=200&gist=
// SPDX-License-Identifier: GPL-3.0
pragma solidity >=0.7.0 <0.9.0;
import "@openzeppelin/contracts/token/ERC721/extensions/ERC721URIStorage.sol";
import "@openzeppelin/contracts/utils/Counters.sol";
//["0xfFe1426e77CE0F7c0945fCC1f4196CD8dC3f090A", "0xdFE56933c0e112589A2BD414161B39aa3A1EC4BE", "0x5d519e11E98Cd230D3e8d18C12E740D449fd05cD", "0x4b8a65c8ef37430edFaaD1B61Dba2D680f56FFd7", "0xA873Bb96597D71d3BA6764ab26387DB598F65372","0xfFe1426e77CE0F7c0945fCC1f4196CD8dC3f090A", "0xdFE56933c0e112589A2BD414161B39aa3A1EC4BE", "0x5d519e11E98Cd230D3e8d18C12E740D449fd05cD", "0x4b8a65c8ef37430edFaaD1B61Dba2D680f56FFd7", "0xA873Bb96597D71d3BA6764ab26387DB598F65372","0xfFe1426e77CE0F7c0945fCC1f4196CD8dC3f090A", "0xdFE56933c0e112589A2BD414161B39aa3A1EC4BE", "0x5d519e11E98Cd230D3e8d18C12E740D449fd05cD", "0x4b8a65c8ef37430edFaaD1B61Dba2D680f56FFd7", "0xA873Bb96597D71d3BA6764ab26387DB598F65372","0xfFe1426e77CE0F7c0945fCC1f4196CD8dC3f090A", "0xdFE56933c0e112589A2BD414161B39aa3A1EC4BE", "0x5d519e11E98Cd230D3e8d18C12E740D449f
@gyan0890
gyan0890 / contracts...SpockPlatform.sol
Created September 23, 2021 18:09
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.0+commit.1d4f565a.js&optimize=false&runs=200&gist=
//SPDX-Identifier: Unlciensed
pragma solidity ^0.8.0;
contract SpockPlatform {
mapping(address -> uint[]);
address[] payable users;
struct Stock {
uint id;
@gyan0890
gyan0890 / contracts...SpockPlatform.sol
Last active September 24, 2021 17:51
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.0+commit.1d4f565a.js&optimize=false&runs=200&gist=
//SPDX-License-Identifier: Unlicensed
pragma solidity ^0.8.0;
contract SpockPlatform {
//Stores the current score of each stock
mapping(uint => uint) stockScores;
//Store the current price of each stock: score*(current price of spock)
mapping(uint => uint) stockPrices;
@gyan0890
gyan0890 / contracts...SpockPlatform.sol
Last active September 30, 2021 05:50
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.8.2+commit.661d1103.js&optimize=false&runs=200&gist=
//SPDX-License-Identifier: Unlicensed
pragma solidity ^0.8.0;
contract SpockPlatform {
//Stores the current score of each stock
mapping(uint => uint) stockScores;
address owner;