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
1
vote
1answer
91 views

How to see common ENS names that have been auctioned?

In the ENS documentation, it says that the "DApp" shows you when common ENS names are being auctioned. How do the DApp and the twitter bot know what names people are auctioning? The DApp and ...
0
votes
1answer
694 views

Accessing a 3rd party contract's functions using Truffle

I'm trying to build a basic dashboard that will allow me to track the status of any given ICO (assuming the token is ERC20). Right now, I managed to deploy a simple Crowdsale + Coin contract based ...
8
votes
6answers
3k views

Flatten Truffle Solidity Contracts for Etherscan's `Verify Contract Code` Feature

Etherscan.io has a Verify Contract Code feature that takes the inputs Solidity Contract Code and Constructor Arguments ABI-encoded. Question: Is there a tool to flatten your solidity contracts (...
8
votes
2answers
4k views

Where to find contract ABI in new version of online remix solidity compiler?

After the online remix solidity compiler recently changed design, I can't figure out where I can find the contract's ABI? Does anyone know where it can be found in the new version? Or any other way ...
1
vote
3answers
3k views

Decoding contract output of web3 eth call

I have written data to a contract using sendRawTransaction, and am trying to fetch it using web3.eth.call for the function : function checkRecord(uint id, bytes email) constant returns (uint id2, ...
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 ...
2
votes
1answer
775 views

Where does ABI decoding take place?

I'm trying to understand the winning contract from the Underhanded Solidity Contest. That contract apparently caused an overflow in the ABI decoder, but I'm having a hard time understanding where in ...
8
votes
2answers
5k views

How to get the contract ABI in new Remix IDE?

Waked up today just to find out the remix browser interface changed to this what happened !!? I cannot find the contract details to get the json interface anymore.
1
vote
1answer
2k views

How to verify a contract having constructor arguments?

This is a contract that requires an argument to be deployed. The Contract Name is "Asset". The compiler used is "Compiler 0.4.16+commit.d7661dd9.Emscripten.clang" and Optimization was Disabled. To ...
11
votes
1answer
4k views

How to find solidity code for a contract address

I need to find out the public contract code i.e. solidity code for a contract address. For eample, here it has a tab for contract code but it's in assembly and byte code only, which is not useful. ...
1
vote
1answer
202 views

Calling smart contract from Javascript

I am newbie at smart contracts and their deploying and I am pretty confused. I am following this example https://github.com/bellaj/Ballot-Dapp Someone could explain me well what these lines do, please?...
1
vote
1answer
586 views

When using delegatecall, data in parameters of type uint[] are left-shifted by 8 bits

progma solidity ^0.4.15; contract Callee { uint public result_; function foo (uint _length, uint[] _nums) public returns (uint) { result_ = 0; for ( uint i = 0; i <...
3
votes
1answer
2k views

How to decode input data with ABI using java?

There is a tool on npm ethereum-input-data-decoder. And yes, i can read input data as hex byte[] bytes = Hex.decodeHex(transactionReceipt.getInput().substring(2).toCharArray()); System.out.println(...
1
vote
1answer
337 views

Is there a way to reverse engineer and know the ABI of a contract just by knowing its contract address?

Let me be clear on this, here i want reverse functionality. I have the contract address generated and i am able to access it in the mined block. However i want to know what is the data in ABI json ...
3
votes
2answers
1k views

Method ID for a Solidity generated getter function

In solidity, the bytecode for functions is taking the web3.sha3 value of a function name and taking the first 4 bytes of the resulting hash in the format of 0x00000000 So if you have a function ...
1
vote
1answer
301 views

How to access public contract storage with Go?

I have a mapping defined in a contract: mapping(bytes32=>string) public name; How can I access this in Go? abigen provides bindings for functions but not variables. This question shows how to ...
11
votes
3answers
7k views

Convert contract arguments from JSON to ABI-encoded format

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 tool I can use, or some ...
7
votes
1answer
4k views

web3.js import contract abi from .json file

So I have a deployed contract with address0. I can easily interact with it using my index.html like so: import contract_artifacts from '../../build/contracts/contract.json' var contract0 = contract(...
4
votes
2answers
3k views

What is “data” param of rawTx? How to send ETH by using web3

I want to send eth by using web3 on testnet. Source address is 0xbddf0bf3ac858d7fb8a2bdda55884d61779ba5a9. The destination is 0x8005ceb675d2ff8c989cc95354438b9fab568681. I found the example on web3 ...
2
votes
2answers
2k views

Deploy contract from command line

Is there any command or utility to deploy contract from .sol file to test-net? I've seen there is JSON API, so I can write some code to implement this. But isn't it done already? Thanx.
1
vote
1answer
397 views

how to retrieve function call address from deployed contract for usage with MetaMask send + transaction data?

I've deployed a contract into my testrpc network. $ truffle deploy Using network 'development'. Running migration: 1_initial_migration.js Deploying Migrations... Migrations: ...
5
votes
2answers
2k views

how to get code for already deployed contract in ethereum network

Let's say peer A is deployed a contract and exposes contract ABI. Peer B wants to join the same network.He have the ABI with him.But he wants to see the real contract code before joining the network....
2
votes
0answers
214 views

How to get ABI for an existing contract [duplicate]

I'm trying to understand Ethereum smart contract interaction at the base level using the JSON-RPC. Say I want to update a contract programmatically. I create the contract, there is a public method ...
5
votes
2answers
841 views

Convert ABI to Solidity code

Is there a tool to generate a solidity code from the ABI interface? const Ballot = [{"constant":false,"inputs":[{"name":"to","type":"address"}],"name":"delegate","outputs":[],"payable":false,"type":"...
5
votes
1answer
2k views

How to send a smart token transaction from one account to another account using JSON RPC interface

I would like to send amounts of a created token from one address to another. I would like to use eth_sendTransaction: eth_sendTransaction Creates new message call transaction or a contract creation,...
2
votes
1answer
2k views

How to know the hex code to use in data to call a specific contract function?

For instance, on the BAT ico site, you can see the crowdsale contract address, the ABI and also a string to use in the data part of your transaction if you don't want to call the contract function ...
1
vote
1answer
407 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 ...
10
votes
4answers
8k views

Web3.js Get Contract Abi Knowing Only Contract Address

is there a way with web3.js to get a contract abi json, knowing only the contract address? I cannot find anymore a link in wich they explain how to do this, in this post the guy replied telling that ...
6
votes
1answer
302 views

Can an ABI be embedded into a smart contract?

So one of the most unfriendly things about Ethereum is that every time I want to interact with a contract I need to load up the ABI from an external, centralized source. Sure Parity lets me save ...
3
votes
1answer
1k views

How are the arguments of the constructor encoded in the contract creation transaction?

The Ethereum ABI defines how arguments are encoded and passed when a method is called. But how are the arguments to the constructor encoded in the contract creation transaction which creates the smart ...
5
votes
1answer
549 views

Do you need to publish the contract ABI and address for others to interact with the contract?

Suppose you write a contract that you want others to interact with. My understanding is that if you want others to interact with your contract, you need to provide the contract's ABI and address. Is ...
4
votes
1answer
2k views

The solc is not generatig *.abi file with the option --abi and -o build

When I use the --abi option, the abi interface is generated: $ solc Greeter.sol --abi ======= Greeter.sol:mortal ======= Contract JSON ABI [{"constant":false,"inputs":[],"name":"kill","outputs":[],"...
0
votes
1answer
235 views

Getting ABI from contract source file offline

Is there any way other than online solidity browser to get the ABI and bytecode of a contract?
2
votes
1answer
106 views

Who uses the ABI typically? Is it the wallet?

I have seen all kinds of explanations of ABI. But I am still wondering who would use it. As per my current understanding it should be wallet apps using it. Or is it the node app? Can someone please ...
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 ...
5
votes
1answer
3k views

How to find the contract wallet JSON and ABI

I'm trying to find the JSON and ABI for one of my contract wallets here: 0x1Fa0926C69eEe89d212F0848803e4Ee2E548fE4D The reason is that there is some ETC locked up in it that I'm trying to dump, ...
3
votes
1answer
452 views

Inside `geth` how could I convert abi object into a string?

Inside geth how could I convert abi object into a string? I want to convert it into string to apply str.replace(/[\r\n]/g, ''); to remove new lines and make it more compact. myContractCompiled.Array....
15
votes
1answer
4k views

Deploying contract with constructor arguments via Geth RPC

How can I deploy a compiled contract with constructor arguments using geth rpc? I have tested my call deployed the compiled contract bytecode just fine, I just don't understand how I can pass ...
3
votes
1answer
455 views

How to explain string serialization when invoking contract method?

On Ropsten testnet I have deployed a contract like this: // creation of contract object var aContract = web3.eth.contract([{"constant":true,"inputs":[{"name":"","type":"address"}],"name":"...
3
votes
1answer
65 views

Make function invisible for general user

I have a pretty big contract with a few functions, some are designed for administrative goals. Here's a simplified example: contract big_contract { function user_function_1 (uint32 arg1, string ...
5
votes
1answer
3k views

Interaction with a deployed smart contract from the geth command line

I have a contract which I'd like to be able to sum numbers submitted by any other address: contract UnitCounter { mapping (address => uint256) public UnitsFrom; uint256 public TotalUnits; ...
7
votes
2answers
1k views

How to bind Go auto-generated code to a smart contract over IPC?

I wish to create a go-binding to my smart contract which was mined on a private blockchain. I've looked at the Native Dapps : Go binding to Ethereum contracts tutorial (located here : https://github....
3
votes
1answer
255 views

Deploy contract hangs in Mist

I'm not able to deploy any contract (the greeter contract does not work either) using Mist 0.8.6 in Windows. The deployment just hangs there and nothing really happens. Is there a way to figure out ...
8
votes
2answers
3k views

How to estimate the cost to call a Smart Contract method?

After succesfully deployed this Smart Contract on Ethereum testnet https://testnet.etherscan.io/address/0x27c042342C9ba937214117e11A4970A6145034cB is it possible to calculate how much gas is going ...
1
vote
1answer
468 views

Instantiate a deployed Smart Contract

After deploying a Smart Contract and knowing that: address = 0x20e4ac9385ea45919b9709c2b38d3190efa42ee4 ABI = [{ constant: false, inputs: [], name: "kill", outputs: [],...
4
votes
2answers
94 views

Is there a simple way to make sense of Ethereum tx given ABI?

It seems that ABI is used by web3.js to only make sense of the function calls and storage values, are there any simple means to make sense of Ethereum tx given ABI? For example, given ABI, is there ...
9
votes
1answer
12k views

What does Solidity's “call” function mean?

address nameReg = 0x72ba7d8e73fe8eb666ea66babc8116a41bfb10e2; nameReg.call("register", "MyName"); //1 nameReg.call(bytes4(sha3("fun(uint256)")), a); //2 if(!nameReg.call.value(10)){throw;} //3 Here ...
6
votes
2answers
3k views

Understanding nameReg.call(“register”, “MyName”) style call between contracts

Here's an example from solidity docs on Address type methods(call method specifically): address nameReg = 0x72ba7d8e73fe8eb666ea66babc8116a41bfb10e2; nameReg.call("register", "MyName"); ...
6
votes
1answer
2k views

How is an ABI stored in bytecode?

I'm trying to understand how a simple hex string like 0x25d8dcf2 is enough information to execute a function in a contract. I've read up on the ABI and understand that the hex string is basically just ...
3
votes
0answers
38 views

How to make sense of the “data” sent to execute a contract? [duplicate]

I'm trying to understand the technical details of Ethereum and one thing I can't find any info about is the data to be sent to a contract. For example, I have a very simple coin flip betting ...