Skip to content

Instantly share code, notes, and snippets.

Avatar
🎯
Focusing

Graeme graemecode

🎯
Focusing
View GitHub Profile
View ERC20Upgrader.sol
// SPDX-License-Identifier: GPL-3.0-or-later
pragma solidity 0.8.6;
import {IERC20} from "../../external/interface/IERC20.sol";
/**
* @title ERC20Upgrader
* @author MirrorXYZ
* @notice This contract allows swapping a legacy ERC20 token for an upgraded one.
*/
View ZoraColdieAuctionReference.sol
//SPDX-License-Identifier: GPL-3.0-or-later
pragma solidity 0.6.8;
pragma experimental ABIEncoderV2;
import {ERC721} from "@openzeppelin/contracts/token/ERC721/ERC721.sol";
/**
* @title ZoraColdieAuctionReference
* @author Graeme (@strangechances) from MirrorXYZ
*
@graemecode
graemecode / Crowdfund.sol
Last active Oct 3, 2021
Crowdfunding NFTs with Zora
View Crowdfund.sol
//SPDX-License-Identifier: GPL-3.0-or-later
pragma solidity 0.6.8;
pragma experimental ABIEncoderV2;
import {ERC20} from "@openzeppelin/contracts/token/ERC20/ERC20.sol";
import {
ReentrancyGuard
} from "@openzeppelin/contracts/utils/ReentrancyGuard.sol";
import {SafeMath} from "@openzeppelin/contracts/math/SafeMath.sol";
View test-upload-arweave.html
<html>
<style type="text/css">
#recent-avatars-container img {
width: 64px;
height: 64px;
margin: 5px;
}
#cropped-image-preview img {
border: 1px solid #ccc;
View example-ecs-avatar-world.html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta
name="viewport"
content="width=device-width, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0"
/>
<script type="module">
window.process = { env: { NODE_ENV: "development" } };
View example-arweave-nft-interfaces.js
export interface Entity {
id: string;
forSale: boolean,
price: number,
// A list of components
components: Component[],
}
export interface Component {
// STUB.
@graemecode
graemecode / returnERC721Collateral.js
Last active Aug 31, 2018
Part 4/4 in a series on collateralizing ERC721s for loans on Dharma Protocol
View returnERC721Collateral.js
/*********************
* Setup Dharma.js *
*********************/
// Instantiate Dharma
const dharma = new Dharma();
/*****************
* Repay a Loan *
*****************/
@graemecode
graemecode / fillDebtOrder.js
Last active Aug 31, 2018
Part 3/4 in a series on collateralizing ERC721s for loans on Dharma Protocol
View fillDebtOrder.js
/*********************
* Setup Dharma.js *
*********************/
// Import Dharma from Dharma.js
import Dharma from "@dharmaprotocol/dharma.js";
// Import BigNumber.js version 5.0.0, for wrapping numbers before sending to blockchain.
import * as BigNumber from "bignumber.js";
// Instantiate Dharma
@graemecode
graemecode / createERC721DebtOrder.js
Last active Aug 31, 2018
Part 2/4 in a series on collateralizing ERC721s for loans on Dharma Protocol
View createERC721DebtOrder.js
/*********************
* Setup Dharma.js *
*********************/
// Import Dharma from Dharma.js
import Dharma from "@dharmaprotocol/dharma.js";
// Import BigNumber.js version 5.0.0, which we will use when posting numbers to the blockchain.
import * as BigNumber from "bignumber.js";
@graemecode
graemecode / mintERC721.js
Last active Aug 31, 2018
Part 1/4 in a series on collateralizing ERC721s for loans on Dharma Protocol
View mintERC721.js
/********************
* Setup Dharma.js *
*******************/
// Instantiate Dharma
const dharma = new Dharma();
/********************
* Mint an ERC721 *
*******************/