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 { encode } from '@ethereumjs/rlp'; | |
import { ecrecover } from '@ethereumjs/util'; | |
import { keccak256 } from 'ethereum-cryptography/keccak'; | |
// tx: 0xb00b758da7b97dbeedd1ef62592b2c1427c70ca042dc51a63f3a39d8d31ebbcc | |
const chainId = 0x1n; | |
const nonce = 0x3n; | |
const maxPriorityFeePerGas = 0xf4240n; | |
const maxFeePerGas = 0x73323c225n; | |
const gasLimit = 0xdd9cn; |
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
function atkin(MAX) { | |
const SQRT_MAX = Math.floor(Math.sqrt(MAX) + 1); | |
const array = new Array(MAX).fill(false); | |
for (let x = 1; x < SQRT_MAX; x++) { | |
for (let y = 1; y < SQRT_MAX; y++) { | |
let k = 4 * x * x + y * y; | |
if ((k < MAX) && ((k % 12 === 1) || (k % 12 === 5))) { | |
array[k] = !array[k]; | |
} |
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
// create2 playground by @pldespaigne | |
// based on contract written by @miguelmota & @ricmoo | |
pragma solidity >0.4.99 <0.6.0; | |
contract Factory { | |
event Deployed(address addr, uint256 salt); | |
function deploy(bytes memory code, uint256 salt) public returns(address) { | |
address addr; |