Skip to content

Instantly share code, notes, and snippets.

View coindegen's full-sized avatar

CoinDegen coindegen

View GitHub Profile
// File: @openzeppelin/contracts/utils/Context.sol
// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)
pragma solidity ^0.8.0;
/**
* @dev Provides information about the current execution context, including the
* sender of the transaction and its data. While these are generally available
* via msg.sender and msg.data, they should not be accessed in such a direct
@coindegen
coindegen / bybit.js
Created December 8, 2021 05:31
bybit.js
const { WebsocketClient } = require("bybit-api")
const API_KEY = "key goes here"
const PRIVATE_KEY = "replace me"
const wsConfig = {
key: API_KEY,
secret: PRIVATE_KEY,
/*
@coindegen
coindegen / bybit.js
Last active December 8, 2021 05:30
script.js
We couldn’t find that file to show.
@coindegen
coindegen / FLURKSToken.sol
Created November 27, 2021 01:29
Boilerplate code for FLURKS token
// contracts/FLURKS.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/token/ERC20/presets/ERC20PresetMinterPauser.sol";
contract FLURKSToken is ERC20PresetMinterPauser {
constructor() ERC20PresetMinterPauser("Flurks", "FLURKS") {
_mint(msg.sender, 22000000);
}
@coindegen
coindegen / tokenDictionary.json
Last active July 17, 2021 02:03
Apple Finance token data
{
"0x44154e2de24f43700f7b7ca91085af13c481e001": {
"symbol": "aAPPLE",
"name": "Apple Wrapped APPLE",
"decimals": "8",
"underlying": "0xda8f20bf431d04a3661250f922d75e2bbe0b001c",
"exchangeRateStored": "103400641500358826504434038"
},
"0xda8f20bf431d04a3661250f922d75e2bbe0b001c": {
"symbol": "Apple",
try {
const abi = [{"inputs":[{"internalType":"contract ComptrollerInterface","name":"comptroller_","type":"address"},{"internalType":"contract InterestRateModel","name":"interestRateModel_","type":"address"},{"internalType":"uint256","name":"initialExchangeRateMantissa_","type":"uint256"},{"internalType":"string","name":"name_","type":"string"},{"internalType":"string","name":"symbol_","type":"string"},{"internalType":"uint8","name":"decimals_","type":"uint8"},{"internalType":"address payable","name":"admin_","type":"address"}],"payable":false,"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"cashPrior","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"interestAccumulated","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"borrowIndex","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"totalBorrows","type":"uint256"}],"name":"AccrueInterest","type":"event"},{"anonymous":fa