Questions tagged [abi]

The Application Binary Interface (ABI) is the standard way to interact with contracts in the Ethereum ecosystem, both from outside the blockchain and for contract-to-contract interaction. Data is encoded according to its type, as described in this specification. The encoding is not self describing and thus requires a schema in order to decode.

Filter by
Sorted by
Tagged with
0
votes
0answers
18 views

Revert transaction payable error with abi.encodeWithSignature

I have two contracts: Validate.sol // SPDX-License-Identifier: MIT pragma solidity 0.8.4; contract Validate { function validate(address _verifier, bytes memory _validityData) public view { ...
0
votes
1answer
10 views

How to extract fourbyte signatures and resulting arguments from Solidity compiler output?

It seems that the Solidity compiler output has JSON that lists methods and their arguments as a complex nested JSON structure. How can I take parse structure and output the string and fourbyte that ...
0
votes
1answer
11 views

How do I find the code of a external interface function?

I am learning about importing contracts and noticed with the following contract there is an external interface function with no code block. Where does this code come from? function version() external ...
0
votes
1answer
31 views

How to get MethodID of a function in a smart contract?

If I look in the past transactions of a smart contract that called a function, I can see the MethodID being used. If the function was never used in the past, I would never know what was the method ID....
0
votes
0answers
28 views

Finding the appropriate ABI to read input data

Given the transaction hash 0x7da7a1645278c94434bdc8f54eae8f8f6bf8d1a730d84af38ffcc05ded24492f I would like to understand the input data better. To do this, I attempted loading the ABI of the verified ...
1
vote
1answer
13 views

Querying an ethereum contract without ABI, with only input bytes

I know some transaction has some input bytes to the contract as specified by Etherscan or a mining pool (for instance, this transaction has input data that looks like 0x000000062de258...9b1d). I know ...
2
votes
2answers
109 views

How to deploy a bytecode-only contract without an ABI

I see a contract's bytecode on chain that I want to re-deploy almost verbatim, but the issue is that there's no verification -- no ABI or source code. Can I still redeploy this contract to a hardhat ...
0
votes
1answer
16 views

Not able to create an ABI in vs code

I want to compile a smart contract on my vs code and also want to create a JSON file by using the following code at the end of my solidity code: with open("compiled_code.json", "w")...
0
votes
1answer
43 views

Abi Decode raw types with Go

I have a simple abi.encoded string data that has a series of raw types. In solidity I would decode data by using the abi.decode function. (uint256 total, uint256 id) = abi.decode(data, (uint256, ...
0
votes
1answer
26 views

Can I get abi file from deployed contract? or resore abi json file

I deployed ERC-721 contract to mainnet last night with truffle Contract is successfully deployed but no abi file generated (I don't know why..) so I can't run my dapp https://etherscan.io/address/...
1
vote
0answers
11 views

How to know contract functionality given only bytcode and address

Let's assume that we only have access to the address and bytecode of a smart contract (pure decentralization, no 3rd party tools such as etherscan etc). How can we understand or deduce what the ...
1
vote
0answers
66 views

Is the abi for all Uniswap V3 liquidity pools the same?

I would like to get the abis for some liquidity pool contracts of Uniswap V3. With the etherscan api this is only possible for verified contract code. For a random liquidity pool, the response is { ...
1
vote
1answer
11 views

Fetching InternalType data from another contract

basically I have this ABI for a contract {"internalType":"bytes","name":"_DATA","type":"bytes"}],"name":"function","...
0
votes
1answer
49 views

Encode function data with value

I have Contract A: import "@openzeppelin/contracts/utils/Address.sol"; contract A { using Address for address payable; function proxyCallWithValue(address payable target, bytes memory ...
1
vote
1answer
16 views

Generate documentation from ABI json

Is there a tool to generate readable documentation given a ABI json file? For example let's say I have this simple ABI: [ { "inputs": [], "name": "retrieve", &...
1
vote
1answer
25 views

How to view contract source code from ABI, address and bytecode?

I have the address and ABI of a contract. I can also view the bytecode from that address on Etherscan but not the source code. Is it possible to get the contract source code using these information?
0
votes
1answer
66 views

Ethers ENS setABI howto

I'm having trouble getting my ABI data registered with my ENS record. I am unable to find any examples which include ethers. I have tried using the artifact's abi object, JSON.stringify(abi), various ...
1
vote
1answer
11 views

Find contract address based on ABI

I'm trying to find the deployed address of a contract (on Ethereum mainnet) from its ABI or source code. Is it possible?
1
vote
1answer
51 views

Not sure how to decode log event where I can't get the ABI for the contract?

I am trying to decode some transactions logs and have hit a problem with one of the entries. In the event log for 0x1c50c336329a7ee41f722ce5d848ebd066b72bf44a1eaafcaa92e8c0282049d2 the first three ...
0
votes
1answer
54 views

How can i extract an activity name of a method signature from an ABI?

I am actually working for a research, I'm studying what happened in DAO Hack and I'm looking for some infos in the ABI of TheDarkDAO's smart contract. Exactly I am trying to understand how to discover ...
0
votes
1answer
47 views

How to get abi from ByteCode?

How i can get ABI from source code of contract? pls help! if you know how this can be done, I will pay you, here is my telegram - https://t.me/Aarne19
0
votes
1answer
36 views

The Graph nodes can't decode ABI encoded data containing arrays

I'm currently having an issue with decoding a function call inside a Subgraph mapping that seems to be related to builtin abi decoder of a Graph node: Given this input: ...
0
votes
0answers
26 views

Is there a way to get a smart contract's ABI automatically using python?

I am scraping a smart contract trying to get the ipfs link for its tokens, but each of these tokens comes from different smart contracts. I have the tokenIDs and the specific smart contract addresses ...
0
votes
1answer
78 views

Return values aren't valid, did it run out of gas? while calling a function from the abi file

Uncaught (in promise) Error: Returned values aren't valid, did it run Out of Gas? You might also see this error if you are not using the correct ABI for the contract you are retrieving data from, ...
0
votes
0answers
21 views

Is it possible to use the old ABI of proxy contracts to query the balance of proxy contract historically?

I am trying to build a web application to query the balance of a wallet address in the pool. However, the problem is that the ABI of a proxy contract changes all the time but I would still like the ...
0
votes
1answer
53 views

What is the output of abi.encodePacked(x,y)?

What does the abi.encodePacked("abcdef", "123") function do and how can I simulate the output? This function is missing in these projects web3-eth-abi, ethereumjs-abi and when I ...
0
votes
1answer
24 views

How to get ABI from vyper source code?

My main gold is to interact with contract. Rexmix online IDE gives solidity and Yul language. To interact my contract I need ABI Question How does vyper source code give me an ABI file?
0
votes
1answer
36 views

How to encode function signature besides parameters using eth_abi

I want to encode a contract's function signature together with parameters and values using python, more explicitely the eth_abi library. tokenA = "0xbb4CdB9CBd36B01bD1cBaEBF2De08d9173bc095c"...
0
votes
1answer
26 views

Recover Source Code with ABI & Bytecode?

I stupidly lost my smart-contract source code due to a PC crash and was unable to recover it. I have an old version saved but much of the work I've done is lost. Luckily, I have the ABI, ByteCode, ...
3
votes
1answer
118 views

Can abi.encode receive different values and return the same result?

I'm searching for vulnrabilities and I have the following code: function hash( address[] memory addresses, uint256[] memory values, bytes[] memory data, bytes32 description ) public ...
0
votes
0answers
48 views

I am not able found ABI ,Write and read contracts in Bscscan

I am getting ABI for my contract,instead i am getting [].After deploying the contract in remix IDE ,after verification process.I am not getting write and read contract
0
votes
0answers
51 views

Where i can take ABI this contract?(BSC)

contract_address = 0x1EE6539c12361B6Bc1fB930435c70D557DEE392f example transaction = 0xc6f7c6f441d01a05347f1758d90154095f47240a74180ac6abd6a02cc1614dac I need do transaction with python code, but i can`...
0
votes
0answers
16 views

Decoding Ethereum Logs Best Practices

So given a hash, you can get only a partial overview of what the transaction did. If it was a purely ether coin transfer, the value field should tell you how much changed hands. But in more ...
0
votes
1answer
227 views

How do you pass ABI-encoded parameters to abi.encodeWithSignature / abi.encodeWithSelector as a single bytes object?

Given a function setXY(uint256 x, uint256 y), how can I encode data parameters x and y into a single bytes data array that can be fed into abi.encodeWithSignature('setXY(uint256,uint256)', data)? ...
0
votes
0answers
30 views

Changing contract address in the ABI of the front-end

I am developing a react dapp and have a smart contract deployed on the test net. I am deeply concerned with regards to the security of this dapp. This question is very much related to this As I ...
1
vote
1answer
308 views

How to encode tuple parameters?

I found many tools to encode parameters online, but besides web3 and thus Etherscan, none of them supports tuples/struct. And my problem is I’m unable to find the correct syntax. So obviously : [['...
0
votes
1answer
64 views

Need help: python3 script that will call an ABI function (withdraw funds) of a smart contract (dYdX)

I don't know enough about python or web3, and I must use the smart contract's ABI. I am using Infura for my node and do not run a local node. The smart contract is ...
2
votes
2answers
573 views

Decode input parameter without ABI

I have a transaction with input data that looks like this: 0x2293db5700000000000000000000000030823e060e8be429b34bd9192df9cad4b166a056 I know that the last 40 characters is the token address which ...
0
votes
1answer
71 views

How to load the first 4 bytes from a bytes calldata var?

It is common for calldata to be encoded as bytes calldata when developing contracts in Solidity. I need to extract the function selector from such a bytes var. What's the best way to load the first 4 ...
0
votes
1answer
380 views

etherjs equivalent of abi.encodeWithSignature

I'm encoding parameters on-chain to pass into new OZ Beacon proxy instances. For verification purposes, I need to encode the same arguments via ethers.js The solidity function: abi.encodeWithSignature(...
0
votes
1answer
81 views

Web3.py: encoding zero-length byte array

I'm using Web3.py, and I'm trying to build a transaction to call a contract function where one of the arguments is of type "bytes". I want to call the function with a zero-length byte array. ...
1
vote
1answer
295 views

web3 equivalent of abi.encodePacked

What is the equivalent of abi.encodePacked in web3? I am trying to generate the equivalent of (solidity) keccak256(abi.encodePacked("\x19Ethereum Signed Message:\n32", domainHash, ...
1
vote
1answer
76 views

Why does solidity use a MethodID for functions instead of the function signature?

I understand that a MethodID is derived from a function signature and used so that a particular contract function can be specified in the "data" attribute of a transaction. But I'm not sure ...
2
votes
2answers
475 views

Why some ERC20 tokens have different Transfer event ABI signature than Transfer(address,address,uint256)?

Looking at ChainLink ABI (using this tool) I see { "anonymous": false, "inputs": [ { "indexed": true, "name": "from", "type": &...
0
votes
0answers
29 views

Solidity ABI decode equivalent in web3js

This is the Solidity code from this oracle contract: function transmit(bytes calldata _report, ...) external { ... (r.rawReportContext, rawObservers, r.observations) = abi.decode( ...
0
votes
0answers
30 views

What purpose of merkleProof in contract?

I found a ABI list of this contract in bscscan: 0x16fb38712d355833647f4adfb1f6ff80f289c203. I dont know what is the purpose of _merkleProof parameter as below and what value that I can pass for it? { ...
0
votes
0answers
18 views

Can I catch malformed structs with try/catch in an external contract?

I want to check whether a bytes variable can decode to a certain struct and do stuff if does not. However, abi.decode reverts on fail, and apparently you can't wrap it in a try/catch, so I wrapped the ...
0
votes
0answers
92 views

How to decode input for tx sent to zero address (contract creation tx)

Decoding transaction input data requires providing ABI. How can I decode transaction input from a transaction issued to "zero" address? This special address is used for creating new ...
1
vote
0answers
720 views

invalid BigNumber value (argument="value") Error trying to trigger contract method from ABI

From the ABI in a VueJS frontend I'm trying to trigger the following method in my contract: // Payout.sol function checkStatusAndPay(bytes32 _gameId, int _winner) public notDisabled onlyOwner returns ...
1
vote
1answer
366 views

Pancake Swap Factory smart contract error

I am using web3js to call PancakeFactory v2 contract (bscscan): contract address: 0xcA143Ce32Fe78f1f7019d7d551a6402fC5350c73 Anytime I want to call any function present in the contract I end up with ...

1
2 3 4 5
8