A message from our CEO about the future of Stack Overflow and Stack Exchange. Read now.

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.

51 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
4
votes
3answers
281 views

Inability to verify contract with ABIEncoderV2 on Etherscan

Yesterday I deployed a contract to Ropsten (https://ropsten.etherscan.io/address/0x1fe59c223fa4e9781237f0f49a15ca598069cc30) that relies on V2 of the ABI encoder. Thus it includes statement pragma ...
3
votes
0answers
69 views

Methods and constants order in the contract ABI

Is it possible to annotate methods and constants order in the contract ABI before compilation?
2
votes
1answer
42 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
42 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
228 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
372 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
213 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
143 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
356 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
18 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 (...
1
vote
0answers
15 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 ...
1
vote
0answers
31 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
219 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
22 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
48 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
33 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
166 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
122 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
250 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
162 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
16 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
122 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
74 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
150 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
58 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
405 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
1answer
11 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 ...
0
votes
0answers
26 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
40 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
1answer
251 views

TypeError: Wrong argument count for function call: 2 arguments given but expected 1. Use abi.encodePacked

I was playing with this post code example: function random() private view returns (uint8) { return uint8(uint256(keccak256(block.timestamp, block.difficulty))%251); } But I'm always ...
0
votes
0answers
26 views

How does remix decode a contract response without the ABI?

Remix seems to be able to decode the output of a contract to a block of JSON without having the ABI (say I just specify the contract address). How is this achieved - I'm interested in doing something ...
0
votes
0answers
77 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. ...
0
votes
1answer
24 views

Is the encoded ABI of a function guaranteed to be unique?

I assume that two functions of different prototypes will yield two different encoded ABIs. Is that correct? With regards to two functions of the same prototype, I tested a pair of functions which ...
0
votes
0answers
55 views

could n't find ABI constructor in my input data

I have developed the solidity code and need to verify the smart contract but I could not find Constructor Arguments ABI-encoded check the screenshots, i have developed in testnet
0
votes
1answer
589 views

abi.decoder in solidity

Im trying to decode a bytes memory _data parameter directly in a smart contract. Im currently running: var data = await abi.encode("120000000000000000000", user2, OCcontract1.address, "...
0
votes
0answers
121 views

Golang web3.eth.abi.encodeParameters equivalent

I need to encode some data in golang like using the web3.eth.abi.encodeParameters(paramsTypes[], params[]) I tried to use golang's ABI.Pack(functionName string, params) but it's not a good solution ...
0
votes
1answer
115 views

what type of encoding is used by the abi specification in solidity

the abi specification of solidity which provides functions like abi.encodePacked() using a certain type of encoding (eg: for functions, a 4 byte function signature hash followed by encoding of ...
0
votes
0answers
78 views

Can I use an address value in such a hash function

I have a method which updates 3 mappings in my contract. To save data I use some items properties and message sender address, which allows easily to get users data. mapping(bytes32 => uint256) ...
0
votes
1answer
24 views

Why is it that my first original contract containing the setters and gettters are not showing up when I hit deploy?

pragma solidity ^0.4.24; contract Bank{ uint private value; constructor(uint amount) public{ value = amount; } function deposit(uint amount) public{ value += amount; ...
0
votes
1answer
459 views

Where do I find the “constructor arguments” for a contract deployed with Remix?

When try to verify token, I dont know what to put in for this line: Constructor Arguments ABI-encoded (For contracts that accept constructor parameters) I made token after looking at a YouTube ...
0
votes
0answers
47 views

hash an array of structs

So what I am trying to do is create a keccak256 of an array of structs. pragma solidity ^0.4.24; pragma experimental ABIEncoderV2; contract Test { struct test1 { address test; ...
0
votes
1answer
720 views

How to find ABI and verify my contract

When I try to verify my contract , it returned: Note: Contract was created during TxHash# 0x8a13fd16a810e886266d49addf46e459847d583528f966561e45abdd34a13e14 Result: Does not match the input creation ...
0
votes
1answer
115 views

How to identify the bytecode of a single function

I am trying to generate the bytecode for a single function. I need to avoid any setup/teardown that may occur in the contract as I am trying to get a precise measurement of the execution time in the ...
0
votes
1answer
96 views

Getting error : This type of error is only supported in new experimental ABI Encoder while passing struct inside function

How can I pass struct to Function I tried doing it but all in vain struct testSruct { uint size; } function testFunc( testSruct test) public returns(bool replaced) { return true; } ...
0
votes
1answer
112 views

Is remix ABI generator still working?

I have recently used the ABI generator fo remix, but when I copy the ABI and paste it in my Geth I get an error: var abi=x; // where x is abi copied from remix ethereum website. However, if I copy ...
0
votes
1answer
293 views

Can I find constructor arguments from truffle artifact?

I'm in the process of verifying my contract on Etherscan. Etherscan asks for ABI-encoded constructor arguments during the verification process, though I was a bit silly and don't quite know what they ...
0
votes
1answer
695 views

Can not verify contract on etherscan.io “Error! Unable to generate Contract ByteCode and ABI”

I am getting the error "Error! Unable to generate Contract ByteCode and ABI" When I try to verify this code. I have split it into two pieces as I import it but not sure how to include it all in ...
0
votes
1answer
392 views

ABI for Etherscan verification

How I can get ABI in multiple contract code? if the code is here: Token address is: 0x4960a0Db832c3Bb503F3Da59a274D9385e0Ade5A Crowdsale contract: 0x7a76d1A86a8b801865eC9134552904366b327A45 I ...
0
votes
0answers
129 views

Reinstantiating deployed contract

Looked at multiple answer for this question but they seem to be out of date. I committed a contract to the testnet chain, closed my geth console and upon starting the console again would like to ...