Comments (4)
@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.
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.
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.
Altered: 6147143
from erc-1155.
Related Issues (17)
- It's not safe HOT 1
- A question about function create() and mint() in ERC1155Mintable.sol HOT 3
- Could not find suitable configuration file. HOT 5
- Rename ERC1155Mintable.sol HOT 4
- Cannot read property 'match' of undefined
- Why does ERC1155MixedFungibleMintable needs store the type of both fungible and non fundgibl HOT 3
- Cannot use import statement outside a module HOT 2
- What is the difference between 'create' and 'mint' functions in ERC1155Mintable.sol
- Replace the EIP-1538 Implementation with EIP-2535, the Diamond Standard
- expectThrow.js unexpected token issue HOT 1
- id from mintNonFungible duplicating, skips even numbers
- ERC1155Mintable does not follow the metadata standard
- ERC1155 Questions about ID, Metadata and uniqueness
- How to withdraw tokens from ERC1155 contract?
- Vulnerability: Nonce must be limited to 2^127 in split bit design
- Spend allowance
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 erc-1155.