Skip to main content

Questions tagged [bytes]

both the fixed-size array byte, bytes1...bytes32, and the dynamic array bytes types in Solidity

1 vote
2 answers
30 views

I’m interested in testing my 0x8 precompile implementation in SageMath, but how to do it without using an external library ? Am I correct to assume that the input’s ᴀʙɪ is calldata bytes ? As result, ...
user2284570's user avatar
  • 1,063
1 vote
2 answers
83 views

I'm referencing How to get access to the storage mapping through the solidity assembler? question with this. It's helpful for a solution on reading mappings with non-dynamic values, but not very ...
somasine's user avatar
0 votes
1 answer
86 views

This worked with remix This worked without use of encryptedSecretsUrl using ethers.js. It worked in remix, but it didn't work with ethers.js. provider = new ethers.BrowserProvider(window.ethereum); ...
Pyakhurel Pasas's user avatar
0 votes
1 answer
95 views

I'm doing the course of Patrick Collins to learn about programming in Solidity; but some libraries from Chainlink has been changed since 2 years ago. So, when I try to compile the code I have the next ...
Tucan's user avatar
  • 3
0 votes
2 answers
47 views

I am trying to manage strings on a smart contract. I know these strings will be 46 bytes long so I thought I could convert them into bytes and split them in two bytes32 arrays. Then I realized smaller ...
Pietro D'Amico's user avatar
2 votes
1 answer
38 views

Casting between uints and bytes16 yields different results as that of manipulating the bits directly. Why? I thought that with casting we were just changing the representation from bits to bytes, and ...
dNyrM's user avatar
  • 974
1 vote
1 answer
90 views

Using assembly only, how do I switch, for A0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48, the last 20 bytes of the second 32-bytes from the bytes variable below, and keep the rest as it is? Original bytes: ...
dNyrM's user avatar
  • 974
1 vote
0 answers
99 views

I am trying to emit an Event with UUIDv4 indexed string. Example contract: contract EventEmitter { event ExampleEvent(string indexed id); function dispatchEvent(string memory _uuid) public { ...
Marcin's user avatar
  • 111
1 vote
1 answer
80 views

For the past few days I have been looking into creating a simple function to generate a url based on block.chainid (uint256) and address(this). The idea is as follows: function url() public view ...
Cloudronaut's user avatar
0 votes
1 answer
131 views

Today i find this phishing smart contract and i wanna know how he's doing this! There is smart contract and after deploy, fund and call function Start() - funds from contract move to another address ...
Pavlo Konchych's user avatar
0 votes
1 answer
101 views

Suppose I have a contract below: contract Hack { Switch private target; constructor(address _target) { target = Switch(_target); } function test() external pure returns (...
Shubham's user avatar
  • 35
2 votes
1 answer
187 views

I am confused of this. when I write uint256 internal ownerPrivateKey = 0xB0b; Is this conversion implicit? how are we assigning bytes to a uint256 variable?
Zartaj Afser's user avatar
  • 4,293
2 votes
1 answer
279 views

In solidity casting or assembly, how do I grab the first 20 bytes of this 32-bytes input: 0x00010000c900c90062fceaad00000000000000000002af416812f9bb6f2fdff5? Thanks!
dNyrM's user avatar
  • 974
0 votes
1 answer
2k views

I ran into this Custom Error during my Foundry test: [FAIL. Reason: Custom Error cd786059:(0xF628...)] and I had no idea about what it means... then I figured out where it went wrong after tracing ...
Russo's user avatar
  • 1,844
1 vote
1 answer
1k views

I've got the following event declaration in my Solidity contract: event RemoteOrderCreated(bytes32 indexed id, uint32 indexed nonce, address indexed sender, bytes input); And I capture the event ...
Milkncookiez's user avatar

15 30 50 per page
1
2 3 4 5
14