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

missing encodePacket / .abi + keccak256

I'm not 100% sure how to describe my issue, total noob following the BlindAuction solidity tutorial and stuck unable to compile. any help is much appreciated. function generateBlindedBidBytes32(uint ...
user avatar
  • 1
0 votes
0 answers
28 views

calling method only knowing bytecode and address

hi I have a question here enviroment: truffle test suite question: I met a senario that, you are only provided with a bytecode to created the contract(send transaction in truffle), you need to call ...
user avatar
0 votes
1 answer
21 views

Contract has callable functions not in ABI or source code

I've found several contracts for which I am able to call functions on the contract's front-end but that exist in neither the contract source code nor ABI. When I call the functions, ftmscan (an analog ...
user avatar
  • 75
0 votes
2 answers
55 views

address.call{}(abi.encodeWithSignature()) in solidity returns boolean and what other parameters?

I learned from this documentation https://docs.soliditylang.org/en/v0.8.15/contracts.html and this discussion How to use address.call{}() in solidity about abi.encodeWithSignature() . I have question ...
user avatar
  • 105
2 votes
0 answers
26 views

Return type in method signature of ABI and contract differs - ethers.js call still works

I observed a strange behaviour that I cannot explain. I'm calling the EIP-1271 function function isValidSignature(bytes32 _dataHash, bytes calldata _signature) external view returns (bytes4) of the ...
user avatar
  • 131
0 votes
1 answer
31 views

Using ABI's in Proxy contract pattern

I am planning to implement a Proxy pattern for my smart-contracts. And I want to make sure I understood it's use-case right. In short: User only needs to know about Proxy contract address, and by ...
user avatar
  • 636
0 votes
0 answers
37 views

Typechain: how to generate factory, d.ts files of contract abi

I have a command called typechain --target=ethers-v5 --out-dir src 'src/constants/abis/BoxContract.json' which created a BoxContract.ts file and a BoxContract__factory.ts, but it doesnt create a ...
user avatar
3 votes
1 answer
39 views

Can I import solidity code (or ABIs) into vyper?

Let's say I have a contract in solidity: pragma solidity 0.8.8; contract MyContract{ function getFive() public pure returns (uint256){ return 5; } } Could I import, inhert, etc in ...
user avatar
0 votes
0 answers
67 views

Call contract that's unverified [duplicate]

I am currently developing a smart contract ecosystem. I want to interact with my smart contracts on the testnets. However, I have to verify to do so. I cannot verify, as I don't want my code displayed ...
user avatar
0 votes
0 answers
14 views

is there any way to get other smart contract ABI(not my smart contract) automatically without using API or manual(etherscan copy-past)?

my question is so simple but with difficult answer :-) is there any way to get ABI for some smart contract address automatically without using API ? there are some API that i can get ABI for smart ...
user avatar
0 votes
0 answers
19 views

Verify Smart Contract ABI Encoded Avalanche

I would like to verify a smart contract with snowtrace.io explorer on Avalanche. For this I need Constructor Argument ABI-Encoded To encode this, I use https://abi.hashex.org/ Anyway I get the error ...
user avatar
0 votes
1 answer
10 views

Any tool or online platform which when provided with a deployed contract address and it's abi, shows the methods of that contract?

I have an unverified deployed smart contract and I have the ABI of that contract, now how can I get the list of methods inside that contract?
user avatar
0 votes
2 answers
22 views

Can ABI be uploaded to Etherscan without source code?

Is it possible to only upload a contracts ABI without including the source code? If so, how? Curious if Etherscan can still be used to interact with the smart contract, but not make the source code ...
user avatar
  • 13
0 votes
0 answers
17 views

Not getting any values in contract.eth.methods field

Here is my Web3.js code const Web3 = require('web3') const rpcURL = 'https://bsc-dataseed.binance.org/' const web3 = new Web3(rpcURL) const fs = require('fs/promises'); var contract; //execution ...
user avatar
0 votes
1 answer
34 views

is there a way to extract smart contract code from bytecode?

I have deployed the smart contract into polygon mainnet but I do not have the smart contract code now, I only had the smart contract address. I have not 'verify and published ' after deploying the ...
user avatar
0 votes
0 answers
40 views

How to decode and parse (via ABI) ethereum transaction in JAVA

I am currently passing the Ethereum serialized raw transaction to https://github.com/flightwallet/decode-eth-tx to get output like: { "nonce": 0, "gasPrice": null, "...
user avatar
0 votes
0 answers
110 views

ERC721 Contract: Adding Contract Level Metadata?

I am trying to implement contract level metadata so "description", "image", external_link": etc show up on marketplaces, particularly OpenSea. I have done an extensive search ...
user avatar
0 votes
0 answers
19 views

How do other nodes / devices call methods in a smart contract without knowing ABI?

I am working with web3.py and i realize that i need to supply ABI every time i need to call a method from a smart contract But, if i am not mistaken, on the Ethereum network, most devices can call ...
user avatar
1 vote
0 answers
43 views

Maximum ABI-encoded variables

In early versions of the ABI encoder/EVM/Solidity, the budget for function parameters was 16 fixed-length variable or 8 variable-length variables. The logic was simple enough - a budget of 16 slots ...
user avatar
  • 51.3k
0 votes
0 answers
108 views

How to Decode ABI Encoded string with Nethereum (porting code from typescript to c#)

For some reason I port a specific functionality of bitcore-node (https://github.com/bitpay/bitcore/tree/master/packages/bitcore-node) to C# However I am stuck with a problem now and need some advice. ...
user avatar
0 votes
1 answer
161 views

How to compress transaction's input?

Any idea to compress the input data to erase the much zeros From: ...
user avatar
0 votes
1 answer
167 views

Why use abi encoding/decoding for method parameters? Why not simply separate the parameters in the method signature?

I have seen source codes where they would encode a bunch of parameters into a single bytes parameter and pass it into a function, what's the real purpose of doing it? For example: function hello(bytes ...
user avatar
  • 255
1 vote
1 answer
37 views

should i change the ABI when using a proxy pattern?

i would like to ask you a question about the proxy pattern. Suppose I published an ERC721 token contract(version 1) and also I'm using proxy contract(OpenZeppelin upgradable proxy). if i add a new ...
user avatar
  • 13
0 votes
1 answer
21 views

I have a stakeTransaction, but i can't figure out why it wont let me input the amount of tokens i want to stake. not responding to input on frontend

const stakeTransaction = async () => { try { if (!ethereum) return alert("Please install MetaMask."); const { amount } = formData; const Contract = createEthereumContract(); ...
user avatar
0 votes
1 answer
60 views

How to differentiate between topics and data in an event ABI?

I'm trying to recreate the ABI of an event function (that I don't have the ABI for). I have looked at event ABIs in other contracts of the same project and they all look like this: {"anonymous&...
user avatar
  • 113
1 vote
1 answer
72 views

What is the max number of inputs that can be entered in a keccak256(abi.encodePacked()) function?

I'm learning to use the keccak function on cryptozombies, and seeing that this function takes three inputs: uint(keccak256(abi.encodePacked(now, msg.sender, randNonce))) made me wonder how many ...
user avatar
0 votes
0 answers
39 views

How to interact with a deployed smart contract using the etherscan API key

I want to interact with a deployed smart contract on etherscan.io using the ABI and I'm wondering how can make a fetch call in my code editor to get the ABI, use that ABI to create an instance of that ...
user avatar
  • 205
1 vote
2 answers
184 views

How can I interact with a smart contract deployed on etherscan.io using the ABI?

I was wondering if it is possible to interact with someone's smart contract deployed on etherscan.io by using the ABI of that smart contract. for example when developing projects on my coding editor ...
user avatar
  • 205
0 votes
0 answers
230 views

swapExactTokensForTokens error with ether.js

const secret = require('./secret.json') const provider = new ethers.providers.JsonRpcProvider('https://bsc-dataseed1.binance.org'); const WBNB = '0xbb4cdb9cbd36b01bd1cbaebf2de08d9173bc095c' const ...
user avatar
  • 13
0 votes
0 answers
45 views

Can we interact with a function in the blockchain but isn't mentioned in the ABI?

There's a public contract (with no access control) and it has a function which is also public and has no access control and can be called by anyone, as example : contract example { function ...
user avatar
1 vote
1 answer
269 views

Unable to decode input using Etherscan ABI

I'm looking at the input for a transaction that calls a Smart Contract and I cannot make sense of it. This specific sample is on FTM, but I'm assuming there is no difference in behaviour to ETH? ...
user avatar
0 votes
1 answer
177 views

How to call ".approve()" function of a token which ABI I don't have? In web3.js/ethers

I need to call .approve() function of a token which I address I know but which ABI I don't have. How to do it? Will it be enough to create ABI string which will contain the signature of .approve() ...
user avatar
1 vote
1 answer
244 views

A simple way to do a read a contract from a json file and interract with it using ethers.js?

I'm using hardhat and have deployed some contracts. That's created a directory deployments which containes meta data of the deployed smart contracts. Is it called artifacts? Now, via the library ...
user avatar
1 vote
1 answer
331 views

is including hardhat's artifacts folder in build files safe?

I am trying to deploy my DAPP to vercel. it says 'module not found' for the files in artifacts folder. Ofcourse, it is missing because it is included in the .gitignore file, so I added the artifacts ...
user avatar
  • 62
0 votes
2 answers
268 views

Decode constructor arguments of deployed Smart Contract

I need to know which parameters has been used to init the following smart contract: https://testnet.bscscan.com/address/0x9Ac64Cc6e4415144C455BD8E4837Fea55603e5c3#code From the page, I can only see it ...
user avatar
  • 3
0 votes
1 answer
116 views

Error on loading contract ABI into react application

Hello i am quite new in web3 development, I have compiled my smart contract on ganache using "truffle compile" and copy the generated JSON (DevToken.json) in the build folder and paste it ...
user avatar
0 votes
1 answer
307 views

USDC etherscan ABI missing decimals function

I'm pulling the USDC ABI from etherscan and then passing it in to web3 erc20_dict = { 'USDC': '0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48' } url = f'https://api.etherscan.io/api?module=contract&...
user avatar
1 vote
0 answers
9 views

Why `bytesN` elements padded to the right, but all other elements (e.g. `uintN`) are padded to the left?

here is the great post how to encode arguments to ethereum functions https://medium.com/b2expand/abi-encoding-explanation-4f470927092d But WHY ethereum creators decided to pad like this?
user avatar
  • 181
0 votes
0 answers
81 views

Encode function call with parameter value

I'm trying to encode a function call to retrieve the tokenURI of a token from an ETH contract. I'm using web3.py as follow to encode the function signature. However I don't know how to pass the ...
user avatar
0 votes
0 answers
105 views

How to parse constructor arguments on contract creation transaction using ethers.js?

Ethers.js has a parseTransaction function that can be used in the following way to extract arguments from any transaction on a deployed contract. const txDescription = contractInfo.interface....
user avatar
  • 875
1 vote
1 answer
407 views

Problem with encoding tuple data with Web3 ABI

I am trying to make a swap on Uniswap v3 through the SwapRouter contract via the ExactInputSingle function. The ABI states that this function gets tuple as the input parameter. How can I encode this ...
user avatar
  • 11
0 votes
0 answers
18 views

Why the encoding of the address is different in trx than etherjs?

When I see a transaction on etherscan the input data is the following: 0000000000000000000000000000000000000000000000000000000000000001 0000000000000000000000000000000000000000000000000000000000000040 ...
user avatar
2 votes
0 answers
185 views

Decode parameters on contract creation or constructor parameters

I want to decode parameters passed to contract constructor. Even if i used the ABI of the contract, it doesn't seem to resolve the parameters used. Here is the transaction trace out put https://gist....
user avatar
0 votes
0 answers
86 views

Finding exact Constructor Arguments to pass for Etherscan contract verification?

I made a simple token through Remix using the ERC20PresetFixedSupply.sol contract and passed it the following constructor arguments: contract TokenName is ERC20PresetFixedSupply { constructor() ...
user avatar
0 votes
0 answers
43 views

Problem in verifying & publishing contract on ropsten.etherscan

I'm trying to verify the following smart contract on ropsten.etherscan: pragma solidity ^0.4.17; //@title Ownable //@dev The Ownable contract has an owner address, and provides basic ...
user avatar
  • 1
0 votes
1 answer
157 views

eth_call to call a function in my solidity contract fails with "execution reverted"

UPDATE: I figured it out though is doesn't entirely make sense. When abi-encoding an "address" as an argument, you use "address" in the hash of the function signature, however you ...
user avatar
1 vote
1 answer
86 views

how is Etherscan decoding transactions whose contract address has no available ABI?

Hi I was wondering how Etherscan was able to decode this transaction even though the contract address doesn't appear to have any ABI https://etherscan.io/tx/...
user avatar
0 votes
0 answers
107 views

ABI bindings in GO using abigen

Upon using the following command abigen --pkg package --abi abi.json --out binding.go I get this error: Fatal: Failed to generate ABI binding: 5:9: expected 'IDENT', found '/' What does this mean? ...
user avatar
0 votes
1 answer
60 views

What role does ABI-encoding play in digital signature?

I have two questions regarding the ABI. 1. When does it happen? A digital signature is made by creating a transaction data structure, RLP-encoded serializing the data, hashing it through keccak-256, ...
user avatar
  • 587
0 votes
1 answer
249 views

Decoding TX input (contract isn't verified at BSCscan and ABI is unknown)

I tied to decode transaction's input for the specific contract Contract source code is unknown and ABI is unknown too. At BSCscan contract isn't verified and built-in decompiling returns a mess ...
user avatar

1
2 3 4 5
9