Skip to content
This repository has been archived by the owner on Sep 9, 2022. It is now read-only.

Commit

Permalink
readme updates, fix interface for lootbox
Browse files Browse the repository at this point in the history
  • Loading branch information
alexanderatallah committed Oct 16, 2019
1 parent f67786f commit b82b22f
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 11 deletions.
15 changes: 12 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,22 @@
## OpenSea ERC-1155 Starter Contracts

### About ERC-1155.
### About These Contracts

This is a simple sample ERC-1155 contract for the purposes of demonstrating integration with the [OpenSea](https://opensea.io) marketplace for crypto collectibles. We include:
This is a sample ERC-1155 contract for the purposes of demonstrating integration with the [OpenSea](https://opensea.io) marketplace for crypto collectibles. We also include:
- A script for minting items.
- A factory contract for making sell orders for unminted items (allowing for **gas-free and mint-free presales**).
- A configurable lootbox contract for selling randomized collections of ERC-1155 items.

Additionally, this contract whitelists the proxy accounts of OpenSea users so that they are automatically able to trade the ERC-1155 items on OpenSea (without having to pay gas for an additional approval). On OpenSea, each user has a "proxy" account that they control, and is ultimately called by the exchange contracts to trade their items. (Note that this addition does not mean that OpenSea itself has access to the items, simply that the users can list them more easily if they wish to do so)
On top of the features from the [OpenSea ERC721 sample contracts](https://github.com/ProjectOpenSea/opensea-creatures), ERC1155
- supports multiple creators per contract, where only the creator is able to mint more copies
- supports pre-minted items for the lootbox to choose from


### Why are some standard methods overridden?

This contract overrides the `isApprovedForAll` method in order to whitelist the proxy accounts of OpenSea users. This means that they are automatically able to trade your ERC-1155 items on OpenSea (without having to pay gas for an additional approval). On OpenSea, each user has a "proxy" account that they control, and is ultimately called by the exchange contracts to trade their items.

Note that this addition does not mean that OpenSea itself has access to the items, simply that the users can list them more easily if they wish to do so!

## Requirements

Expand Down
6 changes: 0 additions & 6 deletions contracts/ILootBox.sol
Original file line number Diff line number Diff line change
Expand Up @@ -71,12 +71,6 @@ interface ILootBox {
*/
function setClassForTokenId(uint256 _tokenId, uint256 _classId) external;

/**
* @dev Set token IDs for each rarity class. Bulk version of `setTokenIdForClass`
* @param _tokenIds List of token IDs to set for each class, specified above in order
*/
function setTokenIdsForClasses(uint256[] calldata _tokenIds) external;

/**
* @dev Remove all token ids for a given class, causing it to fall back to
* creating/minting into the nft address
Expand Down
4 changes: 2 additions & 2 deletions contracts/MyLootBox.sol
Original file line number Diff line number Diff line change
Expand Up @@ -140,11 +140,11 @@ contract MyLootBox is ILootBox, Ownable, Pausable, ReentrancyGuard, MyFactory {
* Convenience method for contract owner.
*/
function open(
Option _option,
uint256 _optionId,
address _toAddress,
uint256 _amount
) external {
_mint(_option, _toAddress, _amount, "");
_mint(Option(_optionId), _toAddress, _amount, "");
}

/**
Expand Down

0 comments on commit b82b22f

Please sign in to comment.