Factory
Inherits: ERC721, Owned
Author: out.eth (@outdoteth)
This contract is used to create and initialize new private pools. Each time a private pool is created, a new NFT representing that private pool is minted to the creator. All protocol fees also accrue to this contract and can be withdrawn by the admin.
State Variables
privatePoolImplementation
The address of the private pool implementation that proxies point to.
privatePoolMetadata
Helper contract that constructs the private pool metadata svg and json for each pool NFT.
protocolFeeRate
The protocol fee that is taken on each buy/sell/change. It's in basis points: 350 = 3.5%.
Functions
constructor
receive
create
Creates a new private pool using the minimal proxy pattern that points to the private pool implementation. The caller must approve the factory to transfer the NFTs that will be deposited to the pool.
Parameters
Name | Type | Description |
---|---|---|
|
| The address of the base token. |
|
| The address of the NFT. |
|
| The virtual base token reserves. |
|
| The virtual NFT reserves. |
|
| The change fee. |
|
| The fee rate. |
|
| The merkle root. |
|
| Whether to use the stolen NFT oracle. |
|
| |
|
| The salt that will used on deployment. |
|
| The token ids to deposit to the pool. |
|
| The amount of base tokens to deposit to the pool. |
Returns
Name | Type | Description |
---|---|---|
|
| The address of the private pool. |
predictPoolDeploymentAddress
Predicts the deployment address of a new private pool.
Parameters
Name | Type | Description |
---|---|---|
|
| The salt that will used on deployment. |
Returns
Name | Type | Description |
---|---|---|
|
| The predicted deployment address of the private pool. |
setPrivatePoolMetadata
Sets private pool metadata contract.
Parameters
Name | Type | Description |
---|---|---|
|
| The private pool metadata contract. |
setPrivatePoolImplementation
Sets the private pool implementation contract that newly deployed proxies point to.
Parameters
Name | Type | Description |
---|---|---|
|
| The private pool implementation contract. |
setProtocolFeeRate
Sets the protocol fee that is taken on each buy/sell/change. It's in basis points: 350 = 3.5%.
Parameters
Name | Type | Description |
---|---|---|
|
| The protocol fee. |
withdraw
Withdraws the earned protocol fees.
Parameters
Name | Type | Description |
---|---|---|
|
| The token to withdraw. |
|
| The amount to withdraw. |
tokenURI
Returns the token URI for a given token id.
Parameters
Name | Type | Description |
---|---|---|
|
| The token id. |
Returns
Name | Type | Description |
---|---|---|
|
| uri The token URI. |
Events
Create
Withdraw
Last updated