Example inputs:
Variable | Value |
---|---|
key | the shared secret key here |
message | the message to hash here |
Reference outputs for example inputs above:
| Type | Hash |
// SPDX-License-Identifier: GPL-3.0-or-later | |
pragma solidity >=0.8.4; | |
/// @notice Simple gas-optimized multi-signature contract. | |
contract Multisig { | |
event Propose(address indexed proposer, uint256 indexed proposal); | |
event Sign(address indexed signer, uint256 indexed proposal); | |
event Execute(uint256 indexed proposal); | |
error NotSigner(); |
import { ethers } from 'ethers' | |
// To use this you need to read the Uniswap v2 contract for a pair/ | |
// PRICE pulled from priceXCumulativeLast | |
// TIMESTAMPS pulled from _blockTimestampLast in getReserves() | |
// Mock Data | |
// In a real scenario you would fetch and store price & timestamp at an interval | |
// to mirror the contract calculating the TWAP on chain | |
const price0 = '529527205677379158060966860839' |
// SPDX-License-Identifier: AGPL-3.0-or-later | |
// The ABI encoder is necessary, but older Solidity versions should work | |
pragma solidity ^0.7.0; | |
pragma experimental ABIEncoderV2; | |
// These definitions are taken from across multiple dydx contracts, and are | |
// limited to just the bare minimum necessary to make flash loans work. | |
library Types { | |
enum AssetDenomination { Wei, Par } |
<?php | |
ini_set('display_errors', 1); | |
ini_set('display_startup_errors', 1); | |
ini_set('max_execution_time', 300); //300 seconds = 5 minutes. In case if your CURL is slow and is loading too much (Can be IPv6 problem) | |
error_reporting(E_ALL); | |
define('OAUTH2_CLIENT_ID', 'PLEASE EDIT'); | |
define('OAUTH2_CLIENT_SECRET', 'PLEASE EDIT'); | |
$authorizeURL = 'https://discordapp.com/api/oauth2/authorize'; | |
$tokenURL = 'https://discordapp.com/api/oauth2/token'; | |
$apiURLBase = 'https://discordapp.com/api/users/@me'; |
#!/bin/bash | |
# ~/.bashrc: executed by bash(1) for non-login shells. | |
# kevin gallagher (@ageis) <kevingallagher@gmail.com> | |
# normally I divide this into separate files: .bashrc, .bash_profile, .bash_aliases and .bash_functions (also .bash_logout), but it's all concatenated here. | |
ulimit -s unlimited | |
export MYUID=$(id -u) | |
export USER="$(id -un)" | |
if [[ "$TILIX_ID" ]] || [[ "$VTE_VERSION" ]]; then |
// This is universal, works with Infura -- set provider accordingly | |
const ethers = require('ethers') | |
//const provider = ethers.getDefaultProvider('rinkeby') | |
const provider = new ethers.providers.JsonRpcProvider(process.env.WEB3_URL) | |
function hex_to_ascii(str1) { | |
var hex = str1.toString(); | |
var str = ''; | |
for (var n = 0; n < hex.length; n += 2) { |
Example inputs:
Variable | Value |
---|---|
key | the shared secret key here |
message | the message to hash here |
Reference outputs for example inputs above:
| Type | Hash |
function decorate(tag, template) { | |
customElements.define(tag, class extends HTMLElement { | |
constructor() { | |
super(); | |
this.attachShadow({ mode: 'open' }); | |
} | |
connectedCallback() { | |
let root = this.shadowRoot; | |
if(!root.firstChild) { |
var ethUtil = require('ethereumjs-util'); | |
var data = 'Login'; | |
var message = ethUtil.toBuffer(data); | |
var msgHash = ethUtil.hashPersonalMessage(message); | |
var privateKey = new Buffer('62debf78d596673bce224a85a90da5aecf6e781d9aadcaedd4f65586cfe670d2', "hex") | |
var sig = ethUtil.ecsign(msgHash, privateKey); | |
var signature = ethUtil.toBuffer(sig) |