Skip to content

Instantly share code, notes, and snippets.

View jongan69's full-sized avatar
🎯
WEB3D

Jonathan Gan jongan69

🎯
WEB3D
View GitHub Profile
@jongan69
jongan69 / ballot.sol
Created November 4, 2019 16:30
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.11+commit.c082d0b4.js&optimize=true&gist=
pragma solidity >=0.4.22 <0.6.0;
contract Ballot {
struct Voter {
uint weight;
bool voted;
uint8 vote;
address delegate;
}
struct Proposal {
@jongan69
jongan69 / contracts...Cryptohoes.sol
Last active April 19, 2022 15:43
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=
pragma solidity ^0.8.2;
// Deployed Contract to BSC for DEMO: https://www.bscscan.com/address/0xC76F08B7B723d3b0461cEc8206710cd12D71f2a2
// Github Page: https://cryptohoes.github.io/CryptoHoesICO/
contract CryptoHoes {
mapping(address => uint) public balances;
mapping(address => mapping(address => uint)) public allowance;
uint public totalSupply = 69420000 * 10 ** 18;
string public name = "CryptoHoes";
@jongan69
jongan69 / VRFD20.sol
Created November 12, 2022 16:52
Chainlink VRF Contract for rolling 20 sided die
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.7;
import '@chainlink/contracts/src/v0.8/interfaces/VRFCoordinatorV2Interface.sol';
import '@chainlink/contracts/src/v0.8/VRFConsumerBaseV2.sol';
/**
* @notice A Chainlink VRF consumer which uses randomness to mimic the rolling
* of a 20 sided dice
*/
@jongan69
jongan69 / TaskContract.sol
Created November 13, 2022 19: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.7+commit.e28d00a7.js&optimize=false&runs=200&gist=
// Todo App Task Contract
pragma solidity 0.8.6;
contract TaskContract {
event AddTask(address recipient, unit taskId)
event Delete(uint taskId, bool isDeleted)
struct Task {
uint id;
string taskText;
@jongan69
jongan69 / docs.chain.link...Todo...artifacts...TaskContract.json
Created November 13, 2022 19:41
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.6+commit.11564f7e.js&optimize=false&runs=200&gist=
@jongan69
jongan69 / docs.chain.link...Todo...artifacts...TaskContract.json
Created November 13, 2022 19:41
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.6+commit.11564f7e.js&optimize=false&runs=200&gist=
@jongan69
jongan69 / .deps...npm...@chainlink...contracts...src...v0.8...Chainlink.sol
Created November 13, 2022 19: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.8.6+commit.11564f7e.js&optimize=false&runs=200&gist=
@jongan69
jongan69 / docs.chain.link...Todo...TaskContract.sol
Created November 13, 2022 19: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.8.6+commit.11564f7e.js&optimize=false&runs=200&gist=
@jongan69
jongan69 / .deps...npm...@chainlink...contracts...src...v0.8...Chainlink.sol
Created November 14, 2022 22:54
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=
@jongan69
jongan69 / removeYouTubeTranscriptTimestamp.js
Created November 23, 2022 19:02
Console Script for Removing YouTube Video Transcript Timestamps
javascript:document.querySelectorAll('div.segment-start-offset').forEach(r => r.remove())