Component | Responsibility |
---|---|
Seed (SK.seed ) |
Generates all private keys via a pseudorandom function (PRF). |
FORS | Signs the message digest using a few-time signature scheme (bottom layer). |
WOTS+ | Signs the FORS root and hypertree layer roots (one-time signatures). |
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 { BigNumber} from "ethers"; | |
import { ethers } from "hardhat"; | |
import { mine,setStorageAt } from "@nomicfoundation/hardhat-network-helpers"; | |
/* | |
* @param account is account of the user | |
* @param token is token address | |
* @param balance is the balance you want set for the give account | |
* @param slot is slot number on which the required state variable exist(i.e: mapping of _balances) |
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
slither . --print human-summary | |
slither . --print contract-summary | |
slither . --print function-summary | |
slither . --print vars-and-auth | |
slither . --print call-graph | |
slither . --print inheritance-graph | |
slither . --print cfg |
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: Unlicense | |
pragma solidity ^0.8.0; | |
pragma abicoder v2; | |
import "@uniswap/v2-periphery/contracts/interfaces/IWETH.sol"; | |
import "@uniswap/v3-periphery/contracts/interfaces/ISwapRouter.sol"; | |
import "@uniswap/v3-core/contracts/libraries/LowGasSafeMath.sol"; | |
import "@uniswap/v3-core/contracts/interfaces/IUniswapV3Pool.sol"; | |
import "@uniswap/v3-core/contracts/interfaces/IUniswapV3Factory.sol"; | |
import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; |
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
0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE |
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
pragma solidity ^0.8.0; | |
import "hardhat/console.sol"; | |
/* | |
1. abi.encode(...) returns (bytes) : | |
ABI encodes the given arguments. Arguments can be of any type. It returns the encoded data as bytes . | |
2. abi.encodePacked(...) returns (bytes) : | |
This performs packed encoding of the given arguments. Arguments can be of any type. It returns the packed encoding of the data as bytes . | |
3. abi.encodeWithSelector(bytes4 selector, ...) returns (bytes) : | |
ABI encodes the given arguments. The first argument takes a function selector and from the second onward it takes any data type. It returns the encoded data as bytes . |
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 { network, ethers } from "hardhat"; | |
const { ethers } = require("hardhat"); | |
await network.provider.request({ | |
method: "hardhat_impersonateAccount", | |
params: ["0x..........................."], | |
}); | |
if you use hardhat-ethers |
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
curl -s https://api.github.com/users/decentraland/repos?page=1&per_page=100 | jq -r ".[].ssh_url" | xargs -L1 git clone |
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 { ethers } from "hardhat"; | |
ethers.provider.send("evm_increaseTime", [duration]); | |
ethers.provider.send("evm_mine", []); | |
await ethers.provider.send("evm_setNextBlockTimestamp", [1625097600]) | |
await ethers.provider.send("evm_mine") | |
await ethers.provider.send("hardhat_dropTransaction", [txHash]); |
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
pragma solidity 0.8.0; | |
contract Average { | |
function avg(uint256 x, uint256 y) external view returns (uint256 result) { | |
unchecked { | |
result = (x >> 1) + (y >> 1) + (x & y & 1); | |
} | |
} |
NewerOlder