Created
February 25, 2022 06:45
-
-
Save wminshew/4a619b1f3ca9b53bebd6fd15fee6de9e to your computer and use it in GitHub Desktop.
Zora-0xSplits-Juicebox Integration Contracts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// SPDX-License-Identifier: MIT | |
pragma solidity 0.8.6; | |
import './libraries/JBTokens.sol'; | |
import './abstract/JBProject.sol'; | |
import '@openzeppelin/contracts/token/ERC721/IERC721.sol'; | |
/** | |
@notice Steps for Zora-0xSplits-Juicebox integration: | |
1/ deploy clones of the below contracts w projects & NFTs of your choosing | |
2/ create an immutable split & point some %s at the clones' addresses | |
3/ list NFT for sale on zora & point _sellerFundsRecipient at the split's address | |
4/ ??? | |
5/ profit | |
*/ | |
contract NFTBuyerToJBProject { | |
JBProject public immutable jbProject; | |
IERC721 public immutable erc721; | |
uint256 public immutable tokenId; | |
constructor( | |
JBProject _jbProject, | |
IERC721 _erc721, | |
uint256 _tokenId | |
) { | |
jbProject = _jbProject; | |
erc721 = _erc721; | |
tokenId = _tokenId; | |
} | |
receive() external payable { | |
jbProject.pay(erc721.ownerOf(tokenId), "NFT sale buyer share via 0xSplits", false, JBTokens.ETH); | |
} | |
} | |
contract NFTSellerToJBProject { | |
JBProject public immutable jbProject; | |
address public immutable beneficiary; | |
constructor( | |
JBProject _jbProject, | |
address _beneficiary | |
) { | |
jbProject = _jbProject; | |
beneficiary = _beneficiary; | |
} | |
receive() external payable { | |
jbProject.pay(beneficiary, "NFT sale seller share via 0xSplits", false, JBTokens.ETH); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment