Skip to main content

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

NameTypeDescription
hostcontract ISuperfluid

Fn createPool

Creates a new Superfluid Pool.

Parameters

NameTypeDescription
tokencontract ISuperfluidTokenThe Super Token address.
adminaddressThe pool admin address.
configstruct PoolConfigThe pool configuration (see PoolConfig in IGeneralDistributionAgreementV1.sol)

Return Values

NameTypeDescription
successboolA boolean value indicating whether the pool was created successfully.
poolcontract ISuperfluidPoolThe address of the deployed Superfluid Pool

Fn updateMemberUnits

Updates the units of a pool member.

Parameters

NameTypeDescription
poolcontract ISuperfluidPoolThe Superfluid Pool to update.
memberAddressaddressThe address of the member to update.
newUnitsuint128The new units of the member.
userDatabytesUser-specific data.

Fn claimAll

Claims all tokens from the pool.

Parameters

NameTypeDescription
poolcontract ISuperfluidPoolThe Superfluid Pool to claim from.
memberAddressaddressThe address of the member to claim for.
userDatabytesUser-specific data.

Fn connectPool

Connects a pool member to pool.

Parameters

NameTypeDescription
poolcontract ISuperfluidPoolThe Superfluid Pool to connect.
userDatabytesUser-specific data.

Return Values

NameTypeDescription
[0]boolA boolean value indicating whether the connection was successful.

Fn disconnectPool

Disconnects a pool member from pool.

Parameters

NameTypeDescription
poolcontract ISuperfluidPoolThe Superfluid Pool to disconnect.
userDatabytesUser-specific data.

Return Values

NameTypeDescription
[0]boolA boolean value indicating whether the disconnection was successful.

Fn distribute

Tries to distribute requestedAmount amount of token from from to pool.

Parameters

NameTypeDescription
tokencontract ISuperfluidTokenThe Super Token address.
fromaddressThe address from which to distribute tokens.
poolcontract ISuperfluidPoolThe Superfluid Pool address.
requestedAmountuint256The amount of tokens to distribute.
userDatabytesUser-specific data.

Return Values

NameTypeDescription
[0]boolA boolean value indicating whether the distribution was successful.

Fn distributeFlow

Tries to distribute flow at requestedFlowRate of token from from to pool.

Parameters

NameTypeDescription
tokencontract ISuperfluidTokenThe Super Token address.
fromaddressThe address from which to distribute tokens.
poolcontract ISuperfluidPoolThe Superfluid Pool address.
requestedFlowRateint96The flow rate of tokens to distribute.
userDatabytesUser-specific data.

Return Values

NameTypeDescription
[0]boolA boolean value indicating whether the distribution was successful.

Fn isPool

Checks if the specified account is a pool.

Parameters

NameTypeDescription
tokencontract ISuperfluidTokenThe Super Token address.
accountaddressThe account address to check.

Return Values

NameTypeDescription
[0]boolA boolean value indicating whether the account is a pool.

Fn getNetFlow

Gets the GDA net flow rate for the specified account.

Parameters

NameTypeDescription
tokencontract ISuperfluidTokenThe Super Token address.
accountaddressThe account address.

Return Values

NameTypeDescription
[0]int96The gda net flow rate for the account.

Fn getFlowDistributionFlowRate

Gets the flow rate of tokens between the specified accounts.

Parameters

NameTypeDescription
tokencontract ISuperfluidTokenThe Super Token address.
fromaddressThe sender address.
tocontract ISuperfluidPoolThe receiver address (the pool address).

Return Values

NameTypeDescription
[0]int96The flow distribution flow rate

Fn getPoolAdjustmentFlowRate

Gets the pool adjustment flow rate for the specified pool.

Parameters

NameTypeDescription
pooladdressThe pool address.

Return Values

NameTypeDescription
[0]int96The pool adjustment flow rate.

Fn estimateFlowDistributionActualFlowRate

Estimates the actual flow rate for flow distribution to the specified pool.

Parameters

NameTypeDescription
tokencontract ISuperfluidTokenThe Super Token address.
fromaddressThe sender address.
tocontract ISuperfluidPoolThe pool address.
requestedFlowRateint96The requested flow rate.

Return Values

NameTypeDescription
actualFlowRateint96
totalDistributionFlowRateint96

Fn estimateDistributionActualAmount

Estimates the actual amount for distribution to the specified pool.

Parameters

NameTypeDescription
tokencontract ISuperfluidTokenThe Super Token address.
fromaddressThe sender address.
tocontract ISuperfluidPoolThe pool address.
requestedAmountuint256The requested amount.

Return Values

NameTypeDescription
actualAmountuint256The actual amount for distribution.

Fn isMemberConnected

Checks if the specified member is connected to the pool.

Parameters

NameTypeDescription
poolcontract ISuperfluidPoolThe Superfluid Pool address.
memberaddressThe member address.

Return Values

NameTypeDescription
[0]boolA boolean value indicating whether the member is connected to the pool.

Fn getPoolAdjustmentFlowInfo

Gets the pool adjustment flow information for the specified pool.

Parameters

NameTypeDescription
poolcontract ISuperfluidPoolThe pool address.

Return Values

NameTypeDescription
[0]addressThe pool admin, pool ID, and pool adjustment flow rate.
[1]bytes32
[2]int96