0

Can I just change 1 bit of data in a smart contract? More specifically would this allow me to make a smart contract where it is really cheap just to flip specific bits.

This would be like setting header flags in a IP packet. Initially I want to deploy a contact with a set of 1s and 0s then flip some later on. I want to just be-able to flip different bits in a contract that is as cheap as possible.

-Thanks

1 Answer 1

1

The smallest chunk of state you can update is a 32-byte word. You can create cheaper immutable records using event logs and stateless design. There would be tradeoffs.

Alternatives might exist depending on the use case and constraints.

Hope it helps.

2
  • 1
    Please note that you can pack bits to words yourself. 256-bit word is the smallest unit you can allocate from EVM storage. Commented Feb 5, 2019 at 9:13
  • Exactly. I think the OP wants a way around it. Commented Feb 5, 2019 at 15:00

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.