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
export function getRandomEthereumAddress(): string { | |
const length: number = 40; | |
const number: string = [...Array(length)] | |
.map(() => { | |
return Math.floor(Math.random() * 16).toString(16); | |
}) | |
.join(""); | |
return "0x" + number; | |
} |
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
{ | |
streams(where: { sender: "ADDRESS_HERE"}) { | |
id | |
deposit | |
cancellation { | |
id | |
recipientBalance | |
senderBalance | |
} | |
recipient |
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
/* Autogenerated file. Do not edit manually. */ | |
/* tslint:disable */ | |
/* eslint-disable */ | |
import { | |
ethers, | |
EventFilter, | |
Signer, | |
BigNumber, | |
BigNumberish, |
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
/* Autogenerated file. Do not edit manually. */ | |
/* tslint:disable */ | |
/* eslint-disable */ | |
export type { IOwnable } from "./IOwnable"; | |
export type { Ownable } from "./Ownable"; | |
export type { Erc20 } from "./Erc20"; | |
export type { Erc20Permit } from "./Erc20Permit"; | |
export type { Erc20Recover } from "./Erc20Recover"; | |
export type { IErc20 } from "./IErc20"; | |
export type { IErc20Permit } from "./IErc20Permit"; |
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
[ | |
{ | |
"inputs": [ | |
{ | |
"internalType": "address", | |
"name": "target", | |
"type": "address" | |
} | |
], | |
"name": "CallToNonContract", |
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
YN0000: │ /private/var/folders/24/8k48jl6d249_n_qfxwsl6xvm0000gn/T/xfs-d4fad668 STDOUT No package manager detected; defaulting to Yarn | |
➤ YN0000: │ /private/var/folders/24/8k48jl6d249_n_qfxwsl6xvm0000gn/T/xfs-d4fad668 STDOUT | |
➤ YN0000: │ /private/var/folders/24/8k48jl6d249_n_qfxwsl6xvm0000gn/T/xfs-d4fad668 STDOUT ➤ YN0000: LICENSE | |
➤ YN0000: │ /private/var/folders/24/8k48jl6d249_n_qfxwsl6xvm0000gn/T/xfs-d4fad668 STDOUT ➤ YN0000: index.js | |
➤ YN0000: │ /private/var/folders/24/8k48jl6d249_n_qfxwsl6xvm0000gn/T/xfs-d4fad668 STDOUT ➤ YN0000: package.json | |
➤ YN0000: │ /private/var/folders/24/8k48jl6d249_n_qfxwsl6xvm0000gn/T/xfs-d4fad668 STDOUT ➤ YN0000: readme.md | |
➤ YN0000: │ /private/var/folders/24/8k48jl6d249_n_qfxwsl6xvm0000gn/T/xfs-d4fad668 STDOUT ➤ YN0000: Package archive generated in /private/var/folders/24/8k48jl6d249_n_qfxwsl6xvm0000gn/T/xfs-d4fad668/package.tgz | |
➤ YN0000: │ /private/var/folders/24/8k48jl6d249_n_qfxwsl6xvm0000gn/T/xfs-d4fad668 STDOUT ➤ YN0000: Done in 0s 46ms | |
➤ YN0000: │ /private/v |
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: UNLICENSED | |
pragma solidity >=0.8.0; | |
import "@prb/math/contracts/PRBMathUD60x18.sol"; | |
contract UnsignedConsumer { | |
using PRBMathUD60x18 for uint256; | |
/// @notice Calculates x*1e18÷y while handling possible intermediary overflow. | |
function unsignedDiv(uint256 x, uint256 y) external pure returns (uint256 result) { |
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
import path from "path"; | |
import fsExtra from "fs-extra"; | |
import hre from "hardhat"; | |
import { Artifact } from "hardhat/types"; | |
const artifactsDir: string = path.join(__dirname, "..", "artifacts"); | |
const contracts: string[] = [ | |
"Admin", | |
"AdminInterface", |
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
Being in need of calculating the following numbers with 18 decimals of precision: | |
$$ | |
2^{2^{-x}}, x\in{\mathbb{N}} | |
$$ | |
I looked for what built-in symbols can help me and found [Power](https://reference.wolfram.com/language/ref/Power.html) and [NumberForm](https://reference.wolfram.com/language/ref/NumberForm.html). I tried an example: | |
```mathematica | |
NumberForm[Power[2, 2^-3], 18] |
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
/// @notice Calculates floor(a×b÷denominator) with full precision. Throws if result overflows a uint256 or denominator == 0 | |
/// @param a The multiplicand | |
/// @param b The multiplier | |
/// @param denominator The divisor | |
/// @return result The 256-bit result | |
/// @dev Credit to Remco Bloemen under MIT license https://xn--2-umb.com/21/muldiv | |
function mulDiv( | |
uint256 a, | |
uint256 b, | |
uint256 denominator |