Created
February 5, 2022 23:19
Revisions
-
doublesharp created this gist
Feb 5, 2022 .There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,46 @@ pragma solidity ^0.8.11; import '@openzeppelin/contracts/access/Ownable.sol'; interface IBoredApeYachtClub { function withdraw() external; function function setProvenanceHash(string memory provenanceHash) external; function setBaseURI(string memory baseURI) external; } contract BoredApeYachtClubOwner is IBoredApeYachtClub, Ownable { // the BAYC contract address private immutable bayc; // pass in the BAYC address, then transfer ownership to this contract constructor(address _bayc) public { bayc = _bayc; } /* * Withdraws the BoredApeYachtClub contract, then again from this contract to the caller */ function withdraw() external override onlyOwner { // call withdraw bayc.withdraw(); // now withdraw again from this contract uint balance = address(this).balance; msg.sender.transfer(balance); } /* * Update provenance once it's calculated */ function setProvenanceHash(string memory provenanceHash) external override onlyOwner { bayc.setProvenanceHash(provenanceHash); } /* * Update the base URI for the token metadata */ function setBaseURI(string memory baseURI) external override onlyOwner { bayc.setBaseURI(baseURI); } }