This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
ethereum(network: ethereum) { | |
smartContractCalls( | |
smartContractMethod: {is: "Contract Creation"} | |
caller: {is: "0x9dfc3cbf922cd187990c1bb82a7bd134350c2d37"} | |
options: {desc: "date.date"} | |
) { | |
date { | |
date | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// SPDX-License-Identifier: GPL-3.0 | |
pragma solidity ^0.8; | |
contract RockPaperScissors { | |
uint public enrollmentAmount; | |
address owner; | |
address[] public players; | |
mapping(address => bool) playerPlayed; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; | |
NewerOlder