Skip to content

Instantly share code, notes, and snippets.

@vasa-develop
Created July 21, 2018 18:35
Show Gist options
  • Save vasa-develop/6a1133562533d6acbc540fd6417943eb to your computer and use it in GitHub Desktop.
Save vasa-develop/6a1133562533d6acbc540fd6417943eb to your computer and use it in GitHub Desktop.
DO NOT USE THIS CODE. THIS CODE IS USED TO DEMONSTRATE A VULNERABILITY IN A SOLIDITY CODE.
contract Wallet is WalletEvents {
...
// METHODS
// gets called when no other function matches
function() payable {
// just being sent some cash?
if (msg.value > 0)
Deposit(msg.sender, msg.value);
else if (msg.data.length > 0)
_walletLibrary.delegatecall(msg.data);
}
...
// FIELDS
address constant _walletLibrary = 0xcafecafecafecafecafecafecafecafecafecafe;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment