CARVIEW |
Select Language
HTTP/2 200
date: Sat, 11 Oct 2025 18:10:22 GMT
content-type: text/html; charset=UTF-8
server: cloudflare
x-frame-options: DENY
x-content-type-options: nosniff
x-xss-protection: 1;mode=block
vary: accept-encoding
cf-cache-status: DYNAMIC
content-encoding: gzip
set-cookie: _csrf-frontend=7cf0de409c7dd23cb8058c7a44f77428fb6ba1d5de77881101bd9a4c7848c1e8a%3A2%3A%7Bi%3A0%3Bs%3A14%3A%22_csrf-frontend%22%3Bi%3A1%3Bs%3A32%3A%22RbfHZD2bSaAVOKChRe3UNcaSP_EtUAji%22%3B%7D; HttpOnly; Path=/
cf-ray: 98d05059a990c1b5-BLR
solidity// SPDX-License-Identifier: MITpragma solidity 0.8.27;contract K - Pastebin.com
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- solidity
- // SPDX-License-Identifier: MIT
- pragma solidity 0.8.27;
- contract KonohaFund {
- address public owner;
- uint public goal;
- uint public deadline;
- uint public totalRaised;
- bool public goalReached;
- bool public campaignEnded;
- mapping(address => uint) public contributions;
- event FundContributed(address contributor, uint amount);
- event FundRefunded(address contributor, uint amount);
- event CampaignEnded(address owner, bool goalReached);
- constructor(uint _time, uint _goal) {
- owner = msg.sender;
- goal = _goal;
- deadline = block.timestamp + _time;
- }
- modifier onlyOwner() {
- require(msg.sender == owner, "only owner can call this function");
- _;
- }
- function contribute() public payable {
- require(!campaignEnded, "Campaign has ended");
- require(msg.value > 0, "Send more than 0 eth");
- uint checkRaise = totalRaised + msg.value;
- require(checkRaise <= goal, "amount more than remaining goal");
- totalRaised += msg.value;
- contributions[msg.sender] += msg.value;
- if (totalRaised == goal) {
- goalReached = true;
- campaignEnded = true;
- emit CampaignEnded(owner, true);
- }
- emit FundContributed(msg.sender, msg.value);
- }
- function withdraw() public onlyOwner {
- require(campaignEnded, "Campaign has not ended");
- require(goalReached, "Goal not yet reached");
- uint amount = address(this).balance;
- payable(owner).transfer(amount);
- }
- function refund() public {
- require(campaignEnded && !goalReached, "Campaign has not ended or goal met");
- require(contributions[msg.sender] > 0, "No contributions to refund");
- uint refundAmount = contributions[msg.sender];
- contributions[msg.sender] = 0;
- payable(msg.sender).transfer(refundAmount);
- emit FundRefunded(msg.sender, refundAmount);
- }
- function timeLeft() public view returns (uint) {
- if (block.timestamp >= deadline) {
- return 0;
- } else {
- return deadline - block.timestamp;
- }
- }
- function checkRemainingGoal() public view returns (uint) {
- if (totalRaised == goal) {
- return 0;
- } else {
- return goal - totalRaised;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
-
Free Crypto Method (NEVER SEEN BEFORE)⭐⭐ J
JavaScript | 3 sec ago | 0.24 KB
-
✅⭐ Make huge profits on trading ⭐⭐ W
JavaScript | 5 sec ago | 0.24 KB
-
⭐⭐⭐ G2A Payment Exploit ✅ NEVER SEEN BEFORE ⭐...
JavaScript | 6 sec ago | 0.24 KB
-
⭐✅ Marketplace Glitch ✅ Working ✅ NEVER SEEN...
JavaScript | 14 sec ago | 0.24 KB
-
⭐✅ MAKE $2500 IN 15 MIN ✅ NEVER SEEN BEFORE ⭐...
JavaScript | 22 sec ago | 0.24 KB
-
⭐✅ Exploit 2500$ in 15 Minutes⭐⭐⭐ 9
JavaScript | 23 sec ago | 0.24 KB
-
Curseforge Rarity Get Mod Response
JSON | 29 sec ago | 57.38 KB
-
⭐ ✅ Free Products Method ✅ ✅ NEVER SEEN BEFOR...
JavaScript | 31 sec ago | 0.24 KB
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand