Skip to content

Instantly share code, notes, and snippets.


Peter Petrovics szerintedmi

  • Equal Experts
  • London, UK
View GitHub Profile
szerintedmi / jest.config.js
Created April 19, 2021 17:39
jest.config.js : TypeScript with jest-environment-puppeteer
View jest.config.js
/* Setup with ts-jest preset then overwrite the rest with jest-environment-puppeteer
* so we can use typescript for puppeteer tests.
module.exports = {
preset: "ts-jest",
globalSetup: "jest-environment-puppeteer/setup",
globalTeardown: "jest-environment-puppeteer/teardown",
testEnvironment: "jest-environment-puppeteer",
setupFilesAfterEnv: ["expect-puppeteer"],
szerintedmi / travis.output
Created May 18, 2019 09:32
node gyp build error
View travis.output
[5/5] Building fresh packages...
error /home/travis/build/Augmint/augmint-web/node_modules/sha3: Command failed.
Exit code: 1
Command: node-gyp rebuild
Directory: /home/travis/build/Augmint/augmint-web/node_modules/sha3
gyp info it worked if it ends with ok
gyp info using node-gyp@3.8.0
gyp info using node@10.15.3 | linux | x64
View Loan.ts
import BigNumber from "bignumber.js";
import { Contract } from "./Contract";
export interface ILoanProduct {
id: number;
termInSecs: number;
termInDays: number;
termText: string;
View web3jse2eTest.output
Web3 e2e tests
Web3 integration tests for: http://ganache:8545
✓ should be able to make a web3 instance
✓ should be able to get a list of accounts (157ms)
Web3 integration tests for: http://geth:8545
✓ should be able to make a web3 instance
✓ should be able to get a list of accounts
Web3 integration tests for: ws://geth:8546
✓ should be able to make a web3 instance
connection not open on send()
szerintedmi / deployContract.js
Last active April 5, 2019 16:18
barebone script to deploy a solidity contract
View deployContract.js
const Web3 = require("web3");
const web3 = new Web3(
defaultBlock: "latest",
defaultGas: 5000000,
defaultGasPrice: 1,
transactionBlockTimeout: 50,
szerintedmi / sendTx.js
Last active May 3, 2019 14:05
barebone demonstration of web3 tx not resolving issue
View sendTx.js
const Web3 = require("web3");
const OPTIONS = {
defaultBlock: "latest",
transactionConfirmationBlocks: 1,
transactionBlockTimeout: 5
const web3 = new Web3(
new Web3.providers.WebsocketProvider("ws://localhost:8545"),
szerintedmi / Rink0011_adjustInterest.sol
Created September 7, 2018 10:51
View Rink0011_adjustInterest.sol
/* adjust lock & loan interest rates, increase allowedLtdDifferenceAmount */
pragma solidity 0.4.24;
import "../../LoanManager.sol";
import "../../Locker.sol";
import "../../MonetarySupervisor.sol";
contract Rink0011_adjustInterest {
View Rink0010_changeDefaultingFee.sol
/* set defaulting fee from 5% to 10% */
pragma solidity 0.4.24;
import "../../LoanManager.sol";
contract Rink0010_changeDefaultingFee {
address constant stabilityBoardProxyAddress = 0x44022C28766652EC5901790E53CEd7A79a19c10A;
szerintedmi / Main0006_initNewLocker.sol
Created July 5, 2018 15:39
View Main0006_initNewLocker.sol
/* grant permissions & add lock products to new locker contract
It sets up the products with different interest rates than in old locker and
introduces two new lock products: 90 days and 180 days term
NB: once UI is switched over to new locker, products in old locker
should be disabled to prevent ppl keep using locker directly
pragma solidity 0.4.24;
import "../../generic/MultiSig.sol";
szerintedmi / 23_executeRink0004_and_revokeOldPermissions.js
Created June 10, 2018 13:45
View 23_executeRink0004_and_revokeOldPermissions.js
* Execute Rink0004_migrate_MSv0_5_0.sol (already signed by stability board)
* and switch to new MS and rates contracts and revoke permissions from old contracts
* NB:
* - switch contracts can executed from deployer account for now because old contracts didn't have multiSig.
* In future these must be set via StabilityBoardProxy, ie. be part of the migrate script
const Migrations = artifacts.require("./Migrations.sol");
const Rink0004_migrate_MSv0_5_0 = artifacts.require("./Rink0004_migrate_MSv0_5_0.sol");
const StabilityBoardProxy = artifacts.require("./StabilityBoardProxy.sol");