Skip to content

Instantly share code, notes, and snippets.

import { makeADR36AminoSignDoc, serializeSignDoc } from "@keplr-wallet/cosmos";
import { Hash, PrivKeySecp256k1 } from "@keplr-wallet/crypto";
function signArbFn(address: string, privateKey: string) {
const cryptoPrivKey = new PrivKeySecp256k1(fromHex(privateKey));
return async (message: string | Uint8Array): Promise<string> => {
const signDoc = makeADR36AminoSignDoc(address, message);
const serializedSignDoc = serializeSignDoc(signDoc);
const digest = Hash.sha256(serializedSignDoc);
const {send: transportGRPC} = require("@onflow/transport-grpc")
const fcl = require("@onflow/fcl")
const {TransactionAuthorizer} = require("@freshmint/core")
const {
HashAlgorithm,
InMemoryECSigner,
SignatureAlgorithm,
InMemoryECPrivateKey,
} = require("@freshmint/core/crypto")
import FungibleToken from 0xf233dcee88fe0abe
import FiatToken from 0xb19436aae4d94622
transaction {
prepare(signer: AuthAccount) {
// Return early if the account already stores a FiatToken Vault
if signer.borrow<&FiatToken.Vault>(from: FiatToken.VaultStoragePath) != nil {
return
}
// Create a new ExampleToken Vault and put it in storage
@justinbarry
justinbarry / .gitignore
Last active March 29, 2022 16:50
Ledger Bug Example
# folders
node_modules/
dist/
.parcel-cache/
flowdb/
.exrc
.DS_Store
# file types
  1. Is the candidate comfortable working remotely?
  2. What is the expected graduation date of the candidate?
  3. Is the candidate open to 4-month or 8-month internship?
  4. If the candidate is from University of Waterloo, ask for the date that they plan to submit employer rating. (note: this is because we need to extend an offer before that date if it’s a match)
  5. Confirm the candidate’s location is US or Canada + the candidate can legally work in these two locations

Requirement Collection:

Functionality:

#!/bin/bash
((!$#)) && echo No issue number provided, command ignored! && exit 1;
TITLE=$(gh issue view $1 --json title | jq --raw-output '.title' )
ESCAPED_TITLE=$(echo "GH-$1-${TITLE// /-}" | tr -cd '[:alnum:][\-]' | cut -c1-100);
if [ `git branch --list $ESCAPED_TITLE` ]; then
git checkout $ESCAPED_TITLE;
/**
*Submitted for verification at Etherscan.io on 2020-09-14
*/
// File: @openzeppelin/contracts/GSN/Context.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.6.0;
pragma solidity 0.5.15;
pragma experimental ABIEncoderV2;
import "ROOT/trading/wrappedShareToken/WrappedShareToken.sol";
import 'ROOT/para/interfaces/IParaShareToken.sol';
/**
* @dev This is a factory that creates Wrappers around ERC1155 shareTokens generated by Augur
* @author yashnaman
* as shares on outcomes of a markets.
factory.transferCash(augurMarket, shareToken, fee, _user, address(this), _cash);
// Move 5% of cash to the balancer pool.
uint256 _cashToSendToPool = (_cash * 5 * 10**16) / 10**18;
uint _poolCashBalance = bPool.getBalance(address(cash));
uint _poolLPTokenTotalSupply = bPool.totalSupply();
uint256 _lpTokenOut = _cashToSendToPool.div(_poolCashBalance).mul(_poolLPTokenTotalSupply);
shareToken.publicBuyCompleteSets(augurMarket, _cashToSendToPool.div(numTicks));
#------------------------------------------------------------------------------
# solidity.rb
#
# Homebrew formula for solidity. Homebrew (http://brew.sh/) is
# the de-facto standard package manager for OS X, and this Ruby script
# contains the metadata used to map command-line user settings used
# with the 'brew' command onto build options.
#
# Our documentation for the solidity Homebrew setup is at:
#