2

Automatic getter functions of struct state variables will encode the struct data as if they were multiple return values, instead of returning one struct value. This is because before ABIEncoderV2, it was not possible to return a struct value. In this example, the getter function for aaa encodes the data exactly like function bbb: as multiple return values. ...


1

If you pass as a parameter or receive from a function a value of non-canonical type, such as a string or an array, then the offset of its description is passed in the position of the corresponding parameter or return value. Accordingly, for two bytse32 arrays it will be (array1[2], array2[3]): 000 ...


1

DSProxy uses delegatecall to call the target contract so inside wrapEth you are accessing DSProxy storage and not TargetContract. You are reading weth from the wrong storage and using something else as weth address. One possible solution is pass weth as a parameter. contract TargetContract { constructor() {} function wrapEth(WethInterface weth) ...


1

A simple test to show that the answer is "sendMessage()". Solidity Contract: pragma solidity 0.6.12; contract MyContract { uint256 private constant SUCCESS = 42; uint256 private constant FAILURE = 84; function sendMessage() external pure returns (uint256) { return SUCCESS; } function test(bytes4 funcSelector) external ...


1

They are encoded using solidity abi The first 32 bytes is the offset where string is present within the response: 0000000000000000000000000000000000000000000000000000000000000020. So the string starts at position 20h = 32. At specified offset the first 32 bytes indicates the length of the string: ...


1

As of v5 of the Web3.py library, you would do: from web3 import Web3, EthereumTesterProvider w3 = Web3(EthereumTesterProvider()) print(w3.toInt(w3.solidityKeccak(['uint256', 'uint256', 'uint256'], [1, 2, 3]))) 49776295142305522338649292811956300178326541500117443588869412604416814650524 There's also this: print(w3.toInt(w3.keccak( b'\x00'*31 + b'\x01' ...


Only top voted, non community-wiki answers of a minimum length are eligible