This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// SPDX-License-Identifier: MIT | |
pragma solidity ^0.8.0; | |
import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; | |
import "@openzeppelin/contracts/utils/math/SafeMath.sol"; | |
contract MultiBeneficiaryVestingToken { | |
using SafeMath for uint256; | |
struct VestingSchedule { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[ | |
{ | |
"anonymous": false, | |
"inputs": [ | |
{ | |
"indexed": true, | |
"internalType": "address", | |
"name": "owner", | |
"type": "address" | |
}, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// contracts/Splice.sol | |
// SPDX-License-Identifier: MIT | |
pragma solidity 0.8.10; | |
import '@openzeppelin/contracts/utils/math/SafeMath.sol'; | |
contract OneOnOneNFTMarketPlace { | |
using SafeMath for uint256; | |
struct RoyaltyReceiver { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { providers } from "ethers"; | |
import React, { useContext, useEffect, useState } from "react"; | |
import WalletConnectProvider from "@walletconnect/web3-provider"; | |
import { ethers } from "ethers"; | |
import Web3Modal from "web3modal"; | |
interface IWeb3Context { | |
provider?: providers.Web3Provider; | |
signer?: ethers.Signer; | |
account?: string; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function generateTrait(trait_type, distributions, values) { | |
const sum = distributions.reduce((prv,cur) => (cur + prv), 0); | |
if (sum !== 10000) throw ("probabilites don't add up to 100%"); | |
const traitRandomness = 10000 * p5.random(); | |
let probability = 10000; | |
for (const i in distributions) { | |
probability -= distributions[i] | |
if (traitRandomness > probability) { | |
return { trait_type, value: values[i] } | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { ERC721 as ERC721Contract } from '../generated/Splice/ERC721'; | |
import { Bytes, ByteArray, ethereum } from '@graphprotocol/graph-ts'; | |
import { Splice, Style } from '../generated/schema'; | |
import { Minted, Splice as SpliceContract } from '../generated/Splice/Splice'; | |
export function handleMinted(event: Minted): void { | |
const tokenId = event.params.token_id.toString(); | |
const splice = new Splice(tokenId); | |
const spliceContract = SpliceContract.bind(event.address); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const { ethers } = require("ethers"); | |
const abi = require("./storage.abi.json"); | |
const INFURA_KEY = "..."; //get at https://infura.io/product/ethereum | |
const CONTRACT_ADDRESS = "0x7DA77f8a834369dDc5e9e47407C9746Ed55C3b72"; | |
const provider = new ethers.providers.InfuraProvider(42, INFURA_KEY); | |
const contract = new ethers.Contract(CONTRACT_ADDRESS, abi, provider); | |
(async function main() { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[ | |
{ | |
"inputs": [], | |
"stateMutability": "nonpayable", | |
"type": "constructor" | |
}, | |
{ | |
"anonymous": false, | |
"inputs": [ | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// SPDX-License-Identifier: GPL-3.0 | |
pragma solidity ^0.8; | |
import '@openzeppelin/contracts/access/Ownable.sol'; | |
contract Storage is Ownable { | |
uint256 number; | |
constructor() Ownable() {} |