Skip to content

Instantly share code, notes, and snippets.

View prtk418's full-sized avatar
:shipit:
Chilling

Pratik Agarwal prtk418

:shipit:
Chilling
View GitHub Profile
@prtk418
prtk418 / Ballot.sol
Created April 25, 2022 02:53
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.7+commit.e28d00a7.js&optimize=false&runs=200&gist=
// SPDX-License-Identifier: GPL-3.0
pragma solidity >=0.7.0 <0.9.0;
/// @title Voting with delegation.
contract Ballot {
// This declares a new complex type which will
// be used for variables later.
// It will represent a single voter.
struct Voter {
uint weight; // weight is accumulated by delegation
bool voted; // if true, that person already voted
@prtk418
prtk418 / HelloWorld.sol
Created April 25, 2022 02:52
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.7+commit.e28d00a7.js&optimize=false&runs=200&gist=
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.1;
/// @notice Hello World contract
contract HelloWorld {
/// @notice state variable to store the number
uint256 intToStore;
/**
* @notice Stores specified number in contract
{
ethereum(network: ethereum) {
smartContractCalls(
smartContractMethod: {is: "Contract Creation"}
caller: {is: "0x9dfc3cbf922cd187990c1bb82a7bd134350c2d37"}
options: {desc: "date.date"}
) {
date {
date
}
@prtk418
prtk418 / [email protected]
Created December 13, 2021 13: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.7+commit.e28d00a7.js&optimize=false&runs=200&gist=
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.0 (access/Ownable.sol)
pragma solidity ^0.8.0;
import "../utils/Context.sol";
/**
* @dev Contract module which provides a basic access control mechanism, where
* there is an account (an owner) that can be granted exclusive access to
@prtk418
prtk418 / contracts...ForeverClub.sol
Created October 9, 2021 04:04
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.7+commit.e28d00a7.js&optimize=false&runs=200&gist=
//SPDX-License-Identifier: UNLICENSED
/*
ForeverClub is an NFT that can't be bought or sold.
Only be transferred, to bootstrap crypto communities.
Rules:
* Mint ForeverClub NFT
* give it a name
* decide the size of the club
* Minter transfers to second member
@prtk418
prtk418 / gist-5d33ac6857bd0683e63202b8dc6b1b9d...contracts...subquest-add-compound.sol
Created August 30, 2021 13:00
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.4+commit.c7e474f2.js&optimize=false&runs=200&gist=
pragma solidity >=0.7.0 <0.9.0;
interface cETH {
// define functions of COMPOUND we'll be using
function mint() external payable; // to deposit to compound
function redeem(uint redeemTokens) external returns (uint); // to withdraw from compound
@prtk418
prtk418 / gist-5d33ac6857bd0683e63202b8dc6b1b9d...contracts...subquest-add-compound.sol
Created August 30, 2021 13:00
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.4+commit.c7e474f2.js&optimize=false&runs=200&gist=
pragma solidity >=0.7.0 <0.9.0;
interface cETH {
// define functions of COMPOUND we'll be using
function mint() external payable; // to deposit to compound
function redeem(uint redeemTokens) external returns (uint); // to withdraw from compound
@prtk418
prtk418 / gist-5d33ac6857bd0683e63202b8dc6b1b9d...contracts...subquest-add-compound.sol
Last active August 30, 2021 13:01
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.4+commit.c7e474f2.js&optimize=false&runs=200&gist=
pragma solidity >=0.7.0 <0.9.0;
interface cETH {
// define functions of COMPOUND we'll be using
function mint() external payable; // to deposit to compound
function redeem(uint redeemTokens) external returns (uint); // to withdraw from compound
@prtk418
prtk418 / contracts...RockPaperScissors.sol
Created August 21, 2021 12: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.7+commit.e28d00a7.js&optimize=false&runs=200&gist=
// SPDX-License-Identifier: GPL-3.0
pragma solidity ^0.8;
contract RockPaperScissors {
uint public enrollmentAmount;
address owner;
address[] public players;
mapping(address => bool) playerPlayed;
pragma solidity ^0.8.0;
import "@openzeppelin/contracts/token/ERC721/extensions/ERC721URIStorage.sol";
contract YourCollectible is ERC721URIStorage {
string NAME = "Abstract Collectibles";
string SYMBOL = "ABS";
uint256 private _tokenId = 1;