This file contains hidden or 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 ipfs = ipfsClient(); // Connect to the local IPFS API | |
| import { create } from 'ipfs-http-client' | |
| import { Buffer } from 'buffer' | |
| /* configure Infura auth settings */ | |
| const projectId = "" | |
| const projectSecret = "" | |
| const auth = 'Basic ' + Buffer.from(projectId + ':' + projectSecret).toString('base64') |
This file contains hidden or 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 React from "react"; | |
| import LoginButton from "../components/LoginButton"; | |
| import LogoutButton from "../components/LogoutButton"; | |
| import {uploadJson} from "../components/upload"; | |
| import { | |
| ContentFocus, ProfileOwnedByMe,useActiveWallet, useActiveProfile, useCreatePost, useExploreProfiles | |
| } from '@lens-protocol/react-web'; | |
| async function upload(content) { | |
| const data = await uploadJson(content) |
This file contains hidden or 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
| git clone [email protected]:lens-protocol/core.git | |
| cd lens-protocol | |
| touch .env | |
| npm install | |
| npm run compile | |
| # in a new terminal window | |
| npx hardhat node | |
| # in the original terminal window |
This file contains hidden or 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.13; | |
| import "forge-std/Test.sol"; | |
| import 'src/Call.sol'; | |
| contract AuctionTest is Test { | |
| Call callContract; | |
| TestCall tCallContract; |
This file contains hidden or 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 { WebBundlr } from "@bundlr-network/client" | |
| import { providers } from "ethers" | |
| /* initialize some local state to store the bundlr instance */ | |
| const [bundlrInstance, setBundlrInstance] = useState(null) | |
| /* connect to the user's wallet */ | |
| async function connect() { | |
| await window.ethereum.request({ method: 'eth_requestAccounts' }) | |
| const provider = new providers.Web3Provider(window.ethereum) |
This file contains hidden or 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.4; | |
| import "@openzeppelin/contracts/utils/Counters.sol"; | |
| import "@openzeppelin/contracts/token/ERC721/extensions/ERC721URIStorage.sol"; | |
| import "@openzeppelin/contracts/token/ERC721/ERC721.sol"; | |
| import "hardhat/console.sol"; | |
| contract NFTMarketplace is ERC721URIStorage { |
This file contains hidden or 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 { useState } from 'react' | |
| import Head from 'next/head' | |
| import styles from '../styles/Home.module.css' | |
| import { CeramicClient } from '@ceramicnetwork/http-client' | |
| import { DID } from 'dids' | |
| import { ThreeIdConnect } from '@3id/connect' | |
| const SID = require('@self.id/web') | |
| const { EthereumAuthProvider, SelfID, WebClient } = SID |
This file contains hidden or 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 { ethers } from 'ethers' | |
| import Web3Modal from 'web3modal' | |
| import WalletConnectProvider from '@walletconnect/web3-provider' | |
| async function getWeb3Modal() { | |
| const web3Modal = new Web3Modal({ | |
| network: 'mainnet', | |
| cacheProvider: false, | |
| providerOptions: { | |
| walletconnect: { |
This file contains hidden or 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 anchor = require("@project-serum/anchor"); | |
| const assert = require("assert"); | |
| const { PublicKey } = anchor.web3; | |
| describe("blog", () => { | |
| anchor.setProvider(anchor.Provider.env()); | |
| const program = anchor.workspace.Blog; | |
| const post = anchor.web3.Keypair.generate(); |
This file contains hidden or 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
| use anchor_lang::prelude::*; | |
| declare_id!("Fg6PaFpoGXkYsidMpWTK6W2BeZ7FEfcYkg476zPFsLnS"); | |
| #[program] | |
| pub mod blog { | |
| use super::*; | |
| pub fn create_blog(ctx: Context<CreateBlog>, name: String, bump: u8) -> Result<()> { | |
| ctx.accounts.blog.name = name; |