bosagora / boa-space-contracts Goto Github PK
View Code? Open in Web Editor NEWBOA Space is a marketplace protocol for safely and efficiently buying and selling NFTs.
License: MIT License
BOA Space is a marketplace protocol for safely and efficiently buying and selling NFTs.
License: MIT License
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
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.
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.
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
PayableProxy
and the code about it.PayableProxy
PayableProxy
to be used in fulfilling an order.You can check the contract code of PayableProxy
deployed on Goerli network here.
Relates to #19
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.
fulfillOrder
through AssetContractShared
contract from the Seaport contract address위 서브 작업은 다른 이슈에 비해 중요도가 떨어지므로 분리하여 나중에 적당한 시간에 처리할 예정입니다.
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
sharedProxyAddresses
and proxyRegisryAddress
in AssetContractShared and ERC1155Tradable contracts.sharedProxyAddress
but should check if the proxyRegisryAddress
can be used and can be the address of the Seaport contractDefinition of done
fulfillOrder
through SharedStorefrontLazyMintAdapter
contract from the Seaport contract addressfulfillOrder
in the case of the lazy mintingsharedProxyAddresses
or proxyRegisryAddress
with the Seaport contractOrderType to be used in scripts
Functions to be used in scripts
Key components to be used in scripts
Relates to #10
There are many contracts related to BoaSpace. We need to analyze their relations in order to implement our NFT marketplace.
Definition done
setURI
is called and who calls the function (N/A)setURI
(N/A)How to analyze
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 관련 PR에서 언급되었듯이 OpenSea의 PayableProxy를 ETH를 쌓기만 할 뿐, 인출하는 기능을 따로 가지고 있지 않은 것으로 보인다. 따라서, 추가적인 조사후에 BOASpace의 PayableProxy에서는 인출 함수를 추가하는 것을 고려한다.
PayableProxy 구현 내용 공유하는 자리에서 논의할 예정.
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"
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:
setURI
is called and who calls the functiononlyFullTokenOwnerOrProxy
.Relates #9
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.
We should write the scripts transferring ownership of tokens with batchMint
or safeBatchTransferFrom
.
Definition done:
batchMint
safeBatchTransferFrom
Relates #9
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.
_name
: we will set the name to "FINPL Collections"_symbol
: we will set the name "FNPL"_proxyRegistryAddress
: not assigned in fact in the transaction of contract creation but should be analyzed._templateURI
: not assigned in fact in the transaction of contract creation but should be analyzed._migrationAddress
: not assigned in fact in the transaction of contract creation but should be analyzed.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));
}
}
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
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 **
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);
}
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.