Giter VIP home page Giter VIP logo

Comments (6)

danfinlay avatar danfinlay commented on June 28, 2024

Invoke also doesn't really need to return anything, so we could just remove it from the method definition?

from delegatable-sol.

parseb avatar parseb commented on June 28, 2024

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.

danfinlay avatar danfinlay commented on June 28, 2024

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.

parseb avatar parseb commented on June 28, 2024

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.

McOso avatar McOso commented on June 28, 2024

@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.

parseb avatar parseb commented on June 28, 2024

@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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.