contract MinimalProxyFactory {
address[] public proxies;
function deployClone(address _implementationContract) external returns (address) {
// convert the address to 20 bytes
bytes20 implementationContractInBytes = bytes20(_implementationContract);
//address to assign a cloned proxy
address proxy;
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 Web3 = require('web3'); | |
// Initialize web3 instance | |
const web3 = new Web3('your rpc endpoint'); | |
async function getNFTsOwnedByAddress(contractAddress, ownerAddress) { | |
// Create a new contract instance | |
const contract = new web3.eth.Contract([ | |
{ | |
"anonymous": false, |
contract ExampleContract {
// We will explain the significance of the indexed parameter later.
event ExampleEvent(address indexed sender, uint256 someValue);
function exampleFunction(uint256 someValue) public {
emit ExampleEvent(sender, someValue);
}
}
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 { useAccount, useConnect } from "wagmi"; | |
import SendFunds from "./RareSend"; | |
import { useEffect } from "react"; | |
import styles from "@/styles/Home.module.css"; | |
import { MintNFT } from "./mint"; | |
export default function Home() { | |
const { connect, connectors } = useConnect(); | |
const { isConnected } = useAccount(); |
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
// Initialize ethers.js and wagmi dependencies | |
import { ethers } from "ethers"; | |
import * as React from "react"; | |
import { | |
usePrepareContractWrite, | |
useContractWrite, | |
useWaitForTransaction, | |
} from "wagmi"; | |
import styles from "@/styles/Home.module.css"; |
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 { useAccount, useConnect } from "wagmi"; | |
import SendFunds from "./RareSend"; | |
import { useEffect } from "react"; | |
import styles from "@/styles/Home.module.css"; | |
export default function Home() { | |
{ | |
/* some code... */ | |
} |
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 { parseEther } from "ethers/lib/utils.js"; | |
import React, { useState } from "react"; | |
import { useDebounce } from "use-debounce"; | |
import { usePrepareSendTransaction, useSendTransaction } from "wagmi"; | |
import styles from "@/styles/Home.module.css"; | |
// what this does is simply disable the SendFunds function if the value passed is false | |
interface SendFundsProps { | |
disabled?: boolean; | |
} |
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
.status { | |
text-align: left; | |
margin: 0px; | |
font-family: "Inter Medium", sans-serif; | |
} | |
.maincontainer { | |
position: absolute; | |
top: 50%; | |
left: 50%; |
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 { useAccount, useConnect } from "wagmi"; | |
import { useEffect } from "react"; | |
import styles from "@/styles/Home.module.css"; | |
export default function Home() { | |
const { connect, connectors } = useConnect(); | |
const { isConnected } = useAccount(); | |
useEffect(() => { | |
console.log( |
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 "@/styles/globals.css"; // CSS doesnt really matter now | |
import type { AppProps } from "next/app"; | |
import { WagmiConfig, configureChains, createClient, mainnet } from "wagmi"; | |
import { publicProvider } from "wagmi/providers/public"; | |
import { polygonMumbai } from "wagmi/chains"; | |
import { CoinbaseWalletConnector } from 'wagmi/connectors/coinbaseWallet' | |
import { InjectedConnector } from 'wagmi/connectors/injected' | |
import { MetaMaskConnector } from 'wagmi/connectors/metaMask' | |
import { WalletConnectConnector } from 'wagmi/connectors/walletConnect' |
NewerOlder