Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

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.

0
votes
0answers
13 views

Anyone with knowledge in org.web3j.abi.Type Decoder?

I am trying to decode a String with this code that I found but I have not been able to do it. String to = inputdata.substring(10, 74); String value = inputdata.substring(74, 138); Method refMethod = ...
1
vote
2answers
20 views

Encode constructor arguments used when deploying a contract

How can I encode the constructor arguments when deploying a contract? Here is my deployment function: async function deploy(abi, bin, args) { let contract = new this.web3.eth.Contract(JSON.parse(...
0
votes
1answer
15 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
8 views

How to decode transfer log data Node

I am trying to decode transfer log to get the addresses to and from, and potentially the value but most important address from and to. const subscribe = () => { subscription = web3.eth....
0
votes
2answers
21 views

where is the abi stored for a contract?

once a contract is compiled and deployed to the blockchain, it stores the 'runtime bytecode' in the blockchain (as I understand). but to invoke the functions of a contract by an EOA, it requires ABI ...
1
vote
1answer
58 views

How does delegatecall work from Solidity 0.5.0 onwards?

I am trying, for learning purposes only, to make a mutable smart contract, but I couldn't find anything useful on stackexchange because everything I found was using pragma solidity ^0.4.x; So, I have ...
0
votes
0answers
34 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) ...
5
votes
3answers
205 views

How is Metamask able to send erc20 tokens without ABI?

When I use web3js and Truffle, I cannot send tokens to another wallet without the Token Contract ABI. But Metamask only requires the token contract address to recognize and send the ERC20 tokens. How ...
1
vote
1answer
28 views

Function selector of function that takes enum as argument

If a function takes an enum as a parameter function foo(MyEnum arg1, uint256 arg2) public returns (bool); how do I properly compute the function selector for that function?
1
vote
1answer
47 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); // ...
2
votes
1answer
45 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 ...
0
votes
1answer
19 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
37 views

Is there a way to get the deployed contract from a contract ABI?

Found an implementation of a dapp that uses a solidity contract but what's only available is the contract ABI from their project and not the solidity file. Just wanna ask if this is possible.
1
vote
1answer
17 views

Dapp SDK - Hardcoded ABIs vs Dynamic ABIs

I am developing a Javascript SDK to allow for integration of external services with our Dapp. The SDK calls the smart contracts' methods and therefore needs to know contracts addresses and ABIs. ...
2
votes
1answer
521 views

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

I'm listening to events of my deployed contract. Whenever a transaction gets completed and event is fired receiving the response causes following error: Uncaught Error: Returned values aren't valid,...
0
votes
1answer
31 views

Are there UI-builders or automated UIs based on an ABI + contract address?

In order to demonstrate a contract, I want to use a generated UI, based on the ABI. The contract runs on local network, or on one of the testnets. Two options that I am aware of, and that work, but ...
0
votes
1answer
187 views

Couldn't decode uint256 from ABI: 0x

I'm trying to get all Transfer events from an account of an ERC721 token, I'm currently struggling with the following error. I googled around but couldn't find much helpful things. I'm definitely on ...
6
votes
1answer
37 views

Why is the returndata of a function returning bytes formatted in a weird way?

Solidity 0.4.25. Consider this code contract A{ function test() public view returns (bytes){ bytes memory output = abi.encodePacked(bytes32(1)); return output; } } The ...
1
vote
2answers
65 views

Can a Contract ABI change?

I am developing an app that is using the etherscan-api package. I use it to get the contract ABI. The problem is that I retrieve it via the API every time the function is called. My question is: ...
2
votes
0answers
25 views

What are function signatures in ABIv2 and how are they enhancing Ethereum?

EIP-712 talks about function signatures being bytes4. I understand that the new version of the ABI format will contain a pre-defined set of keccak256 hashes of function names, as per the work done on ...
1
vote
0answers
89 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 ...
0
votes
2answers
136 views

abi.encodePacked with lot of zeros

According this documentation types shorter than 32 bytes are neither zero padded nor sign extended and When I use abi.encodePacked(address, uint, uint, address) I am getting a result with lot of ...
0
votes
1answer
56 views

SyntaxError: invalid syntax on web.py with contract ABI

everybody, I'm stuck with a SyntaxError: invalid syntax every time I try running this script on the contract_abi variable that I got from the Remix IDE. I'm currently trying to connect with a smart ...
2
votes
1answer
73 views

How does a contract's constructor work and load input values?

I set up the following contract: pragma solidity ^0.4.25; contract Simplest { uint x; constructor(bool _lucky) public { if (_lucky == true) { x = 7; } else { ...
3
votes
2answers
149 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 ...
2
votes
1answer
115 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....
1
vote
2answers
151 views

Abi to call value

how to calculate ABI to call some variable in contract? for example contract X { uint data; function Y(uint a) {} } How to calculate signature to call variable "data" ? I know to call ...
3
votes
1answer
36 views

Function selector for constructor & fallback function?

According to https://github.com/ethereum/wiki/wiki/Ethereum-Contract-ABI, function selector is hashed from function name and list of its arguments put inside (). For example, with function deposit(...
0
votes
1answer
21 views

Does an Ethereum contract address hold two different kinds of files, one for the contract bytecode and another for the ABI?

Does an Ethereum contract address hold two different kinds of file, one for the contract bytecode and another for the ABI?
2
votes
1answer
145 views

ethereumjs-abi equivalent for Golang?

ethereumjs-abi is great for easily ABI encoding and decoding in javascript. Is there an equivalently simple package for Golang? Geth's accounts/abipackage does this, but there's a lot of setup and it'...
0
votes
1answer
96 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
28 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; ...
1
vote
1answer
69 views

To transfer ERC20 tokens (using Web3js), is it necessary to implement web.eth.Contract?

I'm kind of new to Ethereum network. I used to implement Stellar before. I have successfully implemented my JavaScript app to transfer Eth already. Therefore, I want to expand my above app to accept/...
0
votes
1answer
96 views

Web3 - Getting variable value from deployed contract without ABI

I'm trying to build a wallet capable of managing ERC20 tokens added by the users, using Web3 1.0.0-beta.34. After adding a certain token to the wallet using its address, I was able to fetch the amount ...
1
vote
1answer
170 views

bytes4(keccak256(“function(uint256)”)) vs. (abi.encodeWithSignature(“buyItem(uint256)”)

What is the (a) technical difference between and (b) practical difference between these, i.e., when do you use one or the other: bool result = address(contract).call.value(10)(bytes4(keccak256("...
0
votes
0answers
70 views

Cannot Install ABI GEN on Mac OSX High Sierra

I am trying to compile smart contracts using the go-ethereum client. I have go installed on my pc and installed ran the following commands: go get -u github.com/ethereum/go-ethereum cd $GOPATH/src/...
0
votes
1answer
272 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
104 views

Get all function names of specific smart contract ABI

I just want to get list of function names from smart contract abi. Please guide
0
votes
0answers
116 views

Does not match the input creation bytecode found at this address

I can not find my abi-encode byte in the compiled contract. this is the contract code I can not find the ABI encode ,before it is after 0029 but now I can not find anything after 0029. So I can ...
0
votes
1answer
249 views

JSON RPC Get Tokens At Address

Getting a balance for a token from the JSON RPC is simple. This is all I need to get a Tronix balance. The "0xf230b790e05390fc8295f4d3f60332c93bed42e2" part is the contract address for Tronix. {"id":...
0
votes
1answer
93 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 ...
15
votes
2answers
4k views

what does “Warning: This function only accepts a single ”bytes“ argument. Please use ”abi.encodePacked(…)" mean

In this question the OP is running into a warning upon using the keccak256 function in Solidity: Warning: This function only accepts a single "bytes" argument. Please use "abi.encodePacked(...)" or ...
0
votes
0answers
54 views

Convert contract arguments from JSON to ABI-encoded format to verifications

9 down vote favorite 1 I want to verify a contract code on Etherscan, but don't know how to get the arguments in ABI-encoded format. I have the source code and the interface in JSON. Is there some ...
1
vote
0answers
115 views

Removing / Unlisting Smart Contract from Etherscan.io [closed]

I've been creating several smart contracts for testing purpose, with the same Name, Symbol, Supply, & etc. And I'd like to remove/unlisting those smart contracts from etherscan because it is ...
5
votes
1answer
142 views

How are tuples handled for the function selector?

How are tuple types encoded into the function signature to generate the 4 byte function selector? The official specification doesn't state anything for tuple types.
0
votes
1answer
144 views

What is the function selector of the fallback function?

The function selector are the first four bytes of the keccak256 hash of the function signature. What is the signature of the fallback function? It neither has a name nor any inputs. If there is no ...
0
votes
0answers
38 views

Please where or how do I get a correct ABI for verification on Etherscan? [duplicate]

This are the details I used Contract Address: 0x9222f388c281eee9649bda0ef460833b5ce9aeda Contract Name: RenewCash Compiler: v0.4.16+commit.d7661dd9 Optimization: No Now this is the error message Error!...
-1
votes
1answer
150 views

How can I compile my smart contract from an API using solc?

I want to compile my solidity code (smart contract) inside my node.js API using the solc library to get the ABI and bytecode of my solidity. What I want in details is an input that can read solidity ...
1
vote
0answers
916 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
0answers
22 views

Help! Unable to verify Token Contract, Where can get ByteCode and ABI? [duplicate]

Receiving the following errors: Note: Contract was created during Txn# Result: Does not match the input creation bytecode found at this address Error! Unable to generate Contract ByteCode and ABI ...