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 handleMintClick = async (evt) => { | |
if( evt && evt.cancelable ) | |
evt.preventDefault(); | |
try{ | |
//usually returns a BN (BigNumber) | |
const priceBN = await contract.methods.PRICE().call(); | |
const quantityBN = new Web3.utils.BN( `${quantity}` ); | |
const valueBN = priceBN.mul( quantityBN ); |
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: BSD-3-Clause | |
pragma solidity ^0.8.0; | |
/************************ | |
* @author: squeebo_nft * | |
************************/ | |
import "@openzeppelin/contracts/utils/Strings.sol"; |
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: BSD-3 | |
pragma solidity ^0.8.0; | |
import "@openzeppelin/contracts/access/Ownable.sol"; | |
import "@openzeppelin/contracts/utils/Address.sol"; | |
interface IERC20 { | |
function balanceOf(address account) external view returns (uint256); | |
function transfer(address to, uint256 amount) external returns (bool); | |
} |
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
//Step 1: Create a signer | |
const Web3 = require( 'web3' ); | |
const web3 = new Web3(); | |
const account = web3.eth.accounts.create(); | |
console.log( account ); | |
/* | |
{ |
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: BSD-3 | |
pragma solidity ^0.8.0; | |
import "@openzeppelin/contracts/access/Ownable.sol"; | |
import "@openzeppelin/contracts/utils/cryptography/ECDSA.sol"; | |
contract Signed is Ownable{ | |
using ECDSA for bytes32; |
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/ERC721/IERC721.sol"; | |
import './Signed.sol'; | |
contract SignedData2B is IERC721, Signed{ | |
struct MintParams{ |
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 { assert } = require("hardhat"); | |
const SignedData2B = artifacts.require( 'contracts/SignedData2B.sol' ); | |
const Web3 = hre.Web3; | |
const accounts = []; | |
let owner, signedData; | |
contract( 'Step2b', async function( accts ){ | |
owner = accts.shift(); |
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
interface DefaultReverseResolver{ | |
function name(bytes32 node) external view returns (string memory); | |
} | |
interface ENS{ | |
function resolver(bytes32 node) external view returns (address); | |
} | |
interface ReverseRegistrar{ | |
function node(address addr) external pure returns (bytes32); |
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
<?php | |
error_reporting( E_ALL ); | |
ini_set( 'display_errors', 1 ); | |
$API_KEY = 'xxxxxxxxxxxxxxxx'; | |
$COLLECTION = '0xacfa101ece167f1894150e090d9471aee2dd3041'; | |
$ch = curl_init(); | |
$fd = tmpfile(); | |
for( $i = 0; $i < 7777; $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
//app.use() adds a middleware | |
//middleware tries to handle every request | |
//this middleware is used for logging | |
app.use(( req, res, next ) => { | |
let request = req.method.toUpperCase() +' '+ req.url | |
if( Object.keys( req.query ).length ){ | |
request += '?'+ querystring.stringify( req.query ) | |
} |
OlderNewer