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

I want to subscribe to flashloan events on the Aave v2 contract via websocket, how do I find the function/event?

I am trying to set up a websocket connection with ethers.js to listen for flashloan events. I have made a connection successfully listening to Transfer events on the USDT contract - which was simple ...
Zara44's user avatar
  • 1
1 vote
1 answer
60 views

how to verify a contract on etherscan?

thank you for your answers, but I think I'm still missing something, I don't know where to look for the elements that I don't like? does anyone have a solution please? I try with CONTRACT VERIFICATION ...
Bryce De Nyce's user avatar
1 vote
0 answers
58 views

Uniswapv2 "quote" ABI

I am trying to sign contractof Uniswapv2 on ethereum mainnet using "quote" ABI. the function is quote(uint amountA, uint reserveA, uint reserveB) I use c++ to make the raw transaction and ...
Biruk Damte's user avatar
1 vote
1 answer
28 views

transactionContract.addtoblockchain is not a function

Calling a specific function from smart contract through react jsx file , console is giving me error "transactionContract.addtoblockchain is not a function", even the function is present in ...
Chinmay Tiwari's user avatar
1 vote
1 answer
14 views

Fetching an implementation contract using ethersjs

I'm attempting to get the implementation contract for a proxy using ethers (and testing it using the recently published Paypal USD: https://etherscan.io/address/...
Abraham P's user avatar
1 vote
1 answer
40 views

How to get Factory address from the Router address? Web3.js

I'm trying to get a factory address for Uniswap on base network, unfortunately I'm not able to locate this address anywhere and I'm kind of desperate as without it I'm not able to try my code that ...
RasmonT's user avatar
  • 131
0 votes
0 answers
47 views

TypeError: AbiCoder is not a constructor, testing purchaseSnack function is failing. I think due to not handling ether conversion correctly

I am trying to write a test script using hardhat to test the purchaseSnack function but I keep receiving these errors. 1) VendingMachine Should fail if insufficient funds are sent: ...
Daryle's user avatar
  • 1
1 vote
2 answers
27 views

Mint From Existing Contract

I have the following contract that is already deployed (pasted below). I can see where the constructor() method is doing an emit Transfer from the 0x0 (zero) address to the deployer address in order ...
ASumeet's user avatar
  • 15
0 votes
1 answer
64 views

Abi encode / decode mystery additional 32 byte field Uniswap v2

When I encode my abi data in web3js or web3.py for a uni v2 trade I get the following: 0x 00000000000000000000000000000000000000000000000000000000000000a0 ...
Nat's user avatar
  • 247
0 votes
0 answers
17 views

How to unpack abi.Arguments() and access values by name

I am trying to unpack encoded arguments in input field of trunsaction. Input field consist of 2 params: blockId and Input (another input field) - and I got stuck unpacking this 2nd input. var ...
davaymne's user avatar
1 vote
3 answers
81 views

I can't verify contract on etherscan because it needs abi-encoded constructor

I can't verify and check my contract on Etherscan. It asks me for the abi-encoded constructor, but I can't find it. Can someone help me, or tell me how to find the missing information? Please! // SPDX-...
Bryce De Nyce's user avatar
0 votes
1 answer
71 views

How to call smart contract methods without abi?

I need to call a smart contract from python, but it is not verified. Since this is not my contract, I cannot verify it. How to call the smart contract methods through python in this case? Smart ...
Никита Филиппов's user avatar
1 vote
1 answer
25 views

can't find contract after compile successfully in remix: No Contract Compiled Yet

I compile this file in 0.4.8 successfully, pragma solidity 0.4.8; contract A { function f(uint[] arr) constant external returns (uint len) { assembly { pop arr := len }...
LEVI_104's user avatar
0 votes
1 answer
127 views

Ethers.js solidityPackedKeccak256 to bytes32

I have a commit-reveal pattern implemented in my Solidity smart contract. I use the keccak256 encryption function to secure the player's commitment. How can I convert the return value of ...
Mila A's user avatar
  • 202
0 votes
1 answer
41 views

What is an alternative for ethers.AbiCoder in geth

I have a following code that encodes parameters with AbiCoder const name = "Crown"; const symbol = "Crown"; const decimals = 18; const coder = new AbiCoder(); const nameBytes = ...
Danijel Radakovic's user avatar
0 votes
0 answers
30 views

What's the best way to get multi-chain (EVM only) transaction details given a wallet address?

Context I want to display user transactions as shown in Polygon scan (with all the details, logs, decoded input field, etc.) Currently I use Ankr's getTransactionsByAddress to get the transactions for ...
Nishanth Gobi's user avatar
0 votes
0 answers
17 views

web3.eth.abi.decodeLog not finding an event argument

I have a complicated event with the following signature: event SwappedShares(uint256 _stable, DataTypes.FeeReturn _fees, address _user, DataTypes.SubPoolGroup[] _subPoolGroups); Here are the ...
Barney Chambers's user avatar
0 votes
0 answers
58 views

abi: cannot use invalid as type array as argument

I am using go-ethereum to deploy a smart contract. This is how I create the contractABI contractABI, err := abi.JSON(strings.NewReader(getAbi())) if err != nil { log.Fatal(err) } ...
pigfox's user avatar
  • 213
0 votes
1 answer
127 views

Transforming Ethereum ABI(JSON) into Human-Readable ABI in Python

I know there is one example to do it: ethersjs implementation But how to transforming Ethereum ABI into Human-Readable ABI in Python?
LEVI_104's user avatar
0 votes
0 answers
76 views

How to decode data into a struct and store it?

I am trying to make a function that takes in abi-encoded data and decodes it into a struct and stores the struct's values in my smart contract. To generate the encoded data, I am using ethers.js ...
ohShoes's user avatar
  • 53
0 votes
1 answer
97 views

Abi calldata encoding nested structs, find a way

I didn't found any instructions about nested structs (in structs). Seen video about sending bytecode to contract and I wanted to understand. For example, method is: function fulfillOrder( Order ...
Peter Ivanoff's user avatar
1 vote
0 answers
35 views

abi-decoder's decodeMethod returns undefined

I am trying to decode the input field of this transaction as below, const decodedInput = abiDecoder.decodeMethod(transaction.input); but decodedInput returns undefined despite the my ABI having the ...
Nishanth Gobi's user avatar
0 votes
1 answer
85 views

How to encode arbitrary amount of parameters for encodeWithSignature without adding them to function definition?

Lets says we have Contract A that needs to call Contract B at a certain address which the requirements that Contract A doesn't know the exact parameter structure the function in that Contract B needs &...
CoderMan's user avatar
0 votes
1 answer
22 views

using encodePacked vs encodeWithSignature when call function on an external contract

When we call a function on an external contract, we need to put calldata as an argument. // SPDX-License-Identifier: GPL-3.0 pragma solidity ^0.8.10; contract test1 { mapping (address => ...
imelon2's user avatar
  • 425
0 votes
1 answer
21 views

Is there a downside to using a deprecated version of the ERC20 ABI?

I am aware there is deprecated keyword "constant" present in old versions of Solidity ABI for ERC20. Is this still just as good as the latest versions, or should I update asap? On the other ...
Sergio Gliesh's user avatar
0 votes
1 answer
139 views

Does the specific ABI of a particular ERC20 token have to be used in order to interract with it?

....Or can the standard, static ERC20 ABI be used for any ERC20 token equally? Namely, in a custom ERC20 token (smart contract) there can exist any function(s) the author of a token may have ...
Kyell's user avatar
  • 91
0 votes
0 answers
14 views

How to register 'abi-encoded' in bscScan? (noob)

I made a token with '.sol' through 'Remix'. After that, I copied my token abi, pasted it to 'https://abi.hashex.org/' , and checked the construction function, and it was empty. What is the '...
neta's user avatar
  • 1
1 vote
1 answer
87 views

Compiling two smart contracts it the same folder cause duplicates

When I compile two contracts in the same folder I get duplicates. The following contracts, Store.sol pragma solidity ^0.8.0; contract Store { event ItemSet(bytes32 key, bytes32 value); ...
pigfox's user avatar
  • 213
0 votes
0 answers
15 views

Cannot create contract "invalid identifier" second time loading

I create a contract interface with ether.js, below the error is the onMount function. The "first time" the component is mounted, the contract is created without problem. The second time, and ...
Cookie's user avatar
  • 101
2 votes
2 answers
168 views

How does MetaMask know the name of the contract function you're calling?

When you interact with a smart contract and, instead of the name of the function you're calling, MetaMask only outputs "CONTRACT INTERACTION", is this because the contract you're interacting ...
Iaroslav's user avatar
  • 279
2 votes
2 answers
192 views

Why can't MetaMask "verify" a contract?

When interacting with smart contracts via MetaMask, what does it mean when the wallet tells you "We cannot verify this contract. Make sure you trust this address"? See an example of the ...
Iaroslav's user avatar
  • 279
1 vote
0 answers
55 views

ABI interaction of Safe custom module

We've recently deployed a contract to testnet for managing membership nfts of a gnosis safe, however, is there any way that we can go about interacting with this custom module in a way that doesn't ...
Noah McGuire's user avatar
1 vote
1 answer
221 views

How can i get Abi from the byteCode using ethersjs i am using following code:-

Its not working for me const byteCode = await provider.getCode(address); const AABBI = ethers.utils.Interface.parse(byteCode).abi; console.log("AAABBBIII", AABBI);
Ritesh Gurjar's user avatar
1 vote
1 answer
180 views

How to decode ABI such that i get From, To, For in python

Currently my implementations of abi decode gets only token amount and not the From, To, address and token amount is without decimal point value = decode(['uint256'],log['data']) ouptput Token ...
Matt's user avatar
  • 11
2 votes
1 answer
158 views

How to calculate the 4byte selector using Cast?

I am using Foundry, and I need to calculate the 4-byte selector of a custom error. How can I do this with the cast CLI?
Paul Razvan Berg's user avatar
1 vote
0 answers
104 views

Help understanding why I am getting an error when calling the observe() function on IUniswapV3Pool?

The function I'm trying to call is observe() at line 326 I have previously successfully called this before but I'm coming back to it after a while and it is giving an error I don't understand. This is ...
Pickinanameainteasy's user avatar
1 vote
0 answers
150 views

ABI-encoding in Nethereum of a struct that contains a bytes-array (variable size)

I have a custom struct defined in solidity. When calling the decode-function of the contract, I want to decode an encoded MyStruct (in bytes). This works perfectly as long as a previous defined ...
Alexander Schmidt's user avatar
0 votes
1 answer
46 views

Question about the Contract API from ethers.js

API spec for Contract: new Contract(addressOrName: string, contractInterface: ethers.ethers.ContractInterface, signerOrProvider?: ethers.ethers.providers.Provider | ethers.ethers.Signer | undefined): ...
Mike Chan's user avatar
0 votes
1 answer
505 views

How to decode the msg.data on a function in plain solidity?

I was wondering how to decode the data payload received on a function At first, I thought it would be enough with knowing the order of the variables and the exact data type of them at the moment of ...
Stalin Macias's user avatar
1 vote
1 answer
956 views

How to generate a contract's artifact in solidity/foundry to use with targetArtifact?

Foundry invariant tests (stateful fuzzing) have helper functions for configurable invariant test setup such as targetArtifact(string memory newTargetedArtifact_), which adds a Target Artifact defined ...
Patrick Collins's user avatar
2 votes
2 answers
341 views

How to extract the ABI part from JSON file created in artifacts and create a separate file for it?

I have been using the Hardhat environment for a while now, and every time I have to provide the ABI to the front-end team, I need to copy-paste the ABI manually from the JSON file, since it contains ...
Shubham Sharma's user avatar
2 votes
1 answer
375 views

Get ABI code for an ethereum contract event

How can I construct the ABI code for a contract event? I don't need the whole contract ABI. Example: transferFrom(address,address,uint256) executeMetaTransaction(address,bytes,bytes32,bytes32,uint8) ...
jinsley8's user avatar
0 votes
1 answer
476 views

How to decode abi.encodeWithSignature and get the encoded values?

I'm running Foundry and trying to decode the encoded signature, but I'm getting "EvmError: Revert" error when running the below code. It appears to be something I'm doing incorrectly with ...
Jason's user avatar
  • 23
0 votes
1 answer
30 views

Chainlink UpKeep Registration ABI Error Problem

Everytime I try to register my UpKeep on Chainlink Automation, I get this error, "ABI must be of type { "name": string, "inputs": { "name": string, "type": ...
Vidhan Mangla's user avatar
0 votes
1 answer
137 views

How do get human-readable function definition from ABI in Python?

By human-readable I mean how the definition looks like in solidity. Example. Wasn't able to find it in Google.
Poma's user avatar
  • 171
0 votes
1 answer
157 views

Is there a way to index all contracts which deployed in an EVM-based chain?

I don't want to use a third party explorer or database, please don't give examples such as etherscan, 4byte directory etc. This is basically what i want to do: basically I need the ABIs of the ...
user20778175's user avatar
1 vote
1 answer
837 views

How to decode `encodePacked` data

I have two addresses, _token1 and _token2. I would like to pack them into bytes data to pass it to a function. bytes memory params = abi.encode(_token1, _token2); The obtained params is the ...
ywat's user avatar
  • 177
0 votes
1 answer
119 views

TypeError: Member "encodeCall" not found or not visible after argument-dependent lookup in abi

I am trying to test abi.encodeCall on Remix. I have this function function getTestData() external pure returns (bytes memory){ // passing empty args () return abi.encodeCall(TargetContract.send,()); } ...
Yilmaz's user avatar
  • 1,492
1 vote
0 answers
240 views

How can we send contract transaction with Web3dart package?

I'm using web3dart package to send tokens on the Ethereum blockchain. but every time returns error : [log] RPCError: got code -32000 with msg "filter not found". [log] #0 JsonRPC.call ...
user113939's user avatar
0 votes
1 answer
222 views

How to verify ABI matches the source code?

I want to analyze the Solidity version of the source code of the smart contract of a crypto coin. I can get the ABI from Etherscan and I can get the smart contract from, say, Github. (Assume the ...
Mowzer's user avatar
  • 201

1
2 3 4 5
10