Skip to content

Instantly share code, notes, and snippets.

View rgottleber's full-sized avatar
💭
🤙

Richard Gottleber rgottleber

💭
🤙
View GitHub Profile
@rgottleber
rgottleber / DNFT.sol
Created November 1, 2022 17:23
SmartCon Demo NFT
// SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.7;
// Importing other contracts
import "@openzeppelin/contracts/token/ERC721/ERC721.sol";
import "@openzeppelin/contracts/token/ERC721/extensions/ERC721URIStorage.sol";
import "@openzeppelin/contracts/utils/Strings.sol";
import "@openzeppelin/contracts/utils/Base64.sol";
// Importing Chainlink contracts
@rgottleber
rgottleber / CountingSVG.sol
Last active July 24, 2023 10:12
Code For Keepers Masterclass
// SPDX-License-Identifier: MIT
// An example of a consumer contract that relies on a subscription for funding.
pragma solidity ^0.8.17;
import "@openzeppelin/contracts/token/ERC721/ERC721.sol";
import "@openzeppelin/contracts/token/ERC721/extensions/ERC721URIStorage.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/utils/Counters.sol";
import "@openzeppelin/contracts/utils/Strings.sol";
import "@openzeppelin/contracts/utils/Base64.sol";
import "@openzeppelin/contracts/token/ERC721/extensions/ERC721URIStorage.sol";
import "@openzeppelin/contracts/utils/Counters.sol";
contract EmojiGotchi is ERC721, ERC721URIStorage {
using Counters for Counters.Counter;
Counters.Counter private _tokenIdCounter;
constructor() ERC721("EmojiGotchi", "emg") {}
@rgottleber
rgottleber / 00 - About.md
Last active September 9, 2022 15:25
Resources for DEMOs - SmartCon 2022

Demo Files For SmartCon 2022

Sept 27, 2022

These Files will be updated for each talk. If you are looking for a past talk check the history.

Resources for live session from SmartCon Workshop

// SPDX-License-Identifier: MIT
pragma solidity ^0.8.7;
import "@openzeppelin/contracts@4.4.2/token/ERC721/extensions/ERC721URIStorage.sol";
import "@openzeppelin/contracts@4.4.2/utils/Counters.sol";
contract dynBloom is ERC721, ERC721URIStorage {
using Counters for Counters.Counter;
@rgottleber
rgottleber / differences.txt
Created October 11, 2021 21:13
Solidity modifier vs function
just_modifier.sol
968 length
MyContract (484 bytes)
Deployment costs: 90541 gas
608060405234801561001057600080fd5b506101c4806100206000396000f3fe608060405234801561001057600080fd5b50600436106101375760003560e01c806398e9a73d116100b8578063c3f902021161007c578063c3f902021461013c578063c9ff79aa1461013c578063df2025dc1461013c578063e6e0ae361461013c578063e70255931461013c578063ebd25c8f1461013c57600080fd5b806398e9a73d1461013c5780639942ec6f1461013c578063aa66aa631461013c578063aaf05f3d1461013c578063c27fc3051461013c57600080fd5b80636d4975a2116100ff5780636d4975a21461013c5780637c396b831461013c5780638da5cb5b146101465780638dc714ba1461013c578063920f5c731461013c57600080fd5b806324a75cfd1461013c5780633b88f6c21461013c5780633c9d377d1461013c57806340bcff2a1461013c5780635fb435921461013c575b600080fd5b610144610175565b005b600054610159906001600160a01b031681565b6040516001600160a01b03909116815260200160405180910390f35b6000546001600160a01b0316331461018c57600080fd5b56fea264697066735822122075be568f28bfc828da662bbfbd86eef234a773f9810037dc5dbb9a7b5bf1
@rgottleber
rgottleber / .deps...npm...
Created August 29, 2021 01:24
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.4.26+commit.4563c3fc.js&optimize=false&runs=200&gist=
<!DOCTYPE html><html lang="en"><head><script async="" src="https://www.googletagmanager.com/gtag/js?id=UA-140352188-1"></script><script>window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'UA-140352188-1');</script><meta charSet="utf-8"/><meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"/><meta name="description" content="The CDN for everything on npm"/><meta name="viewport" content="width=device-width,initial-scale=1,maximum-scale=1"/><meta name="timestamp" content="2021-08-28T16:46:02.357Z"/><link rel="shortcut icon" href="/favicon.ico"/><title>UNPKG</title><script>window.Promise || document.write('\x3Cscript src="/es6-promise@4.2.5/dist/es6-promise.min.js">\x3C/script>\x3Cscript>ES6Promise.polyfill()\x3C/script>')</script><script>window.fetch || document.write('\x3Cscript src="/whatwg-fetch@3.0.0/dist/fetch.umd.js">\x3C/script>')</script></head><body><div id="root"><style data-emotion-css="xshv0">html{box-sizing:border-box
@rgottleber
rgottleber / contracts...Ownable.sol
Created August 28, 2021 20:56
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.4.26+commit.4563c3fc.js&optimize=false&runs=200&gist=
pragma solidity ^ 0.4.18;
contract Ownable {
address public owner;
constructor() public {
owner = msg.sender;
}
modifier onlyOwner() {
@rgottleber
rgottleber / contracts...Ownable.sol
Created August 28, 2021 20:37
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.4.26+commit.4563c3fc.js&optimize=false&runs=200&gist=
pragma solidity ^ 0.4.18;
contract Ownable {
address public owner;
constructor() public {
owner = msg.sender;
}
modifier onlyOwner() {
@rgottleber
rgottleber / contracts...SimpleCoin.sol
Created August 28, 2021 19:12
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.4.26+commit.4563c3fc.js&optimize=false&runs=200&gist=
pragma solidity ^0.4.0;
contract SimpleCoin {
mapping (address => uint256) public coinBalance;
// Allowance is used to limit the number of coins an address can
// use in transferFrom
mapping (address => mapping (address => uint256)) public allowance;
mapping (address => bool) public frozenAccount;
address public owner;