New answers tagged

0

I am just trying to understand why the bytes32 and 5, need strings of length 66 and 11 respectively if each character is a byte I'll explain for bytes32: In order to send bytes32 from web3.js to a smart-contract function, you need to provide a string which starts with "0x" followed by 64 hexadecimal characters. Why 64? Because each character ...


2

The Istanbul hardfork included EIP-1884, which (among other repricings) repriced SLOAD from 200 to 800 gas. That means loading 5 addresses from storage will cost 4000 gas, not including any overhead. The Istanbul hardfork also included EIP-2028, which lowered the cost of non-zero calldata bytes from 68 to 16. These two EIPS are what cause the huge difference ...


1

In any standard ERC20-Token, for example, because that's what the ERC20 standard dictates: function name() public view returns (string); function symbol() public view returns (string); If you use bytes32 instead (as implemented in some of the early ERC20 tokens deployed on mainnet), then you'll be violating the standard, and any application trying to ...


1

It seems there now is, since solidity version 0.4.24 you can use abi.encodePacked E.G: uint i = 0; i_bytes = abi.encodePacked(i);


Top 50 recent answers are included