2

Assuming I have a DApp that relies on people having some injected Web3 available such as MetaMask. If I detect that they do not have Web3, how can I forward them to myetherwallet offline transactions such that To Address, Value, and Gas Limit are prefilled?

What I mean is, it should look like this without users having to copy and paste the value, gas limit, and my address to send Ether from their account:

enter image description here

6

MyEtherWallet supports URI Strings on the Send Transaction Page.

  • to=[address]
  • value=[number]
  • sendMode=[ether | token]
  • tokenSymbol=[ARC | ICN | MKR | ....]
  • gasLimit=[number] OR gas=[number]
  • data=[hex data]

Example 1: https://www.myetherwallet.com/?to=0x7cB57B5A97eAbe94205C07890BE4c1aD31E486A8&value=1&tokenSymbol=REP&gaslimit=50000#send-transaction

Example 2: https://www.myetherwallet.com/?to=0x7cB57B5A97eAbe94205C07890BE4c1aD31E486A8&value=1&gaslimit=23000&data=0x5468616e6b20796f752c204d455720322e30#send-transaction

  • is value in wei or ether? – SmCaterpillar Oct 6 '17 at 12:48
  • 1
    The value is just a value, if you enter 2, it will input 2 in the value/amount to send field. So you could say it's in Ether, but it works with tokens as well. – Wietze Oct 6 '17 at 13:07
  • 1
    FYI, It was recently brought to my attention that these may or may not work in all cases anymore. I believe when things were updated for gasPrice or the custom gasLimits for ICOs or address-or-ENS-address-fields, things weren't properly updated. 😭 – tayvano Oct 6 '17 at 17:51
  • 1
    Does this also work for myetherwallet.com/#contracts as well? Can I specify the method and encoded data as well? Is there a documentation somewhere? – SmCaterpillar Oct 12 '17 at 10:46
  • @SmCaterpillar you can use conteract.io for that purpose. For example, this link - conteract.io/c/86198dcd06?function=getAddr&AddrName=owner - will automatically init the getAddr function with owner as an argument of the function which is defined as AddrName. – Sowmay Jain Jun 19 '18 at 12:02

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.