Revolutionize Your Business with Xamer's Smart Audit Services
On-chain smart contract security monitoring
AlgoFund is creating fair decentralized launches where investors get to choose between a lottery tier or a guaranteed allocation tier. It also provides a fair presale offering on behalf of the startups and attracts investors that will support their vision
Audits
Onboarded Date
14/Dec/2022
Contracts
46355...54836
Website
We talked about a project on linkedin.
Create new project Buildng product
Adding a new event with attachments
added a new member to velzon dashboard
These customers can rest assured their order has been placed.
They all have something to say beyond the words on the page. They can come across as casual or neutral, exotic or graphic.
2 days left notification to submit the monthly sales report. Reports Builder
User Erica245 submitted a ticket.
Team Leader & HR
Projects
Tasks
Full Stack Developer
Project Manager
UI/UX Designer
Team Leader & Web Developer
Backend Developer
Front-End Developer
Web Designer
Wed Developer
Showing 1 to 10 of 12 entries
All Findings
Acknowledge
Partially
Resolved
463554836...54836
Token Standard
Functions
Verified Contract
// SPDX-License-Identifier: MITpragma solidity ^0.8.0;contract AlgoFund { address public owner; mapping(address => uint256) public contributions; uint256 public totalFunds; uint256 public minContribution; uint256 public deadline; bool public fundingClosed; event ContributionMade(address indexed contributor, uint256 amount); event FundingClosed(uint256 totalFunds); modifier onlyOwner() { require(msg.sender == owner, "Only the owner can call this function"); _; } modifier onlyBeforeDeadline() { require(block.timestamp < deadline, "Funding deadline has passed"); _; } modifier onlyAfterDeadline() { require(block.timestamp >= deadline, "Funding deadline has not passed"); _; } modifier notClosed() { require(!fundingClosed, "Funding is closed"); _; } constructor(uint256 _minContribution, uint256 _durationInDays) { owner = msg.sender; minContribution = _minContribution; deadline = block.timestamp + (_durationInDays * 1 days); } function contribute() external payable onlyBeforeDeadline notClosed { require(msg.value >= minContribution, "Contribution amount is below the minimum"); contributions[msg.sender] += msg.value; totalFunds += msg.value; emit ContributionMade(msg.sender, msg.value); } function closeFunding() external onlyOwner onlyAfterDeadline notClosed { fundingClosed = true; emit FundingClosed(totalFunds); } function withdrawFunds() external onlyOwner onlyAfterDeadline notClosed { payable(owner).transfer(address(this).balance); fundingClosed = true; emit FundingClosed(totalFunds); }}
The AlgoFund smart contract is a crowdfunding mechanism implemented in Solidity for blockchain platforms like Ethereum. It features an owner-managed fund pool where contributors can participate by sending funds before a specified deadline. The contract maintains a record of individual contributions, the total funds collected, and enforces a minimum contribution amount.
The owner has special privileges, such as the ability to close the funding period and withdraw the accumulated funds after the deadline. The contract employs modifiers to ensure that certain functions are only accessible to the owner, and the events 'ContributionMade' and 'FundingClosed' are emitted to track contributions and the closure of the funding period. This basic structure can be customized and expanded upon to meet specific project requirements.
In the provided Solidity code, the concept of privileged roles is implemented through the use of the `onlyOwner` modifier. The `onlyOwner` modifier restricts certain functions to be callable only by the address that deployed the smart contract, typically referred to as the "owner." Here's a breakdown of the privileged roles in the code:Owner:
Modifiers:
Functions:
By implementing these roles and modifiers, the smart contract ensures that critical functions related to closing the funding and withdrawing funds are restricted to the owner, providing a level of control and security. It's a common practice to use privileged roles to manage access to sensitive functionalities in decentralized applications.
function withdrawFunds() external onlyOwner onlyAfterDeadline notClosed { payable(owner).transfer(address(this).balance); fundingClosed = true; emit FundingClosed(totalFunds); }
Location in code: Inside the withdrawFunds function Line number: 59-63Description: The `transfer` function is used to send funds to the owner, which can be a vulnerability if the owner's address performs an external call. Consider using the `reentrancyGuard` pattern to prevent reentrancy attacks.
modifier onlyOwner() { require(msg.sender == owner, "Only the owner can call this function"); _; }
Location in code: Inside the `modifier onlyOwner()`Line number: 19-22Description: The owner is assumed to be the deployer of the contract. In a more advanced use case, consider implementing a proper access control mechanism using roles.
function contribute() external payable onlyBeforeDeadline notClosed { require(msg.value >= minContribution, "Contribution amount is below the minimum"); contributions[msg.sender] += msg.value; totalFunds += msg.value; emit ContributionMade(msg.sender, msg.value); }
Location in code: Inside the contribute function Line number: 45-52Description: While there is a check for the minimum contribution, additional input validation may be needed to ensure the correctness of contributed amounts.
function closeFunding() external onlyOwner onlyAfterDeadline notClosed { fundingClosed = true; emit FundingClosed(totalFunds); }
Code Reference: Inside the closeFunding function Line number: 54-57Description: It may be beneficial to emit an event when closing funding to provide transparency and traceability.
modifier onlyAfterDeadline() { require(block.timestamp >= deadline, "Funding deadline has not passed"); _; }
Location in code: Inside the onlyAfterDeadline() ModifierLine number: 29-32Description: The modifier onlyAfterDeadline() relies on block timestamps, which may be manipulated by miners. Consider using alternative methods, such as a block number comparison, for more secure time-dependent conditions.
Our industry-leading audit methodology and tooling includes a review of your code’s logic, with a mathematical approach to ensure your program works as intended.