Skip to content

Instantly share code, notes, and snippets.

View tarrencev's full-sized avatar

Tarrence van As tarrencev

View GitHub Profile
@tarrencev
tarrencev / TransactionDelegate.sol
Last active May 23, 2018 20:31 — forked from backus/EthedIn.sol
Example #1 for "How to make a user friendly Ethereum dApp"
// Transaction Delegation is a generic way to enable transactions to be signed by one ethereum account
// and be sent by a different account. Enabling improved UX patterns where users of an application
// do not need to pay for transaction gas and do not necessarily need to have any ether at all to
// interact with an application.
//
// To delegate a transaction, a user A creates a transaction and signs the hash keccak256(calldata, nonce).
// The calldata and signature v, r, s is then communicated to user B who will submit the transaction on
// their behalf. User B submits the transaction by calling `TransactionDelegate.delegatedTxn`.
//
// This contract requires elevated privledges to the target contract allowing it to submit transactions