Skip to main content
Share Your Experience: Take the 2024 Developer Survey

Questions tagged [contract-invocation]

Questions regarding the act of calling or interacting with (a.k.a. invoking) a contract on the Ethereum blockchain by a user or another contract on the blockchain. Includes both local invocation by call and global invocation by transaction.

Filter by
Sorted by
Tagged with
0 votes
0 answers
5 views

How to encode/decode complex conditions into 256 bit

I'd like to encode conditions in a single 256 bit integer to avoid storage costs. For example, assume that user passes 4 addresses(address[] type) to my smart contract function and he also wants to ...
irma magradze's user avatar
0 votes
1 answer
12 views

The state of the called contract has not updated!

There are two smart contracts, A and B. The addDev() function in contract A is called from contract B using the targetContractAddress.call() method. However, despite the call being successful, the ...
Alireza's user avatar
  • 547
0 votes
2 answers
28 views

Risk in using Singleton Call forwarding

I have a contract which manages assets. Users can add transfer ownership of contracts to the contract Users should be able to call their own contracts without risking other users having access. I've ...
RitzyDevUk's user avatar
0 votes
1 answer
35 views

Delegatecall failing 'could not coalesce error'

I'm trying to set a message to my Contract setmsg through a proxy contract using delegatecall.Using hardhat. getting this error: error: { code: -32603, message: "Error: VM Exception ...
Loputocharlio's user avatar
0 votes
1 answer
17 views

can we send value as well as call smart contract function using CALL

CALL opcode consumes value of the stack (which is transferred to the account). It can also additionally consume stack items to pass input to the smart contract account function. Can both happen ...
Sudeep Kumar's user avatar
0 votes
1 answer
53 views

Calls to self failing when passing structs

When a contract calls itself using the .call method and attempts to pass a struct, it results in a revert with the following error output: "error": "Failed to decode output: Error: data ...
Riley's user avatar
  • 1
1 vote
1 answer
17 views

how do you unstake VGX token?

i had staked my VGX token through their website back in 2021. but now their website is no longer available and i have been told that i have to unstake using etherscan. i tried to use the unstake ...
Feroz's user avatar
  • 13
1 vote
0 answers
75 views

eth_sendTransaction is not supported. Use eth_sendRawTransaction to send a signed transaction

I'll go straight to the point. I have a React App, I want to integrate this web with a very simple smart contract, which receives a hash and then saves with an event the timestamp of when it was ...
JETIX's user avatar
  • 11
0 votes
2 answers
42 views

Is there a way to test whether an external contract implements (or does not implement) a given interface method?

How would you determine whether a given contract implements a particular interface method without reverting? interface IRandomMethod { function getUint() external view returns (uint); function ...
Ashraile's user avatar
  • 125
5 votes
2 answers
113 views

How transaction fee is calculated in case of L2?

In case of L1, the transaction fee is typically calculated as the product of gas price and gas usage, i.e., txFee = gasPrice * gasUsage One such example can be seen in this transaction. In which the ...
SYED ASAD KAZMI's user avatar
0 votes
0 answers
35 views

How to make a smart contract/ a third party pay for transaction fees?

I'm trying to create a LiquidStacking smart contract where it would be possible to deposit any amount of ETH. Every time the smart contract's balance reach 32 ETH, it creates a BeaconChainDepositor ...
ASANSON's user avatar
  • 11
0 votes
0 answers
49 views

Verifying eth_call Results with Cryptographic Proofs for L1s and L2s

I'm interested in enhancing the reliability of static call requests (eth_call) to Ethereum smart contracts. Currently, the returned data is only as trustworthy as the node or service providing it. ...
MShakeG's user avatar
  • 1,703
0 votes
0 answers
16 views

On-chain or Off-chain: Optimal Calculation for Arbitraging Two v2 Pairs?

I'm currently exploring arbitrage opportunities involving two v2 pairs and I'm wondering whether it's more advisable to compute the optimal amount to trade on-chain or off-chain. What are the key ...
adam mr's user avatar
  • 121
0 votes
0 answers
32 views

Can my ETH be frozen by Metamask's Validator Staking Contract?

Does MetaMask have the power to freeze my assets? I'm not an expert but Validator Staking looks to me like a contract interacting with the beacon chain contract. Does me investing/interacting into ...
user23507422's user avatar
0 votes
1 answer
52 views

Transaction Hijacking?

So I created a wallet and sent it some funds then I submitted a few invalid transactions. I approved the correct address for transferring wrapped eth. After the approval my script immediately sent the ...
Samuel Wagner's user avatar
1 vote
1 answer
47 views

gasLimit argument in ethers.js confuses me

Assume the following: // Tx1 const realCall = await contract.callMain(secondAddress, num); const waited = await realCall.wait(); console.log(waited.gasUsed.toString(), ' gas used') it prints: "...
Neo's user avatar
  • 103
0 votes
1 answer
39 views

Does contract logic get executed with a SimulatedBackend?

I am trying to write a test, but I am surprised by an unexpected behavior with the SimulatedBackend. I am able to deploy the contract, and then call a function. The function runs an internal check, in ...
unsafe_where_true's user avatar
1 vote
1 answer
86 views

I need help with changing the owner of a contract

I'm trying to assist a client in changing the owner of a contract, but the situation is as follows: He has two contracts, A and B. Contract A is the owner of contract B. He only has access to the ...
Rafael Oliveira's user avatar
0 votes
0 answers
66 views

PancakeSwapV2 router "getAmountsOut" function returns wrong value

I'm struggling with "getAmountsOut" function, which works kinda fine for BNB/CAKE or CAKE/BNB. But it in some cases it just returns straight wrong values. Code: public async Task<decimal&...
Danik Logan's user avatar
0 votes
0 answers
112 views

ERC20 Multisend works on Sepolia Testnet but Fails on Mainnet

I've got a smart contract function that takes an erc20 contract address, an array of addresses and an array of amounts and then sends the each amount to each address of the specified token. I've got ...
nultinator's user avatar
0 votes
1 answer
28 views

Can require() be used to revert low level call() that were made before it?

CODE: (success, ) = contract.call(); // low level call if (success) { // do something } // instead of below check, can I just use require(condition)? if (!condition) { revert(); } Instead of ...
aste123's user avatar
  • 233
0 votes
1 answer
40 views

tokens transfered out after swap in

I am learning ethers.js and try swap tokens via ethers.js, and my transaction succeed buy my wallet had 0 tokens. Then i checked on bscscan and found that after my 'swap' transaction succeed, the ...
Roy Fong's user avatar
0 votes
0 answers
181 views

Generating input data with Ethers for low level call to Uniswap Router

I'm trying to generate the input data necessary to execute a low level contract call to the Uniswap SwapRouter.exactInput method. I've done the same for the exactInputSingle successfully but can't get ...
TommyF's user avatar
  • 152
0 votes
2 answers
45 views

Call a function from another contract, entirely determined by initial contract's function arguments

I would like to have a contract MainContract that can call any other contract functions depending on arguments given a MainContract function. It would look like this: pragma solidity 0.8.16; contract ...
Pacdac's user avatar
  • 80
0 votes
1 answer
35 views

How do I add my address to a deployed contract public address using a security exploit? (coding challenge)

I'm working on a coding challenge for smart contract security exploits. I need to add my address to public address (browerr) in the contract. Do I need to create another contract that inherits the ...
johnTg's user avatar
  • 1
0 votes
1 answer
317 views

error: "Transaction has been reverted by EVM"

I'm fairly new to Solidity and coding overall. I'm going through a Udemy course and I ran into an error which I can't find the solution for. I deployed a contract on the Sepolia test network from ...
Arad11222's user avatar
1 vote
0 answers
18 views

Why did my contract read method call get turned into a transaction using gas fees? [closed]

I called a contract read method from my React app using ethersjs but it turned into a tx with gas fees. See the below tx hash on etherscan: https://etherscan.io/tx/...
jiamijiang's user avatar
0 votes
1 answer
40 views

Using the Freeze functionality as a user in the BNB contract

In the BNB contract there is the Freeze and UnFreeze functionality. As I have understood, this doesn't allow Binance to freeze users’ balances. Instead, it allows any user to freeze and unfreeze their ...
Bart DV's user avatar
1 vote
1 answer
78 views

is this how delegatecall works? what other ways are there keep msg.sender the same when a contract is interacting with a different contract? [duplicate]

I recently started development on a personal project, and one of the suggested methods to achieve what i want was using delegatecall. Essentially I have a main contract that the user interacts with ...
pierre96's user avatar
0 votes
1 answer
224 views

simulate a transaction considering another pending transaction

I have the following problem and have hard time to simulate it to get the answer. Let say I have a 5 WETH tokens. I sent transaction X with nonce 1 to transfer 5 tokens from Account A to Account B. ...
Majd TL's user avatar
  • 3,237
0 votes
1 answer
36 views

Facing errors with contract invocation ( Unable to access a function stating only owner can access it , even tho I am the owner)

(sorry for structuring the question in a wrong way as I am not sure what term to use precisely) I am facing issue while trying to call the function flip in the program below , I am using chainlinks ...
kaushik choudhury's user avatar
0 votes
1 answer
134 views

Detect honey pots / rugpulls

I was wondering if there was a way to detect honey pots and rugpulls tokens in python. I'd like to do some sniping, so using api and waiting for their response would make me lose time. I'd like a way ...
Newly Sama's user avatar
0 votes
1 answer
79 views

Receiving no events in contract receipt web3js

In my contract interaction with web3js I have a .once("receipt", async (receipt) => { console.log("receipt:", receipt); I run this with a firebase function. ...
ctseer seer's user avatar
0 votes
0 answers
545 views

Wagmi throws "Cannot Decode Zero Data" Error when using useContractRead

I am using wagmi with next 13, and trying to call "view" function in my contract. The function in my contract: function getAllGrids() public view returns (address[] memory) { return ...
Arham S C's user avatar
2 votes
1 answer
163 views

Tool to re-create state of smart contract locally

I would like to be able to simulate transactions with smart contracts based on their solidity source code. The process should be entirely automated. While I am aware that some tools allow forking the ...
davidsawyer's user avatar
0 votes
0 answers
25 views

Token Rewards Calculation and Distribution

I'm doing a script to calculate rewards for a handful of addresses (from sensors). The script runs weekly where it takes a bunch of addresses from our DB, cleans the data and calculates the associated ...
gritty's user avatar
  • 1
0 votes
1 answer
55 views

Calling a safeTransferFrom of a contract that implements an ERC721Upgradeable interface

I have a contract A that inherits the following contracts: contract NftTemplate is Initializable, ERC721Upgradeable, ERC721URIStorageUpgradeable, AccessControlUpgradeable, ...
Allennick's user avatar
  • 253
0 votes
0 answers
46 views

How would look like calldata for bytes[] calldata argument?

Imagine I have a function with such signature in Solidity: function doThing(bytes[] calldata arr) external; how are elements of arr are packed in bytes? I would say that first 4 bytes is bytes4(...
gabbi's user avatar
  • 1
2 votes
1 answer
85 views

How to access funds if the Gnosis Safe website is shutdown?

Imagine that the Gnosis Safe website and services is shutdown, how can users access their funds?
usama's user avatar
  • 21
1 vote
2 answers
84 views

Malicious smart contract that transfers tokens forth and back

Sorry if my question was already discussed. Is it possible to implement such a smart contract or contracts that in result can transfer eth or ERC20 tokens forth from ANY to B account and back from B ...
Oleg's user avatar
  • 11
0 votes
1 answer
158 views

Unable to call functions on a deployed contract through web3py

I have a working private network in which i have successfully deployed a contract using python. I have its address and i can see the deployment in the node log, but i cant call any functions and it ...
Javi Gómez's user avatar
0 votes
1 answer
396 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
1 vote
1 answer
38 views

Why doesn't this try/catch block catch the revert in `asset.symbol`?

I wrote this Solidity function: function getAssetSymbol(IERC20Metadata asset) internal view returns (string memory) { try asset.symbol() returns (string memory symbol) { return symbol; ...
Paul Razvan Berg's user avatar
1 vote
1 answer
178 views

Wrapping ETH into WETH via ethers -- WETH coins on my balance won't appear

I'm attempting to wrap ETH on Goerli into WETH by calling deposit function using ethers. Even though several TX already have been confirmed and successfully mined, nothing will appear on my WETH ...
Camila326's user avatar
  • 115
1 vote
2 answers
1k views

WEBSOCKETS Provider url for binance smart chain

I have a contract deployed in Binance smart chain. I have written a script that will help me read the events logs from the Blockchain. currently, I tested that with the local hardhat network itself, ...
Bappa Banerjee's user avatar
0 votes
1 answer
43 views

Why is MyCrypto is disabling the Sign Transaction button?

I'm using MyCrypto to execute a function of a smart contract but the sign Transaction button is disabled. I'm using the setting to auto calculate the Gas Limit and its suggesting a limit of 68908 with ...
TheLogicMan's user avatar
1 vote
1 answer
57 views

@openzeppelin/contracts import failed

The issue I am having is when I am trying to compile my contract, I am getting multiple errors for ERC721. As imported ERC721 is importing more contracts, as seen from the errors, the issue is that it ...
Hasbik645's user avatar
1 vote
1 answer
30 views

calldata usage, difference between the method calling function with calldata

I recently studied optimism, and found that appendSequencerBatch() of CanonicalTransactionChain contract called with calldata. I assumed that this function was called using 0x(functionSelector)+(data.....
gun bos's user avatar
  • 25
0 votes
1 answer
57 views

Emit is not working on simple Token Factory

I'm using Hardhat 2.12.7, here's my Factory contract: // SPDX-License-Identifier: MIT pragma solidity ^0.8.9; import "./SimpleToken.sol"; contract SimpleFactory { event Deployed(string ...
deb0rian's user avatar
  • 121
2 votes
1 answer
69 views

What should the input parameter structure look like in validate(touple) function of Seaport contract?

I'm trying to call the validate() method of Seaport but can't find the correct form of inputs, as it always returns the error types/value length mismatch when calling on Etherscan. I'm calling the ...
Nal Luksic's user avatar
  • 1,167

1
2 3 4 5
24