Search…
⌃K

OrgFundFactory

This contract is the factory for both the Org and Fund objects.

Methods

ETH_PLACEHOLDER

function ETH_PLACEHOLDER() external view returns (address)
Placeholder address used in swapping method to denote usage of ETH instead of a token.

Returns

Name
Type
Description
_0
address
undefined

baseToken

function baseToken() external view returns (contract ERC20)
Base Token address is the stable coin used throughout the system.

Returns

Name
Type
Description
_0
contract ERC20
undefined

computeFundAddress

function computeFundAddress(bytes32 _salt) external view returns (address)
Calculates a Fund contract's deployment address.
This function is used off-chain by the automated tests to verify proper contract address deployment.

Parameters

Name
Type
Description
_salt
bytes32
A 32-byte value used to create the contract at a deterministic address.

Returns

Name
Type
Description
_0
address
The Fund's deployment address.

computeOrgAddress

function computeOrgAddress(bytes32 _salt) external view returns (address)
Calculates an Org contract's deployment address.
This function is used off-chain by the automated tests to verify proper contract address deployment.

Parameters

Name
Type
Description
_salt
bytes32
A 32-byte value used to create the contract at a deterministic address.

Returns

Name
Type
Description
_0
address
The Org's deployment address.

deployFund

function deployFund(address _manager, bytes32 _salt) external nonpayable returns (contract Fund _fund)
Deploys a Fund.

Parameters

Name
Type
Description
_manager
address
The address of the Fund's manager.
_salt
bytes32
A 32-byte value used to create the contract at a deterministic address.

Returns

Name
Type
Description
_fund
contract Fund
The deployed Fund.

deployFundAndDonate

function deployFundAndDonate(address _manager, bytes32 _salt, uint256 _amount) external nonpayable returns (contract Fund _fund)
Deploys a Fund then pulls base token from the sender and donates to it.

Parameters

Name
Type
Description
_manager
address
The address of the Fund's manager.
_salt
bytes32
A 32-byte value used to create the contract at a deterministic address.
_amount
uint256
The amount of base token to donate.

Returns

Name
Type
Description
_fund
contract Fund
The deployed Fund.

deployFundSwapAndDonate

function deployFundSwapAndDonate(address _manager, bytes32 _salt, contract ISwapWrapper _swapWrapper, address _tokenIn, uint256 _amountIn, bytes _data) external payable returns (contract Fund _fund)
Deploys a new Fund, then pulls a ETH or ERC20 tokens, swaps them to base tokens, and donates to the new Fund.

Parameters

Name
Type
Description
_manager
address
The address of the Fund's manager.
_salt
bytes32
A 32-byte value used to create the contract at a deterministic address.
_swapWrapper
contract ISwapWrapper
The swap wrapper to use for the donation. Must be whitelisted on the Registry.
_tokenIn
address
The address of the ERC20 token to swap and donate, or ETH_PLACEHOLDER if donating ETH.
_amountIn
uint256
The amount of tokens or ETH being swapped and donated.
_data
bytes
Additional call data required by the ISwapWrapper being used.

Returns

Name
Type
Description
_fund
contract Fund
The deployed Fund.

deployOrg

function deployOrg(bytes32 _orgId, bytes32 _salt) external nonpayable returns (contract Org _org)
Deploys an Org.

Parameters

Name
Type
Description
_orgId
bytes32
The Org's ID for tax purposes.
_salt
bytes32
A 32-byte value used to create the contract at a deterministic address.

Returns

Name
Type
Description
_org
contract Org
The deployed Org.

deployOrgAndDonate

function deployOrgAndDonate(bytes32 _orgId, bytes32 _salt, uint256 _amount) external nonpayable returns (contract Org _org)
Deploys an Org then pulls base token from the sender and donates to it.

Parameters

Name
Type
Description
_orgId
bytes32
The Org's ID for tax purposes.
_salt
bytes32
A 32-byte value used to create the contract at a deterministic address.
_amount
uint256
The amount of base token to donate.

Returns

Name
Type
Description
_org
contract Org
The deployed Org.

deployOrgSwapAndDonate

function deployOrgSwapAndDonate(bytes32 _orgId, bytes32 _salt, contract ISwapWrapper _swapWrapper, address _tokenIn, uint256 _amountIn, bytes _data) external payable returns (contract Org _org)
Deploys a new Org, then pulls a ETH or ERC20 tokens, swaps them to base tokens, and donates to the new Org.

Parameters

Name
Type
Description
_orgId
bytes32
The Org's ID for tax purposes.
_salt
bytes32
A 32-byte value used to create the contract at a deterministic address.
_swapWrapper
contract ISwapWrapper
The swap wrapper to use for the donation. Must be whitelisted on the Registry.
_tokenIn
address
The address of the ERC20 token to swap and donate, or ETH_PLACEHOLDER if donating ETH.
_amountIn
uint256
The amount of tokens or ETH being swapped and donated.
_data
bytes
Additional call data required by the ISwapWrapper being used.

Returns

Name
Type
Description
_org
contract Org
The deployed Org.

fundImplementation

function fundImplementation() external view returns (contract Fund)
The concrete Fund used for minimal proxy deployment.

Returns

Name
Type
Description
_0
contract Fund
undefined

orgImplementation

function orgImplementation() external view returns (contract Org)
The concrete Org used for minimal proxy deployment.

Returns

Name
Type
Description
_0
contract Org
undefined

registry

function registry() external view returns (contract Registry)
_registry The registry to host the Entity.

Returns

Name
Type
Description
_0
contract Registry
undefined

Events

EntityDeployed

event EntityDeployed(address indexed entity, uint8 indexed entityType, address indexed entityManager)
Emitted when an Entity is deployed.

Parameters

Name
Type
Description
entity indexed
address
undefined
entityType indexed
uint8
undefined
entityManager indexed
address
undefined