name: DonateWithFeedback
description: ""
structs:
  Donation:
    amount: Uint64 # amount donated
    donator: AgentID # who donated
    error: String # error to be reported to donator if anything goes wrong
    feedback: String # the feedback for the person donated to
    timestamp: Uint64 # when the donation took place
typedefs: {}
state:
  log: Donation[]
  maxDonation: Uint64
  owner: AgentID
  totalDonation: Uint64
funcs:
  init:
    params:
      owner: AgentID?
  donate:
    params:
      feedback: String? # feedback for the person you donate to
  withdraw:
    access: owner # only SC owner can withdraw donated funds
    params:
      amount: Uint64? # amount to withdraw
views:
  donation:
    params:
      nr: Uint32
    results:
      amount: Uint64 # amount donated
      donator: AgentID # who donated
      error: String # error to be reported to donator if anything goes wrong
      feedback: String # the feedback for the person donated to
      timestamp: Uint64 # when the donation took place
  donationInfo:
    results:
      count: Uint32
      maxDonation: Uint64
      totalDonation: Uint64
