-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Open
Labels
investigateUnder investigation and may be a bug.Under investigation and may be a bug.v6Issues regarding v6Issues regarding v6
Description
Ethers Version
6.7.1
Search Terms
parseTransaction,address toBeHex
Describe the Problem
This transaction is an Ethereum mainnet transaction, https://cn.etherscan.com/tx/0x683167e4a06a66c64f982bccdd7bcf401096d6be755e9c79fc7b335e03f0d4b9
const contractInterface = new Interface(abis.ERC20Abi);
const parsedData = contractInterface.parseTransaction({ data:"0xa9059cbb00000000000000000000017cc8538c41ab04558d9a2994b98765a6d2f6d13500000000000000000000000000000000000000000000000000000000001dcd6500" });
console.log(parsedData, '===parsedData');
return parsedData;
Code Snippet
No response
Contract ABI
[
{
"anonymous": false,
"inputs": [
{
"indexed": true,
"internalType": "address",
"name": "owner",
"type": "address"
},
{
"indexed": true,
"internalType": "address",
"name": "spender",
"type": "address"
},
{
"indexed": false,
"internalType": "uint256",
"name": "value",
"type": "uint256"
}
],
"name": "Approval",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": true,
"internalType": "address",
"name": "from",
"type": "address"
},
{
"indexed": true,
"internalType": "address",
"name": "to",
"type": "address"
},
{
"indexed": false,
"internalType": "uint256",
"name": "value",
"type": "uint256"
}
],
"name": "Transfer",
"type": "event"
},
{
"inputs": [
{
"internalType": "address",
"name": "owner",
"type": "address"
},
{
"internalType": "address",
"name": "spender",
"type": "address"
}
],
"name": "allowance",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "spender",
"type": "address"
},
{
"internalType": "uint256",
"name": "amount",
"type": "uint256"
}
],
"name": "approve",
"outputs": [
{
"internalType": "bool",
"name": "",
"type": "bool"
}
],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "account",
"type": "address"
}
],
"name": "balanceOf",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "decimals",
"outputs": [
{
"internalType": "uint8",
"name": "",
"type": "uint8"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "name",
"outputs": [
{
"internalType": "string",
"name": "",
"type": "string"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "symbol",
"outputs": [
{
"internalType": "string",
"name": "",
"type": "string"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "totalSupply",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "recipient",
"type": "address"
},
{
"internalType": "uint256",
"name": "amount",
"type": "uint256"
}
],
"name": "transfer",
"outputs": [
{
"internalType": "bool",
"name": "",
"type": "bool"
}
],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "sender",
"type": "address"
},
{
"internalType": "address",
"name": "recipient",
"type": "address"
},
{
"internalType": "uint256",
"name": "amount",
"type": "uint256"
}
],
"name": "transferFrom",
"outputs": [
{
"internalType": "bool",
"name": "",
"type": "bool"
}
],
"stateMutability": "nonpayable",
"type": "function"
}
]Errors
TransactionDescription {
fragment: FunctionFragment {
type: 'function',
inputs: [ [ParamType], [ParamType] ],
name: 'transfer',
constant: false,
outputs: [ [ParamType] ],
stateMutability: 'nonpayable',
payable: false,
gas: null
},
name: 'transfer',
args: Result(2) [
recipient: value exceeds width (20 bits) (operation="toBeHex", fault="overflow", value=556514283519825059651953496263113110841818824652032, code=NUMERIC_FAULT, version=6.7.1)
at makeError (/Users/kakui/projects/client-monorepo/node_modules/ethers6/src.ts/utils/errors.ts:682:21)
at assert (/Users/kakui/projects/client-monorepo/node_modules/ethers6/src.ts/utils/errors.ts:702:25)
at toBeHex (/Users/kakui/projects/client-monorepo/node_modules/ethers6/src.ts/utils/maths.ts:194:15)
at AddressCoder.decode (/Users/kakui/projects/client-monorepo/node_modules/ethers6/src.ts/abi/coders/address.ts:34:34)
at /Users/kakui/projects/client-monorepo/node_modules/ethers6/src.ts/abi/coders/array.ts:108:31
at Array.forEach (<anonymous>)
at unpack (/Users/kakui/projects/client-monorepo/node_modules/ethers6/src.ts/abi/coders/array.ts:86:12)
at TupleCoder.decode (/Users/kakui/projects/client-monorepo/node_modules/ethers6/src.ts/abi/coders/tuple.ts:66:22)
at AbiCoder.decode (/Users/kakui/projects/client-monorepo/node_modules/ethers6/src.ts/abi/abi-coder.ts:209:22)
at Interface.parseTransaction (/Users/kakui/projects/client-monorepo/node_modules/ethers6/src.ts/abi/interface.ts:1201:37) {
code: 'NUMERIC_FAULT',
operation: 'toBeHex',
fault: 'overflow',
value: 556514283519825059651953496263113110841818824652032n,
baseType: 'address',
type: 'address'
},
500000000n
],
signature: 'transfer(address,uint256)',
selector: '0xa9059cbb',
value: 0n
}Environment
node.js (v12 or newer)
Environment (Other)
No response
Metadata
Metadata
Assignees
Labels
investigateUnder investigation and may be a bug.Under investigation and may be a bug.v6Issues regarding v6Issues regarding v6