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
1answer
564 views

myContract.getPastEvents(“allEvents”) returns empty array

I want to get all past events from a contract I deployed on the Ropsten network. Contract is: pragma solidity ^0.5.1; contract SampleContract { uint storageData; event MamboNumberTwo(uint ...
0
votes
1answer
763 views

Deploying contract using byteCode

In that example you can see, how to deploy a new contract having just ABI and ByteCode (uses for copy and deploy contracts from mainnet to your testnet for example). /****** Deploying new contract ...
0
votes
2answers
135 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 ...
0
votes
1answer
119 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
1k 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 ...
0
votes
1answer
27 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?
0
votes
2answers
368 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 ...
0
votes
1answer
310 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
1answer
244 views

Permanent deployment of contracts in Geth

My current method of deploying smart contracts in geth is by generating the bin and abi files of the corresponding sol and then loading the bin and abi files of the contract into geth using the ...
0
votes
1answer
412 views

Convert contract arguments to ABI-encoded format

My Contract Source https://gist.github.com/munggo/ed25afb0aff9169a6c57f1d464d13177 Convert contract arguments to ABI-encoded format How???
0
votes
3answers
1k views

What is a good implementation to get function signatures from contract ABI?

This is a simple storage contract: contract SimpleStorage { uint public data; function set(uint x) public { data = x; } } The ABI is: [ { "constant": false, ...
0
votes
1answer
1k views

Send tokens from ethereum address programmatically

I want to create a service to send tokens from different wallets. I already created the ethereum transactions, but I don't get tokens yet. It seems I need the ABI, but I would like to avoid using it. ...
0
votes
1answer
247 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?
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
16 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
24 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
21 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
31 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
1answer
42 views

abi.decode with pragma experimental ABIEncoderV2 reverts with nested array

I have a function with a parameter of bytes calldata that needs to be decoded to a struct, but the call reverts in assembly. I believe the issue has something to do with the nested array. I have ...
0
votes
0answers
17 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
2answers
29 views

How concatenate encodeWithSignature with another data type to external call?

There are a abi.encodeWithSignature("foo((bytes))", info), but in addition to calling the function in another contract I want to send more data as an address to retrieve with msg.data, for ...
0
votes
0answers
47 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
46 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
23 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
35 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
68 views

Deploy contract with web3 with ABI in JSON file give me “SyntaxError: Unexpected token o in JSON at position 1” [duplicate]

I got problem with my deploy.js script to te deploy my smart contract with web3. When I run it, I always got this error: Attempting to deploy from account XXXXXXXXXXXXXX (node:25929) ...
0
votes
0answers
172 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
30 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
111 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
157 views

Get past events of a contract without ABI using Web3?

I'm building a simple explorer and I would like to list events emitted by contracts. Since I can't know the ABI of each contract, is it possible to get past events from a contract using Web3? If I ...
0
votes
1answer
47 views

How can I pass struct as function parameter with ABIEncoderV2 from outside?

have this code: struct UserScore { address user; uint score; uint time; } function getWithStruct(UserScore _user) public view returns (address, uint, uint) { return (_user.user, _user....
0
votes
0answers
67 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
82 views

Interaction with deployed contract over private blockchain Error: invalid address

I have deployed a smart contract over my private ethereum blockchain using geth. Smart Contract pragma solidity >=0.4.22 <0.6.0; contract GreenPoints { string public name; string ...
0
votes
1answer
1k 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
1answer
178 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
95 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
30 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
171 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 ...
0
votes
0answers
63 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
875 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
124 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
112 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
141 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
605 views

Transfer ERC20 tokens by ruby

I found only one semi-automatic solution to transfer tokens from one wallet to another. But i want to do that by web3js way on ruby stack. Could you guys explain me, how exatly to get data for ...
0
votes
1answer
471 views

Padding parameter values in contract low-level call

In the following example: contract_address.call(bytes4(sha3("function_name(types)")),parameters_values) should we pad the parameters values to 32 bytes? Because I have seen code like if (!...
0
votes
1answer
365 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
847 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
418 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 ...