NOTE: this also downgrads webpack to version 4
npm remove react react-dom react-scripts
npm add react@^17.0.2 react-dom@^17.0.2 react-scripts@^4.0.3
await this.getProvider().request({ | |
method: "wallet_requestPermissions", | |
params: [ | |
{ | |
eth_accounts: {} | |
} | |
] | |
}); |
// SPDX-License-Identifier: BSD-3-Clause | |
pragma solidity ^0.8.17; | |
import { EnumerableMap } from "@openzeppelin/contracts/utils/structs/EnumerableMap.sol"; | |
import { EnumerableSet } from "@openzeppelin/contracts/utils/structs/EnumerableSet.sol"; | |
abstract contract ERC165 { | |
// slot 0 | |
mapping(bytes4 => bool) private _supportedInterfaces; |
const webpack = require("webpack"); | |
module.exports = function override(config) { | |
const fallback = config.resolve.fallback || {}; | |
Object.assign(fallback, { | |
// assert: require.resolve("assert"), | |
// crypto: require.resolve("crypto-browserify"), | |
https: require.resolve("https-browserify"), | |
os: require.resolve("os-browserify"), | |
stream: require.resolve("stream-browserify"), |
// SPDX-License-Identifier: MIT | |
pragma solidity ^0.8.9; | |
import "@openzeppelin/contracts/utils/cryptography/MerkleProof.sol"; | |
contract Merkle{ | |
bytes32 public merkleRoot = ""; | |
// TODO: implement a setter |
"use strict"; | |
const Web3 = require("web3"); | |
(async () => { | |
const web3 = new Web3("https://mainnet.infura.io/v3/e7b52fa01b064e1eb3b6aa231e9ca335"); | |
const contractAddress = "0x8661cD0C4A3fD3Dc6B31cD24B20368851749Df00"; |
// SPDX-License-Identifier: MIT | |
pragma solidity ^0.8.9; | |
import "@openzeppelin/contracts/proxy/Proxy.sol"; | |
contract Diamond is Proxy{ | |
mapping(bytes4 => address) public implementations; | |
function register( bytes4 selector, address impl ) external { |
/* | |
npx hardhat compile | |
npx hardhat test | |
truffle deploy --network rinkeby --contract=UntamedMatriarcks | tee notes/UntamedMatriarcks-rinkeby.txt | |
truffle run verify WGMIOwl --network rinkeby | |
truffle deploy --network mainnet --contract=BitBotSociety | |
truffle run verify BitBotSociety --network mainnet |
function remove(string calldata input) external pure returns(bytes memory result, uint256 resultLength){ | |
//bit mask | |
bytes1 precheck = bytes1(" "); | |
uint256 needlesLength = 3; | |
bytes1[] memory needles = new bytes1[](needlesLength); | |
needles[0] = bytes1(" "); // 0010 0000, 32, 20 | |
needles[1] = bytes1("#"); // 0010 0111, 35, 23 | |
needles[2] = bytes1("&"); // 0010 1011, 38, 26 |
function toString(uint256 value) internal pure returns (string memory) { | |
// Inspired by OraclizeAPI's implementation - MIT licence | |
// https://github.com/oraclize/ethereum-api/blob/b42146b063c7d6ee1358846c198246239e9360e8/oraclizeAPI_0.4.25.sol | |
if (value == 0) { | |
return "0"; | |
} | |
uint256 temp = value; | |
uint256 digits; | |
while (temp != 0) { |