Skip to content

Instantly share code, notes, and snippets.

@holiman
Created June 18, 2016 19:03
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save holiman/f66bae83540728c209e521c42bd06362 to your computer and use it in GitHub Desktop.
Save holiman/f66bae83540728c209e521c42bd06362 to your computer and use it in GitHub Desktop.
contract DeliveryBoy{
/*
* Delivery boy is very important, but not so clever
*/
function deliver(address recipient){
selfdestruct(recipient);
}
}
contract MailMan{
/*
* The MailMan delivers
* No-fuzz delivery of ether to the recipient.
* Mailman tolerates no code-execution or funny stuff on cash delivery
* Nobody owns the mailman (no 'owner')
* Mailman remembers nothing (no storage slots)
*
* You wanna use mailman for payment?
* Go ahead, but its'a gonna cost'ya some extra gas, capisce...
*/
function payRecipient(address recipient)
{
DeliveryBoy d = new DeliveryBoy();
d.deliver.value(msg.value)(recipient);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment