Right now we handle token transfer on the frontend, we want to move this action to the contract. Implement openzeppelin_token erc20 token component and use the transfer function to handle token transfer after donation.
Then update self.donations.write(campaign_address, amount); with the amount donated.
Add a new storage map donation details
Right now we handle token transfer on the frontend, we want to move this action to the contract. Implement openzeppelin_token erc20 token component and use the transfer function to handle token transfer after donation.
Then update
self.donations.write(campaign_address, amount);
with the amount donated. Add a new storage map donation detailsEmit donation event with following fields.