Giter Club home page Giter Club logo

Comments (4)

AC0DEM0NK3Y avatar AC0DEM0NK3Y commented on July 1, 2024 1

@scherrey would it be helpful if I changed this impl to not use inline asm? I guess it would.

It was used this way when we had accept/reject logic for the receiver but that is gone now. It is either accept or revert now (in a non hybrid solution).

from erc-1155.

wighawag avatar wighawag commented on July 1, 2024 1

I updated the code at https://github.com/pixowl/thesandbox-contracts to fit the spec

@scherrey Feel free to ask any question

from erc-1155.

AC0DEM0NK3Y avatar AC0DEM0NK3Y commented on July 1, 2024

It's just pulling the return value out if it was returned. Here a lowlevel .call is being used rather than a straight function call so that the call to onERC1155Received doesn't revert the transaction automatically see https://solidity.readthedocs.io/en/v0.5.8/control-structures.html#error-handling-assert-require-revert-and-exceptions

In this ref function that is not really needed, it could be reverted straight away but as you can see in the 1155/721 hybrid this can be a useful technique (as this code wants to continue if it is also an erc721 but the .call fails). Note: this is not updated to latest 1155 spec by the looks of it, maybe @wighawag can let us know when it plans to be: https://github.com/pixowl/thesandbox-contracts/blob/master/src/Asset/ERC1155ERC721.sol#L679

I'm not sure if this type of thing is possible with Vyper I've never looked, but if you don't need hybridity it should be fine to just call the on1155Received function and require the return value is exact.

from erc-1155.

AC0DEM0NK3Y avatar AC0DEM0NK3Y commented on July 1, 2024

Altered: 6147143

from erc-1155.

Related Issues (17)

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.