Giter Site home page Giter Site logo

boa-space-contracts's People

Contributors

linked0 avatar

Watchers

 avatar  avatar

Forkers

linked0 she110ff

boa-space-contracts's Issues

Research the components relating to an order including `Zone`

We found out roughly the concept of Zone described as follows in the OpenSea doc.

The zone of the order is an optional secondary account attached to the order with two additional privileges:

  • The zone may cancel orders where it is named as the zone by calling cancel. (Note that offerers can also cancel their own orders, either individually or for all orders signed with their current counter at once by calling incrementCounter).
  • "Restricted" orders (as specified by the order type) must either be executed by the zone or the offerer, or must be approved as indicated by a call to an isValidOrder or isValidOrderIncludingExtraData view function on the zone.

But we need to research more about the usage and write a related example script for that if possible.

Until now, we can not find any use case of the Zone in common usages in OpenSea which is set to
0x0000000000000000000000000000000000000000 on an order in our tests on the OpenSea testnets.

Definition of done

  • Basic order and advanced order
  • Listing the order on-chain (i.e. calling validate).
  • Criteria element(criteria-based item)
  • Clear definition about Partial OrderType
  • Counter
  • matchOrder
  • The clear role of fulfiller on the OpenSea
  • Transaction occurred for Cancel
  • Zone
  • Salt

All the research should be done with the association of OpenSea doc, Contract code, and testing on OpenSea sites, all the information should be documented in Miro in detail.

The reason why the `cancel` call is needed

One of the important features of the BoaSpace is lazy-minting. So we don't store information about an order on the chains but need to call the cancel function of the Consideration contract. The change of state from the cancel call is stored in the _orderStatus state variable and is referred to in the OrderValidator contract, which is related to the validation of orders.

We need to research more about that as the algorithm is related to the validation that is checked from the validate call of the Consideration contract.

Analyze and implement `PayableProxy` contract

All the trades in the marketplace have a consideration that is a fee for the marketplace which is currently set to 2.5% of the total price of traded NFTs in the OpenSea. The unit of the fee is WETH(Wrapped ETH) in the OpenSea but we might use BOA in the BoaSpace.

Definition of done

  • Analyze the algorithm of the PayableProxy and the code about it.
  • Deploy our PayableProxy
  • Write the script for PayableProxy to be used in fulfilling an order.

You can check the contract code of PayableProxy deployed on Goerli network here.

Relates to #19

Fulfill an order through `AssetContractShared` from `Seaport`

This subtask is from issue #19. We separate the original issue into two issues because we should focus on fulfilling an order through the StorefrontLazyMintAdapter contract and analyzing the usage of Conduit and ConduitController contracts which is not fully understood yet. This will be handled later.

  • Write a script for executing fulfillOrder through AssetContractShared contract from the Seaport contract address

위 서브 작업은 다른 이슈에 비해 중요도가 떨어지므로 분리하여 나중에 적당한 시간에 처리할 예정입니다.

Script executing `safeTransferFrom` through `LazyMintAdapter` from `fulfillOrder` of Seaport

Currently, we can execute fulfillOrder of Seaport with ERC1155 compatible contracts like BoaTestERC1155 in this script.
We introduced AssetContractShared of a kind of ERC11555 contract so we should adopt this contract to the Seaport contract. We are making a script executing fulfillOrder with AssetContractShared based on this script in this issue.

Things to consider

  • There are two important proxies, sharedProxyAddresses and proxyRegisryAddress in AssetContractShared and ERC1155Tradable contracts.
  • We used the sharedProxyAddresses as EOA(Externally Owned Account) but we check this address as a contract address like the Seaport contract, which might not be possible I guess but needs to be checked.
  • We only used the sharedProxyAddress but should check if the proxyRegisryAddress can be used and can be the address of the Seaport contract

Definition of done

  • Write a script for executing fulfillOrder through SharedStorefrontLazyMintAdapter contract from the Seaport contract address
  • Write a script for executing fulfillOrder in the case of the lazy minting
  • Consider using a Conduit and applying it
  • Analyze the usage of sharedProxyAddresses or proxyRegisryAddress with the Seaport contract
  • Add description to the README for the usage of all the scripts

OrderType to be used in scripts

  • FULL_OPEN = 0, // No partial fills, anyone can execute (We don't use it)
  • PARTIAL_OPEN = 1, // Partial fills supported, anyone can execute
  • FULL_RESTRICTED = 2, // No partial fills, only offerer or zone can execute (We don't use it)
  • PARTIAL_RESTRICTED = 3, // Partial fills supported, only offerer or zone can execute (We don't use it)

Functions to be used in scripts

  • fulfillBasicOrder(sig=0xfb0f3ee1)
  • fulfillOrder(0xb3a34c4c)
  • fulfillAdvancedOrder(0xe7acab24)
  • matchOrders(0xa8174404)
  • matchAdvancedOrders(0x55944a42)
  • fulfillAvailableOrders(0xed98a574)
  • fulfillAvailableAdvancedOrders(0x87201b41)
  • cancel(0xfd9f1e10)
  • validate(0x88147732)
  • incrementCounter(0x5b34b966)

Key components to be used in scripts

  • zone (We don't use it)
  • conduitKey(We don't use it)
  • salt

Relates to #10

Analyze the relation of Seaport, Conduit, LazyMintAdapter, and etc

There are many contracts related to BoaSpace. We need to analyze their relations in order to implement our NFT marketplace.

  • Seaport
  • ConduitController
  • ConduitCreator
  • Conduit
  • SharedStorefrontLazyMintAdapter
  • AssetContractShared

Definition done

  • Find when the setURI is called and who calls the function (N/A)
  • Write the script code based on the found information relating to setURI (N/A)
  • Analyze the relationship between Seaport, LazyMintAdapter, and SharedAssetContract
  • Analyze the relationship between Seaport, Conduit, and ConduitController
  • Summarize and share the information found in analyzing the relations from time to time

How to analyze

  • Run the test code from Seaport repository
  • Test functions with the deployed contract on our TestNet
  • Refer to the frontend and API server.

Relates #9
Relates #15

Remove package-lock.json

The package-lock.json should be removed.
Only the package.json should exist for yarn, otherwise, it warns that you are using yarn and npm.

PayableProxy의 BOA 인출 기능에 대한 고려

PayableProxy 관련 PR에서 언급되었듯이 OpenSea의 PayableProxy를 ETH를 쌓기만 할 뿐, 인출하는 기능을 따로 가지고 있지 않은 것으로 보인다. 따라서, 추가적인 조사후에 BOASpace의 PayableProxy에서는 인출 함수를 추가하는 것을 고려한다.

PayableProxy 구현 내용 공유하는 자리에서 논의할 예정.

Deploy and mint a AssetContractShared NFT to the Mainnet

We need to deploy the AssetContractShared contract to the Mainnet and mint an NFT.
In order to deploy the contract we should use the Admin account which is managed by the Foundation.

One way is for @MichaelKim20 to deploy the contract.
The usage to deploy is described in this part of README

The properties are as follows.

name = "BOASPACE Collections"
symbol="BOASPACESTORE"

Set data URI with a SharedProxy account

Currently, we can mint and batch-mint tokens to a creator with a SharedProxy. But we can not set the URI data as the fourth parameter on mint and mintBatch functions. It's because the setURI function called in mint function is checking that the owner of the minted tokens is the same as msg.sender as following code.

modifier onlyFullTokenOwner(uint256 _id) {
    require(
        _ownsTokenAmount(_msgSender(), _id, _id.tokenMaxSupply()),
        "AssetContractShared#onlyFullTokenOwner: ONLY_FULL_TOKEN_OWNER_ALLOWED"
    );
    _;
}

So we need to modify the setURI function of AssetContractShared contract.

function setURI(uint256 _id, string memory _uri)
public
override
creatorOnly(_id)
onlyImpermanentURI(_id)
onlyFullTokenOwner(_id)
{
    _setURI(_id, _uri);
}

Definition of done:

  • Find when the setURI is called and who calls the function
  • Write the script code based on the found information
  • Consider the modification of the function by adding a new modifier like onlyFullTokenOwnerOrProxy.

Relates #9

Method to set SEAPORT and CONDUIT in SharedStorefrontLazyMintAdapter

The SharedStorefrontLazyMintAdapter has hard-coded storage variables like SEAPORT and CONDUIT as follows.

address private constant SEAPORT =
    0x4F445109d11419c3612e43D2e71a3593921621E0;
address private constant CONDUIT =
    0xCef34f700b0F060fAA00E91001259E80Fcdc9570;

But it's very critical when Seaport and Conduit contract should be changed, which is the case that we should avoid. So we should determine whether to need a function to change these variables and how to add it.

This is not for adding the function for that but checking that we actually need that but it's worth adding the method and testing it before adopting it to the contract.

Deploy FINPL NFT for test

We are gonna deploy FINPL NFT with the AssetContractShared contract.

We should pass in the parameters of the constructor of the AssetContractShared contract as follows.

We may consider the child class named FinpleAssetContract inherited from AssetContractShared which makes the usage of the FINPL NFT clear and should be determined soon.

The mint function of AssetContract which is a superclass of AssetContractShared has four parameters as follows. Most importantly, the _data parameter can be used for an IPFS URL for the minted NFT.

function _mint(
    address _to,
    uint256 _id,
    uint256 _quantity,
    bytes memory _data
) internal override {
    super._mint(_to, _id, _quantity, _data);
    if (_data.length > 1) {
        setURI(_id, string(_data));
    }
}

Deploy SharedStorefrontLazyMintAdapter contract

The SharedStorefrontLazyMintAdapter contract is found to be used for lazy minting. So we will deploy this contract soon.
We should also check the relation between this contract and ConduitCreator, Conduit, and AssetContractShared contracts while preparing to deploy the contract. So this issue page will be used for sharing the information also.

The summary of the ShareStorefrontLazyMintAdapter contract.
It has two main constant values that indicate the addresses of the Seaport and Conduit contracts.

contract SharedStorefrontLazyMintAdapter {
    IERC1155 immutable ssfToken;
    address private constant SEAPORT =
    0x00000000006c3852cbEf3e08E8dF289169EdE581;
    address private constant CONDUIT =
    0x1E0049783F008A0085193E00003D00cd54003c71;

    ...
}

We should make these contants mutable and pass in these addresses in the constructor of our SharedStorefrontLazyMintAdapter contract.

And the constructor of the contract also has the address of an ERC1155-compatible contract.

constructor(address tokenAddress) {
    ssfToken = IERC1155(tokenAddress);
}

The value is actually the address of the AssetContractShared contract in this case as shown on the detail page of Goerli Etherscan.

-----Decoded View---------------
Arg [0] : tokenAddress (address): 0xf4910C763eD4e47A585E2D34baA9A4b611aE448C

Change the way we batch-mint FINPL NFTs

Currently, we mint or batch-mint without a metadata URI because a creator can only set the metadata. But we decided to mint or batch-mint FINPL NFTs with a creator account in order to import NFTs with their metadata.

현재 batch-mint의 경우 metadata URI를 고려하지 않고 NFT를 발행하고 있는데, 여러개의 medadata를 하나의 URI로 갖는 방식의 배포하는 스크립트를 만들어 놓고 나중에 필요시 큰 추가 작업 없이 배포할 수 있도록 준비한다.

** Definition of done **

  • Mint one token and transfer it to specified addresses, which is the way @she110ff suggested.
  • Use a metadata when minting a NFT
  • Make a utility function to make Combined Token ID

QUANTITY_EXCEEDS_TOKEN_SUPPLY_CAP Error

There seems to be some limitation to the total amount where NFTs are minted for each creator. We should check the meaning of the following error exactly.
reason: 'execution reverted: AssetContract#_beforeMint: QUANTITY_EXCEEDS_TOKEN_SUPPLY_CAP',

The code in AssetContracg needs to be analyzed more.

uint256 constant TOKEN_SUPPLY_CAP = 1;

function _remainingSupply(uint256 _id)
  internal
  view
  virtual
  returns (uint256)
  {
      return TOKEN_SUPPLY_CAP - totalSupply(_id);
  }

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.