Linked Questions

64 votes
7 answers
16k views

How can I verify that a contract on the blockchain matches the source code?

Given the (Solidity) source code of a smart contract, is there a way to deterministically compile the code and compare it with the code on the blockchain? I want to verify that the contract does what ...
J-B's user avatar
  • 8,941
25 votes
5 answers
13k views

Pass a function as a parameter in Solidity

Can you pass a function as a parameter in Solidity? My guess: There is the concept of address in Solidity, but they represent contracts. Contracts can have fallback functions, but I don't think you ...
Karl Floersch's user avatar
57 votes
4 answers
55k views

How to call a contract method using the eth_call JSON-RPC API

Ok, so I'm trying to call a contract method using the methods provided by the Ethereum JSON RPC interface. The JSON RPC is running on an Ubuntu machine. Unfortunately, I can't really get a result back ...
MethDamon's user avatar
  • 803
31 votes
3 answers
25k views

What is calldata?

What is calldata? I learned that there are three types of memories: Storage Memory Stack In the Ethereum docs, it says that the function parameters are of type memory by default. However, I've also ...
Sheikh's user avatar
  • 445
12 votes
3 answers
7k views

How does the EVM find the entry of a called function?

I read the source code of go-ethereum and confused about how does the EVM find the entry of a called function. As the specification said, the data field in a transaction specifies the function and the ...
rong jialei's user avatar
4 votes
3 answers
975 views

Why do I need to have exact same code to load contract from address in Remix IDE?

I tried to interact with the deployed contract and i don't have its code. so i found out the contract address and tried to load contract from address in Remix IDE! isn't this possible? WHY?
MYANZIK shrestha's user avatar
25 votes
2 answers
14k views

Do I need a compiled contract just to get the ABI definition?

Why do I need a compiled version of the contract just to get the ABI definition? Seems like the contract address should be enough. Im very confused because I am simply trying to run a contract ...
ZMitton's user avatar
  • 2,750
13 votes
2 answers
2k views

Why does an empty message still invoke the code of the contract?

An empty message still invokes the code of the contract and is the mechanism that allows Solidity to implement a feature of a fallback function per contract. But when msg.data is empty, why does ...
eth's user avatar
  • 85.6k
12 votes
2 answers
5k views

Clarification of "256 bit word" semantics

EVM has "256bit words". Some cases treat strings shorter than 32 bytes (256 bits) as left-justified ascii (packed into the most significant bytes of the word). Does this mean that the word value of ...
rethsid's user avatar
  • 1,898
10 votes
2 answers
8k views

What is a function signature and function selector in solidity (and EVM languages)?

I've heard the term "function signature" as well as "function selector", what are they? What are they for?
Patrick Collins's user avatar
9 votes
2 answers
1k views

Is sending some datas in the data field safe?

An airdrop ask to send it 0ETH with 150000 GAS and some datas in DATA field. Is it safe? What could be the aim of this transaction? Thanks.
Pat Hibulaire's user avatar
9 votes
2 answers
2k views

Can msg.data be used as an identifier?

I'm looking at the multisig wallet implementation here and I see the usage of sha3(msg.data,block.number) being used as an identifier. What exactly is inside the msg.data and why is it unique enough ...
plsnoban's user avatar
9 votes
2 answers
8k views

Get smartcontract token balance via JSON RPC

Via Geth commandline I can get my smartcontract token balance with: var mytest = eth.contract([{interface}]).at(contract address); mytest.balanceOf(eth.accounts[0]) >998 I want to present the ...
Jeroen's user avatar
  • 191
8 votes
2 answers
12k views

How do I manually encode and send transaction data?

Say I want my contract (in assembly) to be more gas efficient and can handle deserialization of a more efficient msg.data myself than the standard ABI.. I am willing to spend time on the client in ...
nxstock-trader's user avatar
6 votes
2 answers
5k views

Understanding nameReg.call("register", "MyName") style call between contracts

Here's an example from solidity docs on Address type methods(call method specifically): address nameReg = 0x72ba7d8e73fe8eb666ea66babc8116a41bfb10e2; nameReg.call("register", "MyName&...
manidos's user avatar
  • 4,298

15 30 50 per page