Sepolia Testnet

Contract

0xb658FB9c330381a059e8A14363F71fb7D4648f2A
Source Code

Overview

ETH Balance

0.003 ETH

Token Holdings

Multichain Info

N/A
Transaction Hash
Method
Block
From
To
Value
Donate48801962023-12-13 18:18:1275 days 20 hrs ago1702491492IN
0xb658FB...D4648f2A
0.001 ETH0.000044332.08880135
Donate46868152023-11-13 16:47:48105 days 21 hrs ago1699894068IN
0xb658FB...D4648f2A
0.001 ETH0.000048972.30722824
Donate35581172023-05-25 19:08:00277 days 19 hrs ago1685041680IN
0xb658FB...D4648f2A
0.001 ETH0.000021221
0x6080604035580242023-05-25 18:47:24277 days 19 hrs ago1685040444IN
 Create: Donations
0 ETH0.000878092.5

Advanced mode:
Parent Txn Hash Block From To Value
View All Internal Transactions
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
Donations

Compiler Version
v0.8.20+commit.a1b79de6

Optimization Enabled:
No with 200 runs

Other Settings:
default evmVersion, MIT license
/**
 *Submitted for verification at Etherscan.io on 2023-05-25
*/

// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

contract Donations {
  address public owner;

  constructor() {
    owner = msg.sender;
  }

  // Function to donate
  function donate() public payable {
    require(msg.value > 0, "Donation needs to be a positive value");
  }

  // Withdraw ether
  function withdraw() public payable {
    require(msg.sender == owner, "Only the owner can withdraw!");

    uint balance = address(this).balance;
    require(balance > 0, "No ether left to withdraw");

    (bool success, ) = (msg.sender).call{value: balance}("");
    require(success, "Transfer failed.");
  }
}

Contract ABI

[{"inputs":[],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"donate","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"withdraw","outputs":[],"stateMutability":"payable","type":"function"}]

608060405234801561000f575f80fd5b50335f806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506105008061005c5f395ff3fe608060405260043610610033575f3560e01c80633ccfd60b146100375780638da5cb5b14610041578063ed88c68e1461006b575b5f80fd5b61003f610075565b005b34801561004c575f80fd5b506100556101f4565b604051610062919061029a565b60405180910390f35b610073610217565b005b5f8054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610102576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016100f99061030d565b60405180910390fd5b5f4790505f8111610148576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161013f90610375565b60405180910390fd5b5f3373ffffffffffffffffffffffffffffffffffffffff168260405161016d906103c0565b5f6040518083038185875af1925050503d805f81146101a7576040519150601f19603f3d011682016040523d82523d5f602084013e6101ac565b606091505b50509050806101f0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016101e79061041e565b60405180910390fd5b5050565b5f8054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b5f3411610259576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610250906104ac565b60405180910390fd5b565b5f73ffffffffffffffffffffffffffffffffffffffff82169050919050565b5f6102848261025b565b9050919050565b6102948161027a565b82525050565b5f6020820190506102ad5f83018461028b565b92915050565b5f82825260208201905092915050565b7f4f6e6c7920746865206f776e65722063616e20776974686472617721000000005f82015250565b5f6102f7601c836102b3565b9150610302826102c3565b602082019050919050565b5f6020820190508181035f830152610324816102eb565b9050919050565b7f4e6f206574686572206c65667420746f207769746864726177000000000000005f82015250565b5f61035f6019836102b3565b915061036a8261032b565b602082019050919050565b5f6020820190508181035f83015261038c81610353565b9050919050565b5f81905092915050565b50565b5f6103ab5f83610393565b91506103b68261039d565b5f82019050919050565b5f6103ca826103a0565b9150819050919050565b7f5472616e73666572206661696c65642e000000000000000000000000000000005f82015250565b5f6104086010836102b3565b9150610413826103d4565b602082019050919050565b5f6020820190508181035f830152610435816103fc565b9050919050565b7f446f6e6174696f6e206e6565647320746f206265206120706f736974697665205f8201527f76616c7565000000000000000000000000000000000000000000000000000000602082015250565b5f6104966025836102b3565b91506104a18261043c565b604082019050919050565b5f6020820190508181035f8301526104c38161048a565b905091905056fea26469706673582212205c8bad9896a6ef00269454cdbad80616580d2e50126f553d478b2c24c9a8a9f364736f6c63430008140033

Deployed Bytecode

0x608060405260043610610033575f3560e01c80633ccfd60b146100375780638da5cb5b14610041578063ed88c68e1461006b575b5f80fd5b61003f610075565b005b34801561004c575f80fd5b506100556101f4565b604051610062919061029a565b60405180910390f35b610073610217565b005b5f8054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610102576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016100f99061030d565b60405180910390fd5b5f4790505f8111610148576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161013f90610375565b60405180910390fd5b5f3373ffffffffffffffffffffffffffffffffffffffff168260405161016d906103c0565b5f6040518083038185875af1925050503d805f81146101a7576040519150601f19603f3d011682016040523d82523d5f602084013e6101ac565b606091505b50509050806101f0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016101e79061041e565b60405180910390fd5b5050565b5f8054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b5f3411610259576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610250906104ac565b60405180910390fd5b565b5f73ffffffffffffffffffffffffffffffffffffffff82169050919050565b5f6102848261025b565b9050919050565b6102948161027a565b82525050565b5f6020820190506102ad5f83018461028b565b92915050565b5f82825260208201905092915050565b7f4f6e6c7920746865206f776e65722063616e20776974686472617721000000005f82015250565b5f6102f7601c836102b3565b9150610302826102c3565b602082019050919050565b5f6020820190508181035f830152610324816102eb565b9050919050565b7f4e6f206574686572206c65667420746f207769746864726177000000000000005f82015250565b5f61035f6019836102b3565b915061036a8261032b565b602082019050919050565b5f6020820190508181035f83015261038c81610353565b9050919050565b5f81905092915050565b50565b5f6103ab5f83610393565b91506103b68261039d565b5f82019050919050565b5f6103ca826103a0565b9150819050919050565b7f5472616e73666572206661696c65642e000000000000000000000000000000005f82015250565b5f6104086010836102b3565b9150610413826103d4565b602082019050919050565b5f6020820190508181035f830152610435816103fc565b9050919050565b7f446f6e6174696f6e206e6565647320746f206265206120706f736974697665205f8201527f76616c7565000000000000000000000000000000000000000000000000000000602082015250565b5f6104966025836102b3565b91506104a18261043c565b604082019050919050565b5f6020820190508181035f8301526104c38161048a565b905091905056fea26469706673582212205c8bad9896a6ef00269454cdbad80616580d2e50126f553d478b2c24c9a8a9f364736f6c63430008140033

Deployed Bytecode Sourcemap

60:583:0:-:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;323:317;;;:::i;:::-;;84:20;;;;;;;;;;;;;:::i;:::-;;;;;;;:::i;:::-;;;;;;;;187:109;;;:::i;:::-;;323:317;387:5;;;;;;;;;;373:19;;:10;:19;;;365:60;;;;;;;;;;;;:::i;:::-;;;;;;;;;434:12;449:21;434:36;;495:1;485:7;:11;477:49;;;;;;;;;;;;:::i;:::-;;;;;;;;;536:12;555:10;554:17;;579:7;554:37;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;535:56;;;606:7;598:36;;;;;;;;;;;;:::i;:::-;;;;;;;;;358:282;;323:317::o;84:20::-;;;;;;;;;;;;:::o;187:109::-;247:1;235:9;:13;227:63;;;;;;;;;;;;:::i;:::-;;;;;;;;;187:109::o;7:126:1:-;44:7;84:42;77:5;73:54;62:65;;7:126;;;:::o;139:96::-;176:7;205:24;223:5;205:24;:::i;:::-;194:35;;139:96;;;:::o;241:118::-;328:24;346:5;328:24;:::i;:::-;323:3;316:37;241:118;;:::o;365:222::-;458:4;496:2;485:9;481:18;473:26;;509:71;577:1;566:9;562:17;553:6;509:71;:::i;:::-;365:222;;;;:::o;593:169::-;677:11;711:6;706:3;699:19;751:4;746:3;742:14;727:29;;593:169;;;;:::o;768:178::-;908:30;904:1;896:6;892:14;885:54;768:178;:::o;952:366::-;1094:3;1115:67;1179:2;1174:3;1115:67;:::i;:::-;1108:74;;1191:93;1280:3;1191:93;:::i;:::-;1309:2;1304:3;1300:12;1293:19;;952:366;;;:::o;1324:419::-;1490:4;1528:2;1517:9;1513:18;1505:26;;1577:9;1571:4;1567:20;1563:1;1552:9;1548:17;1541:47;1605:131;1731:4;1605:131;:::i;:::-;1597:139;;1324:419;;;:::o;1749:175::-;1889:27;1885:1;1877:6;1873:14;1866:51;1749:175;:::o;1930:366::-;2072:3;2093:67;2157:2;2152:3;2093:67;:::i;:::-;2086:74;;2169:93;2258:3;2169:93;:::i;:::-;2287:2;2282:3;2278:12;2271:19;;1930:366;;;:::o;2302:419::-;2468:4;2506:2;2495:9;2491:18;2483:26;;2555:9;2549:4;2545:20;2541:1;2530:9;2526:17;2519:47;2583:131;2709:4;2583:131;:::i;:::-;2575:139;;2302:419;;;:::o;2727:147::-;2828:11;2865:3;2850:18;;2727:147;;;;:::o;2880:114::-;;:::o;3000:398::-;3159:3;3180:83;3261:1;3256:3;3180:83;:::i;:::-;3173:90;;3272:93;3361:3;3272:93;:::i;:::-;3390:1;3385:3;3381:11;3374:18;;3000:398;;;:::o;3404:379::-;3588:3;3610:147;3753:3;3610:147;:::i;:::-;3603:154;;3774:3;3767:10;;3404:379;;;:::o;3789:166::-;3929:18;3925:1;3917:6;3913:14;3906:42;3789:166;:::o;3961:366::-;4103:3;4124:67;4188:2;4183:3;4124:67;:::i;:::-;4117:74;;4200:93;4289:3;4200:93;:::i;:::-;4318:2;4313:3;4309:12;4302:19;;3961:366;;;:::o;4333:419::-;4499:4;4537:2;4526:9;4522:18;4514:26;;4586:9;4580:4;4576:20;4572:1;4561:9;4557:17;4550:47;4614:131;4740:4;4614:131;:::i;:::-;4606:139;;4333:419;;;:::o;4758:224::-;4898:34;4894:1;4886:6;4882:14;4875:58;4967:7;4962:2;4954:6;4950:15;4943:32;4758:224;:::o;4988:366::-;5130:3;5151:67;5215:2;5210:3;5151:67;:::i;:::-;5144:74;;5227:93;5316:3;5227:93;:::i;:::-;5345:2;5340:3;5336:12;5329:19;;4988:366;;;:::o;5360:419::-;5526:4;5564:2;5553:9;5549:18;5541:26;;5613:9;5607:4;5603:20;5599:1;5588:9;5584:17;5577:47;5641:131;5767:4;5641:131;:::i;:::-;5633:139;;5360:419;;;:::o

Swarm Source

ipfs://5c8bad9896a6ef00269454cdbad80616580d2e50126f553d478b2c24c9a8a9f3

Block Transaction Difficulty Gas Used Reward
View All Blocks Produced

Block Uncle Number Difficulty Gas Used Reward
View All Uncles
Loading...
Loading

Validator Index Block Amount
View All Withdrawals

Txn Hash Block Value Eth2 PubKey Valid
View All Deposits
[ Download: CSV Export  ]

A contract address hosts a smart contract, which is a set of code stored on the blockchain that runs when predetermined conditions are met. Learn more about addresses in our Knowledge Base.