Skip to content

Instantly share code, notes, and snippets.

View graemecode's full-sized avatar
🎯
Focusing

Graeme graemecode

🎯
Focusing
View GitHub Profile

Keybase proof

I hereby claim:

  • I am graemecode on github.
  • I am graeme_dharma (https://keybase.io/graeme_dharma) on keybase.
  • I have a public key ASCz6r8-h8x4z_RtOkJPll6bARkNKTZukaHVKkqiuP6qiwo

To claim this, I am signing this object:

@graemecode
graemecode / mintERC721.js
Last active August 31, 2018 08:25
Part 1/4 in a series on collateralizing ERC721s for loans on Dharma Protocol
/********************
* Setup Dharma.js *
*******************/
// Instantiate Dharma
const dharma = new Dharma();
/********************
* Mint an ERC721 *
*******************/
@graemecode
graemecode / createERC721DebtOrder.js
Last active August 31, 2018 08:25
Part 2/4 in a series on collateralizing ERC721s for loans on Dharma Protocol
/*********************
* 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 / fillDebtOrder.js
Last active August 31, 2018 08:25
Part 3/4 in a series on collateralizing ERC721s for loans on Dharma Protocol
/*********************
* 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 / returnERC721Collateral.js
Last active August 31, 2018 08:26
Part 4/4 in a series on collateralizing ERC721s for loans on Dharma Protocol
/*********************
* Setup Dharma.js *
*********************/
// Instantiate Dharma
const dharma = new Dharma();
/*****************
* Repay a Loan *
*****************/
export interface Entity {
id: string;
forSale: boolean,
price: number,
// A list of components
components: Component[],
}
export interface Component {
// STUB.
<!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" } };
<html>
<style type="text/css">
#recent-avatars-container img {
width: 64px;
height: 64px;
margin: 5px;
}
#cropped-image-preview img {
border: 1px solid #ccc;
@graemecode
graemecode / Crowdfund.sol
Last active October 3, 2021 19:08
Crowdfunding NFTs with Zora
//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";
//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
*