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
0answers
8 views

Typescript creating web3 contract abi

Trying to do a simple test call to my contract, im getting this error on the contract instantiation part, Type '{ contractName: string; abi: ({ inputs: any[]; stateMutability: string; type: string; ...
0
votes
1answer
7 views

Why is Brownie ContractContainer empty despite Deployed Contracts?

I'm having issues with Brownie not appending the deployed contracts to the ContractContainer as when attempting to index the ContractContainer for my SimpleStorage contract I get the following error: ...
0
votes
0answers
12 views

Streaming Contract pending transactions using ethers?

Trying to setup interaction with a contract to stream pending transactions but I don't see how to do so for a specific contract or address. Ethers js documentation shows how to pull all pending tx (...
0
votes
1answer
7 views

variable in WGAME woolf.sol confuses me

Okay, so I was looking over the wolf contract(https://etherscan.io/address/0xeb834ae72b30866af20a6ce5440fa598bfad3a42#code), to understand how they fixed it and what happened... and one thing just ...
1
vote
1answer
19 views

Getting the functions of an unpublished contract

New to all this so please be gentle. Suppose a contract is deployed, eg: 0xfc0995dc31ff8986bedbb3e88c21a89997f54c12 Checking its contract tab under bscscan shows it hasnt been published, though its ...
0
votes
0answers
13 views

Is there a way to get a smart contract's ABI automatically using python?

I am scraping a smart contract trying to get the ipfs link for its tokens, but each of these tokens comes from different smart contracts. I have the tokenIDs and the specific smart contract addresses ...
0
votes
0answers
13 views

Smart contract that recognizes Tweets made by each Twitter user [duplicate]

Is there a way for a Solidity smart contract to interface with Twitter accounts or Twitter API to recognize the number of "relevantly tagged" tweets that account made? For example, an ERC-20 ...
1
vote
1answer
28 views

Monitoring Ethereum Contracts for specific function calls - missing methods in ABI

I created a script to accept a contract address and watch that contract for specific "events." In this case, I want to check each time the Loot for Snail function is invoked on the EvoSnails ...
0
votes
1answer
17 views

The longer a smart contract interaction's code is, the higher the gas?

It seems that different contract interactions cost different amounts of gas. For example, minting an NFT costs much more gas than the action of transferring some ether to another wallet. Are these gas ...
1
vote
1answer
12 views

How to tell whether a 0x address is a wallet or a contract?

This as an Ethereum wallet address: 0x983110309620D911731Ac0932219af06091b6744 This is a token contract address (ERC-20, WETH): 0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2 As you can see they are ...
1
vote
1answer
25 views

What is SwapRouter in Uniswap v3?

I am trying to find any information about the SwapRouter contract in Uniswap V3. I have tried searching on Web and docs, but nothing meaningful shows up. Based on my general understanding of Uniswap, ...
0
votes
1answer
26 views

How to interact with Ethernaut contracts via Remix

I'm going through the Ethernaut levels and I have some fundamental questions I need answered before I can continue. This question is particularly in reference to the levels that require you to deploy ...
0
votes
0answers
19 views

How to call a solidity function from python?

I wrote a contract, now want call my function _send from python I write this code my function function _Send(address to) internal payable { payable(to).transfer(msg.value); } my code python import ...
0
votes
0answers
30 views

Why did this txn fail? Gas Limit 2x and Price 1.3x, but 'Out of Gas'

I deployed a solidity contract to rinkeby, then mainnet. The same transaction that succeeds on rinkeby, fails on mainnet due to "Out of Gas". The contract and client are the same. On the ...
0
votes
1answer
21 views

How to call a smart contract on any chain without code?

Is there a tool that allows making calls to smart contracts without the need to write code, and that can be used on all (or most) chains (e.g. Ethereum, Binance, Solana, Hamony, etc.)?
2
votes
2answers
56 views

How can I decode calls to the songbird network?

for example: I am a multisig signer. And I want to decode the call data that is used to call a specific smart contract. example on smart contract : 0x02f0826ef6aD107Cfc861152B32B52fD11BaB9ED (WNat) I ...
1
vote
1answer
40 views

ethers - call an overloaded function with a specific signer

Connecting a specific signer to a contract object in Ethers is easy: // assuming a signer called 'user' and a contract called 'Foo' with function 'bar' await Foo.connect(user).bar(); There's also ...
0
votes
1answer
72 views

Solidity MINT ERC20

I will try to be brief in my doubt, below I am putting a model of a Smart Contract referring to a currency that I am creating for my game. // SPDX-License-Identifier: MIT pragma solidity >=0.4.22 &...
0
votes
1answer
120 views

How to estimate gas without balance?

So, I'm making a private network and deploying some contracts. The contract has a payable method which means I have to put value when calling the method. I want to get the estimated cost to call the ...
0
votes
0answers
83 views

Truffle: Error: Returned values aren't valid, did it run Out of Gas? for trying to return uint

I have a very simple contract which i fully expected to work. event FlagChanged(uint newFlag); uint private flag; function storeFlag(uint newFlag) public payable{ flag = newFlag; emit ...
0
votes
0answers
20 views

Check if smart contract function exists from code and then call it

I'm getting the code of a smart contract by using web3.eth.getCode(contract_address) I want to call certain functions that I'm fairly certain exist on that contract, however I don't know the ...
2
votes
2answers
244 views

Decode input parameter without ABI

I have a transaction with input data that looks like this: 0x2293db5700000000000000000000000030823e060e8be429b34bd9192df9cad4b166a056 I know that the last 40 characters is the token address which ...
0
votes
2answers
19 views

How to write a smart contract that transfers funds from an address in the future

Following understanding that smart contracts do not have private keys and cannot sign transactions I am wondering how would a smart contract that transfers funds from an address in the future look ...
0
votes
0answers
15 views

What does "caller()" return in Yul when DELEGATECALL is used?

While browsing the Solidity docs, I noticed this instruction available in assembly: caller(): call sender (excluding delegatecall) What do the docs mean by "excluding delegatecall"? Is it ...
0
votes
1answer
42 views

How do smart contract transfer funds if they do not have private keys?

I am reading a book on ethereum and I saw this: Only externally owned accounts have a corresponding private key. Private keys are used for signing new transactions sent to the network as a means of ...
0
votes
0answers
10 views

Getting an error when using methods.myMethod.call() with web3js

I am getting an error trying to call an existing smart contract function using call(). The error is "Returned values aren't valid, did it run Out of Gas? You might also see this error if you are ...
0
votes
0answers
16 views

Get into latest block before given timestamp

I have a specified future timestamp. And I need to put my transaction into latest block before given timestamp. Not just commit transaction before timestamp, but get into the lates one block before it,...
0
votes
0answers
25 views

Error creating contract after getting contract ABI from Etherscan API

I am trying to get the contract ABI using the Etherscan API, and then create a contract instance and call a method using web3.js. I am able to get the ABI from Etherscan but when creating the contract ...
0
votes
0answers
30 views

execution reverting when using w3.eth.call(), but going through when using MyContract.functions.myFunction(params).call()

I am calling my Contract in the two following ways: params = {"amount0": int(amount0), "amount1": int(amount1), "token0Flash": token0, "token1Flash": token1} ...
0
votes
0answers
26 views

Error testing call function

I am trying to test the call function using the contracts provided in this link. Attempting on Truffle running Solidity 0.6.12 (I think this is the most recent version) I get the following errors For ...
0
votes
1answer
35 views

Can I use delegatecall with the target contract's storage?

With a scenario that goes as follows: I want a Contract A that allows me to call functions from other contracts, different each time, using the storage and code of the target contract. Essentially, I ...
2
votes
1answer
166 views

Can you test a contract function transaction by calling it instead

I am trying to test my deployed smart contract functions without having to go through the transaction and pay gas fees. I saw that Metamask can detect if a smart contract function is going to fail ...
0
votes
0answers
40 views

How to buy self-created ERC-20 token via simple transaction?

Pretty sure that this is something newbie, but here is the problem: I created smart contract I got initial balance using official faucet of Rinkeby network and Metamask I deployed contract using ...
0
votes
0answers
11 views

What's the easiest way to call a constant function in the context of a past block number?

I need to find out what was the state of a contract at a specific block number in the past. What's the easiest way to do this? Is there a public archive node that we could interact with, similar to ...
0
votes
1answer
32 views

How does msg.data is encoded?

I have a call for this function (from here): function setup( address[] calldata _owners, uint256 _threshold, address to, bytes calldata data, address ...
0
votes
1answer
27 views

Can you use smart contract 'instances' rather than deploying each new contract?

My apologies in advance for this noob question, I think a scenario might be the best way to ask: I have a simple escrow smart contract that facilitates the buying of products. For simplicity sake, the ...
0
votes
0answers
13 views

Using tx.origin to restrict function call by originator (even if indirectly, via another contract)

In my use case I have a root smart contract with which end users interact, and I have some several services, which a variety of contracts may call, but I want those services to execute only on behalf ...
0
votes
0answers
84 views

Can't seem to withdraw money from contract

I am new with solidity. I've implemented this withdraw function function withdraw() public payable onlyOwner { require(payable(msg.sender).send(address(this).balance)); } And I am calling ...
0
votes
1answer
130 views

Does a view function always have access to msg.sender?

Any transaction happening on the blockchain obviously has an associated sender address, which solidity stores in msg.sender. However, if I have a view function which can be used to read the state from ...
0
votes
0answers
25 views

What purpose of merkleProof in contract?

I found a ABI list of this contract in bscscan: 0x16fb38712d355833647f4adfb1f6ff80f289c203. I dont know what is the purpose of _merkleProof parameter as below and what value that I can pass for it? { ...
1
vote
0answers
27 views

What happens when you pass more gas than what is available?

When making a contract call in Solidity, the gas stipend can be altered with the following special options: {value: WEI_VALUE, gas: GAS_VALUE} What happens when the GAS_VALUE is bigger than what is ...
0
votes
1answer
77 views

How does Solidity decode a struct returned from a delegate call?

I have a proxy contract that delegate calls to a target contract. The proxy is similar to DSProxy. In it, there is an execute function: function execute(address target, bytes memory data) external ...
0
votes
0answers
19 views

How can a contract receive Ether via a public getter function?

While reading the Solidity docs on Panic via assert and Error via require, the following statement caught my attention: An Error(string) exception (or an exception without data) is generated by the ...
5
votes
2answers
181 views

How to bubble up a custom error when using DELEGATECALL?

Solidity v0.8.4 introduced custom errors: error Unauthorized(); Say I have contract A which delegate calls to contract B. The latter reverts with the custom error defined above. How can I bubble that ...
0
votes
1answer
190 views

Having trouble figuring out EIP-1599 params for contract transaction in ethers.js

I am following contracts documentation at https://docs.ethers.io/v5/api/contract/contract/#contract-functionsSend And got to the point where my contract call looks something like this (someMethod and ...
0
votes
1answer
51 views

Manually add contract address to an Ethereum wallet

I cannot find any advice on how to manually add a contract address for tokens on the ETH network. All resources point to clicking "add wallet" within their own application. Similar to adding ...
0
votes
0answers
243 views

What does setApprovalForAll do when minting an NFT directly from contracts on Etherscan?

When there is a contract : It says Approve Get access by card Or if it says ————- Whitelist address Set approval Claim free mint Mint _____ And I’m trying to just mint the project In both of these ...
0
votes
0answers
14 views

Web3.js retrieve a boolean from ERC721 Contract

I can't find this anywhere in the docs. I'm trying to retrieve a boolean value from my ERC721 contract. I understand that to call a function, you simply use: contract.methods.MyFunction(param1, param2)...
2
votes
2answers
175 views

does using external over public in a library reduce any gas costs?

I have a library utils.sol library Utils { struct UtilType { unit var1; bool var2; } function addExtra(UtilType storage state, uint extra) public { state.var1 += extra; } } ...
1
vote
2answers
49 views

How to send token instead of eth with web3?

I have a function that sends eth to a function in a contract with web3: await contract.methods.withdraw(i).send({ from: from }); debug("withdraw in battle: "+i); } I would like ...

1
2 3 4 5
21