Skip to content

Instantly share code, notes, and snippets.

@devonwesley
Created March 14, 2018 18:54
Show Gist options
  • Save devonwesley/e2be6ea92e5fd6f45e05cc049c03f4d1 to your computer and use it in GitHub Desktop.
Save devonwesley/e2be6ea92e5fd6f45e05cc049c03f4d1 to your computer and use it in GitHub Desktop.
This is a Wallet contract it interfaces with the WalletLibrary contract to become a fully functioning contract wallet. DO NOT USE.
pragma solidity ^0.4.6;
contract Wallet {
address public owner;
address public _walletLibrary;
function Wallet(address libAddress, address _owner) public {
_walletLibrary = libAddress;
_walletLibrary.delegatecall(bytes4(keccak256("initWallet(address)")), _owner);
}
function withdraw(uint amount) public returns (bool success) {
return _walletLibrary.delegatecall(bytes4(keccak256("withdraw(uint)")), amount);
}
function () payable {
_walletLibrary.delegatecall(msg.data);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment