Skip to content

Instantly share code, notes, and snippets.

@ryestew
ryestew / 2Contracts.sol
Created October 12, 2020 03:24
Remix Lecture Sample Solidity Files
// 2 contracts pick one
pragma solidity >=0.4.22 <0.7.0;
contract Puppy { function retrieve() public view returns (uint256) {
return 1 + 3;
}
}
contract PerfectPuppy {
@ryestew
ryestew / gridMix4.sol
Created September 24, 2020 14:06
GridMix
pragma experimental ABIEncoderV2;
import "https://github.com/OpenZeppelin/openzeppelin-contracts/blob/release-v3.2.0/contracts/utils/EnumerableMap.sol";
import "https://github.com/OpenZeppelin/openzeppelin-contracts/blob/release-v3.2.0/contracts/introspection/IERC1820Registry.sol";
import "https://github.com/OpenZeppelin/openzeppelin-contracts/blob/release-v3.2.0/contracts/token/ERC777/IERC777Recipient.sol";
import "https://github.com/OpenZeppelin/openzeppelin-contracts/blob/release-v3.2.0/contracts/token/ERC777/IERC777.sol";
contract masterSLEC is IERC777Recipient {
using EnumerableMap for EnumerableMap.UintToAddressMap;
IERC1820Registry private _erc1820 = IERC1820Registry(0x1820a4B7618BdE71Dce8cdc73aAB6C95905faD24);
@ryestew
ryestew / 1_Storage.sol
Created September 15, 2020 14:44
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.6+commit.6c089d02.js&optimize=false&gist=
pragma solidity >=0.4.22 <0.7.0;
/**
* @title Storage
* @dev Store & retreive value in a variable
*/
contract Storage {
uint256 number;
{
"name": "Discover Solidity",
"description": "Beginner workshop to discover Solidity. You will learn how to create a method and change the state.",
"steps": [{
"name": "Hello World",
"fileName": "HelloWorld",
"markdown": "https://github.com/GrandSchtroumpf/solidity-school/blob/master/std-0/1_HelloWorld/README.md",
"solidity": "https://github.com/GrandSchtroumpf/solidity-school/blob/master/std-0/1_HelloWorld/HelloWorld.sol",
"test": "https://github.com/GrandSchtroumpf/solidity-school/blob/master/std-0/1_HelloWorld/HelloWorld_test.sol"
},
6204164591: {
name: 'Discover Solidity',
description: 'Beginner workshop to discover Solidity. You will learn how to create a method and change the state.',
steps: [
{
name: 'Hello World',
fileName: 'HelloWorld',
markdown: 'https://github.com/GrandSchtroumpf/solidity-school/blob/master/std-0/1_HelloWorld/README.md',
solidity: 'https://github.com/GrandSchtroumpf/solidity-school/blob/master/std-0/1_HelloWorld/HelloWorld.sol',
test: 'https://github.com/GrandSchtroumpf/solidity-school/blob/master/std-0/1_HelloWorld/HelloWorld_test.sol'
@ryestew
ryestew / ballot.sol
Created August 18, 2019 23: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.5.1+commit.c8a2cb62.js&optimize=false&gist=
pragma solidity >=0.4.22 <0.6.0;
contract Ballot {
struct Voter {
uint weight;
bool voted;
uint8 vote;
address delegate;
}
struct Proposal {
@ryestew
ryestew / ballot.sol
Last active August 1, 2019 14:10
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.1+commit.c8a2cb62.js&optimize=false&gist=
pragma solidity >=0.4.22 <0.6.0;
contract Ballot {
struct Voter {
uint weight;
bool voted;
uint8 vote;
address delegate;
}
struct Proposal {
@ryestew
ryestew / ballot.sol
Last active July 30, 2019 14:19
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.1+commit.c8a2cb62.js&optimize=false&gist=
pragma solidity >=0.4.22 <0.6.0;
contract Ballot {
struct Voter {
uint weight;
bool voted;
uint8 vote;
address delegate;
}
struct Proposal {
@ryestew
ryestew / ballot.sol
Last active July 30, 2019 13:57
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.1+commit.c8a2cb62.js&optimize=false&gist=
pragma solidity >=0.4.22 <0.6.0;
contract Ballot {
struct Voter {
uint weight;
bool voted;
uint8 vote;
address delegate;
}
struct Proposal {