dragonfly-xyz / useful-solidity-patterns Goto Github PK
View Code? Open in Web Editor NEWLicense: MIT License
License: MIT License
This has been an extremely useful example (as the name says it) for knowing how Permit2 works.
I believe it'd go full circe if you guys could add a working example for how it would be with PermitBatchTransferFrom
.
Hello π
I've followed your patterns for PermitTransferFrom
utilization and I've tried to apply it to the PermitBatchTransferFrom
version.
But because the signature for the user, for "batched version" is different from the "original" version, I've modified the helpers functions : _signPermitt()
and especially _getEIP712Hash
in order to fit to the new version. Attached the modification I've done.
But I receive this error with I'm testing it : "InvalidSigner()". So I assume that the hash that I'm generating is wrong.
I've you can provide a quick example on how generate the hash for batched permit2 transfer, this could be really useful!
Thanks a lot in advance π
Thank you for these excellent descriptions! They are super helpful.
I wanted to mention that the following image for the permit2 system is, for me, a tad hard to parse. I believe that Alice doesn't need to perform an interaction with a protocol contract; anyone with her permit can pass off her message and signature as long as they match to perform permitTransferFrom
.
I believe a more accurate photo should look something like the following to show that Alice doesn't need to perform any more on-chain interactions herself.
This project is amazing and has been very helpful to me. I'm wondering if I can open another repository and translate it into Chinese. I will definitely credit the source. Or do you have any recommendations on how I can contribute Chinese translation right into to this repository ?
https://github.com/dragonfly-xyz/useful-solidity-patterns/blob/a915da6aa4037b89f02c02ff133753b695e8bfb6/test/ExplicitStorageBuckets.t.sol#L11C1-L11C64
I have tried other addresses, and in the test case "unsafeCanBeReinitializedAndExploited," the function in the figure is self-defined, and the content logic is consistent.
Hello! First of all, thank you for creating and maintaining this extremely valuable list of common Solidity patterns, personally that's something I was looking for (for a while π).
Secondly, in my opinion, it will be useful to add the latest Solidity pattern: "Function Requirements-Effects-Interactions + Protocol Invariants", proposed by @brockelmore in the following article.
Thanks in advance for your consideration.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. πππ
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google β€οΈ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.