Skip to content

Instantly share code, notes, and snippets.

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 CJentzsch/12a9df0d33b8964dff7e1003f0793464 to your computer and use it in GitHub Desktop.
Save CJentzsch/12a9df0d33b8964dff7e1003f0793464 to your computer and use it in GitHub Desktop.
Refund.sol
contract Refund {
address public mother = 0xbb9bc244d798123fde783fcc1c72d3bb8c189413;
mapping (address => bool) public blackList;
uint public totalSupply = 12000000000000000000000000000; // to be replaced with the exact number
uint public totalWeiSupply = 12000000000000000000000000000; // to be replaced with the exact number
uint public multiplier = 1;
uint public divisor = 1;
uint public attackTime = 0;
uint public fixChildDAOsListTime = 0;
function Refund(){
blackList[0xb136707642a4ea12fb4bae820f03d2562ebff487] = true;
blackList[0x304a554a310c7e546dfe434669c62820b7d83490] = true;
blackList[0x84ef4b2357079cd7a7c69fd7a37cd0609a679106] = true;
blackList[0xf4c64518ea10f995918a454158c6b61407ea345c] = true;
blackList[0x4613f3bca5c44ea06337a9e439fbc6d42e501d0a] = true;
blackList[0xaeeb8ff27288bdabc0fa5ebb731b6f409507516c] = true;
blackList[0x304a554a310c7e546dfe434669c62820b7d83490] = true;
blackList[0xfe24cdd8648121a43a7c86d289be4dd2951ed49f] = true;
}
function withdraw(address _child){
uint balance = DAO(mother).balanceOf(msg.sender);
if (DAO(mother).transferFrom(msg.sender, this, balance)) {
msg.sender.send(balance * totalWeiSupply / totalSupply);
}
if (blackList[_child] || DAO(_child).lastTimeMinQuorumMet() > fixChildDAOsListTime) throw;
uint childBalance = DAO(_child).balanceOf(msg.sender);
if (childBalance != 0 && DAO(_child).transferFrom(msg.sender, this, balance)) {
if (DAO(_child).lastTimeMinQuorumMet() > attackTime)
msg.sender.send(balance * totalWeiSupply * multiplier / (totalSupply * divisor));
else
msg.sender.send(balance * totalWeiSupply / totalSupply);
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment