diff --git a/networks/kovan-fork.json b/networks/kovan-fork.json new file mode 100644 index 000000000..9ba4a23e7 --- /dev/null +++ b/networks/kovan-fork.json @@ -0,0 +1,4 @@ +{ + "url": "https://kovan.infura.io/v3/e1a5d4d2c06a4e81945fca56d0d5d8ea", + "unlocked": ["0xA776184Fd6F545DAe5f51361dBcC9018549a9749"] +} diff --git a/networks/mainnet-abi.json b/networks/mainnet-abi.json index df2fad107..612af7a15 100644 --- a/networks/mainnet-abi.json +++ b/networks/mainnet-abi.json @@ -3974,6 +3974,614 @@ "signature": "0xdd62ed3e" } ], + "SAI": [ + { + "constant": true, + "inputs": [ + + ], + "name": "name", + "outputs": [ + { + "name": "", + "type": "bytes32" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": false, + "inputs": [ + + ], + "name": "stop", + "outputs": [ + + ], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "name": "guy", + "type": "address" + }, + { + "name": "wad", + "type": "uint256" + } + ], + "name": "approve", + "outputs": [ + { + "name": "", + "type": "bool" + } + ], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "name": "owner_", + "type": "address" + } + ], + "name": "setOwner", + "outputs": [ + + ], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": true, + "inputs": [ + + ], + "name": "totalSupply", + "outputs": [ + { + "name": "", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "name": "src", + "type": "address" + }, + { + "name": "dst", + "type": "address" + }, + { + "name": "wad", + "type": "uint256" + } + ], + "name": "transferFrom", + "outputs": [ + { + "name": "", + "type": "bool" + } + ], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": true, + "inputs": [ + + ], + "name": "decimals", + "outputs": [ + { + "name": "", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "name": "guy", + "type": "address" + }, + { + "name": "wad", + "type": "uint256" + } + ], + "name": "mint", + "outputs": [ + + ], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "name": "wad", + "type": "uint256" + } + ], + "name": "burn", + "outputs": [ + + ], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "name": "name_", + "type": "bytes32" + } + ], + "name": "setName", + "outputs": [ + + ], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": true, + "inputs": [ + { + "name": "src", + "type": "address" + } + ], + "name": "balanceOf", + "outputs": [ + { + "name": "", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [ + + ], + "name": "stopped", + "outputs": [ + { + "name": "", + "type": "bool" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "name": "authority_", + "type": "address" + } + ], + "name": "setAuthority", + "outputs": [ + + ], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": true, + "inputs": [ + + ], + "name": "owner", + "outputs": [ + { + "name": "", + "type": "address" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [ + + ], + "name": "symbol", + "outputs": [ + { + "name": "", + "type": "bytes32" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "name": "guy", + "type": "address" + }, + { + "name": "wad", + "type": "uint256" + } + ], + "name": "burn", + "outputs": [ + + ], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "name": "wad", + "type": "uint256" + } + ], + "name": "mint", + "outputs": [ + + ], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "name": "dst", + "type": "address" + }, + { + "name": "wad", + "type": "uint256" + } + ], + "name": "transfer", + "outputs": [ + { + "name": "", + "type": "bool" + } + ], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "name": "dst", + "type": "address" + }, + { + "name": "wad", + "type": "uint256" + } + ], + "name": "push", + "outputs": [ + + ], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "name": "src", + "type": "address" + }, + { + "name": "dst", + "type": "address" + }, + { + "name": "wad", + "type": "uint256" + } + ], + "name": "move", + "outputs": [ + + ], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": false, + "inputs": [ + + ], + "name": "start", + "outputs": [ + + ], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": true, + "inputs": [ + + ], + "name": "authority", + "outputs": [ + { + "name": "", + "type": "address" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "name": "guy", + "type": "address" + } + ], + "name": "approve", + "outputs": [ + { + "name": "", + "type": "bool" + } + ], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": true, + "inputs": [ + { + "name": "src", + "type": "address" + }, + { + "name": "guy", + "type": "address" + } + ], + "name": "allowance", + "outputs": [ + { + "name": "", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "name": "src", + "type": "address" + }, + { + "name": "wad", + "type": "uint256" + } + ], + "name": "pull", + "outputs": [ + + ], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "name": "symbol_", + "type": "bytes32" + } + ], + "payable": false, + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "name": "guy", + "type": "address" + }, + { + "indexed": false, + "name": "wad", + "type": "uint256" + } + ], + "name": "Mint", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "name": "guy", + "type": "address" + }, + { + "indexed": false, + "name": "wad", + "type": "uint256" + } + ], + "name": "Burn", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "name": "authority", + "type": "address" + } + ], + "name": "LogSetAuthority", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "name": "owner", + "type": "address" + } + ], + "name": "LogSetOwner", + "type": "event" + }, + { + "anonymous": true, + "inputs": [ + { + "indexed": true, + "name": "sig", + "type": "bytes4" + }, + { + "indexed": true, + "name": "guy", + "type": "address" + }, + { + "indexed": true, + "name": "foo", + "type": "bytes32" + }, + { + "indexed": true, + "name": "bar", + "type": "bytes32" + }, + { + "indexed": false, + "name": "wad", + "type": "uint256" + }, + { + "indexed": false, + "name": "fax", + "type": "bytes" + } + ], + "name": "LogNote", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "name": "src", + "type": "address" + }, + { + "indexed": true, + "name": "guy", + "type": "address" + }, + { + "indexed": false, + "name": "wad", + "type": "uint256" + } + ], + "name": "Approval", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "name": "src", + "type": "address" + }, + { + "indexed": true, + "name": "dst", + "type": "address" + }, + { + "indexed": false, + "name": "wad", + "type": "uint256" + } + ], + "name": "Transfer", + "type": "event" + } + ], "StdComptroller": [ { "constant": true, diff --git a/package.json b/package.json index 622193cbb..6a92408da 100644 --- a/package.json +++ b/package.json @@ -18,7 +18,8 @@ "license": "UNLICENSED", "devDependencies": { "bignumber.js": "8.0.1", - "ganache-core": "^2.9.0-istanbul.0", + "ganache-cli": "^6.7.0", + "ganache-core": "^2.8.0", "immutable": "^4.0.0-rc.12", "jest": "^24.9.0", "jest-cli": "^24.9.0", @@ -28,7 +29,7 @@ "solparse": "^2.2.8" }, "dependencies": { - "eth-saddle": "^0.0.25", + "eth-saddle": "^0.0.30", "truffle-hdwallet-provider": "^1.0.17", "web3": "^1.2.4" }, diff --git a/scenario/package.json b/scenario/package.json index bb96477c3..28382e643 100644 --- a/scenario/package.json +++ b/scenario/package.json @@ -4,7 +4,8 @@ "description": "The Compound Money Market", "main": "index.js", "scripts": { - "build": "./script/webpack" + "build": "./script/webpack", + "postinstall": "rm node_modules/ganache-core/typings/index.d.ts" }, "repository": "git@github.com:compound-finance/money-market.git", "author": "Compound Finance", @@ -21,15 +22,12 @@ }, "dependencies": { "bignumber.js": "8.0.1", - "eth-saddle": "^0.0.25", + "eth-saddle": "^0.0.30", "ethers": "^4.0.0-beta.1", "ganache-core": "https://github.com/trufflesuite/ganache-core.git", "immutable": "^4.0.0-rc.12", "truffle-flattener": "^1.3.0", "truffle-hdwallet-provider": "1.0.5", "web3": "^1.2.4" - }, - "resolutions": { - "scrypt.js": "https://registry.npmjs.org/@compound-finance/ethereumjs-wallet/-/ethereumjs-wallet-0.6.3.tgz" } } diff --git a/scenario/script/repl b/scenario/script/repl index 672f40042..2ec33eddd 100755 --- a/scenario/script/repl +++ b/scenario/script/repl @@ -21,6 +21,9 @@ while getopts ":hdn:e:s:vt" arg; do d) # Dry run dry_run="true" ;; + h) # Hypothetical + hypothetical="true" + ;; e) # Add variables for script (key=value,key2=value2) env_vars="$OPTARG" ;; @@ -28,10 +31,10 @@ while getopts ":hdn:e:s:vt" arg; do network=$OPTARG ;; s) # Specify a script to run - script=$OPTARG - [ ! -f "$script" ] \ - && echo "Cannot find script $script" \ + [ ! -f "$OPTARG" ] \ + && echo "Cannot find script $OPTARG" \ && exit 1 + script+=("$OPTARG") ;; t) # Don't build TSC no_tsc="true" diff --git a/scenario/src/Builder/InterestRateModelBuilder.ts b/scenario/src/Builder/InterestRateModelBuilder.ts index c6db8cdcc..94822d5b1 100644 --- a/scenario/src/Builder/InterestRateModelBuilder.ts +++ b/scenario/src/Builder/InterestRateModelBuilder.ts @@ -3,12 +3,14 @@ import {addAction, World} from '../World'; import {InterestRateModel} from '../Contract/InterestRateModel'; import {Invokation, invoke} from '../Invokation'; import { + getAddressV, getExpNumberV, getNumberV, getPercentV, getStringV, } from '../CoreValue'; import { + AddressV, EventV, NumberV, StringV, @@ -20,6 +22,7 @@ import {getContract, getTestContract} from '../Contract'; const FixedInterestRateModel = getTestContract('InterestRateModelHarness'); const WhitePaperInterestRateModel = getContract('WhitePaperInterestRateModel'); const JumpRateModel = getContract('JumpRateModel'); +const DAIInterestRateModel = getContract('DAIInterestRateModel'); export interface InterestRateModelData { invokation: Invokation @@ -47,7 +50,7 @@ export async function buildInterestRateModel(world: World, from: string, event: new Arg("rate", getPercentV), ], async (world, {name, rate}) => ({ - invokation: await FixedInterestRateModel.deploy(world, from, [rate.val]), + invokation: await FixedInterestRateModel.deploy(world, from, [rate.encode()]), name: name.val, contract: "InterestRateModelHarness", description: `Fixed rate ${rate.show()} per block` @@ -67,39 +70,66 @@ export async function buildInterestRateModel(world: World, from: string, event: new Arg("multiplier", getExpNumberV) ], async (world, {name, baseRate, multiplier}) => ({ - invokation: await WhitePaperInterestRateModel.deploy(world, from, [baseRate.val, multiplier.val]), + invokation: await WhitePaperInterestRateModel.deploy(world, from, [baseRate.encode(), multiplier.encode()]), name: name.val, contract: "WhitePaperInterestRateModel", - description: `WhitePaper baseRate=${baseRate.val} multiplier=${multiplier.val}`, + description: `WhitePaper baseRate=${baseRate.encode().toString()} multiplier=${multiplier.encode().toString()}`, base: baseRate.encode().toString(), slope: multiplier.encode().toString() }) ), - new Fetcher<{name: StringV, baseRate: NumberV, multiplier: NumberV, kink: NumberV, jump: NumberV}, InterestRateModelData>(` - #### JumpRateModel - * "JumpRateModel name: baseRate: multiplier: kink: jump:" - The Jump interest rate - * E.g. "InterestRateModel Deploy JumpRateModel MyInterestRateModel 0.05 0.2 0.90 5" - 5% base rate and 20% utilization multiplier and 5x jump at 90% utilization - `, - "JumpRateModel", - [ - new Arg("name", getStringV), - new Arg("baseRate", getExpNumberV), - new Arg("multiplier", getExpNumberV), - new Arg("kink", getExpNumberV), - new Arg("jump", getNumberV) - ], - async (world, {name, baseRate, multiplier, kink, jump}) => ({ - invokation: await JumpRateModel.deploy(world, from, [baseRate.val, multiplier.val, kink.val, jump.val]), - name: name.val, - contract: "JumpRateModel", - description: `JumpRate model baseRate=${baseRate.val} multiplier=${multiplier.val} kink=${kink.val} jump=${jump.val}`, - base: baseRate.encode().toString(), - slope: multiplier.encode().toString(), - kink: kink.encode().toString(), - jump: jump.encode().toString() - }) - ) + new Fetcher<{name: StringV, baseRate: NumberV, multiplier: NumberV, jump: NumberV, kink: NumberV}, InterestRateModelData>(` + #### JumpRateModel + + * "JumpRateModel name: baseRate: multiplier: jump: kink:" - The Jump interest rate + * E.g. "InterestRateModel Deploy JumpRateModel MyInterestRateModel 0.05 0.2 200 0.90" - 5% base rate and 20% utilization multiplier and 200% multiplier at 90% utilization + `, + "JumpRateModel", + [ + new Arg("name", getStringV), + new Arg("baseRate", getExpNumberV), + new Arg("multiplier", getExpNumberV), + new Arg("jump", getExpNumberV), + new Arg("kink", getExpNumberV) + ], + async (world, {name, baseRate, multiplier, jump, kink}) => ({ + invokation: await JumpRateModel.deploy(world, from, [baseRate.encode(), multiplier.encode(), jump.encode(), kink.val]), + name: name.val, + contract: "JumpRateModel", + description: `JumpRateModel baseRate=${baseRate.encode().toString()} multiplier=${multiplier.encode().toString()} jump=${jump.encode().toString()} kink=${kink.encode().toString()}`, + base: baseRate.encode().toString(), + slope: multiplier.encode().toString(), + jump: jump.encode().toString(), + kink: kink.encode().toString() + }) + ), + + new Fetcher<{name: StringV, jump: NumberV, kink: NumberV, pot: AddressV, jug: AddressV}, InterestRateModelData>(` + #### DAIInterestRateModel + + * "DAIInterestRateModel name: jump: kink: pot:
jug:
" - The DAI interest rate model + * E.g. "InterestRateModel Deploy DAIInterestRateModel MyInterestRateModel 200 0.90 0xPotAddress 0xJugAddress" - 200% multiplier at 90% utilization + `, + "DAIInterestRateModel", + [ + new Arg("name", getStringV), + new Arg("jump", getExpNumberV), + new Arg("kink", getExpNumberV), + new Arg("pot", getAddressV), + new Arg("jug", getAddressV) + ], + async (world, {name, jump, kink, pot, jug}) => ({ + invokation: await DAIInterestRateModel.deploy(world, from, [jump.encode(), kink.encode(), pot.val, jug.val]), + name: name.val, + contract: "DAIInterestRateModel", + description: `DAIInterestRateModel jump=${jump.encode().toString()} kink=${kink.encode().toString()} pot=${pot.val} jug=${jug.val}`, + jump: jump.encode().toString(), + kink: kink.encode().toString(), + pot: pot.val, + jug: jug.val + }) + ) ]; let interestRateModelData = await getFetcherValue("DeployInterestRateModel", fetchers, world, event); diff --git a/scenario/src/Contract/CToken.ts b/scenario/src/Contract/CToken.ts index de002101d..81742a7e4 100644 --- a/scenario/src/Contract/CToken.ts +++ b/scenario/src/Contract/CToken.ts @@ -3,6 +3,7 @@ import { Callable, Sendable } from '../Invokation'; import { encodedNumber } from '../Encoding'; export interface CTokenMethods { + _resignImplementation(): Sendable; balanceOfUnderlying(address: string): Callable; borrowBalanceCurrent(address: string): Callable; borrowBalanceStored(address: string): Callable; diff --git a/scenario/src/CoreEvent.ts b/scenario/src/CoreEvent.ts index a13e14491..97c4791ed 100644 --- a/scenario/src/CoreEvent.ts +++ b/scenario/src/CoreEvent.ts @@ -212,7 +212,7 @@ export const commands = [ new Arg('url', getStringV), new Arg('unlockedAccounts', getAddressV, { mapped: true }) ], - (world, { url, unlockedAccounts }) => fork(world, url.val, unlockedAccounts.map(v => v.val)) + async (world, { url, unlockedAccounts }) => fork(world, url.val, unlockedAccounts.map(v => v.val)) ), new View<{ networkVal: StringV; }>( diff --git a/scenario/src/Event/CTokenEvent.ts b/scenario/src/Event/CTokenEvent.ts index 1e00dd0d6..71282faea 100644 --- a/scenario/src/Event/CTokenEvent.ts +++ b/scenario/src/Event/CTokenEvent.ts @@ -21,6 +21,7 @@ import { NumberV, StringV } from '../Value'; +import { getContract } from '../Contract'; import { Arg, Command, View, processCommandEvent } from '../Command'; import { CTokenErrorReporter } from '../ErrorReporter'; import { getComptroller, getCTokenData } from '../ContractLookup'; @@ -288,17 +289,19 @@ async function setComptroller(world: World, from: string, cToken: CToken, comptr return world; } -async function becomImplementation( +async function becomeImplementation( world: World, from: string, cToken: CToken, becomeImplementationData: string ): Promise { + + const cErc20Delegate = getContract('CErc20Delegate'); + const cErc20DelegateContract = await cErc20Delegate.at(world, cToken._address); + let invokation = await invoke( world, - (cToken as CErc20Delegate).methods._becomeImplementation( - becomeImplementationData - ), + cErc20DelegateContract.methods._becomeImplementation(becomeImplementationData), from, CTokenErrorReporter ); @@ -315,6 +318,34 @@ async function becomImplementation( return world; } +async function resignImplementation( + world: World, + from: string, + cToken: CToken, +): Promise { + + const cErc20Delegate = getContract('CErc20Delegate'); + const cErc20DelegateContract = await cErc20Delegate.at(world, cToken._address); + + let invokation = await invoke( + world, + cErc20DelegateContract.methods._resignImplementation(), + from, + CTokenErrorReporter + ); + + world = addAction( + world, + `CToken ${cToken.name}: ${describeUser( + world, + from + )} initiates _resignImplementation.`, + invokation + ); + + return world; +} + async function setImplementation( world: World, from: string, @@ -735,7 +766,7 @@ export function cTokenCommands() { new Arg('becomeImplementationData', getStringV) ], (world, from, { cToken, becomeImplementationData }) => - becomImplementation( + becomeImplementation( world, from, cToken, @@ -743,6 +774,23 @@ export function cTokenCommands() { ), { namePos: 1 } ), + new Command<{cToken: CToken;}>( + ` + #### ResignImplementation + + * "CToken ResignImplementation" + * E.g. "CToken cDAI ResignImplementation" + `, + 'ResignImplementation', + [new Arg('cToken', getCTokenV)], + (world, from, { cToken }) => + resignImplementation( + world, + from, + cToken + ), + { namePos: 1 } + ), new Command<{ cToken: CErc20Delegator; implementation: AddressV; @@ -752,7 +800,7 @@ export function cTokenCommands() { ` #### SetImplementation - * "CToken SetImplementation implementation:
allowResign: becomImplementationData:" + * "CToken SetImplementation implementation:
allowResign: becomeImplementationData:" * E.g. "CToken cDAI SetImplementation (CToken cDAIDelegate Address) True "0x01234anyByTeS56789" `, 'SetImplementation', diff --git a/scenario/src/Repl.ts b/scenario/src/Repl.ts index 521c7e7c6..20ef2c18f 100644 --- a/scenario/src/Repl.ts +++ b/scenario/src/Repl.ts @@ -14,18 +14,21 @@ import {formatEvent} from './Formatter'; import {complete} from './Completer'; import {loadContracts} from './Networks'; import {accountAliases, loadAccounts} from './Accounts'; -import {getNetworkPath} from './File'; +import {getNetworkPath, readFile} from './File'; import {SuccessInvariant} from './Invariant/SuccessInvariant'; import {createInterface} from './HistoricReadline'; import {runCommand} from './Runner'; import {parse} from './Parser'; -import { getSaddle } from 'eth-saddle'; +import {forkWeb3} from './Hypothetical'; +import {getSaddle} from 'eth-saddle'; +import Web3 from 'web3'; import * as fs from 'fs'; import * as path from 'path'; const basePath = process.env.proj_root || process.cwd(); const baseScenarioPath = path.join(basePath, 'spec', 'scenario'); +const baseNetworksPath = path.join(basePath, 'networks'); function questionPromise(rl): Promise { return new Promise((resolve, reject) => { @@ -87,12 +90,12 @@ async function repl(): Promise { }); const verbose: boolean = !!process.env['verbose']; - let printer = new ReplPrinter(rl, verbose); - - const saddle = await getSaddle(network); + const hypothetical: boolean = !!process.env['hypothetical']; + let printer = new ReplPrinter(rl, verbose); let contractInfo: string[]; + let saddle = await getSaddle(network); let accounts: string[] = [saddle.account].concat(saddle.accounts).filter((x) => !!x); world = await initWorld(throwExpect, printer, saddle.web3, saddle, network, accounts, basePath); @@ -104,6 +107,32 @@ async function repl(): Promise { printer.printLine(`Network: ${network}`); + if (hypothetical) { + const forkJsonPath = path.join(baseNetworksPath, `${network}-fork.json`); + let forkJson; + + try { + let forkJsonString = fs.readFileSync(forkJsonPath, 'utf8'); + forkJson = JSON.parse(forkJsonString); + } catch (err) { + throw new Error(`Cannot read fork configuration from \`${forkJsonPath}\`, ${err}`); + } + if (!forkJson['url']) { + throw new Error(`Missing url in fork json`); + } + if (!forkJson['unlocked'] || !Array.isArray(forkJson.unlocked)) { + throw new Error(`Missing unlocked in fork json`); + } + + saddle.web3 = await forkWeb3(saddle.web3, forkJson.url, forkJson.unlocked); + saddle.accounts = forkJson.unlocked; + console.log(`Running on fork ${forkJson.url} with unlocked accounts ${forkJson.unlocked.join(', ')}`) + } else { + // Uck, we have to load accounts first..let's just see if we have any unlocked accounts + // XXX does this break something with wallet addresses? + saddle.accounts = await (new Web3(saddle.web3.currentProvider)).eth.personal.getAccounts(); + } + if (saddle.accounts.length > 0) { printer.printLine(`Accounts:`); saddle.accounts.forEach((account, i) => { @@ -123,23 +152,30 @@ async function repl(): Promise { printer.printLine(``); if (script) { - printer.printLine(`Running script: ${script}...`); - const envVars = loadEnvVars(); - const scriptData: string = fs.readFileSync(script).toString(); + const combined = script.split(',').reduce((acc, script) => { + printer.printLine(`Running script: ${script}...`); + const envVars = loadEnvVars(); + if (hypothetical) { + envVars['hypo'] = true; + } + const scriptData: string = fs.readFileSync(script).toString(); - if (Object.keys(envVars).length > 0) { - printer.printLine(`Env Vars:`); - } + if (Object.keys(envVars).length > 0) { + printer.printLine(`Env Vars:`); + } + + const replacedScript = Object.entries(envVars).reduce((data, [key, val]) => { + printer.printLine(`\t${key}: ${val}`); - const replacedScript = Object.entries(envVars).reduce((data, [key, val]) => { - printer.printLine(`\t${key}: ${val}`); + return data.split(`$${key}`).join(val); + }, scriptData); - return data.split(`$${key}`).join(val); - }, scriptData); + const finalScript = replacedScript.replace(new RegExp(/\$[\w_]+/, 'g'), 'Nothing'); - const finalScript = replacedScript.replace(new RegExp(/\$[\w_]+/, 'g'), 'Nothing'); + return [...acc, ...finalScript.split("\n")]; + }, []); - return await finalScript.split("\n").reduce(async (acc, command) => { + return await combined.reduce(async (acc, command) => { return await runCommand(await acc, command, macros); }, Promise.resolve(world)); printer.printLine(`Script complete.`); diff --git a/scenario/src/World.ts b/scenario/src/World.ts index 318a4d223..b883566aa 100644 --- a/scenario/src/World.ts +++ b/scenario/src/World.ts @@ -110,7 +110,7 @@ export class World extends Record(defaultWorldProps) { return { ...baseOpts, ...this.invokationOpts, - ...{ value: this.value ? this.value.toString() : undefined } + ...this.value ? {value: this.value.toString()} : {} }; } diff --git a/scenario/yarn.lock b/scenario/yarn.lock index b61cf15b9..2e74e12ed 100644 --- a/scenario/yarn.lock +++ b/scenario/yarn.lock @@ -386,15 +386,25 @@ resolved "https://registry.yarnpkg.com/@types/minimatch/-/minimatch-3.0.3.tgz#3dca0e3f33b200fc7d1139c0cd96c1268cadfd9d" integrity sha512-tHq6qdbT9U1IRSGf14CL0pUlULksvY9OZ+5eEgl1N7t+OA3tGvNpxJCzuKQlsNgCVwbAs670L1vcVQi8j9HjnA== -"@types/node@*", "@types/node@^12.6.1": +"@types/node@*": version "12.12.14" resolved "https://registry.yarnpkg.com/@types/node/-/node-12.12.14.tgz#1c1d6e3c75dba466e0326948d56e8bd72a1903d2" integrity sha512-u/SJDyXwuihpwjXy7hOOghagLEV1KdAST6syfnOk6QZAMzZuWZqXy5aYYZbh8Jdpd4escVFP0MvftHNDb9pruA== -"@types/node@^10.12.18", "@types/node@^10.3.2": - version "10.17.6" - resolved "https://registry.yarnpkg.com/@types/node/-/node-10.17.6.tgz#1aaabd6f6470a6ac3824ab1e94d731ca1326d93d" - integrity sha512-0a2X6cgN3RdPBL2MIlR6Lt0KlM7fOFsutuXcdglcOq6WvLnYXgPQSh0Mx6tO1KCAE8MxbHSOSTWDoUxRq+l3DA== +"@types/node@^10.12.18": + version "10.17.11" + resolved "https://registry.yarnpkg.com/@types/node/-/node-10.17.11.tgz#46ba035fb917b31c948280dbea22ab8838f386a4" + integrity sha512-dNd2pp8qTzzNLAs3O8nH3iU9DG9866KHq9L3ISPB7DOGERZN81nW/5/g/KzMJpCU8jrbCiMRBzV9/sCEdRosig== + +"@types/node@^10.3.2": + version "10.14.4" + resolved "https://registry.yarnpkg.com/@types/node/-/node-10.14.4.tgz#1c586b991457cbb58fef51bc4e0cfcfa347714b5" + integrity sha512-DT25xX/YgyPKiHFOpNuANIQIVvYEwCWXgK2jYYwqgaMrYE6+tq+DtmMwlD3drl6DJbUwtlIDnn0d7tIn/EbXBg== + +"@types/node@^12.6.1": + version "12.12.21" + resolved "https://registry.yarnpkg.com/@types/node/-/node-12.12.21.tgz#aa44a6363291c7037111c47e4661ad210aded23f" + integrity sha512-8sRGhbpU+ck1n0PGAUgVrWrWdjSW2aqNeyC15W88GRsMpSwzv6RJGlLhE7s2RhVSOdyDmxbqlWSeThq4/7xqlA== "@types/prop-types@*": version "15.7.3" @@ -2358,11 +2368,6 @@ copy-props@^2.0.1: each-props "^1.3.0" is-plain-object "^2.0.1" -core-js-pure@^3.0.1: - version "3.6.4" - resolved "https://registry.yarnpkg.com/core-js-pure/-/core-js-pure-3.6.4.tgz#4bf1ba866e25814f149d4e9aaa08c36173506e3a" - integrity sha512-epIhRLkXdgv32xIUFaaAry2wdxZYBi6bgM7cB136dzzXXa+dFyRLTZeLUJxnd8ShrmyVXBub63n2NHo2JAt8Cw== - core-js@^2.4.0, core-js@^2.5.0: version "2.6.10" resolved "https://registry.yarnpkg.com/core-js/-/core-js-2.6.10.tgz#8a5b8391f8cc7013da703411ce5b585706300d7f" @@ -2902,23 +2907,6 @@ error-ex@^1.2.0: dependencies: is-arrayish "^0.2.1" -es-abstract@^1.17.0-next.1: - version "1.17.2" - resolved "https://registry.yarnpkg.com/es-abstract/-/es-abstract-1.17.2.tgz#965b10af56597b631da15872c17a405e86c1fd46" - integrity sha512-YoKuru3Lyoy7yVTBSH2j7UxTqe/je3dWAruC0sHvZX1GNd5zX8SSLvQqEgO9b3Ex8IW+goFI9arEEsFIbulhOw== - dependencies: - es-to-primitive "^1.2.1" - function-bind "^1.1.1" - has "^1.0.3" - has-symbols "^1.0.1" - is-callable "^1.1.5" - is-regex "^1.0.5" - object-inspect "^1.7.0" - object-keys "^1.1.1" - object.assign "^4.1.0" - string.prototype.trimleft "^2.1.1" - string.prototype.trimright "^2.1.1" - es-abstract@^1.5.0: version "1.16.3" resolved "https://registry.yarnpkg.com/es-abstract/-/es-abstract-1.16.3.tgz#52490d978f96ff9f89ec15b5cf244304a5bca161" @@ -3194,10 +3182,10 @@ eth-query@^2.0.2, eth-query@^2.1.0, eth-query@^2.1.2: json-rpc-random-id "^1.0.0" xtend "^4.0.1" -eth-saddle@^0.0.25: - version "0.0.25" - resolved "https://registry.yarnpkg.com/eth-saddle/-/eth-saddle-0.0.25.tgz#a047779de227ee30314a3024e2162dff9a710b9d" - integrity sha512-lAF//N9OXqw/hkV7kga3vXtckz8mBN18wqYGkGT2y1a3P71DnTbi+ni9VZlN+CBUKLKRCQyJDVd3BnmbLTI5yQ== +eth-saddle@^0.0.30: + version "0.0.30" + resolved "https://registry.yarnpkg.com/eth-saddle/-/eth-saddle-0.0.30.tgz#9be303d4155e6482c098664fef43f812034a23dc" + integrity sha512-0KR/yurqQX3ZgD7QJwHyAK51lPLIaPfMUvkeUUos08btz0UlblnR+p2IJ2hR3Nkemu8rnBiKH3y39o/rGkEJ6w== dependencies: "@0x/subproviders" "^6.0.0" "@compound-finance/sol-coverage" "^4.0.0-r1" @@ -3300,7 +3288,7 @@ ethereumjs-abi@0.6.7: bn.js "^4.11.8" ethereumjs-util "^6.0.0" -ethereumjs-account@3.0.0, ethereumjs-account@^3.0.0: +ethereumjs-account@3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/ethereumjs-account/-/ethereumjs-account-3.0.0.tgz#728f060c8e0c6e87f1e987f751d3da25422570a9" integrity sha512-WP6BdscjiiPkQfF9PVfMcwx/rDvfZTjFKY0Uwc09zSQr9JfIVH87dYIJu0gNhBhpmovV4yq295fdllS925fnBA== @@ -3318,7 +3306,7 @@ ethereumjs-account@^2.0.3: rlp "^2.0.0" safe-buffer "^5.1.1" -ethereumjs-block@2.2.0: +ethereumjs-block@2.2.0, ethereumjs-block@~2.2.0: version "2.2.0" resolved "https://registry.yarnpkg.com/ethereumjs-block/-/ethereumjs-block-2.2.0.tgz#8c6c3ab4a5eff0a16d9785fbeedbe643f4dbcbef" integrity sha512-Ye+uG/L2wrp364Zihdlr/GfC3ft+zG8PdHcRtsBFNNH1CkOhxOwdB8friBU85n89uRZ9eIMAywCq0F4CwT1wAw== @@ -3329,17 +3317,6 @@ ethereumjs-block@2.2.0: ethereumjs-util "^5.0.0" merkle-patricia-tree "^2.1.2" -ethereumjs-block@2.2.1, ethereumjs-block@~2.2.0: - version "2.2.1" - resolved "https://registry.yarnpkg.com/ethereumjs-block/-/ethereumjs-block-2.2.1.tgz#5fba423305b40ab6486a6b81922e5312b2667c8d" - integrity sha512-ze8I1844m5oKZL7hiHuezRcPzqdi4Iv0ssqQyuRaJ9Je0/YCYfXobJHvNLnex2ETgs5JypicdtLYrCNWdgcLvg== - dependencies: - async "^2.0.1" - ethereumjs-common "^1.1.0" - ethereumjs-tx "^2.1.1" - ethereumjs-util "^5.0.0" - merkle-patricia-tree "^2.1.2" - ethereumjs-block@^1.2.2, ethereumjs-block@^1.4.1, ethereumjs-block@^1.6.0: version "1.7.1" resolved "https://registry.yarnpkg.com/ethereumjs-block/-/ethereumjs-block-1.7.1.tgz#78b88e6cc56de29a6b4884ee75379b6860333c3f" @@ -3351,17 +3328,6 @@ ethereumjs-block@^1.2.2, ethereumjs-block@^1.4.1, ethereumjs-block@^1.6.0: ethereumjs-util "^5.0.0" merkle-patricia-tree "^2.1.2" -ethereumjs-block@^2.2.1, ethereumjs-block@~2.2.2: - version "2.2.2" - resolved "https://registry.yarnpkg.com/ethereumjs-block/-/ethereumjs-block-2.2.2.tgz#c7654be7e22df489fda206139ecd63e2e9c04965" - integrity sha512-2p49ifhek3h2zeg/+da6XpdFR3GlqY3BIEiqxGF8j9aSRIgkb7M1Ky+yULBKJOu8PAZxfhsYA+HxUk2aCQp3vg== - dependencies: - async "^2.0.1" - ethereumjs-common "^1.5.0" - ethereumjs-tx "^2.1.1" - ethereumjs-util "^5.0.0" - merkle-patricia-tree "^2.1.2" - ethereumjs-blockchain@^3.4.0: version "3.4.0" resolved "https://registry.yarnpkg.com/ethereumjs-blockchain/-/ethereumjs-blockchain-3.4.0.tgz#92240da6ecd86b3d8d324df69510b381f26c966b" @@ -3378,28 +3344,12 @@ ethereumjs-blockchain@^3.4.0: safe-buffer "^5.1.2" semaphore "^1.1.0" -ethereumjs-blockchain@^4.0.2: - version "4.0.3" - resolved "https://registry.yarnpkg.com/ethereumjs-blockchain/-/ethereumjs-blockchain-4.0.3.tgz#e013034633a30ad2006728e8e2b21956b267b773" - integrity sha512-0nJWbyA+Gu0ZKZr/cywMtB/77aS/4lOVsIKbgUN2sFQYscXO5rPbUfrEe7G2Zhjp86/a0VqLllemDSTHvx3vZA== - dependencies: - async "^2.6.1" - ethashjs "~0.0.7" - ethereumjs-block "~2.2.2" - ethereumjs-common "^1.5.0" - ethereumjs-util "~6.1.0" - flow-stoplight "^1.0.0" - level-mem "^3.0.1" - lru-cache "^5.1.1" - rlp "^2.2.2" - semaphore "^1.1.0" - -ethereumjs-common@1.4.0, ethereumjs-common@^1.1.0, ethereumjs-common@^1.3.1, ethereumjs-common@^1.3.2: +ethereumjs-common@^1.1.0: version "1.4.0" resolved "https://registry.yarnpkg.com/ethereumjs-common/-/ethereumjs-common-1.4.0.tgz#a940685f88f3c2587e4061630fe720b089c965b8" integrity sha512-ser2SAplX/YI5W2AnzU8wmSjKRy4KQd4uxInJ36BzjS3m18E/B9QedPUIresZN1CSEQb/RgNQ2gN7C/XbpTafA== -ethereumjs-common@^1.5.0: +ethereumjs-common@^1.3.1, ethereumjs-common@^1.3.2: version "1.5.0" resolved "https://registry.yarnpkg.com/ethereumjs-common/-/ethereumjs-common-1.5.0.tgz#d3e82fc7c47c0cef95047f431a99485abc9bb1cd" integrity sha512-SZOjgK1356hIY7MRj3/ma5qtfr/4B5BL+G4rP/XSMYr2z1H5el4RX5GReYCKmQmYI/nSBmRnwrZ17IfHuG0viQ== @@ -3412,7 +3362,7 @@ ethereumjs-tx@1.3.7, ethereumjs-tx@^1.1.1, ethereumjs-tx@^1.2.0, ethereumjs-tx@^ ethereum-common "^0.0.18" ethereumjs-util "^5.0.0" -ethereumjs-tx@2.1.1, ethereumjs-tx@^2.1.1: +ethereumjs-tx@^2.1.1: version "2.1.1" resolved "https://registry.yarnpkg.com/ethereumjs-tx/-/ethereumjs-tx-2.1.1.tgz#7d204e2b319156c9bc6cec67e9529424a26e8ccc" integrity sha512-QtVriNqowCFA19X9BCRPMgdVNJ0/gMBS91TQb1DfrhsbR748g4STwxZptFAwfqehMyrF8rDwB23w87PQwru0wA== @@ -3420,7 +3370,7 @@ ethereumjs-tx@2.1.1, ethereumjs-tx@^2.1.1: ethereumjs-common "^1.3.1" ethereumjs-util "^6.0.0" -ethereumjs-util@6.1.0, ethereumjs-util@~6.1.0: +ethereumjs-util@6.1.0: version "6.1.0" resolved "https://registry.yarnpkg.com/ethereumjs-util/-/ethereumjs-util-6.1.0.tgz#e9c51e5549e8ebd757a339cc00f5380507e799c8" integrity sha512-URESKMFbDeJxnAxPppnk2fN6Y3BIatn9fwn76Lm8bQlt+s52TpG8dN9M66MLPuRAiAOIqL3dfwqWJf0sd0fL0Q== @@ -3501,27 +3451,6 @@ ethereumjs-vm@3.0.0: rustbn.js "~0.2.0" safe-buffer "^5.1.1" -ethereumjs-vm@4.1.1: - version "4.1.1" - resolved "https://registry.yarnpkg.com/ethereumjs-vm/-/ethereumjs-vm-4.1.1.tgz#ba6f565fd7788a0e7db494fa2096d45f9ea0802b" - integrity sha512-Bh2avDY9Hyon9TvJ/fmkdyd5JDnmTudLJ5oKhmTfXn0Jjq7UzP4YRNp7e5PWoWXSmdXAGXU9W0DXK5TV9Qy/NQ== - dependencies: - async "^2.1.2" - async-eventemitter "^0.2.2" - core-js-pure "^3.0.1" - ethereumjs-account "^3.0.0" - ethereumjs-block "^2.2.1" - ethereumjs-blockchain "^4.0.2" - ethereumjs-common "^1.3.2" - ethereumjs-tx "^2.1.1" - ethereumjs-util "~6.1.0" - fake-merkle-patricia-tree "^1.0.1" - functional-red-black-tree "^1.0.1" - merkle-patricia-tree "^2.3.2" - rustbn.js "~0.2.0" - safe-buffer "^5.1.1" - util.promisify "^1.0.0" - ethereumjs-vm@^2.1.0, ethereumjs-vm@^2.3.4, ethereumjs-vm@^2.6.0: version "2.6.0" resolved "https://registry.yarnpkg.com/ethereumjs-vm/-/ethereumjs-vm-2.6.0.tgz#76243ed8de031b408793ac33907fb3407fe400c6" @@ -4084,7 +4013,7 @@ functional-red-black-tree@^1.0.1, functional-red-black-tree@~1.0.1: resolved "https://registry.yarnpkg.com/functional-red-black-tree/-/functional-red-black-tree-1.0.1.tgz#1b0ab3bd553b2a0d6399d29c0e3ea0b252078327" integrity sha1-GwqzvVU7Kg1jmdKcDj6gslIHgyc= -ganache-core@^2.6.0: +ganache-core@^2.6.0, ganache-core@^2.8.0: version "2.8.0" resolved "https://registry.yarnpkg.com/ganache-core/-/ganache-core-2.8.0.tgz#eeadc7f7fc3a0c20d99f8f62021fb80b5a05490c" integrity sha512-hfXqZGJx700jJqwDHNXrU2BnPYuETn1ekm36oRHuXY3oOuJLFs5C+cFdUFaBlgUxcau1dOgZUUwKqTAy0gTA9Q== @@ -4117,39 +4046,6 @@ ganache-core@^2.6.0: ethereumjs-wallet "0.6.3" web3 "1.2.1" -"ganache-core@https://github.com/trufflesuite/ganache-core.git": - version "2.9.1" - resolved "https://github.com/trufflesuite/ganache-core.git#dad69a5a19ecafb656994df6971f9a75e6ac35a2" - dependencies: - abstract-leveldown "3.0.0" - async "2.6.2" - bip39 "2.5.0" - cachedown "1.0.0" - clone "2.1.2" - debug "3.2.6" - encoding-down "5.0.4" - eth-sig-util "2.3.0" - ethereumjs-abi "0.6.7" - ethereumjs-account "3.0.0" - ethereumjs-block "2.2.1" - ethereumjs-common "1.4.0" - ethereumjs-tx "2.1.1" - ethereumjs-util "6.1.0" - ethereumjs-vm "4.1.1" - heap "0.2.6" - level-sublevel "6.6.4" - levelup "3.1.1" - lodash "4.17.14" - merkle-patricia-tree "2.3.2" - seedrandom "3.0.1" - source-map-support "0.5.12" - tmp "0.1.0" - web3-provider-engine "14.2.1" - websocket "1.0.29" - optionalDependencies: - ethereumjs-wallet "0.6.3" - web3 "1.2.4" - gauge@~2.7.3: version "2.7.4" resolved "https://registry.yarnpkg.com/gauge/-/gauge-2.7.4.tgz#2c03405c7538c39d7eb37b317022e325fb018bf7" @@ -4860,11 +4756,6 @@ is-callable@^1.1.3, is-callable@^1.1.4: resolved "https://registry.yarnpkg.com/is-callable/-/is-callable-1.1.4.tgz#1e1adf219e1eeb684d691f9d6a05ff0d30a24d75" integrity sha512-r5p9sxJjYnArLjObpjA4xu5EKI3CuKHkJXMhT7kwbpUyIFD1n5PMAsoPvWnvtZiNz7LjkYDRZhd7FlI0eMijEA== -is-callable@^1.1.5: - version "1.1.5" - resolved "https://registry.yarnpkg.com/is-callable/-/is-callable-1.1.5.tgz#f7e46b596890456db74e7f6e976cb3273d06faab" - integrity sha512-ESKv5sMCJB2jnHTWZ3O5itG+O128Hsus4K4Qh1h2/cgn2vbgnLSVqfV46AeJA9D5EeeLa9w81KUXMtn34zhX+Q== - is-data-descriptor@^0.1.4: version "0.1.4" resolved "https://registry.yarnpkg.com/is-data-descriptor/-/is-data-descriptor-0.1.4.tgz#0b5ee648388e2c860282e793f1856fec3f301b56" @@ -5018,13 +4909,6 @@ is-regex@^1.0.4: dependencies: has "^1.0.1" -is-regex@^1.0.5: - version "1.0.5" - resolved "https://registry.yarnpkg.com/is-regex/-/is-regex-1.0.5.tgz#39d589a358bf18967f726967120b8fc1aed74eae" - integrity sha512-vlKW17SNq44owv5AQR3Cq0bQPEb8+kF3UKZ2fiZNOWtztYE5i0CzCZxFDwO58qAOWtxdBRVO/V5Qin1wjCqFYQ== - dependencies: - has "^1.0.3" - is-relative@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/is-relative/-/is-relative-1.0.0.tgz#a1bb6935ce8c5dba1e8b9754b9b2dcc020e2260d" @@ -6349,7 +6233,7 @@ object-visit@^1.0.0: dependencies: isobject "^3.0.0" -object.assign@^4.0.4, object.assign@^4.1.0: +object.assign@^4.0.4: version "4.1.0" resolved "https://registry.yarnpkg.com/object.assign/-/object.assign-4.1.0.tgz#968bf1100d7956bb3ca086f006f846b3bc4008da" integrity sha512-exHJeq6kBKj58mqGyTQ9DFvrZC/eR6OwxzoM9YRoGBqrXYonaFyGiFMuc9VZrXf7DarreEwMpurG3dd+CNyW5w== @@ -6369,14 +6253,6 @@ object.defaults@^1.0.0, object.defaults@^1.1.0: for-own "^1.0.0" isobject "^3.0.0" -object.getownpropertydescriptors@^2.0.3: - version "2.1.0" - resolved "https://registry.yarnpkg.com/object.getownpropertydescriptors/-/object.getownpropertydescriptors-2.1.0.tgz#369bf1f9592d8ab89d712dced5cb81c7c5352649" - integrity sha512-Z53Oah9A3TdLoblT7VKJaTDdXdT+lQO+cNpKVnya5JDe9uLvzu1YyY1yFDFrcxrlRgWrEFH0jJtD/IbuwjcEVg== - dependencies: - define-properties "^1.1.3" - es-abstract "^1.17.0-next.1" - object.map@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/object.map/-/object.map-1.0.1.tgz#cf83e59dc8fcc0ad5f4250e1f78b3b81bd801d37" @@ -7386,7 +7262,7 @@ ripemd160@^2.0.0, ripemd160@^2.0.1: hash-base "^3.0.0" inherits "^2.0.1" -rlp@^2.0.0, rlp@^2.2.1, rlp@^2.2.2, rlp@^2.2.3: +rlp@^2.0.0, rlp@^2.2.1, rlp@^2.2.3: version "2.2.4" resolved "https://registry.yarnpkg.com/rlp/-/rlp-2.2.4.tgz#d6b0e1659e9285fc509a5d169a9bd06f704951c1" integrity sha512-fdq2yYCWpAQBhwkZv+Z8o/Z4sPmYm1CUq6P7n6lVTOdb949CnqA0sndXal5C1NleSVSZm6q5F3iEbauyVln/iw== @@ -7979,14 +7855,6 @@ string.prototype.trim@~1.1.2: function-bind "^1.0.2" string.prototype.trimleft@^2.1.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/string.prototype.trimleft/-/string.prototype.trimleft-2.1.0.tgz#6cc47f0d7eb8d62b0f3701611715a3954591d634" - integrity sha512-FJ6b7EgdKxxbDxc79cOlok6Afd++TTs5szo+zJTUyow3ycrRfJVE2pq3vcN53XexvKZu/DJMDfeI/qMiZTrjTw== - dependencies: - define-properties "^1.1.3" - function-bind "^1.1.1" - -string.prototype.trimleft@^2.1.1: version "2.1.1" resolved "https://registry.yarnpkg.com/string.prototype.trimleft/-/string.prototype.trimleft-2.1.1.tgz#9bdb8ac6abd6d602b17a4ed321870d2f8dcefc74" integrity sha512-iu2AGd3PuP5Rp7x2kEZCrB2Nf41ehzh+goo8TV7z8/XDBbsvc6HQIlUl9RjkZ4oyrW1XM5UwlGl1oVEaDjg6Ag== @@ -7995,14 +7863,6 @@ string.prototype.trimleft@^2.1.1: function-bind "^1.1.1" string.prototype.trimright@^2.1.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/string.prototype.trimright/-/string.prototype.trimright-2.1.0.tgz#669d164be9df9b6f7559fa8e89945b168a5a6c58" - integrity sha512-fXZTSV55dNBwv16uw+hh5jkghxSnc5oHq+5K/gXgizHwAvMetdAJlHqqoFC1FSDVPYWLkAKl2cxpUT41sV7nSg== - dependencies: - define-properties "^1.1.3" - function-bind "^1.1.1" - -string.prototype.trimright@^2.1.1: version "2.1.1" resolved "https://registry.yarnpkg.com/string.prototype.trimright/-/string.prototype.trimright-2.1.1.tgz#440314b15996c866ce8a0341894d45186200c5d9" integrity sha512-qFvWL3/+QIgZXVmJBfpHmxLB7xsUXz6HsUmP8+5dRaC3Q7oKUv9Vo6aMCRZC1smrtyECFsIT30PqBJ1gTjAs+g== @@ -8715,14 +8575,6 @@ util-deprecate@^1.0.1, util-deprecate@~1.0.1: resolved "https://registry.yarnpkg.com/util-deprecate/-/util-deprecate-1.0.2.tgz#450d4dc9fa70de732762fbd2d4a28981419a0ccf" integrity sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8= -util.promisify@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/util.promisify/-/util.promisify-1.0.0.tgz#440f7165a459c9a16dc145eb8e72f35687097030" - integrity sha512-i+6qA2MPhvoKLuxnJNpXAGhg7HphQOSUq2LKMZD0m15EiskXUkMvKdF4Uui0WYeCUGea+o2cw/ZuwehtfsrNkA== - dependencies: - define-properties "^1.1.2" - object.getownpropertydescriptors "^2.0.3" - util@0.10.3: version "0.10.3" resolved "https://registry.yarnpkg.com/util/-/util-0.10.3.tgz#7afb1afe50805246489e3db7fe0ed379336ac0f9" @@ -9399,7 +9251,7 @@ web3@1.2.1: web3-shh "1.2.1" web3-utils "1.2.1" -web3@1.2.4, web3@^1.2.4: +web3@^1.2.4: version "1.2.4" resolved "https://registry.yarnpkg.com/web3/-/web3-1.2.4.tgz#6e7ab799eefc9b4648c2dab63003f704a1d5e7d9" integrity sha512-xPXGe+w0x0t88Wj+s/dmAdASr3O9wmA9mpZRtixGZxmBexAF0MjfqYM+MS4tVl5s11hMTN3AZb8cDD4VLfC57A== diff --git a/spec/scenario/MCDai.scen b/spec/scenario/MCDai.scen index 7387c149b..73b0b6880 100644 --- a/spec/scenario/MCDai.scen +++ b/spec/scenario/MCDai.scen @@ -1,6 +1,8 @@ -- Multi-collateral DAI tests +-- These fork tests are very slow and highly dependent on ganache version, so we mark them pending Macro ForkMCD + -- Uses MakerDAO 0.2.16 Release https://changelog.makerdao.com/releases/kovan/0.2.16/index.html Alias CTokenAdmin "0x9C1856636d78C051deAd6CAB9c5699e4E25549e9" Alias DaiHolder "0x9Bffd1579bd6760a186fFf1A720f2a5dB35dE0f4" Alias DaiAddress "0xc27a24e60a89a03bd2f1ffb4ea59076fd8385fe6" @@ -11,6 +13,16 @@ Macro ForkMCD Erc20 Deploy Existing DAI DaiAddress DAI Assert Equal (EtherBalance CTokenAdmin) 1.680448935e18 -- Ensure the fork works as expected +Macro ForkMCD101 + -- Uses MakerDAO 1.0.1 Release https://changelog.makerdao.com/releases/kovan/1.0.1/index.html + Alias CTokenAdmin "0xA776184Fd6F545DAe5f51361dBcC9018549a9749" + Alias DaiHolder "0x72776bb917751225d24c07d0663b3780b2ada67c" + Alias DaiJoinAddress "0x5aa71a3ae1c0bd6ac27a1f28e1415fffb6f15b8c" + Alias PotAddress "0xea190dbdc7adf265260ec4da6e9675fd4f5a78bb" + Alias VatAddress "0xba987bdb501d131f766fee8180da5d81b34b69d9" + Alias JugAddress "0xcbb7718c9f39d05aeede1c472ca8bf804b2f1ead" + Web3Fork "https://kovan.infura.io/v3/e1a5d4d2c06a4e81945fca56d0d5d8ea@15090204" (CTokenAdmin DaiHolder) + Macro DeployCDAIWithDSR ForkMCD NewComptroller @@ -87,22 +99,70 @@ Macro CheckBasicBorrowRepayWithDSR repayAmount=1000015000000000000 Assert Approx (MCD PotAt PotAddress "pie" (CToken cDAI Address)) repayAmount -- pot is a wad (1e18), check for ~ 1 DAI + interest Assert (MCD VatAt VatAddress "dai" (CToken cDAI Address)) LessThan 2e27 -- vat is a rad (1e45), check for ~ dust -Test "Basic mint and redeem cDAI2 (directly to swept DSR)" +Pending "Basic mint and redeem cDAI2 (directly to swept DSR)" DeployCDAIWithDSR CheckBasicMintRedeemWithDSR -Test "Basic borrow and repay cDAI2 (directly to swept DSR)" +Pending "Basic borrow and repay cDAI2 (directly to swept DSR)" DeployCDAIWithDSR CheckBasicBorrowRepayWithDSR -Test "Basic mint and redeem cDAI2 (upgrade to swept DSR)" +Pending "Basic mint and redeem cDAI2 (upgrade to swept DSR)" DeployCDAI CheckBasicMintRedeem UpgradeToDSR CheckBasicMintRedeemWithDSR -Test "Basic borrow and repay cDAI2 (upgrade to swept DSR)" +Pending "Basic borrow and repay cDAI2 (upgrade to swept DSR)" DeployCDAI CheckBasicMintRedeem UpgradeToDSR CheckBasicBorrowRepayWithDSR repayAmount:1000014999999999999 -- real block numbers can get nasty + +Pending "Mint, upgrade to DSR and then downgrade to vanilla delegate" + DeployCDAI + From DaiHolder (Erc20 DAI Approve (CToken cDAI Address) 1e18) + Mint DaiHolder 1e18 cDAI + Assert Equal (Erc20 DAI TokenBalance cDAI) 1e18 + Assert Equal (CToken cDAI Cash) 1e18 + -- Upgrade + UpgradeToDSR + Assert Equal (Erc20 DAI TokenBalance cDAI) 0 + Assert Approx (CToken cDAI Cash) 1e18 + Assert Approx (MCD PotAt PotAddress "pie" (CToken cDAI Address)) 1e18 + -- Downgrade + From CTokenAdmin (CToken cDAI SetImplementation (CTokenDelegate cErc20Delegate Address) True "0x0") + Assert Approx (Erc20 DAI TokenBalance cDAI) 1e18 + Assert Approx (CToken cDAI Cash) 1e18 + +Pending "Mint, upgrade to DSR, mint, and then reupgrade to a new cdai delegate" + DeployCDAI + From DaiHolder (Erc20 DAI Approve (CToken cDAI Address) 2e18) + Mint DaiHolder 1e18 cDAI + Assert Equal (Erc20 DAI TokenBalance cDAI) 1e18 + Assert Equal (CToken cDAI Cash) 1e18 + -- Upgrade + UpgradeToDSR + Mint DaiHolder 1e18 cDAI + Assert Equal (Erc20 DAI TokenBalance cDAI) 0 + Assert Approx (CToken cDAI Cash) 2e18 + Assert Approx (MCD PotAt PotAddress "pie" (CToken cDAI Address)) 2e18 + -- Reupgrade to a new cDaiDelegate + CTokenDelegate Deploy CDaiDelegate cDaiDelegate2 + From CTokenAdmin (CToken cDAI SetImplementation (CTokenDelegate cDaiDelegate2 Address) True (EncodeParameters ("address" "address") (DaiJoinAddress PotAddress))) + Assert Equal (Erc20 DAI TokenBalance cDAI) 0 + Assert Approx (CToken cDAI Cash) 2e18 + Assert Approx (MCD PotAt PotAddress "pie" (CToken cDAI Address)) 2e18 + +Pending "Test resigning implementation" + ForkMCD101 + UseConfigs kovan + Assert Approx (Erc20 DAI TokenBalance cDAI) 0 + Assert Equal (MCD PotAt PotAddress "pie" (CToken cDAI Address)) 137889496810499277888 + From CTokenAdmin (CToken cDAI ResignImplementation) + Assert Approx (Erc20 DAI TokenBalance cDAI) 137889496810499277888 + Assert Approx (MCD PotAt PotAddress "pie" (CToken cDAI Address)) 0 + +Pending "DAI interest rate model" + ForkMCD101 + InterestRateModel Deploy DAIInterestRateModel DSR_Kink_9000bps_Jump_12000bps_AssumedRF_500bps 120e16 90e16 PotAddress JugAddress diff --git a/yarn.lock b/yarn.lock index bb0a2967e..5cc1e8ffc 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3372,11 +3372,6 @@ core-js-compat@^3.4.7: browserslist "^4.8.0" semver "^6.3.0" -core-js-pure@^3.0.1: - version "3.4.7" - resolved "https://registry.yarnpkg.com/core-js-pure/-/core-js-pure-3.4.7.tgz#c998e1892da9949200c7452cbd33c0df95be9f54" - integrity sha512-Am3uRS8WCdTFA3lP7LtKR0PxgqYzjAMGKXaZKSNSC/8sqU0Wfq8R/YzoRs2rqtOVEunfgH+0q3O0BKOg0AvjPw== - core-js@^2.4.0, core-js@^2.5.0: version "2.6.10" resolved "https://registry.yarnpkg.com/core-js/-/core-js-2.6.10.tgz#8a5b8391f8cc7013da703411ce5b585706300d7f" @@ -3984,7 +3979,24 @@ error-ex@^1.2.0, error-ex@^1.3.1: dependencies: is-arrayish "^0.2.1" -es-abstract@^1.5.0, es-abstract@^1.5.1: +es-abstract@^1.17.0-next.1: + version "1.17.0-next.1" + resolved "https://registry.yarnpkg.com/es-abstract/-/es-abstract-1.17.0-next.1.tgz#94acc93e20b05a6e96dacb5ab2f1cb3a81fc2172" + integrity sha512-7MmGr03N7Rnuid6+wyhD9sHNE2n4tFSwExnU2lQl3lIo2ShXWGePY80zYaoMOmILWv57H0amMjZGHNzzGG70Rw== + dependencies: + es-to-primitive "^1.2.1" + function-bind "^1.1.1" + has "^1.0.3" + has-symbols "^1.0.1" + is-callable "^1.1.4" + is-regex "^1.0.4" + object-inspect "^1.7.0" + object-keys "^1.1.1" + object.assign "^4.1.0" + string.prototype.trimleft "^2.1.0" + string.prototype.trimright "^2.1.0" + +es-abstract@^1.5.0: version "1.16.3" resolved "https://registry.yarnpkg.com/es-abstract/-/es-abstract-1.16.3.tgz#52490d978f96ff9f89ec15b5cf244304a5bca161" integrity sha512-WtY7Fx5LiOnSYgF5eg/1T+GONaGmpvpPdCpSnYij+U2gDTL0UPfWrhDw7b2IYb+9NQJsYpCA0wOQvZfsd6YwRw== @@ -4261,10 +4273,10 @@ eth-query@^2.0.2, eth-query@^2.1.0, eth-query@^2.1.2: json-rpc-random-id "^1.0.0" xtend "^4.0.1" -eth-saddle@^0.0.25: - version "0.0.25" - resolved "https://registry.yarnpkg.com/eth-saddle/-/eth-saddle-0.0.25.tgz#a047779de227ee30314a3024e2162dff9a710b9d" - integrity sha512-lAF//N9OXqw/hkV7kga3vXtckz8mBN18wqYGkGT2y1a3P71DnTbi+ni9VZlN+CBUKLKRCQyJDVd3BnmbLTI5yQ== +eth-saddle@^0.0.30: + version "0.0.30" + resolved "https://registry.yarnpkg.com/eth-saddle/-/eth-saddle-0.0.30.tgz#9be303d4155e6482c098664fef43f812034a23dc" + integrity sha512-0KR/yurqQX3ZgD7QJwHyAK51lPLIaPfMUvkeUUos08btz0UlblnR+p2IJ2hR3Nkemu8rnBiKH3y39o/rGkEJ6w== dependencies: "@0x/subproviders" "^6.0.0" "@compound-finance/sol-coverage" "^4.0.0-r1" @@ -4367,7 +4379,7 @@ ethereumjs-abi@0.6.7: bn.js "^4.11.8" ethereumjs-util "^6.0.0" -ethereumjs-account@3.0.0, ethereumjs-account@^3.0.0: +ethereumjs-account@3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/ethereumjs-account/-/ethereumjs-account-3.0.0.tgz#728f060c8e0c6e87f1e987f751d3da25422570a9" integrity sha512-WP6BdscjiiPkQfF9PVfMcwx/rDvfZTjFKY0Uwc09zSQr9JfIVH87dYIJu0gNhBhpmovV4yq295fdllS925fnBA== @@ -4407,7 +4419,7 @@ ethereumjs-block@^1.2.2, ethereumjs-block@^1.4.1, ethereumjs-block@^1.6.0: ethereumjs-util "^5.0.0" merkle-patricia-tree "^2.1.2" -ethereumjs-block@~2.2.0, ethereumjs-block@~2.2.1: +ethereumjs-block@~2.2.0: version "2.2.1" resolved "https://registry.yarnpkg.com/ethereumjs-block/-/ethereumjs-block-2.2.1.tgz#5fba423305b40ab6486a6b81922e5312b2667c8d" integrity sha512-ze8I1844m5oKZL7hiHuezRcPzqdi4Iv0ssqQyuRaJ9Je0/YCYfXobJHvNLnex2ETgs5JypicdtLYrCNWdgcLvg== @@ -4434,22 +4446,6 @@ ethereumjs-blockchain@^3.4.0: safe-buffer "^5.1.2" semaphore "^1.1.0" -ethereumjs-blockchain@^4.0.1: - version "4.0.2" - resolved "https://registry.yarnpkg.com/ethereumjs-blockchain/-/ethereumjs-blockchain-4.0.2.tgz#660c20df5895a88cec858738f286ec28d9a9acf6" - integrity sha512-K7N7EJpDQJXX634uEuXRk3pIH058SPeu+g0xQslViQyaTpJNTHsN5Wu/MdA5BzrUriBRlfmX9lCEaU4ZuaftJA== - dependencies: - async "^2.6.1" - ethashjs "~0.0.7" - ethereumjs-block "~2.2.1" - ethereumjs-common "^1.1.0" - ethereumjs-util "~6.1.0" - flow-stoplight "^1.0.0" - level-mem "^3.0.1" - lru-cache "^5.1.1" - rlp "^2.2.2" - semaphore "^1.1.0" - ethereumjs-common@^1.1.0, ethereumjs-common@^1.3.1, ethereumjs-common@^1.3.2: version "1.4.0" resolved "https://registry.yarnpkg.com/ethereumjs-common/-/ethereumjs-common-1.4.0.tgz#a940685f88f3c2587e4061630fe720b089c965b8" @@ -4471,7 +4467,7 @@ ethereumjs-tx@^2.1.1: ethereumjs-common "^1.3.1" ethereumjs-util "^6.0.0" -ethereumjs-util@6.1.0, ethereumjs-util@~6.1.0: +ethereumjs-util@6.1.0: version "6.1.0" resolved "https://registry.yarnpkg.com/ethereumjs-util/-/ethereumjs-util-6.1.0.tgz#e9c51e5549e8ebd757a339cc00f5380507e799c8" integrity sha512-URESKMFbDeJxnAxPppnk2fN6Y3BIatn9fwn76Lm8bQlt+s52TpG8dN9M66MLPuRAiAOIqL3dfwqWJf0sd0fL0Q== @@ -4508,7 +4504,7 @@ ethereumjs-util@^5.0.0, ethereumjs-util@^5.0.1, ethereumjs-util@^5.1.1, ethereum safe-buffer "^5.1.1" secp256k1 "^3.0.1" -ethereumjs-util@^6.0.0, ethereumjs-util@^6.1.0: +ethereumjs-util@^6.0.0: version "6.2.0" resolved "https://registry.yarnpkg.com/ethereumjs-util/-/ethereumjs-util-6.2.0.tgz#23ec79b2488a7d041242f01e25f24e5ad0357960" integrity sha512-vb0XN9J2QGdZGIEKG2vXM+kUdEivUfU6Wmi5y0cg+LRhDYKnXIZ/Lz7XjFbHRR9VIKq2lVGLzGBkA++y2nOdOQ== @@ -4552,27 +4548,6 @@ ethereumjs-vm@3.0.0: rustbn.js "~0.2.0" safe-buffer "^5.1.1" -ethereumjs-vm@4.1.0: - version "4.1.0" - resolved "https://registry.yarnpkg.com/ethereumjs-vm/-/ethereumjs-vm-4.1.0.tgz#359ed3592636390a5b2909a28d955c908830daa5" - integrity sha512-qvgmKkyF+eZ6NvtqTV74z9oRB7UxUStA0gShEbXftovpukVIYVzhvCl9KvUi64Rpo8jufze6Z0zHhiQpZN0Izw== - dependencies: - async "^2.1.2" - async-eventemitter "^0.2.2" - core-js-pure "^3.0.1" - ethereumjs-account "^3.0.0" - ethereumjs-block "~2.2.0" - ethereumjs-blockchain "^4.0.1" - ethereumjs-common "^1.3.2" - ethereumjs-tx "^2.1.1" - ethereumjs-util "^6.1.0" - fake-merkle-patricia-tree "^1.0.1" - functional-red-black-tree "^1.0.1" - merkle-patricia-tree "^2.3.2" - rustbn.js "~0.2.0" - safe-buffer "^5.1.1" - util.promisify "^1.0.0" - ethereumjs-vm@^2.1.0, ethereumjs-vm@^2.3.4, ethereumjs-vm@^2.6.0: version "2.6.0" resolved "https://registry.yarnpkg.com/ethereumjs-vm/-/ethereumjs-vm-2.6.0.tgz#76243ed8de031b408793ac33907fb3407fe400c6" @@ -5251,43 +5226,19 @@ functional-red-black-tree@^1.0.1, functional-red-black-tree@~1.0.1: resolved "https://registry.yarnpkg.com/functional-red-black-tree/-/functional-red-black-tree-1.0.1.tgz#1b0ab3bd553b2a0d6399d29c0e3ea0b252078327" integrity sha1-GwqzvVU7Kg1jmdKcDj6gslIHgyc= -ganache-core@^2.6.0: - version "2.8.0" - resolved "https://registry.yarnpkg.com/ganache-core/-/ganache-core-2.8.0.tgz#eeadc7f7fc3a0c20d99f8f62021fb80b5a05490c" - integrity sha512-hfXqZGJx700jJqwDHNXrU2BnPYuETn1ekm36oRHuXY3oOuJLFs5C+cFdUFaBlgUxcau1dOgZUUwKqTAy0gTA9Q== +ganache-cli@^6.7.0: + version "6.7.0" + resolved "https://registry.yarnpkg.com/ganache-cli/-/ganache-cli-6.7.0.tgz#b59845578221bdf686cf124d007c5ee62e85a62f" + integrity sha512-9CZsClo9hl5MxGL7hkk14mie89Q94P0idh92jcV7LmppTYTCG7SHatuwcfqN7emFHArMt3fneN4QbH2do2N6Ow== dependencies: - abstract-leveldown "3.0.0" - async "2.6.2" - bip39 "2.5.0" - cachedown "1.0.0" - clone "2.1.2" - debug "3.2.6" - encoding-down "5.0.4" - eth-sig-util "2.3.0" - ethereumjs-abi "0.6.7" - ethereumjs-account "3.0.0" - ethereumjs-block "2.2.0" - ethereumjs-tx "1.3.7" ethereumjs-util "6.1.0" - ethereumjs-vm "3.0.0" - heap "0.2.6" - level-sublevel "6.6.4" - levelup "3.1.1" - lodash "4.17.14" - merkle-patricia-tree "2.3.2" - seedrandom "3.0.1" source-map-support "0.5.12" - tmp "0.1.0" - web3-provider-engine "14.2.1" - websocket "1.0.29" - optionalDependencies: - ethereumjs-wallet "0.6.3" - web3 "1.2.1" + yargs "13.2.4" -ganache-core@^2.9.0-istanbul.0: - version "2.9.0-istanbul.0" - resolved "https://registry.yarnpkg.com/ganache-core/-/ganache-core-2.9.0-istanbul.0.tgz#bc336c770775a2b9fb06f5cae827088ecc194283" - integrity sha512-wqNWyxrfZe4QPxzaR/n4hGxIfa1iZAkymPg17wET0iWZ9uurMywGgpG4ZvxjVU9q7WCjIobOSzE1m9OT0dIYcQ== +ganache-core@^2.6.0, ganache-core@^2.8.0: + version "2.8.0" + resolved "https://registry.yarnpkg.com/ganache-core/-/ganache-core-2.8.0.tgz#eeadc7f7fc3a0c20d99f8f62021fb80b5a05490c" + integrity sha512-hfXqZGJx700jJqwDHNXrU2BnPYuETn1ekm36oRHuXY3oOuJLFs5C+cFdUFaBlgUxcau1dOgZUUwKqTAy0gTA9Q== dependencies: abstract-leveldown "3.0.0" async "2.6.2" @@ -5302,7 +5253,7 @@ ganache-core@^2.9.0-istanbul.0: ethereumjs-block "2.2.0" ethereumjs-tx "1.3.7" ethereumjs-util "6.1.0" - ethereumjs-vm "4.1.0" + ethereumjs-vm "3.0.0" heap "0.2.6" level-sublevel "6.6.4" levelup "3.1.1" @@ -6014,6 +5965,11 @@ invert-kv@^1.0.0: resolved "https://registry.yarnpkg.com/invert-kv/-/invert-kv-1.0.0.tgz#104a8e4aaca6d3d8cd157a8ef8bfab2d7a3ffdb6" integrity sha1-EEqOSqym09jNFXqO+L+rLXo//bY= +invert-kv@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/invert-kv/-/invert-kv-2.0.0.tgz#7393f5afa59ec9ff5f67a27620d11c226e3eec02" + integrity sha512-wPVv/y/QQ/Uiirj/vh3oP+1Ww+AWehmi1g5fFWGPF6IpCBCDVrhgHRMvrLfdYcwDh3QJbGXDW4JAuzxElLSqKA== + ipaddr.js@1.9.0: version "1.9.0" resolved "https://registry.yarnpkg.com/ipaddr.js/-/ipaddr.js-1.9.0.tgz#37df74e430a0e47550fe54a2defe30d8acd95f65" @@ -7229,6 +7185,13 @@ lcid@^1.0.0: dependencies: invert-kv "^1.0.0" +lcid@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/lcid/-/lcid-2.0.0.tgz#6ef5d2df60e52f82eb228a4c373e8d1f397253cf" + integrity sha512-avPEb8P8EGnwXKClwsNUgryVjllcRqtMYa49NTsbQagYuT1DcXnl1915oxWjoyGrXR6zH/Y0Zc96xWsPcoDKeA== + dependencies: + invert-kv "^2.0.0" + lead@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/lead/-/lead-1.0.0.tgz#6f14f99a37be3a9dd784f5495690e5903466ee42" @@ -7560,6 +7523,13 @@ makeerror@1.0.x: dependencies: tmpl "1.0.x" +map-age-cleaner@^0.1.1: + version "0.1.3" + resolved "https://registry.yarnpkg.com/map-age-cleaner/-/map-age-cleaner-0.1.3.tgz#7d583a7306434c055fe474b0f45078e6e1b4b92a" + integrity sha512-bJzx6nMoP6PDLPBFmg7+xRKeFZvFboMrGlxmNj9ClvX53KrmvM5bXFXEWjbz4cz1AFn+jWJ9z/DJSz7hrs0w3w== + dependencies: + p-defer "^1.0.0" + map-cache@^0.2.0, map-cache@^0.2.2: version "0.2.2" resolved "https://registry.yarnpkg.com/map-cache/-/map-cache-0.2.2.tgz#c32abd0bd6525d9b051645bb4f26ac5dc98a0dbf" @@ -7618,6 +7588,15 @@ mem@^1.1.0: dependencies: mimic-fn "^1.0.0" +mem@^4.0.0: + version "4.3.0" + resolved "https://registry.yarnpkg.com/mem/-/mem-4.3.0.tgz#461af497bc4ae09608cdb2e60eefb69bff744178" + integrity sha512-qX2bG48pTqYRVmDB37rn/6PT7LcR8T7oAX3bf99u1Tt1nzxYfxkgqDwUwolPlXweM0XzBOBFzSx4kfp7KP1s/w== + dependencies: + map-age-cleaner "^0.1.1" + mimic-fn "^2.0.0" + p-is-promise "^2.0.0" + memdown@^1.0.0: version "1.4.1" resolved "https://registry.yarnpkg.com/memdown/-/memdown-1.4.1.tgz#b4e4e192174664ffbae41361aa500f3119efe215" @@ -7772,7 +7751,7 @@ mimic-fn@^1.0.0: resolved "https://registry.yarnpkg.com/mimic-fn/-/mimic-fn-1.2.0.tgz#820c86a39334640e99516928bd03fca88057d022" integrity sha512-jf84uxzwiuiIVKiOLpfYk7N46TSy8ubTonmneY9vrpHNAnp0QBt2BxWV9dO3/j+BoVAb+a5G6YDPW3M5HOdMWQ== -mimic-fn@^2.1.0: +mimic-fn@^2.0.0, mimic-fn@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/mimic-fn/-/mimic-fn-2.1.0.tgz#7ed2c2ccccaf84d3ffcb7a69b57711fc2083401b" integrity sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg== @@ -8261,12 +8240,12 @@ object.defaults@^1.0.0, object.defaults@^1.1.0: isobject "^3.0.0" object.getownpropertydescriptors@^2.0.3: - version "2.0.3" - resolved "https://registry.yarnpkg.com/object.getownpropertydescriptors/-/object.getownpropertydescriptors-2.0.3.tgz#8758c846f5b407adab0f236e0986f14b051caa16" - integrity sha1-h1jIRvW0B62rDyNuCYbxSwUcqhY= + version "2.1.0" + resolved "https://registry.yarnpkg.com/object.getownpropertydescriptors/-/object.getownpropertydescriptors-2.1.0.tgz#369bf1f9592d8ab89d712dced5cb81c7c5352649" + integrity sha512-Z53Oah9A3TdLoblT7VKJaTDdXdT+lQO+cNpKVnya5JDe9uLvzu1YyY1yFDFrcxrlRgWrEFH0jJtD/IbuwjcEVg== dependencies: - define-properties "^1.1.2" - es-abstract "^1.5.1" + define-properties "^1.1.3" + es-abstract "^1.17.0-next.1" object.map@^1.0.0: version "1.0.1" @@ -8375,6 +8354,15 @@ os-locale@^2.0.0: lcid "^1.0.0" mem "^1.1.0" +os-locale@^3.1.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/os-locale/-/os-locale-3.1.0.tgz#a802a6ee17f24c10483ab9935719cef4ed16bf1a" + integrity sha512-Z8l3R4wYWM40/52Z+S265okfFj8Kt2cC2MKY+xNi3kFs+XGI7WXu/I309QQQYbRW4ijiZ+yxs9pqEhJh0DqW3Q== + dependencies: + execa "^1.0.0" + lcid "^2.0.0" + mem "^4.0.0" + os-tmpdir@^1.0.0, os-tmpdir@^1.0.1, os-tmpdir@~1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/os-tmpdir/-/os-tmpdir-1.0.2.tgz#bbe67406c79aa85c5cfec766fe5734555dfa1274" @@ -8398,6 +8386,11 @@ p-cancelable@^1.0.0: resolved "https://registry.yarnpkg.com/p-cancelable/-/p-cancelable-1.1.0.tgz#d078d15a3af409220c886f1d9a0ca2e441ab26cc" integrity sha512-s73XxOZ4zpt1edZYZzvhqFa6uvQc1vwUa0K0BdtIZgQMAJj9IbebH+JkgKZc9h+B05PKHLOTl4ajG1BmNrVZlw== +p-defer@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/p-defer/-/p-defer-1.0.0.tgz#9f6eb182f6c9aa8cd743004a7d4f96b196b0fb0c" + integrity sha1-n26xgvbJqozXQwBKfU+WsZaw+ww= + p-each-series@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/p-each-series/-/p-each-series-1.0.0.tgz#930f3d12dd1f50e7434457a22cd6f04ac6ad7f71" @@ -8415,6 +8408,11 @@ p-finally@^2.0.0: resolved "https://registry.yarnpkg.com/p-finally/-/p-finally-2.0.1.tgz#bd6fcaa9c559a096b680806f4d657b3f0f240561" integrity sha512-vpm09aKwq6H9phqRQzecoDpD8TmVyGw70qmWlyq5onxY7tqyTTFVvxMykxQSQKILBSFlbXpypIw2T1Ml7+DDtw== +p-is-promise@^2.0.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/p-is-promise/-/p-is-promise-2.1.0.tgz#918cebaea248a62cf7ffab8e3bca8c5f882fc42e" + integrity sha512-Y3W0wlRPK8ZMRbNq97l4M5otioeA5lm1z7bkNkxCka8HSPjR0xRWmpCmc9utiaLP9Jb1eD8BgeIxTW4AIF45Pg== + p-limit@^1.1.0: version "1.3.0" resolved "https://registry.yarnpkg.com/p-limit/-/p-limit-1.3.0.tgz#b86bd5f0c25690911c7590fcbfc2010d54b3ccb8" @@ -9496,7 +9494,14 @@ ripemd160@^2.0.0, ripemd160@^2.0.1: hash-base "^3.0.0" inherits "^2.0.1" -rlp@^2.0.0, rlp@^2.2.1, rlp@^2.2.2, rlp@^2.2.3: +rlp@^2.0.0: + version "2.2.1" + resolved "https://registry.yarnpkg.com/rlp/-/rlp-2.2.1.tgz#9cacf53ad2579163cc56fba64b1f4336f1f2fa46" + integrity sha512-nqB/qy+YjXdp/zj1CjCiDwfLMBPv/XFDol0ir/7O/+Ix90++rvi+QoK1CDJcn8JoqCu2WrPPeRucu4qyIDzALg== + dependencies: + safe-buffer "^5.1.1" + +rlp@^2.2.1, rlp@^2.2.3: version "2.2.4" resolved "https://registry.yarnpkg.com/rlp/-/rlp-2.2.4.tgz#d6b0e1659e9285fc509a5d169a9bd06f704951c1" integrity sha512-fdq2yYCWpAQBhwkZv+Z8o/Z4sPmYm1CUq6P7n6lVTOdb949CnqA0sndXal5C1NleSVSZm6q5F3iEbauyVln/iw== @@ -11882,7 +11887,7 @@ yargs-parser@^10.0.0: dependencies: camelcase "^4.1.0" -yargs-parser@^13.1.1: +yargs-parser@^13.1.0, yargs-parser@^13.1.1: version "13.1.1" resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-13.1.1.tgz#d26058532aa06d365fe091f6a1fc06b2f7e5eca0" integrity sha512-oVAVsHz6uFrg3XQheFII8ESO2ssAf9luWuAd6Wexsu4F3OtIW0o8IribPXYrD4WC24LWtPrJlGy87y5udK+dxQ== @@ -11904,6 +11909,23 @@ yargs-parser@^8.1.0: dependencies: camelcase "^4.1.0" +yargs@13.2.4: + version "13.2.4" + resolved "https://registry.yarnpkg.com/yargs/-/yargs-13.2.4.tgz#0b562b794016eb9651b98bd37acf364aa5d6dc83" + integrity sha512-HG/DWAJa1PAnHT9JAhNa8AbAv3FPaiLzioSjCcmuXXhP8MlpHO5vwls4g4j6n30Z74GVQj8Xa62dWVx1QCGklg== + dependencies: + cliui "^5.0.0" + find-up "^3.0.0" + get-caller-file "^2.0.1" + os-locale "^3.1.0" + require-directory "^2.1.1" + require-main-filename "^2.0.0" + set-blocking "^2.0.0" + string-width "^3.0.0" + which-module "^2.0.0" + y18n "^4.0.0" + yargs-parser "^13.1.0" + yargs@^10.0.3: version "10.1.2" resolved "https://registry.yarnpkg.com/yargs/-/yargs-10.1.2.tgz#454d074c2b16a51a43e2fb7807e4f9de69ccb5c5"