Comments (7)
always use pre-increment method when incrementing one of your code went 443 less in gas for one of this reason and its a loop and you don't have to initialize to zero by default variables are already zero when created that cost an additional 8 in gas
from contracts.
this part here is weird, i think the hardcoding the function selector is better, then using bit manbipulation to add the params to the end of the selector saves more gas and tbh i think this is better using yul
(bool success_, bytes memory data_) = _currency.call( abi.encodeWithSelector(IERC20.transferFrom.selector, _from, _to, _amount) );
from contracts.
if (_amount == 0) {
success = true;
return success;
}
this tbh is so bad you don't need to do success = true, return success you can just return 1, thats still true
from contracts.
`return string(abi.encodePacked(batchUri, "0"));`
you could have done this yourself, if you do not need the same string in the function again you should just encode this using the length and bit manipulation instead of abi.encodePacked which actually creates a clone in memory then encodes it
from contracts.
the best way to solve this issue, just write in yul, i can't go through the whole codebase
from contracts.
Hey @malik672 👋🏽 appreciate the suggestions. We're starting Solidity optimization work; want to make a PR containing your suggestions? That'd be super helpful.
Regarding custom errors -- we've attempted to introduce them to the codebase before. We'll introduce them to the codebase once we build decent error message rendering for them in our SDK layer.
from contracts.
thank you, will love to
from contracts.
Related Issues (20)
- Deposit Reward Tokens (depositRewardTokens) area has a problem. HOT 3
- npx thirdweb create contract HOT 2
- TCP error when running `forge build` on the `contracts` repo HOT 3
- ZKsync deploy HOT 3
- Revoke signature on zk by revoke HOT 1
- Fix token deploy contract HOT 1
- Can't verify contract deployed on Shibarium
- [EIP 4337] Withdrawing tokens from a contract to a smart account fails HOT 1
- Multiple currency support in MarketplaceV3 DirectListings contract. HOT 1
- Marketplace: Can't Buy NFT Listed For Free HOT 2
- AA Support for Custom Network HOT 4
- Thirdweb Latest Registry Addresses and Factory Addresses HOT 9
- Add nonReentrant modifier to relevant base contract functions
- Deletion on mapping containing a struct-with-mapping
- Apply checks-effects-integration across repo contracts or use nonReentrant
- Emit appropriate events in initialize function
- Update state variables that could be declared immutable as immutable
- Cache array length
- Contract deployment issue on Redbelly Devnet
- TypeError: Wrong argument count for function call: 2 arguments given but expected 1. - SafeERC20.sol:72
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 contracts.