Comments (6)
Invoke also doesn't really need to return anything, so we could just remove it from the method definition?
from delegatable-sol.
Not sure.
Long temporary take (to consider):
execution success trickling is important for secure composability, or at least nice to have
( I do not know why ERC20 returns true on transfer but ERC721 does not. I think it makes life unnecessarily hard.)
Lastly, thinking about chained delegations, where the invocation would be chained (?) and dependent on one-another -> the successful invocation of all items in a batch would be required. But not sure if I have enough of an understanding of how that would happen atm. I'll look at it later.
from delegatable-sol.
Today all batches of invocations are atomic and require success, so you can assume they will all succeed as a group. I considered early on making this a parameter, and letting users opt out of atomicity, but I think I didn't bother for simplicity. You can always submit more batches if you want non-atomicity.
Since atomicity is ensured, we might not need the return value?
from delegatable-sol.
Since atomicity is ensured, we might not need the return value?
Yes. To the best of my knowledge.
Batch building might require use case specific validation or filtering.
I'm thinking any default or indiscriminate batching is likely to result in griefing attacks.
from delegatable-sol.
@parseb This actually isn't true. The external invoke
function returns true or false based on the return of the internal _invoke
function. It is a bit hard to see but since the return variable is declared, whatever gets returned by the function is set to the return variable. Therefore, the result of the _invoke
function of DelegatableCore is set to success
.
I find this warning annoying, so I made a quick change to explicitly set the success
variable. I think it is worth the additional 3 gas. Will make PR after checking with code owners first.
@danfinlay I think we keep the bool return of external invoke
function to allow for the flexibility of a future use case.
from delegatable-sol.
@McOso Not sure what you are saying.
whatever gets returned by the function is set to the return variable
success
is always false in the above example. As such, the function always returns false.
Solidity doesn't have implicit return and the return of _invoke
is never assigned to success.
I might be wrong about the above or you are confounding the lower level .call() return with the declared return.
--
The external invoke function returns true or false based on the return of the internal _invoke function.
- This statement is false. Your solution reflects this.
from delegatable-sol.
Related Issues (18)
- Publish in a way that is easy to import HOT 1
- Re-add revocation enforcer
- Add allowed recipient enforcer
- BlockNumberEnforcer: optimize terms bytecode HOT 1
- Deploy as Diamond Facet singleton HOT 2
- Enable delegations from contract accounts
- Should root delegations work in a chain?
- Create streaming ERC20 caveat
- Create delegatable WETH
- 🔗 Enforcer: Uniswap V3 TWAP HOT 2
- 🔗 Enforcer: Governance Proposal Outcomes HOT 1
- ⛓️ DelegatableCore: Hooks To Lift Signers
- Delegatable swallows error messages
- Add support for eip4337 style initCodes in delegations
- Ensure caveat enforcers are capable of requiring payment HOT 3
- Issues with Delegatable-based Session-Key
- Contact for sharing ideas
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 delegatable-sol.