Skip to content

Instantly share code, notes, and snippets.

View adamgobes's full-sized avatar

Adam Gobran adamgobes

View GitHub Profile
pragma solidity 0.8.10;
interface INFTPreBidder {
/**
* @notice Emitted when the bid is created
* @param id The id of the new bid
* @param bidder msg.sender
* @param collateralContract The contract address of the collateral NFT
* @param collateralTokenId The token id of the collateral NFT, can be a negative number to indicate bidder doesn't care which token ID
* @param loanAssetContract The contract address of the loan asset
@adamgobes
adamgobes / batchCreateLoans.js
Last active January 28, 2022 20:36
Batch create loans for NFT pawn shop
async function main() {
const [deployer] = await ethers.getSigners();
console.log(
"Running batch create loans script with signer:",
await deployer.getAddress()
);
const NFTLoanFacilitatorContract = await ethers.getContractFactory("NFTLoanFacilitator");
const facilitator = await NFTLoanFacilitatorContract.attach(
"0x2b804a97b2b3710b71ed1764eb6fa36233440738"
// SPDX-License-Identifier: GPL-3.0
pragma solidity 0.6.8;
pragma experimental ABIEncoderV2;
import {SafeMath} from "@openzeppelin/contracts/math/SafeMath.sol";
import {IERC721} from "@openzeppelin/contracts/token/ERC721/IERC721.sol";
import {IERC20} from "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import {SafeERC20} from "@openzeppelin/contracts/token/ERC20/SafeERC20.sol";
import {Decimal} from "./Decimal.sol";
// SPDX-License-Identifier: GPL-3.0
pragma solidity 0.6.8;
pragma experimental ABIEncoderV2;
import { SafeMath } from "@openzeppelin/contracts/math/SafeMath.sol";
import { IERC721, IERC165 } from "@openzeppelin/contracts/token/ERC721/IERC721.sol";
import { ReentrancyGuard } from "@openzeppelin/contracts/utils/ReentrancyGuard.sol";
import {IERC20} from "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import { SafeERC20 } from "@openzeppelin/contracts/token/ERC20/SafeERC20.sol";
@adamgobes
adamgobes / IAuctionHouse.sol
Last active December 14, 2021 19:21
IAuctionHouse Zora Contract
// SPDX-License-Identifier: GPL-3.0
pragma solidity 0.6.8;
pragma experimental ABIEncoderV2;
/**
* @title Interface for Auction Houses
*/
interface IAuctionHouse {
struct Auction {
contract WyvernExchange is Exchange {
function calculateMatchPrice_(
address[14] addrs,
uint[18] uints,
uint8[8] feeMethodsSidesKindsHowToCalls,
bytes calldataBuy,
bytes calldataSell,
bytes replacementPatternBuy,
bytes replacementPatternSell,
bytes staticExtradataBuy,
@adamgobes
adamgobes / Wyvern.sol
Created December 3, 2021 21:20
Opensea Wyvern Exchange Contract
/**
*Submitted for verification at Etherscan.io on 2018-06-12
*/
pragma solidity ^0.4.13;
library SafeMath {
/**
* @dev Multiplies two numbers, throws on overflow.