Comments (2)
The aim is to replace some of the old bits with the new bits.
One way is to mask out the old bits with an and
, and do a or
to overlay in the new bits.
Another way is to do a xor
with some special number that will flip the bits in a way that gives the same final result.
This special number will be the xor
difference between the old number and the desired final result.
Hence the double xor
s.
The second way is sometimes slightly more efficient, and gives more compact bytecode.
from solady.
Also forgive me if gh issues is not the best medium for this question. lmk if these types of q's are better suited for twitter or some other medium :)
from solady.
Related Issues (20)
- LOL
- ⚡️ Tokens: Save gas by removing calldatasize & parameter size checks HOT 1
- 🚨 ECDSA and SignatureCheckerLib will NOT check for non-malleability HOT 2
- ✨ Add forceApprove to SafeTransferLib HOT 2
- 🛠️ Minimum Solidity Version will still be ^0.8.4
- ✨ ERC1967Factory for beacon proxies HOT 10
- ✨ Add MetadataReaderLib library HOT 8
- ✨ Add `_getArgBool(offset)` to `Clone` HOT 4
- 💰 Transfer all ETH HOT 1
- should this address be payable? HOT 3
- ✨ More JSONParserLib functions
- 📖 Use of biblical comment not correct HOT 1
- ✨ Add SafeTransferLib permit support HOT 6
- 🚨 FixPointMathLib log functions will NOT revert for zero inputs
- 📏 EIP-6093 HOT 4
- ♻️ Remove increaseAllowance and decreaseAllowance from main ERC20 contract
- ✨ EIP712 view name and version HOT 6
- 📝 Adjust SafeTransferLib docs to more accurately reflect vulnerability related to usage of force invariants HOT 2
- 🪙 ERC223 HOT 1
- 🗞️ Calldata Compressed Proxy HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from solady.