Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature-request: methodCall API #20069

Open
holiman opened this issue Sep 13, 2019 · 2 comments
Open

Feature-request: methodCall API #20069

holiman opened this issue Sep 13, 2019 · 2 comments

Comments

@holiman
Copy link
Contributor

holiman commented Sep 13, 2019

From a discussion on discord with @MicahZoltu
It would be good to add a method to Clef so that dapps can request signing method calls without constructing the calldata. Something like this

{
    "method_call": {
        "contract_address": "0xabcd1234...",
        "signature": "transfer(address, uint256)",
        "parameters": [ "0x1234abcd...", "1,000,000,000,000,000,000" ]
    }
}

This does not provide any details about nonce, gasPrice etc, so that would have to be either added

{
    "method_call": {
        "contract_address": "0xabcd1234...",
        "signature": "transfer(address, uint256)",
        "parameters": [ "0x1234abcd...", "1,000,000,000,000,000,000" ]
    }, 
   "tx_data":{
      "nonce": 1, 
      "sender" : "", 
      "gasPrice": "...", 
   }
}

Alternatively, we could add this method to eth_-namespace in Geth, and geth could fill the blockchain details, and then pass it on to clef.

@MicahZoltu
Copy link
Contributor

I'm a fan of the dapp only providing the first JSON block and leaving nonce management, gas pricing, and gas estimation to Geth (or whatever sits between the signer and the dapp). As a dapp developer, I don't think that those are things that are appropriate for the dapp to be managing.

One exception is for variable gas cost calls, where changes in the chain may result in gas cost estimations being too low. There could be value in the API providing a mechanism for the dapp to say, "This is a variable cost transaction, we recommend XXX gas for it." Ideally, dapp developers would only use this when the transaction is truly variable, but otherwise they would lean on the node to do estimation.

@MicahZoltu
Copy link
Contributor

It would be nice if this API also left space for something like ethereum/EIPs#719 in it, so the node can present the user with a human readable signature prompt.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants