Skip to content

Commit

Permalink
Merge pull request #455 from liquity/multicall
Browse files Browse the repository at this point in the history
Make BatchedProvider mainnet ready
  • Loading branch information
danielattilasimon authored Mar 30, 2021
2 parents 395e6af + 171bbdb commit 2e216d7
Show file tree
Hide file tree
Showing 11 changed files with 129 additions and 259 deletions.
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,6 @@
"save-live-version": "yarn workspace @liquity/lib-ethers save-live-version",
"start-dev-chain": "run-s start-dev-chain:*",
"start-dev-chain:openethereum": "node dev-chain/start.js",
"start-dev-chain:deploy-multicaller": "yarn workspace @liquity/providers deploy-to-dev-chain",
"start-dev-chain:prepare-providers": "yarn prepare:providers",
"start-dev-chain:deploy-contracts": "yarn deploy --network dev",
"start-dev-chain:prepare-lib-ethers": "yarn prepare:lib-ethers",
Expand Down
9 changes: 1 addition & 8 deletions packages/lib-ethers/src/ReadableEthersLiquity.ts
Original file line number Diff line number Diff line change
Expand Up @@ -213,14 +213,7 @@ export class ReadableEthersLiquity implements ReadableLiquity {
getPrice(overrides?: EthersCallOverrides): Promise<Decimal> {
const { priceFeed } = _getContracts(this.connection);

// fetchPrice() fails when called through BatchedProvider, because that uses a helper contract
// that dispatches batched calls using STATICCALL, and fetchPrice() tries to modify state, which
// "will result in an exception instead of performing the modification" (EIP-214).

// Passing a pointless gasPrice override ensures that the call is performed directly --
// bypassing the helper contract -- because BatchedProvider has no support for overrides other
// than blockTag.
return priceFeed.callStatic.fetchPrice({ ...overrides, gasPrice: 0 }).then(decimalify);
return priceFeed.callStatic.fetchPrice({ ...overrides }).then(decimalify);
}

/** @internal */
Expand Down
1 change: 0 additions & 1 deletion packages/providers/.gitignore

This file was deleted.

10 changes: 0 additions & 10 deletions packages/providers/multicaller/MultiCaller.json

This file was deleted.

23 changes: 0 additions & 23 deletions packages/providers/multicaller/MultiCaller.sol

This file was deleted.

112 changes: 0 additions & 112 deletions packages/providers/multicaller/multicall-example.txt

This file was deleted.

6 changes: 1 addition & 5 deletions packages/providers/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,10 @@
"main": "dist/index.js",
"types": "dist/index.d.ts",
"scripts": {
"deploy-to-dev-chain": "ts-node scripts/deployToDevChain.ts",
"prepare": "run-s prepare:*",
"prepare:backfill-dev-deployment": "ts-node scripts/backfillDevDeployment.ts",
"prepare:tsc": "tsc --project tsconfig.dist.json"
"prepare": "tsc --project tsconfig.dist.json"
},
"devDependencies": {
"ethers": "^5.0.0",
"npm-run-all": "^4.1.5",
"ts-node": "^9.1.1",
"typescript": "~4.1.0"
},
Expand Down
5 changes: 0 additions & 5 deletions packages/providers/scripts/backfillDevDeployment.ts

This file was deleted.

25 changes: 0 additions & 25 deletions packages/providers/scripts/deployToDevChain.ts

This file was deleted.

Loading

0 comments on commit 2e216d7

Please sign in to comment.