Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(furucombo): check implementation state change in furucombo proxy #1

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions test/furucombo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,18 @@ describe("Furucombo Hack", function () {
const isValid = await registry.isValid(aaveV2Proxy.address);
expect(isValid, "!isValid").to.be.true;
});
it("check that furucomboProxy implementation is not set", async function () {
const IMPLEMENTATION_SLOT = `0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc`;

const implementationAddr = BigNumber.from(
await ethers.provider.getStorageAt(
furucomboProxy.address,
IMPLEMENTATION_SLOT
)
).toHexString();
console.log(`furucomboProxy implementation address: ${implementationAddr}`);
expect(implementationAddr).to.equal(ethers.constants.Zero);
});
it("performs the attack", async function () {
tx = await attacker.setup();
tx = await attacker.attack(usdc.address, victimAddress);
Expand All @@ -97,4 +108,17 @@ describe("Furucombo Hack", function () {
victimBalance.toString()
);
});
it("check that furucomboProxy implementation is equal to attacker's contract", async function () {
const IMPLEMENTATION_SLOT = `0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc`;
const implementationAddr = BigNumber.from(
await ethers.provider.getStorageAt(
furucomboProxy.address,
IMPLEMENTATION_SLOT
)
).toHexString();
console.log(`furucomboProxy implementation address: ${implementationAddr}`);
expect(implementationAddr.toLowerCase()).to.equal(
attacker.address.toLowerCase()
);
});
});