Skip to content

Commit

Permalink
Remove Prohibition Daily
Browse files Browse the repository at this point in the history
  • Loading branch information
chrismaddern committed Dec 16, 2024
1 parent 6f5382b commit 23e4ac6
Show file tree
Hide file tree
Showing 7 changed files with 48 additions and 391 deletions.
101 changes: 47 additions & 54 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
## What is Mobile Minting?

Mobile Minting unlocks mobile payments for onchain purchases and powers minting in the Rally app (formerly known as Floor!).

**📱 Users pay in-app with In-App Purchases**
Expand All @@ -14,7 +15,8 @@ _Example Mobile Minting user experience._
<br />

## What is this repository?
This repository is a **public, contributable collection of Ingestors** that teach Mobile Minting how to support mints from new platforms.

This repository is a **public, contributable collection of Ingestors** that teach Mobile Minting how to support mints from new platforms.

Historically, only Rally could choose what mints users could mint through Rally based on our roadmap, or partnerships, now anyone can build support for any minting platform / product and (provided it meets some safety & reliability checks) it can be included in Mobile Minting.

Expand All @@ -24,7 +26,8 @@ This library is included in Rally's platform and executed in a sandboxed environ

## Adding a new platform to Mobile Minting

Today, Mobile Minting supports the following creator platforms:
Today, Mobile Minting supports the following creator platforms:

<table>
<tr>
<td>
Expand Down Expand Up @@ -162,23 +165,6 @@ Today, Mobile Minting supports the following creator platforms:
</td>
</tr>
<tr>
<td>
Prohibition Daily
</td>
<td>
Base
</td>
<td>
</td>
<td>
</td>
<td>
</td>
</tr>
<tr>
<td>
Transient Labs
Expand All @@ -202,16 +188,17 @@ Today, Mobile Minting supports the following creator platforms:
Adding a new platform to Mobile Minting is easy - you just have to write a `MintIngestor`!

### MintIngestor functionality

A MintIngestor has a simple job:

> Transform a URL or contract address into a valid MintTemplate, iff it represents a supported mint by the ingestor
![template](https://github.com/floornfts/mobile-minting/assets/1068437/7693bfe2-8754-48ba-ac5d-7b222b1435de)


<br />

### What is a `MintTemplate`?

A MintTemplate is a standard format for expressing the details of a mint. It's used to populate the marketing page, pricing, and ultimately fulfill the item onchain.

<img width="1341" alt="mint-template" src="https://github.com/floornfts/mobile-minting/assets/1068437/9bdd3a1f-14a4-4506-9d77-2981f825fc9f">
Expand All @@ -220,19 +207,19 @@ _Mapping of MintTemplate fields to an in-app mint._

Once you generate a MintTemplate, Rally will do all the additional work to get the mint live:

* Map priceWei to an in-app purchase
* Simulate the transaction in multiple scenarios to ensure success
* Re-host all images & cache IPFS resources
- Map priceWei to an in-app purchase
- Simulate the transaction in multiple scenarios to ensure success
- Re-host all images & cache IPFS resources

The full process looks something like this...

![mint-template-flow](https://github.com/floornfts/mobile-minting/assets/1068437/fbe12e74-da4a-40ab-822b-aea197b35d3f)


<br />

### Writing your first `MintIngestor`
We recommend consulting example complete ingestor PRs e.g. [#1: Prohibition Daily](https://github.com/floornfts/mobile-minting/pull/1/files).

We recommend consulting example complete ingestor PRs e.g. [#65: VV Mint Ingestor](https://github.com/floornfts/mobile-minting/pull/65).

You will create a new folder in `src/ingestors` for your new Ingestor.

Expand Down Expand Up @@ -260,49 +247,50 @@ For building the MintTemplate, we recommend using the `MintTemplateBuilder` whic

In this example we make a template, relying on `getMintMetadataFromSomewhere()` and `getMintContractDetailsFromSomewhere()` to fetch the marketing & onchain data respectively. We'll touch on those later.


```ts
const mintBuilder = new MintTemplateBuilder()
.setOriginalUrl(url)
.setMintInstructionType(MintInstructionType.EVM_MINT)
.setPartnerName('MyMints');

const { name, description, image } = await getMintMetadataFromSomewhere();
mintBuilder.setName(name).setDescription(description).setFeaturedImageUrl(image);

const { contractAddress, priceWei } = await getMintContractDetailsFromSomewhere();
mintBuilder.setMintInstructions({
chainId: '8453',
contractAddress,
contractMethod: 'mint',
contractParams: '[address, 1]',
abi: YOUR_ABI_FILE_IMPORT,
priceWei: totalPriceWei,
});
const mintBuilder = new MintTemplateBuilder()
.setOriginalUrl(url)
.setMintInstructionType(MintInstructionType.EVM_MINT)
.setPartnerName('MyMints');

const { name, description, image } = await getMintMetadataFromSomewhere();
mintBuilder.setName(name).setDescription(description).setFeaturedImageUrl(image);

const { contractAddress, priceWei } = await getMintContractDetailsFromSomewhere();
mintBuilder.setMintInstructions({
chainId: '8453',
contractAddress,
contractMethod: 'mint',
contractParams: '[address, 1]',
abi: YOUR_ABI_FILE_IMPORT,
priceWei: totalPriceWei,
});
```

_Note: You will typically want to implement either `createMintForContract` or `createMintTemplateForUrl`, and then call that one from the other._

You can then build the MintTemplate from the builder.

```ts
return mintBuilder.build();
return mintBuilder.build();
```

Note that `mintBuilder.build()` will throw if the MintTemplate does not meet validation requirements.

<br />

### Getting outside resources

Your MintIngestor is passed a `resources` object in it's sandboxed environment.

```ts
async createMintTemplateForUrl(url: string, resources: MintIngestorResources): Promise<MintTemplate>
```

This resources object contains properties:
* `alchemy`: An initalized Alchemy instance
* `fetch`: An HTTP client (Axios)

- `alchemy`: An initalized Alchemy instance
- `fetch`: An HTTP client (Axios)

You can use these to fetch resources you need.

Expand All @@ -311,10 +299,11 @@ You can use these to fetch resources you need.
<br />

### Local Setup

In order to use the Alchemy instance on resources, you will need to set a local Alchemy key.

* Copy `.env.sample` -> `.env`
* Insert your own Alchemy API key as `ALCHEMY_API_KEY`
- Copy `.env.sample` -> `.env`
- Insert your own Alchemy API key as `ALCHEMY_API_KEY`

This repo uses [Yarn](https://classic.yarnpkg.com/lang/en/docs/install/#mac-stable) to manage dependencies & execution.

Expand All @@ -328,11 +317,12 @@ yarn test
<br />

### Trying out your Mint Ingestor

You can try your mint ingestory using `yarn dry-run` -- this will:

* Create an instance of your minter
* Pass the inputs you provide to it
* Print out the output MintTemplate
- Create an instance of your minter
- Pass the inputs you provide to it
- Print out the output MintTemplate

```bash
yarn dry-run <minterSlug> <inputType> <input>
Expand All @@ -343,16 +333,19 @@ yarn dry-run <minterSlug> <inputType> <input>
`<input>`: A full URL for `url`, or a colon delimited fullly qualified address for `contract

Examples:

```bash
yarn dry-run prohibition-daily url https://daily.prohibition.art/mint/8453/0x896037d93a231273070dd5f5c9a72aba9a3fe920
yarn dry-run prohibition-daily contract 8453:0x896037d93a231273070dd5f5c9a72aba9a3fe920
yarn dry-run some-erc-1155-ingestor contract 8453:contractAddress:tokenId
```

# Submitting a Mobile Minting Ingestor

Once you've written a Mobile Minting Ingestor, it needs to be Pull Requested to this repository to be included in the production Rally Mobile Minting ingestion fleet.

### Before you submit

- [ ] Ensure your generated MintTemplate works 😄
- [ ] Ensure that your code is restricted to a single folder in `src/ingestors`
- [ ] Ensure that all required assets are included (e.g. ABIs)
Expand All @@ -363,18 +356,18 @@ Once you've written a Mobile Minting Ingestor, it needs to be Pull Requested to

### Submitting a Mint Ingestor

Open a Pull Request against this repo with your new Ingestor, as well as any comments / questions.
Open a Pull Request against this repo with your new Ingestor, as well as any comments / questions.

We're excited to see new platforms supported, so will quickly jump to help!

### Hopes and dreams

Mobile Minting started out entirely internal & this is our first experiment in decentralizing it & making it more accessible.

In time, we hope to continue down this path, but for now all ingestors will be reviewed by the Rally engineering team & accepted on the basis of safety, cost & other considerations by Rally.

We hope to see people (other companies!?) emerge for whom Mobile Minting, and a unified standard for expressing onchain mints is useful, and look forward to working with them to continue this mission.

### Questions?
Open an issue, or email developers@rally.xyz


Open an issue, or email developers@rally.xyz
4 changes: 1 addition & 3 deletions src/ingestors/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { MintIngestor } from '../lib/types/mint-ingestor';
import { ProhibitionDailyIngestor } from './prohibition-daily';
import { ManifoldIngestor } from './manifold';
import { RaribleIngestor } from './rarible';
import { FxHashIngestor } from './fxhash';
Expand All @@ -17,14 +16,13 @@ export type MintIngestionMap = {
export const ALL_MINT_INGESTORS: MintIngestionMap = {
'zora-internal': new ZoraInternalIngestor(),
rodeo: new RodeoIngestor(),
'prohibition-daily': new ProhibitionDailyIngestor(),
fxhash: new FxHashIngestor(),
manifold: new ManifoldIngestor(),
rarible: new RaribleIngestor(),
transient: new TransientIngestor(),
highlight: new HighlightIngestor(),
foundation: new FoundationIngestor(),
'coinbase-wallet': new CoinbaseWalletIngestor()
'coinbase-wallet': new CoinbaseWalletIngestor(),
};

export * from './';
91 changes: 0 additions & 91 deletions src/ingestors/prohibition-daily/abi.ts

This file was deleted.

Loading

0 comments on commit 23e4ac6

Please sign in to comment.