Encoding
Transaction and contract encoding
ABI
// 1 - Create a simple function to encode into ABI
const simpleAbiFunction = new ABIFunction({
constant: false,
inputs: [
{
name: 'a1',
type: 'uint256'
},
{
name: 'a2',
type: 'string'
}
],
name: 'f1',
outputs: [
{
name: 'r1',
type: 'address'
},
{
name: 'r2',
type: 'bytes'
}
],
payable: false,
stateMutability: 'nonpayable',
type: 'function'
});
// 2 - Encode function
const encodedFunction = simpleAbiFunction.encodeData([1, 'foo']).toString();Contract
RLP Encoding
Last updated
Was this helpful?