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
function dirtyRNG() public view return(uin256) { | |
return uint256(keccak256(abi.encodePacked(msg.sender, block.timestamp)); | |
} |
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.0; | |
import '@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol'; | |
import '@openzeppelin/contracts/access/Ownable.sol'; | |
contract CoolCats is ERC721Enumerable, Ownable { | |
using Strings for uint256; |
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
// Get the estimated gas from the adopt method | |
try { | |
methodGasPrice = await this.contract.methods.adopt(adoptNum).estimateGas({ | |
value: price, | |
from: account | |
}); | |
} catch (err) { | |
console.log("ERROR Method Gas Price"); | |
} |
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.7.0; | |
// @title: Stoner Cats | |
// @author: bighead.club | |
//////////////////////////////////////////////////////////////////////// | |
// // | |
// __ =^..^= // |
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
// THE GIST CONTAINS A DELIBERATE ERROR FOR THE PURPOSES | |
// OF THE ARTICLE - DO NOT BLINDLY COPY AND PASTE | |
// Combine snapshots. | |
async function combineSnapShots() { | |
// Step 1 - Gathering addresses | |
const l1 = JSON.parse(fs.readFileSync('./snapshots/cxllabsHolders.json', 'utf8')); | |
const l2 = JSON.parse(fs.readFileSync('./snapshots/ghxstHolders.json', 'utf8')); | |
const l3 = JSON.parse(fs.readFileSync('./snapshots/ghxstsCxltureHolders.json', 'utf8')); | |
const l4 = JSON.parse(fs.readFileSync('./snapshots/holders.json', 'utf8')); |
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
async function snapShot(slug, address, totalTokens) { | |
const API_KEY = "" | |
// Step 1 - Pagination | |
const pages = Math.ceil(totalTokens / 50); // Paginate to account for OpenSea api call limits. | |
let offSet = 0; | |
let num = 0; | |
let totalOwned = 0; | |
let foundTokens = 0; |
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
// THE GIST CONTAINS A DELIBERATE ERROR FOR THE PURPOSES | |
// OF THE ARTICLE - DO NOT BLINDLY COPY AND PASTE | |
async getAllHolders() { | |
// Step 1 - Get the total population | |
const totalSupply = await this.contract.methods.totalSupply().call(); | |
// Step 2 - Iterate over live tokens and log owners | |
const holder = {}; | |
for(let i = 0; i < totalSupply; i++){ |