Skip to content

Instantly share code, notes, and snippets.

View korrio's full-sized avatar
👽

kOrriO korrio

👽
  • Hal Finney Co.,Ltd.
  • mempool
  • X @korrio
View GitHub Profile
@korrio
korrio / slot.js
Created December 4, 2022 04:15
slot.js
This file has been truncated, but you can view the full file.
(function(t, e, i) {
function n(i) {
var r = e[i];
if (!r) {
var s = t[i];
if (!s)
return;
var a = {};
r = e[i] = {
exports: a
@korrio
korrio / console.js
Created October 25, 2022 09:15
Add timestamp to all subsequent console.logs
// Add timestamp to all subsequent console.logs
// One little two little three little dependency injections....
const origLog = console.log;
console.log = function (obj, ...placeholders) {
if (typeof obj === "string")
placeholders.unshift("[" + new Date().toISOString() + "] " + obj);
else {
// This handles console.log( object )
placeholders.unshift(obj);
placeholders.unshift("[" + new Date().toISOString() + "] %j");
@korrio
korrio / OnlyFans.sol
Created September 18, 2022 04:03
OnlyFans.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.13;
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
function _msgData() internal view virtual returns (bytes calldata) {
return msg.data;
@korrio
korrio / random.sol
Last active July 6, 2022 06:31
random.sol
pragma solidity ^0.6.12;
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
function mod(uint256 a, uint256 b) internal pure returns (uint256) {
@korrio
korrio / ipfsPublish.js
Created July 5, 2022 08:54
ipfsPublish.js
const fetch = require("node-fetch");
async function ipfsPublish(fileName, data) {
const buffer = await Buffer.from(data);
return new Promise((resolve, reject) => {
fetch("https://ipfs.kleros.io/add", {
method: "POST",
body: JSON.stringify({
fileName,
@korrio
korrio / ACL.sol
Created May 26, 2022 05:01
ACL.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.4;
import "@openzeppelin/contracts/token/ERC721/ERC721.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/utils/Counters.sol";
contract MyToken is ERC721, Ownable {
mapping(address => bool) public minters;
@korrio
korrio / BAYC.sol
Created May 26, 2022 03:57
BAYC.sol
/**
*Submitted for verification at Etherscan.io on 2021-04-22
*/
// File: @openzeppelin/contracts/utils/Context.sol
// SPDX-License-Identifier: MIT
pragma solidity >=0.6.0 <0.8.0;
@korrio
korrio / SimpleBankWithCDGToken.sol
Created May 26, 2022 03:30
SimpleBankWithCDGToken.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.6.0;
library SafeMath {
/**
* @dev Returns the addition of two unsigned integers, reverting on
* overflow.
*
* Counterpart to Solidity's `+` operator.
@korrio
korrio / SimpleBankWithERC20.sol
Created May 26, 2022 02:38
SimpleBankWithERC20.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.6.0;
/**
* @dev Interface of the ERC20 standard as defined in the EIP.
*/
interface IERC20 {
/**
* @dev Returns the amount of tokens in existence.
@korrio
korrio / YourContract.sol
Last active May 25, 2022 04:30
YourContract.sol
pragma solidity >=0.8.0 <0.9.0;
//SPDX-License-Identifier: MIT
import "hardhat/console.sol";
// import "@openzeppelin/contracts/access/Ownable.sol";
// https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/access/Ownable.sol
contract YourContract {
event SetPurpose(address sender, string purpose);