We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
WithrawDAoReward()
import "contracts/Daomember.sol"; // reward money of DAO uint256 public DAOMoney;
import "contracts/Daomember.sol";
uint256 public DAOMoney;
// DAOMember contract address DAOMember dAOMember;
DAOMember dAOMember;
// contract address of DAOMember contract
constructor(uint256 _enteranceFee, uint256 _daoPercentage , DAOMember DAOMemberCOntractAdd) { dAOMember=DAOMember(DAOMemberCOntractAdd); lastTimeStamp = block.timestamp; daoPercentage = _daoPercentage; enteranceFee = _enteranceFee; }
// transfer all reward money after successfull funding of project to DAOMember contract
function WithrawDAoReward() internal onlyOwner{ require(DAOMoney>0); (bool success,)=payable(dAOMember).call{value:DAOMoney}(""); require(success,"tansfer failed"); }
function performUpkeep(bytes calldata performData) external override { (bool upkeepNeeded, ) = checkUpkeep(""); if (!upkeepNeeded) { revert FundProject__UpkeepNeeded(); }
uint256 ProjectId = uint256(bytes32(performData)); _isFunding[ProjectId] = false; _isApporovedByDao[ProjectId] = false; if (projectFunds[ProjectId] > projectFundingGoalAmount[ProjectId]) { _ProjectFundingStatus[ProjectId] = ProjectFundingStatus.SUCCESS; uint256 fundsToSent = (projectFunds[ProjectId] * (100 - daoPercentage)) / 100;
DAOMoney+=projectFunds[ProjectId]-fundsToSent; projectFunds[ProjectId] = 0;
DAOMoney+=projectFunds[ProjectId]-fundsToSent;
projectFunds[ProjectId] = 0;
(bool success, ) = (projectOwnerAddress[ProjectId]).call{ value: fundsToSent }(""); if (!success) { revert FundProject__TransferFailed(projectFunds[ProjectId]); } emit projectSuccessfullyFunded(ProjectId); } else { _ProjectFundingStatus[ProjectId] = ProjectFundingStatus.FAILED; emit projectFundingFailed(ProjectId); } }
The text was updated successfully, but these errors were encountered:
AnandK-2024
No branches or pull requests
import "contracts/Daomember.sol";
// reward money of DAO
uint256 public DAOMoney;
// DAOMember contract address
DAOMember dAOMember;
// contract address of DAOMember contract
// transfer all reward money after successfull funding of project to DAOMember contract
update performUpkeep function
function performUpkeep(bytes calldata performData) external override {
(bool upkeepNeeded, ) = checkUpkeep("");
if (!upkeepNeeded) {
revert FundProject__UpkeepNeeded();
}
DAOMoney+=projectFunds[ProjectId]-fundsToSent;
projectFunds[ProjectId] = 0;
The text was updated successfully, but these errors were encountered: