bepronetwork / bepro-js

The repository contains a comprehensive documentation of the bepro.network ecosystem as a javascript framework. If you are new to BEPRO, you might want to check out the Website Overview or our public "Start Building" Page.
161 stars 94 forks source link

Smart Contract - Collectibles NFT [@RealFevr] #16

Open Ruiub3i opened 3 years ago

Ruiub3i commented 3 years ago

Requester
Real Fevr (https://fantasy.realfevr.com/)

Description A decentralized NFT Factory where users are able to open packs with football events

Master Variables

  1. realFvrTokenAddress (Real Fvr Token Address) address
  2. admin (onlyOwner modifier) address
  3. realfvrTokenPriceInUSD uint256
  4. packs Structure

Libraries to Inherit

Features

tbem commented 3 years ago

Hi guys, the createPacks function should consider transactions fees to right holders for the moment of first sell and future transactions, something like this: createPacks( paks_number: 20000, nfts_per_pack: 4, price: 2000, series: 'A', drop: 'First', pack_type: 'Premium', initial_id: 1, first_sell_fees: [ { wallet_id: 'xxxxRightHolder1', fee: 0.5 }, { wallet_id: 'xxxxRealFevr', fee: 0.1 }, { wallet_id: 'xxxxBurn', fee: 0.4 }], future_sell_fees: [{ wallet_id: 'xxxxRightHolder1', fee: 0.01 }, { wallet_id: 'xxxxRightHolder2', fee: 0.01 }] ) This way we can configure different transactions fees / right holders every time we create new nfts packages.

tbem commented 3 years ago

We also should have another function to define the transaction fees on the marketplace, something like this: setMarketplaceFees([{wallet_id: 'xxxxRealFevr', fee: 0.03}]) [Admin] This way we can change the marketplace fee over the time.

Ruiub3i commented 3 years ago

@tbem can we just assume 1 fee based address as that all transactions (included the first one) have the fee sent to the address Y?

Otherwise it would consume a lot of gas and seems that making the first transaction not have a fee while all the future ones will have wont make any real impact

Let us know

tbem commented 3 years ago

@Ruiub3i The createPacks function should receive 2 Array[Hash] parameters for specifying the first buy fees and the future transactions fees. The number of hashes, may vary dependently of the right holders we need on each package drop. Each Hash is composed by the wallet and the percentage in decimal correspondent to the fee that we need to process. Ex: first_sell_fees: [ { wallet_id: 'xxxxRightHolder1', fee: 0.5 }, { wallet_id: 'xxxxRealFevr', fee: 0.1 }, { wallet_id: 'xxxxBurn', fee: 0.4 }]

future_sell_fees: [{ wallet_id: 'xxxxRightHolder1', fee: 0.01 }, { wallet_id: 'xxxxRightHolder2', fee: 0.01 }]

Ruiub3i commented 3 years ago
Ruiub3i commented 3 years ago

Events to Be used below

event PackCreated(uint256 packId, uint256 nftsAmount, string indexed serie, string indexed packType, string indexed drop); event PackOpened(address indexed by, uint256 indexed packId); event PackDelete(uint256 indexed packId);

tbem commented 3 years ago

Would be nice to have a getter and a setter(Admin) for both packIncrementId and lastNFTID vars.

tbem commented 3 years ago

Add this 2 Arrays on createPack function: transferFeeAddresses, transferFeeAmounts

Ruiub3i commented 3 years ago
tbem commented 3 years ago

The buyPack function should receive an array of ids, to support multipacks buys at one shot.

tbem commented 3 years ago

the openPack should receive an array of ids to avoid multi authorisations from Metamask to open each pack.

tbem commented 3 years ago

The getRegisteredTokens is returning error: Error: types/values length mismatch (count={"types":1,"values":0},

tbem commented 3 years ago

isApproved method is inconsistent, it's supposed after the approve for a specific wallet always return true. But that is not happening, sometimes comes true, and then comes false again.

sgoia commented 2 years ago

hey guys, I am working on this issue to make it work as requested but have an important question: I want to see why is there a requirement to inherit from both ERC721 and ERC1151 ? one of them would be ok I think.