From ebdda6387dac50cebe4154565264bdb6458b08db Mon Sep 17 00:00:00 2001 From: Mikko Ohtamaa Date: Thu, 28 May 2020 21:07:55 +0200 Subject: [PATCH 1/2] More about encodeABI Somebody asked about encodeABI so decided to add some colour for the function description. --- docs/web3-eth-contract.rst | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/docs/web3-eth-contract.rst b/docs/web3-eth-contract.rst index 3ed5c00f059..76c0adbdd26 100644 --- a/docs/web3-eth-contract.rst +++ b/docs/web3-eth-contract.rst @@ -986,8 +986,9 @@ methods.myMethod.encodeABI myContract.methods.myMethod([param1[, param2[, ...]]]).encodeABI() -Encodes the ABI for this method. This can be used to send a transaction, call a method, or pass it into another smart contract's method as arguments. +Encodes the ABI for this method. The resulting hex string is 32-bit function signature hash plus the passed parameters in Solidity tightly packed format. This can be used to send a transaction, call a method, or pass it into another smart contract's method as arguments. Set the `data` field on `web3.eth.send()` transaction as the `encodeABI()` payload and it is the same as calling the contract method with `contract.myyMethod.send()`. +Some use cases for `encodeABI()` include: preparing a smart contract transaction for a multisignature wallet, working with offline wallets and cold storage and creating transaction payload for complex smart contract proxy calls. ---------- Parameters From 6d30ca9468fb42117643d6ea6bfb1eaf6c851c7a Mon Sep 17 00:00:00 2001 From: Ryan Ghods Date: Mon, 1 Jun 2020 17:01:47 -0700 Subject: [PATCH 2/2] Update docs/web3-eth-contract.rst Co-authored-by: cgewecke --- docs/web3-eth-contract.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/web3-eth-contract.rst b/docs/web3-eth-contract.rst index 76c0adbdd26..4006d4b7bb0 100644 --- a/docs/web3-eth-contract.rst +++ b/docs/web3-eth-contract.rst @@ -986,7 +986,7 @@ methods.myMethod.encodeABI myContract.methods.myMethod([param1[, param2[, ...]]]).encodeABI() -Encodes the ABI for this method. The resulting hex string is 32-bit function signature hash plus the passed parameters in Solidity tightly packed format. This can be used to send a transaction, call a method, or pass it into another smart contract's method as arguments. Set the `data` field on `web3.eth.send()` transaction as the `encodeABI()` payload and it is the same as calling the contract method with `contract.myyMethod.send()`. +Encodes the ABI for this method. The resulting hex string is 32-bit function signature hash plus the passed parameters in Solidity tightly packed format. This can be used to send a transaction, call a method, or pass it into another smart contract's method as arguments. Set the `data` field on `web3.eth.sendTransaction` options as the `encodeABI()` result and it is the same as calling the contract method with `contract.myMethod.send()`. Some use cases for `encodeABI()` include: preparing a smart contract transaction for a multisignature wallet, working with offline wallets and cold storage and creating transaction payload for complex smart contract proxy calls.