https://github.com/johnexzy/give2wild-defi
A crypto donation system that aims to help wildlife conservancies raise funds
https://github.com/johnexzy/give2wild-defi
Last synced: 8 months ago
JSON representation
A crypto donation system that aims to help wildlife conservancies raise funds
- Host: GitHub
- URL: https://github.com/johnexzy/give2wild-defi
- Owner: johnexzy
- Created: 2022-11-20T23:19:05.000Z (almost 3 years ago)
- Default Branch: feats
- Last Pushed: 2022-11-20T23:20:10.000Z (almost 3 years ago)
- Last Synced: 2025-01-23T04:17:12.582Z (9 months ago)
- Language: TypeScript
- Homepage:
- Size: 1.32 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# MaraScan Contract
This contract was written in purpose of a Hackathon. Security issues may not be analyzed correctly, use cautiosly
## Concepts of the MaraScan Contract?
- It is an upgradeable UUPS contract
- Accepts USDC (central cuurency) Token from donor and disbures equally to beneficiaries
- Accepts ETH from donor, swaps Exact ETH to USDC and disbures equally to beneficiaries
- Accepts anyother approved tokens and swap Exact Token to USDC and disbures equally to beneficiaries
### Disburesement
```typescript
function _disburseToken(
address _tokenAddress,
uint256 _amount,
address[] calldata _beneficiaries,
bytes memory _category
) internal {
uint256 amountPerBeneficiary = _amount / _beneficiaries.length;
for (uint256 index = 0; index < _beneficiaries.length; index++) {
require(
ERC20(_tokenAddress).transfer(
_beneficiaries[index],
amountPerBeneficiary
),
"Unable to transfer token"
);
}
// Disbursement ends
// Mint Badge
IBadges(BADGE).mintBadge(0, msg.sender, _category);
emit Disbursed(msg.sender, _amount, _beneficiaries);
}
```
Upon disbursement of USDC, an ERC1155 is minted to Donor.
```typescript
IBadges(BADGE).mintBadge(0, msg.sender, _category);
```
### Thirdparty Contract
- UNISWAPV2ROUTER
- BADGE CONTRACT