Skip to content

Instantly share code, notes, and snippets.

Paul Razvan Berg PaulRBerg

Block or report user

Report or block PaulRBerg

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View stream.js
import gql from "graphql-tag";
export const BUNDLE = `
{
cash
percentage
units
wei
}
`;
@PaulRBerg
PaulRBerg / index.js
Created Nov 10, 2019
Exporting multiple components
View index.js
export { default as BorderedCross } from "./BorderedCross";
export { default as Modal } from "./Modal";
export { default as ProgressBar } from "./ProgressBar";
export { default as ProgressBarSvg } from "./Stream/ProgressBar";
export { default as Spacer } from "./Spacer";
export { default as Spinner } from "./Spinner";
export { default as Stream } from "./Stream";
export { default as Table } from "./Table";
export { default as TitleAndBorderedCross } from "./TitleAndBorderedCross";
export { default as TokenLogo } from "./TokenLogo";
View Web3Status.js
import React, { useCallback, useEffect, useRef, useState } from "react";
import Jazzicon from "jazzicon";
import styled, { useTheme } from "styled-components";
import typy from "typy";
import { Activity, User } from "react-feather";
import { darken } from "polished";
import { ethers } from "ethers";
import { shortenAddress } from "@sablier/utils";
import { useTranslation } from "react-i18next";
@PaulRBerg
PaulRBerg / .gitignore_global
Created Nov 8, 2019
Global .gitignore file
View .gitignore_global
# Direnv files
.env
.envrc
# Files that might appear on external disks
.Spotlight-V100
.Trashes
# Dotfiles
.extra
@PaulRBerg
PaulRBerg / CTokenManger.sol
Created Sep 29, 2019
Source code for the CTokenManager contract from the Sablier codebase
View CTokenManger.sol
// File: @sablier/shared-contracts/interfaces/ICERC20.sol
pragma solidity 0.5.11;
/**
* @title CERC20 interface
* @author Sablier
* @dev See https://compound.finance/developers
*/
View ErrorReporter.sol
pragma solidity 0.5.10;
contract ComptrollerErrorReporter {
enum Error {
NO_ERROR,
UNAUTHORIZED,
COMPTROLLER_MISMATCH,
INSUFFICIENT_SHORTFALL,
INSUFFICIENT_LIQUIDITY,
INVALID_CLOSE_FACTOR,
@PaulRBerg
PaulRBerg / solcovBug.txt
Created Aug 22, 2019
Logs for the @0x/sol-coverage bug
View solcovBug.txt
Config {
_deepCopy: [ 'compilers' ],
_values:
{ truffle_directory:
'/Users/paulrberg/Projects/Sablier/Sablier/packages/payroll/node_modules/truffle',
working_directory: '/Users/paulrberg/Projects/Sablier/Sablier/packages/payroll',
network: 'development',
networks:
{ development: [Object],
kovan: [Object],
View beforeAfterEach.js
describe("when the stream did start but not end", function() {
const amount = new BigNumber(5).multipliedBy(1e18).toString(10);
beforeEach(async function() {
await web3.utils.advanceBlockAtTime(
now
.plus(STANDARD_TIME_OFFSET)
.plus(5)
.toNumber(),
);
View makeWithdrawalFix.js
balance.should.bignumber.satisfy(function(num) {
return (
num.isEqualTo(newBalance.minus(amount)) || num.isEqualTo(newBalance.minus(amount).plus(ONE_UNIT))
);
});
View snapshotFunctions.js
takeSnapshot = async () => {
return new Promise((resolve, reject) => {
web3.currentProvider.send(
{
jsonrpc: "2.0",
method: "evm_snapshot",
id: new Date().getTime(),
},
(err, snapshotId) => {
if (err) {
You can’t perform that action at this time.