Address Contract Verified
Address
0x0B987a3F6708B371e2Cff3C011F44d685ca66253
Balance
0 ETH
Nonce
1
Code Size
6044 bytes
Creator
0xc27c70F5...d059 at tx 0x2b5e1e5f...2fcfdd
Indexed Transactions
0
Contract Bytecode
6044 bytes
0x60806040526004361061007e575f3560e01c8063a0d597871161004d578063a0d597871461012b578063b83a3bc114610155578063dc2f87441461017d578063e2c41dbc146101bd57610085565b80632e1a7d4d1461008957806343ff7efd146100b15780637b6cc582146100d95780638da5cb5b1461010157610085565b3661008557005b5f80fd5b348015610094575f80fd5b506100af60048036038101906100aa9190610bb5565b6101c7565b005b3480156100bc575f80fd5b506100d760048036038101906100d29190610bb5565b610363565b005b3480156100e4575f80fd5b506100ff60048036038101906100fa9190610bb5565b610672565b005b34801561010c575f80fd5b506101156107a8565b6040516101229190610c1f565b60405180910390f35b348015610136575f80fd5b5061013f6107cb565b60405161014c9190610c47565b60405180910390f35b348015610160575f80fd5b5061017b60048036038101906101769190610d9c565b6107d1565b005b348015610188575f80fd5b506101a3600480360381019061019e9190610bb5565b6109fe565b6040516101b4959493929190610ee9565b60405180910390f35b6101c5610ae2565b005b5f8054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610254576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161024b90610fb1565b60405180910390fd5b80471015610297576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161028e9061103f565b60405180910390fd5b5f805f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16826040516102dc9061108a565b5f6040518083038185875af1925050503d805f8114610316576040519150601f19603f3d011682016040523d82523d5f602084013e61031b565b606091505b505090508061035f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610356906110e8565b60405180910390fd5b5050565b5f8054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146103f0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016103e790610fb1565b60405180910390fd5b5f60025f8381526020019081526020015f2090506001600381111561041857610417610e56565b5b816003015f9054906101000a900460ff16600381111561043b5761043a610e56565b5b1461047b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161047290611176565b60405180910390fd5b6002816003015f6101000a81548160ff021916908360038111156104a2576104a1610e56565b5b02179055505f816002015490505f82600201819055506003826003015f6101000a81548160ff021916908360038111156104df576104de610e56565b5b02179055505f8260030160019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168260405161052d9061108a565b5f6040518083038185875af1925050503d805f8114610567576040519150601f19603f3d011682016040523d82523d5f602084013e61056c565b606091505b50509050806105b0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105a7906111de565b60405180910390fd5b7f39676dec943117d401118d65306f1ec79c9fc6a9df6df3a832e6fe531e7badd0848460030160019054906101000a900473ffffffffffffffffffffffffffffffffffffffff16604051610605929190611257565b60405180910390a17f04492fab062412e7e4e5f46c9e919f1640652946a5e163ad6e6c1c03d87954d2848460030160019054906101000a900473ffffffffffffffffffffffffffffffffffffffff16846040516106649392919061127e565b60405180910390a150505050565b5f60025f8381526020019081526020015f2090505f600381111561069957610698610e56565b5b816003015f9054906101000a900460ff1660038111156106bc576106bb610e56565b5b146106fc576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106f390611323565b60405180910390fd5b338160030160016101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506001816003015f6101000a81548160ff0219169083600381111561076657610765610e56565b5b02179055507f52ef3e7b5eb8d090bcafe10d1fed9a621a0d497e0dd075627f037427e5f41bf0823360405161079c929190611341565b60405180910390a15050565b5f8054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60015481565b5f8054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461085e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161085590610fb1565b60405180910390fd5b804710156108a1576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610898906113d8565b60405180910390fd5b60015f8154809291906108b390611423565b91905055506040518060a0016040528060015481526020018381526020018281526020015f60038111156108ea576108e9610e56565b5b81526020015f73ffffffffffffffffffffffffffffffffffffffff1681525060025f60015481526020019081526020015f205f820151815f01556020820151816001019081610939919061165b565b50604082015181600201556060820151816003015f6101000a81548160ff0219169083600381111561096e5761096d610e56565b5b021790555060808201518160030160016101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055509050507f4b4f8d3c427c31f6a1e8a518678f20d88e304da4d4fa251c3f4ac58edd0de7fa60015483836040516109f29392919061172a565b60405180910390a15050565b6002602052805f5260405f205f91509050805f015490806001018054610a2390611497565b80601f0160208091040260200160405190810160405280929190818152602001828054610a4f90611497565b8015610a9a5780601f10610a7157610100808354040283529160200191610a9a565b820191905f5260205f20905b815481529060010190602001808311610a7d57829003601f168201915b505050505090806002015490806003015f9054906101000a900460ff16908060030160019054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905085565b5f8054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610b6f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b6690610fb1565b60405180910390fd5b565b5f604051905090565b5f80fd5b5f80fd5b5f819050919050565b610b9481610b82565b8114610b9e575f80fd5b50565b5f81359050610baf81610b8b565b92915050565b5f60208284031215610bca57610bc9610b7a565b5b5f610bd784828501610ba1565b91505092915050565b5f73ffffffffffffffffffffffffffffffffffffffff82169050919050565b5f610c0982610be0565b9050919050565b610c1981610bff565b82525050565b5f602082019050610c325f830184610c10565b92915050565b610c4181610b82565b82525050565b5f602082019050610c5a5f830184610c38565b92915050565b5f80fd5b5f80fd5b5f601f19601f8301169050919050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52604160045260245ffd5b610cae82610c68565b810181811067ffffffffffffffff82111715610ccd57610ccc610c78565b5b80604052505050565b5f610cdf610b71565b9050610ceb8282610ca5565b919050565b5f67ffffffffffffffff821115610d0a57610d09610c78565b5b610d1382610c68565b9050602081019050919050565b828183375f83830152505050565b5f610d40610d3b84610cf0565b610cd6565b905082815260208101848484011115610d5c57610d5b610c64565b5b610d67848285610d20565b509392505050565b5f82601f830112610d8357610d82610c60565b5b8135610d93848260208601610d2e565b91505092915050565b5f8060408385031215610db257610db1610b7a565b5b5f83013567ffffffffffffffff811115610dcf57610dce610b7e565b5b610ddb85828601610d6f565b9250506020610dec85828601610ba1565b9150509250929050565b5f81519050919050565b5f82825260208201905092915050565b8281835e5f83830152505050565b5f610e2882610df6565b610e328185610e00565b9350610e42818560208601610e10565b610e4b81610c68565b840191505092915050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52602160045260245ffd5b60048110610e9457610e93610e56565b5b50565b5f819050610ea482610e83565b919050565b5f610eb382610e97565b9050919050565b610ec381610ea9565b82525050565b5f610ed382610be0565b9050919050565b610ee381610ec9565b82525050565b5f60a082019050610efc5f830188610c38565b8181036020830152610f0e8187610e1e565b9050610f1d6040830186610c38565b610f2a6060830185610eba565b610f376080830184610eda565b9695505050505050565b7f4f6e6c79206f776e65722063616e20706572666f726d207468697320616374695f8201527f6f6e2e0000000000000000000000000000000000000000000000000000000000602082015250565b5f610f9b602383610e00565b9150610fa682610f41565b604082019050919050565b5f6020820190508181035f830152610fc881610f8f565b9050919050565b7f496e73756666696369656e742066756e647320666f72207769746864726177615f8201527f6c2e000000000000000000000000000000000000000000000000000000000000602082015250565b5f611029602283610e00565b915061103482610fcf565b604082019050919050565b5f6020820190508181035f8301526110568161101d565b9050919050565b5f81905092915050565b50565b5f6110755f8361105d565b915061108082611067565b5f82019050919050565b5f6110948261106a565b9150819050919050565b7f5769746864726177616c206661696c65642e00000000000000000000000000005f82015250565b5f6110d2601283610e00565b91506110dd8261109e565b602082019050919050565b5f6020820190508181035f8301526110ff816110c6565b9050919050565b7f426f756e7479206d757374206265207375626d6974746564206265666f7265205f8201527f766572696669636174696f6e2e00000000000000000000000000000000000000602082015250565b5f611160602d83610e00565b915061116b82611106565b604082019050919050565b5f6020820190508181035f83015261118d81611154565b9050919050565b7f526577617264207472616e73666572206661696c65642e0000000000000000005f82015250565b5f6111c8601783610e00565b91506111d382611194565b602082019050919050565b5f6020820190508181035f8301526111f5816111bc565b9050919050565b5f819050919050565b5f61121f61121a61121584610be0565b6111fc565b610be0565b9050919050565b5f61123082611205565b9050919050565b5f61124182611226565b9050919050565b61125181611237565b82525050565b5f60408201905061126a5f830185610c38565b6112776020830184611248565b9392505050565b5f6060820190506112915f830186610c38565b61129e6020830185611248565b6112ab6040830184610c38565b949350505050565b7f426f756e7479206973206e6f74206f70656e20666f72207375626d697373696f5f8201527f6e2e000000000000000000000000000000000000000000000000000000000000602082015250565b5f61130d602283610e00565b9150611318826112b3565b604082019050919050565b5f6020820190508181035f83015261133a81611301565b9050919050565b5f6040820190506113545f830185610c38565b6113616020830184610c10565b9392505050565b7f496e73756666696369656e742066756e647320696e2074686520636f6e7472615f8201527f637420746f20636f76657220746865207265776172642e000000000000000000602082015250565b5f6113c2603783610e00565b91506113cd82611368565b604082019050919050565b5f6020820190508181035f8301526113ef816113b6565b9050919050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52601160045260245ffd5b5f61142d82610b82565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff820361145f5761145e6113f6565b5b600182019050919050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52602260045260245ffd5b5f60028204905060018216806114ae57607f821691505b6020821081036114c1576114c061146a565b5b50919050565b5f819050815f5260205f209050919050565b5f6020601f8301049050919050565b5f82821b905092915050565b5f600883026115237fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff826114e8565b61152d86836114e8565b95508019841693508086168417925050509392505050565b5f61155f61155a61155584610b82565b6111fc565b610b82565b9050919050565b5f819050919050565b61157883611545565b61158c61158482611566565b8484546114f4565b825550505050565b5f90565b6115a0611594565b6115ab81848461156f565b505050565b5b818110156115ce576115c35f82611598565b6001810190506115b1565b5050565b601f821115611613576115e4816114c7565b6115ed846114d9565b810160208510156115fc578190505b611610611608856114d9565b8301826115b0565b50505b505050565b5f82821c905092915050565b5f6116335f1984600802611618565b1980831691505092915050565b5f61164b8383611624565b9150826002028217905092915050565b61166482610df6565b67ffffffffffffffff81111561167d5761167c610c78565b5b6116878254611497565b6116928282856115d2565b5f60209050601f8311600181146116c3575f84156116b1578287015190505b6116bb8582611640565b865550611722565b601f1984166116d1866114c7565b5f5b828110156116f8578489015182556001820191506020850194506020810190506116d3565b868310156117155784890151611711601f891682611624565b8355505b6001600288020188555050505b505050505050565b5f60608201905061173d5f830186610c38565b818103602083015261174f8185610e1e565b905061175e6040830184610c38565b94935050505056fea26469706673582212207c2bc23b61a852c8e04d095fda07990e76c13e1db0a5e43f8407e977d208665d64736f6c634300081a0033
Verified Source Code Full Match
Compiler: v0.8.26+commit.8a97fa7a
EVM: cancun
Optimization: No
MicroBounty.sol 102 lines
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
contract MicroBounty {
address public owner;
uint public bountyCounter;
// Bounty status enum
enum BountyStatus { Open, Submitted, Verified, Paid }
// Bounty structure to keep track of each bounty details
struct Bounty {
uint id;
string description;
uint reward;
BountyStatus status;
address payable contributor;
}
// Mapping to store bounties by a unique bounty ID
mapping(uint => Bounty) public bounties;
// Events for logging activity
event BountyCreated(uint id, string description, uint reward);
event SubmissionMade(uint id, address contributor);
event BountyVerified(uint id, address contributor);
event RewardPaid(uint id, address contributor, uint reward);
// Modifier to restrict functions to the contract owner only
modifier onlyOwner() {
require(msg.sender == owner, "Only owner can perform this action.");
_;
}
// Constructor sets the owner of the contract
constructor() {
owner = msg.sender;
bountyCounter = 0;
}
/// @notice Creates a new bounty task. The bounty reward must be backed by funds in the contract.
/// @param _description A short description of the task or bug to be reported.
/// @param _reward The reward amount in wei for completing the task.
function createBounty(string memory _description, uint _reward) public onlyOwner {
require(address(this).balance >= _reward, "Insufficient funds in the contract to cover the reward.");
bountyCounter++;
bounties[bountyCounter] = Bounty({
id: bountyCounter,
description: _description,
reward: _reward,
status: BountyStatus.Open,
contributor: payable(address(0))
});
emit BountyCreated(bountyCounter, _description, _reward);
}
/// @notice Allows a contributor to submit their work for an open bounty.
/// @param _bountyId The unique identifier of the bounty.
function submitBounty(uint _bountyId) public {
Bounty storage bounty = bounties[_bountyId];
require(bounty.status == BountyStatus.Open, "Bounty is not open for submission.");
bounty.contributor = payable(msg.sender);
bounty.status = BountyStatus.Submitted;
emit SubmissionMade(_bountyId, msg.sender);
}
/// @notice Verifies the submitted work and automatically pays the contributor.
/// This function can only be executed by the contract owner.
/// @param _bountyId The unique identifier of the bounty being verified.
function verifyAndReward(uint _bountyId) public onlyOwner {
Bounty storage bounty = bounties[_bountyId];
require(bounty.status == BountyStatus.Submitted, "Bounty must be submitted before verification.");
// Mark bounty as verified (if needed, you can add additional verification checks here)
bounty.status = BountyStatus.Verified;
// Transfer the reward automatically to the contributor
uint rewardAmount = bounty.reward;
bounty.reward = 0; // Prevent re-entrancy by zeroing out the reward first
bounty.status = BountyStatus.Paid;
(bool success, ) = bounty.contributor.call{value: rewardAmount}("");
require(success, "Reward transfer failed.");
emit BountyVerified(_bountyId, bounty.contributor);
emit RewardPaid(_bountyId, bounty.contributor, rewardAmount);
}
/// @notice Deposits funds into the contract.
function depositFunds() public payable onlyOwner {}
/// @notice Allows the owner to withdraw funds from the contract.
/// @param _amount The amount to withdraw in wei.
function withdraw(uint _amount) public onlyOwner {
require(address(this).balance >= _amount, "Insufficient funds for withdrawal.");
(bool success, ) = payable(owner).call{value: _amount}("");
require(success, "Withdrawal failed.");
}
/// @notice Fallback function to receive Ether directly.
receive() external payable {}
}
Read Contract
bounties 0xdc2f8744 → uint256, string, uint256, uint8, address
bountyCounter 0xa0d59787 → uint256
owner 0x8da5cb5b → address
Write Contract 5 functions
These functions modify contract state and require a wallet transaction to execute.
createBounty 0xb83a3bc1
string _description
uint256 _reward
depositFunds 0xe2c41dbc
No parameters
submitBounty 0x7b6cc582
uint256 _bountyId
verifyAndReward 0x43ff7efd
uint256 _bountyId
withdraw 0x2e1a7d4d
uint256 _amount
Recent Transactions
No transactions found for this address