GDAv1Forwarder
The GDAv1Forwarder contract is a Superfluid forwarder that implements the General Distribution Agreement (GDA) related functions. It is a contract specifically made immutable in order to facilitate the interaction with Distributions through the General Distribution Agreement (GDA).
This contract is optimized for interaction that would happen from outside the blockchain (off-chain). For more information on the best practices regarding this interaction, please refer to the Interact Off-Chain section of this documentation.
ABI
In order to interact with the GDAv1Forwarder
contract, you can use the following ABI:
Click here to show GDAv1Forwarder
ABI
[
{
"inputs": [
{
"internalType": "contract ISuperfluid",
"name": "host",
"type": "address"
}
],
"stateMutability": "nonpayable",
"type": "constructor"
},
{
"inputs": [
{
"internalType": "contract ISuperfluidPool",
"name": "pool",
"type": "address"
},
{ "internalType": "address", "name": "memberAddress", "type": "address" },
{ "internalType": "bytes", "name": "userData", "type": "bytes" }
],
"name": "claimAll",
"outputs": [{ "internalType": "bool", "name": "success", "type": "bool" }],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "contract ISuperfluidPool",
"name": "pool",
"type": "address"
},
{ "internalType": "bytes", "name": "userData", "type": "bytes" }
],
"name": "connectPool",
"outputs": [{ "internalType": "bool", "name": "", "type": "bool" }],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "contract ISuperfluidToken",
"name": "token",
"type": "address"
},
{ "internalType": "address", "name": "admin", "type": "address" },
{
"components": [
{
"internalType": "bool",
"name": "transferabilityForUnitsOwner",
"type": "bool"
},
{
"internalType": "bool",
"name": "distributionFromAnyAddress",
"type": "bool"
}
],
"internalType": "struct PoolConfig",
"name": "config",
"type": "tuple"
}
],
"name": "createPool",
"outputs": [
{ "internalType": "bool", "name": "success", "type": "bool" },
{
"internalType": "contract ISuperfluidPool",
"name": "pool",
"type": "address"
}
],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "contract ISuperfluidPool",
"name": "pool",
"type": "address"
},
{ "internalType": "bytes", "name": "userData", "type": "bytes" }
],
"name": "disconnectPool",
"outputs": [{ "internalType": "bool", "name": "", "type": "bool" }],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "contract ISuperfluidToken",
"name": "token",
"type": "address"
},
{ "internalType": "address", "name": "from", "type": "address" },
{
"internalType": "contract ISuperfluidPool",
"name": "pool",
"type": "address"
},
{
"internalType": "uint256",
"name": "requestedAmount",
"type": "uint256"
},
{ "internalType": "bytes", "name": "userData", "type": "bytes" }
],
"name": "distribute",
"outputs": [{ "internalType": "bool", "name": "", "type": "bool" }],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "contract ISuperfluidToken",
"name": "token",
"type": "address"
},
{ "internalType": "address", "name": "from", "type": "address" },
{
"internalType": "contract ISuperfluidPool",
"name": "pool",
"type": "address"
},
{ "internalType": "int96", "name": "requestedFlowRate", "type": "int96" },
{ "internalType": "bytes", "name": "userData", "type": "bytes" }
],
"name": "distributeFlow",
"outputs": [{ "internalType": "bool", "name": "", "type": "bool" }],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "contract ISuperfluidToken",
"name": "token",
"type": "address"
},
{ "internalType": "address", "name": "from", "type": "address" },
{
"internalType": "contract ISuperfluidPool",
"name": "to",
"type": "address"
},
{
"internalType": "uint256",
"name": "requestedAmount",
"type": "uint256"
}
],
"name": "estimateDistributionActualAmount",
"outputs": [
{ "internalType": "uint256", "name": "actualAmount", "type": "uint256" }
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "contract ISuperfluidToken",
"name": "token",
"type": "address"
},
{ "internalType": "address", "name": "from", "type": "address" },
{
"internalType": "contract ISuperfluidPool",
"name": "to",
"type": "address"
},
{ "internalType": "int96", "name": "requestedFlowRate", "type": "int96" }
],
"name": "estimateFlowDistributionActualFlowRate",
"outputs": [
{ "internalType": "int96", "name": "actualFlowRate", "type": "int96" },
{
"internalType": "int96",
"name": "totalDistributionFlowRate",
"type": "int96"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "contract ISuperfluidToken",
"name": "token",
"type": "address"
},
{ "internalType": "address", "name": "from", "type": "address" },
{
"internalType": "contract ISuperfluidPool",
"name": "to",
"type": "address"
}
],
"name": "getFlowDistributionFlowRate",
"outputs": [{ "internalType": "int96", "name": "", "type": "int96" }],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "contract ISuperfluidToken",
"name": "token",
"type": "address"
},
{ "internalType": "address", "name": "account", "type": "address" }
],
"name": "getNetFlow",
"outputs": [{ "internalType": "int96", "name": "", "type": "int96" }],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "contract ISuperfluidPool",
"name": "pool",
"type": "address"
}
],
"name": "getPoolAdjustmentFlowInfo",
"outputs": [
{ "internalType": "address", "name": "", "type": "address" },
{ "internalType": "bytes32", "name": "", "type": "bytes32" },
{ "internalType": "int96", "name": "", "type": "int96" }
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{ "internalType": "address", "name": "pool", "type": "address" }
],
"name": "getPoolAdjustmentFlowRate",
"outputs": [{ "internalType": "int96", "name": "", "type": "int96" }],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "contract ISuperfluidPool",
"name": "pool",
"type": "address"
},
{ "internalType": "address", "name": "member", "type": "address" }
],
"name": "isMemberConnected",
"outputs": [{ "internalType": "bool", "name": "", "type": "bool" }],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "contract ISuperfluidToken",
"name": "token",
"type": "address"
},
{ "internalType": "address", "name": "account", "type": "address" }
],
"name": "isPool",
"outputs": [{ "internalType": "bool", "name": "", "type": "bool" }],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "contract ISuperfluidPool",
"name": "pool",
"type": "address"
},
{ "internalType": "address", "name": "memberAddress", "type": "address" },
{ "internalType": "uint128", "name": "newUnits", "type": "uint128" },
{ "internalType": "bytes", "name": "userData", "type": "bytes" }
],
"name": "updateMemberUnits",
"outputs": [{ "internalType": "bool", "name": "success", "type": "bool" }],
"stateMutability": "nonpayable",
"type": "function"
}
]
_gda
contract IGeneralDistributionAgreementV1 _gda
Fn constructor
function constructor(
contract ISuperfluid host
)
public
Parameters
Name | Type | Description |
---|---|---|
host | contract ISuperfluid |
Fn createPool
Creates a new Superfluid Pool.
Parameters
Name | Type | Description |
---|---|---|
token | contract ISuperfluidToken | The Super Token address. |
admin | address | The pool admin address. |
config | struct PoolConfig | The pool configuration (see PoolConfig in IGeneralDistributionAgreementV1.sol) |
Return Values
Name | Type | Description |
---|---|---|
success | bool | A boolean value indicating whether the pool was created successfully. |
pool | contract ISuperfluidPool | The address of the deployed Superfluid Pool |
Fn updateMemberUnits
Updates the units of a pool member.
Parameters
Name | Type | Description |
---|---|---|
pool | contract ISuperfluidPool | The Superfluid Pool to update. |
memberAddress | address | The address of the member to update. |
newUnits | uint128 | The new units of the member. |
userData | bytes | User-specific data. |
Fn claimAll
Claims all tokens from the pool.
Parameters
Name | Type | Description |
---|---|---|
pool | contract ISuperfluidPool | The Superfluid Pool to claim from. |
memberAddress | address | The address of the member to claim for. |
userData | bytes | User-specific data. |
Fn connectPool
Connects a pool member to pool
.
Parameters
Name | Type | Description |
---|---|---|
pool | contract ISuperfluidPool | The Superfluid Pool to connect. |
userData | bytes | User-specific data. |
Return Values
Name | Type | Description |
---|---|---|
[0] | bool | A boolean value indicating whether the connection was successful. |
Fn disconnectPool
Disconnects a pool member from pool
.
Parameters
Name | Type | Description |
---|---|---|
pool | contract ISuperfluidPool | The Superfluid Pool to disconnect. |
userData | bytes | User-specific data. |
Return Values
Name | Type | Description |
---|---|---|
[0] | bool | A boolean value indicating whether the disconnection was successful. |
Fn distribute
Tries to distribute requestedAmount
amount of token
from from
to pool
.
Parameters
Name | Type | Description |
---|---|---|
token | contract ISuperfluidToken | The Super Token address. |
from | address | The address from which to distribute tokens. |
pool | contract ISuperfluidPool | The Superfluid Pool address. |
requestedAmount | uint256 | The amount of tokens to distribute. |
userData | bytes | User-specific data. |
Return Values
Name | Type | Description |
---|---|---|
[0] | bool | A boolean value indicating whether the distribution was successful. |
Fn distributeFlow
Tries to distribute flow at requestedFlowRate
of token
from from
to pool
.
Parameters
Name | Type | Description |
---|---|---|
token | contract ISuperfluidToken | The Super Token address. |
from | address | The address from which to distribute tokens. |
pool | contract ISuperfluidPool | The Superfluid Pool address. |
requestedFlowRate | int96 | The flow rate of tokens to distribute. |
userData | bytes | User-specific data. |
Return Values
Name | Type | Description |
---|---|---|
[0] | bool | A boolean value indicating whether the distribution was successful. |
Fn isPool
Checks if the specified account is a pool.
Parameters
Name | Type | Description |
---|---|---|
token | contract ISuperfluidToken | The Super Token address. |
account | address | The account address to check. |
Return Values
Name | Type | Description |
---|---|---|
[0] | bool | A boolean value indicating whether the account is a pool. |
Fn getNetFlow
Gets the GDA net flow rate for the specified account.
Parameters
Name | Type | Description |
---|---|---|
token | contract ISuperfluidToken | The Super Token address. |
account | address | The account address. |
Return Values
Name | Type | Description |
---|---|---|
[0] | int96 | The gda net flow rate for the account. |
Fn getFlowDistributionFlowRate
Gets the flow rate of tokens between the specified accounts.
Parameters
Name | Type | Description |
---|---|---|
token | contract ISuperfluidToken | The Super Token address. |
from | address | The sender address. |
to | contract ISuperfluidPool | The receiver address (the pool address). |
Return Values
Name | Type | Description |
---|---|---|
[0] | int96 | The flow distribution flow rate |
Fn getPoolAdjustmentFlowRate
Gets the pool adjustment flow rate for the specified pool.
Parameters
Name | Type | Description |
---|---|---|
pool | address | The pool address. |
Return Values
Name | Type | Description |
---|---|---|
[0] | int96 | The pool adjustment flow rate. |
Fn estimateFlowDistributionActualFlowRate
Estimates the actual flow rate for flow distribution to the specified pool.
Parameters
Name | Type | Description |
---|---|---|
token | contract ISuperfluidToken | The Super Token address. |
from | address | The sender address. |
to | contract ISuperfluidPool | The pool address. |
requestedFlowRate | int96 | The requested flow rate. |
Return Values
Name | Type | Description |
---|---|---|
actualFlowRate | int96 | |
totalDistributionFlowRate | int96 |
Fn estimateDistributionActualAmount
Estimates the actual amount for distribution to the specified pool.
Parameters
Name | Type | Description |
---|---|---|
token | contract ISuperfluidToken | The Super Token address. |
from | address | The sender address. |
to | contract ISuperfluidPool | The pool address. |
requestedAmount | uint256 | The requested amount. |
Return Values
Name | Type | Description |
---|---|---|
actualAmount | uint256 | The actual amount for distribution. |
Fn isMemberConnected
Checks if the specified member is connected to the pool.
Parameters
Name | Type | Description |
---|---|---|
pool | contract ISuperfluidPool | The Superfluid Pool address. |
member | address | The member address. |
Return Values
Name | Type | Description |
---|---|---|
[0] | bool | A boolean value indicating whether the member is connected to the pool. |
Fn getPoolAdjustmentFlowInfo
Gets the pool adjustment flow information for the specified pool.
Parameters
Name | Type | Description |
---|---|---|
pool | contract ISuperfluidPool | The pool address. |
Return Values
Name | Type | Description |
---|---|---|
[0] | address | The pool admin, pool ID, and pool adjustment flow rate. |
[1] | bytes32 | |
[2] | int96 |