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
16 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
14 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
22 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
30 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
  • 70
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
132 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
14 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
19 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
29 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
136 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,177
0 votes
1 answer
35 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
51 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
41 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
344 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
87 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
20 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
36 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
  • 233
0 votes
0 answers
41 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
1 vote
1 answer
57 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
  • 11
1 vote
2 answers
63 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
91 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
165 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
34 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
0 votes
1 answer
119 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
1 vote
1 answer
713 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
34 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
43 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
23 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
47 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
53 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,069
2 votes
1 answer
184 views

How does a sweep contract works?

I received an invoice from one of my clients and they gave me a payment address to: https://etherscan.io/address/0x4b05e01a0a2dd41071172d0c6325349921deaf2a I'm curious to how this works as I am ...
Patoshi パトシ's user avatar
1 vote
2 answers
134 views

How can I add consumers to a Chainlink VRF2 subscription with an external smart contract?

When I try to add a consumer to my VRF2 subscription via the Subscription Manager, the transaction completes successfully. This also works when interacting with the chainlink contract directly on ...
0xheartcode's user avatar
0 votes
0 answers
62 views

Calling emergency withdrawal on deployed unpublished smart contract Binance

Does anyone know how to call emergecny withdrawal function on a contract that is live and in use but not published on BSC Scan? Example: 0x7F62c957151810cD743e5707465F4937422300cC is live but not ...
The-Op2444's user avatar
5 votes
3 answers
3k views

Call smart contract method with ethers.js version 6

I was successfully using the version 5 of ethers.js so far and I'm now migrating my code base to version 6. I tried the following code to call a method on my smart contract that is supposed to return ...
Platus's user avatar
  • 151
1 vote
1 answer
16 views

My payout function to lottery winners is failing. I'm storing the winners in an array and attempting to payout but getting reverts

the code: function payoutWinners() public payable { require(msg.value >= payoutOwed, "send more than what is owed"); for (uint i = 0; i < winningAddresses.length; ...
snejad123's user avatar
0 votes
2 answers
191 views

How to interact with a contract that requires a uint256 value? The input I want to give is "5"

I have the following contract function. I want to input 5, but it requires it in the format uint256. How do I represent this in uint256? And is there a way to interact with this contract function ...
Patoshi パトシ's user avatar
0 votes
0 answers
49 views

Gas cost of calling a function

I have two cases here : CASE 1: Let's say i have a conract A with three functions myFunctionA(), myFunctionB() and myFunctionC(), and when i call myFunctionB from myFunctionA, it calls myFunctionC: ...
noro meb's user avatar
  • 328
0 votes
2 answers
902 views

Can you fetch the whole transaction history of specific contracts somewhere?

I know you can validate the data of specific tx hashes using web3js or the etherscan api. But is there a service which allows to query all transactions performed by or connected to a specific smart ...
rajohs's user avatar
  • 179
0 votes
1 answer
29 views

Retrive data from chainlink node

in APIConsumer contract on chainlink docs (Any API) // SPDX-License-Identifier: MIT pragma solidity ^0.8.7; import "@chainlink/contracts/src/v0.8/ChainlinkClient.sol"; import "@...
noro meb's user avatar
  • 328
1 vote
2 answers
271 views

How does etherscan get such data?

I need to select special transactions like these: That is, a sale transaction, with a certain price (0 ether, as here). As a result of the work carried out, I can determine which nft from which ...
Mod diller's user avatar
3 votes
1 answer
128 views

Best way to ignore the success status of a call?

I have a situation where I want to ignore the success status of a call, and I am currently doing it like this: try addr.functionCall() {} catch {} I know I could do a low-level call like this: (bool ...
Paul Razvan Berg's user avatar
0 votes
1 answer
121 views

Invalid opcode OR Cannot read properties of undefined (reading 'length') (depending on the situation)

I'm working on a bot that loads in a bunch of values from an array and uses an event handler to take action upon an event. This was originally built as a bot to monitor a swap on two exchanges for a ...
Trent Kennelly's user avatar
1 vote
2 answers
315 views

Does the EVM revert if a call is attempted to an address that doesn't have code?

The following code would revert in high-level Solidity if the provided addr is an EOA or a contract that does not implement MyInterface: interface MyInterface { function myFunction() external; } ...
Paul Razvan Berg's user avatar
0 votes
0 answers
26 views

solidity - why returned data not includes length

Let's imagine the following: /// to.call calls this function function fail() { revert("test"); } // (bool success, bytes memory response) = to.call{value: 0}(data); The way I understand is ...
Giorgi Lagidze's user avatar
0 votes
1 answer
37 views

Do i need to fund my contracts with eth

I have a protocol composed of multiple contracts which interact with each other, when a user call a transaction in one of the contracts, the contract calls other contracts functions . The question is :...
noro meb's user avatar
  • 328
1 vote
1 answer
138 views

Why do I need a contract's code/abi to interact with it [duplicate]

The "At Address" button in the remix deploy tab is to interact with an already existing contract. So why is it necessary (to be able to interact with it) to: paste the code of the contract ...
IBeFrogs's user avatar
0 votes
1 answer
90 views

Difference between contract address and contract instance on ethernaut

I'm in ethernaut, on the second level: Fallback. I don't understand the difference between the level address and the instance address. Which of these refers to the contract they show?
IBeFrogs's user avatar
2 votes
1 answer
124 views

check if a DELEGATECALL has taken place during the transaction

I know how to check if a current contract's function is been called using CALL or DELEGATECALL (by comparing address(this) to the contract's address that must have been previously saved as an ...
Alberto Molina's user avatar
1 vote
2 answers
59 views

Unable to get value from a smart contract

I try to deploy a smart contract on a private block chain (geth started with --dev). However, even if my contract is as simple as possible, I cannot get the stored value. pragma solidity ^0.8.8; ...
Eric's user avatar
  • 11

1
2 3 4 5
24