Skip to content

Commit

Permalink
add link to JSON interface spec docs
Browse files Browse the repository at this point in the history
  • Loading branch information
cyborgRen committed Feb 25, 2024
1 parent 95807a6 commit 7960dea
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/web3-eth-abi/src/api/functions_api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@ import { AbiFunctionFragment } from 'web3-types';
import { isAbiFunctionFragment, jsonInterfaceMethodToString } from '../utils.js';
import { encodeParameters } from './parameters_api.js';

// todo Add link to JSON interface documentation
/**
* Encodes the function name to its ABI representation, which are the first 4 bytes of the sha3 of the function name including types.
* The JSON interface spec documentation https://docs.soliditylang.org/en/latest/abi-spec.html#json
* @param functionName - The function name to encode or the `JSON interface` object of the function.
* If the passed parameter is a string, it has to be in the form of `functionName(param1Type,param2Type,...)`. eg: myFunction(uint256,uint32[],bytes10,bytes)
* @returns - The ABI signature of the function.
Expand Down Expand Up @@ -75,9 +75,9 @@ export const encodeFunctionSignature = (functionName: string | AbiFunctionFragme
return sha3Raw(name).slice(0, 10);
};

// todo Add link to JSON interface documentation
/**
* Encodes a function call using its `JSON interface` object and given parameters.
* The JSON interface spec documentation https://docs.soliditylang.org/en/latest/abi-spec.html#json
* @param jsonInterface - The `JSON interface` object of the function.
* @param params - The parameters to encode
* @returns - The ABI encoded function call, which, means the function signature and the parameters passed.
Expand Down

0 comments on commit 7960dea

Please sign in to comment.