Customize Clubs Contract
This walkthrough will go through the process of manually customizing a Clubs contract. For the sake of this example let's say that you want to code special requirements to mint that the Meem Contracts do not support out of the box.
We'll create a contract that implements the
requireCanMint
function and then use EPM to use that function for our Club.In your club settings, grab the contract address

For this (silly) example, we'll only allow minting for odd-numbered timestamps
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.13;
struct RequireCanMintParams {
address minter;
address to;
bytes32[] proof;
}
contract MyCustomFacet {
function requireCanMint(RequireCanMintParams memory params) public payable {
if (block.timestamp % 2 == 0) {
revert('Minting only allowed for odd-numbered timestamps');
}
}
}
Head over to https://epm.wtf/create and upload your contract. See Creating a Contract for more info.

Next you'll need to actually deploy the contract you just created. On the contract details page. Find the contract you uploaded and deploy it from https://epm.wtf/contracts

Take the club address you just copied and drop it into EPM at:
The page should show you all the current facets and associated functions. You can toggle which contract handles what function(s).



When you save, you're triggering a Diamond Cut which will tell our Diamond Proxy Contract that it should use our new contract for the
requireCanMint
function
You've now customized your clubs contract with custom minting requirements. What other use cases can you dream up?
Last modified 1yr ago