Skip to content

Commit

Permalink
build(amm,flash-swap,proxy-target): add "@openzeppelin/contracts-upgr…
Browse files Browse the repository at this point in the history
…adeable" v4.3.2 as dep

build(protocol): upgrade to "@openzeppelin/contracts-upgradeable" v4.5.2
test(flash-swap): use latest automatic error message thrown by hardhat

See NomicFoundation/hardhat#2451
  • Loading branch information
PaulRBerg committed Mar 3, 2022
1 parent ce70409 commit 86ccdbb
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 9 deletions.
1 change: 1 addition & 0 deletions packages/amm/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
"@ethersproject/bytes": "^5.5.0",
"@ethersproject/providers": "^5.5.3",
"@hifi/protocol": "1.7.1",
"@openzeppelin/contracts-upgradeable": "4.3.2",
"@paulrberg/contracts": "3.7.0",
"ethers": "^5.5.4",
"prb-math": "2.4.3"
Expand Down
1 change: 1 addition & 0 deletions packages/flash-swap/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
"@ethersproject/bytes": "^5.5.0",
"@ethersproject/providers": "^5.5.3",
"@hifi/protocol": "1.7.1",
"@openzeppelin/contracts-upgradeable": "4.3.2",
"@paulrberg/contracts": "3.7.0",
"@uniswap/v2-core": "1.0.1",
"ethers": "^5.5.4"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,11 +55,14 @@ export function shouldBehaveLikeUniswapV2Call(): void {

context("when the caller is an externally owned account", function () {
it("reverts", async function () {
// See https://hardhat.org/hardhat-network/#automatic-error-messages
// See https://github.com/NomicFoundation/hardhat/issues/2451
const automaticErrorMessage = "function returned an unexpected amount of data";
await expect(
this.contracts.flashUniswapV2
.connect(this.signers.raider)
.uniswapV2Call(sender, swapCollateralAmount, swapUnderlyingAmount, data),
).to.be.revertedWith("function call to a non-contract account");
).to.be.revertedWith(automaticErrorMessage);
});
});

Expand Down
4 changes: 2 additions & 2 deletions packages/protocol/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"@ethersproject/abi": "^5.5.0",
"@ethersproject/bytes": "^5.5.0",
"@ethersproject/providers": "^5.5.3",
"@openzeppelin/contracts-upgradeable": "4.5.1",
"@openzeppelin/contracts-upgradeable": "4.5.2",
"@paulrberg/contracts": "3.7.0",
"ethers": "^5.5.4",
"prb-math": "2.4.3"
Expand Down Expand Up @@ -87,7 +87,7 @@
],
"license": "LGPL-3.0-or-later",
"peerDependencies": {
"@openzeppelin/contracts-upgradeable": "4.3.2",
"@openzeppelin/contracts-upgradeable": "4.5.2",
"@paulrberg/contracts": "3.7.0",
"ethers": "^5.4.7",
"prb-math": "2.4.3"
Expand Down
1 change: 1 addition & 0 deletions packages/proxy-target/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
"@ethersproject/providers": "^5.5.3",
"@hifi/amm": "1.7.1",
"@hifi/protocol": "1.7.1",
"@openzeppelin/contracts-upgradeable": "4.3.2",
"@paulrberg/contracts": "3.7.0",
"ethers": "^5.5.4"
},
Expand Down
15 changes: 9 additions & 6 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1435,6 +1435,7 @@ __metadata:
"@nomiclabs/hardhat-ethers": ^2.0.5
"@nomiclabs/hardhat-etherscan": ^3.0.1
"@nomiclabs/hardhat-waffle": ^2.0.2
"@openzeppelin/contracts-upgradeable": 4.3.2
"@paulrberg/contracts": 3.7.0
"@typechain/ethers-v5": ^9.0.0
"@typechain/hardhat": ^4.0.0
Expand Down Expand Up @@ -1530,6 +1531,7 @@ __metadata:
"@nomiclabs/hardhat-ethers": ^2.0.5
"@nomiclabs/hardhat-etherscan": ^3.0.1
"@nomiclabs/hardhat-waffle": ^2.0.2
"@openzeppelin/contracts-upgradeable": 4.3.2
"@paulrberg/contracts": 3.7.0
"@typechain/ethers-v5": ^9.0.0
"@typechain/hardhat": ^4.0.0
Expand Down Expand Up @@ -1626,7 +1628,7 @@ __metadata:
"@nomiclabs/hardhat-ethers": ^2.0.5
"@nomiclabs/hardhat-etherscan": ^3.0.1
"@nomiclabs/hardhat-waffle": ^2.0.2
"@openzeppelin/contracts-upgradeable": 4.5.1
"@openzeppelin/contracts-upgradeable": 4.5.2
"@openzeppelin/hardhat-upgrades": ^1.14.0
"@paulrberg/contracts": 3.7.0
"@typechain/ethers-v5": ^9.0.0
Expand Down Expand Up @@ -1666,7 +1668,7 @@ __metadata:
typechain: ^7.0.0
typescript: ^4.5.5
peerDependencies:
"@openzeppelin/contracts-upgradeable": 4.3.2
"@openzeppelin/contracts-upgradeable": 4.5.2
"@paulrberg/contracts": 3.7.0
ethers: ^5.4.7
prb-math: 2.4.3
Expand All @@ -1684,6 +1686,7 @@ __metadata:
"@hifi/helpers": "workspace:*"
"@hifi/protocol": 1.7.1
"@nomiclabs/hardhat-etherscan": ^3.0.1
"@openzeppelin/contracts-upgradeable": 4.3.2
"@paulrberg/contracts": 3.7.0
"@typechain/ethers-v5": ^9.0.0
"@typechain/hardhat": ^4.0.0
Expand Down Expand Up @@ -1977,10 +1980,10 @@ __metadata:
languageName: node
linkType: hard

"@openzeppelin/contracts-upgradeable@npm:4.5.1":
version: 4.5.1
resolution: "@openzeppelin/contracts-upgradeable@npm:4.5.1"
checksum: 9dc0adeeae384e3b8bfa7d688f75020687ea19948b323f6a94c349b5aeeede6924289190f3a719144163e4048ddea29354a524943072a38d7dba891d2efceba2
"@openzeppelin/contracts-upgradeable@npm:4.5.2":
version: 4.5.2
resolution: "@openzeppelin/contracts-upgradeable@npm:4.5.2"
checksum: bd6a12eb83d8e3194e0847ffb248a1063668e2bf723afd21066316090de9b02e95af6057086a95fa21b0d09a2ef0ea057459bb5f5645dfff298e59e8c3267692
languageName: node
linkType: hard

Expand Down

0 comments on commit 86ccdbb

Please sign in to comment.