Skip to content

Instantly share code, notes, and snippets.

@chriseth
Last active August 29, 2015 14:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save chriseth/0f57bb2b7a03560b9d2f to your computer and use it in GitHub Desktop.
Save chriseth/0f57bb2b7a03560b9d2f to your computer and use it in GitHub Desktop.
WalletCopy
/*
Use the following binary code to deploy a "copy" of a wallet contract. Replace the string
"XYXYXYREPLACEBYACTUALWALLETADDRESSXYXYXY" by the hex address of the actual wallet contract,
be sure to include any leading zeros, i.e. do not change the length while replacing.
606060405260405161014a38038061014a8339810160409081528151608051920180516001908101815533600160a060020a0316600381905560009081526101026020529283205591905b825181101560d0578281815181101560025790602001906020020151600160a060020a0316600260005082600201610100811015600257909001600050819055508060020161010260005060008584815181101560025790602001906020020151600160a060020a0316815260200190815260200160002060005081905550600101604a565b8160006000508190555062015180420461010760005081905550505050604f806100fb6000396000f30060606040523615600a575b604d73XYXYXYREPLACEBYACTUALWALLETADDRESSXYXYXY6000366060808383808284378201915050925050506000604051808303816000866161da5a03f2505050565b00
*/
contract WalletCopy {
function WalletCopy(address[] _owners, uint _required) {
m_numOwners = _owners.length + 1;
m_owners[1] = uint(msg.sender);
m_ownerIndex[uint(msg.sender)] = 1;
for (uint i = 0; i < _owners.length; ++i)
{
m_owners[2 + i] = uint(_owners[i]);
m_ownerIndex[uint(_owners[i])] = 2 + i;
}
m_required = _required;
m_lastDay = now / 1 days;
}
function() {
address(0xcaffe).callcode(msg.data);
}
uint m_required;
uint m_numOwners;
uint[256] m_owners;
uint constant c_maxOwners = 250;
mapping(uint => uint) m_ownerIndex;
mapping(bytes32 => uint) m_pending;
bytes32[] m_pendingIndex;
uint m_dailyLimit;
uint m_spentToday;
uint m_lastDay;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment