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
// Interact with WETH9 contract using Hardhat network + mainnet forking | |
// #0 = No. 0 of Hardhat Network default accounts | |
// #1 = A randomly picked address | |
// Constants | |
const EXIT_SUCCESS = 0; | |
const EXIT_FAILURE = 1; | |
const weth9_address = "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2"; | |
const somebody = "0x2feb1512183545f48f6b9c5b4ebfcaf49cfca6f3"; | |
const contract_ABI = require("./contract-abi.json"); // WETH9's ABI |
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
// Please read mainnet forking tutorial at the LunDAO | |
// Constants | |
const EXIT_SUCCESS = 0; | |
const EXIT_FAILURE = 1; | |
const weth9_address = "0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2"; | |
const contract_ABI = require("./contract-abi.json"); | |
const start_block = 14379900; // The starting block number you want | |
const end_block = 14379910; // The ending block number you want |
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: GPL-3.0 | |
pragma solidity >=0.8.0 <0.9.0; | |
contract PreSaleMint { | |
address public immutable _owner; | |
mapping(address => uint256) public addressMintedBalance; // # of NFTs minted by every address | |
address[] public whitelistedAddresses; // Dynamic array version of the whitelist | |
mapping(address => bool) public whitelistedAddressesMap; // Mapping version of the whitelist | |
modifier onlyOwner() { |
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
#include <iostream> | |
#include <cmath> | |
#define SQRT_MAGIC32 0x5F375A86 | |
#define SQRT_MAGIC64 0x5FE6EB50C7B537A9 | |
using namespace std; | |
float Sqrt32(float x) { | |
uint32_t i; // The integer interpretation of x |
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 <0.9.0; // 限定 compiler version 在某一個區間較好 | |
contract donation { | |
// Data | |
struct donorinfo { | |
address[] donors; | |
mapping(address=> uint) ledger; | |
} |
NewerOlder