New answers tagged

0 votes

Interacting with one smart contract to another ? , Multiple smart contract interaction ? , One contract calls to another contract ? Solidity

Ok, So to solve this problem, Solidity not only provides for inheritance to invoke contracts in one another, It also provides a cool feature that helps devs/coders to invoke a contracts function from ...
user avatar
0 votes

Pass a function as a parameter in Solidity

As noted in other answers, there are distinct answers to your question depending on whether you are talking about calling the function "externally" or calling it "internally." ...
user avatar
1 vote

Pass a function as a parameter in Solidity

For anyone coming from google looking for a quick example of how to pass a function as a parameter, check out the following code excerpt (source https://docs.soliditylang.org/en/latest/types.html#...
user avatar
  • 123
0 votes

Sending eth with write function causing problems?

The way I've used it is to pass overrides to the write function: const [{ data: writeData, error: writeError }, write] = useContractWrite( { addressOrName: 'Address', contractInterface:...
user avatar
  • 101
1 vote

How to call a contract's method via web3 1.x without a node (sign with a privateKey and send)?

Assuming you have a proper Web3 instance setup, the below is how I generally make contract calls from the server using a class (or where you have a fixed key that requires no user input). I use an ...
user avatar
1 vote

How to get value of a contract public property using web3.eth

None of the other answers work for me. This does: import Web3 from "web3"; const address = "0xe9e7..."; const abi = "[{..."; const web3 = new Web3(); // pass your ...
user avatar
  • 111
1 vote

How does a single getter call get chosen by a node if there's no reward associated?

Only transactions are distributed to the miners to be executed. The calls to view functions are executed by the web3 provider. If you run your own node the query will be executed locally, if you use a ...
user avatar
  • 29.3k
0 votes

NFT Sent to Smart Contract

I don't think that you can. But that would have reverted if you would have used the safeTransferFrom function as this contract doesn't appear to implement the IERC721Receiver. Did you used ...
user avatar
  • 124
0 votes

get array.length without a getter from other contract?

I recently had this issue and really needed to get the array length on an already deployed contract. And of course I didn't deploy some nice getCount() function. Here's my really terrible, but working ...
user avatar
  • 1
0 votes

How to detect from web3 if method exists on a deployed contract?

yes, there is a way. If the smart contract address owner have given the codes on its polyscan/etherescan, then you can get codes, they also provider API, so that you don't need to retrieve available ...
user avatar
1 vote
Accepted

Can external solidity functions get called within the same contract dynamically?

Is it a valid call or we need to add public modifier to mooz ? It is a valid call, but it's a strange usecase though. You do not need to add public and in fact, you can't. It would trigger a compiler ...
user avatar
  • 4,799
0 votes

Contract A delegatecall function in contract B which calls function in contract c. msg.sender for function in contract c?

The msg.sender according to the test scenario below is Contract A The Change to state happens in Contract A and Contract C For me it make sense because contract B has nothing to do with the ...
user avatar
  • 2,223
0 votes
Accepted

How can I call a deployed smart contract on Kovan using Python?

Any smart contract call cannot change the Ethereum state. You need to perform a transaction and pay the gas fee to make any state changes. There are no free state changes. Use transact() instead of ...
user avatar

Top 50 recent answers are included