IPatchworkProtocol
Interface for interacting with Patchwork Protocol
Functions
claimScope
Claim a scope, with owner set to caller.
function claimScope(string calldata scopeName) external;
Parameters
Name | Type | Description |
---|---|---|
scopeName | string | Name of the scope |
transferScopeOwnership
Transfer ownership of a scope to a new entity.
function transferScopeOwnership(string calldata scopeName, address newOwner) external;
Parameters
Name | Type | Description |
---|---|---|
scopeName | string | Name of the scope |
newOwner | address | Address of the new owner |
cancelScopeTransfer
Cancel a pending scope transfer
function cancelScopeTransfer(string calldata scopeName) external;
Parameters
Name | Type | Description |
---|---|---|
scopeName | string | Name of the scope |
acceptScopeTransfer
Accept a scope transfer
function acceptScopeTransfer(string calldata scopeName) external;
Parameters
Name | Type | Description |
---|---|---|
scopeName | string | Name of the scope |
getScopeOwnerElect
Get owner-elect of a scope
function getScopeOwnerElect(string calldata scopeName) external view returns (address ownerElect);
Parameters
Name | Type | Description |
---|---|---|
scopeName | string | Name of the scope |
Returns
Name | Type | Description |
---|---|---|
ownerElect | address | Address of the scope’s owner-elect |
getScopeOwner
Get owner of a scope
function getScopeOwner(string calldata scopeName) external view returns (address owner);
Parameters
Name | Type | Description |
---|---|---|
scopeName | string | Name of the scope |
Returns
Name | Type | Description |
---|---|---|
owner | address | Address of the scope owner |
addOperator
Add an operator to a scope
function addOperator(string calldata scopeName, address op) external;
Parameters
Name | Type | Description |
---|---|---|
scopeName | string | Name of the scope |
op | address | Address of the operator |
removeOperator
Remove an operator from a scope
function removeOperator(string calldata scopeName, address op) external;
Parameters
Name | Type | Description |
---|---|---|
scopeName | string | Name of the scope |
op | address | Address of the operator |
setScopeRules
Set rules for a scope
function setScopeRules(string calldata scopeName, bool allowUserPatch, bool allowUserAssign, bool requireWhitelist)
external;
Parameters
Name | Type | Description |
---|---|---|
scopeName | string | Name of the scope |
allowUserPatch | bool | Boolean indicating whether user patches are allowed |
allowUserAssign | bool | Boolean indicating whether user assignments are allowed |
requireWhitelist | bool | Boolean indicating whether whitelist is required |
addWhitelist
Add an address to a scope’s whitelist
function addWhitelist(string calldata scopeName, address addr) external;
Parameters
Name | Type | Description |
---|---|---|
scopeName | string | Name of the scope |
addr | address | Address to be whitelisted |
removeWhitelist
Remove an address from a scope’s whitelist
function removeWhitelist(string calldata scopeName, address addr) external;
Parameters
Name | Type | Description |
---|---|---|
scopeName | string | Name of the scope |
addr | address | Address to be removed from the whitelist |
setMintConfiguration
Set the mint configuration for a given address
function setMintConfiguration(address addr, MintConfig memory config) external;
Parameters
Name | Type | Description |
---|---|---|
addr | address | The address for which to set the mint configuration, must be IPatchworkMintable |
config | MintConfig | The mint configuration to be set |
getMintConfiguration
Get the mint configuration for a given address
function getMintConfiguration(address addr) external view returns (MintConfig memory config);
Parameters
Name | Type | Description |
---|---|---|
addr | address | The address for which to get the mint configuration |
Returns
Name | Type | Description |
---|---|---|
config | MintConfig | The mint configuration of the given address |
setPatchFee
Set the patch fee for a given address
function setPatchFee(address addr, uint256 baseFee) external;
Parameters
Name | Type | Description |
---|---|---|
addr | address | The address for which to set the patch fee |
baseFee | uint256 | The patch fee to be set in wei |
getPatchFee
Get the patch fee for a given address
function getPatchFee(address addr) external view returns (uint256 baseFee);
Parameters
Name | Type | Description |
---|---|---|
addr | address | The address for which to get the patch fee |
Returns
Name | Type | Description |
---|---|---|
baseFee | uint256 | The patch fee of the given address in wei |
setAssignFee
Set the assign fee for a given fragment address
function setAssignFee(address fragmentAddress, uint256 baseFee) external;
Parameters
Name | Type | Description |
---|---|---|
fragmentAddress | address | The address of the fragment for which to set the fee |
baseFee | uint256 | The assign fee to be set in wei |
getAssignFee
Get the assign fee for a given fragment address
function getAssignFee(address fragmentAddress) external view returns (uint256 baseFee);
Parameters
Name | Type | Description |
---|---|---|
fragmentAddress | address | The address of the fragment for which to get the fee |
Returns
Name | Type | Description |
---|---|---|
baseFee | uint256 | The assign fee of the given fragment address in wei |
addBanker
Add a banker to a given scope
function addBanker(string memory scopeName, address addr) external;
Parameters
Name | Type | Description |
---|---|---|
scopeName | string | The name of the scope |
addr | address | The address to be added as a banker |
removeBanker
Remove a banker from a given scope
function removeBanker(string memory scopeName, address addr) external;
Parameters
Name | Type | Description |
---|---|---|
scopeName | string | The name of the scope |
addr | address | The address to be removed as a banker |
withdraw
Withdraw an amount from the balance of a given scope
amount
to the msg.senderfunction withdraw(string memory scopeName, uint256 amount) external;
Parameters
Name | Type | Description |
---|---|---|
scopeName | string | The name of the scope |
amount | uint256 | The amount to be withdrawn in wei |
balanceOf
Get the balance of a given scope
function balanceOf(string memory scopeName) external view returns (uint256 balance);
Parameters
Name | Type | Description |
---|---|---|
scopeName | string | The name of the scope |
Returns
Name | Type | Description |
---|---|---|
balance | uint256 | The balance of the given scope in wei |
mint
Mint a new token
function mint(address to, address mintable, bytes calldata data) external payable returns (uint256 tokenId);
Parameters
Name | Type | Description |
---|---|---|
to | address | The address to which the token will be minted |
mintable | address | The address of the IPatchworkMintable contract |
data | bytes | Additional data to be passed to the minting |
Returns
Name | Type | Description |
---|---|---|
tokenId | uint256 | The ID of the minted token |
mintBatch
Mint a batch of new tokens
function mintBatch(address to, address mintable, bytes calldata data, uint256 quantity)
external
payable
returns (uint256[] memory tokenIds);
Parameters
Name | Type | Description |
---|---|---|
to | address | The address to which the tokens will be minted |
mintable | address | The address of the IPatchworkMintable contract |
data | bytes | Additional data to be passed to the minting |
quantity | uint256 | The number of tokens to mint |
Returns
Name | Type | Description |
---|---|---|
tokenIds | uint256[] | An array of the IDs of the minted tokens |
proposeProtocolFeeConfig
Proposes a protocol fee configuration
commitProtocolFeeConfig
is called.function proposeProtocolFeeConfig(FeeConfig memory config) external;
Parameters
Name | Type | Description |
---|---|---|
config | FeeConfig | The protocol fee configuration to be set |
commitProtocolFeeConfig
Commits the current proposed protocol fee configuration
function commitProtocolFeeConfig() external;
getProtocolFeeConfig
Get the current protocol fee configuration
function getProtocolFeeConfig() external view returns (FeeConfig memory config);
Returns
Name | Type | Description |
---|---|---|
config | FeeConfig | The current protocol fee configuration |
proposeScopeFeeOverride
Proposes a protocol fee override for a scope
function proposeScopeFeeOverride(string memory scopeName, FeeConfigOverride memory config) external;
Parameters
Name | Type | Description |
---|---|---|
scopeName | string | |
config | FeeConfigOverride | The protocol fee override configuration to be set |
commitScopeFeeOverride
Commits the current proposed protocol fee override configuration for a scope
function commitScopeFeeOverride(string memory scopeName) external;
getScopeFeeOverride
Get the protocol fee override for a scope
function getScopeFeeOverride(string memory scopeName) external view returns (FeeConfigOverride memory config);
Returns
Name | Type | Description |
---|---|---|
config | FeeConfigOverride | The current protocol fee override |
addProtocolBanker
Add a banker to the protocol
function addProtocolBanker(address addr) external;
Parameters
Name | Type | Description |
---|---|---|
addr | address | The address to be added as a protocol banker |
removeProtocolBanker
Remove a banker from the protocol
function removeProtocolBanker(address addr) external;
Parameters
Name | Type | Description |
---|---|---|
addr | address | The address to be removed as a protocol banker |
withdrawFromProtocol
Withdraw a specified amount from the protocol balance
function withdrawFromProtocol(uint256 balance) external;
Parameters
Name | Type | Description |
---|---|---|
balance | uint256 | The amount to be withdrawn in wei |
balanceOfProtocol
Get the current balance of the protocol
function balanceOfProtocol() external view returns (uint256 balance);
Returns
Name | Type | Description |
---|---|---|
balance | uint256 | The balance of the protocol in wei |
patch
Create a new patch
function patch(address owner, address originalAddress, uint256 originalTokenId, address patchAddress)
external
payable
returns (uint256 tokenId);
Parameters
Name | Type | Description |
---|---|---|
owner | address | The owner of the patch |
originalAddress | address | Address of the original 721 |
originalTokenId | uint256 | Token ID of the original 721 |
patchAddress | address | Address of the IPatchworkPatch to mint |
Returns
Name | Type | Description |
---|---|---|
tokenId | uint256 | Token ID of the newly created patch |
patchBurned
Callback for when a patch is burned
patchAddress
.function patchBurned(address originalAddress, uint256 originalTokenId, address patchAddress) external;
Parameters
Name | Type | Description |
---|---|---|
originalAddress | address | Address of the original 721 |
originalTokenId | uint256 | Token ID of the original 721 |
patchAddress | address | Address of the IPatchworkPatch to mint |
patch1155
Create a new 1155 patch
function patch1155(
address to,
address originalAddress,
uint256 originalTokenId,
address originalAccount,
address patchAddress
) external payable returns (uint256 tokenId);
Parameters
Name | Type | Description |
---|---|---|
to | address | |
originalAddress | address | Address of the original 1155 |
originalTokenId | uint256 | Token ID of the original 1155 |
originalAccount | address | Address of the account to patch |
patchAddress | address | Address of the IPatchworkPatch to mint |
Returns
Name | Type | Description |
---|---|---|
tokenId | uint256 | Token ID of the newly created patch |
patchBurned1155
Callback for when an 1155 patch is burned
patchAddress
.function patchBurned1155(
address originalAddress,
uint256 originalTokenId,
address originalAccount,
address patchAddress
) external;
Parameters
Name | Type | Description |
---|---|---|
originalAddress | address | Address of the original 1155 |
originalTokenId | uint256 | Token ID of the original 1155 |
originalAccount | address | Address of the account to patch |
patchAddress | address | Address of the IPatchworkPatch to mint |
patchAccount
Create a new account patch
function patchAccount(address owner, address originalAddress, address patchAddress)
external
payable
returns (uint256 tokenId);
Parameters
Name | Type | Description |
---|---|---|
owner | address | The owner of the patch |
originalAddress | address | Address of the original account |
patchAddress | address | Address of the IPatchworkPatch to mint |
Returns
Name | Type | Description |
---|---|---|
tokenId | uint256 | Token ID of the newly created patch |
patchBurnedAccount
Callback for when an account patch is burned
patchAddress
.function patchBurnedAccount(address originalAddress, address patchAddress) external;
Parameters
Name | Type | Description |
---|---|---|
originalAddress | address | Address of the original 1155 |
patchAddress | address | Address of the IPatchworkPatch to mint |
assign
Assigns a relation to have an IPatchworkLiteRef form a LiteRef to a IPatchworkAssignable
function assign(address fragment, uint256 fragmentTokenId, address target, uint256 targetTokenId) external payable;
Parameters
Name | Type | Description |
---|---|---|
fragment | address | The IPatchworkAssignable address to assign |
fragmentTokenId | uint256 | The IPatchworkAssignable Token ID to assign |
target | address | The IPatchworkLiteRef address to hold the reference to the fragment |
targetTokenId | uint256 | The IPatchworkLiteRef Token ID to hold the reference to the fragment |
assign
Assigns a relation to have an IPatchworkLiteRef form a LiteRef to a IPatchworkAssignable
function assign(
address fragment,
uint256 fragmentTokenId,
address target,
uint256 targetTokenId,
uint256 targetMetadataId
) external payable;
Parameters
Name | Type | Description |
---|---|---|
fragment | address | The IPatchworkAssignable address to assign |
fragmentTokenId | uint256 | The IPatchworkAssignable Token ID to assign |
target | address | The IPatchworkLiteRef address to hold the reference to the fragment |
targetTokenId | uint256 | The IPatchworkLiteRef Token ID to hold the reference to the fragment |
targetMetadataId | uint256 | The metadata ID on the target to store the reference in |
assignBatch
Assign multiple fragments to a target in batch
function assignBatch(address[] calldata fragments, uint256[] calldata tokenIds, address target, uint256 targetTokenId)
external
payable;
Parameters
Name | Type | Description |
---|---|---|
fragments | address[] | The array of addresses of the fragment IPatchworkAssignables |
tokenIds | uint256[] | The array of token IDs of the fragment IPatchworkAssignables |
target | address | The address of the target IPatchworkLiteRef |
targetTokenId | uint256 | The token ID of the target IPatchworkLiteRef |
assignBatch
Assign multiple fragments to a target in batch
function assignBatch(
address[] calldata fragments,
uint256[] calldata tokenIds,
address target,
uint256 targetTokenId,
uint256 targetMetadataId
) external payable;
Parameters
Name | Type | Description |
---|---|---|
fragments | address[] | The array of addresses of the fragment IPatchworkAssignables |
tokenIds | uint256[] | The array of token IDs of the fragment IPatchworkAssignables |
target | address | The address of the target IPatchworkLiteRef |
targetTokenId | uint256 | The token ID of the target IPatchworkLiteRef |
targetMetadataId | uint256 | The metadata ID on the target to store the references in |
unassignSingle
Unassign a fragment from a target
IPatchworkSingleAssignable
.function unassignSingle(address fragment, uint256 fragmentTokenId) external;
Parameters
Name | Type | Description |
---|---|---|
fragment | address | The IPatchworkSingleAssignable address of the fragment |
fragmentTokenId | uint256 | The IPatchworkSingleAssignable token ID of the fragment |
unassignSingle
Unassign a fragment from a target
IPatchworkSingleAssignable
.function unassignSingle(address fragment, uint256 fragmentTokenId, uint256 targetMetadataId) external;
Parameters
Name | Type | Description |
---|---|---|
fragment | address | The IPatchworkSingleAssignable address of the fragment |
fragmentTokenId | uint256 | The IPatchworkSingleAssignable token ID of the fragment |
targetMetadataId | uint256 | The metadata ID on the target to unassign from |
unassignMulti
Unassigns a multi relation
IPatchworkMultiAssignable
.function unassignMulti(address fragment, uint256 fragmentTokenId, address target, uint256 targetTokenId) external;
Parameters
Name | Type | Description |
---|---|---|
fragment | address | The IPatchworMultiAssignable address to unassign |
fragmentTokenId | uint256 | The IPatchworkMultiAssignable Token ID to unassign |
target | address | The IPatchworkLiteRef address which holds a reference to the fragment |
targetTokenId | uint256 | The IPatchworkLiteRef Token ID which holds a reference to the fragment |
unassignMulti
Unassigns a multi relation
IPatchworkMultiAssignable
.function unassignMulti(
address fragment,
uint256 fragmentTokenId,
address target,
uint256 targetTokenId,
uint256 targetMetadataId
) external;
Parameters
Name | Type | Description |
---|---|---|
fragment | address | The IPatchworMultiAssignable address to unassign |
fragmentTokenId | uint256 | The IPatchworkMultiAssignable Token ID to unassign |
target | address | The IPatchworkLiteRef address which holds a reference to the fragment |
targetTokenId | uint256 | The IPatchworkLiteRef Token ID which holds a reference to the fragment |
targetMetadataId | uint256 | The metadata ID on the target to unassign from |
unassign
Unassigns a relation (single or multi)
function unassign(address fragment, uint256 fragmentTokenId, address target, uint256 targetTokenId) external;
Parameters
Name | Type | Description |
---|---|---|
fragment | address | The IPatchworkAssignable address to unassign |
fragmentTokenId | uint256 | The IPatchworkAssignable Token ID to unassign |
target | address | The IPatchworkLiteRef address which holds a reference to the fragment |
targetTokenId | uint256 | The IPatchworkLiteRef Token ID which holds a reference to the fragment |
unassign
Unassigns a relation (single or multi)
function unassign(
address fragment,
uint256 fragmentTokenId,
address target,
uint256 targetTokenId,
uint256 targetMetadataId
) external;
Parameters
Name | Type | Description |
---|---|---|
fragment | address | The IPatchworkAssignable address to unassign |
fragmentTokenId | uint256 | The IPatchworkAssignable Token ID to unassign |
target | address | The IPatchworkLiteRef address which holds a reference to the fragment |
targetTokenId | uint256 | The IPatchworkLiteRef Token ID which holds a reference to the fragment |
targetMetadataId | uint256 | The metadata ID on the target to unassign from |
applyTransfer
Apply transfer rules and actions of a specific token from one address to another
function applyTransfer(address from, address to, uint256 tokenId) external;
Parameters
Name | Type | Description |
---|---|---|
from | address | The address of the sender |
to | address | The address of the receiver |
tokenId | uint256 | The ID of the token to be transferred |
updateOwnershipTree
Update the ownership tree of a specific Patchwork 721
function updateOwnershipTree(address addr, uint256 tokenId) external;
Parameters
Name | Type | Description |
---|---|---|
addr | address | The address of the Patchwork 721 |
tokenId | uint256 | The ID of the token whose ownership tree needs to be updated |
proposeAssignerDelegate
Propose an assigner delegate module
function proposeAssignerDelegate(address addr) external;
Parameters
Name | Type | Description |
---|---|---|
addr | address | The address of the new delegate module |
commitAssignerDelegate
Commit the proposed assigner delegate module
timelock
.function commitAssignerDelegate() external;
Events
Assign
Emitted when a fragment is assigned
event Assign(
address indexed owner,
address fragmentAddress,
uint256 fragmentTokenId,
address indexed targetAddress,
uint256 indexed targetTokenId,
uint256 scopeFee,
uint256 protocolFee
);
Parameters
Name | Type | Description |
---|---|---|
owner | address | The owner of the target and fragment |
fragmentAddress | address | The address of the fragment’s contract |
fragmentTokenId | uint256 | The tokenId of the fragment |
targetAddress | address | The address of the target’s contract |
targetTokenId | uint256 | The tokenId of the target |
scopeFee | uint256 | The fee collected to the scope |
protocolFee | uint256 | The fee collected to the protocol |
Unassign
Emitted when a fragment is unassigned
event Unassign(
address indexed owner,
address fragmentAddress,
uint256 fragmentTokenId,
address indexed targetAddress,
uint256 indexed targetTokenId
);
Parameters
Name | Type | Description |
---|---|---|
owner | address | The owner of the fragment |
fragmentAddress | address | The address of the fragment’s contract |
fragmentTokenId | uint256 | The tokenId of the fragment |
targetAddress | address | The address of the target’s contract |
targetTokenId | uint256 | The tokenId of the target |
Patch
Emitted when a patch is minted
event Patch(
address indexed owner,
address originalAddress,
uint256 originalTokenId,
address indexed patchAddress,
uint256 indexed patchTokenId,
uint256 scopeFee,
uint256 protocolFee
);
Parameters
Name | Type | Description |
---|---|---|
owner | address | The owner of the patch |
originalAddress | address | The address of the original 721’s contract |
originalTokenId | uint256 | The tokenId of the original 721 |
patchAddress | address | The address of the patch’s contract |
patchTokenId | uint256 | The tokenId of the patch |
scopeFee | uint256 | The fee collected to the scope |
protocolFee | uint256 | The fee collected to the protocol |
ERC1155Patch
Emitted when a patch is minted
event ERC1155Patch(
address indexed owner,
address originalAddress,
uint256 originalTokenId,
address originalAccount,
address indexed patchAddress,
uint256 indexed patchTokenId,
uint256 scopeFee,
uint256 protocolFee
);
Parameters
Name | Type | Description |
---|---|---|
owner | address | The owner of the patch |
originalAddress | address | The address of the original 1155’s contract |
originalTokenId | uint256 | The tokenId of the original 1155 |
originalAccount | address | The address of the original 1155’s account |
patchAddress | address | The address of the patch’s contract |
patchTokenId | uint256 | The tokenId of the patch |
scopeFee | uint256 | The fee collected to the scope |
protocolFee | uint256 | The fee collected to the protocol |
AccountPatch
Emitted when an account patch is minted
event AccountPatch(
address indexed owner,
address originalAddress,
address indexed patchAddress,
uint256 indexed patchTokenId,
uint256 scopeFee,
uint256 protocolFee
);
Parameters
Name | Type | Description |
---|---|---|
owner | address | The owner of the patch |
originalAddress | address | The address of the original account |
patchAddress | address | The address of the patch’s contract |
patchTokenId | uint256 | The tokenId of the patch |
scopeFee | uint256 | The fee collected to the scope |
protocolFee | uint256 | The fee collected to the protocol |
ScopeClaim
Emitted when a new scope is claimed
event ScopeClaim(string scopeName, address indexed owner);
Parameters
Name | Type | Description |
---|---|---|
scopeName | string | The name of the claimed scope |
owner | address | The owner of the scope |
ScopeTransferElect
Emitted when a scope has elected a new owner to transfer to
event ScopeTransferElect(string scopeName, address indexed from, address indexed to);
Parameters
Name | Type | Description |
---|---|---|
scopeName | string | The name of the transferred scope |
from | address | The owner of the scope |
to | address | The owner-elect of the scope |
ScopeTransferCancel
Emitted when a scope transfer is canceled
event ScopeTransferCancel(string scopeName, address indexed from, address indexed to);
Parameters
Name | Type | Description |
---|---|---|
scopeName | string | The name of the transferred scope |
from | address | The owner of the scope |
to | address | The owner-elect of the scope |
ScopeTransfer
Emitted when a scope is transferred
event ScopeTransfer(string scopeName, address indexed from, address indexed to);
Parameters
Name | Type | Description |
---|---|---|
scopeName | string | The name of the transferred scope |
from | address | The address transferring the scope |
to | address | The recipient of the scope |
ScopeAddOperator
Emitted when a scope has an operator added
event ScopeAddOperator(string scopeName, address indexed actor, address indexed operator);
Parameters
Name | Type | Description |
---|---|---|
scopeName | string | The name of the scope |
actor | address | The address responsible for the action |
operator | address | The new operator’s address |
ScopeRemoveOperator
Emitted when a scope has an operator removed
event ScopeRemoveOperator(string scopeName, address indexed actor, address indexed operator);
Parameters
Name | Type | Description |
---|---|---|
scopeName | string | The name of the scope |
actor | address | The address responsible for the action |
operator | address | The operator’s address being removed |
ScopeRuleChange
Emitted when a scope’s rules are changed
event ScopeRuleChange(
string scopeName, address indexed actor, bool allowUserPatch, bool allowUserAssign, bool requireWhitelist
);
Parameters
Name | Type | Description |
---|---|---|
scopeName | string | The name of the scope |
actor | address | The address responsible for the action |
allowUserPatch | bool | Indicates whether user patches are allowed |
allowUserAssign | bool | Indicates whether user assignments are allowed |
requireWhitelist | bool | Indicates whether a whitelist is required |
ScopeWhitelistAdd
Emitted when a scope has an address added to the whitelist
event ScopeWhitelistAdd(string scopeName, address indexed actor, address indexed addr);
Parameters
Name | Type | Description |
---|---|---|
scopeName | string | The name of the scope |
actor | address | The address responsible for the action |
addr | address | The address being added to the whitelist |
ScopeWhitelistRemove
Emitted when a scope has an address removed from the whitelist
event ScopeWhitelistRemove(string scopeName, address indexed actor, address indexed addr);
Parameters
Name | Type | Description |
---|---|---|
scopeName | string | The name of the scope |
actor | address | The address responsible for the action |
addr | address | The address being removed from the whitelist |
MintConfigure
Emitted when a mint is configured
event MintConfigure(string scopeName, address indexed actor, address indexed mintable, MintConfig config);
Parameters
Name | Type | Description |
---|---|---|
scopeName | string | The name of the scope |
actor | address | |
mintable | address | The address of the IPatchworkMintable |
config | MintConfig | The mint configuration |
ScopeBankerAdd
Emitted when a banker is added to a scope
event ScopeBankerAdd(string scopeName, address indexed actor, address indexed banker);
Parameters
Name | Type | Description |
---|---|---|
scopeName | string | The name of the scope |
actor | address | The address responsible for the action |
banker | address | The banker that was added |
ScopeBankerRemove
Emitted when a banker is removed from a scope
event ScopeBankerRemove(string scopeName, address indexed actor, address indexed banker);
Parameters
Name | Type | Description |
---|---|---|
scopeName | string | The name of the scope |
actor | address | The address responsible for the action |
banker | address | The banker that was removed |
ScopeWithdraw
Emitted when a withdrawl is made from a scope
event ScopeWithdraw(string scopeName, address indexed actor, uint256 amount);
Parameters
Name | Type | Description |
---|---|---|
scopeName | string | The name of the scope |
actor | address | The address responsible for the action |
amount | uint256 | The amount withdrawn |
ProtocolBankerAdd
Emitted when a banker is added to the protocol
event ProtocolBankerAdd(address indexed actor, address indexed banker);
Parameters
Name | Type | Description |
---|---|---|
actor | address | The address responsible for the action |
banker | address | The banker that was added |
ProtocolBankerRemove
Emitted when a banker is removed from the protocol
event ProtocolBankerRemove(address indexed actor, address indexed banker);
Parameters
Name | Type | Description |
---|---|---|
actor | address | The address responsible for the action |
banker | address | The banker that was removed |
ProtocolWithdraw
Emitted when a withdrawl is made from the protocol
event ProtocolWithdraw(address indexed actor, uint256 amount);
Parameters
Name | Type | Description |
---|---|---|
actor | address | The address responsible for the action |
amount | uint256 | The amount withdrawn |
Mint
Emitted on mint
event Mint(
address indexed actor,
string scopeName,
address indexed to,
address indexed mintable,
bytes data,
uint256 scopeFee,
uint256 protocolFee
);
Parameters
Name | Type | Description |
---|---|---|
actor | address | The address responsible for the action |
scopeName | string | The scope of the IPatchworkMintable |
to | address | The receipient of the mint |
mintable | address | The IPatchworkMintable minted |
data | bytes | The data used to mint |
scopeFee | uint256 | The fee collected to the scope |
protocolFee | uint256 | The fee collected to the protocol |
MintBatch
Emitted on batch mint
event MintBatch(
address indexed actor,
string scopeName,
address indexed to,
address indexed mintable,
bytes data,
uint256 quantity,
uint256 scopeFee,
uint256 protocolFee
);
Parameters
Name | Type | Description |
---|---|---|
actor | address | The address responsible for the action |
scopeName | string | The scope of the IPatchworkMintable |
to | address | The receipient of the mint |
mintable | address | The IPatchworkMintable minted |
data | bytes | The data used to mint |
quantity | uint256 | The quantity minted |
scopeFee | uint256 | The fee collected to the scope |
protocolFee | uint256 | The fee collected to the protocol |
ProtocolFeeConfigPropose
Emitted on protocol fee config proposed
event ProtocolFeeConfigPropose(FeeConfig config);
Parameters
Name | Type | Description |
---|---|---|
config | FeeConfig | The fee configuration |
ProtocolFeeConfigCommit
Emitted on protocol fee config committed
event ProtocolFeeConfigCommit(FeeConfig config);
Parameters
Name | Type | Description |
---|---|---|
config | FeeConfig | The fee configuration |
ScopeFeeOverridePropose
Emitted on scope fee config override proposed
event ScopeFeeOverridePropose(string scopeName, FeeConfigOverride config);
Parameters
Name | Type | Description |
---|---|---|
scopeName | string | The scope |
config | FeeConfigOverride | The fee configuration |
ScopeFeeOverrideCommit
Emitted on scope fee config override committed
event ScopeFeeOverrideCommit(string scopeName, FeeConfigOverride config);
Parameters
Name | Type | Description |
---|---|---|
scopeName | string | The scope |
config | FeeConfigOverride | The fee configuration |
PatchFeeChange
Emitted on patch fee change
event PatchFeeChange(string scopeName, address indexed addr, uint256 fee);
Parameters
Name | Type | Description |
---|---|---|
scopeName | string | The scope of the patch |
addr | address | The address of the patch |
fee | uint256 | The new fee |
AssignFeeChange
Emitted on assign fee change
event AssignFeeChange(string scopeName, address indexed addr, uint256 fee);
Parameters
Name | Type | Description |
---|---|---|
scopeName | string | The scope of the assignable |
addr | address | The address of the assignable |
fee | uint256 | The new fee |
AssignerDelegatePropose
Emitted on assigner delegate propose
event AssignerDelegatePropose(address indexed addr);
Parameters
Name | Type | Description |
---|---|---|
addr | address | The address of the delegate |
AssignerDelegateCommit
Emitted on assigner delegate commit
event AssignerDelegateCommit(address indexed addr);
Parameters
Name | Type | Description |
---|---|---|
addr | address | The address of the delegate |
Errors
NotAuthorized
The address is not authorized to perform this action
error NotAuthorized(address addr);
Parameters
Name | Type | Description |
---|---|---|
addr | address | The address attempting to perform the action |
ScopeExists
The scope with the provided name already exists
error ScopeExists(string scopeName);
Parameters
Name | Type | Description |
---|---|---|
scopeName | string | Name of the scope |
ScopeDoesNotExist
The scope with the provided name does not exist
error ScopeDoesNotExist(string scopeName);
Parameters
Name | Type | Description |
---|---|---|
scopeName | string | Name of the scope |
ScopeTransferNotAllowed
Transfer of the scope to the provided address is not allowed
error ScopeTransferNotAllowed(address to);
Parameters
Name | Type | Description |
---|---|---|
to | address | Address not allowed for scope transfer |
Frozen
The token with the provided ID at the given address is frozen
error Frozen(address addr, uint256 tokenId);
Parameters
Name | Type | Description |
---|---|---|
addr | address | Address of the token owner |
tokenId | uint256 | ID of the frozen token |
Locked
The token with the provided ID at the given address is locked
error Locked(address addr, uint256 tokenId);
Parameters
Name | Type | Description |
---|---|---|
addr | address | Address of the token owner |
tokenId | uint256 | ID of the locked token |
NotWhitelisted
The address is not whitelisted for the given scope
error NotWhitelisted(string scopeName, address addr);
Parameters
Name | Type | Description |
---|---|---|
scopeName | string | Name of the scope |
addr | address | Address that isn’t whitelisted |
AccountAlreadyPatched
The address at the given address has already been patched
error AccountAlreadyPatched(address addr, address patchAddress);
Parameters
Name | Type | Description |
---|---|---|
addr | address | The address that was patched |
patchAddress | address | Address of the patch applied |
AlreadyPatched
The token at the given address has already been patched
error AlreadyPatched(address addr, uint256 tokenId, address patchAddress);
Parameters
Name | Type | Description |
---|---|---|
addr | address | Address of the original 721 |
tokenId | uint256 | ID of the patched token |
patchAddress | address | Address of the patch applied |
ERC1155AlreadyPatched
The ERC1155 path has already been patched
error ERC1155AlreadyPatched(address addr, uint256 tokenId, address account, address patchAddress);
Parameters
Name | Type | Description |
---|---|---|
addr | address | Address of the 1155 |
tokenId | uint256 | ID of the patched token |
account | address | The account patched |
patchAddress | address | Address of the patch applied |
BadInputLengths
The provided input lengths are not compatible or valid
for any multi array inputs, they must be the same length
error BadInputLengths();
FragmentUnregistered
The fragment at the given address is unregistered
error FragmentUnregistered(address addr);
Parameters
Name | Type | Description |
---|---|---|
addr | address | Address of the unregistered fragment |
FragmentRedacted
The fragment at the given address has been redacted
error FragmentRedacted(address addr);
Parameters
Name | Type | Description |
---|---|---|
addr | address | Address of the redacted fragment |
FragmentAlreadyAssigned
The fragment with the provided ID at the given address is already assigned
error FragmentAlreadyAssigned(address addr, uint256 tokenId);
Parameters
Name | Type | Description |
---|---|---|
addr | address | Address of the fragment |
tokenId | uint256 | ID of the assigned fragment |
RefNotFound
The reference was not found for the given fragment and target
error RefNotFound(address target, address fragment, uint256 tokenId);
Parameters
Name | Type | Description |
---|---|---|
target | address | Address of the target token |
fragment | address | Address of the fragment |
tokenId | uint256 | ID of the fragment |
FragmentNotAssigned
The fragment with the provided ID at the given address is not assigned
error FragmentNotAssigned(address addr, uint256 tokenId);
Parameters
Name | Type | Description |
---|---|---|
addr | address | Address of the fragment |
tokenId | uint256 | ID of the fragment |
FragmentNotAssignedToTarget
The fragment with the provided ID at the given address is not assigned to the target
error FragmentNotAssignedToTarget(address addr, uint256 tokenId, address targetAddress, uint256 targetTokenId);
Parameters
Name | Type | Description |
---|---|---|
addr | address | Address of the fragment |
tokenId | uint256 | ID of the fragment |
targetAddress | address | Address of the target |
targetTokenId | uint256 | ID of the target |
FragmentAlreadyRegistered
The fragment at the given address is already registered
error FragmentAlreadyRegistered(address addr);
Parameters
Name | Type | Description |
---|---|---|
addr | address | Address of the registered fragment |
OutOfIDs
Ran out of available IDs for allocation
error OutOfIDs();
UnsupportedTokenId
The provided token ID is unsupported
error UnsupportedTokenId(uint256 tokenId);
Parameters
Name | Type | Description |
---|---|---|
tokenId | uint256 | The unsupported token ID |
CannotLockSoulboundPatch
Cannot lock the soulbound patch at the given address
error CannotLockSoulboundPatch(address addr);
Parameters
Name | Type | Description |
---|---|---|
addr | address | Address of the soulbound patch |
NotFrozen
The token with the provided ID at the given address is not frozen
error NotFrozen(address addr, uint256 tokenId);
Parameters
Name | Type | Description |
---|---|---|
addr | address | Address of the token owner |
tokenId | uint256 | ID of the token |
IncorrectNonce
The nonce for the token with the provided ID at the given address is incorrect
error IncorrectNonce(address addr, uint256 tokenId, uint256 nonce);
Parameters
Name | Type | Description |
---|---|---|
addr | address | Address of the token owner |
tokenId | uint256 | ID of the token |
nonce | uint256 | The incorrect nonce |
SelfAssignmentNotAllowed
Self assignment of the token with the provided ID at the given address is not allowed
error SelfAssignmentNotAllowed(address addr, uint256 tokenId);
Parameters
Name | Type | Description |
---|---|---|
addr | address | Address of the token owner |
tokenId | uint256 | ID of the token |
TransferNotAllowed
Transfer of the token with the provided ID at the given address is not allowed
error TransferNotAllowed(address addr, uint256 tokenId);
Parameters
Name | Type | Description |
---|---|---|
addr | address | Address of the token owner |
tokenId | uint256 | ID of the token |
TransferBlockedByAssignment
Transfer of the token with the provided ID at the given address is blocked by an assignment
error TransferBlockedByAssignment(address addr, uint256 tokenId);
Parameters
Name | Type | Description |
---|---|---|
addr | address | Address of the token owner |
tokenId | uint256 | ID of the token |
MintNotAllowed
A rule is blocking the mint to this owner address
error MintNotAllowed(address addr);
Parameters
Name | Type | Description |
---|---|---|
addr | address | Address of the token owner |
NotPatchworkAssignable
The token at the given address is not IPatchworkAssignable
error NotPatchworkAssignable(address addr);
Parameters
Name | Type | Description |
---|---|---|
addr | address | Address of the non-assignable token |
DataIntegrityError
A data integrity error has been detected
addr
+tokenId
is expected where addr2
+tokenId2
is present.error DataIntegrityError(address addr, uint256 tokenId, address addr2, uint256 tokenId2);
Parameters
Name | Type | Description |
---|---|---|
addr | address | Address of the first token |
tokenId | uint256 | ID of the first token |
addr2 | address | Address of the second token |
tokenId2 | uint256 | ID of the second token |
InsufficientFunds
The available balance does not satisfy the amount
error InsufficientFunds();
IncorrectFeeAmount
The supplied fee is not the corret amount
error IncorrectFeeAmount();
MintNotActive
Minting is not active for this address
error MintNotActive();
FailedToSend
The value could not be sent
error FailedToSend();
UnsupportedContract
The contract is not supported
error UnsupportedContract();
UnsupportedOperation
The operation is not supported
error UnsupportedOperation();
NoProposedFeeSet
No proposed fee is set
error NoProposedFeeSet();
TimelockNotElapsed
Timelock has not elapsed
error TimelockNotElapsed();
InvalidFeeValue
Invalid fee value
error InvalidFeeValue();
NoDelegateProposed
No delegate proposed
error NoDelegateProposed();
Structs
FeeConfig
Fee Configuration
struct FeeConfig {
uint256 mintBp;
uint256 patchBp;
uint256 assignBp;
}
FeeConfigOverride
Fee Configuration Override
struct FeeConfigOverride {
uint256 mintBp;
uint256 patchBp;
uint256 assignBp;
bool active;
}
ProposedFeeConfig
Proposal to change a fee configuration for either protocol or scope override
struct ProposedFeeConfig {
FeeConfig config;
uint256 timestamp;
bool active;
}
MintConfig
Mint configuration
struct MintConfig {
uint256 flatFee;
bool active;
}
ProposedAssignerDelegate
Proposed assigner delegate
struct ProposedAssignerDelegate {
uint256 timestamp;
address addr;
}
Scope
Represents a defined scope within the system
struct Scope {
address owner;
address ownerElect;
bool allowUserPatch;
bool allowUserAssign;
bool requireWhitelist;
mapping(address => bool) operators;
mapping(address => bool) whitelist;
mapping(address => MintConfig) mintConfigurations;
mapping(address => uint256) patchFees;
mapping(address => uint256) assignFees;
uint256 balance;
mapping(address => bool) bankers;
}