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 keccak256 from "keccak256"; | |
import { MerkleTree } from "merkletreejs"; | |
import fs from "fs"; | |
const leafValues = []; | |
let tree; | |
let root; | |
/** | |
* Creates a new file called 'MerkleTree.txt' that contains |
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
pragma solidity 0.8.0; | |
// We need some util functions for strings. | |
import "@openzeppelin/contracts/utils/Strings.sol"; | |
import "@openzeppelin/contracts/token/ERC721/extensions/ERC721URIStorage.sol"; | |
import "@openzeppelin/contracts/utils/Counters.sol"; | |
import "hardhat/console.sol"; | |
contract MyEpicNFT is ERC721URIStorage { |
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
contract PseudoRandom { | |
function abiEncode(string memory stringInput) public view returns (bytes memory) { | |
return abi.encode(stringInput, msg.sender, block.timestamp); | |
} | |
function kHash(bytes memory bytesInput) public pure returns (uint) { | |
return uint(keccak256(bytesInput)); | |
} | |
function random(string memory input, uint arrayLength) public view returns (uint) { |
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 React, { useEffect, useState } from "react"; | |
import { ethers } from "ethers"; | |
import './App.css'; | |
import wavePortal from './utils/WavePortal.json'; | |
const App = () => { | |
const [currentAccount, setCurrentAccount] = useState(""); | |
const [allWaves, setAllWaves] = useState([]); | |
const contractAddress = "0xd5f08a0ae197482FA808cE84E00E97d940dBD26E"; |
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
class TestReadOnly { | |
readonly testProp: string = "sup man"; | |
constructor(newValue?: string) { | |
if (newValue !== undefined) { | |
this.testProp = newValue; | |
} | |
} | |
} |
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
contract CarCollection { | |
struct Car { | |
string name; | |
bool owned; | |
string color; | |
} | |
Car[] public cars; |