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.

65 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
3
votes
0answers
71 views

Methods and constants order in the contract ABI

Is it possible to annotate methods and constants order in the contract ABI before compilation?
3
votes
1answer
404 views

How to convert string to type defined by an abi.Type for payload construction?

I am writing a CLI in Go that should faciliate users to be able to make contract function calls from it. This entails generating contract ABIs and providing input parameters to the function arguments ...
2
votes
1answer
55 views

Automatically extracting functions names and parameters from ABI JSON file

I have done some work on captioned subject. For example, I can extract all getter functions (and some constructors as well) of all given smart contracts (in abi json file format). Then i can call (...
2
votes
0answers
36 views

What is the purpose of `internalType` now generated by the Solidity compiler in ABIs?

Newer Solidity 0.5.x compilers generate ABIs whose function and event parameters contain an internalType field as well as the usual type. In the examples I've seen, type and internalType usually have ...
2
votes
2answers
130 views

Hashnot matching generated from solidity contract and web3js

I want to make hash same as generating by solidity contract from web3 or ether's js. In solidity contract hash generation by below : sha256(abi.encodePacked(no of parameters)). Kindly help for it. ...
2
votes
0answers
51 views

Why I can't use two functions with same name, but different parameters

I have a function which returns address but it gives me error if I try to read it. I'll explain by a quick example: Solidity: contract TestOneReturn { mapping(uint => uint) m_Data; ...
2
votes
1answer
597 views

How can I decode the inputs to a transaction written by a smart contract constructor with Nethereum?

I've been able to decode the inputs to a contract function transaction given the ABI as follows: var myFunction = contract.GetFunction("MyFunction"); var myFunctionTxn = await contract.Eth....
2
votes
0answers
233 views

“queue limit” error

I try to deploy a smart contract and every time i receive "queue limit" error. Here is what i do: Web3 = require("web3") web3 = new Web3(new Web3.providers.HttpProvider("http://localhost:8545")); ...
2
votes
1answer
159 views

How can I check if a contract contains a specific function signature in the ABI?

I'm using Geth and thinking maybe I'll have to deep dive into the Go code to make this happen, but it should be possible. What would I need to do to check if a function signature exists in a contract?
2
votes
0answers
360 views

eth_sendTransaction for function with address type parameters

I'm interacting with my local private blockchain created using geth. I'm able to use eth_call, but now I have some problems with eth_sendTransaction. The signature of the function is this: function ...
1
vote
1answer
10 views

How can I do abi.encodePacked in Python or PHP?

Just concatenating strings doesn't work. Keccak::hash(10 . $address, 256) is what I'm doing atm.
1
vote
0answers
18 views

Cannot read property 'methods' of null

My teammate has deployed ERC 20 token to rinkeby test network using the truffle openzeppelin code. Now I wanted to interact with that token by using ABI and the contract address of that token using ...
1
vote
1answer
27 views

Events declared in library are missed in contract ABI

DYDX contract SoloMargin is firing events like LogTrade, LogSell but they are not provided in ABI. SoloMargin contract: https://etherscan.io/address/0x1e0447b19bb6ecfdae1e4ae1694b0c3659614e4e#code ...
1
vote
1answer
159 views

How to get contract object using ABI json and address with web3j?

I worked with web3js(JavaScript) and used web3.eth.Contract with 2 params (json, address) and successfully got contract object. Now I started to work with web3j(Java) and don`t understand how I have ...
1
vote
0answers
53 views

How to call the super contract function where msg.sender should be same in solidity?

I am trying to call contract A.fun_A() via Contract C contract A{ function fun_A(address tenant, uint itemId){ //Here the msg.sender should be msg.sender in C require(msg.sender == ...
1
vote
0answers
43 views

go-ethereum: Return data from contract function

I have a smart contract written in solidity. I deployed the contract to my Ganache network and I can interact with it via go-ethereum using stubs generated by abigen. My function returns a uint256, ...
1
vote
0answers
33 views

What is the maximum size of ABI in real world contracts?

To monitor my contracts during development and test in a private blockchain I’ve written an event explorer that encodes beside other parameter the ABI in an URL parameter. The ABI will be compressed ...
1
vote
1answer
24 views

arrays and structs for function arguments

A lot of contracts and libraries with functions that use arrays and structs for arguments. Structs can themselves include arrays, structs and mappings. For example: function doSomething(MyStruct ...
1
vote
0answers
85 views

Function selector computed differently for libraries?

As documented in various places, the function selector is computed as the first four bytes of the keccak256 hash of the function header, which consists of the function name followed by the list of ...
1
vote
0answers
347 views

Cannot read property 'type' of undefined - abi-coder

I'm creating a simple voting contract. It is deployed with truffle and infura. This is the contract code: pragma solidity >=0.4.21 <0.6.0; contract Voter { struct OptionPos { uint ...
1
vote
0answers
35 views

Where can i get total list of all existent Etehereum contract ABIs?

We all know that exists https://www.4byte.directory/ where we can get mapping (function selector) -> (function signatures). Is there a dataset where I can get mapping (contract address) -> (JSON ...
1
vote
0answers
75 views

How to pass array parameter. Drizzle

Is there have a way to pass array parameter from the drizzle to my contract ? I want to pass an array of uint[] i have read a lot about getData() function and encodeABI but how to use it in Drizzle ?
1
vote
0answers
44 views

Smart Contract ABI in Remix (Ethereum)

When I deploy smart contract on the Rinkeby network using Remix the ABI of smart contract does not contain its address, so how do I connect it with my frontend application.
1
vote
0answers
217 views

How to decode Tx data? Online tool?

Is there a fast way to decode the data returning from a Smart Contract call? I know there are github projects with JS libraries to decode this kind of data (such as https://github.com/ConsenSys/abi-...
1
vote
1answer
164 views

Error: Invalid number of arguments to Solidity function when calling safeTransferFrom function

I want to call the safeTransferFrom function to transfer ERC721 tokens. I am using the following code: var contract = this.web3.eth.contract(JSON.parse(contractabierc721)).at(contractAddress); // ...
1
vote
0answers
287 views

How to encode tuple as input parameter to function using web3j

I am attempting to call a solidity function that looks something like the following: function fillOrder( Order memory order, uint256 takerAssetFillAmount, bytes memory signature ) Using ...
1
vote
0answers
1k views

Error: Couldn't decode uint256 from ABI: 0x

I'm aware this is a duplicate, but the other never got authoritative answers and this is a simpler demonstration of the problem. I created this Contract: https://etherscan.io/address/...
1
vote
1answer
205 views

How to call solidity function in html 'inspect' console properly?

I can see my contract in my console. The solidity code and abi is in the the index.html. I can't figure out how to call this function and send 0.01 ether with it as well. I would think it is something ...
1
vote
0answers
17 views

Library/Framework for generating Contract Forms

Based on ABI, Mist is able to automatically generate forms for contracts for read/write access. Does someone know if there is a JS framework/library for this task? For the prototyping/demonstration ...
1
vote
1answer
136 views

Can an ABI file be made from separate json files by stripping out information?

I am looking at the CryptoKitties KittyCore contract. What I notice is that there are multiple contracts within the file. (https://etherscan.io/address/0x06012c8cf97bead5deae237070f9587f8e7a266d#code)....
1
vote
1answer
81 views

Bytecode version of ABI

I wonder if aside the Json representation of ABI is there a bytecoded and compact version of the same interface. Json is human readable, but in some cases it is just an overkill.
1
vote
2answers
174 views

How can I find all contracts that support a particular ABI?

I'm trying to find an easy way to scan the blockchain for contracts that support a particular ABI. Take ERC20 as an example: What is the easiest way to find all the ERC20 supporting contracts on the ...
1
vote
0answers
61 views

Where in the compile process do storage indexes get assigned to variable names and where can I sniff that data?

I have found the articles explaining how storage works and I understand that if I have a mapping that I need to know the key. What I'm trying to do is figure out how given, solidity code, abi, and ...
1
vote
1answer
431 views

Ethereum Contract ABI - Encoding for functions with no arguments

I am using argument encoding from this page (https://github.com/ethereum/wiki/wiki/Ethereum-Contract-ABI) to build data field for offline signing. I am using eth.sendRawTransaction to call a function ...
0
votes
0answers
12 views

Generating a React UI given a contract ABI

Is there a way to automatically generate a React input form as per a contract address and ABI input by a user? The user inputs a contract address and an ABI. Now, an input form is generated for him as ...
0
votes
0answers
15 views

What's the difference between the two ways that contract B interacts with contract A?

The deployed contract A: A.sol: contract A { function testA() public returns(uint) {return 1;}; } Here is the first way that contract B interacts with contract A: B.sol: import "./A.sol"...
0
votes
0answers
20 views

No ABI produced with online remix compiler if any libraries defined above main contract

I am using remix online http://remix.ethereum.org/ to compile smart contracts, but the ABI is not being produced if the contract has any libraries or other definitions above the contract code itself. ...
0
votes
0answers
34 views

Is there a c++ library to encode abi

I am writing a c++ wallet and I need to be able to encode smart contract function calls in ABI format. I found that the web3 library has the ability, but it is written in JS. Is there a c++ ...
0
votes
1answer
22 views

How do I receive a revert message using go-ethereum

How do I receive a revert message using go-ethereum? receipt, err := bind.WaitMined(context.Background(), client, tx) if err != nil { fmt.Errorf(err) } fmt.Println(receipt.Status) Now I can only ...
0
votes
1answer
38 views

Cannot figure out how to set constructors and ABI for a contract

So I've been breaking my head over this for the last 2 days. I cannot seem to figure out how to get the constructors and ABI set up properly. I'm testing smart contracts by copying Sushi contract from ...
0
votes
0answers
21 views

Read ABI directly from network api in GOLang

Using go-ethereum package how can we read the JSON file of the deployed contract and then get the ABI out of it and then instantiate? I don't want to compile smart-contracts into GO but want to use ...
0
votes
0answers
56 views

Can unverified contracts expose a public ABI?

I am trying to understand if there are unverified contracts that come with a public ABI. I was exploring contracts on Etherscan, and I was only able to find unverified contracts without source code ...
0
votes
0answers
58 views

`web3.eth.abi.decodeParameters()` not returning correct values

I call to a method that returns two contract addresses, like this, where method is the method object taken from the ABI (triple-checked that already): web3.eth.call( { from: account, ...
0
votes
1answer
26 views

How to use initialize a bytes array with abi data?

To initialize a bytes array with the bool value True encoded as ABI data, I'm attempting to do it like this: bytes memory arr = '0x0000000000000000000000000000000000000000000000000000000000000001'; ...
0
votes
0answers
42 views

Error calling view function: Returned values aren't valid, did it run Out of Gas?

I compiled my code on 0.6.6 solidity compiler and the code ABI for the function im calling is: { "inputs": [{ "internalType": "address", "name": "user", "type": "address" }], "name": "getAssetIds", "...
0
votes
0answers
192 views

Interacting with contract in myetherwallet

I have developed some smart contracts and deployed/interacted with them successfully using truffle framework. However, when copying the main smart contract's address and it's ABI into myetherwallet to ...
0
votes
0answers
10 views

Aragon: How to update files after a contract compiles

I need to update certain files (in app/public/) every time when a contract compiles. Namely I need to extract the ABI from a contract and store in app/public/. Is it possible with the current version ...
0
votes
0answers
31 views

creating transaction with dynamic arguments (objects/variables)

My scenario is to make transactions (deploy contract, calling its functions, etc.) with arguments (which are dynamically created/extracted from some json abi file). For example; function ...
0
votes
1answer
50 views

How to automatically identify which value is stored in specific location of transaction input , given a smart contract source code and ABI?

For example, a function's name and parameters are given as following: function batchTransfer(address[] _receivers, uint256 _value) public returns (bool); Then I want to get a python dictionary whose ...
0
votes
0answers
115 views

Why am I getting the error "Expected pragma, import directive or contract/interface/library definition?

I have "pragma solidity ^0.5.9" at the start of the file yet I still get this error. Listing.sol:1:1: ParserError: Expected pragma, import directive or contract/interface/library definition. ...