GovernedToken_CollectSplitPayment
GovernedToken_CollectSplitPayment is an integration mandate designed to work with the Governed721 contract. When a Governed721 token is sold, this mandate allows an eligible party (Artist, Intermediary, or Old Owner) to collect their percentage share of the payment.
Overview
Section titled “Overview”This mandate retrieves a pending transfer record from the Governed721 contract, verifies the caller’s role in that transfer, calculates their share of the payment, and generates an ERC20 token transfer to send them the correct amount.
Configuration
Section titled “Configuration”When adopting a GovernedToken_CollectSplitPayment instance, the following parameter is required:
Governed721Address(address): The address of the Governed721 token contract.
Proposing an Action
Section titled “Proposing an Action”When calling the mandate, one parameter must be provided:
TransferId(uint256): The ID of the pending transfer record in the Governed721 contract.
Execution Flow
Section titled “Execution Flow”-
Data Retrieval
- Fetches the
TransferDatafrom the Governed721 contract using theTransferId. - Validates that the transfer record exists and contains valid data.
- Fetches the
-
Authorization Check
- Verifies that the caller matches the expected role in the transfer (Artist, Intermediary, or Old Owner). Reverts if they don’t match.
-
Payment Calculation
- Retrieves the caller’s split percentage from the Governed721 contract.
- Calculates:
amount = quantity * percentage / 100.
-
Transfer
- Generates an ERC20
transfercall to send the calculated amount to the caller.
- Generates an ERC20
Error Conditions
Section titled “Error Conditions”"Transfer ID cannot be 0"— A zero transfer ID was provided."Transfer data mismatch or not found"— The transfer record does not exist or is incomplete."Caller is not the Artist"/"Caller is not the Intermediary"/"Caller is not the Old Owner"— The caller does not match the expected role."Calculated amount is zero"— The split percentage results in a zero payment.
Current Deployments
Section titled “Current Deployments”| Chain ID | Chain Name | Address |
|---|---|---|