Skip to content
This repository has been archived by the owner on Jan 5, 2024. It is now read-only.

Pre Builts How it works page #872

Merged
merged 2 commits into from
Sep 12, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 0 additions & 21 deletions docs/onboarding/2 Explore/1 1 Overview.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -72,24 +72,3 @@ Pre-built contracts are written by the thirdweb team, and cover the most common
| [Vote](/pre-built-contracts/vote) | Create and vote on proposals. |
| [Token](/pre-built-contracts/token) | Create cryptocurrency compliant with ERC-20 standard. |
| [Split](/pre-built-contracts/split) | Distribute funds among multiple recipients. |

## How Pre-Built Contracts Work

Each contract extends the extensions that are available in our [Solidity SDK](/solidity/extensions),
and all come with a standard set of features that enable fine-grained control over the contract's behavior, such as:

- [Contract metadata](/dashboard/NFTs)
- [Permission controls](/dashboard/permissions)
- [Royalties and platform fees](/dashboard/settings)

When you deploy a prebuilt contract, you are actually deploying a [**proxy contract**](/glossary/proxy-contracts);
which reduces the gas cost for you by **~90%**!

This works by having our smart contracts run the underlying logic, meaning you only deploy the code that is unique to _your_ contract.

The proxy contract stores the state, for example; its name, and what NFTs have been minted so far.
For any logic (such as how to mint an NFT), it delegates to the implementation smart contract to handle, since this logic is the same for every NFT collection.

**You still maintain 100% ownership of the contract.**

![Proxy Contract Flow](./2EVM/assets/delegating-calls.png)
25 changes: 25 additions & 0 deletions docs/onboarding/2 Explore/1 2 How it Works.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
---
title: Overview
slug: /pre-built-contracts/how-it-works
---

# How Pre-Built Contracts Work

Each contract extends the extensions that are available in our [Solidity SDK](/solidity/extensions),
and all come with a standard set of features that enable fine-grained control over the contract's behavior, such as:

- [Contract metadata](/dashboard/NFTs)
- [Permission controls](/dashboard/permissions)
- [Royalties and platform fees](/dashboard/settings)

When you deploy a prebuilt contract, you are actually deploying a [**proxy contract**](/glossary/proxy-contracts);
which reduces the gas cost for you by **~90%**!

This works by having our smart contracts run the underlying logic, meaning you only deploy the code that is unique to _your_ contract.

The proxy contract stores the state, for example; its name, and what NFTs have been minted so far.
For any logic (such as how to mint an NFT), it delegates to the implementation smart contract to handle, since this logic is the same for every NFT collection.

**You still maintain 100% ownership of the contract.**

![Proxy Contract Flow](./2EVM/assets/delegating-calls.png)