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
13 views

Transfering MATIC tokens on matic network

I'm attempting to transfer MATIC on the matic testnet (mumbai) and submitting the standard ERC20 transfer call (0xa9059cbb) isn't working. Here's my transaction: ...
2
votes
0answers
21 views

Estimating gas limit using Go-ethereum BoundContract (abigen)

I have a smart contract and it's native bindings generated in go-ethereum (version 1.9.11 if that matters) abigen. Im looking for a way to estimate gas limit before calling method on smart contract. I ...
0
votes
0answers
18 views

Converting Remix ABI JSON statements to ABI-encoded Constructor Arguments

I am using MetaMask wallet with test-Ether via the Rinkeby faucet on Rinkeby test network to create a smart contract via Remix and Etherscan. The code is basically using the functions from the ...
0
votes
1answer
23 views

Help decoding this Json ABI

I'm interested in reading how dHedge implemented their asset-buying program so would greatly appreciate if you guys could help me decode their json abi. I couldn't find a json abi decoder anywhere as ...
0
votes
1answer
21 views

how do i fix such an error; uncaught TypeError

The error that I am facing is as said 'Uncaught TypeError: Cannot read property 'abi' of undefined These are the codes FilmRegistrationApp.prototype.init = function(cb) { this.web3 = new Web3( ...
0
votes
1answer
30 views

Is it possible to convert input data from etherscan to abi?

the contract isnt verified but etherscan knows whats being called. how can we write what we got from the input data back into abi form
1
vote
1answer
41 views

Value error: Calling 1inch contract with web3.py but having problems with the ABI

i am trying to get the quote from 1inch regarding the Ethereum/DAI price. I am new to Web3.py and need some additional help regarding the following problem. My code: import json from web3 import Web3 ...
0
votes
0answers
18 views

A python module equivalent to Nethereum codegen

Does anyone know a Python module that can help me convert an ABI for a contract to a python class automatically. Nethereum has Codegen for C#, is there anything like that for python ?
1
vote
1answer
57 views

Why is there 2 methods abi.encode and abi.encodePacked for argument encoding

When we call a function on an external contract, the evm computes a bytes buffer which contains the function signature and arguments. There are 2 ways to serialize arguments: abi.encode and abi....
1
vote
0answers
25 views

Is older web3.js UI code compatible with new contracts that use ABI coder v2?

The solidity 0.8.0 patch notes state: ABI coder v2 is activated by default. You can choose to use the old behaviour using pragma abicoder v1;. The pragma pragma experimental ABIEncoderV2; is still ...
1
vote
0answers
16 views

How can i get the name of an emitted event through the event abi (log entry, topics) of solidity?

I want to get the name of an emitted event from my contract using the event abi and web3j. This is the contract i'm using as an example for this question: pragma solidity ^0.5.7; contract ...
0
votes
0answers
10 views

Method's parameters: a way to know a uint256 is a token amount and its number of decimals?

When decoding transaction actions or logs, I never know how to human-read uint256 values when they are token amounts and, if so, how to know how many decimals they are. For the decimals, do I always ...
0
votes
0answers
32 views

How to read all logs from a transaction without having each contract ABI?

From a transaction logs, how do I decode every logs since I don't have all contracts ABI? Do I have to fetch the ABI every time I encounter an unknown contract? How do apps that display all logs deal ...
1
vote
1answer
21 views

How is the signature generated when the function does not have parameters?

When the function has parameters, Solidity generates its signature by adding the parameter types after the function name, in between brackets, and taking a keccak256 hash of the resulting string. As ...
2
votes
1answer
51 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
42 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 ...
0
votes
0answers
45 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 ...
1
vote
1answer
39 views

How does the EVM identify a dynamic type in the function calldata?

So as per the ABI encoding specifications mentioned in Solidity Docs, for a dynamic array, the data location (in bytes from start, for the data part) is specified at first, followed by the length of ...
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"...
1
vote
1answer
20 views

Running test with multiple contract address on a local Ganache blockchain

I'm developing with Truffle and Ganache I have an standard ERC20 ABI that I import in my test file. it only has 3 optionals functions name, symbol and decimals. const Token = artifacts.require('./...
2
votes
1answer
520 views

What does the function “abi.encodeWithSelector(bytes4 selector, …) returns (bytes memory)” do exactly?

I tried to edit this function according to my smart contract but I couldn't understand this function. I read the docs already. can someone explain this to me with more details and examples? Thank you.
0
votes
0answers
46 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
85 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
32 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
67 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 ...
1
vote
1answer
35 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 ...
0
votes
1answer
188 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 ...
1
vote
1answer
415 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
75 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 == ...
0
votes
1answer
74 views

Can we not allow to read/write contract from ethereum explorer?

Is there any way to not allow reading and writing contract from ethereum blockchain explorer? One can view contract code, ABI, and every other information once the owner verifies contracts. Is this ...
0
votes
1answer
31 views

Why do we write ABI before some functions

Why do we write "abi" before abi.encode()? I understand that ABI is a like a JSON file used to help interaction of different applications because the solidity code is stored as bytecode, but ...
0
votes
1answer
60 views

Uncaught TypeError: TheContract.at is not a function

just trying my first steps in ethereum and web3. So i found this tutorial: https://www.youtube.com/watch?v=hcTPjpPvas8 But it raise an error: index.html:85 Uncaught TypeError: TheContract.at is not a ...
0
votes
0answers
30 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
73 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
78 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
124 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
32 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
67 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", "...
1
vote
0answers
53 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
34 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 ...
0
votes
2answers
61 views

Decreasing the size of ABI files

I have some Truffle and Solidity produced ABI files that I am bundling with a JavaScript NPM package. 221.7kB esm5/lib/abi/IERC777.json Currently, the ABI files include full details, like ...
0
votes
2answers
220 views

How to generate Data payload for a smart contract transaction programmatically?

Some wallets, like Gnosis Safe multisig, do not have web3.js support or ABI encoder built-in. How one can create a transaction that calls a smart contract function and originates from such wallets?
0
votes
0answers
141 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) ...
3
votes
1answer
53 views

abi.decode() and unused variables

I am decoding bytes as the following: // Decode Solidity tightly packed arguments (uint8 _, uint128 stakeId, address behalf) = abi.decode(userData, (uint8, uint128, address)); // solhint-...
0
votes
1answer
168 views

How can I get the ABI from solc.compile? (^0.6.4)

In pragma solidity ^0.6.4; I wrote a contract and can get the byte code as follow: const solc = require("solc"); const path = require("path"); const fs = require("fs"); const inboxPath = path....
0
votes
1answer
31 views

Where does the length parameter end and the actual string start in an abi encoded string?

Assuming I decided to ABI encode a very long string (for the purpose of this question I just picked an arbitrary 5-paragraph lorem ipsum text generate by https://www.lipsum.com/feed/html) and get out ...
1
vote
1answer
40 views

Can't find address in abi encoded data of event

I have an event with the signature Event(address, uint256, string) which my smart contract emit from time to time. I am testing said contract on a ganache test net where when the Ganache picks up ...
0
votes
0answers
298 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
2answers
20 views

Does solidity create unique outputs every time it compiles same exact code?

Is there any difference if I compile everytime I want to deploy another multisig wallet. Or I can just deploy another multisig wallet using the same compiled data?
1
vote
1answer
63 views

AbiEncoderV2 encoding Tuple algorithm

Where can I find AbiEncoderV2 encoding Tuple algorithm? I would like to add Tuples support to a ruby library.

1
2 3 4 5 6