Search…
Fund.sol
A Fund contract serves as an on-chain US Donor-Advised Fund. It holds the proceeds of gifted cryptocurrency as ERC20 tokens and allows for the manager to submit Grant recommendations to the contract. The EndaomentAdmin can then chose to approve the Grant recommendation, triggering a SafeMath transfer of a 1% fee to the EndaomentAdmin and the remainder to the recipient Org contract.

Methods

constructor(address fundManager, address fundFactory) - public

Creates new Fund
Parameters:
  • fundManager: Address of the Fund's Primary Advisor
  • fundFactory: Address of the Factory contract.

changeManager(address newManager) - public

Changes Fund Primary Advisor and emits a ManagerChanged event
Parameters:
  • newManager: The address of the new PrimaryAdvisor.

checkRecipient(address recipient, address orgFactoryContractAddress) → bool - public

Checks recipient of a Grant is an address created by the OrgFactory
Parameters:
  • recipient: The address of the Grant recipient.
  • orgFactoryContractAddress: Address of the OrgFactory contract.

getSummary(address tokenAddress) → uint256, address - external

Returns summary of details about the fund [tokenBalance, number of grants, managerAddress].
Parameters:
  • tokenAddress: The token address of the ERC20 being used by the web server.

createGrant(string grantId, string description, uint256 value, address recipient) - public

Creates new Grant Recommendation and emits a GrantCreated event.
Parameters:
  • grantId: UUID representing this grant
  • description: The address of the Owner.
  • value: The value of the grant in base units.
  • recipient: The address of the receiving organization's contract.

updateGrant(string grantId, string description, uint256 value, address recipient) - public

Updates Grant Recommendation and emits a GrantUpdated event.
Parameters:
  • grantId: UUID representing this grant
  • description: The address of the Owner.
  • value: The value of the grant in base units.
  • recipient: The address of the receiving organization's contract.

rejectGrant(string grantId) - public

Rejects Grant Recommendation and emits a GrantRejected event.
Parameters:
  • grantId: UUID representing this grant

finalizeGrant(string grantId, address tokenAddress) - public

Approves Grant Recommendation and emits a GrantFinalized event.
Parameters:
  • grantId: UUID of the grant being finalized
  • tokenAddress: The ERC20 token address of the token prescribed by the web server.

Events

  • ManagerChanged(address newManager)
  • GrantCreated(string grantId, struct Fund.Grant grant)
  • GrantUpdated(string grantId, struct Fund.Grant grant)
  • GrantRejected(string grantId)
  • GrantFinalized(string grantId, struct Fund.Grant grant)
Last modified 9mo ago
Export as PDF
Copy link