Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Frontend dk #91

Open
wants to merge 90 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
90 commits
Select commit Hold shift + click to select a range
d41983a
Updates the ReadMe
anthonykimani Sep 28, 2022
745ed77
initial commit
Ronexlemon Oct 3, 2022
6dda53c
initialise hardhat
Ronexlemon Oct 3, 2022
d35b5af
added the rehemaTokens Mint contract
Ronexlemon Oct 3, 2022
b53f4f2
added the joincommunity contract
Ronexlemon Oct 3, 2022
3cd6a43
Merge pull request #1 from Ronexlemon/Backend
Ronexlemon Oct 3, 2022
fc9705d
Merge pull request #1 from anthonykimani/main
Ronexlemon Oct 3, 2022
943be4c
combine RehemaMint Ang Join Community contracts
Ronexlemon Oct 3, 2022
3fafe8a
Merge pull request #2 from Ronexlemon/Backend
Ronexlemon Oct 3, 2022
5e13b50
added the donate cUSD contract
Ronexlemon Oct 3, 2022
786bde0
Merge pull request #3 from Ronexlemon/Backend
Ronexlemon Oct 3, 2022
0eff10b
Merge pull request #4 from Ronexlemon/main
Ronexlemon Oct 3, 2022
878c44d
Merge pull request #2 from anthonykimani/main
Ronexlemon Oct 3, 2022
0153aa8
Add a navbar
anthonykimani Oct 6, 2022
5f733b7
Merge branch 'main' of github.com:anthonykimani/build-with-celo-hacka…
anthonykimani Oct 6, 2022
6745fe5
completes landing page
anthonykimani Oct 6, 2022
21f377a
Merge branch 'anthonykimani:main' into main
Ronexlemon Oct 10, 2022
b8287e5
modify the contracts
Ronexlemon Oct 10, 2022
ddc1429
added the tumaini Dao
Ronexlemon Oct 10, 2022
8a850d5
include new dependecies
Ronexlemon Oct 10, 2022
feb800d
Merge pull request #5 from Ronexlemon/contracts
Ronexlemon Oct 10, 2022
d22ed47
Merge pull request #3 from anthonykimani/main
Ronexlemon Oct 10, 2022
e2d525f
deployed the contracts
Ronexlemon Oct 12, 2022
63729d0
Merge pull request #6 from Ronexlemon/contracts
Ronexlemon Oct 13, 2022
46b57a0
Merge pull request #7 from Ronexlemon/main
Ronexlemon Oct 13, 2022
4e9bff2
Merge pull request #4 from anthonykimani/main
Ronexlemon Oct 13, 2022
169c01d
Adds Proposal section and more styling
anthonykimani Oct 16, 2022
61520b5
Adds Proposal section and more styling
anthonykimani Oct 16, 2022
c9788c8
Adds new proposal modal,proposal components and an individual proposa…
anthonykimani Oct 17, 2022
4aafe3f
Merge pull request #5 from anthonykimani/main
Ronexlemon Oct 18, 2022
4fc9dad
include overide config file
Ronexlemon Oct 18, 2022
9e70dac
implement the connect button
Ronexlemon Oct 18, 2022
777f076
added useeffect on page reload to get the address of the proposer
Ronexlemon Oct 18, 2022
518b11f
added the contract json files
Ronexlemon Oct 18, 2022
a9ec64e
Merge pull request #8 from Ronexlemon/createProposal
Ronexlemon Oct 18, 2022
d988f4d
Merge pull request #6 from anthonykimani/main
Ronexlemon Oct 18, 2022
883952c
Adds the mint Tokens Buttons and input field for minting a token
anthonykimani Oct 19, 2022
f2895f5
Update with input field for minting tokens
anthonykimani Oct 19, 2022
5004350
Merge pull request #9 from Ronexlemon/main
Ronexlemon Oct 19, 2022
8a6c924
Merge pull request #7 from anthonykimani/development
Ronexlemon Oct 19, 2022
5b3578a
Merge pull request #10 from Ronexlemon/main
Ronexlemon Oct 19, 2022
9fca3e0
minor change
Ronexlemon Oct 19, 2022
a17c1fb
Merge branch 'main' of https://github.com/Ronexlemon/build-with-celo-…
Ronexlemon Oct 19, 2022
7b66b80
Merge pull request #8 from anthonykimani/main
Ronexlemon Oct 19, 2022
8b1c56a
Merge branch 'main' of https://github.com/Ronexlemon/build-with-celo-…
Ronexlemon Oct 19, 2022
5ccc851
fix merge issues
Ronexlemon Oct 19, 2022
28ee5e3
Merge pull request #11 from Ronexlemon/main
Ronexlemon Oct 19, 2022
52f25d5
implement rehema tokens
Ronexlemon Oct 19, 2022
a2d54a6
activate rehema tokens in the joincommunity
Ronexlemon Oct 19, 2022
c772737
Merge pull request #12 from Ronexlemon/rehematokenmint
Ronexlemon Oct 19, 2022
57d8fad
implement the join community use case
Ronexlemon Oct 19, 2022
5663150
add get user balance function
Ronexlemon Oct 19, 2022
edea35f
Merge pull request #13 from Ronexlemon/joincommunity
Ronexlemon Oct 19, 2022
dd84572
Merge pull request #9 from anthonykimani/main
Ronexlemon Oct 19, 2022
067beda
modify the dao abi json
Ronexlemon Oct 20, 2022
d3cd5f9
implement makestakeholder functionality
Ronexlemon Oct 20, 2022
36cd296
fix contract address
Ronexlemon Oct 20, 2022
ec0242f
Merge pull request #14 from Ronexlemon/main
Ronexlemon Oct 20, 2022
81af063
Merge pull request #15 from Ronexlemon/daoimplementation
Ronexlemon Oct 20, 2022
8898647
Merge pull request #10 from anthonykimani/main
Ronexlemon Oct 20, 2022
a784fa2
update the dao contract
Ronexlemon Oct 21, 2022
5d2fd5c
implement write to the dao
Ronexlemon Oct 21, 2022
c0a4f50
implement the add proposal functionality
Ronexlemon Oct 21, 2022
16b6e26
Merge pull request #16 from Ronexlemon/daoimplementation
Ronexlemon Oct 21, 2022
99a188c
Merge pull request #11 from anthonykimani/main
Ronexlemon Oct 21, 2022
76ae4f5
implement voting
Ronexlemon Oct 28, 2022
1304e8c
modify the dao contract
Ronexlemon Oct 28, 2022
1dcfdc3
change the dao contract
Ronexlemon Oct 28, 2022
730f37c
modify the piechart options
Ronexlemon Oct 28, 2022
e47d041
implement voting functionality
Ronexlemon Oct 28, 2022
694433d
Merge pull request #17 from Ronexlemon/DaoVoteimpelementation
Ronexlemon Oct 28, 2022
d397d42
Merge pull request #12 from anthonykimani/main
Ronexlemon Oct 28, 2022
9dd4e73
modify the reject functionality
Ronexlemon Nov 1, 2022
f85fb45
Merge pull request #18 from Ronexlemon/main
Ronexlemon Nov 1, 2022
1dd3f40
Adds a community page
anthonykimani Nov 3, 2022
3b3e758
modification
Ronexlemon Nov 3, 2022
3eca11b
Merge branch 'main' into passdatatoproposalcard
Ronexlemon Nov 3, 2022
76d5fd6
Merge pull request #19 from Ronexlemon/passdatatoproposalcard
Ronexlemon Nov 3, 2022
23b6172
Merge pull request #13 from anthonykimani/main
Ronexlemon Nov 3, 2022
ad31f96
implement comunity page
Ronexlemon Nov 4, 2022
9b488f3
implement community
Ronexlemon Nov 4, 2022
7455d14
Merge pull request #20 from Ronexlemon/community
Ronexlemon Nov 4, 2022
5fed6d0
fix: set user address to navbar
Nov 12, 2022
d087ccc
style: style address button
Nov 12, 2022
ce4e696
style: style proposal page
Nov 12, 2022
6e70142
style: style voting buttons
Nov 12, 2022
858dfb5
style: style proposal cards
Nov 12, 2022
d03257d
style: reduce navbar links size
Nov 12, 2022
d396e51
feat: style new proposl modal
Nov 12, 2022
70a15f4
style: style community page
Nov 12, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions BACKENDHARDHAT/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
node_modules
.env
coverage
coverage.json
typechain
typechain-types

#Hardhat files
cache
artifacts

13 changes: 13 additions & 0 deletions BACKENDHARDHAT/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Sample Hardhat Project

This project demonstrates a basic Hardhat use case. It comes with a sample contract, a test for that contract, and a script that deploys that contract.

Try running some of the following tasks:

```shell
npx hardhat help
npx hardhat test
REPORT_GAS=true npx hardhat test
npx hardhat node
npx hardhat run scripts/deploy.js
```
34 changes: 34 additions & 0 deletions BACKENDHARDHAT/contracts/Lock.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
// SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.9;

// Uncomment this line to use console.log
// import "hardhat/console.sol";

contract Lock {
uint public unlockTime;
address payable public owner;

event Withdrawal(uint amount, uint when);

constructor(uint _unlockTime) payable {
require(
block.timestamp < _unlockTime,
"Unlock time should be in the future"
);

unlockTime = _unlockTime;
owner = payable(msg.sender);
}

function withdraw() public {
// Uncomment this line, and the import of "hardhat/console.sol", to print a log in your terminal
// console.log("Unlock time is %o and block timestamp is %o", unlockTime, block.timestamp);

require(block.timestamp >= unlockTime, "You can't withdraw yet");
require(msg.sender == owner, "You aren't the owner");

emit Withdrawal(address(this).balance, block.timestamp);

owner.transfer(address(this).balance);
}
}
50 changes: 50 additions & 0 deletions BACKENDHARDHAT/contracts/SendcUSD.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
// SPDX-License-Identifier: MIT
pragma solidity ^ 0.8.2;
interface IERC20Token {
function transfer(address, uint256) external returns (bool);
function approve(address, uint256) external returns (bool);
function transferFrom(address, address, uint256) external returns (bool);
function totalSupply() external view returns (uint256);
function balanceOf(address) external view returns (uint256);
function allowance(address, address) external view returns (uint256);

event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
contract sendCeloOrEth{
uint testbalance ;
address payable receiver;
address payable owner;
event Transfer(address indexed from, address indexed to, uint256 value);
address internal cUsdTokenAddress = 0x874069Fa1Eb16D44d622F2e0Ca25eeA172369bC1;

// constructor(){
// owner = payable (msg.sender);
// }

function donatecUSD( address payable _receiver)public payable {
receiver = _receiver;

_receiver.transfer(msg.value);





}
function checkBalance() public view returns(uint){
return IERC20Token(cUsdTokenAddress).balanceOf(msg.sender);
}

function getbalanceofreceiver()public view returns(uint){
return IERC20Token(cUsdTokenAddress).balanceOf(receiver);
}

receive() external payable {
// React to receiving ether
}
fallback() external payable {
// React to receiving ether
}

}
86 changes: 86 additions & 0 deletions BACKENDHARDHAT/contracts/joincommunity.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
// SPDX-License-Identifier: MIT

pragma solidity ^ 0.8.2;

import "../node_modules/@openzeppelin/contracts/access/Ownable.sol";
import "../node_modules/@openzeppelin/contracts/token/ERC20/IERC20.sol";



contract joinCommunity is Ownable{

IERC20 Token;
IERC20 cUSDToken;
address payable myaddress = payable(0xC877733b142f44AF7e2FA8d29A7065e56FF851fa);
mapping(address => bool) public join;
uint256 public amount =10;
address internal cUsdTokenAddress = 0x874069Fa1Eb16D44d622F2e0Ca25eeA172369bC1;
constructor(){
cUSDToken = IERC20(cUsdTokenAddress);
}
/*
* @ dev Activate function to cast the rehema tokens to The IERC20

*/
function activate(address _rehemaToken )public onlyOwner{
Token = IERC20(_rehemaToken);
}
function joinCommunityy() public{
require(join[msg.sender] !=true,"already a member");



Token.transfer(msg.sender,amount);
join[msg.sender] =true;

}
/*
* @dev : getrehema balance of a member
*/
function getBalanceofMember()public view returns(uint){
return Token.balanceOf(msg.sender);
}
function shareRehemaTokens(address payable _receiver,uint _amount) public payable{
require(Token.balanceOf(msg.sender) >= _amount,"You have less rehema tokens please top up");
Token.transfer(_receiver,amount);
}

/*
*@dev buy rehema tokens for cUsd
*/
function buyRehemaTokensForcUSD(uint256 _amount)public payable {
require(cUSDToken.balanceOf(msg.sender) >= _amount,"low balance");

require(cUSDToken.approve(address(this),_amount));

require(
cUSDToken.transferFrom(
msg.sender,
address(this),
_amount
),
"Transefer Failed"
);
Token.transfer(msg.sender,_amount *10);
}
/*
*@dev but for ethereum*/
function buyRehemaTokenForETH(uint256 _amount)public payable{
require( msg.sender.balance >= _amount,"Less amount in the account");
payable(address(this)).transfer(_amount);
Token.transfer(msg.sender,_amount*10);

}
function balances()public view onlyOwner returns(uint){
return cUSDToken.balanceOf(address(this));

}
function balancesthis()public view onlyOwner returns(uint){
return address(this).balance;

}

receive() external payable {}
fallback() external payable{}

}
21 changes: 21 additions & 0 deletions BACKENDHARDHAT/contracts/rehemaTokens.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
// SPDX-License-Identifier: MIT

pragma solidity ^ 0.8.2;
import "../node_modules/@openzeppelin/contracts/access/Ownable.sol";
import "../node_modules/@openzeppelin/contracts/token/ERC20/ERC20.sol";
contract RehemaToken is ERC20 ,Ownable{


constructor() ERC20("Rehema","RH"){


}
function mintToken(uint _rehemaTokens,address _joincommu) public onlyOwner {
_mint(_joincommu,10**18*_rehemaTokens);
}





}
Loading