All Questions
Tagged with contract-invocation transactions
29 questions
195
votes
2
answers
60k
views
What is the difference between a transaction and a call?
What is the difference between a transaction and a call? In some interfaces, I can interact with contracts via calls or via transactions. What is the difference between the two, and can contracts also ...
91
votes
9
answers
26k
views
Can contracts pay the gas instead of the message sender?
Is it possible for a contract to pay the gas costs (or part of it) that result from the contract being called? Or does the sender of a message always pay the resulting gas costs no matter what?
21
votes
1
answer
2k
views
What is the order and concurrency behavior of multiple calls to a contract in a single transaction?
Suppose a contract has three call APIs that have side effects.
What's the behavior if I try to:
Call all three APIs from one address (i.e. issue three transactions if from nodejs). Are all three ...
16
votes
1
answer
8k
views
How much does it cost to use a contract?
Still new to ethereum and would like to know the price for a contract.
30
votes
4
answers
11k
views
Does every node execute the contract code for each transaction?
This question was asked on Reddit a while ago:
When a node sends a transaction to the network and has the receiver as a contract, does every node execute the contract bytecode with the inputs to ...
20
votes
2
answers
4k
views
What happens when a smart contract gets several similar calls in the same block?
What happens when a smart contract gets several similar calls in the same block?
Consider for instance this greeter:
contract greeter {
string name;
function setName(string name_) {
...
28
votes
2
answers
22k
views
How do I know how much gas to use when calling a contract?
When I am calling (sending a transaction to) a contract how do I determine how much gas to use? Is there a way to calculate this upfront & what happens if I send too much / too few gas?
7
votes
1
answer
3k
views
Passing ether with call to Solidity function
I have deployed a contract to testnet which appears to function.
I have a function named contribute which gets the ether from the msg.value. The function is below and doesn't take any arguments.
I ...
5
votes
2
answers
4k
views
How can I get the hexadecimal equivalent for a method name in an Ethereum contract using Python?
The function to call is called xyz().
My code:
web3.sha3("xyz()").substr(0,10)
Error:
AttributeError: module 'web3' has no attribute 'sha3'
In newer versions of web3, the above error ...
8
votes
3
answers
4k
views
Reading values from a contract: When do I need transactions?
Since reading on the Blockchain does not need performance of other nodes, I wonder how I can get values from a Smart Contract without any transactions. I have created a little example contract:
...
2
votes
2
answers
900
views
How do I deploy a contract, then send and retrieve a string from it?
I wish to store strings on-chain.
From what I understand so far, I need to set up a contract, then I can send transactions (with a string) to that contract which will be stored. Is this the best way ...
9
votes
3
answers
7k
views
Who pays gas for smart contracts?
I'm currently writing my first smart contract and I'm trying to figure out how to inject gas into the contract, of course, if it's possible.
I'm not sure If I got it correctly. With every transaction ...
7
votes
2
answers
564
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 ...
6
votes
1
answer
15k
views
Execute transaction Approve directly against contract address (without ABI)
Solved
For now, you will always need the ABI to execute a call against the ethereum network with web3. A simple way is to reconstruct the function you wish to execute is to, either create a separate ...
5
votes
1
answer
8k
views
Get pending transactions to a given address/contract
Is there a way I can get all pending transactions to a given address/contract? I could get the confirmed transactions by exploring transactions in recent blocks. But how would I go about getting ...
5
votes
2
answers
2k
views
Who is msg.sender in a nested call chain?
I read about who is msg.sender when calling a contract from a contract, but who is msg.sender when calling a contract from a contract that calls another contract and so on and so forth?
1
vote
2
answers
8k
views
Is it possible to insert some custom data in the DATA field of an Ethereum Transaction?
i am working on trying to get some data encoded/inserted into an ethereum transaction.
Let me describe my environment first, i am using Web3py, Ganache and Remix IDE. I am able to successfully ...
0
votes
2
answers
677
views
Why is transaction reverting with custom smart contract?
I have deployed a smart contract to the Polygon Mumbai Testnet (it shouldn't really matter where I deployed it).
When sending a transaction to call a function on this contract, the transaction fails, ...
7
votes
2
answers
3k
views
How can I use "eth_sendTransaction" to invoke a contract and get logs?
I have deployed:
contract test {
function multiply(uint a) returns(uint d) {
return a * 7;
}
}
I can call the contract with "eth_call" :
mpsp@ubuntu-slave2:~$ ...
5
votes
2
answers
905
views
return (bytes32,bytes32) , returns actual transaction address instead of the real data
I have attached my contract, which works fine on populus and compiles on geth. It is a simple source code: Test() function appends data into my linkedlist that is defined in my library. And get() ...
5
votes
1
answer
4k
views
How to know the hex code to use in data to call a specific contract function?
For instance, on the BAT ico site, you can see the crowdsale contract address, the ABI and also a string to use in the data part of your transaction if you don't want to call the contract function ...
4
votes
1
answer
2k
views
"Estimated fee consuption: The contract won't allow this transaction to be executed." happening in my custom contract in my private network
Any ideas?
My contract:
pragma solidity ^0.4.0;
contract shares {
enum OrderType{BUY,SELL}
struct Order{
address solicitant;
uint price;
uint quantity;
}
...
3
votes
1
answer
8k
views
Get the balance of an ERC20 token at an Ethereum address [duplicate]
I'm trying to get the balance of a token on an Ethereum address. So let's say my Ethereum address has 1 SNT. I'd like to make a call to get that 1 SNT as a response. I've written many other calls ...
2
votes
1
answer
6k
views
ENS on Rinkeby - Network does not support ENS?
I was able to register the ENS domain on Rinkeby, as the network supports ENS.
My TX: https://rinkeby.etherscan.io/tx/0xd42b64ab03387d7ca405e7ba7b85ce893444a141e7a7de174f0361e2c4231674
My subdomain: ...
2
votes
2
answers
3k
views
How can i sent ETH from a contract wallet to another account?
Use the mist wallet 0.3.9.
The ETH from a pool is sent to a wallet address. How can I send the ETH from wallet to account?
When I try to send from the wallet address to an exchange address, I saw ...
1
vote
0
answers
1k
views
How to get all the transactions made by a token address [duplicate]
Given the address of a token, how I can get all the transactions related to that address using JSON RPC or an external api such a api.etherscan.io?
The transactions that gives a Ethereum address are ...
1
vote
1
answer
93
views
Is gas ultimately *only* sent to miners while the computation defined in a smart contract is performed by each node of the network? [duplicate]
To my understanding, the execution of the code inside a smart contract is done by all nodes in the network. However the miners are the only ones who receive the paid gas. Also, when setting up the ...
1
vote
0
answers
524
views
How to get transaction hash at time of invoking function?
I have a function as follows:
function setEnergy(address dev, uint256 energy) public returns (bool) {
require(dev != address(0));
amount[dev].energyValue = amount[dev].energyValue + energy;
...
1
vote
1
answer
2k
views
How to send data to smart contract?
I have the variable w1_temp, which i need to send to contract
I have the following code:
var W1Temp = require('w1temp')
var Web3 = require('web3')
var web3 = new Web3()
web3.setProvider(new web3....